daily.vue 459 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746
  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. <!--针对景昱-->
  22. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  23. <i class="el-icon-warning" style="color:red;"></i>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </span>
  28. </div>
  29. </div>
  30. <div style="display:flex;">
  31. <div class="grand flex">
  32. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  34. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  35. </div> -->
  36. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  37. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  38. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  39. </el-input>
  40. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  41. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  42. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  43. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  44. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  45. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  46. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  47. </el-select>
  48. </div>
  49. <div>
  50. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  51. <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">
  52. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  53. <!-- <span>{{ node.label }}</span> -->
  54. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  55. <span v-if="user.userNameNeedTranslate == '1'">
  56. <span v-if="node.data.children">
  57. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  58. </span>
  59. <span v-else>
  60. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  61. </span>
  62. </span>
  63. <span v-if="user.userNameNeedTranslate != '1'">
  64. {{ node.label }}
  65. </span>
  66. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  67. </span>
  68. <div style="position: absolute;right: 15px;">
  69. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  70. <!-- 未填报 -->
  71. {{$t('state.DidNotFillIn')}}
  72. </span>
  73. <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'">
  74. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  75. {{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)')}}
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  78. <!-- 待审核 -->
  79. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  82. <!-- 已通过 -->
  83. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  86. <!-- 未通过 -->
  87. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  90. <!-- 待提交 -->
  91. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  92. </span>
  93. </div>
  94. </span>
  95. </el-tree>
  96. </div>
  97. </div>
  98. </div>
  99. <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">
  100. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  101. -
  102. -
  103. -
  104. </div>
  105. </div>
  106. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  107. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  108. <div class="allDaily" style="float:left;flex-grow:1">
  109. <!--系统管理员和部门负责人 -->
  110. <div class="report_title" style="display:flex;justify-content: space-between;">
  111. <span>
  112. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  113. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  114. <!-- {{depData != null ?depData.label:""}} -->
  115. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  117. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  118. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  119. <span v-if="targetUid == null">
  120. <!-- - 已提交 -->
  121. -{{$t('state.hasBeenSubmitted')}}
  122. <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')}},
  123. <!-- 待提交 -->
  124. {{$t('state.waitingsubmit')}}
  125. <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')}},
  126. <!-- 漏填 -->
  127. <!-- {{$t('state.missFillReport')}} -->
  128. 未填
  129. <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')}}
  130. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  131. </span>
  132. </span>
  133. </span>
  134. <span style="float:right;">
  135. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  136. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  137. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  138. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  139. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <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>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  147. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  148. </span>
  149. </div>
  150. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  151. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  152. <i class="fa fa-circle"></i>
  153. <!-- {{item1.name}} -->
  154. <span v-if="user.userNameNeedTranslate == '1'">
  155. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  156. </span>
  157. <span v-if="user.userNameNeedTranslate != '1'">
  158. {{item1.name}}
  159. </span>
  160. <span style="margin-left:30px;">
  161. <span style="margin-right:20px;">
  162. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  163. <!-- 工作总时长: -->
  164. {{$t('other.totalWorkingHours')}}
  165. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  166. <span >{{item1.reportTime | amounts}}</span>h
  167. </span>
  168. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  169. <i class="iconfont firerock-iconliucheng1"></i>
  170. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  171. <!-- 审批流程 -->
  172. {{$t('other.approvalProcess')}}
  173. </span>
  174. </span>
  175. </span>
  176. <div class="checkbtn" style="padding-right:20px;">
  177. <!--编辑和删除日报-->
  178. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  179. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  180. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  181. </div>
  182. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  183. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  184. </div>
  185. <div class="one_daily_body">
  186. <el-timeline>
  187. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  188. <el-card shadow="never">
  189. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  190. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  191. <span v-if="user.company.packageEngineering == 0">
  192. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  193. <span v-if="item2.isDeptAudit==0">
  194. <span v-if="item2.projectAuditState==0">
  195. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  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('other.audit')}}
  204. </span>
  205. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  206. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  207. <span v-if="item2.projectAuditorName != null">(
  208. <!-- {{item2.projectAuditorName}} -->
  209. <span v-if="user.userNameNeedTranslate == '1'">
  210. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  211. </span>
  212. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  213. )</span>
  214. <!-- 审核通过 --> {{$t('state.approved')}}
  215. </span>
  216. </span>
  217. <span v-else-if="item2.isDeptAudit==1">
  218. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  219. ({{$t('other.await')}}
  220. <span v-if="user.userNameNeedTranslate == '1'">
  221. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  222. </span>
  223. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  224. {{$t('other.audit')}})
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <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> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  246. </span>
  247. )
  248. </span>{{$t('other.audit')}} ]</span>
  249. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  252. </span>
  253. <!--每个项目上单独审核 -->
  254. <span style="float:right;">
  255. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  256. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  257. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  258. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  259. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  260. <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"
  261. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  262. <!--自己可以撤回待审核状态的报告 -->
  263. <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>
  264. </span>
  265. </p>
  266. <p v-if="user.companyId == yuzhongCompId">
  267. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  268. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  269. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  270. <!--任务分组和阶段 -->
  271. <p v-if="item2.groupId != 0">
  272. {{$t('other.taskGroup')}}:{{item2.groupName}}
  273. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  274. </p>
  275. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  276. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  277. <!-- 自定义日报文本 -->
  278. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  279. <p v-if="user.company.packageEngineering == 1">
  280. {{$t('other.professionalProgress')}}:
  281. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  282. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  283. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  284. </el-tooltip>
  285. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  286. <i class="iconfont firerock-iconshenhetongguo"></i>
  287. </el-tooltip>
  288. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  289. <i class="iconfont firerock-iconshenhebohui"></i>
  290. </el-tooltip>
  291. </span>
  292. </p>
  293. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  294. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  295. </p>
  296. <div v-if="item2.multiWorktime==0">
  297. <p style="display: inline-block;">{{$t('time.duration')}}:
  298. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  299. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  300. {{item2.time.toFixed(1)}}h
  301. <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>
  302. </p>
  303. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  304. </div>
  305. <div v-if="item2.multiWorktime==1" >
  306. <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>
  307. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  308. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  309. <p style="display: inline-block;">{{$t('time.duration')}}:
  310. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  311. {{timeItem.time.toFixed(1)}}h
  312. </p>
  313. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  314. </div>
  315. </div>
  316. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  317. <!--照片的显示 -->
  318. <p v-if="item2.pics != null && item2.pics.length > 0">
  319. <el-image v-for="(pic, index) in item2.pics" :key="index"
  320. style="width: 100px; height: 100px; margin-right:10px;"
  321. :src="pic"
  322. :preview-src-list="item2.pics">
  323. </el-image>
  324. </p>
  325. </el-card>
  326. </el-timeline-item>
  327. </el-timeline>
  328. </div>
  329. </div>
  330. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  331. <!-- 简陋的无报告提示 -->
  332. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </div>
  338. </el-card>
  339. </div>
  340. <!-- 工时推送日志弹窗 -->
  341. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  342. <template>
  343. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  344. </template>
  345. <template>
  346. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  347. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  348. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  349. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  350. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  351. <el-table-column prop="result" label="推送结果" width="250">
  352. <template slot-scope="scope">
  353. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  354. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  355. </template>
  356. </el-table-column>
  357. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  358. </el-table>
  359. </template>
  360. <span slot="footer" class="dialog-footer">
  361. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  362. </span>
  363. </el-dialog>
  364. <!-- 填写日报的dialog -->
  365. <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">
  366. <div style="height: 65vh;overflow: auto;">
  367. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  368. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  369. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  370. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  371. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  372. <span class="spnn" v-if="workForm.userNames">
  373. <span v-for="(item, index) in workForm.userNames" :key="index">
  374. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  375. <span v-if="index < workForm.userNames.length - 1">,</span>
  376. </span>
  377. </span>
  378. <span class="spnn hover" v-else>
  379. {{$t('defaultText.pleaseSelectAsubstitute')}}
  380. </span>
  381. </div>
  382. </el-form-item>
  383. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  384. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  385. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  386. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  387. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  388. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  389. <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>
  390. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  391. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  392. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  393. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  394. <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>
  395. <!-- AI智能填报 -->
  396. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  397. </el-form-item>
  398. <!--考勤时长显示-->
  399. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.time || user.companyId == 5978">
  400. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  401. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  402. </span>
  403. <!--批量填报和批量代填不显示考勤记录-->
  404. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  405. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  406. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  407. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  408. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  409. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  410. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  411. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  412. @click="refreshAttendance(workForm.createDate)"></el-button>
  413. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  414. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  415. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  416. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  417. </el-form-item>
  418. <!-- 000000 -->
  419. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  420. <div v-if="reportTimeType.multiWorktime==0">
  421. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  422. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  423. <el-select v-model="domain.timeType" style="width:200px;"
  424. v-if="reportTimeType.type == 0"
  425. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  426. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  427. @change="onTimeTypeChange(domain.timeType)">
  428. <el-option
  429. v-for="item in timeType"
  430. :key="item.value"
  431. :label="item.label"
  432. :value="item.value">
  433. </el-option>
  434. </el-select>
  435. <!-- 数字时长选择 -->
  436. <el-select v-model="domain.workingTime" style="width:200px;"
  437. v-if="reportTimeType.type == 1"
  438. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  439. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  440. @change="seleChn(0,domain)">
  441. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  442. </el-select>
  443. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  444. <span v-if="reportTimeType.type == 2">
  445. <!--时间范围选择 -->
  446. <el-time-picker
  447. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  448. v-model="domain.startTime"
  449. :placeholder="$t('time.startTime')"
  450. style="width:120px;"
  451. format="HH:mm"
  452. value-format="HH:mm"
  453. :picker-options="{
  454. start: '08:00',
  455. end: '23:30'
  456. }"
  457. @change="iptChang()">
  458. </el-time-picker> - <el-time-picker
  459. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  460. v-model="domain.endTime"
  461. :placeholder="$t('time.endTime')"
  462. style="width:120px;"
  463. format="HH:mm"
  464. value-format="HH:mm"
  465. :picker-options="{
  466. start: '08:00',
  467. end: '23:30',
  468. minTime: domain.startTime
  469. }"
  470. @change="iptChang()">
  471. </el-time-picker>
  472. </span>
  473. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  474. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  475. <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>
  476. </div>
  477. </el-form-item>
  478. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  479. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  480. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  481. @change="selectProject(domain, index)"
  482. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  483. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  484. <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">
  485. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  486. <span style="float: right;">{{ item.projectName }}</span>
  487. </el-option>
  488. </el-option-group>
  489. </el-select>
  490. <!--昱众不显示子项目-->
  491. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  492. <span style="margin-left:45px;">
  493. {{$t('lable.subproject')}}</span>
  494. <!--子项目 -->
  495. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  496. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  497. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  498. </el-select>
  499. </template>
  500. <template v-if="user.companyId == yuzhongCompId">
  501. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  502. <!--角色选择 -->
  503. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  504. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  505. <el-option
  506. v-for="item in roleList"
  507. :key="item.value"
  508. :label="item.label"
  509. :value="item.value">
  510. </el-option>
  511. </el-select>
  512. </template>
  513. <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%;"
  514. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  515. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  516. </el-link>
  517. <!-- <el-link type="primary" v-if="canEdit"
  518. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  519. </el-form-item>
  520. <el-form-item :label="$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">
  521. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  522. </el-form-item>
  523. <!--如果设置了工时成本预警的预算成本项-->
  524. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  525. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  526. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  527. </el-select>
  528. </el-form-item>
  529. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  530. <template slot="label">
  531. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  532. <span >{{$t('lable.taskGrouping')}}</span>
  533. </template>
  534. <!-- 任务分组 -->
  535. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  536. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  537. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  538. </el-select>
  539. <template v-if="user.companyId == yuzhongCompId">
  540. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  541. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  542. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  543. <el-option
  544. v-for="item in domain.filteredRespList"
  545. :key="item.id"
  546. :label="item.jobRespon"
  547. :value="item.id">
  548. </el-option>
  549. </el-select>
  550. </template>
  551. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  552. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  553. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  554. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  555. @change="changeStages(domain, index)"
  556. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  557. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  558. </el-select>
  559. </template>
  560. </el-form-item>
  561. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  562. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  563. <template slot="label">
  564. <span style="color:#FF0000;">*</span>
  565. <span >{{$t('other.projectAuditor')}}</span>
  566. </template>
  567. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  568. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  569. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  570. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  571. </el-option>
  572. </el-select>
  573. <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>
  574. </el-form-item>
  575. </div>
  576. <el-form-item v-if="user.companyId == yuzhongCompId">
  577. <template slot="label">
  578. <span style="color:#FF0000;">*</span>
  579. <span >工作内容</span>
  580. </template>
  581. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  582. :disabled="(workForm.domains[index].state>=2?false:true)" >
  583. <el-option
  584. v-for="item in domain.workContentList"
  585. :key="item.id"
  586. :label="item.workContext"
  587. :value="item.id">
  588. </el-option>
  589. </el-select>
  590. </el-form-item>
  591. <!-- 111111 -->
  592. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  593. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  594. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  595. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  596. <span v-else>{{item.name}}</span>
  597. </el-option>
  598. </el-select>
  599. <template v-if="user.timeType.auditLevel > 1">
  600. <i class="el-icon-right"></i>
  601. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  602. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  603. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  604. <span v-else>{{item.name}}</span>
  605. </el-option>
  606. </el-select>
  607. </template>
  608. <template v-if="user.timeType.auditLevel > 2">
  609. <i class="el-icon-right"></i>
  610. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  611. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  612. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  613. <span v-else>{{item.name}}</span>
  614. </el-option>
  615. </el-select>
  616. </template>
  617. </el-form-item>
  618. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  619. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  620. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  621. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  622. <span v-else>{{item.name}}</span>
  623. </el-option>
  624. </el-select>
  625. </el-form-item>
  626. <!-- 相关维度/自定义维度 -->
  627. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :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'">
  628. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  629. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  630. </el-option>
  631. </el-select>
  632. </el-form-item>
  633. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :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 + '.multiDegrIdArray'">
  634. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  635. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  636. </el-option>
  637. </el-select>
  638. </el-form-item>
  639. <!-- 相关数值 -->
  640. <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">
  641. <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>
  642. </el-form-item>
  643. <!-- 自定义文本 -->
  644. <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">
  645. <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>
  646. </el-form-item>
  647. <!--按比例填报-->
  648. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  649. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  650. <div style="width:400px;">
  651. <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>
  652. <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>
  653. </div>
  654. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  655. <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>
  656. </div>
  657. </el-form-item>
  658. <!--工程专业版本模式下, 各个专业的进度填报 -->
  659. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  660. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  661. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  662. <el-input size="mini" style="width:60px;" v-model="item.progress"
  663. @keyup.native="onProgressChange"
  664. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  665. </span>
  666. </el-form-item>
  667. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  668. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  669. <template slot="label" v-if="user.timeType.taskRequired == 1">
  670. <span style="color:#FF0000;">*</span>
  671. <span >任务</span>
  672. </template>
  673. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  674. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  675. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  676. </el-select>
  677. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  678. </el-form-item>
  679. <!--针对依斯贝的SAP服务-->
  680. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  681. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  682. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  683. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  684. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  685. </el-select>
  686. </el-form-item>
  687. <!--工作事项-->
  688. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  689. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  690. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  691. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  692. </el-form-item>
  693. <!-- 拍照上传 -->
  694. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  695. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  696. <div class="photos">
  697. <div>
  698. <el-upload
  699. list-type="picture-card"
  700. :http-request="(file) => {return addImg(file, index)}"
  701. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  702. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  703. :file-list="domain.imgListUrl" :limit="9"
  704. :disabled="workForm.domains[index].state>=2?false:true">
  705. <i class="el-icon-plus"></i>
  706. </el-upload>
  707. </div>
  708. </div>
  709. </el-form-item>
  710. </div>
  711. <!--多个工作事项填报的情况 -->
  712. <div v-if="reportTimeType.multiWorktime==1">
  713. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  714. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  715. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  716. @change="selectProject(domain, index)"
  717. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  718. <!-- <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">
  719. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  720. <span style="float: right;">{{ item.projectName }}</span>
  721. </el-option> -->
  722. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  723. <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">
  724. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  725. <span style="float: right;">{{ item.projectName }}</span>
  726. </el-option>
  727. </el-option-group>
  728. </el-select>
  729. <template v-if="user.timeType.mainProjectState != 1">
  730. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  731. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  732. <!--子项目 -->
  733. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  734. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  735. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  736. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  737. </el-select>
  738. </template>
  739. <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;"
  740. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  741. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  742. </el-link>
  743. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  744. <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>
  745. </div>
  746. <!-- <el-link type="primary" v-if="canEdit"
  747. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  748. </el-form-item>
  749. <el-form-item :label="$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">
  750. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  751. </el-form-item>
  752. <!--如果设置了工时成本预警的预算成本项-->
  753. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  754. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  755. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  756. </el-select>
  757. </el-form-item>
  758. <el-form-item v-if="user.company.packageProject == 1">
  759. <template slot="label">
  760. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  761. <span >{{$t('lable.taskGrouping')}}</span>
  762. </template>
  763. <!-- 任务分组 -->
  764. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  765. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  766. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  767. </el-select>
  768. <!-- 项目的阶段 -->
  769. <span v-if="domain.stages != null && domain.stages.length> 0"
  770. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  771. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  772. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  773. @change="changeStages(domain, index)"
  774. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  775. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  776. </el-select>
  777. </el-form-item>
  778. <el-form-item :label="$t('other.projectAuditor')" >
  779. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  780. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  781. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  782. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  783. </el-option>
  784. </el-select>
  785. <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>
  786. </el-form-item>
  787. <!--工程专业版本模式下, 各个专业的进度填报 -->
  788. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  789. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  790. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  791. <el-input size="mini" style="width:60px;" v-model="item.progress"
  792. @keyup.native="onProgressChange"
  793. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  794. </span>
  795. </el-form-item>
  796. <!-- 相关维度 -->
  797. <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'">
  798. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  799. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  800. </el-option>
  801. </el-select>
  802. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  803. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  804. </el-option>
  805. </el-select>
  806. </el-form-item>
  807. <!-- 相关数值 -->
  808. <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">
  809. <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>
  810. </el-form-item>
  811. <!-- 自定义文本 -->
  812. <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">
  813. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  814. </el-form-item>
  815. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  816. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  817. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  818. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  819. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  820. </el-select>
  821. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  822. </el-form-item>
  823. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  824. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  825. <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>
  826. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  827. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  828. <span v-if="reportTimeType.type == 2">
  829. <!-- <span> -->
  830. <!--时间范围选择 -->
  831. <el-time-picker
  832. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  833. v-model="timeItem.startTime"
  834. :placeholder="$t('time.startTime')"
  835. style="width:120px;"
  836. format="HH:mm"
  837. value-format="HH:mm"
  838. :picker-options="{
  839. start: '00:00',
  840. end: '23:59',
  841. }"
  842. @change="iptChangs()">
  843. </el-time-picker> - <el-time-picker
  844. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  845. v-model="timeItem.endTime"
  846. :placeholder="$t('time.endTime')"
  847. style="width:120px;"
  848. format="HH:mm"
  849. value-format="HH:mm"
  850. :picker-options="{
  851. start: '00:00',
  852. end: '23:59',
  853. minTime: timeItem.startTime
  854. }"
  855. @change="iptChangs()">
  856. </el-time-picker>
  857. </span>
  858. </el-form-item>
  859. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  860. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  861. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  862. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  863. ></el-input>
  864. </el-form-item>
  865. </div>
  866. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  867. </div>
  868. <!--照片的显示 -->
  869. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  870. <el-image v-for="(pic, index) in domain.pics" :key="index"
  871. style="width: 100px; height: 100px; margin-right:10px;"
  872. :src="pic"
  873. :preview-src-list="domain.pics">
  874. </el-image>
  875. </p>
  876. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  877. </div>
  878. <span id="workFormsItemBottom"></span>
  879. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  880. </el-form>
  881. </div>
  882. <span slot="footer" class="dialog-footer">
  883. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  884. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  885. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  886. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  887. <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>
  888. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  889. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  890. </span>
  891. </el-dialog>
  892. <!-- 按周填报 -->
  893. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  894. <!-- 按周填报-已填工时-点击 -->
  895. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  896. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  897. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  898. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  899. <el-table-column prop="state" :label="$t('state.states')">
  900. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  901. </el-table-column>
  902. <!-- <el-table-column label="操作">
  903. <template slot-scope="scope">
  904. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  905. </template>
  906. </el-table-column> -->
  907. </el-table>
  908. <span slot="footer" class="dialog-footer">
  909. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  910. </span>
  911. </el-dialog>
  912. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  913. <el-form-item style="height:30px;margin-top:-72px;">
  914. <!-- <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> -->
  915. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  916. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  917. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  918. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  919. <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>
  920. <el-option
  921. v-for="item in fillProjectList"
  922. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  923. :key="item.id"
  924. :label="item.projectName + '\u3000' + item.projectCode"
  925. :value="item.id">
  926. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  927. <span style="float: right">{{ item.projectName }}</span>
  928. </el-option>
  929. </el-select>
  930. <span style="float:right;margin-right:10px;">选择项目</span>
  931. </el-form-item>
  932. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  933. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  934. <template slot-scope="scope">
  935. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  936. </template>
  937. </el-table-column>
  938. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  939. <template slot-scope="scope">
  940. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  941. <p v-else></p>
  942. </template>
  943. </el-table-column> -->
  944. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  945. <template slot-scope="scope">
  946. <div v-if="scope.row.canFill == 1">
  947. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  948. <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>
  949. <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>
  950. <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>
  951. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  952. </div>
  953. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  954. <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>
  955. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  956. </div>
  957. </div>
  958. <div v-else >
  959. <span style="color:#999999;">不可超前填报</span>
  960. </div>
  961. </template>
  962. </el-table-column>
  963. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  964. <template slot-scope="scope">
  965. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  966. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  967. </template>
  968. </el-table-column>
  969. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  970. <template slot-scope="scope">
  971. <div class="zhiss">
  972. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  973. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  974. </div>
  975. </template>
  976. </el-table-column>
  977. </el-table>
  978. </el-form>
  979. <span slot="footer" class="dialog-footer" >
  980. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  981. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  982. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  983. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  984. </span>
  985. </el-dialog>
  986. <!-- 重庆物奇私人定制的按周填报 -->
  987. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  988. <div class="fillWeekDialogVisiCustom">
  989. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  990. </div>
  991. </el-dialog>
  992. <!-- 选择时间 -->
  993. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  994. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  995. <span slot="footer" class="dialog-footer">
  996. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  997. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  998. </span>
  999. </el-dialog>
  1000. <!-- 按周填报弹窗 -->
  1001. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1002. <div>
  1003. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1004. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1005. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1006. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1007. </el-select>
  1008. </div>
  1009. <!--如果设置了工时成本预警的预算成本项-->
  1010. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1011. <p>{{$t('lable.budgetSource')}}</p>
  1012. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1013. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1014. </el-select>
  1015. </div>
  1016. <!-- 任务分组 -->
  1017. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1018. <p>{{$t('lable.taskGrouping')}}</p>
  1019. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1020. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1021. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1022. </el-select>
  1023. </div>
  1024. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1025. <p>{{$t('other.inputStage')}}</p>
  1026. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1027. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1028. </el-select>
  1029. </div>
  1030. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1031. <p>{{$t('other.reviewer')}}</p>
  1032. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1033. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1034. </el-select>
  1035. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1036. </div>
  1037. <template v-if="user.timeType.reportAuditType == 3">
  1038. <div class="zhoFel">
  1039. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1040. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1041. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1042. </el-select>
  1043. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1044. </div>
  1045. <div class="zhoFel">
  1046. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1047. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1048. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1049. </el-select>
  1050. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1051. </div>
  1052. <div class="zhoFel">
  1053. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1054. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1055. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1056. </el-select>
  1057. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1058. </div>
  1059. <div class="zhoFel">
  1060. <p>{{ $t('chao-song-ren') }}</p>
  1061. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1062. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1063. </el-select>
  1064. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1065. </div>
  1066. </template>
  1067. <!-- 自定义维度 -->
  1068. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1069. <p>{{user.timeType.customDegreeName}}</p>
  1070. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1071. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1072. </el-select>
  1073. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1074. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1075. </el-select>
  1076. </div>
  1077. <!-- 自定义数值 -->
  1078. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1079. <p>{{user.timeType.customDataName}}</p>
  1080. <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>
  1081. </div>
  1082. <!-- 自定义文本 -->
  1083. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1084. <p>{{user.timeType.customTextName}}</p>
  1085. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1086. </div>
  1087. <!-- 选择任务 -->
  1088. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1089. <p>任务 / 里程碑</p>
  1090. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1091. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1092. </el-select>
  1093. </div>
  1094. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1095. <p>{{$t('other.timeSelection')}}</p>
  1096. <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>
  1097. </div>
  1098. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1099. <p>{{$t('other.chooseDuration')}}</p>
  1100. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1101. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1102. </el-select>
  1103. </div>
  1104. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1105. <p>{{$t('lable.percentageOfTime')}}</p>
  1106. <div style="width:400px;display: flex;align-items: center;">
  1107. <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>
  1108. <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>
  1109. </div>
  1110. </div>
  1111. <div class="zhoFel">
  1112. <p>{{$t('other.workMatters')}}</p>
  1113. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1114. </div>
  1115. </div>
  1116. <span slot="footer" class="dialog-footer">
  1117. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1118. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1119. </span>
  1120. </el-dialog>
  1121. <!--导出报表条件选择 -->
  1122. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1123. <el-form ref="form3" :model="exportParam" >
  1124. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1125. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1126. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1127. </el-select>
  1128. </el-form-item>
  1129. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1130. <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>
  1131. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1132. </el-form-item>
  1133. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1134. <el-date-picker
  1135. v-model="exportParam.dateRange" :editable="false"
  1136. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1137. :range-separator="$t('other.to')"
  1138. type="daterange"
  1139. :start-placeholder="$t('time.startDate')"
  1140. :end-placeholder="$t('time.endDate')"
  1141. ></el-date-picker>
  1142. </el-form-item>
  1143. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1144. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1145. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1146. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1147. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1148. </el-select>
  1149. </el-form-item>
  1150. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1151. <div class="exportReportRadio">
  1152. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1153. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1154. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1155. <i class="el-icon-question"></i>
  1156. </el-tooltip>
  1157. </div>
  1158. </el-form-item>
  1159. </el-form>
  1160. <div slot="footer" class="dialog-footer">
  1161. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1162. </div>
  1163. </el-dialog>
  1164. <!--导出报表条件选择 -->
  1165. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1166. <el-form ref="form3" :model="exportParam" >
  1167. <el-form-item prop="range" :label="$t('time.dateRange')">
  1168. <el-date-picker
  1169. v-model="exportParam.dateRange" :editable="false"
  1170. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1171. :clearable="true"
  1172. :range-separator="$t('other.to')"
  1173. type="daterange"
  1174. :start-placeholder="$t('time.startDate')"
  1175. :end-placeholder="$t('time.endDate')"
  1176. ></el-date-picker>
  1177. </el-form-item>
  1178. </el-form>
  1179. <div slot="footer" class="dialog-footer">
  1180. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1181. </div>
  1182. </el-dialog>
  1183. <!--人员列表 -->
  1184. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1185. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1186. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1187. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1188. <el-table-column type="selection"></el-table-column>
  1189. <el-table-column prop="label" :label="$t('lable.name')" >
  1190. <template slot-scope="scope">
  1191. <span>
  1192. <!-- {{(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}} -->
  1193. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1194. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1195. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1196. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1197. </span>
  1198. <span v-else>
  1199. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1200. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1201. </span>
  1202. </span>
  1203. </template>
  1204. </el-table-column>
  1205. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1206. <template slot-scope="scope">
  1207. <div>
  1208. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1209. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1210. </div>
  1211. </template>
  1212. </el-table-column>
  1213. </el-table>
  1214. </el-tab-pane>
  1215. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1216. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1217. <el-table-column prop="label" :label="$t('lable.name')" >
  1218. <template slot-scope="scope">
  1219. <!-- <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> -->
  1220. <!-- <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> -->
  1221. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1222. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1223. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1224. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1225. </span>
  1226. <span v-else>
  1227. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1228. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1229. </span>
  1230. </template>
  1231. </el-table-column>
  1232. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1233. <template slot-scope="scope">
  1234. <div>
  1235. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1236. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1237. </div>
  1238. </template>
  1239. </el-table-column>
  1240. </el-table>
  1241. </el-tab-pane>
  1242. </el-tabs>
  1243. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1244. <el-table-column type="selection"></el-table-column>
  1245. <el-table-column prop="label" :label="$t('lable.name')" >
  1246. <template slot-scope="scope">
  1247. <div>
  1248. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1249. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1250. </div>
  1251. </template>
  1252. </el-table-column>
  1253. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1254. <template slot-scope="scope">
  1255. <div>
  1256. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1257. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1258. </div>
  1259. </template>
  1260. </el-table-column>
  1261. </el-table>
  1262. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1263. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1264. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1265. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1266. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1267. </div>
  1268. </el-dialog>
  1269. <!-- 按部门选择人员 -->
  1270. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1271. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1272. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1273. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1274. </el-input>
  1275. <div class="tree" style="height:400px">
  1276. <el-scrollbar style="height:100%">
  1277. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1278. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1279. highlight-current :filter-node-method="filterNode">
  1280. <span class="custom-tree-node" slot-scope="{ node }">
  1281. <span v-if="user.userNameNeedTranslate == '1'">
  1282. <span v-if="node.data.children">
  1283. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1284. </span>
  1285. <span v-else>
  1286. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1287. </span>
  1288. </span>
  1289. <span v-if="user.userNameNeedTranslate != '1'">
  1290. {{ node.label }}
  1291. </span>
  1292. <!-- {{ node.label }} -->
  1293. </span>
  1294. </el-tree>
  1295. </el-scrollbar>
  1296. </div>
  1297. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1298. <div slot="footer" class="dialog-footer">
  1299. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1300. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1301. </div>
  1302. </el-dialog>
  1303. <el-dialog
  1304. v-if="monthWorkTimeDialog"
  1305. :visible.sync="monthWorkTimeDialog"
  1306. :close-on-click-modal="false"
  1307. customClass="customWidth selectworktime"
  1308. width="1200px"
  1309. title=""
  1310. >
  1311. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1312. <el-tabs v-model="activeName" @tab-click="handleClick">
  1313. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1314. <div class="selectworktime_export" style="margin-top:10px;">
  1315. <div class="selectworktime_export_l">
  1316. <el-date-picker
  1317. class="selecteworktime_datapick"
  1318. v-model="WorktimeDatepickValue"
  1319. value-format="yyyy-MM-dd"
  1320. type="daterange"
  1321. align="right"
  1322. unlink-panels
  1323. :range-separator="$t('other.to')"
  1324. :start-placeholder="$t('time.startDate')"
  1325. :end-placeholder="$t('time.endDate')"
  1326. :default-time="['12:00:00', '12:00:00']"
  1327. size="small"
  1328. popper-class="selecteorktime_datapick_popper"
  1329. @change="showMonthWorkTime('first')"
  1330. >
  1331. </el-date-picker>
  1332. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1333. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1334. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1335. <!-- 222 -->
  1336. </div>
  1337. <div>
  1338. <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">
  1339. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1340. </el-input>
  1341. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1342. </div>
  1343. <div style="float: right; vertical-align: middle;height:32px">
  1344. <el-link
  1345. type="primary"
  1346. @click="exportMembWorkHours()"
  1347. >{{$t('export.exportData')}}</el-link
  1348. >
  1349. </div>
  1350. </div>
  1351. <el-table ref="hasworkTbl"
  1352. :data="monthWorkDataS"
  1353. v-el-table-infinite-scroll="listScroll"
  1354. border
  1355. :height="500"
  1356. highlight-current-row
  1357. style="width: 100%"
  1358. v-loading="tbload"
  1359. :lazy="true"
  1360. >
  1361. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1362. <template slot-scope="scope">
  1363. {{ scope.$index + 1 }}
  1364. </template>
  1365. </el-table-column>
  1366. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1367. <template slot-scope="scope">
  1368. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1369. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1370. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1371. <!-- {{scope.row.name}} -->
  1372. </span>
  1373. </template>
  1374. </el-table-column>
  1375. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1376. <template slot-scope="scope">
  1377. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1378. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1379. </template>
  1380. </el-table-column>
  1381. <el-table-column
  1382. min-width="105"
  1383. v-for="(item, index) in pickDateArray"
  1384. :key="index"
  1385. :label="item.label"
  1386. align="center"
  1387. >
  1388. <template slot-scope="scope">
  1389. <div
  1390. style="color: red"
  1391. v-if="
  1392. scope.row.worktimeList.filter(
  1393. (w) =>
  1394. w.createDate==item.date
  1395. ).length > 0 &&
  1396. scope.row.worktimeList.filter(
  1397. (w) =>w.createDate==item.date
  1398. )[0].workingTime < reportTimeType.allday
  1399. "
  1400. >
  1401. {{
  1402. scope.row.worktimeList.filter(
  1403. (w) =>w.createDate==item.date
  1404. )[0].workingTime.toFixed(1)
  1405. }}
  1406. </div>
  1407. <div
  1408. style="color: #20a0ff"
  1409. v-if="
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. ).length > 0 &&
  1413. scope.row.worktimeList.filter(
  1414. (w) =>w.createDate==item.date
  1415. )[0].workingTime > reportTimeType.allday
  1416. "
  1417. >
  1418. {{
  1419. scope.row.worktimeList.filter(
  1420. (w) =>w.createDate==item.date
  1421. )[0].workingTime.toFixed(1)
  1422. }}
  1423. </div>
  1424. <div
  1425. v-if="
  1426. scope.row.worktimeList.filter(
  1427. (w) =>w.createDate==item.date
  1428. ).length > 0 &&
  1429. scope.row.worktimeList.filter(
  1430. (w) =>w.createDate==item.date
  1431. )[0].workingTime == reportTimeType.allday
  1432. "
  1433. >
  1434. {{
  1435. scope.row.worktimeList.filter(
  1436. (w) =>w.createDate==item.date
  1437. )[0].workingTime
  1438. }}
  1439. </div>
  1440. <div
  1441. v-if="
  1442. scope.row.worktimeList.filter(
  1443. (w) =>w.createDate==item.date
  1444. ).length == 0
  1445. "
  1446. >
  1447. 0
  1448. </div>
  1449. <div
  1450. v-if="
  1451. scope.row.worktimeList.filter(
  1452. (w) =>w.createDate==item.date
  1453. ).length > 0 &&
  1454. typeof scope.row.worktimeList.filter(
  1455. (w) =>w.createDate==item.date
  1456. )[0].workingTime == 'string'
  1457. "
  1458. >
  1459. {{
  1460. scope.row.worktimeList.filter(
  1461. (w) =>w.createDate==item.date
  1462. )[0].workingTime
  1463. }}
  1464. </div>
  1465. </template>
  1466. </el-table-column>
  1467. </el-table>
  1468. <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>
  1469. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1470. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1471. <label style="font-size: 16px">员工每日已填报工时数</label>
  1472. <el-link
  1473. type="primary"
  1474. style="float: right; margin-right: 60px"
  1475. @click="exportMembWorkHours()"
  1476. >导出已填报数据</el-link
  1477. > -->
  1478. <!-- <el-button >导出</el-button> -->
  1479. <!-- </div> -->
  1480. </el-tab-pane>
  1481. <el-tab-pane label="未提交人员列表" name="second" >
  1482. <div class="selectworktime_export" style="margin-top:10px">
  1483. <div class="selectworktime_export_l">
  1484. <el-date-picker
  1485. class="selecteworktime_datapick"
  1486. v-model="WorktimeDatepickValue"
  1487. value-format="yyyy-MM-dd"
  1488. type="daterange"
  1489. align="right"
  1490. unlink-panels
  1491. :range-separator="$t('other.to')"
  1492. :start-placeholder="$t('time.startDate')"
  1493. :end-placeholder="$t('time.endDate')"
  1494. :default-time="['12:00:00', '12:00:00']"
  1495. size="small"
  1496. popper-class="selecteorktime_datapick_popper"
  1497. @change="showMonthNotWorkTime()"
  1498. >
  1499. </el-date-picker>
  1500. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1501. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1502. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1503. </div>
  1504. <div>
  1505. <div style="margin-top:10px;">
  1506. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1507. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1508. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1509. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1510. </el-input>
  1511. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1512. <el-link
  1513. type="primary"
  1514. style="float: right; vertical-align: middle;height:32px"
  1515. @click="exportMembNotWorkHours()"
  1516. >{{$t('export.exportData')}}</el-link
  1517. >
  1518. </div>
  1519. </div>
  1520. </div>
  1521. <el-table
  1522. ref="hasworkTbl2"
  1523. :data="monthNotWorkDateS"
  1524. v-el-table-infinite-scroll="notListScroll"
  1525. border
  1526. :height="500"
  1527. highlight-current-row
  1528. style="width: 100%"
  1529. v-loading="tbload"
  1530. lazy
  1531. >
  1532. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1533. <template slot-scope="scope">
  1534. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1535. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1536. </template>
  1537. </el-table-column>
  1538. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1539. <template slot-scope="scope">
  1540. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1541. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1542. </template>
  1543. </el-table-column>
  1544. <el-table-column
  1545. min-width="200"
  1546. :label="$t('weekDay.date')"
  1547. align="center"
  1548. prop="createDate"
  1549. >
  1550. </el-table-column>
  1551. <el-table-column
  1552. min-width="200"
  1553. :label="$t('state.states')"
  1554. align="center"
  1555. prop="status"
  1556. />
  1557. <el-table-column
  1558. min-width="200"
  1559. :label="$t('other.attendanceData')"
  1560. prop="cardTime"
  1561. align="center"
  1562. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1563. </el-table>
  1564. <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>
  1565. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1566. </el-tab-pane>
  1567. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1568. <div class="selectworktime_export" style="margin-top:10px;">
  1569. <!-- <div class="selectworktime_export_l">
  1570. <el-date-picker
  1571. class="selecteworktime_datapick"
  1572. v-model="WorktimeDatepickValue"
  1573. value-format="yyyy-MM-dd"
  1574. type="daterange"
  1575. align="right"
  1576. unlink-panels
  1577. :range-separator="$t('other.to')"
  1578. :start-placeholder="$t('time.startDate')"
  1579. :end-placeholder="$t('time.endDate')"
  1580. :default-time="['12:00:00', '12:00:00']"
  1581. size="small"
  1582. popper-class="selecteorktime_datapick_popper"
  1583. @change="showMonthWorkTime()"
  1584. >
  1585. </el-date-picker>
  1586. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1587. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1588. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1589. </div> -->
  1590. <div>
  1591. <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">
  1592. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1593. </el-input>
  1594. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1595. </div>
  1596. <div style="float: right; vertical-align: middle;height:32px">
  1597. <el-link
  1598. type="primary"
  1599. @click="changeReminder()"
  1600. >{{'变更提醒'}}</el-link
  1601. >
  1602. <el-link
  1603. type="primary"
  1604. @click="exportMembWorkHoursReminder()"
  1605. >{{$t('export.exportData')}}</el-link
  1606. >
  1607. </div>
  1608. </div>
  1609. <el-table ref="hasworkTbl"
  1610. :data="monthWorkDataS"
  1611. v-el-table-infinite-scroll="listScroll"
  1612. border
  1613. :height="500"
  1614. highlight-current-row
  1615. style="width: 100%"
  1616. v-loading="tbload"
  1617. :lazy="true"
  1618. >
  1619. <el-table-column width="180" type="index" fixed="left" :label="'日期'">
  1620. <template slot-scope="scope">
  1621. {{ scope.row.createDate}}
  1622. </template>
  1623. </el-table-column>
  1624. <el-table-column width="160" prop="name" fixed="left" :label="$t('lable.name')">
  1625. <template slot-scope="scope">
  1626. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1627. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1628. <!-- {{scope.row.name}} -->
  1629. </template>
  1630. </el-table-column>
  1631. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1632. <template slot-scope="scope">
  1633. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1634. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1635. </template>
  1636. </el-table-column>
  1637. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1638. <template slot-scope="scope">
  1639. {{ scope.row.workingTime}}
  1640. </template>
  1641. </el-table-column>
  1642. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1643. <template slot-scope="scope">
  1644. {{ scope.row.cardTime}}
  1645. </template>
  1646. </el-table-column>
  1647. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1648. <template slot-scope="scope">
  1649. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1650. </template>
  1651. </el-table-column>
  1652. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1653. <template slot-scope="scope">
  1654. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1655. </template>
  1656. </el-table-column>
  1657. </el-table>
  1658. <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>
  1659. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1660. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1661. <label style="font-size: 16px">员工每日已填报工时数</label>
  1662. <el-link
  1663. type="primary"
  1664. style="float: right; margin-right: 60px"
  1665. @click="exportMembWorkHours()"
  1666. >导出已填报数据</el-link
  1667. > -->
  1668. <!-- <el-button >导出</el-button> -->
  1669. <!-- </div> -->
  1670. </el-tab-pane>
  1671. </el-tabs>
  1672. </el-dialog>
  1673. <!--驳回弹出框 -->
  1674. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1675. <div>
  1676. <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')" />
  1677. </div>
  1678. <div slot="footer" class="dialog-footer">
  1679. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1680. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1681. </div>
  1682. </el-dialog>
  1683. <!-- 通过弹出框 -->
  1684. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1685. <div>
  1686. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1687. </div>
  1688. <div slot="footer" class="dialog-footer">
  1689. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1690. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1691. </div>
  1692. </el-dialog>
  1693. <!--批量导入日报 -->
  1694. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1695. <p>1. {{$t('other.download')}}
  1696. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1697. </p>
  1698. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1699. <p style="display: flex;justify-content: center;">
  1700. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1701. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1702. </el-upload>
  1703. </p>
  1704. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1705. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1706. </div>
  1707. </el-dialog>
  1708. <!-- 工时导入记录弹窗 -->
  1709. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1710. <div style="height: 452px">
  1711. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1712. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1713. <el-table-column prop="userName" :label="$t('other.operator')">
  1714. <template slot-scope="scope">
  1715. <div>
  1716. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1717. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1718. </div>
  1719. </template>
  1720. </el-table-column>
  1721. <el-table-column prop="datel" :label="$t('other.document')">
  1722. <template slot-scope="scope">
  1723. <div>
  1724. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1725. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1726. </div>
  1727. </template>
  1728. </el-table-column>
  1729. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1730. <template slot-scope="scope">
  1731. <div>
  1732. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1733. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1734. </div>
  1735. </template>
  1736. </el-table-column>
  1737. </el-table>
  1738. <el-col :span="24" class="paginatis">
  1739. <el-pagination
  1740. @size-change="handleSizeChange"
  1741. @current-change="handleCurrentChange"
  1742. :page-sizes="[20 , 50 , 80 , 100]"
  1743. :page-size="20"
  1744. layout="total, sizes, prev, pager, next"
  1745. :total="toViewForm.total"
  1746. style="float:right;"
  1747. ></el-pagination>
  1748. </el-col>
  1749. </div>
  1750. </el-dialog>
  1751. <!--基于企业微信考勤数据的工时导入 -->
  1752. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1753. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1754. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1755. </el-step>
  1756. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1757. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1758. </el-steps>
  1759. <div v-if="active==0" style="padding:30px;height:360px;">
  1760. <div style="margin-top:50px;margin-left:280px;">
  1761. <el-date-picker
  1762. v-model="importWxParam.date" :editable="false"
  1763. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1764. :clearable="true"
  1765. :range-separator="$t('other.to')"
  1766. type="daterange"
  1767. :start-placeholder="$t('time.startDate')"
  1768. :end-placeholder="$t('time.endDate')"
  1769. @change="loadCheckInData"
  1770. ></el-date-picker>
  1771. </div>
  1772. </div>
  1773. <div v-if="active==1" style="padding:10px;">
  1774. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1775. style="width: 100%;margin-top:5px;" >
  1776. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1777. <template slot-scope="scope">
  1778. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1779. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1780. </template>
  1781. </el-table-column>
  1782. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1783. </el-table-column>
  1784. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1785. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1786. <template slot-scope="scope">
  1787. <div>
  1788. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1789. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1790. </div>
  1791. </template>
  1792. </el-table-column>
  1793. <el-table-column prop="departmentName" label="部门" >
  1794. <template slot-scope="scope">
  1795. <div>
  1796. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1797. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1798. </div>
  1799. </template>
  1800. </el-table-column>
  1801. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1802. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1803. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1804. <template slot-scope="scope">
  1805. {{scope.row.workHours.toFixed(1)}}h
  1806. </template>
  1807. </el-table-column>
  1808. </el-table>
  1809. </div>
  1810. <div v-if="active==2" >
  1811. <p style="display: flex;justify-content: center;height:390px;">
  1812. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1813. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1814. </el-upload>
  1815. </p>
  1816. </div>
  1817. <div slot="title">
  1818. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1819. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1820. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1821. <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>
  1822. <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>
  1823. <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>
  1824. </div>
  1825. <span slot="footer">
  1826. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1827. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1828. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1829. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1830. </span>
  1831. </el-dialog>
  1832. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1833. <p style="display: flex;justify-content: center;height:100px;">
  1834. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1835. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1836. </el-upload>
  1837. </p>
  1838. </el-dialog>
  1839. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1840. <div>
  1841. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1842. v-model="deleteReportParam.date" :editable="false"
  1843. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1844. :clearable="true"
  1845. :range-separator="$t('other.to')"
  1846. type="daterange"
  1847. :start-placeholder="$t('time.startDate')"
  1848. :end-placeholder="$t('time.endDate')"
  1849. ></el-date-picker>
  1850. </div>
  1851. <div style="margin-top:10px;">
  1852. <span>请选择部门:</span>
  1853. <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>
  1854. <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>
  1855. </div>
  1856. <div style="margin-top:10px;">
  1857. <span>请选择员工:</span>
  1858. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1859. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1860. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1861. <span v-else>{{item.name}}</span>
  1862. </el-option>
  1863. </el-select>
  1864. </div>
  1865. <span slot="footer">
  1866. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1867. </span>
  1868. </el-dialog>
  1869. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1870. <div>
  1871. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1872. v-model="deleteReportParam.date" :editable="false"
  1873. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1874. :clearable="true"
  1875. :range-separator="$t('other.to')"
  1876. type="daterange"
  1877. :start-placeholder="$t('time.startDate')"
  1878. :end-placeholder="$t('time.endDate')"
  1879. ></el-date-picker>
  1880. </div>
  1881. <div style="margin-top:15px;">
  1882. <span>选择部门:</span>
  1883. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1884. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1885. size="small" v-if="user.userNameNeedTranslate != 1"
  1886. ></el-cascader>
  1887. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1888. </div>
  1889. <span slot="footer">
  1890. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1891. </span>
  1892. </el-dialog>
  1893. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1894. <div>
  1895. <span>选择时间:</span><el-date-picker
  1896. v-model="modImportTime"
  1897. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1898. :clearable="true"
  1899. type="datetime"
  1900. ></el-date-picker>
  1901. <span>选择导入人员:</span><el-select
  1902. v-model="modImportUserId"
  1903. >
  1904. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1905. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1906. <span v-else>{{item.name}}</span>
  1907. </el-option>
  1908. </el-select>
  1909. </div>
  1910. <span slot="footer">
  1911. <el-button @click="confirmChangeModTime" >确认</el-button>
  1912. </span>
  1913. </el-dialog>
  1914. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1915. <div>
  1916. <span>请选择年月:</span>
  1917. <el-date-picker
  1918. v-model="ratioYmonth" :editable="false"
  1919. format="yyyyMM" value-format="yyyyMM"
  1920. type="month"
  1921. ></el-date-picker>
  1922. </div>
  1923. <span slot="footer">
  1924. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1925. </span>
  1926. </el-dialog>
  1927. <!--工时批量代填 -->
  1928. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1929. <div>
  1930. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1931. v-model="importWxParam.date" :editable="false"
  1932. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1933. :clearable="true"
  1934. :range-separator="$t('other.to')"
  1935. type="daterange"
  1936. :start-placeholder="$t('time.startDate')"
  1937. :end-placeholder="$t('time.endDate')"
  1938. @change="loadCheckInData"
  1939. ></el-date-picker>
  1940. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1941. </div>
  1942. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1943. :key="timeStamp"
  1944. style="width: 100%;margin-top:5px;" ref="tab">
  1945. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1946. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1947. <template slot-scope="scope">
  1948. <div>
  1949. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1950. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1951. </div>
  1952. </template>
  1953. </el-table-column>
  1954. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1955. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1956. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1957. <template slot-scope="scope">
  1958. {{scope.row.workHours.toFixed(1)}}h
  1959. </template>
  1960. </el-table-column>
  1961. <!--项目名称列表 -->
  1962. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1963. <template slot-scope="scope">
  1964. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1965. </template>
  1966. </el-table-column>
  1967. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1968. <template slot-scope="scope">
  1969. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1970. </template>
  1971. </el-table-column>
  1972. </el-table>
  1973. </el-dialog>
  1974. <!--基于企业微信考勤数据的工时导入 -->
  1975. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1976. <div style="padding-bottom:10px;">
  1977. <p>{{importResultMsg}}</p>
  1978. </div>
  1979. <!-- <span slot="footer" class="dialog-footer">
  1980. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1981. </span> -->
  1982. </el-dialog>
  1983. <!-- 审核流程展示 -->
  1984. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1985. <div style="padding:20px 40px 20px 0">
  1986. <el-timeline :reverse="false">
  1987. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1988. <!-- {{item.msg}} -->
  1989. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1990. <span v-if="user.userNameNeedTranslate == 1">
  1991. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1992. <span>{{item.msgCon.two}}</span>
  1993. </span>
  1994. </el-timeline-item>
  1995. </el-timeline>
  1996. </div>
  1997. </el-dialog>
  1998. </section>
  1999. </template>
  2000. <script>
  2001. // 左右滑动
  2002. import dragMixin from "@/common/js/tensile.js";
  2003. import util from "../../common/js/util";
  2004. // 自定义select组件
  2005. import selectCat from "@/components/select.vue"
  2006. // 引入自定义级联组件
  2007. import vueCascader from "@/components/cascader.vue"
  2008. // 重庆物奇定制组件
  2009. import WeeklyCustomization from "./weeklyCustomization.vue"
  2010. import { mapMutations } from 'vuex'
  2011. let _that = this
  2012. export default {
  2013. mixins: [dragMixin],
  2014. components: {
  2015. selectCat,
  2016. vueCascader,
  2017. WeeklyCustomization
  2018. },
  2019. data() {
  2020. return {
  2021. pageIndex: 0,
  2022. hasMore: true,
  2023. exportType: 0,
  2024. exportingData: false,
  2025. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2026. jobResponseList:[],
  2027. yisibeiCompId: 3092,
  2028. yuzhongCompId: 3385,
  2029. mingyiName : '成都明夷电子科技有限公司',
  2030. // mingyiName : '明夷',
  2031. modItemDataId: null,
  2032. modImportTime: null,
  2033. modImportUserId: null,
  2034. showModImportTimeDialog: false,
  2035. showBatchSimpleApproveReport: false,
  2036. startDeleting: false,
  2037. showBatchDeleteReport: false,
  2038. deleteReportParam: {date:null, userIds:[]},
  2039. isDenying: false,
  2040. targetWeekDate: null,//填写周报中的周日期
  2041. importCardTimeVisi: false,
  2042. startRatioExporting: false,
  2043. exportUserRatio: false,
  2044. ratioYmonth:null,
  2045. hasWrittenReport: false,
  2046. today:null,
  2047. syncTimeLoading: false,
  2048. seluserText: '',
  2049. translation: '1', // 1、文字, 2、部门, 3、人员
  2050. exportLoad: false,
  2051. getPickerOptions: {
  2052. disabledDate: (time) => {
  2053. var date = new Date();
  2054. var year = date.getFullYear();
  2055. var month = date.getMonth() + 1;
  2056. if (month >= 1 && month <= 9) {
  2057. month = "0" + month;
  2058. }
  2059. var currentdate = year.toString() + month.toString();
  2060. var timeyear = time.getFullYear();
  2061. var timemonth = time.getMonth() + 1;
  2062. if (timemonth >= 1 && timemonth <= 9) {
  2063. timemonth = "0" + timemonth;
  2064. }
  2065. var timedate = timeyear.toString() + timemonth.toString();
  2066. if(this.user.timeType.fillAhead == 0){
  2067. return currentdate < timedate;
  2068. }else{
  2069. return false
  2070. }
  2071. }
  2072. },
  2073. alalal: '8.0',
  2074. timeBasecostList:null,
  2075. tbload: false,
  2076. exportTimeDialog: false,
  2077. searchKeyword: '',
  2078. monthWorkDataS: [],
  2079. monthNotWorkDateS: [],
  2080. pickDateArray:[],
  2081. WorktimeDatepickValue: [],
  2082. activeName:"first",
  2083. isLeave: 0,
  2084. submitingReport: false,
  2085. importResultMsg:null,
  2086. showImportResult:false,
  2087. importingData: false,
  2088. isDraft: 0,
  2089. timeStamp: 0,
  2090. projectColumns:[],
  2091. checkinLoading:false,
  2092. importWxParam:{date:null,},
  2093. active:0,
  2094. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2095. importWxDialog:false,
  2096. importDialog:false,
  2097. denyForm:null,
  2098. denyReasonDialog:false,
  2099. monthWorkTimeDialog: false,
  2100. isSubstitude:false,
  2101. isFill:false,
  2102. unFillList:[],
  2103. fillList:[],
  2104. fillMembList:[],
  2105. fillMembList_leave: [],
  2106. membListVisible: false,
  2107. isBatch:0,//是否是批量填报
  2108. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2109. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2110. 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')],
  2111. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2112. fillStatusList: [],
  2113. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2114. exportDialog:false,
  2115. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2116. subProjectList:[],
  2117. canEdit: true,
  2118. originCanEdit: true,
  2119. timeRange:[0.0,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],
  2120. selectTime:null,
  2121. reportTimeType:{},
  2122. curDate:'',
  2123. isAllSelect: false,
  2124. approveDialogVisible:false,
  2125. deptId:null,
  2126. targetUid: null,
  2127. membCount:0,
  2128. selectState:"-1",
  2129. user: JSON.parse(sessionStorage.getItem("user")),
  2130. allUsersList: [],
  2131. showAddMore:false,
  2132. allDate: [],
  2133. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2134. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2135. choseDay: 0,
  2136. tableHeight: 0,
  2137. listLoading: false,
  2138. projectList: [], //项目列表
  2139. fillProjectList: [],
  2140. reportList: [], //日报列表
  2141. reportNames:[], //批量审批列表
  2142. selCon:[], //筛选条件
  2143. selProjectList:[], //筛选后项目列表
  2144. selConShow: true,
  2145. usersList: [], // 全部人员列表
  2146. usersListId: '', // 选中的人员id
  2147. dialogVisible: false, //项目弹窗
  2148. report: '',
  2149. workForm: {
  2150. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2151. domains: [{
  2152. id: null,
  2153. projectId: "",
  2154. workingTime: "",
  2155. timeType:0,
  2156. content: "",
  2157. state: 2,
  2158. multiWorktime:0,
  2159. worktimeList:[],
  2160. degreeId: null,
  2161. auditUserList: [],
  2162. }],
  2163. },
  2164. workRules: {
  2165. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2166. },
  2167. chooseParticipVisible: false,
  2168. logining: false,
  2169. isDisable: false,
  2170. timeType:[],
  2171. deptMembData: [
  2172. ],
  2173. //部门人员树状结构
  2174. data: [
  2175. {
  2176. id: -1,
  2177. label: this.$t('lable.allStaff'),
  2178. membCount:0
  2179. },
  2180. {
  2181. id: 0,
  2182. label: this.$t('lable.unassigned'),
  2183. }
  2184. ],
  2185. allData:{},
  2186. batchShowData:{},
  2187. option: [],
  2188. deptOptionList: [],
  2189. depData: {
  2190. id: -1,
  2191. label: this.$t('lable.allStaff'),
  2192. },
  2193. defaultProps: {
  2194. children: 'children',
  2195. label: 'label'
  2196. },
  2197. isNew: false,
  2198. selected: false,
  2199. valuet: new Date(),
  2200. domObj: null,
  2201. participator:[],
  2202. chosenMembCount:0,
  2203. jsDay: 0,
  2204. jsTime: 0,
  2205. falsss: false,
  2206. weidu: [],
  2207. weiduList: [],
  2208. yonghuUser: [],
  2209. dateAr: [],
  2210. batchSubFillDialog: false,
  2211. isSubstiS: false,
  2212. fillWeekDialogVisi: false,
  2213. fillWeekDialogVisiCustom: false,
  2214. zhoData: [],
  2215. weekDateRange: [],
  2216. btnZho: false,
  2217. weekDataLoading: false,
  2218. changdu: 6,
  2219. tianxieDialogVisible: false,
  2220. scopess: {},
  2221. zhoBao: {
  2222. time: '',
  2223. workingTime: '',
  2224. progress: '',
  2225. con: '',
  2226. subProjectId: '',
  2227. stage: '',
  2228. subProjectList: [],
  2229. stages: [],
  2230. },
  2231. zhoBaoIdx: '',
  2232. zhoBaoName: '',
  2233. zhis: {},
  2234. dealList: [],
  2235. toViewDialogVisible: false,
  2236. toViewList: [],
  2237. toViewloading: true,
  2238. toViewForm: {
  2239. pageIndex: '1',
  2240. pageSize: '20',
  2241. total: 0,
  2242. },
  2243. toViewloadings: false,
  2244. tabPositionss: 'top',
  2245. monthTotal: 0,
  2246. monthTotalPage: 0,
  2247. monthTotalLages: 20,
  2248. monthWorkData: [],
  2249. monthNotWorkDate: [],
  2250. monthWorkDataS1: [],
  2251. monthnotTotal: 0,
  2252. monthnotTotalPage: 0,
  2253. monthnotTotalLages: 20,
  2254. monthNotWorkDateS1: [],
  2255. deptMembDataText: '',
  2256. isFlag: false,
  2257. isMore: false,
  2258. stateKey: '0',
  2259. expandDate: [],
  2260. notifySelList:[],
  2261. departmentList: [],
  2262. approvalProcessDialog: false,
  2263. approvalProcessData: [],
  2264. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2265. 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')],
  2266. isWeekend: false,
  2267. canCancelInDialog: false,
  2268. approveinData: {},
  2269. approveinDialog: false,
  2270. reportCanDelete: false,
  2271. weeklyFilledTimeDialog: false,
  2272. weeklyFilledTimeList: [],
  2273. weeklyFilledTimeLoading: false,
  2274. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2275. weeklyFilledTimeCanDelete: false,
  2276. weeklyFilledTimeDate: null,
  2277. leaveAllNum: 0,
  2278. dataLoading: false,
  2279. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2280. vacationTime: {},
  2281. integrationProjectList: [],
  2282. totalReportHours: 0, // 合计的工时
  2283. workTimeForMinYi:0,
  2284. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2285. weekIndex: 1,
  2286. weekParentData: {},
  2287. deptIdForNoReport:[],
  2288. nameAearch: '', // 企业微信姓名搜索
  2289. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2290. deptMembDataLoading: false,
  2291. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2292. {
  2293. id: 4811,
  2294. // id: 10,
  2295. name: '陕西柘中建设工程有限公司'
  2296. }
  2297. ],
  2298. pushWorkTimeLogDig:false,
  2299. pushWorkTimeLogData:[],
  2300. WorktimeDatepickValueForMonth:[],
  2301. };
  2302. },
  2303. watch: {
  2304. deptMembDataText(val) {
  2305. this.$refs.chooseMembTree.filter(val);
  2306. }
  2307. },
  2308. filters: {
  2309. // 过滤
  2310. amounts(value) {
  2311. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2312. return 0
  2313. }
  2314. var zhi = +value + 0
  2315. return zhi.toFixed(1)
  2316. },
  2317. // zhoData
  2318. zhoData(value, arr) {
  2319. var dateArray = value.split("-");
  2320. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2321. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2322. // console.log(arr[date.getDay()])
  2323. // return "周" + "日一二三四五六".charAt(date.getDay());
  2324. return arr[date.getDay()]
  2325. },
  2326. // 过滤数字
  2327. numbers(value) {
  2328. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2329. return 0
  2330. }
  2331. return value
  2332. },
  2333. },
  2334. computed: {},
  2335. mounted() {
  2336. var now = new Date();
  2337. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2338. this.today = t;
  2339. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2340. this.exportParam.dateRange = [startStr,t];
  2341. this.getAllDate(1);
  2342. this.getReportList();
  2343. this.getProjectList();
  2344. this.getFillProjectList();
  2345. this.getTimeType();
  2346. this.getDepartment();
  2347. this.scrollFunction()
  2348. this.userssHu();
  2349. this.getFirstAndLastDay()
  2350. if(this.user.timeType.reportAuditType == 3){
  2351. this.getAllUsersList()
  2352. }
  2353. if (this.user.company.packageProject == 1) {
  2354. this.getBasecostItemList();
  2355. }
  2356. if(this.user.timeType.lockWorktime){
  2357. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2358. }
  2359. //设置了下限
  2360. if (this.user.timeType.minReportTime) {
  2361. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2362. }
  2363. const that = this
  2364. if(this.user.userNameNeedTranslate == 1) {
  2365. that.dataLoading = that.$store.state.dataLoading
  2366. this.upDataLoading()
  2367. setTimeout(()=>{
  2368. that.dataLoading = that.$store.state.dataLoading
  2369. }, 1000)
  2370. }
  2371. if (this.user.companyId == this.yuzhongCompId) {
  2372. this.getJobResponList();
  2373. }
  2374. },
  2375. methods: {
  2376. ...mapMutations(['upDataLoading']),
  2377. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2378. isCustomization(userInfo, permissionArray) {
  2379. const { companyId } = userInfo
  2380. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2381. return isReportPictureRequired
  2382. },
  2383. //任务被选中
  2384. onTaskSelected(domainItem) {
  2385. //取服务
  2386. if (domainItem.taskId) {
  2387. var that = this;
  2388. var param = {taskId:domainItem.taskId};
  2389. if (this.isSubstitude) {
  2390. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2391. param.userId = this.workForm.userId[0];
  2392. }
  2393. }
  2394. this.http.post('/task/getMyTaskService',param, res => {
  2395. if (res.code == "ok") {
  2396. // domainItem.workContentList = res.data;
  2397. that.$set(domainItem, 'sapServiceId', null);
  2398. that.$set(domainItem, 'serviceList', res.data);
  2399. } else {
  2400. this.$message({
  2401. message: res.msg,
  2402. type: "error"
  2403. });
  2404. }
  2405. },error => {
  2406. this.$message({
  2407. message: error,
  2408. type: "error"
  2409. });
  2410. }
  2411. );
  2412. } else {
  2413. //清空服务
  2414. }
  2415. },
  2416. onBatchTimeChange() {
  2417. //反向计算每日工作时长
  2418. if (this.workForm.createDate) {
  2419. let sdate = new Date(this.workForm.createDate[0]);
  2420. let edate = new Date(this.workForm.createDate[1]);
  2421. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2422. console.log('days===', days)
  2423. if (days < 0) {
  2424. return;
  2425. }
  2426. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2427. //总时长发生改变,自动按比例计算
  2428. this.workForm.domains.forEach(d=>{
  2429. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2430. });
  2431. }
  2432. },
  2433. //更新工作内容列表
  2434. updateJobContent(domainItem) {
  2435. var that = this;
  2436. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2437. if (res.code == "ok") {
  2438. // domainItem.workContentList = res.data;
  2439. that.$set(domainItem, 'extraField3', null);
  2440. that.$set(domainItem, 'workContentList', res.data);
  2441. } else {
  2442. this.$message({
  2443. message: res.msg,
  2444. type: "error"
  2445. });
  2446. }
  2447. },error => {
  2448. this.$message({
  2449. message: error,
  2450. type: "error"
  2451. });
  2452. }
  2453. );
  2454. },
  2455. updateResponse(domainItem) {
  2456. var that = this;
  2457. var selectPid = domainItem.projectId;
  2458. domainItem.extraField2 = null;
  2459. domainItem.extraField3 = null;
  2460. if (selectPid && domainItem.extraField1) {
  2461. //是否非项目
  2462. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2463. console.log('==========','isPublic=='+isPublic);
  2464. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2465. console.log(filteredRespList);
  2466. domainItem.filteredRespList = filteredRespList;
  2467. }
  2468. },
  2469. getJobResponList() {
  2470. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2471. if (res.code == "ok") {
  2472. this.jobResponseList = res.data;
  2473. } else {
  2474. this.$message({
  2475. message: res.msg,
  2476. type: "error"
  2477. });
  2478. }
  2479. },error => {
  2480. this.$message({
  2481. message: error,
  2482. type: "error"
  2483. });
  2484. }
  2485. );
  2486. },
  2487. openModImportTime(row) {
  2488. this.showModImportTimeDialog = true;
  2489. this.modItemDataId = row.id;
  2490. },
  2491. delImportTime(row) {
  2492. let rowId = row.id;
  2493. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2494. confirmButtonText: this.$t('btn.determine'),
  2495. cancelButtonText: this.$t('btn.cancel'),
  2496. type: "warning"
  2497. })
  2498. .then(() => {
  2499. this.http.post('/report-import-log/delete',{
  2500. id: rowId
  2501. },res => {
  2502. if (res.code == "ok") {
  2503. this.$message({
  2504. message: '删除成功',
  2505. type: "success"
  2506. });
  2507. this.getToView();
  2508. } else {
  2509. this.$message({
  2510. message: res.msg,
  2511. type: "error"
  2512. });
  2513. }
  2514. },error => {
  2515. this.$message({
  2516. message: error,
  2517. type: "error"
  2518. });
  2519. }
  2520. );
  2521. }).catch(() => {this.startDeleting = false});
  2522. },
  2523. confirmChangeModTime() {
  2524. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2525. this.$message({
  2526. message: '请选择时间',
  2527. type: "error"
  2528. });
  2529. return;
  2530. }
  2531. this.http.post('/report-import-log/changeTime',{
  2532. modLogDateTime: this.modImportTime,
  2533. modImportUserId: this.modImportUserId,
  2534. id: this.modItemDataId
  2535. },res => {
  2536. if (res.code == "ok") {
  2537. this.$message({
  2538. message: '修改成功',
  2539. type: "success"
  2540. });
  2541. this.getToView();
  2542. this.showModImportTimeDialog = false;
  2543. } else {
  2544. this.$message({
  2545. message: res.msg,
  2546. type: "error"
  2547. });
  2548. }
  2549. },error => {
  2550. this.$message({
  2551. message: error,
  2552. type: "error"
  2553. });
  2554. }
  2555. );
  2556. },
  2557. confirmBatchApproveReport() {
  2558. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2559. this.$message({
  2560. message: '请选择日期范围',
  2561. type: "error"
  2562. });
  2563. return;
  2564. }
  2565. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2566. confirmButtonText: this.$t('btn.determine'),
  2567. cancelButtonText: this.$t('btn.cancel'),
  2568. type: "warning"
  2569. })
  2570. .then(() => {
  2571. this.startDeleting = true;
  2572. let obj = {
  2573. startDate: this.deleteReportParam.date[0],
  2574. endDate: this.deleteReportParam.date[1]
  2575. }
  2576. if(this.deleteReportParam.departmentId) {
  2577. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2578. } else {
  2579. obj.departmentId = null
  2580. }
  2581. this.http.post('/report/batchApproveByDate',obj,res => {
  2582. if (res.code == "ok") {
  2583. this.$message({
  2584. message: '审核通过',
  2585. type: "success"
  2586. });
  2587. this.getReportList();
  2588. this.getDepartment();
  2589. this.startDeleting = false;
  2590. } else {
  2591. this.$message({
  2592. message: res.msg,
  2593. type: "error"
  2594. });
  2595. }
  2596. },error => {
  2597. this.$message({
  2598. message: error,
  2599. type: "error"
  2600. });
  2601. }
  2602. );
  2603. }).catch(() => {this.startDeleting = false});
  2604. },
  2605. confirmBatchDelReport() {
  2606. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2607. this.$message({
  2608. message: '请选择部门或人员',
  2609. type: "error"
  2610. });
  2611. return;
  2612. }
  2613. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2614. this.$message({
  2615. message: '请选择日期范围',
  2616. type: "error"
  2617. });
  2618. return;
  2619. }
  2620. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2621. confirmButtonText: this.$t('btn.determine'),
  2622. cancelButtonText: this.$t('btn.cancel'),
  2623. type: "warning"
  2624. })
  2625. .then(() => {
  2626. this.startDeleting = true;
  2627. this.http.post('/report/batchDelete',{
  2628. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2629. startDate: this.deleteReportParam.date[0],
  2630. endDate: this.deleteReportParam.date[1],
  2631. deptId: this.deleteReportParam.deptId[0]
  2632. },res => {
  2633. if (res.code == "ok") {
  2634. this.$message({
  2635. message: this.$t('message.successfullyDeleted'),
  2636. type: "success"
  2637. });
  2638. this.getReportList();
  2639. this.getDepartment();
  2640. this.startDeleting = false;
  2641. } else {
  2642. this.$message({
  2643. message: res.msg,
  2644. type: "error"
  2645. });
  2646. }
  2647. },error => {
  2648. this.$message({
  2649. message: error,
  2650. type: "error"
  2651. });
  2652. }
  2653. );
  2654. }).catch(() => {this.startDeleting = false});
  2655. },
  2656. getRecentlyProject() {
  2657. this.http.post('/project/nearProject',{},res => {
  2658. if(res.code == 'ok'){
  2659. let topObj = {
  2660. label: '最近选择项目',
  2661. peojectList: res.data
  2662. }
  2663. let botomObj = {
  2664. label: '全部项目',
  2665. peojectList: this.fillProjectList
  2666. }
  2667. //最近项目如果在fillProjectList中不存在,需要移除
  2668. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2669. this.integrationProjectList = [topObj, botomObj]
  2670. }else {
  2671. this.$message({
  2672. message: res.msg,
  2673. type: 'error'
  2674. })
  2675. }
  2676. },err => {
  2677. this.$message({
  2678. message: err,
  2679. type: 'error'
  2680. })
  2681. })
  2682. },
  2683. handlePictureCardPreview(file, index) {
  2684. console.log(file, index)
  2685. let arr = []
  2686. let imgArr = this.workForm.domains[index].imgListUrl
  2687. for(var i in imgArr) {
  2688. arr.push(imgArr[i].url)
  2689. }
  2690. console.log(arr, '图片数据')
  2691. const $viewer = this.$viewerApi({
  2692. images: arr
  2693. });
  2694. },
  2695. // 图片上传
  2696. addImg(e, index) {
  2697. console.log(e, '数据')
  2698. let formData = new FormData()
  2699. formData.append('multipartFile', e.file)
  2700. this.http.uploadFile('/common/uploadFile', formData,
  2701. res => {
  2702. if (res.code == "ok") {
  2703. this.$message({
  2704. message: this.$t('uploadedsuccessfully'),
  2705. type: "success"
  2706. });
  2707. if(!this.workForm.domains[index].imgList) {
  2708. this.workForm.domains[index].imgList = []
  2709. this.workForm.domains[index].imgListUrl = []
  2710. }
  2711. this.workForm.domains[index].imgList.push(res.data)
  2712. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2713. } else {
  2714. this.$message({message: res.msg,type: "error"});
  2715. }
  2716. console.log(this.workForm.domains[index])
  2717. },
  2718. error => {this.$message({message: error,type: "error"});
  2719. });
  2720. },
  2721. // 删除图片
  2722. delImg(file,fileList, index) {
  2723. console.log(file, fileList)
  2724. let idx = 0
  2725. for(let i in fileList) {
  2726. if(fileList[i].uid == file.uid) {
  2727. idx = i
  2728. }
  2729. }
  2730. this.workForm.domains[index].imgList.splice(idx, 1)
  2731. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2732. console.log(this.workForm.domains[index])
  2733. },
  2734. test(){
  2735. console.log('test',this.workForm.domains);
  2736. },
  2737. getHour(s1, s2) {
  2738. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2739. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2740. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2741. var ms = s2.getTime() - s1.getTime();
  2742. if (ms < 0) return 0;
  2743. let ma = ms / 1000 / 60 / 60
  2744. return ma; //小时
  2745. },
  2746. refreshWXCardTime(workdate) {
  2747. if (!workdate) return;
  2748. this.syncTimeLoading = true;
  2749. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2750. date: workdate,
  2751. },res => {
  2752. this.syncTimeLoading = false;
  2753. if(res.code == 'ok'){
  2754. this.workForm.time = res.data.time;
  2755. }else {
  2756. this.$message({
  2757. message: res.msg,
  2758. type: 'error'
  2759. })
  2760. }
  2761. },err => {
  2762. this.syncTimeLoading = false;
  2763. this.$message({
  2764. message: err,
  2765. type: 'error'
  2766. })
  2767. })
  2768. },
  2769. refreshAttendance(workdate) {
  2770. if (!workdate) return;
  2771. this.syncTimeLoading = true;
  2772. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2773. startDate: workdate[0],
  2774. endDate: workdate[1]
  2775. },res => {
  2776. this.syncTimeLoading = false;
  2777. if(res.code == 'ok'){
  2778. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2779. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2780. this.totalReportHours = this.workTimeForMinYi;
  2781. }else {
  2782. this.$message({
  2783. message: res.msg,
  2784. type: 'error'
  2785. })
  2786. }
  2787. },err => {
  2788. this.syncTimeLoading = false;
  2789. this.$message({
  2790. message: err,
  2791. type: 'error'
  2792. })
  2793. })
  2794. },
  2795. refreshBeiSengAttendance(workdate) {
  2796. if (!workdate) return;
  2797. this.syncTimeLoading = true;
  2798. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2799. createDate: workdate
  2800. },res => {
  2801. this.syncTimeLoading = false;
  2802. if(res.code == 'ok'){
  2803. this.workForm.time = res.data;
  2804. }else {
  2805. this.$message({
  2806. message: res.msg,
  2807. type: 'error'
  2808. })
  2809. }
  2810. },err => {
  2811. this.syncTimeLoading = false;
  2812. this.$message({
  2813. message: err,
  2814. type: 'error'
  2815. })
  2816. })
  2817. },
  2818. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2819. this.weeklyFilledTimeDialog = true
  2820. this.weeklyFilledTimeLoading = true
  2821. this.weeklyFilledTimeDate = parameterDate
  2822. this.http.post('/report/getReportList',{
  2823. date: parameterDate,
  2824. userId: this.user.id
  2825. },res => {
  2826. this.weeklyFilledTimeLoading = false
  2827. if(res.code == 'ok'){
  2828. this.weeklyFilledTimeList = res.data[0].data
  2829. let candelete = true
  2830. for(let i in this.weeklyFilledTimeList){
  2831. if(this.weeklyFilledTimeList[i].state < 2){
  2832. candelete = false
  2833. }
  2834. }
  2835. this.weeklyFilledTimeCanDelete = candelete
  2836. }else {
  2837. this.$message({
  2838. message: res.msg,
  2839. type: 'error'
  2840. })
  2841. }
  2842. },err => {
  2843. this.weeklyFilledTimeLoading = false
  2844. this.$message({
  2845. message: err,
  2846. type: 'error'
  2847. })
  2848. })
  2849. },
  2850. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2851. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2852. confirmButtonText: this.$t('btn.determine'),
  2853. cancelButtonText: this.$t('btn.cancel'),
  2854. type: "warning"
  2855. })
  2856. .then(() => {
  2857. this.http.post('/report/delete',{
  2858. userId: this.user.id,
  2859. date: this.weeklyFilledTimeDate
  2860. },res => {
  2861. if (res.code == "ok") {
  2862. this.$message({
  2863. message: this.$t('message.successfullyDeleted'),
  2864. type: "success"
  2865. });
  2866. this.getWeeklyWorkTime()
  2867. this.getReportList();
  2868. this.getDepartment();
  2869. this.weeklyFilledTimeDialog = false;
  2870. } else {
  2871. this.$message({
  2872. message: res.msg,
  2873. type: "error"
  2874. });
  2875. }
  2876. },error => {
  2877. this.$message({
  2878. message: error,
  2879. type: "error"
  2880. });
  2881. }
  2882. );
  2883. }).catch(() => {});
  2884. },
  2885. getApprovalProcess(item){
  2886. // console.log('this.date',this.choseDate);
  2887. this.http.post('/report-log/get',{
  2888. creatorId: item.id,
  2889. createDate: sessionStorage.msg
  2890. },res => {
  2891. if(res.code == 'ok'){
  2892. this.approvalProcessDialog = true
  2893. if(this.user.userNameNeedTranslate == 1) {
  2894. for(var i in res.data) {
  2895. let obj = {
  2896. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2897. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2898. }
  2899. res.data[i].msgCon = obj
  2900. }
  2901. }
  2902. this.approvalProcessData = res.data
  2903. console.log(this.approvalProcessData, '数据卡看')
  2904. }else{
  2905. this.$message({
  2906. message: res.msg,
  2907. type: 'error'
  2908. })
  2909. }
  2910. },err => {
  2911. this.$message({
  2912. message: err,
  2913. type: 'error'
  2914. })
  2915. })
  2916. },
  2917. filterNode(value, data) {
  2918. if (!value) return true;
  2919. return data.label.indexOf(value) !== -1;
  2920. },
  2921. triggerCalculateOT(index) {
  2922. var str = this.workForm.domains[index].overtimeHours + ''
  2923. if(str.indexOf('.') != '-1') {
  2924. var s = str.split('.')[0]
  2925. var st = str.split('.')[1]
  2926. var sts = st.split('')
  2927. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2928. }
  2929. },
  2930. searchScreen(e){
  2931. if(e){
  2932. this.monthNotWorkDateS1 = []
  2933. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2934. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2935. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2936. }
  2937. }
  2938. if (this.monthNotWorkDateS1.length > 50) {
  2939. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2940. }else{
  2941. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2942. }
  2943. // if (this.monthNotWorkDateS1.length > 0) {
  2944. // setTimeout(() => {
  2945. // this.tableListenernot()
  2946. // }, 1000);
  2947. // }
  2948. }else{
  2949. this.monthWorkDataS1 = []
  2950. for (let i = 0; i < this.monthWorkData.length; i++) {
  2951. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2952. this.monthWorkDataS1.push(this.monthWorkData[i])
  2953. }
  2954. }
  2955. if (this.monthWorkDataS1.length > 50) {
  2956. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2957. }else{
  2958. this.monthWorkDataS = this.monthWorkDataS1
  2959. }
  2960. // if (this.monthWorkDataS1.length > 0) {
  2961. // setTimeout(() => {
  2962. // this.tableListener()
  2963. // }, 1000);
  2964. // }
  2965. }
  2966. },
  2967. addUpload(data) {
  2968. // var zhi = data.fileName.split('.')[0]
  2969. // var sss = zhi + '.xlsx'
  2970. // return
  2971. var filePath = '/upload/' + data.serverName;
  2972. const a = document.createElement('a'); // 创建a标签
  2973. a.setAttribute('download', data.fileName);// download属性
  2974. a.setAttribute('href', filePath);// href链接
  2975. a.click(); //自执行点击事件
  2976. a.remove();
  2977. },
  2978. restrictNumber(targetId) {
  2979. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2980. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2981. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2982. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2983. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2984. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2985. inpu.value = parseFloat(inpu.value);
  2986. }
  2987. },
  2988. //获取项目下的任务分组
  2989. getTaskGroups(domain, index) {
  2990. domain.groupId=null;
  2991. this.http.post('/task-group/listMyJoinGroup',{
  2992. projectId: domain.projectId,
  2993. isSubstitude: this.isSubstitude ? 1 : 0
  2994. },
  2995. res => {
  2996. if (res.code == "ok") {
  2997. this.workForm.domains[index].taskGroups = res.data;
  2998. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2999. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3000. // this.getGroupStages(domain, index);
  3001. // }
  3002. this.$forceUpdate();
  3003. }
  3004. },
  3005. error => {
  3006. this.$message({
  3007. message: error,
  3008. type: "error"
  3009. });
  3010. }
  3011. );
  3012. },
  3013. //下载填报工时占比报表
  3014. downloadProjectRatio() {
  3015. this.exportUserRatio = true;
  3016. // let now = new Date();
  3017. // let month = now.getMonth();//默认看上个月的
  3018. // let monthStr = month<10? ('0'+month): month;
  3019. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3020. const today = new Date();
  3021. const year = today.getFullYear();
  3022. const month = today.getMonth() + 1;
  3023. let lastMonthYear, lastMonth;
  3024. if (month === 1) {
  3025. lastMonthYear = year - 1;
  3026. lastMonth = 12;
  3027. } else {
  3028. lastMonthYear = year;
  3029. lastMonth = month - 1;
  3030. }
  3031. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3032. console.log('赋值 ==>', this.ratioYmonth)
  3033. },
  3034. confirmDownloadRatio() {
  3035. this.startRatioExporting = true;
  3036. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3037. ymonth: this.ratioYmonth
  3038. },
  3039. res => {
  3040. if (res.code == "ok") {
  3041. this.startRatioExporting = false;
  3042. var filePath = res.data;
  3043. const a = document.createElement('a'); // 创建a标签
  3044. var data = filePath.split("/");
  3045. a.setAttribute('download', data[data.length-1]);// download属性
  3046. a.setAttribute('href', filePath);// href链接
  3047. a.click(); //自执行点击事件
  3048. a.remove();
  3049. } else {
  3050. this.startRatioExporting = false;
  3051. this.$message({
  3052. message: res.msg,
  3053. type: "error"
  3054. });
  3055. }
  3056. },
  3057. error => {
  3058. this.checkinLoading = false;
  3059. this.$message({
  3060. message: error,
  3061. type: "error"
  3062. });
  3063. }
  3064. );
  3065. },
  3066. //下载带企业微信考勤数据的工时统计模板
  3067. downloadCheckInExcel() {
  3068. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3069. startDate: this.importWxParam.date[0],
  3070. endDate: this.importWxParam.date[1],
  3071. },
  3072. res => {
  3073. if (res.code == "ok") {
  3074. var filePath = res.data;
  3075. const a = document.createElement('a'); // 创建a标签
  3076. var data = filePath.split("/");
  3077. a.setAttribute('download', data[data.length-1]);// download属性
  3078. a.setAttribute('href', filePath);// href链接
  3079. a.click(); //自执行点击事件
  3080. a.remove();
  3081. } else {
  3082. this.$message({
  3083. message: res.msg,
  3084. type: "error"
  3085. });
  3086. }
  3087. },
  3088. error => {
  3089. this.checkinLoading = false;
  3090. this.$message({
  3091. message: error,
  3092. type: "error"
  3093. });
  3094. }
  3095. );
  3096. },
  3097. pre() {
  3098. if (this.active == 0) return;
  3099. this.active--;
  3100. },
  3101. next() {
  3102. this.active++;
  3103. },
  3104. triggerTotalTime(index) {
  3105. var item = this.checkinList[index];
  3106. var total = 0.0;
  3107. for (var i=0;i<this.projectColumns.length; i++) {
  3108. var key = this.projectColumns[i];
  3109. if (item[key] != null && item[key] != '') {
  3110. total += parseFloat(item[key]);
  3111. }
  3112. }
  3113. item.totalFillTime = total;
  3114. },
  3115. //提交批量代填的数据
  3116. submitBatchSubFillData() {
  3117. var data = JSON.stringify(this.checkinList);
  3118. this.http.post('/user-corpwx-time/submitProjectTime',{
  3119. json: data,
  3120. projectColumns: JSON.stringify(this.projectColumns)
  3121. },
  3122. res => {
  3123. if (res.code == "ok") {
  3124. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3125. this.importWxDialog = false;
  3126. }
  3127. },
  3128. error => {
  3129. this.checkinLoading = false;
  3130. this.$message({
  3131. message: error,
  3132. type: "error"
  3133. });
  3134. }
  3135. );
  3136. },
  3137. loadCheckInData() {
  3138. if (this.importWxParam.date == null) {
  3139. this.checkinList = [];
  3140. return;
  3141. }
  3142. this.checkinLoading = true;
  3143. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3144. startDate: this.importWxParam.date[0],
  3145. endDate: this.importWxParam.date[1],
  3146. },
  3147. res => {
  3148. if (res.code == "ok") {
  3149. this.checkinLoading = false;
  3150. this.checkinList = res.data.list;
  3151. this.projectColumns = res.data.projects;
  3152. // 自定义表格会导致表格错乱,需重新计算表格
  3153. this.$nextTick(()=>{
  3154. this.$refs.tab.doLayout()
  3155. })
  3156. }
  3157. },
  3158. error => {
  3159. this.checkinLoading = false;
  3160. this.$message({
  3161. message: error,
  3162. type: "error"
  3163. });
  3164. }
  3165. );
  3166. },
  3167. importCardTime(item) {
  3168. //首先判断文件类型
  3169. let str = item.file.name.split(".");
  3170. let format = str[str.length - 1];
  3171. if (format != "xls" && format != "xlsx") {
  3172. this.$message({
  3173. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3174. type: "error"
  3175. });
  3176. } else {
  3177. this.importingData = true;
  3178. let formData = new FormData();
  3179. formData.append("multipartFile", item.file);
  3180. formData.append("companyId", this.user.companyId);
  3181. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3182. res => {
  3183. this.$refs.uploadCardTime.clearFiles();
  3184. this.importingData = false;
  3185. if (res.code == "ok") {
  3186. //换成弹出框,以免有人等了半天回来啥也没看到
  3187. this.$message({
  3188. message: '导入考勤时长成功',
  3189. type: "success"
  3190. });
  3191. } else {
  3192. this.$message({
  3193. message: res.msg,
  3194. type: "error"
  3195. });
  3196. }
  3197. },
  3198. error => {
  3199. this.$refs.upload.clearFiles();
  3200. this.listLoading = false;
  3201. this.$message({
  3202. message: error,
  3203. type: "error"
  3204. });
  3205. });
  3206. }
  3207. },
  3208. batchImportWxData(item) {
  3209. //首先判断文件类型
  3210. let str = item.file.name.split(".");
  3211. let format = str[str.length - 1];
  3212. if (format != "xls" && format != "xlsx") {
  3213. this.$message({
  3214. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3215. type: "error"
  3216. });
  3217. } else {
  3218. this.importingData = true;
  3219. let formData = new FormData();
  3220. formData.append("file", item.file);
  3221. formData.append("companyId", this.user.companyId);
  3222. formData.append("withCheckIn", 1);
  3223. this.http.uploadFile('/report/importData', formData,
  3224. res => {
  3225. this.$refs.upload.clearFiles();
  3226. this.showImportResult = true;
  3227. this.importingData = false;
  3228. if (res.code == "ok") {
  3229. //换成弹出框,以免有人等了半天回来啥也没看到
  3230. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3231. this.getReportList();
  3232. this.importWxDialog = false;
  3233. } else {
  3234. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3235. }
  3236. },
  3237. error => {
  3238. this.$refs.upload.clearFiles();
  3239. this.listLoading = false;
  3240. this.$message({
  3241. message: error,
  3242. type: "error"
  3243. });
  3244. });
  3245. }
  3246. },
  3247. batchImportData(item) {
  3248. //首先判断文件类型
  3249. let str = item.file.name.split(".");
  3250. let format = str[str.length - 1];
  3251. if (format != "xls" && format != "xlsx") {
  3252. this.$message({
  3253. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3254. type: "error"
  3255. });
  3256. } else {
  3257. this.importingData = true;
  3258. let formData = new FormData();
  3259. formData.append("file", item.file);
  3260. formData.append("companyId", this.user.companyId);
  3261. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3262. this.http.uploadFile(url, formData,
  3263. res => {
  3264. this.$refs.upload.clearFiles();
  3265. this.importingData = false;
  3266. this.showImportResult = true;
  3267. if (res.code == "ok") {
  3268. //换成弹出框,以免有人等了半天回来啥也没看到
  3269. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3270. this.getReportList();
  3271. this.importWXDialog = false;
  3272. } else {
  3273. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3274. }
  3275. },
  3276. error => {
  3277. this.$refs.upload.clearFiles();
  3278. this.importingData = false;
  3279. this.$message({
  3280. message: error,
  3281. type: "error"
  3282. });
  3283. });
  3284. }
  3285. },
  3286. userssHu() {
  3287. this.http.post('/time-type/getCompanyTimeSetting',{
  3288. companyId: this.user.companyId
  3289. },
  3290. res => {
  3291. if (res.code == "ok") {
  3292. this.yonghuUser = res.data
  3293. }
  3294. },
  3295. error => {
  3296. this.$message({
  3297. message: error,
  3298. type: "error"
  3299. });
  3300. }
  3301. );
  3302. },
  3303. iptBlur(i) {
  3304. if(this.isBatch == 0) {
  3305. return
  3306. }
  3307. var reqParam = {
  3308. startDate: this.workForm.createDate[0],
  3309. endDate: this.workForm.createDate[1]
  3310. };
  3311. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3312. reqParam.userId = this.workForm.userId[0];
  3313. }
  3314. this.http.post('/report/getWorkDays',reqParam,
  3315. res => {
  3316. if (res.code == "ok") {
  3317. this.jsDay = res.data
  3318. this.chuji(i)
  3319. } else {
  3320. this.$message({
  3321. message: res.msg,
  3322. type: "error"
  3323. });
  3324. }
  3325. },
  3326. error => {
  3327. this.$message({
  3328. message: error,
  3329. type: "error"
  3330. });
  3331. }
  3332. );
  3333. //明夷硬编码获取
  3334. if (this.user.company.companyName == this.mingyiName) {
  3335. this.getWorkTimeForMinYi();
  3336. }
  3337. },
  3338. getWorkTimeForMinYi(){
  3339. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3340. startDate: this.workForm.createDate[0],
  3341. endDate: this.workForm.createDate[1]
  3342. },
  3343. res => {
  3344. if (res.code == "ok") {
  3345. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3346. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3347. this.totalReportHours = this.workTimeForMinYi;
  3348. } else {
  3349. this.$message({
  3350. message: res.msg,
  3351. type: "error"
  3352. });
  3353. this.workForm.createDate = [];
  3354. }
  3355. },
  3356. error => {
  3357. this.$message({
  3358. message: error,
  3359. type: "error"
  3360. });
  3361. }
  3362. );
  3363. },
  3364. chuji(i) {
  3365. if(i == 0) {
  3366. this.seleChn(1)
  3367. } else if(i == 1) {
  3368. this.seleChn(0)
  3369. } else if(i == 2) {
  3370. if(this.workForm.domains[0].multiWorktime > 0) {
  3371. this.iptChangs()
  3372. } else {
  3373. this.iptChang()
  3374. }
  3375. } else if(i == 3) {
  3376. this.seleChn(0)
  3377. }
  3378. },
  3379. seleChn(e,domain) {
  3380. if(e == 1) {
  3381. for(var i in this.workForm.domains) {
  3382. if(this.workForm.domains[i].timeType == 0) {
  3383. this.workForm.domains[i].workingTime = 8
  3384. } else {
  3385. this.workForm.domains[i].workingTime = 4
  3386. }
  3387. }
  3388. }
  3389. var quanbu = 0
  3390. var spl = this.workForm.domains
  3391. var zhi = ''
  3392. for(var i in spl) {
  3393. var sp = +spl[i].workingTime + 0
  3394. zhi = this.jsDay * sp
  3395. quanbu = +quanbu + zhi
  3396. }
  3397. this.jsTime = quanbu
  3398. this.totalReportHours = quanbu
  3399. let worktime = this.jsTime
  3400. // 自动计算加班时长
  3401. if(this.isBatch != 0){
  3402. worktime = this.jsTime / this.jsDay
  3403. }
  3404. if(this.user.timeType.fillOvertime && domain){
  3405. let isover = false
  3406. let alltime = 0
  3407. let allover = 0 //此处alltime同上面的worktime
  3408. for(let d in spl){
  3409. if(spl[d].isOvertime){
  3410. isover = true
  3411. allover += spl[d].overtimeHours*1
  3412. }
  3413. alltime += spl[d].workingTime*1
  3414. }
  3415. if(domain.overtimeHours){
  3416. allover = allover - domain.overtimeHours
  3417. }
  3418. if(worktime*1 > this.user.timeType.allday){
  3419. if(isover){
  3420. if(alltime > (allover + this.user.timeType.allday)){
  3421. this.$set(domain,'isOvertime',true)
  3422. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3423. }else{
  3424. this.$set(domain,'isOvertime',false)
  3425. this.$set(domain,'overtimeHours',null)
  3426. if(alltime < (allover + this.user.timeType.allday)){
  3427. let overtime = allover + this.user.timeType.allday - alltime
  3428. for(let pi in spl){
  3429. if(spl[pi].overtimeHours){
  3430. if((overtime - spl[pi].overtimeHours*1) > 0){
  3431. overtime = overtime - spl[pi].overtimeHours*1
  3432. this.$set(spl[pi],'isOvertime',false)
  3433. this.$set(spl[pi],'overtimeHours',null)
  3434. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3435. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3436. break
  3437. }else{
  3438. this.$set(spl[pi],'isOvertime',false)
  3439. this.$set(spl[pi],'overtimeHours',null)
  3440. break
  3441. }
  3442. }
  3443. }
  3444. }
  3445. }
  3446. }else{
  3447. this.$set(domain,'isOvertime',true)
  3448. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3449. }
  3450. }else{
  3451. for(let di in spl){
  3452. this.$set(spl[di],'isOvertime',false)
  3453. this.$set(spl[di],'overtimeHours',null)
  3454. }
  3455. }
  3456. }
  3457. },
  3458. iptChang() {
  3459. var sl = this.workForm.domains
  3460. let timeArr = []
  3461. for(var i in sl) {
  3462. if(sl[i].startTime && sl[i].endTime) {
  3463. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3464. }
  3465. }
  3466. this.getTimeHours(timeArr)
  3467. // for(let j in arrNum) {
  3468. // this.timeJsonStr += arrNum[j]
  3469. // if(flg) {
  3470. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3471. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3472. // }
  3473. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3474. // flg = true
  3475. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3476. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3477. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3478. // }
  3479. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3480. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3481. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3482. // }
  3483. // }
  3484. },
  3485. iptChangs() {
  3486. var sl = this.workForm.domains
  3487. let timeArr = []
  3488. for(var i in sl) {
  3489. for(var j in sl[i].worktimeList){
  3490. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3491. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3492. }
  3493. }
  3494. }
  3495. this.getTimeHours(timeArr)
  3496. },
  3497. // 调用接口或去数据
  3498. getTimeHours(arr) {
  3499. this.http.post('/report/getHoursByTimeRange',{
  3500. timeJsonStr: JSON.stringify(arr)
  3501. },res => {
  3502. if(res.code === 'ok') {
  3503. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3504. } else {
  3505. this.$message({
  3506. message: res.msg,
  3507. type: 'error'
  3508. })
  3509. }
  3510. },err => {
  3511. this.$message({
  3512. message: err,
  3513. type: 'error'
  3514. })
  3515. })
  3516. },
  3517. // 按周填报调用接口计算时间
  3518. async getWeekHoursByTimeRange(timeRange) {
  3519. const url = '/report/getHoursByTimeRange';
  3520. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3521. var that = this;
  3522. return new Promise((resolve, reject) => {
  3523. this.http.post(url, data, function(res) {
  3524. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3525. }, function(err) {
  3526. reject(err);
  3527. });
  3528. });
  3529. },
  3530. removeTimeItem(item, index) {
  3531. item.worktimeList.splice(index, 1);
  3532. this.iptChangs()
  3533. },
  3534. //添加工时
  3535. addNewWorktime(index, item) {
  3536. if(item.worktimeList == null ) {
  3537. item.worktimeList = []
  3538. }
  3539. item.worktimeList.push({});
  3540. },
  3541. //复制项目
  3542. copyProject(index) {
  3543. var leftProgress = 10;
  3544. if (this.reportTimeType.type == 3) {
  3545. //计算已经待分配工时比例
  3546. let array = this.workForm.domains;
  3547. let totalProgress = 0;
  3548. for (var i=0;i<array.length; i++) {
  3549. totalProgress += array[i].progress;
  3550. }
  3551. if (totalProgress < 100) {
  3552. leftProgress = 100 - totalProgress;
  3553. }
  3554. }
  3555. var newIndex = index+1;
  3556. var itemDomain = {
  3557. projectId: this.workForm.domains[index].projectId,
  3558. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3559. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3560. ),
  3561. content: "",
  3562. progress:leftProgress,
  3563. state:2,//2-表示待提交
  3564. };
  3565. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3566. if (this.reportTimeType.type == 0) {
  3567. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3568. var length = this.workForm.domains.length;
  3569. if (length == 2) {
  3570. this.showAddMore = false;
  3571. }
  3572. }
  3573. this.selectProject(itemDomain, newIndex);
  3574. },
  3575. pushWorkTime(reportId){
  3576. let url=''
  3577. if(this.user.timeType.syncSap == 1){
  3578. url='/report/pushProjectReportToSap'
  3579. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3580. var pushDate = this.date + day;
  3581. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3582. confirmButtonText: '确定',
  3583. cancelButtonText: '取消',
  3584. type: 'info'
  3585. }).then(() => {
  3586. const loading = this.$loading({
  3587. lock: true,
  3588. text: '正在推送中,请耐心等待。',
  3589. spinner: 'el-icon-loading',
  3590. background: 'rgba(0, 0, 0, 0.7)'
  3591. });
  3592. this.http.post(url,{
  3593. pushDate: pushDate,
  3594. reportId: reportId
  3595. },res => {
  3596. loading.close();
  3597. if(res.code == 'ok'){
  3598. this.$message({
  3599. type: 'success',
  3600. message: res.data
  3601. });
  3602. }else{
  3603. this.$message({
  3604. type: 'error',
  3605. message: res.msg
  3606. })
  3607. }
  3608. },err => {
  3609. loading.close();
  3610. this.$message({
  3611. type: 'error',
  3612. message: err
  3613. })
  3614. })
  3615. }).catch(() => {
  3616. });
  3617. }else{
  3618. url='/report/pushReportDataToThird'
  3619. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3620. confirmButtonText: '确定',
  3621. cancelButtonText: '取消',
  3622. type: 'info'
  3623. }).then(() => {
  3624. const loading = this.$loading({
  3625. lock: true,
  3626. text: '正在推送中,请耐心等待。',
  3627. spinner: 'el-icon-loading',
  3628. background: 'rgba(0, 0, 0, 0.7)'
  3629. });
  3630. this.http.post(url,{
  3631. yearMonth: this.date
  3632. },res => {
  3633. loading.close();
  3634. if(res.code == 'ok'){
  3635. this.$message({
  3636. type: 'success',
  3637. message: '推送成功!'
  3638. });
  3639. }else{
  3640. this.$message({
  3641. type: 'error',
  3642. message: res.msg
  3643. })
  3644. }
  3645. },err => {
  3646. loading.close();
  3647. this.$message({
  3648. type: 'error',
  3649. message: err
  3650. })
  3651. })
  3652. }).catch(() => {
  3653. });
  3654. }
  3655. },
  3656. showWorkTime(){
  3657. this.monthWorkTimeDialog = true;
  3658. this.searchKeyword = ''
  3659. this.WorktimeDatepickValue = this.istoMonth()
  3660. if(this.WorktimeDatepickValue.length == 0){
  3661. let newdate = new Date();
  3662. let nowdate = newdate.toLocaleDateString();
  3663. let getauto = this.getAutoWeekDate(nowdate)
  3664. let nowwd = [getauto[0],getauto[6]]
  3665. this.WorktimeDatepickValue = nowwd
  3666. }
  3667. this.showMonthWorkTime('first')
  3668. },
  3669. handleClick(t,e){
  3670. if (t.name == "second") {
  3671. this.showMonthNotWorkTime()
  3672. }else if(t.name == "first"){
  3673. this.showMonthWorkTime(t.name)
  3674. }else if(t.name == "third"){
  3675. this.showMonthWorkTimeReminder()
  3676. }
  3677. },
  3678. //导出员工每日填报工时数
  3679. exportMembWorkHours() {
  3680. this.http.post(
  3681. "/report/exportUserDailyWorkTime",
  3682. {
  3683. // month: this.date,
  3684. startDate: this.WorktimeDatepickValue[0],
  3685. endDate: this.WorktimeDatepickValue[1],
  3686. },
  3687. (res) => {
  3688. if (res.code == "ok") {
  3689. let url = res.data;
  3690. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3691. }
  3692. },
  3693. (error) => {
  3694. this.$message({
  3695. message: error,
  3696. type: "error",
  3697. });
  3698. }
  3699. );
  3700. },
  3701. exportMembWorkHoursReminder() {
  3702. this.http.post(
  3703. "/report/exportUserDailyWorkTimeReminder",
  3704. {
  3705. // month: this.date,
  3706. startDate: this.WorktimeDatepickValueForMonth[0],
  3707. endDate: this.WorktimeDatepickValueForMonth[1],
  3708. },
  3709. (res) => {
  3710. if (res.code == "ok") {
  3711. let url = res.data;
  3712. this.downloadByA('工时异常表.xlsx', url);
  3713. }
  3714. },
  3715. (error) => {
  3716. this.$message({
  3717. message: error,
  3718. type: "error",
  3719. });
  3720. }
  3721. );
  3722. },
  3723. exportMembNotWorkHours() {
  3724. this.http.post(
  3725. "/report/exportNoReportUserList",
  3726. {
  3727. // month: this.date,
  3728. startDate: this.WorktimeDatepickValue[0],
  3729. endDate: this.WorktimeDatepickValue[1],
  3730. },
  3731. (res) => {
  3732. if (res.code == "ok") {
  3733. let url = res.data;
  3734. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3735. }
  3736. },
  3737. (error) => {
  3738. this.$message({
  3739. message: error,
  3740. type: "error",
  3741. });
  3742. }
  3743. );
  3744. },
  3745. downloadByA(name, url) {
  3746. const a = document.createElement("a"); // 创建a标签
  3747. a.setAttribute("download", name); // download属性
  3748. a.setAttribute("href", url); // href链接
  3749. a.click(); // 自执行点击事件
  3750. a.remove();
  3751. },
  3752. // 是否本月判断
  3753. istoMonth(){
  3754. let todate = new Date()
  3755. let tomonth = todate.getMonth() + 1
  3756. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3757. if(this.date == adate){
  3758. return []
  3759. }else{
  3760. let sedate = new Date(this.date)
  3761. let semonth = sedate.getMonth() + 1
  3762. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3763. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3764. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3765. return [sedates1, sedates2]
  3766. }
  3767. },
  3768. showMonthWorkTime(t) {
  3769. this.monthTotalPage = 0,
  3770. this.tbload = true
  3771. let parameter={}
  3772. if(t == "first"){
  3773. parameter={
  3774. startDate: this.WorktimeDatepickValue[0],
  3775. endDate: this.WorktimeDatepickValue[1],
  3776. }
  3777. }else{
  3778. parameter={
  3779. startDate: this.WorktimeDatepickValueForMonth[0],
  3780. endDate: this.WorktimeDatepickValueForMonth[1],
  3781. }
  3782. }
  3783. this.http.post(
  3784. "/report/getUserDailyWorkTime",
  3785. // "/report/getNoReportUserList",
  3786. parameter,
  3787. (res) => {
  3788. if (res.code == "ok") {
  3789. this.tbload = false;
  3790. this.pickDateArray = res.data.days;
  3791. // console.log('dataarray',res.data.days);
  3792. this.monthWorkData = res.data.list;
  3793. // this.monthWorkDataS = this.monthWorkData
  3794. // this.monthWorkDataS1 = res.data.list
  3795. this.monthTotal = res.data.list.length
  3796. if (this.monthWorkData.length > 50) {
  3797. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3798. }else{
  3799. this.monthWorkDataS = this.monthWorkData
  3800. }
  3801. this.searchScreen(0)
  3802. // this.monthWorkDataS = infoList
  3803. // 判断
  3804. // if (this.monthWorkDataS1.length > 0) {
  3805. // setTimeout(() => {
  3806. // this.tableListener()
  3807. // }, 1000);
  3808. // }
  3809. this.$nextTick(function(){
  3810. this.$refs.hasworkTbl.doLayout();
  3811. });
  3812. // this.$forceUpdate()
  3813. }
  3814. },
  3815. (error) => {
  3816. this.tbload = false
  3817. this.$message({
  3818. message: error,
  3819. type: "error",
  3820. });
  3821. }
  3822. );
  3823. },
  3824. showMonthWorkTimeReminder() {
  3825. this.monthTotalPage = 0,
  3826. this.tbload = true
  3827. let parameter={}
  3828. parameter={
  3829. startDate: this.WorktimeDatepickValueForMonth[0],
  3830. endDate: this.WorktimeDatepickValueForMonth[1],
  3831. }
  3832. this.http.post(
  3833. "/report/getUserDailyWorkTimeReminder",
  3834. parameter,
  3835. (res) => {
  3836. if (res.code == "ok") {
  3837. this.tbload = false;
  3838. this.monthWorkData = res.data.list;
  3839. this.monthTotal = res.data.list.length
  3840. if (this.monthWorkData.length > 50) {
  3841. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3842. }else{
  3843. this.monthWorkDataS = this.monthWorkData
  3844. }
  3845. this.searchScreen(0)
  3846. this.$nextTick(function(){
  3847. this.$refs.hasworkTbl.doLayout();
  3848. });
  3849. }
  3850. },
  3851. (error) => {
  3852. this.tbload = false
  3853. this.$message({
  3854. message: error,
  3855. type: "error",
  3856. });
  3857. }
  3858. );
  3859. },
  3860. // tableListener(){
  3861. // let that = this;
  3862. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3863. // // 添加scroll监听事件
  3864. // dom.addEventListener("scroll", function () {
  3865. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3866. // if (scrollDistance < 2) {
  3867. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3868. // that.monthTotalPage++; //当前页数自增
  3869. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3870. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3871. // var infoList = arrList.splice(
  3872. // that.monthTotalPage * that.monthTotalLages,
  3873. // that.monthTotalLages
  3874. // );
  3875. // // 数据添加
  3876. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3877. // }
  3878. // }
  3879. // })
  3880. // },
  3881. showMonthNotWorkTime() {
  3882. this.monthTotalPage = 0,
  3883. this.tbload = true,
  3884. this.http.post(
  3885. "/report/getNoReportUserList",
  3886. {
  3887. startDate: this.WorktimeDatepickValue[0],
  3888. endDate: this.WorktimeDatepickValue[1],
  3889. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3890. },
  3891. (res) => {
  3892. if (res.code == "ok") {
  3893. this.tbload = false
  3894. this.monthNotWorkDate = res.data;
  3895. // this.monthNotWorkDateS1 = res.data
  3896. this.monthnotTotal = res.data.length
  3897. // 2222111
  3898. if (this.monthNotWorkDate.length > 50) {
  3899. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3900. } else {
  3901. this.monthNotWorkDateS = this.monthNotWorkDate
  3902. }
  3903. this.searchScreen(1)
  3904. // 判断
  3905. // if (this.monthnotworkDateS1.length > 0) {
  3906. // setTimeout(() => {
  3907. // this.tableListenernot()
  3908. // }, 1000);
  3909. // }
  3910. this.$nextTick(function(){
  3911. this.$refs.hasworkTbl2.doLayout();
  3912. });
  3913. }
  3914. },
  3915. (error) => {
  3916. this.tbload = false
  3917. this.$message({
  3918. message: error,
  3919. type: "error",
  3920. });
  3921. }
  3922. );
  3923. },
  3924. // tableListenernot(){
  3925. // let that = this;
  3926. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3927. // dom.addEventListener("scroll", function () {
  3928. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3929. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3930. // if (scrollDistance2 < 2) {
  3931. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3932. // that.monthnotTotalPage++; //当前页数自增
  3933. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3934. // var infoList = arrList.splice(
  3935. // that.monthnotTotalPage * that.monthnotTotalLages,
  3936. // that.monthnotTotalLages
  3937. // );
  3938. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3939. // }
  3940. // }
  3941. // })
  3942. // },
  3943. listScroll(){
  3944. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3945. this.isMore = true
  3946. setTimeout(()=>{
  3947. this.isMore = false
  3948. },1000)
  3949. }else {
  3950. this.isFlag = true
  3951. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3952. this.monthWorkDataS = datalist
  3953. setTimeout(()=>{
  3954. this.isFlag = false
  3955. },300)
  3956. }
  3957. },
  3958. notListScroll(){
  3959. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3960. this.isMore = true
  3961. setTimeout(()=>{
  3962. this.isMore = false
  3963. },1000)
  3964. }else {
  3965. this.isFlag = true
  3966. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3967. this.monthNotWorkDateS = datalist
  3968. // console.log('length',this.monthNotWorkDateS.length)
  3969. setTimeout(()=>{
  3970. this.isFlag = false
  3971. },300)
  3972. }
  3973. },
  3974. getFirstAndLastDay() {
  3975. // 将选定的月份转换为Date对象
  3976. var monthDate = new Date();
  3977. var year = monthDate.getFullYear();
  3978. var month = monthDate.getMonth();
  3979. // 计算起始日和结束日
  3980. var startDay = new Date(year, month, 1);
  3981. var endDay = new Date(year, month + 1, 0);
  3982. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  3983. this.WorktimeDatepickValueForMonth=lastmd
  3984. },
  3985. formatDate(date) {
  3986. var year = date.getFullYear();
  3987. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  3988. var day = ("0" + date.getDate()).slice(-2);
  3989. return year + "-" + month + "-" + day;
  3990. },
  3991. // 获取默认这zhou日期参数 222
  3992. getLastWeek(e){
  3993. let newdate = new Date()
  3994. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3995. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3996. if(e){
  3997. this.WorktimeDatepickValue = lastwd
  3998. this.showMonthWorkTime('first')
  3999. }else{
  4000. this.WorktimeDatepickValue = lastwd
  4001. this.showMonthNotWorkTime()
  4002. }
  4003. },
  4004. getThisWeek(e){
  4005. let newdate = new Date();
  4006. let nowdate = newdate.toLocaleDateString();
  4007. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4008. if(e){
  4009. this.WorktimeDatepickValue = nowwd
  4010. this.showMonthWorkTime('first')
  4011. }else{
  4012. this.WorktimeDatepickValue = nowwd
  4013. this.showMonthNotWorkTime()
  4014. }
  4015. },
  4016. getDoubleLastWeek(e){
  4017. let newdate = new Date()
  4018. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4019. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4020. if(e){
  4021. this.WorktimeDatepickValue = nextwd
  4022. this.showMonthWorkTime('first')
  4023. }else{
  4024. this.WorktimeDatepickValue = nextwd
  4025. this.showMonthNotWorkTime()
  4026. }
  4027. },
  4028. alreadyAllDate(stime,etime){
  4029. let diffdate = new Array();
  4030. let i=0;
  4031. while(stime<=etime){
  4032. let dateArray = stime.split("-");
  4033. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4034. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4035. let stimewk = this.weekDay[date.getDay()]
  4036. 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')
  4037. 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])
  4038. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4039. let stime_ts = new Date(stime).getTime();
  4040. let next_date = stime_ts + (24*60*60*1000);
  4041. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4042. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4043. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4044. stime = next_dates_y+next_dates_m+next_dates_d;
  4045. i++;
  4046. }
  4047. return diffdate
  4048. },
  4049. getAutoWeekDate(e) {
  4050. let dateString = e;
  4051. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4052. if (dateString.match(dateStringReg)) {
  4053. let presentDate = new Date(dateString),
  4054. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4055. return Array.from(new Array(7), function (val, index) {
  4056. let formatDate = new Date(
  4057. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4058. );
  4059. return (
  4060. formatDate.getFullYear() +
  4061. "-" +
  4062. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4063. "-" +
  4064. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4065. );
  4066. });
  4067. } else {
  4068. throw new Error(
  4069. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4070. );
  4071. }
  4072. },
  4073. onProgressChange() {
  4074. this.$forceUpdate();
  4075. },
  4076. showChooseMembTree() {
  4077. this.chosenMembCount = this.participator.length;
  4078. this.chooseParticipVisible = true;
  4079. },
  4080. onTreeItemChange() {
  4081. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4082. var list = chosenList.filter(item=>item.isUser == 1);
  4083. this.chosenMembCount = list.length;
  4084. },
  4085. findUserInTree() {
  4086. if (this.filterName == '') {
  4087. this.deptMembData = this.allMembData;
  4088. } else {
  4089. var list = this.findRecursively(this.filterName, this.allMembData);
  4090. this.deptMembData = list;
  4091. }
  4092. },
  4093. findRecursively(username, list) {
  4094. var filterList = [];
  4095. for (var i=0;i<list.length; i++) {
  4096. if (list[i].isUser == 1) {
  4097. if (list[i].label.indexOf(username) >= 0) {
  4098. //匹配上了
  4099. filterList.push(list[i]);
  4100. }
  4101. } else if (list[i].children != null && list[i].children.length > 0) {
  4102. var subList = this.findRecursively(username, list[i].children);
  4103. if (subList.length > 0) {
  4104. subList.forEach(s=>filterList.push(s));
  4105. }
  4106. }
  4107. }
  4108. return filterList;
  4109. },
  4110. //确定选择参与人
  4111. chooseParticip() {
  4112. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4113. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4114. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4115. if (this.user.company.packageProject == 1) {
  4116. if (this.chosenMembList.length > 1) {
  4117. this.$message({
  4118. message: '每次仅支持代填一个人',
  4119. type: "error",
  4120. });
  4121. return;
  4122. }
  4123. }
  4124. this.chooseParticipVisible = false;
  4125. this.workForm.userNames = '';
  4126. this.workForm.userId = [];
  4127. this.participator = [];
  4128. for (var i=0;i<this.chosenMembList.length; i++) {
  4129. this.workForm.userId.push(this.chosenMembList[i].id);
  4130. this.workForm.userNames += this.chosenMembList[i].label+',';
  4131. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4132. this.participator.push(item);
  4133. }
  4134. if (this.workForm.userNames.length > 0) {
  4135. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4136. }
  4137. if(this.user.userNameNeedTranslate == 1) {
  4138. if(this.workForm.userNames) {
  4139. this.workForm.userNames = this.workForm.userNames.split(',')
  4140. }
  4141. }
  4142. },
  4143. notifySel(sel){
  4144. // console.log(sel);
  4145. this.notifySelList = sel
  4146. },
  4147. //微信通知人员填写
  4148. Notify(code) {
  4149. if (this.notifySelList.length == 0) return;
  4150. var ids = '';
  4151. this.notifySelList.forEach(f=>{
  4152. ids += f.id+',';
  4153. })
  4154. this.http.post('/user/pushFillReport',{
  4155. ids: ids, date: this.curDate,
  4156. code: code
  4157. },
  4158. res => {
  4159. if (res.code == "ok") {
  4160. this.$message({
  4161. message: this.$t('message.sentSuccessfully'),
  4162. type: "success"
  4163. });
  4164. }
  4165. },
  4166. error => {
  4167. this.$message({
  4168. message: error,
  4169. type: "error"
  4170. });
  4171. }
  4172. );
  4173. },
  4174. //导出人员列表
  4175. exportMemb() {
  4176. if (this.fillMembList.length == 0) return;
  4177. var ids = '';
  4178. this.fillMembList.forEach(f=>{
  4179. ids += f.id+',';
  4180. })
  4181. this.http.post('/user/exportMembList',{
  4182. ids: ids,isFill: this.isFill, date: this.curDate
  4183. },
  4184. res => {
  4185. if (res.code == "ok") {
  4186. var aTag = document.createElement('a');
  4187. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4188. aTag.href = res.data;
  4189. aTag.click();
  4190. }
  4191. },
  4192. error => {
  4193. this.$message({
  4194. message: error,
  4195. type: "error"
  4196. });
  4197. }
  4198. );
  4199. },
  4200. showMembList(fill) {
  4201. this.membListVisible = true;
  4202. if (fill == 0) {
  4203. this.fillMembList = this.unFillList;
  4204. this.isFill = false;
  4205. let leaveList = []
  4206. let unleaveList = []
  4207. for(let i in this.fillMembList){
  4208. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4209. leaveList.push(this.fillMembList[i])
  4210. }else{
  4211. unleaveList.push(this.fillMembList[i])
  4212. }
  4213. }
  4214. this.fillMembList = unleaveList
  4215. this.fillMembList_leave = leaveList
  4216. } else if(fill == 1){
  4217. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4218. this.isFill = true;
  4219. }else{
  4220. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4221. this.isFill = true;
  4222. }
  4223. },
  4224. //获取自己填写的日报状态
  4225. getReportFillStatus() {
  4226. this.http.post('/report/getReportFillStatus',{
  4227. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4228. },
  4229. res => {
  4230. if (res.code == "ok") {
  4231. this.fillStatusList = res.data;
  4232. this.allDate.forEach(d=>{
  4233. var fillInfo = null;
  4234. d.state = null;
  4235. this.fillStatusList.forEach(s=>{
  4236. var d1 = s.createDate.split('-')[2];
  4237. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4238. if (d1.indexOf('0') == 0) {
  4239. d1 = d1.substring(1,d1.length);
  4240. }
  4241. if (d1 == d2) {
  4242. d.state = s.state;
  4243. d.exceedCardTime = s.exceedCardTime
  4244. }
  4245. })
  4246. })
  4247. this.$forceUpdate();
  4248. }
  4249. },
  4250. error => {
  4251. this.$message({
  4252. message: error,
  4253. type: "error"
  4254. });
  4255. }
  4256. );
  4257. },
  4258. scrollFunction () {
  4259. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4260. if (this.domObj.attachEvent) { // IE
  4261. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4262. } else if (this.domObj.addEventListener) {
  4263. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4264. }
  4265. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4266. },
  4267. mouseScroll(event) { // google 浏览器下
  4268. let detail = event.wheelDelta || event.detail
  4269. let moveForwardStep = -1
  4270. let moveBackStep = 1
  4271. let step = 0
  4272. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4273. event.preventDefault() // 阻止浏览器默认事件
  4274. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4275. },
  4276. // //左右滚动
  4277. // wheel(e){
  4278. // var a = document.getElementById("dateScroll");
  4279. // var scroll_width = 80; //滚动一下的距离
  4280. // var e = e || window.event, v;
  4281. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4282. // if(v>3||-v>3) v=-v;
  4283. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4284. // e.preventDefault(); //阻止浏览器的默认滚动
  4285. // },
  4286. showExportDialog() {
  4287. this.exportType = 0
  4288. this.exportDialog = true;
  4289. },
  4290. showExportTimeDialog() {
  4291. this.exportTimeDialog = true;
  4292. },
  4293. changeAllTime() {
  4294. //总时长发生改变,自动按比例计算
  4295. this.workForm.domains.forEach(d=>{
  4296. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4297. });
  4298. //计算jsTime
  4299. if (this.workForm.createDate) {
  4300. let sdate = new Date(this.workForm.createDate[0]);
  4301. let edate = new Date(this.workForm.createDate[1]);
  4302. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4303. console.log('days===', days)
  4304. if (days < 0) {
  4305. days = 0;
  4306. }
  4307. this.jsTime = this.reportTimeType.allday * days;
  4308. }
  4309. },
  4310. // 是否加班的单机事件
  4311. check() {
  4312. this.selected = !this.selected
  4313. this.isNew = this.selected
  4314. },
  4315. updateSubProject() {
  4316. this.$forceUpdate();
  4317. },
  4318. selectDegreeId(domain, index) {
  4319. this.http.post('/report/defaultDegree',{
  4320. projectId: domain.projectId
  4321. },
  4322. res => {
  4323. if (res.code == "ok") {
  4324. if(res.data) {
  4325. this.workForm.domains[index].degreeId = res.data.id + ''
  4326. this.$forceUpdate();
  4327. }
  4328. }
  4329. },
  4330. error => {
  4331. this.$message({
  4332. message: error,
  4333. type: "error"
  4334. });
  4335. }
  4336. );
  4337. },
  4338. //项目选中了, 加载子项目
  4339. selectProject(domain, index) {
  4340. if(!domain.projectId){
  4341. return;
  4342. }
  4343. // 默认选中上次填写的自定义维度
  4344. if(this.yonghuUser.customDegreeActive == 1) {
  4345. this.selectDegreeId(domain, index)
  4346. }
  4347. // console.log('projectId===',domain.projectId);
  4348. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4349. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4350. this.http.post('/sub-project/list',{
  4351. projectId: domain.projectId,
  4352. isReport: true
  4353. },
  4354. res => {
  4355. //清空之前选中的子项目
  4356. // this.workForm.domains[index].subProjectId = 0;
  4357. if (res.code == "ok") {
  4358. this.workForm.domains[index].subProjectList = res.data;
  4359. this.workForm.domains[index].subProjectId = null;
  4360. this.$forceUpdate();
  4361. }
  4362. },
  4363. error => {
  4364. this.$message({
  4365. message: error,
  4366. type: "error"
  4367. });
  4368. }
  4369. );
  4370. //项目相关的近期任务
  4371. if (this.user.company.packageProject == 1) {
  4372. this.getRecentTaskList(domain, index);
  4373. //获取项目相关专业
  4374. if (this.user.company.packageEngineering == 1) {
  4375. this.getProjectProfessions(domain, index);
  4376. }
  4377. //获取项目下的任务分组
  4378. this.getTaskGroups(domain, index);
  4379. }
  4380. // 获取项目相关的维度
  4381. // domain.degreeId = null
  4382. this.$set(domain,'degreeId',null)
  4383. this.$set(domain,'multiDegrIdArray',null)
  4384. this.dimension(domain, index);
  4385. //获取项目审核人
  4386. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4387. this.getProjectAuditorList(domain, index);
  4388. } else {
  4389. //按分组的负责人来审核
  4390. domain.projectAuditorId = null;
  4391. domain.projectAuditorName = null;
  4392. domain.auditUserList = null;
  4393. }
  4394. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4395. if (this.reportTimeType.type == 3) {
  4396. //新增项目时,自动计算
  4397. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4398. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4399. }
  4400. //加载昱众的工作职责
  4401. if (this.user.companyId == this.yuzhongCompId) {
  4402. this.updateResponse(domain);
  4403. }
  4404. },
  4405. getRecentTaskList(domain, index) {
  4406. //刷新任务时,清空服务
  4407. this.$set(domain, 'sapServiceId', null);
  4408. this.$set(domain, 'taskId', null);
  4409. var param = {
  4410. projectId: domain.projectId,
  4411. isSubstitude:this.isSubstitude?1:0,
  4412. };
  4413. if (domain.groupId) {
  4414. param.groupId = domain.groupId;
  4415. }
  4416. if (domain.stage) {
  4417. param.stage = domain.stage;
  4418. }
  4419. //专业版代填,获取代填员工的任务
  4420. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4421. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4422. this.$message({
  4423. message: '请选择代填的员工',
  4424. type: "error"
  4425. });
  4426. return;
  4427. } else {
  4428. param.userId = this.workForm.userId[0];
  4429. }
  4430. }
  4431. this.http.post('/task/getRecentTask',param,
  4432. res => {
  4433. if (res.code == "ok") {
  4434. this.workForm.domains[index].allTaskList = res.data;
  4435. this.workForm.domains[index].taskList = res.data;
  4436. this.$forceUpdate();
  4437. }
  4438. },
  4439. error => {
  4440. this.$message({
  4441. message: error,
  4442. type: "error"
  4443. });
  4444. }
  4445. );
  4446. },
  4447. //获取项目审核人
  4448. getProjectAuditorList(domainItem, index) {
  4449. if(domainItem.projectId == '') {
  4450. return
  4451. }
  4452. domainItem.projectAuditorId = null;
  4453. domainItem.projectAuditorName = null;
  4454. this.http.post('/project-auditor/getList',{
  4455. projectId: domainItem.projectId,
  4456. },
  4457. res => {
  4458. if (res.code == "ok") {
  4459. domainItem.auditUserList = res.data;
  4460. if (res.data.length==0) {
  4461. this.$message({
  4462. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4463. type: "error"
  4464. });
  4465. } else if (res.data.length==1) {
  4466. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4467. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4468. }
  4469. this.$forceUpdate();
  4470. }
  4471. },
  4472. error => {
  4473. this.$message({
  4474. message: error,
  4475. type: "error"
  4476. });
  4477. }
  4478. );
  4479. },
  4480. // 获取维度数据
  4481. dimension(domain, index) {
  4482. if(domain.projectId == '') {
  4483. return
  4484. }
  4485. this.http.post('/project/getDegreeList',{
  4486. projectId: domain.projectId,
  4487. },
  4488. res => {
  4489. if (res.code == "ok") {
  4490. // console.log("维度数据",res.data);
  4491. this.workForm.domains[index].wuduList = res.data
  4492. // this.workForm = this.workForm
  4493. this.$forceUpdate()
  4494. }
  4495. },
  4496. error => {
  4497. this.$message({
  4498. message: error,
  4499. type: "error"
  4500. });
  4501. }
  4502. );
  4503. },
  4504. //切换任务阶段
  4505. changeStages(domain, index) {
  4506. if (domain.stage == null || domain.stage == '') {
  4507. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4508. } else {
  4509. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4510. }
  4511. this.getRecentTaskList(domain, index);
  4512. this.$forceUpdate();
  4513. },
  4514. getGroupStages(domain, index, keepStage) {
  4515. // console.log(domain);
  4516. if(!domain.groupId){
  4517. domain.projectAuditorId = ''
  4518. domain.stages = []
  4519. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4520. domain.taskId = ''
  4521. domain.sapServiceId = ''
  4522. }
  4523. if(this.user.timeType.reportAuditType >= 1){
  4524. domain.auditUserList = []
  4525. }
  4526. this.$forceUpdate();
  4527. return
  4528. }
  4529. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4530. res => {
  4531. if (res.code == "ok") {
  4532. if (!keepStage) {
  4533. domain.stage = '';
  4534. }
  4535. domain.stages = res.data;
  4536. this.getRecentTaskList(domain, index);
  4537. this.$forceUpdate();
  4538. }
  4539. },
  4540. error => {
  4541. this.$message({
  4542. message: error,
  4543. type: "error"
  4544. });
  4545. });
  4546. //检查当前的项目是否需要获取分组的负责人
  4547. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4548. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4549. res => {
  4550. if (res.code == "ok") {
  4551. domain.getProjectAuditorList = res.data;
  4552. domain.auditUserList = res.data;
  4553. if (res.data.length==1) {
  4554. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4555. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4556. } else if (res.data.length==0) {
  4557. domain.projectAuditorId = null;
  4558. domain.projectAuditorName = null;
  4559. }
  4560. this.$forceUpdate();
  4561. }
  4562. },
  4563. error => {
  4564. this.$message({
  4565. message: error,
  4566. type: "error"
  4567. });
  4568. });
  4569. }
  4570. },
  4571. getProjectProfessions(domain, index) {
  4572. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4573. res => {
  4574. if (res.code == "ok") {
  4575. this.workForm.domains[index].professionProgress = res.data;
  4576. this.$forceUpdate();
  4577. }
  4578. },
  4579. error => {
  4580. this.$message({
  4581. message: error,
  4582. type: "error"
  4583. });
  4584. });
  4585. },
  4586. //删除自己的日报
  4587. deleteReport() {
  4588. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4589. confirmButtonText: this.$t('btn.determine'),
  4590. cancelButtonText: this.$t('btn.cancel'),
  4591. type: "warning"
  4592. })
  4593. .then(() => {
  4594. this.listLoading = true;
  4595. this.http.post('/report/delete',{
  4596. userId: this.user.id,
  4597. date: this.workForm.createDate
  4598. },
  4599. res => {
  4600. this.listLoading = false;
  4601. if (res.code == "ok") {
  4602. this.$message({
  4603. message: this.$t('message.successfullyDeleted'),
  4604. type: "success"
  4605. });
  4606. this.getReportList();
  4607. this.getDepartment();
  4608. this.dialogVisible = false;
  4609. } else {
  4610. this.$message({
  4611. message: res.msg,
  4612. type: "error"
  4613. });
  4614. }
  4615. },
  4616. error => {
  4617. this.listLoading = false;
  4618. this.$message({
  4619. message: error,
  4620. type: "error"
  4621. });
  4622. }
  4623. );
  4624. })
  4625. .catch(() => {});
  4626. },
  4627. // 管理员删除日报
  4628. guanli(item) {
  4629. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4630. let param = {date: this.date + day, userId: item.id};
  4631. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4632. confirmButtonText: this.$t('btn.determine'),
  4633. cancelButtonText: this.$t('btn.cancel'),
  4634. type: "warning"
  4635. })
  4636. .then(() => {
  4637. this.listLoading = true;
  4638. this.http.post('/report/delete',param,
  4639. res => {
  4640. this.listLoading = false;
  4641. if (res.code == "ok") {
  4642. this.$message({
  4643. message: this.$t('message.successfullyDeleted'),
  4644. type: "success"
  4645. });
  4646. this.getReportList();
  4647. this.getDepartment();
  4648. this.dialogVisible = false;
  4649. } else {
  4650. this.$message({
  4651. message: res.msg,
  4652. type: "error"
  4653. });
  4654. }
  4655. },
  4656. error => {
  4657. this.listLoading = false;
  4658. this.$message({
  4659. message: error,
  4660. type: "error"
  4661. });
  4662. }
  4663. );
  4664. })
  4665. .catch(() => {});
  4666. },
  4667. selectAll() {
  4668. if (this.isAllSelect) {
  4669. var keys = [];
  4670. this.reportNames.forEach(b=>{
  4671. keys.push(b.id);
  4672. })
  4673. this.$refs.approveTree.setCheckedKeys(keys);
  4674. } else {
  4675. this.$refs.approveTree.setCheckedKeys([]);
  4676. }
  4677. },
  4678. removeEmptyNode(list) {
  4679. for (var i=0;i<list.length;i++) {
  4680. var cnt = 0;
  4681. if (list[i].membCount == 0) {
  4682. list.splice(i, 1);
  4683. i--;
  4684. } else if (list[i].children != null) {
  4685. this.removeEmptyNode(list[i].children);
  4686. }
  4687. }
  4688. },
  4689. calculateMembCount(list) {
  4690. for (var i in list) {
  4691. var cnt = 0;
  4692. if (list[i].children != null) {
  4693. this.calculateMembCount(list[i].children);
  4694. for (var m in list[i].children) {
  4695. cnt += list[i].children[m].membCount;
  4696. }
  4697. }
  4698. if (list[i].isUser == 1) {
  4699. cnt++;
  4700. this.membCount++;
  4701. }
  4702. list[i].membCount = cnt;
  4703. }
  4704. },
  4705. stateChange() {
  4706. // console.log(this.allData,'alldate');
  4707. this.membCount = 0;
  4708. if (this.selectState == -1) {
  4709. //全部状态
  4710. this.data = this.allData;
  4711. } else {
  4712. //未填报
  4713. this.seluserText = ''
  4714. var newData = JSON.parse(JSON.stringify(this.allData));
  4715. this.filterState(this.selectState, newData);
  4716. this.data = newData;
  4717. }
  4718. this.calculateMembCount(this.data);
  4719. this.data[0].membCount = this.membCount;//总人数
  4720. },
  4721. //按状态过滤部门人员
  4722. filterState(state, list) {
  4723. for (var i =0;i<list.length; i++) {
  4724. var obj = list[i];
  4725. if (obj.isUser == 1) {
  4726. var match = false;
  4727. if (state == -2) {
  4728. if (obj.state == null) {
  4729. match = true;
  4730. }
  4731. } else {
  4732. if (obj.state == state) {
  4733. match = true;
  4734. }
  4735. }
  4736. if (!match) {
  4737. list.splice(i, 1);
  4738. i--;
  4739. } else {
  4740. }
  4741. } else {
  4742. if (obj.children != null) {
  4743. this.filterState(state, obj.children);
  4744. }
  4745. }
  4746. }
  4747. },
  4748. //a按名称过滤部门人员
  4749. async seluserforText(){
  4750. const { userNameNeedTranslate } = this.user
  4751. this.membCount = 0;
  4752. var newData = JSON.parse(JSON.stringify(this.allData));
  4753. let textList = [this.seluserText]
  4754. if(userNameNeedTranslate == 1) {
  4755. this.dataLoading = true
  4756. let res = await this.postData('/user/getEmployeeList', {
  4757. keyword: this.seluserText,
  4758. cursor: '',
  4759. departmentId: -1,
  4760. pageIndex: 1,
  4761. pageSize: 1000
  4762. })
  4763. textList = res.data.records.map(item => item.name)
  4764. this.dataLoading = false
  4765. }
  4766. // return
  4767. console.log(textList, '<=== textList')
  4768. this.seluserforTextin(this.seluserText, newData, textList)
  4769. console.log(newData, 'Data')
  4770. this.data = newData;
  4771. this.calculateMembCount(this.data);
  4772. this.data[0].membCount = this.membCount;//总人数
  4773. },
  4774. seluserforTextin(text, list, textList = []){
  4775. for (var i =0;i<list.length; i++) {
  4776. var obj = list[i];
  4777. if (obj.isUser == 1) {
  4778. var match = false;
  4779. // if (obj.label.indexOf(text) != -1) {
  4780. // match = true
  4781. // }
  4782. if(textList.some(item => item.includes(obj.label))) {
  4783. match = true
  4784. }
  4785. if (!match) {
  4786. list.splice(i, 1);
  4787. i--;
  4788. } else {
  4789. }
  4790. } else {
  4791. if (obj.children != null) {
  4792. this.seluserforTextin(text, obj.children, textList);
  4793. }
  4794. }
  4795. }
  4796. },
  4797. // 当节点发生变化时
  4798. nodeChangeExpand(data) {
  4799. // 保存当前展开的节点
  4800. let flag = false
  4801. this.nodeModelData.some(item => {
  4802. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4803. flag = true
  4804. return true
  4805. }
  4806. })
  4807. if (!flag) { // 不存在则存到数组里
  4808. this.nodeModelData.push(data.id)
  4809. }
  4810. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4811. },
  4812. nodeChangeCollapse(data) {
  4813. console.log(this.nodeModelData)
  4814. this.nodeModelData.some((item, i) => {
  4815. if (item === data.id) {
  4816. this.nodeModelData.length = i
  4817. }
  4818. })
  4819. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4820. },
  4821. // 部门列表点击
  4822. handleNodeClick(data) {
  4823. // this.dealList = data
  4824. this.theValues(data.id, this.allData)
  4825. // this.depData = data;
  4826. var list = [];
  4827. if (data.id == -1) {
  4828. this.deptId = null;
  4829. this.targetUid = null;
  4830. list = this.data;
  4831. } else if (data.isUser == 1) {
  4832. this.deptId = null;
  4833. this.targetUid = data.id;
  4834. } else {
  4835. this.deptId = data.id;
  4836. this.targetUid = null;
  4837. list.push(data);
  4838. }
  4839. this.getReportList();
  4840. if (list.length > 0) {
  4841. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4842. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4843. }
  4844. },
  4845. exportPushLog(){
  4846. this.http.post('/sap-sync-log/export',{},
  4847. res => {
  4848. if (res.code == "ok") {
  4849. var filePath = res.data;
  4850. var fName = '推送日志.xlsx'
  4851. const a = document.createElement('a'); // 创建a标签
  4852. a.setAttribute('download', fName);// download属性
  4853. a.setAttribute('href', filePath);// href链接
  4854. a.click(); //自执行点击事件
  4855. a.remove();
  4856. } else {
  4857. this.$message({
  4858. message: res.msg,
  4859. type: "error"
  4860. });
  4861. }
  4862. },
  4863. error => {
  4864. this.$message({
  4865. message: error,
  4866. type: "error"
  4867. });
  4868. });
  4869. },
  4870. theValues(id, item) {
  4871. for(var i in item) {
  4872. if(item[i].id == id) {
  4873. this.depData = item[i]
  4874. if(id == '-1') {
  4875. this.translation = '1'
  4876. } else {
  4877. if(item[i].children) {
  4878. this.translation = '2'
  4879. } else {
  4880. this.translation = '3'
  4881. }
  4882. }
  4883. return
  4884. } else {
  4885. if(item[i].children) {
  4886. this.theValues(id, item[i].children)
  4887. }
  4888. }
  4889. }
  4890. },
  4891. //获取可以选择的代填的人员列表
  4892. getSubstitudeUserDeptList() {
  4893. if (this.deptMembData.length == 0) {
  4894. this.http.post("/department/listMyMembs", {},
  4895. res => {
  4896. if (res.code == "ok") {
  4897. let noAllData = JSON.parse(JSON.stringify(res.data));
  4898. if (noAllData.length > 0) {
  4899. // if (noAllData[0].label == '全部人员') {
  4900. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4901. noAllData.splice(0,1);
  4902. }
  4903. }
  4904. this.setUserToDept(noAllData);
  4905. this.deptMembData = noAllData;
  4906. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4907. console.log(this.deptMembData, '代填人员数据')
  4908. } else {
  4909. this.$message({
  4910. message: res.msg,
  4911. type: "error"
  4912. });
  4913. }
  4914. },
  4915. error => {
  4916. this.$message({
  4917. message: error,
  4918. type: "error"
  4919. });
  4920. });
  4921. }
  4922. },
  4923. // 获取部门列表
  4924. getDepartmentForApprove() {
  4925. this.http.post( this.port.manage.depList, {},
  4926. res => {
  4927. if (res.code == "ok") {
  4928. var list1 = JSON.parse(JSON.stringify(res.data));
  4929. this.deptOptionList = this.changeArr(list1);
  4930. console.log(this.deptOptionList, '部门')
  4931. } else {
  4932. this.$message({
  4933. message: res.msg,
  4934. type: "error"
  4935. });
  4936. }
  4937. },
  4938. error => {
  4939. this.$message({
  4940. message: error,
  4941. type: "error"
  4942. });
  4943. });
  4944. },
  4945. // 获取部门列表
  4946. getDepartment() {
  4947. //如果没有权限,就不需要获取
  4948. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4949. return;
  4950. }
  4951. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4952. var param = {date:this.date + day};
  4953. this.http.post("/report/getMembList", param,
  4954. res => {
  4955. if (res.code == "ok") {
  4956. if(res.data.length == 0){
  4957. return
  4958. }
  4959. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4960. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4961. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4962. // if (this.user.role > 0) {
  4963. // }
  4964. list.splice(0,0,{
  4965. id: -1,
  4966. label: this.$t('lable.allStaff'),
  4967. })
  4968. this.membCount = 0;
  4969. //设置员工到部门下面
  4970. this.setUserToDept(list);
  4971. this.data = list;
  4972. // console.log('data',this.data);
  4973. this.expandDate = [this.data[1].id]
  4974. this.allData = list;
  4975. // if (noAllData.length > 0) {
  4976. // if (noAllData[0].label == '全部人员') {
  4977. // noAllData.splice(0,1);
  4978. // }
  4979. // }
  4980. // this.setUserToDept(noAllData);
  4981. // this.deptMembData = noAllData;
  4982. this.option = this.changeArr(list1);
  4983. list[0].membCount = this.membCount;
  4984. if (this.depData.id == -1) {
  4985. this.depData.membCount = this.membCount;
  4986. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4987. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4988. } else {
  4989. if (this.depData.isUser == null) {
  4990. var dep = this.findTargetDept(this.data, this.depData.id);
  4991. var membDeptList = [];
  4992. membDeptList.push(dep);
  4993. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4994. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4995. }
  4996. }
  4997. if (this.depData.isUser == null) {
  4998. if (this.isFill) {
  4999. this.fillMembList = this.fillList;
  5000. } else {
  5001. this.fillMembList = this.unFillList;
  5002. }
  5003. }
  5004. this.leaveAllNum = 0
  5005. for(let i in this.unFillList){
  5006. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5007. this.leaveAllNum += 1
  5008. }
  5009. }
  5010. this.stateChange()
  5011. } else {
  5012. this.$message({
  5013. message: res.msg,
  5014. type: "error"
  5015. });
  5016. }
  5017. },
  5018. error => {
  5019. this.$message({
  5020. message: error,
  5021. type: "error"
  5022. });
  5023. });
  5024. this.getReportFillStatus();
  5025. },
  5026. findTargetDept(list, deptId) {
  5027. var t = null;
  5028. for (var i=0;i<list.length; i++) {
  5029. if (list[i].isUser == null && list[i].id == deptId) {
  5030. t = list[i];
  5031. break;
  5032. }
  5033. }
  5034. if (t == null) {
  5035. for (var i=0;i<list.length; i++) {
  5036. if (list[i].children != null && list[i].children.length > 0) {
  5037. t = this.findTargetDept(list[i].children, deptId);
  5038. if (t != null) {
  5039. break;
  5040. }
  5041. }
  5042. }
  5043. }
  5044. return t;
  5045. },
  5046. getUserMembListFromDeptList(list, isFill) {
  5047. var membList = [];
  5048. for (var i in list) {
  5049. var deptName = list[i].label;
  5050. if (list[i].userList != null) {
  5051. list[i].userList.forEach(element => {
  5052. if (isFill == 0) {
  5053. //获取未填的
  5054. if (element.state == null) {
  5055. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5056. membList.push(obj);
  5057. }
  5058. } else {
  5059. if (element.state != null) {
  5060. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5061. membList.push(obj);
  5062. }
  5063. }
  5064. });
  5065. }
  5066. if (list[i].children != null) {
  5067. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5068. }
  5069. }
  5070. return membList;
  5071. },
  5072. setUserToDept(list) {
  5073. for (var i in list) {
  5074. var cnt = 0;
  5075. if (list[i].children != null) {
  5076. this.setUserToDept(list[i].children);
  5077. for (var m in list[i].children) {
  5078. cnt += list[i].children[m].membCount;
  5079. }
  5080. }
  5081. if (list[i].userList != null) {
  5082. if (list[i].children == null) {
  5083. list[i].children = [];
  5084. }
  5085. list[i].userList.forEach(element => {
  5086. var obj = {
  5087. id: element.id,
  5088. label:element.name,
  5089. state:element.state,
  5090. parentId:element.departmentId,
  5091. isUser:1,
  5092. workingTime: element.workingTime,
  5093. leaveDays: element.leaveDays,
  5094. leaveTimes: element.leaveTimes
  5095. };
  5096. list[i].children.push(obj);
  5097. this.membCount++;
  5098. cnt++;
  5099. });
  5100. }
  5101. list[i].membCount = cnt;
  5102. }
  5103. },
  5104. // 修改数组
  5105. changeArr(arr) {
  5106. for (var i = 0; i < arr.length; i++) {
  5107. if(arr[i].id != -1 && arr[i].id != 0) {
  5108. if (arr[i].children != null && arr[i].children.length>0) {
  5109. arr[i].children = this.changeArr(arr[i].children);
  5110. }
  5111. arr[i].id && (arr[i].value = arr[i].id);
  5112. delete arr[i].id;
  5113. }
  5114. }
  5115. for(var i in arr) {
  5116. if(arr[i].id == -1 || arr[i].id == 0) {
  5117. arr.splice(i,1)
  5118. }
  5119. }
  5120. return arr;
  5121. },
  5122. //时间段范围设置改动,监听
  5123. onTimeTypeChange(timeType) {
  5124. this.seleChn(1)
  5125. this.showAddMore = true;
  5126. for(var i in this.workForm.domains) {
  5127. if (this.workForm.domains[i].timeType == 0) {
  5128. this.showAddMore = false;
  5129. break;
  5130. }
  5131. }
  5132. if (this.showAddMore) {
  5133. //检测数量
  5134. if (this.workForm.domains.length == 2) {
  5135. this.showAddMore = false;
  5136. } else {
  5137. this.showAddMore = true;
  5138. }
  5139. }
  5140. },
  5141. getTimeType() {
  5142. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5143. res => {
  5144. if (res.code == "ok") {
  5145. var t = res.data;
  5146. this.reportTimeType = t;
  5147. if (this.reportTimeType.type > 0) {
  5148. this.showAddMore = true;
  5149. }
  5150. //转化时间格式
  5151. if (t.allday != null) {
  5152. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5153. }
  5154. if (t.am != null) {
  5155. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5156. }
  5157. if (t.pm != null) {
  5158. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5159. }
  5160. let arr = []
  5161. for(var i in res.data.excludeTimeList) {
  5162. let obj = {
  5163. s: res.data.excludeTimeList[i].startTime,
  5164. e: res.data.excludeTimeList[i].endTime,
  5165. }
  5166. arr.push(obj)
  5167. }
  5168. this.vacationTime = arr
  5169. } else {
  5170. this.$message({
  5171. message: res.msg,
  5172. type: "error"
  5173. });
  5174. }
  5175. },
  5176. error => {
  5177. this.listLoading = false;
  5178. this.$message({
  5179. message: error,
  5180. type: "error"
  5181. });
  5182. });
  5183. },
  5184. // 改变月份 -------
  5185. changeMonthOut() {
  5186. this.getAllDate();
  5187. this.getReportList();
  5188. this.getDepartment();
  5189. },
  5190. // 选择日期
  5191. choseDate(i, item) {
  5192. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5193. return
  5194. }
  5195. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5196. this.choseDay = i;
  5197. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5198. sessionStorage.msg = this.date + day,
  5199. this.getReportList();
  5200. this.getDepartment();
  5201. this.curDate = item.date;
  5202. },
  5203. canClick(i, item){
  5204. let nowDate = new Date()
  5205. let nowDateYear = nowDate.getFullYear()
  5206. let itemYear = parseInt(this.date.split('-')[0])
  5207. let nowDateMonth = nowDate.getMonth() + 1
  5208. let itemMonth = parseInt(this.date.split('-')[1])
  5209. let nowDateDay = nowDate.getDate()
  5210. let itemDay = parseInt(item.showDate.split('.')[1])
  5211. if(nowDateYear < itemYear){
  5212. return false
  5213. }else if(nowDateYear == itemYear){
  5214. if(nowDateMonth < itemMonth){
  5215. return false
  5216. }else if(nowDateMonth == itemMonth){
  5217. if(nowDateDay < itemDay){
  5218. return false
  5219. }
  5220. }
  5221. }
  5222. },
  5223. // 获取日期列表
  5224. getAllDate(e) {
  5225. var dayArry = [];
  5226. var day = this.getCountDays();
  5227. let curMonthDay = null;
  5228. for (var k = 1; k <= day; k++) {
  5229. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5230. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5231. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5232. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5233. if(sessionStorage.msg) {
  5234. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5235. this.choseDay = k - 1;
  5236. curMonthDay = str;
  5237. }
  5238. } else {
  5239. if (new Date().getDate() == k) {
  5240. this.choseDay = k - 1;
  5241. }
  5242. }
  5243. } else {
  5244. this.choseDay = 0;
  5245. }
  5246. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5247. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5248. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5249. }
  5250. this.allDate = dayArry;
  5251. //不能超过最大日期
  5252. if (this.choseDay > day-1) {
  5253. this.choseDay = day-1;
  5254. }
  5255. if(sessionStorage.from != 1){
  5256. let nowmonth = new Date().getMonth() + 1
  5257. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5258. let nowdate = new Date().getDate()
  5259. if(nowd == this.date){
  5260. if(e && sessionStorage.msg){
  5261. }else{
  5262. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5263. }
  5264. let nowday = new Date(sessionStorage.msg).getDate()
  5265. this.choseDay = nowday - 1
  5266. let monthdate = new Date(sessionStorage.msg)
  5267. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5268. }else{
  5269. if(e && sessionStorage.msg){
  5270. }else{
  5271. sessionStorage.msg = this.date + '-01'
  5272. }
  5273. let monthdate = new Date(sessionStorage.msg)
  5274. this.choseDay = monthdate.getDate() - 1
  5275. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5276. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5277. }
  5278. }else{
  5279. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5280. }
  5281. //从消息点击跳转过来的,直接加载指定日期
  5282. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5283. this.curDate = sessionStorage.msg;
  5284. sessionStorage.from = 0;
  5285. } else {
  5286. // if (curMonthDay != null) {
  5287. // // this.curDate = curMonthDay;
  5288. // let d = new Date(sessionStorage.msg)
  5289. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5290. // } else {
  5291. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5292. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5293. // }
  5294. }
  5295. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5296. // if(!sessionStorage.msg){
  5297. // let msgday = this.choseDay + 1
  5298. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5299. // }
  5300. this.getReportFillStatus();
  5301. },
  5302. getCountDays() {
  5303. var newstr = this.date.replace(/-/g, "/");
  5304. var curDate = new Date(newstr+'/01');
  5305. var curMonth = curDate.getMonth();
  5306. curDate.setMonth(curMonth + 1);
  5307. curDate.setDate(0);
  5308. return curDate.getDate();
  5309. },
  5310. reqMore() {
  5311. if (this.hasMore) {
  5312. this.pageIndex++;
  5313. this.requestHttpReports();
  5314. }
  5315. },
  5316. //加载日报数据
  5317. requestHttpReports() {
  5318. //请求数据
  5319. this.listLoading = true;
  5320. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5321. let param = {date: this.date + day};
  5322. if (this.deptId) {
  5323. param.deptId = this.deptId;
  5324. }
  5325. if (this.targetUid) {
  5326. param.userId = this.targetUid;
  5327. }
  5328. //传页码
  5329. if (this.hasMore) {
  5330. param.pageIndex = this.pageIndex;
  5331. }
  5332. this.http.post( this.port.report.list, param,
  5333. res => {
  5334. this.listLoading = false;
  5335. if (res.code == "ok") {
  5336. //扩增
  5337. this.reportList = this.reportList.concat(res.data.data);
  5338. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5339. if(document.querySelector("#day"+this.choseDay)){
  5340. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5341. }
  5342. } else {
  5343. this.$message({
  5344. message: res.msg,
  5345. type: "error"
  5346. });
  5347. }
  5348. },
  5349. error => {
  5350. this.listLoading = false;
  5351. this.$message({
  5352. message: error,
  5353. type: "error"
  5354. });
  5355. });
  5356. },
  5357. //获取日报列表
  5358. getReportList() {
  5359. //初始化,重置数据
  5360. this.pageIndex = 0;
  5361. this.hasMore = true;
  5362. this.reportList = [];
  5363. this.requestHttpReports();
  5364. },
  5365. //刷新日报状态,用于审核后更新
  5366. refreshReportData(reportId) {
  5367. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5368. res => {
  5369. if (res.code == "ok") {
  5370. for (var m=0;m<this.reportList.length; m++) {
  5371. var d = this.reportList[m].data;
  5372. var find = d.filter(r=>r.id == reportId);
  5373. if (find.length > 0) {
  5374. find[0].state = res.data.state;
  5375. if (find[0].state == 2) {//被驳回,要可以编辑
  5376. this.reportList[m].state = 2;
  5377. }
  5378. find[0].isDeptAudit = res.data.isDeptAudit;
  5379. find[0].departmentAuditState = res.data.departmentAuditState;
  5380. find[0].projectAuditorName = res.data.projectAuditorName;
  5381. find[0].projectAuditorId = res.data.projectAuditorId;
  5382. find[0].projectAuditState = res.data.projectAuditState;
  5383. find[0].rejectUserid = res.data.rejectUserid;
  5384. find[0].rejectUsername = res.data.rejectUsername;
  5385. find[0].rejectReason = res.data.rejectReason;
  5386. this.$forceUpdate();
  5387. break;
  5388. }
  5389. }
  5390. } else {
  5391. this.$message({
  5392. message: res.msg,
  5393. type: "error"
  5394. });
  5395. }
  5396. },
  5397. error => {
  5398. this.listLoading = false;
  5399. this.$message({
  5400. message: error,
  5401. type: "error"
  5402. });
  5403. });
  5404. },
  5405. //导出员工工时统计
  5406. exportUserTime() {
  5407. this.listLoading = true;
  5408. var param = {};
  5409. if (this.exportParam.dateRange != null) {
  5410. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5411. }
  5412. this.http.post('/department/exportDeptStatistic', param,
  5413. res => {
  5414. this.listLoading = false;
  5415. if (res.code == "ok") {
  5416. location.href = res.data;
  5417. this.exportTimeDialog = false;
  5418. } else {
  5419. this.$message({
  5420. message: res.msg,
  5421. type: "error"
  5422. });
  5423. }
  5424. },
  5425. error => {
  5426. this.listLoading = false;
  5427. this.$message({
  5428. message: error,
  5429. type: "error"
  5430. });
  5431. });
  5432. },
  5433. //导出日报
  5434. exportReport() {
  5435. this.exportingData = true;
  5436. var param = {};
  5437. if (this.exportParam.dateRange != null) {
  5438. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5439. }
  5440. if (this.exportParam.projectId != null) {
  5441. param.projectId = this.exportParam.projectId;
  5442. }
  5443. if (this.exportParam.departmentId != null) {
  5444. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5445. }
  5446. param.stateKey = this.stateKey
  5447. // param.departmentId = this.user.departmentId
  5448. console.log(param, '《=== 导出传的参数');
  5449. console.log('开始调用exportReport接口');
  5450. this.http.post(this.port.report.export, param,
  5451. res => {
  5452. this.exportingData = false;
  5453. if (res.code == "ok") {
  5454. location.href = res.data;
  5455. this.exportDialog = false;
  5456. } else {
  5457. this.$message({
  5458. message: res.msg,
  5459. type: "error"
  5460. });
  5461. }
  5462. },
  5463. error => {
  5464. this.exportingData = false;
  5465. this.$message({
  5466. message: error,
  5467. type: "error"
  5468. });
  5469. });
  5470. },
  5471. //获取项目列表
  5472. getProjectList() {
  5473. this.listLoading = true;
  5474. this.http.post( this.port.project.list, {},
  5475. res => {
  5476. this.listLoading = false;
  5477. if (res.code == "ok") {
  5478. for(var i in res.data) {
  5479. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5480. res.data[i].projectCode = ''
  5481. }
  5482. }
  5483. this.projectList = res.data;
  5484. console.log("项目列表",this.projectList);
  5485. } else {
  5486. this.$message({
  5487. message: res.msg,
  5488. type: "error"
  5489. });
  5490. }
  5491. },
  5492. error => {
  5493. this.listLoading = false;
  5494. this.$message({
  5495. message: error,
  5496. type: "error"
  5497. });
  5498. });
  5499. },
  5500. // 获取填报日报的项目下拉列表
  5501. getFillProjectList() {
  5502. this.http.post( this.port.project.list, {
  5503. forReport: 1
  5504. },res => {
  5505. if (res.code == "ok") {
  5506. for(var i in res.data) {
  5507. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5508. res.data[i].projectCode = ''
  5509. }
  5510. }
  5511. this.fillProjectList = res.data;
  5512. this.getRecentlyProject()
  5513. } else {
  5514. this.$message({
  5515. message: res.msg,
  5516. type: "error"
  5517. });
  5518. }
  5519. },
  5520. error => {
  5521. this.$message({
  5522. message: error,
  5523. type: "error"
  5524. });
  5525. });
  5526. },
  5527. getBasecostItemList() {
  5528. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5529. companyId: this.user.companyId
  5530. },
  5531. res => {
  5532. if (res.code == "ok") {
  5533. this.timeBasecostList = res.data;
  5534. }
  5535. });
  5536. },
  5537. getAIReport(createDate) {
  5538. this.http.post('/report/getAIReport', {},
  5539. res => {
  5540. if (res.code == "ok") {
  5541. var quanbu = 0
  5542. this.jsDay = 1
  5543. var zhi = ''
  5544. var slp = res.data
  5545. for(var i in slp) {
  5546. var sp = +slp[i].workingTime + 0
  5547. zhi = this.jsDay * sp
  5548. quanbu = +quanbu + zhi
  5549. }
  5550. this.jsTime = quanbu
  5551. var aiReportData = res.data;
  5552. this.canCancelInDialog = false
  5553. if(aiReportData.length != 0) {
  5554. var arr = [];
  5555. for(var i in aiReportData) {
  5556. arr.push({
  5557. id: null,
  5558. projectId: aiReportData[i].projectId,
  5559. workingTime: aiReportData[i].workingTime,
  5560. content: '',
  5561. progress:100,
  5562. state: 2,
  5563. timeType: aiReportData[i].timeType,
  5564. subProjectList: aiReportData[i].subProjectList,
  5565. taskList: aiReportData[i].taskList,
  5566. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5567. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5568. taskId: aiReportData[i].taskId,
  5569. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5570. startTime: aiReportData[i].startTime,
  5571. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5572. endTime: aiReportData[i].endTime,
  5573. isOvertime: 0,
  5574. progress:aiReportData[i].progress,
  5575. professionProgress: aiReportData[i].professionProgressList,
  5576. stages:aiReportData[i].stages,
  5577. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5578. pics: null,
  5579. multiWorktime: aiReportData[i].multiWorktime,
  5580. worktimeList: [{}],
  5581. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5582. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5583. wuduList: aiReportData[i].degreeList,
  5584. taskGroups:aiReportData[i].taskGroups,
  5585. customData: aiReportData[i].customData,//自定义的数值
  5586. auditUserList: aiReportData[i].auditUserList,
  5587. projectAuditorId: aiReportData[i].projectAuditorId,
  5588. projectAuditorName: aiReportData[i].projectAuditorName,
  5589. overtimeHours: aiReportData[i].overtimeHours,
  5590. customText: aiReportData[i].customText,
  5591. basecostId: aiReportData[i].basecostId,
  5592. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5593. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5594. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5595. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5596. canEdit: true
  5597. })
  5598. }
  5599. this.workForm.domains = arr;
  5600. } else {
  5601. }
  5602. this.canEdit = true;
  5603. this.originCanEdit = true;
  5604. this.seleChn()
  5605. } else {
  5606. this.$message({
  5607. message: res.msg,
  5608. type: "error"
  5609. });
  5610. }
  5611. },
  5612. error => {
  5613. this.$message({
  5614. message: error,
  5615. type: "error"
  5616. });
  5617. });
  5618. },
  5619. // 获取个人某天的日报 111111
  5620. getReport() {
  5621. this.http.post( this.port.report.getPort, {
  5622. date: this.workForm.createDate
  5623. },
  5624. res => {
  5625. if (res.code == "ok") {
  5626. var quanbu = 0
  5627. this.jsDay = 1
  5628. var zhi = ''
  5629. var slp = res.data.report
  5630. for(var i in slp) {
  5631. var sp = +slp[i].workingTime + 0
  5632. zhi = this.jsDay * sp
  5633. quanbu = +quanbu + zhi
  5634. }
  5635. this.jsTime = quanbu
  5636. var list = res.data;
  5637. this.report = list;
  5638. this.reportTimeType = this.report.timeType;
  5639. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5640. this.isWeekend = !this.report.isWorkDay;
  5641. this.canCancelInDialog = false;
  5642. this.hasWrittenReport = list.report.length != 0;
  5643. if(list.report.length != 0) {
  5644. var arr = [];
  5645. this.canEdit = false;
  5646. let candelete = true
  5647. for(var i in list.report) {
  5648. var flg = null
  5649. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5650. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5651. var filteredRespList = null
  5652. if (targetP.length > 0) {
  5653. var isPublic = targetP[0].isPublic;
  5654. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5655. }
  5656. arr.push({
  5657. id: list.report[i].id,
  5658. projectId: list.report[i].projectId,
  5659. workingTime: list.report[i].workingTime,
  5660. content: list.report[i].content,
  5661. state: list.report[i].state,
  5662. timeType: list.report[i].timeType,
  5663. subProjectList: list.report[i].subProjectList,
  5664. taskList: list.report[i].taskList,
  5665. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5666. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5667. taskId: list.report[i].taskId,
  5668. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5669. startTime: list.report[i].startTime,
  5670. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5671. endTime: list.report[i].endTime,
  5672. isOvertime: flg,
  5673. progress:list.report[i].progress,
  5674. professionProgress: list.report[i].professionProgressList,
  5675. stages:list.report[i].stages,
  5676. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5677. pics: list.report[i].pics,
  5678. multiWorktime: list.report[i].multiWorktime,
  5679. worktimeList: list.report[i].worktimeList,
  5680. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5681. multiDegrIdArray: list.report[i].multiDegrIdList,
  5682. wuduList: list.report[i].degreeList,
  5683. taskGroups:list.report[i].taskGroups,
  5684. customData: list.report[i].customData,//自定义的数值
  5685. auditUserList: list.report[i].auditUserList,
  5686. projectAuditorId: list.report[i].projectAuditorId,
  5687. projectAuditorName: list.report[i].projectAuditorName,
  5688. overtimeHours: list.report[i].overtimeHours,
  5689. customText: list.report[i].customText,
  5690. basecostId: list.report[i].basecostId,
  5691. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5692. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5693. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5694. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5695. canEdit: list.report[i].state >= 2 ? true : false,
  5696. extraField1: list.report[i].extraField1,
  5697. extraField2: list.report[i].extraField2,
  5698. extraField3: list.report[i].extraField3,
  5699. workContentList: list.report[i].workContentList,
  5700. filteredRespList: filteredRespList,
  5701. serviceList: list.report[i].serviceList,
  5702. sapServiceId: list.report[i].sapServiceId,
  5703. })
  5704. if (list.report[i].state >= 2) {
  5705. this.canEdit = true;
  5706. }
  5707. if(list.report[i].state < 2){
  5708. candelete = false
  5709. }
  5710. if (list.report[i].state == 0){
  5711. this.canCancelInDialog = true
  5712. }
  5713. // 加判断
  5714. if(this.user.timeType.choseFromAlbum == 1) {
  5715. let arrList = []
  5716. for(var k in list.report[i].pics) {
  5717. let obj = {
  5718. name: k,
  5719. url: list.report[i].pics[k]
  5720. }
  5721. arrList.push(obj)
  5722. }
  5723. arr[i].imgListUrl = arrList
  5724. arr[i].imgList = list.report[i].pics
  5725. }
  5726. }
  5727. this.reportCanDelete = candelete
  5728. this.workForm = {
  5729. createDate: this.workForm.createDate,
  5730. domains: arr,
  5731. userNames:null,
  5732. userId:null,
  5733. time: list.time
  5734. }
  5735. console.log('workForm', this.workForm)
  5736. } else {
  5737. this.workForm = {
  5738. createDate: this.workForm.createDate,
  5739. domains: [{
  5740. id: null,
  5741. projectId: "",
  5742. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5743. content: "",
  5744. progress:100,
  5745. state: 2,
  5746. timeType:0,
  5747. multiWorktime: this.reportTimeType.multiWorktime,
  5748. worktimeList:[{}],
  5749. canEdit: true,
  5750. auditorFirst: '',
  5751. auditorSec: '',
  5752. auditorThird: '',
  5753. ccUserid: ''
  5754. }],
  5755. userId:null,
  5756. userNames:null,
  5757. time: this.report.time
  5758. }
  5759. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5760. this.$set(this.workForm.domains[0],'isOvertime',true)
  5761. if(this.reportTimeType.type != 2){
  5762. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5763. }
  5764. }
  5765. if(this.user.timeType.type == 1) {
  5766. var shuzhi = this.user.timeType.allday + ''
  5767. // console.log('执行一次', shuzhi.indexOf('.'))
  5768. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5769. }
  5770. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5771. //默认给第一个,必填字段
  5772. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5773. }
  5774. this.canEdit = true;
  5775. }
  5776. this.originCanEdit = this.canEdit;
  5777. this.seleChn()
  5778. } else {
  5779. this.$message({
  5780. message: res.msg,
  5781. type: "error"
  5782. });
  5783. }
  5784. },
  5785. error => {
  5786. this.$message({
  5787. message: error,
  5788. type: "error"
  5789. });
  5790. });
  5791. },
  5792. guanbi() {
  5793. this.falsss = false,
  5794. this.workTimeForMinYi=0
  5795. },
  5796. // 打开日报填写
  5797. fillInReport(i, isBatch) {
  5798. this.isWeekend = false
  5799. this.reportCanDelete = false
  5800. // console.log(this.user.timeType.type, '选择时长')
  5801. if(i != 1) {
  5802. this.falsss = false
  5803. } else {
  5804. this.falsss = true
  5805. }
  5806. if (this.isSubstitude) {
  5807. this.getSubstitudeUserDeptList();
  5808. }
  5809. if(i == -1 || this.isSubstitude) {
  5810. this.isDisable = false;
  5811. } else {
  5812. this.isDisable = true;
  5813. }
  5814. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5815. this.isBatch = isBatch;
  5816. if (this.isBatch == 0 && !this.isSubstitude) {
  5817. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5818. let weekday = new Date(this.workForm.createDate).getDay()
  5819. if(this.user.companyId == 817){
  5820. if(weekday == 0){
  5821. this.isWeekend = true
  5822. }
  5823. }else{
  5824. if(weekday == 0 || weekday == 6){
  5825. this.isWeekend = true
  5826. }
  5827. }
  5828. this.getReport(i);
  5829. } else {
  5830. // console.log('执行到了这里')
  5831. this.jsTime = 0
  5832. this.jsDay = 0
  5833. this.workForm = {
  5834. createDate: null,//批量填报没有日期
  5835. domains: [{
  5836. id: null,
  5837. projectId: "",
  5838. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5839. content: "",
  5840. progress:100,
  5841. state: 2,
  5842. timeType:0,
  5843. multiWorktime: this.reportTimeType.multiWorktime,
  5844. worktimeList:[{}],
  5845. canEdit: true,
  5846. }],
  5847. }
  5848. if(this.user.timeType.type == 1) {
  5849. var shuzhi = this.user.timeType.allday + ''
  5850. // console.log('执行二次')
  5851. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5852. }
  5853. // console.log(this.workForm)
  5854. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5855. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5856. }
  5857. this.canEdit = true;
  5858. }
  5859. this.dialogVisible = true;
  5860. },
  5861. //按周填报的弹窗口中编辑单项目相关数据
  5862. setWeekFormReportItem(reportId, i, names, row,sss) {
  5863. console.log(sss)
  5864. this.http.post('/report/getReportById', {
  5865. reportId: reportId
  5866. },
  5867. res => {
  5868. if (res.code == "ok") {
  5869. var data = res.data.report;
  5870. sss.subProjectId = data.subProjectId
  5871. sss.subProjectList = data.subProjectList;
  5872. sss.stage = data.stage
  5873. sss.subProjectList = data.subProjectList
  5874. sss.stages = data.stages
  5875. sss.taskGroups = data.taskGroups;
  5876. sss.auditUserList = data.auditUserList;
  5877. sss.degreeId = data.degreeId;
  5878. sss.customData = data.customData;
  5879. sss.wuduList = data.degreeList;
  5880. this.zhoBaoIdx = i
  5881. this.zhoBaoName = names
  5882. this.zhoBao = sss
  5883. this.zhis = row
  5884. if (sss.groupId) {
  5885. //最后一个参数表示是否保留stage的值,不要重置为空
  5886. this.getGroupStages(this.zhoBao, 0, true)
  5887. }
  5888. this.$forceUpdate();
  5889. }
  5890. });
  5891. },
  5892. // 按周填报里内容的填写
  5893. tianxies(item, i, names, row) {
  5894. if (item.state == 0) {
  5895. this.$message({
  5896. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5897. type: "error"
  5898. });
  5899. return;
  5900. }
  5901. if (item.state == 1) {
  5902. this.$message({
  5903. message: '已通过状态不可修改',
  5904. type: "error"
  5905. });
  5906. return;
  5907. }
  5908. if(this.user.timeType.notAllowedNoAttendance == 1){
  5909. if(this.zhoData[i].corpTime){
  5910. if(this.zhoData[i].corpTime.workHours == 0){
  5911. this.$message({
  5912. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5913. type: 'error'
  5914. })
  5915. return
  5916. }
  5917. }else{
  5918. this.$message({
  5919. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5920. type: 'error'
  5921. })
  5922. return
  5923. }
  5924. }
  5925. var idd = ''
  5926. var obj = {}
  5927. for(var l in this.projectList) {
  5928. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5929. }
  5930. obj.projectId = idd
  5931. this.tianxieDialogVisible = true
  5932. this.scopess = item
  5933. console.log(item, '《==== 当前的对象')
  5934. var sss = {}
  5935. if (item.id != null) {
  5936. sss.id = item.id;
  5937. sss.state = item.state;
  5938. } else {
  5939. sss.id = -1;
  5940. sss.state = 3;
  5941. }
  5942. sss.projectId = idd;
  5943. sss.progress = item.progress
  5944. sss.time = item.time
  5945. sss.content = item.content;
  5946. console.log('333', sss.content)
  5947. if (sss.time == '' && this.reportTimeType.type == 2) {
  5948. //取已填时间范围中最大的一个作为开始时间
  5949. var startTime = '09:00';
  5950. var fillStartTime = '00:00';
  5951. for (var t in this.selProjectList) {
  5952. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5953. if (fillItem.time) {
  5954. if (fillItem.time[1] > fillStartTime) {
  5955. fillStartTime = fillItem.time[1];
  5956. }
  5957. }
  5958. }
  5959. if (fillStartTime == '00:00') {
  5960. fillStartTime = '09:00';
  5961. }
  5962. var fillEndMax = '18:00';
  5963. if (fillStartTime >= '18:00') {
  5964. fillEndMax = '23:59';
  5965. }
  5966. sss.time = [fillStartTime, fillEndMax];
  5967. }
  5968. sss.groupId = item.groupId
  5969. sss.stage = item.stage;
  5970. sss.workingTime = item.workingTime
  5971. sss.projectAuditorId = item.projectAuditorId;
  5972. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5973. //默认选中第一个
  5974. sss.basecostId = this.timeBasecostList[0].id;
  5975. }
  5976. var hasEdited = this.zhoData[i][names].hasEdited;
  5977. if (hasEdited) {
  5978. sss = { ...item }
  5979. //编辑过了
  5980. sss.subProjectId = item.subProjectId
  5981. sss.stage = item.stage
  5982. sss.subProjectList = item.subProjectList
  5983. sss.stages = item.stages
  5984. sss.taskGroups = item.taskGroups;
  5985. console.log(sss.taskGroups, '33333');
  5986. sss.auditUserList = obj.auditUserList;
  5987. sss.degreeId = item.degreeId;
  5988. sss.customData = item.customData;
  5989. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5990. //只有一个审核人,自动设置上去
  5991. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5992. }
  5993. sss.wuduList = item.wuduList;
  5994. this.zhoBaoIdx = i
  5995. this.zhoBaoName = names
  5996. this.zhoBao = sss
  5997. this.zhis = row
  5998. if (sss.groupId) {
  5999. //最后一个参数表示是否保留stage的值,不要重置为空
  6000. this.getGroupStages(this.zhoBao, 0, true)
  6001. }
  6002. this.$forceUpdate();
  6003. this.getWeeklyTaskList(sss)
  6004. console.log('最后的周报 ===>', this.zhoBao)
  6005. } else {
  6006. //第一次打开,获取数据
  6007. if (sss.id == -1) {
  6008. //新填报的
  6009. this.selectProject(obj, 0);
  6010. var that = this
  6011. setTimeout(() =>{
  6012. sss.subProjectId = that.workForm.domains[0].subProjectId
  6013. sss.subProjectList = item.subProjectList;
  6014. sss.stage = that.workForm.domains[0].stage
  6015. sss.subProjectList = that.workForm.domains[0].subProjectList
  6016. sss.stages = that.workForm.domains[0].stages
  6017. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6018. sss.auditUserList = obj.auditUserList;
  6019. sss.degreeId = item.degreeId;
  6020. sss.customData = item.customData;
  6021. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6022. //只有一个审核人,自动设置上去
  6023. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6024. }
  6025. sss.wuduList = row[0].wuduList
  6026. that.zhoBaoIdx = i
  6027. that.zhoBaoName = names
  6028. that.zhoBao = sss
  6029. that.zhis = row
  6030. if (sss.groupId) {
  6031. //最后一个参数表示是否保留stage的值,不要重置为空
  6032. this.getGroupStages(that.zhoBao, 0, false)
  6033. }
  6034. that.$forceUpdate();
  6035. this.getWeeklyTaskList(sss)
  6036. },600);
  6037. } else {
  6038. //编辑填报过的;数据库已经存在的
  6039. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6040. }
  6041. }
  6042. },
  6043. // 按周填报里内容的填写点击确定
  6044. setWeekProItemData() {
  6045. //专业版模式下,任务分组和阶段必填
  6046. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6047. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6048. this.$message({
  6049. message: '任务分组和阶段必填,请检查',
  6050. type: "error"
  6051. });
  6052. return;
  6053. }
  6054. }
  6055. // 检查任务分组
  6056. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6057. this.$message({
  6058. message: '任务分组必填,请检查',
  6059. type: "error"
  6060. });
  6061. return
  6062. }
  6063. //检查子项目是否必填
  6064. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6065. this.$message({
  6066. message: '子项目必填,请检查',
  6067. type: "error"
  6068. });
  6069. return;
  6070. }
  6071. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6072. this.$message({
  6073. message: this.$t('message.Pleaseselectareviewer'),
  6074. type: "error"
  6075. });
  6076. return
  6077. }
  6078. if(this.user.timeType.reportAuditType == 3){
  6079. let auditTips = ''
  6080. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6081. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6082. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6083. if(auditTips){
  6084. auditTips = auditTips.substring(0,auditTips.length - 1)
  6085. this.$message({
  6086. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6087. type: 'error'
  6088. })
  6089. return
  6090. }
  6091. }
  6092. let errtips = ''
  6093. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6094. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6095. errtips += this.user.timeType.customDegreeName + '、'
  6096. }
  6097. }
  6098. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6099. errtips += this.user.timeType.customDataName + '、'
  6100. }
  6101. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6102. errtips += this.user.timeType.customTextName + '、'
  6103. }
  6104. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6105. errtips += this.$t('other.workMatters') +'、'
  6106. }
  6107. if(errtips){
  6108. errtips = errtips.substring(0,errtips.length - 1)
  6109. this.$message({
  6110. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6111. type: 'error'
  6112. })
  6113. return
  6114. }
  6115. this.tianxieDialogVisible = false
  6116. var zhong = this.zhoData
  6117. this.zhoBao.hasEdited = true;
  6118. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6119. this.zhoData = zhong
  6120. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6121. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6122. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6123. },
  6124. // 获取本周
  6125. getCurrentWeek() {
  6126. //今天
  6127. this.targetWeekDate = new Date();
  6128. this.initWeekFormData();
  6129. // this.jiazai()
  6130. },
  6131. // 获取上周
  6132. handleGetPrevWeek() {
  6133. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6134. this.initWeekFormData();
  6135. // this.jiazai()
  6136. },
  6137. // 获取下周
  6138. handleGetNextvWeek() {
  6139. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6140. this.initWeekFormData()
  6141. },
  6142. // 加载动画
  6143. jiazai() {
  6144. this.weekDataLoading = true
  6145. var that = this
  6146. setTimeout(() =>{
  6147. that.weekDataLoading = false
  6148. },1000);
  6149. },
  6150. // 转时间格式
  6151. dealdate(date) {
  6152. const dt = new Date(date)
  6153. const y = dt.getFullYear()
  6154. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6155. const d = (dt.getDate() + '').padStart(2, '0')
  6156. return `${y}-${m}-${d}`
  6157. },
  6158. // 按周填报
  6159. fillInReportss() {
  6160. window.addEventListener('scroll', this.handleScroll, true)
  6161. // this.jiazai()
  6162. this.fillWeekDialogVisi = true
  6163. this.getCurrentWeek();
  6164. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6165. //重新获取工时预警类型的预算项
  6166. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6167. companyId: this.user.companyId
  6168. },
  6169. res => {
  6170. if (res.code == "ok") {
  6171. this.timeBasecostList = res.data;
  6172. }
  6173. });
  6174. }
  6175. },
  6176. fillInReportCustom() {
  6177. this.weekIndex++
  6178. this.weekParentData = {
  6179. isSubstitude: this.isSubstitude
  6180. }
  6181. this.fillWeekDialogVisiCustom = true
  6182. },
  6183. // 按周填报的项目筛选
  6184. selListFun(){
  6185. this.selProjectList = []
  6186. if(this.selCon.length){
  6187. for (let i = 0; i < this.selCon.length; i++) {
  6188. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6189. }
  6190. this.selConShow = false ;
  6191. for (let i in this.zhoData) {
  6192. var obj = this.zhoData[i];
  6193. for(var j in this.selProjectList) {
  6194. var xinzhi = this.selProjectList[j].projectName
  6195. obj[xinzhi] = {}
  6196. obj[xinzhi].time = ''
  6197. obj[xinzhi].content = ''
  6198. obj[xinzhi].progress = 0
  6199. obj[xinzhi].workingTime = 0
  6200. }
  6201. }
  6202. this.initWeekFormData();
  6203. }else{
  6204. this.$message({
  6205. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6206. type:'error'
  6207. })
  6208. }
  6209. },
  6210. setWeekCardTimeData(list) {
  6211. for(let i in list){
  6212. let datei = '';
  6213. if (this.user.timeType.showDdCardtime == 1) {
  6214. datei = list[i].workDate;
  6215. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6216. datei = list[i].createDate;
  6217. } else if (this.user.timeType.syncFanwei == 1) {
  6218. datei = list[i].workDate;
  6219. }
  6220. for(let m in this.zhoData) {
  6221. if(datei == this.zhoData[m].zhoDataTime){
  6222. let item = {
  6223. startTime: list[i].startTime,
  6224. endTime: list[i].endTime,
  6225. workHours: list[i].workHours
  6226. }
  6227. this.$set(this.zhoData[m],'corpTime',item)
  6228. }
  6229. }
  6230. }
  6231. },
  6232. getWeeklyCardTime(){ //按周填报获取考勤信息
  6233. let dateStr = []
  6234. for(let i in this.zhoData){
  6235. dateStr.push(this.zhoData[i].zhoDataTime)
  6236. }
  6237. this.http.post('/report/getWeeklyCardTime',{
  6238. dateStr: JSON.stringify(dateStr)
  6239. },res => {
  6240. if(res.code == 'ok'){
  6241. for(let i in res.data){
  6242. let datei = '';
  6243. if (this.user.timeType.showDdCardtime == 1) {
  6244. datei = res.data[i].workDate.split('-');
  6245. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6246. datei = res.data[i].createDate.split('-');
  6247. }
  6248. for(let m in this.zhoData){
  6249. let datem = new Date(this.zhoData[m].zhoDataTime)
  6250. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6251. let item = {
  6252. startTime: res.data[i].startTime,
  6253. endTime: res.data[i].endTime,
  6254. workHours: res.data[i].workHours
  6255. }
  6256. this.$set(this.zhoData[m],'corpTime',item)
  6257. }
  6258. }
  6259. }
  6260. }else{
  6261. this.$message({
  6262. message: res.msg,
  6263. type: 'error'
  6264. })
  6265. }
  6266. },err => {
  6267. this.$message({
  6268. message: err,
  6269. type: 'error'
  6270. })
  6271. })
  6272. },
  6273. selListqx(){
  6274. this.fillWeekDialogVisi = false
  6275. this.selProjectList = []
  6276. this.selCon = []
  6277. },
  6278. handleScroll() {
  6279. this.changdu = this.projectList.length + 1
  6280. },
  6281. // 自动选择时间点的事件
  6282. // async zhoTimes(item, i) {
  6283. // var iss = i
  6284. // if(item.time == null) {
  6285. // return
  6286. // } else {
  6287. // const zhi = this.zhoData[iss];
  6288. // let he = 0;
  6289. // const timeArr = Object.values(zhi)
  6290. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6291. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6292. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6293. // console.log(data, 'data');
  6294. // zhi.he = `${he}h`;
  6295. // }
  6296. // },
  6297. async zhoTimes(item, index) {
  6298. const zho = this.zhoData[index];
  6299. if (!item.time) {
  6300. return;
  6301. }
  6302. const timeArr = Object.values(zho)
  6303. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6304. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6305. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6306. zho.he = `${totalHours[0]}h`;
  6307. },
  6308. // 判断两个时间段是否重叠
  6309. timeOverlap(idx, dateAr) {
  6310. let zhi = 0
  6311. for (let k in dateAr) {
  6312. if (idx !== k) {
  6313. 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))) {
  6314. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6315. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6316. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6317. }
  6318. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6319. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6320. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6321. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6322. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6323. } else {
  6324. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6325. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6326. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6327. }
  6328. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6329. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6330. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6331. }
  6332. }
  6333. }
  6334. }
  6335. }
  6336. return zhi
  6337. },
  6338. // 计算时间
  6339. getHourMinutes(str, end) {
  6340. var he = 0
  6341. var date2 = '2021/12/12 ' + end +':00'
  6342. var date1 = '2021/12/12 ' + str +':00'
  6343. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6344. var leave1=date3%(24*3600*1000)
  6345. var hours=Math.floor(leave1/(3600*1000))
  6346. var leave2=leave1%(3600*1000)
  6347. var minutes=Math.floor(leave2/(60*1000))
  6348. var shi = hours+'.'+ minutes
  6349. return he += +shi
  6350. },
  6351. // 自动选择事件长度的事件
  6352. zhoXuan(item, i) {
  6353. var iss = i
  6354. if(item.time == null) {
  6355. return
  6356. } else {
  6357. var zhi = this.zhoData[iss]
  6358. var he = 0
  6359. for(var i in zhi) {
  6360. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6361. he += +zhi[i].workingTime
  6362. }
  6363. }
  6364. zhi.he = he + 'h'
  6365. }
  6366. },
  6367. getPushWorkLogData(){
  6368. this.http.post('/sap-sync-log/list', {},
  6369. res => {
  6370. if (res.code == "ok") {
  6371. this.pushWorkTimeLogData = res.data;
  6372. } else {
  6373. this.$message({
  6374. message: res.msg,
  6375. type: "error"
  6376. });
  6377. }
  6378. },
  6379. error => {
  6380. this.$message({
  6381. message: error,
  6382. type: "error"
  6383. });
  6384. });
  6385. },
  6386. // 获取全部人员
  6387. getUsers() {
  6388. this.http.post('/user/getSimpleActiveUserList', {},
  6389. res => {
  6390. if (res.code == "ok") {
  6391. this.usersList = res.data;
  6392. } else {
  6393. this.$message({
  6394. message: res.msg,
  6395. type: "error"
  6396. });
  6397. }
  6398. },
  6399. error => {
  6400. this.$message({
  6401. message: error,
  6402. type: "error"
  6403. });
  6404. });
  6405. },
  6406. // 按时间比例
  6407. addBli(item, i) {
  6408. var iss = i
  6409. if(item.time == null) {
  6410. return
  6411. } else {
  6412. var zhi = this.zhoData[iss]
  6413. var he = 0
  6414. for(var i in zhi) {
  6415. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6416. he += +zhi[i].workingTime
  6417. }
  6418. }
  6419. zhi.he = he.toFixed(1) + 'h'
  6420. }
  6421. },
  6422. //按周填报选择的项目发生变化,需要设置列
  6423. onSelProjectChange() {
  6424. for (let i = 0; i < this.selCon.length; i++) {
  6425. var exists = false;
  6426. for (let j = 0; j < this.selProjectList.length; j++) {
  6427. if (this.selProjectList[j].id == this.selCon[i]) {
  6428. exists = true;
  6429. break;
  6430. }
  6431. }
  6432. if (!exists) {
  6433. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6434. this.selProjectList.push(newProject);
  6435. //添加新项目
  6436. for (var w in this.zhoData) {
  6437. var dayItem = this.zhoData[w];
  6438. var pName = newProject.projectName;
  6439. dayItem[pName] = {};
  6440. dayItem[pName].time = ''
  6441. dayItem[pName].content = ''
  6442. dayItem[pName].progress = 0
  6443. dayItem[pName].workingTime = 0
  6444. }
  6445. }
  6446. }
  6447. //去掉
  6448. for (let j = 0; j < this.selProjectList.length; j++) {
  6449. var exists = false;
  6450. for (let i = 0; i < this.selCon.length; i++) {
  6451. if (this.selProjectList[j].id == this.selCon[i]) {
  6452. exists = true;
  6453. break;
  6454. }
  6455. }
  6456. if (!exists) {
  6457. this.selProjectList.splice(j, 1);
  6458. j--;
  6459. }
  6460. }
  6461. this.loadFilledWeekReportItem();
  6462. //刷新表格
  6463. // this.$refs.weekTable.doLayout();
  6464. },
  6465. //根据选中的项目来刷新填写表格
  6466. loadFilledWeekReportItem() {
  6467. for (var w in this.zhoData) {
  6468. var dayItem = this.zhoData[w];
  6469. for (var i = 0; i < this.selProjectList.length; i++) {
  6470. var curColumnProject = this.selProjectList[i];
  6471. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6472. for (var t in dayItem.reportList) {
  6473. //有日报的项目,不能取消选择
  6474. for (var p in this.fillProjectList) {
  6475. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6476. }
  6477. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6478. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6479. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6480. if (this.reportTimeType.type == 2) {
  6481. //时间段模式
  6482. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6483. }
  6484. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6485. break;
  6486. }
  6487. }
  6488. // dayItem[curColumnProject.projectName] = matchReportItem;
  6489. }
  6490. }
  6491. this.$nextTick(()=>{
  6492. this.$refs.weekTable.doLayout();
  6493. });
  6494. },
  6495. initWeekFormData() {
  6496. this.weekDataLoading = true;
  6497. for (var p in this.fillProjectList) {
  6498. this.fillProjectList[p].canCancel = 1;
  6499. }
  6500. this.http.post('/report/getWeeklyReportData',{
  6501. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6502. },res => {
  6503. this.weekDataLoading = false;
  6504. if(res.code == 'ok'){
  6505. let projectList = res.data.projectList;
  6506. if (projectList.length > 0) {
  6507. //有选择过项目进行填报,直接选中
  6508. this.selProjectList = projectList;
  6509. this.selCon = [];
  6510. for (let i = 0; i < projectList.length; i++) {
  6511. this.selCon.push(projectList[i].id);
  6512. }
  6513. }
  6514. //设置日期
  6515. this.weekDateRange = res.data.dateList;
  6516. this.zhoData = [];
  6517. var arrst = []
  6518. for(var i in this.weekDateRange) {
  6519. var obj = {}
  6520. obj.zhoDataTime = this.weekDateRange[i].date
  6521. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6522. obj.he = this.weekDateRange[i].filledTime;
  6523. obj.canFill = this.weekDateRange[i].canFill;
  6524. // obj.filledTime = this.weekDateRange[i].filledTime;
  6525. obj.reportList = this.weekDateRange[i].reportList;
  6526. //初始化,防止渲染报错
  6527. for (var j = 0; j < this.selProjectList.length; j++) {
  6528. var pName = this.selProjectList[j].projectName
  6529. obj[pName] = {}
  6530. obj[pName].time = ''
  6531. obj[pName].content = ''
  6532. obj[pName].progress = 0
  6533. obj[pName].workingTime = 0
  6534. }
  6535. arrst.push(obj)
  6536. }
  6537. this.zhoData = arrst
  6538. this.setWeekCardTimeData(res.data.cardTimeList);
  6539. this.loadFilledWeekReportItem();
  6540. }else{
  6541. this.$message({
  6542. message: res.msg,
  6543. type: 'error'
  6544. })
  6545. }
  6546. },err => {
  6547. this.$message({
  6548. message: err,
  6549. type: 'error'
  6550. })
  6551. })
  6552. },
  6553. zhoZhi(res, i) {
  6554. var zhi = 0
  6555. for(var i in res) {
  6556. if(i != 'zhoDataTime' && i != 'he') {
  6557. zhi += +res[i]
  6558. }
  6559. }
  6560. res.he = zhi
  6561. },
  6562. zhoBtn(i) {
  6563. // this.zhoData.split(i, 1)
  6564. var arr = this.zhoData
  6565. arr.splice(i, 1)
  6566. },
  6567. zhoAddlast(){
  6568. this.selConShow = true
  6569. },
  6570. closeAddWeeklyReport(){
  6571. this.fillWeekDialogVisi = false
  6572. this.selConShow = true
  6573. this.selProjectList = []
  6574. this.selCon = []
  6575. },
  6576. // 提交按周填报
  6577. submitWeekReport(isDraft) {
  6578. var zhi = this.zhoData
  6579. var ll = 0
  6580. if(this.reportTimeType.type == 2) {
  6581. for(var i in zhi) {
  6582. this.dateAr = []
  6583. var alp = []
  6584. var zhis = zhi[i]
  6585. console.log(zhis)
  6586. for(var j in zhis) {
  6587. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6588. let objs = {}
  6589. objs.s = zhis[j].time[0]
  6590. objs.e = zhis[j].time[1]
  6591. objs.p = j
  6592. alp.push(objs)
  6593. }
  6594. }
  6595. console.log(alp)
  6596. this.dateAr = alp
  6597. if (this.reportTimeType.timeCanOverlap == 0) {
  6598. let str = this.$t('message.Filledtimeperiodsoverlap')
  6599. if(this.dateAr.length > 0) {
  6600. const trus = this.fns();
  6601. const overlapDataTime = this.getOverlapData(alp);
  6602. if (overlapDataTime.length > 0) {
  6603. const arrList = overlapDataTime.map((item) => item.p);
  6604. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6605. }
  6606. ll += 1
  6607. if(!trus) {
  6608. this.$message({
  6609. message: str,
  6610. type: 'error'
  6611. })
  6612. return false
  6613. }
  6614. }
  6615. } else {
  6616. if(this.dateAr.length > 0) {
  6617. ll +=1 ;
  6618. }
  6619. }
  6620. }
  6621. if(ll == 0) {
  6622. this.$message({
  6623. message: this.$t('message.Pleasefillinthetime'),
  6624. type: 'error'
  6625. })
  6626. return false
  6627. }
  6628. } else if(this.reportTimeType.type == 1){
  6629. for(var i in zhi) {
  6630. var zhis = zhi[i]
  6631. for(var j in zhis) {
  6632. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6633. ll += 1
  6634. }
  6635. }
  6636. }
  6637. if(ll == 0) {
  6638. this.$message({
  6639. message: this.$t('message.Pleaseselectatime'),
  6640. type: 'error'
  6641. })
  6642. return false
  6643. }
  6644. let overcorp = ''
  6645. for(let n in zhi){
  6646. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6647. overcorp += zhi[n].zhoDataTime + ','
  6648. }
  6649. }
  6650. if(overcorp != ''){
  6651. overcorp = overcorp.substring(0,overcorp.length - 1)
  6652. this.$message({
  6653. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6654. type: 'error'
  6655. })
  6656. return
  6657. }
  6658. }
  6659. var submits = []
  6660. let formData = new FormData();
  6661. formData.append("draft", isDraft);
  6662. if(this.reportTimeType.multiWorktime == 1){
  6663. for (var i in this.zhoData) {
  6664. var zhoD = this.zhoData[i]
  6665. var flgs = false
  6666. for(var j in zhoD) {
  6667. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6668. flgs = true
  6669. // formData.append("degreeId", "-1");
  6670. formData.append("id", '-1');
  6671. for(var s in this.projectList) {
  6672. if(j == this.projectList[s].projectName) {
  6673. formData.append("projectId", this.projectList[s].id);
  6674. }
  6675. }
  6676. if(this.user.timeType.reportAuditType == 3){
  6677. let audItem = {}
  6678. if(this.user.timeType.auditLevel > 0){
  6679. audItem.auditorFirst = zhoD[j].auditorFirst
  6680. }
  6681. if(this.user.timeType.auditLevel > 1){
  6682. audItem.auditorSec = zhoD[j].auditorSec
  6683. }
  6684. if(this.user.timeType.auditLevel > 2){
  6685. audItem.auditorThird = zhoD[j].auditorThird
  6686. }
  6687. if(zhoD[j].ccUserid){
  6688. audItem.ccUserid = zhoD[j].ccUserid
  6689. }
  6690. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6691. }
  6692. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6693. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6694. formData.append("reportTimeType", this.reportTimeType.type);
  6695. formData.append("endTime", '');
  6696. formData.append("startTime", '');
  6697. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6698. var lix = []
  6699. var objjs = {}
  6700. objjs.startTime = zhoD[j].time[0]
  6701. objjs.endTime = zhoD[j].time[1]
  6702. if (zhoD[j].content == null || zhoD[j].content == '') {
  6703. zhoD[j].content == '-'
  6704. }
  6705. objjs.content = zhoD[j].content
  6706. lix.push(objjs)
  6707. var zhiZhi = JSON.stringify(lix)
  6708. zhiZhi = zhiZhi.replace(/,/g,"@");
  6709. formData.append("content", zhiZhi)
  6710. formData.append("isOvertime", 0)
  6711. formData.append("professionProgress", "[]")
  6712. if (zhoD[j].groupId) {
  6713. formData.append("groupId",zhoD[j].groupId)
  6714. } else {
  6715. //解决后台groupId数组越界的问题
  6716. formData.append("groupId",0)
  6717. }
  6718. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6719. formData.append("createDate",zhoD.zhoDataTime)
  6720. if (zhoD[j].projectAuditorId) {
  6721. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6722. }
  6723. if(zhoD[j].basecostId) {
  6724. formData.append("basecostId", zhoD[j].basecostId);
  6725. } else {
  6726. formData.append("basecostId", 0);
  6727. }
  6728. if(this.user.timeType.customDegreeActive){
  6729. if (this.user.timeType.customDegreeMultiple) {
  6730. if (zhoD[j].multiDegrIdArray) {
  6731. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6732. } else {
  6733. formData.append('multiDegrId','[]')
  6734. }
  6735. } else {
  6736. if (zhoD[j].degreeId) {
  6737. formData.append('degreeId',zhoD[j].degreeId)
  6738. } else {
  6739. formData.append('degreeId','-1')
  6740. }
  6741. }
  6742. }else{
  6743. formData.append("degreeId", "-1");
  6744. }
  6745. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6746. formData.append('customData',zhoD[j].customData)
  6747. }else if(this.user.timeType.customDataActive){
  6748. formData.append('customData',0)
  6749. }
  6750. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6751. formData.append('customText',zhoD[j].customText)
  6752. }else if(this.user.timeType.customTextActive){
  6753. formData.append('customText','-')
  6754. }
  6755. }
  6756. }
  6757. }
  6758. } else {
  6759. for (var i in this.zhoData) {
  6760. var zhoD = this.zhoData[i]
  6761. var flgs = false
  6762. if(this.reportTimeType.type == 2) {
  6763. for(var k in this.selProjectList) {
  6764. var pItem = this.selProjectList[k];
  6765. var pName = pItem.projectName;
  6766. var j = pName;
  6767. console.log('j==周报中的项目='+j);
  6768. if(zhoD[j].time && zhoD[j].time != 'null') {
  6769. flgs = true
  6770. // formData.append("degreeId", "-1");
  6771. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6772. for(var s in this.projectList) {
  6773. if(j == this.projectList[s].projectName) {
  6774. formData.append("projectId", this.projectList[s].id);
  6775. }
  6776. }
  6777. if(this.user.timeType.reportAuditType == 3){
  6778. let audItem = {}
  6779. if(this.user.timeType.auditLevel > 0){
  6780. audItem.auditorFirst = zhoD[j].auditorFirst
  6781. }
  6782. if(this.user.timeType.auditLevel > 1){
  6783. audItem.auditorSec = zhoD[j].auditorSec
  6784. }
  6785. if(this.user.timeType.auditLevel > 2){
  6786. audItem.auditorThird = zhoD[j].auditorThird
  6787. }
  6788. if(zhoD[j].ccUserid){
  6789. audItem.ccUserid = zhoD[j].ccUserid
  6790. }
  6791. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6792. }
  6793. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6794. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6795. formData.append("reportTimeType", this.reportTimeType.type);
  6796. formData.append("endTime", zhoD[j].time[1]);
  6797. formData.append("startTime", zhoD[j].time[0]);
  6798. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6799. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6800. formData.append("isOvertime", 0)
  6801. formData.append("professionProgress", "[]")
  6802. if (zhoD[j].groupId) {
  6803. formData.append("groupId",zhoD[j].groupId)
  6804. } else {
  6805. //解决后台groupId数组越界的问题
  6806. formData.append("groupId",0)
  6807. }
  6808. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6809. formData.append("createDate",zhoD.zhoDataTime)
  6810. if (zhoD[j].projectAuditorId) {
  6811. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6812. }
  6813. if(zhoD[j].basecostId) {
  6814. formData.append("basecostId", zhoD[j].basecostId);
  6815. } else {
  6816. formData.append("basecostId", 0);
  6817. }
  6818. if(this.user.timeType.customDegreeActive){
  6819. if (this.user.timeType.customDegreeMultiple) {
  6820. if (zhoD[j].multiDegrIdArray) {
  6821. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6822. } else {
  6823. formData.append("multiDegrId", "[]");
  6824. }
  6825. } else {
  6826. if (zhoD[j].degreeId) {
  6827. formData.append('degreeId',zhoD[j].degreeId)
  6828. } else {
  6829. formData.append("degreeId", "-1");
  6830. }
  6831. }
  6832. }else{
  6833. formData.append("degreeId", "-1");
  6834. }
  6835. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6836. formData.append('customData',zhoD[j].customData)
  6837. }else if(this.user.timeType.customDataActive){
  6838. formData.append('customData',0)
  6839. }
  6840. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6841. formData.append('customText',zhoD[j].customText)
  6842. }else if(this.user.timeType.customTextActive){
  6843. formData.append('customText','-')
  6844. }
  6845. }
  6846. }
  6847. } else {
  6848. for(var k in this.selProjectList) {
  6849. var pItem = this.selProjectList[k];
  6850. var pName = pItem.projectName;
  6851. var j = pName;
  6852. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6853. flgs = true
  6854. // formData.append("degreeId", "-1");
  6855. console.log('进入了workFpppp==='+j);
  6856. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6857. for(var s in this.projectList) {
  6858. if(j == this.projectList[s].projectName) {
  6859. formData.append("projectId", this.projectList[s].id);
  6860. }
  6861. }
  6862. if(this.user.timeType.reportAuditType == 3){
  6863. let audItem = {}
  6864. if(this.user.timeType.auditLevel > 0){
  6865. audItem.auditorFirst = zhoD[j].auditorFirst
  6866. }
  6867. if(this.user.timeType.auditLevel > 1){
  6868. audItem.auditorSec = zhoD[j].auditorSec
  6869. }
  6870. if(this.user.timeType.auditLevel > 2){
  6871. audItem.auditorThird = zhoD[j].auditorThird
  6872. }
  6873. if(zhoD[j].ccUserid){
  6874. audItem.ccUserid = zhoD[j].ccUserid
  6875. }
  6876. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6877. }
  6878. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6879. // formData.append("subProjectId", zhoD[j].subProjectId);
  6880. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6881. formData.append("reportTimeType", this.reportTimeType.type);
  6882. if(this.reportTimeType.type == 1) {
  6883. formData.append("workingTime", zhoD[j].workingTime);
  6884. } else if(this.reportTimeType.type == 2) {
  6885. formData.append("endTime", zhoD[j].time[1]);
  6886. formData.append("startTime", zhoD[j].time[0]);
  6887. } else if(this.reportTimeType.type == 3) {
  6888. formData.append("progress", zhoD[j].progress);
  6889. formData.append("workingTime", zhoD[j].workingTime);
  6890. }
  6891. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6892. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6893. formData.append("isOvertime", 0)
  6894. formData.append("professionProgress", "[]")
  6895. if (zhoD[j].groupId) {
  6896. formData.append("groupId",zhoD[j].groupId)
  6897. } else {
  6898. //解决后台groupId数组越界的问题
  6899. formData.append("groupId",0)
  6900. }
  6901. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6902. formData.append("createDate",zhoD.zhoDataTime)
  6903. if (zhoD[j].projectAuditorId) {
  6904. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6905. }
  6906. if(zhoD[j].basecostId) {
  6907. formData.append("basecostId", zhoD[j].basecostId);
  6908. } else {
  6909. formData.append("basecostId", 0);
  6910. }
  6911. if(this.user.timeType.customDegreeActive){
  6912. if (this.user.timeType.customDegreeMultiple) {
  6913. if (zhoD[j].multiDegrIdArray) {
  6914. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6915. } else {
  6916. formData.append("multiDegrId", "[]");
  6917. }
  6918. } else {
  6919. if (zhoD[j].degreeId) {
  6920. formData.append('degreeId',zhoD[j].degreeId)
  6921. } else {
  6922. formData.append("degreeId", "-1");
  6923. }
  6924. }
  6925. }else{
  6926. formData.append("degreeId", "-1");
  6927. }
  6928. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6929. formData.append('customData',zhoD[j].customData)
  6930. }else if(this.user.timeType.customDataActive){
  6931. formData.append('customData',0)
  6932. }
  6933. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6934. formData.append('customText',zhoD[j].customText)
  6935. }else if(this.user.timeType.customTextActive){
  6936. formData.append('customText','-')
  6937. }
  6938. }
  6939. }
  6940. }
  6941. }
  6942. }
  6943. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6944. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6945. if(!next) {
  6946. this.$message({
  6947. message: `【${error.join('、')}】请填写任务分组`,
  6948. type: 'error'
  6949. })
  6950. return
  6951. }
  6952. // 自定义维度
  6953. this.submitingReport = true;
  6954. this.http.uploadFile( this.port.report.editPort, formData,
  6955. res => {
  6956. // this.listLoading = false;
  6957. this.submitingReport = false;
  6958. if (res.code == "ok") {
  6959. this.$message({
  6960. message: this.$t('message.fillinsuccessfully'),
  6961. type: "success"
  6962. });
  6963. this.fillWeekDialogVisi = false
  6964. this.selConShow = true
  6965. this.zhoData = []
  6966. this.weekDateRange = ''
  6967. this.getReportList();
  6968. this.getDepartment();
  6969. // 关闭弹窗 并 清空
  6970. this.selProjectList = []
  6971. this.selCon = []
  6972. this.getRecentlyProject()
  6973. } else {
  6974. this.$message({
  6975. message: res.msg,
  6976. type: "error"
  6977. });
  6978. }
  6979. },
  6980. error => {
  6981. this.submitingReport = false;
  6982. this.$message({
  6983. message: error,
  6984. type: "error"
  6985. });
  6986. });
  6987. },
  6988. handleGroupAuditorData(data) {
  6989. const { reportAuditType } = this.user.timeType
  6990. if(reportAuditType != 1 && reportAuditType != 2) {
  6991. return {next: true}
  6992. }
  6993. let arrList = [];
  6994. Object.entries(data).forEach(([key, obj]) => {
  6995. Object.entries(obj).forEach(([projectName, projectData]) => {
  6996. if (projectData.workingTime && !projectData.groupId) {
  6997. arrList.push({
  6998. projectName,
  6999. date: obj.zhoDataTime,
  7000. dateText: obj.zhoDataTimeTxt
  7001. });
  7002. }
  7003. });
  7004. });
  7005. if(arrList.length > 0) {
  7006. return {
  7007. next: false,
  7008. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7009. }
  7010. } else {
  7011. return {
  7012. next: true,
  7013. error: [],
  7014. }
  7015. }
  7016. },
  7017. ChangeHourMinutestr (str) {
  7018. if (str !== "0" && str !== "" && str !== null) {
  7019. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7020. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7021. } else {
  7022. return "";
  7023. }
  7024. },
  7025. // 得到两个日期中间的日期
  7026. getdiffdate(stime,etime){
  7027. //初始化日期列表,数组
  7028. var diffdate = new Array();
  7029. var i=0;
  7030. //开始日期小于等于结束日期,并循环
  7031. while(stime<=etime){
  7032. diffdate[i] = stime;
  7033. //获取开始日期时间戳
  7034. var stime_ts = new Date(stime).getTime();
  7035. //增加一天时间戳后的日期
  7036. var next_date = stime_ts + (24*60*60*1000);
  7037. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7038. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7039. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7040. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7041. stime = next_dates_y+next_dates_m+next_dates_d;
  7042. //增加数组key
  7043. i++;
  7044. }
  7045. return diffdate;
  7046. },
  7047. // 添加模块
  7048. addDomain(i) {
  7049. var leftProgress = 10;
  7050. if (this.reportTimeType.type == 3) {
  7051. //计算已经待分配工时比例
  7052. let array = this.workForm.domains;
  7053. let totalProgress = 0;
  7054. for (var i=0;i<array.length; i++) {
  7055. totalProgress += array[i].progress;
  7056. }
  7057. if (totalProgress < 100) {
  7058. leftProgress = 100 - totalProgress;
  7059. }
  7060. }
  7061. var addItem = {
  7062. projectId: "",
  7063. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7064. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7065. ),
  7066. content: "",
  7067. progress:leftProgress,
  7068. state:2,//2-表示待提交
  7069. multiWorktime: this.reportTimeType.multiWorktime,
  7070. worktimeList:[{}],
  7071. canEdit: true,
  7072. auditorFirst: '',
  7073. auditorSec: '',
  7074. auditorThird: '',
  7075. ccUserid: ''
  7076. // degreeId: '',
  7077. };
  7078. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7079. this.$set(addItem,'isOvertime',true)
  7080. if(this.reportTimeType.type == 3){
  7081. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7082. }
  7083. }
  7084. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7085. //默认给第一个,必填字段
  7086. addItem.basecostId = this.timeBasecostList[0].id;
  7087. }
  7088. this.workForm.domains.push(addItem);
  7089. document.getElementById('workFormsItemBottom').scrollIntoView()
  7090. this.canEdit = true
  7091. if (this.reportTimeType.type == 0) {
  7092. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7093. var length = this.workForm.domains.length;
  7094. if (length == 2) {
  7095. this.showAddMore = false;
  7096. }
  7097. }
  7098. this.chuji()
  7099. this.seleChn()
  7100. },
  7101. // 移除模块
  7102. delDomain(i) {
  7103. this.workForm.domains.splice(i,1)
  7104. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7105. if (!this.originCanEdit) {
  7106. let iscan = false
  7107. for(let i in this.workForm.domains){
  7108. if(this.workForm.domains[i].canEdit){
  7109. iscan = true
  7110. }
  7111. }
  7112. this.canEdit = iscan
  7113. }
  7114. //检测当前剩下的一个,时间类型是否是全天
  7115. if (this.reportTimeType.type == 0) {
  7116. if (this.workForm.domains[0].timeType == 0) {
  7117. this.showAddMore = false;
  7118. } else {
  7119. this.showAddMore = true;
  7120. }
  7121. }
  7122. if(this.user.timeType.multiWorktime == 1) {
  7123. this.iptChangs()
  7124. } else {
  7125. this.seleChn(0)
  7126. }
  7127. },
  7128. // 改变月份
  7129. changeMonth() {
  7130. this.isWeekend = false
  7131. let date = new Date()
  7132. let nowmon = date.getMonth() + 1
  7133. let nowday = date.getDate()
  7134. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7135. if (this.isBatch == 0) {
  7136. if(this.user.timeType.fillAhead == 0){
  7137. let date_a = new Date(this.workForm.createDate)
  7138. if(date_a.getTime() > date.getTime()){
  7139. this.workForm.createDate = nowdate
  7140. }
  7141. }
  7142. //只有按天填报才能获取当天的日报
  7143. if(!this.isSubstitude){
  7144. let weekday = new Date(this.workForm.createDate).getDay()
  7145. if(this.user.companyId == 817){
  7146. if(weekday == 0){
  7147. this.isWeekend = true
  7148. }
  7149. }else{
  7150. if(weekday == 0 || weekday == 6){
  7151. this.isWeekend = true
  7152. }
  7153. }
  7154. this.getReport()
  7155. }
  7156. }else {
  7157. if(this.user.timeType.fillAhead == 0){
  7158. let date_a = new Date(this.workForm.createDate[1])
  7159. if(date_a.getTime() > date.getTime()){
  7160. this.workForm.createDate[1] = nowdate
  7161. let sdate = new Date(this.workForm.createDate[0])
  7162. let edate = new Date(this.workForm.createDate[1])
  7163. if(sdate > edate){
  7164. this.workForm.createDate[0] = this.workForm.createDate[1]
  7165. }
  7166. }
  7167. }
  7168. }
  7169. },
  7170. // 判断时间段
  7171. fns() {
  7172. for (let k in this.dateAr) {
  7173. if (!this.judege(k)) {
  7174. return false
  7175. }
  7176. }
  7177. return true
  7178. },
  7179. judege(idx){
  7180. for (let k in this.dateAr) {
  7181. if (idx !== k) {
  7182. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7183. return false
  7184. }
  7185. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7186. return false
  7187. }
  7188. }
  7189. }
  7190. return true
  7191. },
  7192. getOverlapData(data) {
  7193. let overlapData = [];
  7194. for (let i = 0; i < data.length; i++) {
  7195. for (let j = i + 1; j < data.length; j++) {
  7196. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7197. overlapData.push(data[i], data[j]);
  7198. }
  7199. }
  7200. }
  7201. return overlapData;
  7202. },
  7203. // 保存日报111111
  7204. submitReport(isDraft) {
  7205. this.isDraft = isDraft;
  7206. this.$refs.workForm.validate(valid => {
  7207. if (valid) {
  7208. if(this.totalReportHours < this.user.timeType.allday){
  7209. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7210. confirmButtonText: '确定',
  7211. cancelButtonText: '取消',
  7212. type: 'warning'
  7213. }).then(() => {
  7214. this.submitReportSon()
  7215. }).catch(() => {
  7216. });
  7217. }else{
  7218. this.submitReportSon()
  7219. }
  7220. }
  7221. });
  7222. },
  7223. submitReportSon() {
  7224. this.dateAr = []
  7225. //检查重叠
  7226. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7227. let alp = []
  7228. if(this.user.timeType.multiWorktime != 1) {
  7229. for(var p in this.workForm.domains) {
  7230. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7231. let objs = {}
  7232. objs.s = this.workForm.domains[p].startTime
  7233. objs.e = this.workForm.domains[p].endTime
  7234. alp.push(objs)
  7235. }
  7236. }
  7237. this.dateAr = alp
  7238. if(this.dateAr.length > 0) {
  7239. let trus = this.fns()
  7240. if(!trus) {
  7241. this.$message({
  7242. message: this.$t('message.Filledtimeperiodsoverlap'),
  7243. type: "error"
  7244. });
  7245. return
  7246. }
  7247. }
  7248. } else {
  7249. for(var p in this.workForm.domains) {
  7250. var slll = this.workForm.domains[p]
  7251. for(var o in slll.worktimeList) {
  7252. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7253. let objs = {}
  7254. objs.s = slll.worktimeList[o].startTime
  7255. objs.e = slll.worktimeList[o].endTime
  7256. alp.push(objs)
  7257. }
  7258. }
  7259. }
  7260. this.dateAr = alp
  7261. if(this.dateAr.length > 0) {
  7262. let trus = this.fns()
  7263. if(!trus) {
  7264. this.$message({
  7265. message: this.$t('message.Filledtimeperiodsoverlap'),
  7266. type: "error"
  7267. });
  7268. return
  7269. }
  7270. }
  7271. }
  7272. }
  7273. //检查子项目
  7274. if (this.user.timeType.subProMustFill == 1) {
  7275. for(var p in this.workForm.domains) {
  7276. var oneProItem = this.workForm.domains[p]
  7277. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7278. //没有选择子项目
  7279. this.$message({
  7280. message: '子项目必填,请检查',
  7281. type: "error"
  7282. });
  7283. return
  7284. }
  7285. }
  7286. }
  7287. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7288. if (this.user.companyId == this.yuzhongCompId) {
  7289. for(var p in this.workForm.domains) {
  7290. var oneProItem = this.workForm.domains[p]
  7291. if (!oneProItem.extraField1) {
  7292. this.$message({
  7293. message: '角色必填,请检查',
  7294. type: "error"
  7295. });
  7296. return
  7297. }
  7298. if (!oneProItem.extraField2) {
  7299. this.$message({
  7300. message: '工作职责必填,请检查',
  7301. type: "error"
  7302. });
  7303. return
  7304. }
  7305. if (!oneProItem.extraField3) {
  7306. this.$message({
  7307. message: '工作内容必填,请检查',
  7308. type: "error"
  7309. });
  7310. return
  7311. }
  7312. }
  7313. }
  7314. // return
  7315. //代填的情况,检查人员是否已经选择
  7316. if (this.isSubstitude) {
  7317. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7318. this.$message({
  7319. message: this.$t('message.pleaseselectthepersontofillin'),
  7320. type: "error"
  7321. });
  7322. return;
  7323. }
  7324. }
  7325. //检查时间,全天和上下午不能同时存在
  7326. if (this.reportTimeType.type == 0) {
  7327. var alldayNum = 0;
  7328. var amNum = 0;
  7329. var pmNum = 0;
  7330. for(var i in this.workForm.domains) {
  7331. if (this.workForm.domains[i].timeType == 0) {
  7332. alldayNum ++;
  7333. } else if (this.workForm.domains[i].timeType == 1) {
  7334. amNum++;
  7335. } else if (this.workForm.domains[i].timeType == 2) {
  7336. pmNum++;
  7337. }
  7338. }
  7339. if (alldayNum > 1) {
  7340. this.$message({
  7341. // message: "工作时间-全天,只能选择一次",
  7342. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7343. type: "error"
  7344. });
  7345. return;
  7346. }
  7347. if (amNum > 1) {
  7348. this.$message({
  7349. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7350. type: "error"
  7351. });
  7352. return;
  7353. }
  7354. if (pmNum > 1) {
  7355. this.$message({
  7356. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7357. type: "error"
  7358. });
  7359. return;
  7360. }
  7361. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7362. this.$message({
  7363. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7364. type: "error"
  7365. });
  7366. return;
  7367. }
  7368. } else if (this.reportTimeType.type == 3) {
  7369. //总百分比不能超过100%
  7370. let total = 0;
  7371. this.workForm.domains.forEach(w=>{total += w.progress});
  7372. if (total > 100) {
  7373. this.$message({
  7374. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7375. type: "error"
  7376. });
  7377. return;
  7378. } else if (total < 100) {
  7379. this.$message({
  7380. message: this.$t('message.cannotbesubmitted'),
  7381. type: "error"
  7382. });
  7383. return;
  7384. }
  7385. }
  7386. this.listLoading = true;
  7387. let formData = new FormData();
  7388. formData.append("draft", this.isDraft);
  7389. var totalTime = 0;
  7390. for (var t=0;t<this.workForm.domains.length; t++) {
  7391. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7392. }
  7393. //批量填报不校验考勤时长,交给后台校验
  7394. if (!this.isBatch) {
  7395. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7396. if (this.workForm.time){
  7397. if (this.workForm.time.workHours == 0){
  7398. this.$message({
  7399. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7400. type: 'error'
  7401. })
  7402. return
  7403. }
  7404. }else{
  7405. this.$message({
  7406. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7407. type: 'error'
  7408. })
  7409. return
  7410. }
  7411. }
  7412. }
  7413. //针对凡己,不校验考勤时长
  7414. if (this.user.companyId != 3918 && this.reportTimeType.type == 1 && this.workForm.time) {
  7415. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7416. this.$message({
  7417. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7418. type: "error"
  7419. });
  7420. return;
  7421. }
  7422. }
  7423. for(var i in this.workForm.domains) {
  7424. // 检查任务/里程碑是否为必填
  7425. let taskRequired = this.user.timeType.taskRequired
  7426. if(taskRequired == 1) {
  7427. if(!this.workForm.domains[i].taskId) {
  7428. this.$message({
  7429. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7430. type: "error"
  7431. });
  7432. return
  7433. }
  7434. }
  7435. if(this.user.timeType.reportAuditType == 3){
  7436. let audItem = {}
  7437. let auditRule = ''
  7438. if(this.workForm.domains[i].id){
  7439. audItem.reportId = this.workForm.domains[i].id
  7440. }
  7441. if(this.user.timeType.auditLevel > 0){
  7442. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7443. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7444. }
  7445. if(this.user.timeType.auditLevel > 1){
  7446. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7447. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7448. }
  7449. if(this.user.timeType.auditLevel > 2){
  7450. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7451. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7452. }
  7453. if(this.workForm.domains[i].ccUserid){
  7454. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7455. }
  7456. if(auditRule){
  7457. auditRule = auditRule.substring(0,auditRule.length - 1)
  7458. this.$message({
  7459. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7460. type: 'error'
  7461. })
  7462. return
  7463. }
  7464. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7465. }
  7466. if (this.user.timeType.customDegreeActive) {
  7467. if (this.user.timeType.customDegreeMultiple) {
  7468. //多选
  7469. if (this.workForm.domains[i].multiDegrIdArray) {
  7470. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7471. degreeArray = degreeArray.replace(/,/g,"@");
  7472. formData.append("multiDegrId", degreeArray);
  7473. } else {
  7474. formData.append("multiDegrId", '[]');
  7475. }
  7476. } else {
  7477. //单选
  7478. if (this.workForm.domains[i].degreeId) {
  7479. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7480. } else {
  7481. formData.append("degreeId", -1);
  7482. }
  7483. }
  7484. } else {
  7485. formData.append("degreeId", -1);
  7486. }
  7487. if(this.workForm.domains[i].customData) {
  7488. // var sss = this.workForm.domains[i].degreeId.toString()
  7489. formData.append("customData", this.workForm.domains[i].customData);
  7490. } else {
  7491. formData.append("customData", 0);
  7492. }
  7493. if(this.workForm.domains[i].customText) {
  7494. formData.append("customText", this.workForm.domains[i].customText);
  7495. } else {
  7496. formData.append("customText", '-');
  7497. }
  7498. if (this.workForm.domains[i].id) {
  7499. formData.append("id", this.workForm.domains[i].id);
  7500. } else {
  7501. formData.append("id", -1);
  7502. }
  7503. formData.append("projectId", this.workForm.domains[i].projectId);
  7504. if (this.workForm.domains[i].subProjectId) {
  7505. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7506. } else {
  7507. formData.append("subProjectId", 0);
  7508. }
  7509. if (this.workForm.domains[i].groupId) {
  7510. formData.append("groupId", this.workForm.domains[i].groupId);
  7511. } else {
  7512. formData.append("groupId", 0);
  7513. }
  7514. if (this.workForm.domains[i].taskId) {
  7515. formData.append("taskId", this.workForm.domains[i].taskId);
  7516. } else {
  7517. formData.append("taskId", 0);
  7518. }
  7519. if (this.workForm.domains[i].taskFinish == true) {
  7520. formData.append("taskFinish", 1);
  7521. } else {
  7522. formData.append("taskFinish", 0);
  7523. }
  7524. formData.append("reportTimeType", this.reportTimeType.type);
  7525. if (this.reportTimeType.type == 0) {
  7526. formData.append("timeType", this.workForm.domains[i].timeType);
  7527. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7528. formData.append("workingTime", workingTime);
  7529. } else if (this.reportTimeType.type == 1){
  7530. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7531. } else if (this.reportTimeType.type == 2) {
  7532. formData.append("endTime", this.workForm.domains[i].endTime);
  7533. formData.append("startTime", this.workForm.domains[i].startTime);
  7534. } else if (this.reportTimeType.type == 3) {
  7535. //按比例分配
  7536. formData.append("progress", this.workForm.domains[i].progress);
  7537. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7538. }
  7539. if(this.user.timeType.choseFromAlbum == 1 ) {
  7540. console.log(this.workForm.domains[i].imgList)
  7541. if(this.workForm.domains[i].imgList) {
  7542. let imgListFor = this.workForm.domains[i].imgList
  7543. for(var b in imgListFor) {
  7544. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7545. }
  7546. console.log(imgListFor)
  7547. let m = JSON.stringify(imgListFor);
  7548. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7549. formData.append("picStr", m);
  7550. } else {
  7551. formData.append("picStr", '[]');
  7552. }
  7553. }
  7554. //处理多个时间事项
  7555. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7556. if (this.reportTimeType.multiWorktime == 1) {
  7557. //检查时间是否有重叠
  7558. var workList = this.workForm.domains[i].worktimeList;
  7559. for (var j=0;j<workList.length; j++) {
  7560. var curItem = workList[j];
  7561. //检查开始时间是否大于结束时间
  7562. if (curItem.startTime >= curItem.endTime) {
  7563. this.$message({
  7564. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7565. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7566. type: "error"
  7567. });
  7568. return;
  7569. }
  7570. //时间不可重叠
  7571. if (this.reportTimeType.timeCanOverlap == 0) {
  7572. for (var p = j+1;p<workList.length; p++) {
  7573. var jItem = workList[p];
  7574. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7575. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7576. this.$message({
  7577. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7578. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7579. type: "error"
  7580. });
  7581. return;
  7582. }
  7583. }
  7584. }
  7585. }
  7586. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7587. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7588. formData.append("content", m);
  7589. } else {
  7590. if (this.workForm.domains[i].content) {
  7591. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7592. m = m.replace(/,/g,",");
  7593. console.log(m, '需要传值的数据')
  7594. // formData.append("content", this.workForm.domains[i].content);
  7595. formData.append("content", m);
  7596. } else {
  7597. formData.append("content", '-');
  7598. }
  7599. }
  7600. if (this.isBatch == 0) {
  7601. formData.append("createDate", this.workForm.createDate);
  7602. } else {
  7603. //批量填报,时间范围
  7604. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7605. }
  7606. if(this.workForm.domains[i].isOvertime) {
  7607. formData.append("isOvertime", 1);
  7608. } else {
  7609. formData.append("isOvertime", 0);
  7610. }
  7611. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7612. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7613. } else {
  7614. formData.append("overtimeHours", 0);
  7615. }
  7616. if(this.workForm.domains[i].basecostId) {
  7617. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7618. } else {
  7619. formData.append("basecostId", 0);
  7620. }
  7621. if (this.workForm.userId != null) {
  7622. var targetUids = '';
  7623. this.workForm.userId.forEach(u=>{
  7624. targetUids += u + '@';
  7625. });
  7626. if (targetUids.length > 0) {
  7627. targetUids = targetUids.substring(0, targetUids.length -1);
  7628. formData.append("targetUids", targetUids);
  7629. }
  7630. }
  7631. //项目专业进度
  7632. if (this.workForm.domains[i].professionProgress) {
  7633. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7634. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7635. formData.append("professionProgress", m);
  7636. } else {
  7637. formData.append("professionProgress", "[]");
  7638. }
  7639. if (this.workForm.domains[i].stage) {
  7640. formData.append("stage", this.workForm.domains[i].stage);
  7641. } else {
  7642. formData.append("stage", "-");
  7643. }
  7644. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7645. if (this.workForm.domains[i].projectAuditorId) {
  7646. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7647. } else {
  7648. // console.log('执行到了这里')
  7649. // console.log(this.user.timeType.reportAuditType)
  7650. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7651. this.$message({
  7652. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7653. type: "error"
  7654. });
  7655. return;
  7656. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7657. //分组负责人先审核, 确定是选择了任务分组
  7658. if (this.workForm.domains[i].taskGroups.length == 0) {
  7659. this.$message({
  7660. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7661. type: "error"
  7662. });
  7663. } else if (!this.workForm.domains[i].groupId) {
  7664. // console.log(this.workForm.domains[i]);
  7665. this.$message({
  7666. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7667. type: "error"
  7668. });
  7669. } else {
  7670. this.$message({
  7671. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7672. type: "error"
  7673. });
  7674. }
  7675. return;
  7676. }
  7677. }
  7678. if (this.user.companyId == this.yuzhongCompId) {
  7679. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7680. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7681. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7682. }
  7683. //依斯贝的服务Id
  7684. if (this.user.companyId == this.yisibeiCompId) {
  7685. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7686. }
  7687. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7688. this.$message({
  7689. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7690. type: "error"
  7691. });
  7692. return
  7693. }
  7694. }
  7695. this.submitingReport = true;
  7696. this.http.uploadFile( this.port.report.editPort, formData,
  7697. res => {
  7698. this.listLoading = false;
  7699. this.submitingReport = false;
  7700. if (res.code == "ok") {
  7701. if(res.msg!=null){
  7702. this.$message({
  7703. dangerouslyUseHTMLString: true,
  7704. message: res.msg,
  7705. type: "warning",
  7706. showClose: true,
  7707. duration: 0
  7708. });
  7709. }else{
  7710. this.$message({
  7711. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7712. type: "success"
  7713. });
  7714. }
  7715. this.dialogVisible = false;
  7716. this.jsDay = 0
  7717. this.jsTime = 0
  7718. this.getReportList();
  7719. this.getDepartment();
  7720. this.getRecentlyProject()
  7721. } else {
  7722. this.$message({
  7723. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7724. type: "error"
  7725. });
  7726. }
  7727. },
  7728. error => {
  7729. this.listLoading = false;
  7730. this.submitingReport = false;
  7731. this.$message({
  7732. message: error,
  7733. type: "error"
  7734. });
  7735. });
  7736. },
  7737. // 判断是展示那个工时导入
  7738. imports() {
  7739. if(this.user.timeType.syncCorpwxTime == 0) {
  7740. this.importDialog = true
  7741. } else {
  7742. this.importWxDialog = true
  7743. }
  7744. },
  7745. // 跳转
  7746. junpToDeskTop(id) {
  7747. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7748. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7749. },
  7750. // 通过日报
  7751. approve(id, item) {
  7752. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7753. this.approveinData = {
  7754. id: id,
  7755. date: this.date +day,
  7756. reportIds: item.id
  7757. }
  7758. if(this.user.timeType.needEvaluate == 1){
  7759. this.$set(this.approveinData,'evaluate','')
  7760. this.approveinDialog = true
  7761. }else{
  7762. this.logining = true;
  7763. this.approveinfun()
  7764. }
  7765. },
  7766. approveinfun(){
  7767. this.http.post( this.port.report.approve, this.approveinData,
  7768. res => {
  7769. this.logining = false;
  7770. if (res.code == "ok") {
  7771. this.approveinDialog = false
  7772. this.$message({
  7773. message: this.$t('message.Reviewsucceeded'),
  7774. type: "success"
  7775. });
  7776. this.refreshReportData(this.approveinData.reportIds);
  7777. this.getDepartment();
  7778. } else {
  7779. this.$message({
  7780. message: res.msg,
  7781. type: "error"
  7782. });
  7783. }
  7784. },
  7785. error => {
  7786. this.logining = false;
  7787. this.$message({
  7788. message: error,
  7789. type: "error"
  7790. });
  7791. });
  7792. },
  7793. //撤回日报
  7794. cancel(item,e) {
  7795. // console.log('can can need',item);
  7796. this.logining = true;
  7797. var ids = '';
  7798. var data = e ? item : item.data;
  7799. data.forEach(element => {
  7800. if(element.id){
  7801. ids +=(element.id+',');
  7802. }
  7803. });
  7804. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7805. res => {
  7806. this.logining = false;
  7807. if (res.code == "ok") {
  7808. this.$message({
  7809. message:this.$t('message.Withdrawalsucceeded'),
  7810. type: "success"
  7811. });
  7812. this.getReportList();
  7813. if(e){this.getReport()}
  7814. this.getDepartment();
  7815. } else {
  7816. this.$message({
  7817. message: res.msg,
  7818. type: "error"
  7819. });
  7820. }
  7821. },
  7822. error => {
  7823. this.logining = false;
  7824. this.$message({
  7825. message: error,
  7826. type: "error"
  7827. });
  7828. });
  7829. },
  7830. showDenyDialog(id,i, item) {
  7831. this.denyReasonDialog = true;
  7832. this.isDenying = false;
  7833. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7834. var ids = item.id;
  7835. // var data = item.data;
  7836. // data.forEach(element => {
  7837. // ids +=(element.id+',');
  7838. // });
  7839. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7840. },
  7841. // 未通过日报
  7842. deny() {
  7843. this.logining = true;
  7844. this.isDenying = true;
  7845. this.http.post( this.port.report.deny, this.denyForm,
  7846. res => {
  7847. this.logining = false;
  7848. this.isDenying = false;
  7849. if (res.code == "ok") {
  7850. this.$message({
  7851. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7852. type: "success"
  7853. });
  7854. this.refreshReportData(this.denyForm.reportIds);
  7855. this.getDepartment();
  7856. this.denyReasonDialog = false;
  7857. } else {
  7858. this.$message({
  7859. message: res.msg,
  7860. type: "error"
  7861. });
  7862. }
  7863. },
  7864. error => {
  7865. this.logining = false;
  7866. this.$message({
  7867. message: error,
  7868. type: "error"
  7869. });
  7870. });
  7871. },
  7872. // 查看工时记录弹窗
  7873. toView() {
  7874. this.toViewDialogVisible = true
  7875. this.toViewloading = true
  7876. this.getToView()
  7877. },
  7878. getToView() {
  7879. this.http.post( '/report-import-log/getList', this.toViewForm,
  7880. res => {
  7881. this.toViewloading = false;
  7882. if (res.code == "ok") {
  7883. // console.log(res.data, '数据数据')
  7884. this.toViewList = res.data.records
  7885. this.toViewForm.total = res.data.total
  7886. } else {
  7887. this.toViewloading = false;
  7888. this.$message({
  7889. message: res.msg,
  7890. type: "error"
  7891. });
  7892. }
  7893. })
  7894. },
  7895. // 触发 selectCat 组件更改他的值
  7896. selectCatCli(obj) {
  7897. // console.log(obj, '看看')
  7898. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7899. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7900. },
  7901. vueCasader(obj) {
  7902. console.log(obj, '看看值')
  7903. if(obj.distinction == 1 && obj.item) {
  7904. let arr = []
  7905. arr.push(obj.item.value)
  7906. this.exportParam.departmentId = arr
  7907. }
  7908. },
  7909. //分页
  7910. handleCurrentChange(val) {
  7911. this.toViewForm.pageIndex = val;
  7912. this.getToView();
  7913. },
  7914. handleSizeChange(val) {
  7915. this.toViewForm.pageSize = val;
  7916. this.getToView();
  7917. },
  7918. getAllUsersList(){
  7919. this.http.post('/user/getSimpleActiveUserList',{
  7920. },res => {
  7921. if(res.code == 'ok'){
  7922. this.allUsersList = res.data
  7923. }else{
  7924. this.$message({
  7925. message: res.msg,
  7926. type: 'error'
  7927. })
  7928. }
  7929. },err => {
  7930. this.$message({
  7931. message: err,
  7932. type: 'error'
  7933. })
  7934. })
  7935. },
  7936. //景昱变更提醒
  7937. changeReminder(item){
  7938. console.log("============",item)
  7939. let parameter={}
  7940. if(item){
  7941. parameter={
  7942. createDate:item.createDate,
  7943. userId:item.userId,
  7944. }
  7945. }
  7946. this.http.post('/report/changeReminder',parameter,res => {
  7947. if(res.code == 'ok'){
  7948. this.$message({
  7949. message: res.msg,
  7950. type: 'success'
  7951. })
  7952. }else{
  7953. this.$message({
  7954. message: res.msg,
  7955. type: 'error'
  7956. })
  7957. }
  7958. },err => {
  7959. this.$message({
  7960. message: err,
  7961. type: 'error'
  7962. })
  7963. })
  7964. },
  7965. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7966. fillWeekCustomClne() {
  7967. this.fillWeekDialogVisiCustom = false
  7968. },
  7969. fillWeekCustomSubmit() {
  7970. this.getReportList();
  7971. this.getDepartment();
  7972. this.getRecentlyProject()
  7973. },
  7974. // 待填日报姓名搜索
  7975. nameAearchSeek(flg) {
  7976. if(!this.nameAearch) {
  7977. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7978. return
  7979. }
  7980. if(flg) {
  7981. this.enterpriseWechatgetUser()
  7982. }
  7983. },
  7984. handleThreeData(userList) {
  7985. console.log(userList, '人员数据')
  7986. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7987. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7988. },
  7989. // 过滤树节点
  7990. filterTreeNodes(treeData, filterKeywords) {
  7991. return treeData.filter((node) => {
  7992. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7993. if (node.children && node.children.length > 0) {
  7994. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7995. }
  7996. return true;
  7997. }
  7998. if (node.children && node.children.length > 0) {
  7999. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8000. return node.children.length > 0;
  8001. }
  8002. return false;
  8003. });
  8004. },
  8005. // 企业微信获取人员
  8006. enterpriseWechatgetUser() {
  8007. this.deptMembDataLoading = true
  8008. this.http.post('/user/getEmployeeList',{
  8009. departmentId: -1,
  8010. pageIndex: 1,
  8011. pageSize: 100,
  8012. keyword: this.nameAearch,
  8013. status: '',
  8014. roleId: '',
  8015. cursor: '',
  8016. onlyDirect: '',
  8017. matchingType: ''
  8018. },res => {
  8019. if(res.code == 'ok'){
  8020. this.deptMembDataLoading = false
  8021. const userListName = res.data.records.map(item => item.name)
  8022. this.handleThreeData(userListName)
  8023. }else{
  8024. this.deptMembDataLoading = false
  8025. this.$message({
  8026. message: res.msg,
  8027. type: 'error'
  8028. })
  8029. }
  8030. },err => {
  8031. this.deptMembDataLoading = false
  8032. this.$message({
  8033. message: err,
  8034. type: 'error'
  8035. })
  8036. })
  8037. },
  8038. // 按周填报获取相关任务
  8039. async getWeeklyTaskList(item) {
  8040. console.log(item, '<=== 数据')
  8041. const { projectId, groupId, stage, taskId } = item
  8042. console.log(projectId, groupId, stage)
  8043. let parms = { projectId, isSubstitude: 0 }
  8044. groupId ? parms.groupId = groupId : ''
  8045. stage ? parms.stage = stage : ''
  8046. const { data } = await this.postData('/task/getRecentTask', parms)
  8047. this.zhoBao.taskId = taskId
  8048. this.$set(this.zhoBao, 'taskList', data)
  8049. console.log(this.zhoBao)
  8050. },
  8051. // 封装 post 请求
  8052. postData(url, params) {
  8053. return new Promise((resolve, reject) => {
  8054. this.http.post(url, { ...params },
  8055. res => {
  8056. resolve(res)
  8057. },
  8058. error => {
  8059. this.$message({
  8060. message: error,
  8061. type: "error"
  8062. });
  8063. reject(error)
  8064. })
  8065. })
  8066. },
  8067. // 自定义事件
  8068. selectCal(obj) {
  8069. console.log(obj, '传数据来源')
  8070. if(obj.distinction == '1') {
  8071. this.zhoBao.projectAuditorId = obj.id
  8072. } else if(obj.distinction == '2') {
  8073. this.zhoBao.auditorFirst = obj.id
  8074. } else if(obj.distinction == '3') {
  8075. this.zhoBao.auditorSec = obj.id
  8076. } else if(obj.distinction == '4') {
  8077. this.zhoBao.auditorThird = obj.id
  8078. } else if(obj.distinction == '5') {
  8079. this.zhoBao.ccUserid = obj.id
  8080. } else if(obj.distinction == '12') {
  8081. this.usersListId = obj.id
  8082. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8083. this.searchKeyword = obj.name
  8084. } else {
  8085. this.searchKeyword = ''
  8086. }
  8087. this.searchScreen(0)
  8088. } else if(obj.distinction == '13') {
  8089. this.usersListId = obj.id
  8090. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8091. this.searchKeyword = obj.name
  8092. } else {
  8093. this.searchKeyword = ''
  8094. }
  8095. this.searchScreen(1)
  8096. }
  8097. }
  8098. },
  8099. created() {
  8100. this.getUsers()
  8101. let height = window.innerHeight;
  8102. this.tableHeight = height - 178;
  8103. const that = this;
  8104. window.onresize = function temp() {
  8105. that.tableHeight = window.innerHeight - 178;
  8106. };
  8107. this.toViewForm.companyId = this.user.companyId
  8108. this.initDrag([{
  8109. type: "LR",
  8110. domClass: {
  8111. // 中间分割线的名字
  8112. resize: "line-line",
  8113. // 左侧盒子的名字
  8114. left: "box-left",
  8115. // 右侧盒子的名字
  8116. right: "box-right",
  8117. // 父级的名字
  8118. box: "box-father",
  8119. },
  8120. otherInfo: {
  8121. // 限制左边栏最低宽度
  8122. leftWidth: 120,
  8123. },
  8124. },
  8125. {
  8126. type: "LR",
  8127. domClass: {
  8128. // 中间分割线的名字
  8129. resize: "line-second",
  8130. // 左侧盒子的名字
  8131. left: "left-laowang",
  8132. // 右侧盒子的名字
  8133. right: "box-second-father",
  8134. // 父级的名字
  8135. box: "grand",
  8136. },
  8137. otherInfo: {
  8138. // 限制左边栏最低宽度
  8139. leftWidth: 120,
  8140. },
  8141. },
  8142. ]);
  8143. }
  8144. };
  8145. </script>
  8146. <style lang="scss" scoped>
  8147. .fillWeekDialogVisiCustom {
  8148. width: 100%;
  8149. height: 70vh;
  8150. }
  8151. .fillWeekCustom {
  8152. .el-dialog__body {
  8153. padding: 20px 20px !important;
  8154. }
  8155. }
  8156. .photos {
  8157. position: relative;
  8158. display: flex;
  8159. flex-wrap: wrap;
  8160. }
  8161. .photos_img {
  8162. width: 120px;
  8163. height: 120px;
  8164. margin-right: 20px;
  8165. margin-bottom: 20px;
  8166. cursor: pointer;
  8167. img {
  8168. width: 100%;
  8169. height: 100%;
  8170. }
  8171. }
  8172. .paginatis {
  8173. padding: 10px 10px;
  8174. background: #f2f2f2;
  8175. }
  8176. .waiting {
  8177. color:orange;
  8178. }
  8179. .filledReportStyle {
  8180. color:#32CD32;
  8181. }
  8182. .RejectStyle {
  8183. color:red;
  8184. }
  8185. .waitSubmitStyle{
  8186. color: #409eff;
  8187. }
  8188. .chooseDate {
  8189. .waiting {
  8190. color: #20a0ff;
  8191. }
  8192. .filledReportStyle {
  8193. color:#20a0ff;
  8194. }
  8195. .RejectStyle {
  8196. color: #20a0ff;
  8197. }
  8198. .waitSubmitStyle{
  8199. color: #20a0ff;
  8200. }
  8201. }
  8202. .allDaily {
  8203. width:100%;
  8204. }
  8205. .report_title {
  8206. padding:10px 0;
  8207. color:#666;
  8208. }
  8209. .clearfix {
  8210. overflow-x: auto;
  8211. white-space: nowrap;
  8212. padding: 15px 0 10px 0;
  8213. // overflow-y: hidden;
  8214. .date_item {
  8215. padding: 0 3px;
  8216. cursor: pointer;
  8217. position: relative;
  8218. }
  8219. .chooseDate {
  8220. position: absolute;
  8221. bottom: -3px;
  8222. width: 37px;
  8223. height: 2px;
  8224. left: 14px;
  8225. background: #20a0ff;
  8226. }
  8227. }
  8228. .one_daily {
  8229. i {
  8230. color: #9ed0ff;
  8231. margin-right: 5px;
  8232. }
  8233. .one_daily_body {
  8234. padding: 10px 0px;
  8235. p {
  8236. margin: 0;
  8237. line-height: 30px;
  8238. }
  8239. }
  8240. ul {
  8241. padding: 0;
  8242. }
  8243. }
  8244. .checkbtn {
  8245. float: right;
  8246. margin-top: -10px;
  8247. }
  8248. .selConStyle{
  8249. margin-top:9rem;
  8250. margin-bottom:11rem;
  8251. .selConStyle_title{
  8252. height: 3rem;
  8253. text-align: center;
  8254. font-size: 17px;
  8255. }
  8256. .el-select{
  8257. margin: 0 15%;
  8258. width: 70%;
  8259. }
  8260. }
  8261. </style>
  8262. <style lang="scss">
  8263. /*去除upload组件过渡效果*/
  8264. .photos .el-upload-list__item {
  8265. transition: none !important;
  8266. }
  8267. .daily {
  8268. .el-card__body {
  8269. height: 80%;
  8270. overflow-y: auto;
  8271. }
  8272. .el-card__header {
  8273. padding: 0 20px;
  8274. }
  8275. }
  8276. .membListClass{
  8277. .el-dialog__body{
  8278. padding-top: 10px;
  8279. }
  8280. }
  8281. // .editReportDialog .el-dialog__footer{
  8282. // position: sticky;
  8283. // bottom: 0;
  8284. // background: #fff;
  8285. // height: 70px;
  8286. // z-index: 1010;
  8287. // }
  8288. .editReportDialog{
  8289. min-width: 800px;
  8290. }
  8291. .touruxiangmu{
  8292. max-width: 1000px;
  8293. }
  8294. </style>
  8295. <style scoped>
  8296. /* 项目标签的样式 */
  8297. .el-tag + .el-tag {
  8298. margin-left: 10px;
  8299. }
  8300. .button-new-tag {
  8301. margin-left: 10px;
  8302. height: 32px;
  8303. line-height: 30px;
  8304. padding-top: 0;
  8305. padding-bottom: 0;
  8306. }
  8307. .input-new-tag {
  8308. width: 90px;
  8309. margin-left: 10px;
  8310. vertical-align: bottom;
  8311. }
  8312. .selectworktime .el-table__fixed-body-wrapper{
  8313. top: 48px !important;
  8314. }
  8315. .selectworktime_export .selectworktime_export_l{
  8316. width: 650px;
  8317. float: left;
  8318. height: 42px;
  8319. }
  8320. .approvalProcessBox{
  8321. margin-left: 30px;
  8322. font-size: 14px;
  8323. line-height: 16px;
  8324. cursor: pointer;
  8325. }
  8326. .approvalProcessBox i {
  8327. margin-right: 0;
  8328. height: 16px;
  8329. width: 16px;
  8330. display: inline-block;
  8331. transform: scale(1.2);
  8332. position: relative;
  8333. top: 0.5px;
  8334. color: #409eff;
  8335. }
  8336. .approvalProcessBox .approvalProcessClick{
  8337. cursor: pointer;
  8338. color: #409eff;
  8339. font-size: 14px;
  8340. }
  8341. .approvalProcessBox:hover .approvalProcessClick{
  8342. color: #3485fb;
  8343. }
  8344. </style>
  8345. <style lang="scss" scoped>
  8346. // 加班样式
  8347. .overtime {
  8348. display: inline-block;
  8349. margin-left: 20px;
  8350. input {
  8351. display: inline-block;
  8352. margin-top: 5px;
  8353. }
  8354. }
  8355. .plus {
  8356. display: inline-block;
  8357. }
  8358. // .tages {
  8359. // float: right;
  8360. // }
  8361. .overtime {
  8362. display: inline-block;
  8363. margin-left: 30px;
  8364. }
  8365. .bloks {
  8366. display: inline-block;
  8367. width: 380px;
  8368. }
  8369. .zhiss {
  8370. display: flex;
  8371. justify-content: space-around;
  8372. align-items: center;
  8373. }
  8374. .zhoFel {
  8375. display: flex;
  8376. justify-content: space-between;
  8377. align-items: center;
  8378. }
  8379. // 左右滑动样式
  8380. .line {
  8381. width: 30px;
  8382. /* height: 500px; */
  8383. background: #f2f2f2;
  8384. cursor: w-resize;
  8385. }
  8386. .box-father {
  8387. border: 8px solid #000;
  8388. }
  8389. .line-second {
  8390. width: 10px;
  8391. /* background: red; */
  8392. }
  8393. .flex {
  8394. display: flex;
  8395. width: 100%;
  8396. }
  8397. .box-left {
  8398. flex: 0 0 400px;
  8399. /* height: 600px; */
  8400. /* background: blue; */
  8401. }
  8402. .box-right {
  8403. /* height: 600px; */
  8404. /* background: green; */
  8405. flex: 1;
  8406. }
  8407. .box-postion {
  8408. width: 200px;
  8409. /* height: 400px; */
  8410. background: #ccc;
  8411. }
  8412. .custom-tree-node {
  8413. flex: 1;
  8414. display: flex;
  8415. align-items: center;
  8416. justify-content: space-between;
  8417. font-size: 14px;
  8418. padding-right: 8px;
  8419. }
  8420. .daitianrbao {
  8421. width: 100%;
  8422. box-sizing: border-box;
  8423. height: 40px;
  8424. border-radius: 4px;
  8425. border: 1px solid #DCDFE6;
  8426. overflow: hidden;
  8427. text-overflow: ellipsis;
  8428. display: flex;
  8429. // align-items: center;
  8430. }
  8431. .daitianrbao .spnn {
  8432. display: inline-block;
  8433. box-sizing: border-box;
  8434. padding: 0 15px;
  8435. overflow: hidden;
  8436. text-overflow: ellipsis;
  8437. }
  8438. .daitianrbao .hover {
  8439. color: #DCDFE6 !important;
  8440. }
  8441. </style>