daily.vue 481 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139
  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" @keyup.enter.native="seluserforText()" 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="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  53. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  54. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  55. </span>
  56. <div style="position: absolute;right: 15px;">
  57. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  58. <!-- 未填报 -->
  59. {{$t('state.DidNotFillIn')}}
  60. </span>
  61. <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'">
  62. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  63. {{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)')}}
  64. </span>
  65. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  66. <!-- 待审核 -->
  67. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  70. <!-- 已通过 -->
  71. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  74. <!-- 未通过 -->
  75. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  78. <!-- 待提交 -->
  79. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. </div>
  82. </span>
  83. </el-tree>
  84. </div>
  85. </div>
  86. </div>
  87. <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">
  88. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  89. -
  90. -
  91. -
  92. </div>
  93. </div>
  94. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  95. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  96. <div class="allDaily" style="float:left;flex-grow:1">
  97. <!--系统管理员和部门负责人 -->
  98. <div class="report_title" style="display:flex;justify-content: space-between;">
  99. <span>
  100. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  101. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  102. <!-- {{depData != null ?depData.label:""}} -->
  103. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  104. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  105. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  106. </span>
  107. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  108. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  109. </span>
  110. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="targetUid == null">
  112. <!-- - 已提交 -->
  113. -{{$t('state.hasBeenSubmitted')}}
  114. <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')}},
  115. <!-- 待提交 -->
  116. {{$t('state.waitingsubmit')}}
  117. <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')}},
  118. <!-- 漏填 -->
  119. <!-- {{$t('state.missFillReport')}} -->
  120. 未填
  121. <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')}}
  122. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  123. </span>
  124. </span>
  125. </span>
  126. <span style="float:right;">
  127. <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>
  128. <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>
  129. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  130. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  131. <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>
  132. <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>
  133. <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>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  138. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  139. <el-link type="primary" v-if="user.roleName == '超级管理员' && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">日报审核修改</el-link>
  140. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  141. </span>
  142. </div>
  143. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  144. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  145. <i class="fa fa-circle"></i>
  146. <!-- {{item1.name}} -->
  147. <span v-if="user.userNameNeedTranslate == '1'">
  148. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  149. </span>
  150. <span v-if="user.userNameNeedTranslate != '1'">
  151. {{item1.name}}
  152. </span>
  153. <span style="margin-left:30px;">
  154. <span style="margin-right:20px;">
  155. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  156. <!-- 工作总时长: -->
  157. {{$t('other.totalWorkingHours')}}
  158. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  159. <span >{{item1.reportTime | amounts}}</span>h
  160. </span>
  161. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  162. <i class="iconfont firerock-iconliucheng1"></i>
  163. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  164. <!-- 审批流程 -->
  165. {{$t('other.approvalProcess')}}
  166. </span>
  167. </span>
  168. </span>
  169. <div class="checkbtn" style="padding-right:20px;">
  170. <!--编辑和删除日报-->
  171. <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>
  172. <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>
  173. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  174. </div>
  175. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  176. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  177. </div>
  178. <div class="one_daily_body">
  179. <el-timeline>
  180. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  181. <el-card shadow="never">
  182. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  183. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  184. <span v-if="user.company.packageEngineering == 0">
  185. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  186. <span v-if="user.timeType.reportAuditType == 7" >
  187. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  188. <span v-if="item2.deptAuditorName">、</span>
  189. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  190. </span>
  191. <span v-else>
  192. <span v-if="item2.isDeptAudit==0">
  193. <span v-if="item2.projectAuditState==0">
  194. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  195. <span v-if="item2.projectAuditorName != null">(
  196. <!-- {{item2.projectAuditorName}} -->
  197. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  206. )</span>
  207. <!-- 审核通过 --> {{$t('state.approved')}}
  208. </span>
  209. </span>
  210. <span v-else-if="item2.isDeptAudit==1">
  211. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  212. ({{$t('other.await')}}
  213. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  214. {{$t('other.audit')}})
  215. </span>
  216. </span>
  217. ]</span>
  218. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  219. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  220. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  221. </span>
  222. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  223. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  224. </span>
  225. <!-- <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> -->
  226. <span v-if="user.company.packageEngineering == 1">
  227. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  229. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  230. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  231. (
  232. <!-- <span v-if="user.userNameNeedTranslate != 1">
  233. {{item2.projectAuditorName}}
  234. </span>
  235. <span v-if="user.userNameNeedTranslate == 1">
  236. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  237. </span> -->
  238. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  239. )
  240. </span>{{$t('other.audit')}} ]</span>
  241. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  242. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  243. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  244. </span>
  245. <!--每个项目上单独审核 -->
  246. <span style="float:right;">
  247. <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>
  248. <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"
  249. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  250. <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"
  251. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  252. <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"
  253. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  254. <!--自己可以撤回待审核状态的报告 -->
  255. <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>
  256. </span>
  257. </p>
  258. <p v-if="user.companyId == yuzhongCompId">
  259. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  260. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  261. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  262. <!--任务分组和阶段 -->
  263. <p v-if="item2.groupId != 0">
  264. {{$t('other.taskGroup')}}:{{item2.groupName}}
  265. <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>
  266. </p>
  267. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  268. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  269. <!-- 自定义日报文本 -->
  270. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  271. <p v-if="user.company.packageEngineering == 1">
  272. {{$t('other.professionalProgress')}}:
  273. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  274. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  275. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  276. </el-tooltip>
  277. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  278. <i class="iconfont firerock-iconshenhetongguo"></i>
  279. </el-tooltip>
  280. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  281. <i class="iconfont firerock-iconshenhebohui"></i>
  282. </el-tooltip>
  283. </span>
  284. </p>
  285. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  286. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  287. </p>
  288. <div v-if="item2.multiWorktime==0">
  289. <p style="display: inline-block;">{{$t('time.duration')}}:
  290. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  291. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  292. {{item2.time.toFixed(1)}}h
  293. <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>
  294. </p>
  295. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  296. </div>
  297. <div v-if="item2.multiWorktime==1" >
  298. <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>
  299. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  300. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  301. <p style="display: inline-block;">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  303. {{timeItem.time.toFixed(1)}}h
  304. </p>
  305. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  306. </div>
  307. </div>
  308. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  309. <!--照片的显示 -->
  310. <p v-if="item2.pics != null && item2.pics.length > 0">
  311. <el-image v-for="(pic, index) in item2.pics" :key="index"
  312. style="width: 100px; height: 100px; margin-right:10px;"
  313. :src="pic"
  314. :preview-src-list="item2.pics">
  315. </el-image>
  316. </p>
  317. </el-card>
  318. </el-timeline-item>
  319. </el-timeline>
  320. </div>
  321. </div>
  322. <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>
  323. <!-- 简陋的无报告提示 -->
  324. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. </div>
  330. </el-card>
  331. </div>
  332. <!-- 工时推送日志弹窗 -->
  333. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  334. <template>
  335. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  336. </template>
  337. <template>
  338. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  339. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  340. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  341. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  342. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  343. <el-table-column prop="result" label="推送结果" width="250">
  344. <template slot-scope="scope">
  345. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  346. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  347. </template>
  348. </el-table-column>
  349. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  350. </el-table>
  351. </template>
  352. <span slot="footer" class="dialog-footer">
  353. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  354. </span>
  355. </el-dialog>
  356. <!-- 填写日报的dialog -->
  357. <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">
  358. <div style="height: 65vh;overflow: auto;">
  359. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  360. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  361. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  362. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  363. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  364. <span class="spnn" v-if="workForm.userNames">
  365. <span v-for="(item, index) in workForm.userNames" :key="index">
  366. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  367. <span v-if="index < workForm.userNames.length - 1">,</span>
  368. </span>
  369. </span>
  370. <span class="spnn hover" v-else>
  371. {{$t('defaultText.pleaseSelectAsubstitute')}}
  372. </span>
  373. </div>
  374. </el-form-item>
  375. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  376. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  377. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  378. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  379. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  380. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  381. <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>
  382. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  383. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  384. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  385. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  386. <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>
  387. <!-- AI智能填报 -->
  388. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  389. </el-form-item>
  390. <!--考勤时长显示-->
  391. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  392. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  393. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  394. </span>
  395. <!--批量填报和批量代填不显示考勤记录-->
  396. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  397. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  398. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  399. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  400. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  401. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  402. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  403. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  404. @click="refreshAttendance(workForm.createDate)"></el-button>
  405. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  406. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  407. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  408. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  409. </el-form-item>
  410. <!-- 000000 -->
  411. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  412. <div v-if="reportTimeType.multiWorktime==0">
  413. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  414. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  415. <el-select v-model="domain.timeType" style="width:200px;"
  416. v-if="reportTimeType.type == 0"
  417. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  418. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  419. @change="onTimeTypeChange(domain.timeType)">
  420. <el-option
  421. v-for="item in timeType"
  422. :key="item.value"
  423. :label="item.label"
  424. :value="item.value">
  425. </el-option>
  426. </el-select>
  427. <!-- 数字时长选择 -->
  428. <el-select v-model="domain.workingTime" style="width:200px;"
  429. v-if="reportTimeType.type == 1"
  430. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  431. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  432. @change="seleChn(0,domain)">
  433. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  434. </el-select>
  435. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  436. <span v-if="reportTimeType.type == 2">
  437. <!--时间范围选择 -->
  438. <el-time-picker
  439. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  440. v-model="domain.startTime"
  441. :placeholder="$t('time.startTime')"
  442. style="width:120px;"
  443. format="HH:mm"
  444. value-format="HH:mm"
  445. :picker-options="{
  446. start: '08:00',
  447. end: '23:30'
  448. }"
  449. @change="iptChang()">
  450. </el-time-picker> - <el-time-picker
  451. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  452. v-model="domain.endTime"
  453. :placeholder="$t('time.endTime')"
  454. style="width:120px;"
  455. format="HH:mm"
  456. value-format="HH:mm"
  457. :picker-options="{
  458. start: '08:00',
  459. end: '23:30',
  460. minTime: domain.startTime
  461. }"
  462. @change="iptChang()">
  463. </el-time-picker>
  464. </span>
  465. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  466. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  467. <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>
  468. </div>
  469. </el-form-item>
  470. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  471. :prop="'domains.' + index + '.reportTargetDeptId'"
  472. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  473. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  474. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  475. <span style="float: left">
  476. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  477. </span>
  478. </el-option>
  479. </el-select>
  480. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  481. </el-form-item>
  482. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  483. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  484. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  485. @change="selectProject(domain, index)"
  486. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  487. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  488. <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">
  489. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  490. <span style="float: right;">{{ item.projectName }}</span>
  491. </el-option>
  492. </el-option-group>
  493. </el-select>
  494. <!--昱众不显示子项目-->
  495. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  496. <span style="margin-left:45px;">
  497. {{$t('lable.subproject')}}</span>
  498. <!--子项目 -->
  499. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  500. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  501. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  502. </el-select>
  503. </template>
  504. <template v-if="user.companyId == yuzhongCompId">
  505. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  506. <!--角色选择 -->
  507. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  508. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  509. <el-option
  510. v-for="item in roleList"
  511. :key="item.value"
  512. :label="item.label"
  513. :value="item.value">
  514. </el-option>
  515. </el-select>
  516. </template>
  517. <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%;"
  518. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  519. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  520. </el-link>
  521. <!-- <el-link type="primary" v-if="canEdit"
  522. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  523. </el-form-item>
  524. <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">
  525. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  526. </el-form-item>
  527. <!--如果设置了工时成本预警的预算成本项-->
  528. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  529. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  530. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  531. </el-select>
  532. </el-form-item>
  533. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  534. <template slot="label">
  535. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  536. <span >{{$t('lable.taskGrouping')}}</span>
  537. </template>
  538. <!-- 任务分组 -->
  539. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  541. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  542. </el-select>
  543. <template v-if="user.companyId == yuzhongCompId">
  544. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  545. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  546. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  547. <el-option
  548. v-for="item in domain.filteredRespList"
  549. :key="item.id"
  550. :label="item.jobRespon"
  551. :value="item.id">
  552. </el-option>
  553. </el-select>
  554. </template>
  555. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  556. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  557. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  558. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  559. @change="changeStages(domain, index)"
  560. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  561. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  562. </el-select>
  563. </template>
  564. </el-form-item>
  565. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  566. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  567. <template slot="label">
  568. <span style="color:#FF0000;">*</span>
  569. <span >{{$t('other.projectAuditor')}}</span>
  570. </template>
  571. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  572. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  573. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  574. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  575. </el-option>
  576. </el-select>
  577. <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>
  578. </el-form-item>
  579. </div>
  580. <el-form-item v-if="user.companyId == yuzhongCompId">
  581. <template slot="label">
  582. <span style="color:#FF0000;">*</span>
  583. <span >工作内容</span>
  584. </template>
  585. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  586. :disabled="(workForm.domains[index].state>=2?false:true)" >
  587. <el-option
  588. v-for="item in domain.workContentList"
  589. :key="item.id"
  590. :label="item.workContext"
  591. :value="item.id">
  592. </el-option>
  593. </el-select>
  594. </el-form-item>
  595. <!-- 111111 -->
  596. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  597. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  598. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  599. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  600. <span v-else>{{item.name}}</span>
  601. </el-option>
  602. </el-select>
  603. <template v-if="user.timeType.auditLevel > 1">
  604. <i class="el-icon-right"></i>
  605. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  606. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  607. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  608. <span v-else>{{item.name}}</span>
  609. </el-option>
  610. </el-select>
  611. </template>
  612. <template v-if="user.timeType.auditLevel > 2">
  613. <i class="el-icon-right"></i>
  614. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  615. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  616. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  617. <span v-else>{{item.name}}</span>
  618. </el-option>
  619. </el-select>
  620. </template>
  621. </el-form-item>
  622. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  623. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  624. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  625. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  626. <span v-else>{{item.name}}</span>
  627. </el-option>
  628. </el-select>
  629. </el-form-item>
  630. <!-- 相关维度/自定义维度 -->
  631. <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'">
  632. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  633. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  634. </el-option>
  635. </el-select>
  636. </el-form-item>
  637. <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'">
  638. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  639. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  640. </el-option>
  641. </el-select>
  642. </el-form-item>
  643. <!-- 相关数值 -->
  644. <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">
  645. <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>
  646. </el-form-item>
  647. <!-- 自定义文本 -->
  648. <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">
  649. <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>
  650. </el-form-item>
  651. <!--按比例填报-->
  652. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  653. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  654. <div style="width:400px;">
  655. <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>
  656. <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>
  657. </div>
  658. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  659. <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>
  660. </div>
  661. </el-form-item>
  662. <!--工程专业版本模式下, 各个专业的进度填报 -->
  663. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  664. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  665. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  666. <el-input size="mini" style="width:60px;" v-model="item.progress"
  667. @keyup.native="onProgressChange"
  668. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  669. </span>
  670. </el-form-item>
  671. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  672. <el-form-item :label="$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))" >
  673. <template slot="label" v-if="user.timeType.taskRequired == 1">
  674. <span style="color:#FF0000;">*</span>
  675. <span >任务</span>
  676. </template>
  677. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  678. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  679. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  680. </el-select>
  681. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  682. </el-form-item>
  683. <!--针对依斯贝的SAP服务-->
  684. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  685. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  686. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  687. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  688. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  689. </el-select>
  690. </el-form-item>
  691. <!--工作事项-->
  692. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  693. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  694. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  695. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  696. </el-form-item>
  697. <!-- 拍照上传 -->
  698. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  699. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  700. <div class="photos">
  701. <div>
  702. <el-upload
  703. list-type="picture-card"
  704. :http-request="(file) => {return addImg(file, index)}"
  705. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  706. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  707. :file-list="domain.imgListUrl" :limit="9"
  708. :disabled="workForm.domains[index].state>=2?false:true">
  709. <i class="el-icon-plus"></i>
  710. </el-upload>
  711. </div>
  712. </div>
  713. </el-form-item>
  714. </div>
  715. <!--多个工作事项填报的情况 -->
  716. <div v-if="reportTimeType.multiWorktime==1">
  717. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  718. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  719. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  720. @change="selectProject(domain, index)"
  721. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  722. <!-- <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">
  723. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  724. <span style="float: right;">{{ item.projectName }}</span>
  725. </el-option> -->
  726. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  727. <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">
  728. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  729. <span style="float: right;">{{ item.projectName }}</span>
  730. </el-option>
  731. </el-option-group>
  732. </el-select>
  733. <template v-if="user.timeType.mainProjectState != 1">
  734. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  735. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  736. <!--子项目 -->
  737. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  738. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  739. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  740. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  741. </el-select>
  742. </template>
  743. <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;"
  744. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  745. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  746. </el-link>
  747. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  748. <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>
  749. </div>
  750. <!-- <el-link type="primary" v-if="canEdit"
  751. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  752. </el-form-item>
  753. <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">
  754. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  755. </el-form-item>
  756. <!--如果设置了工时成本预警的预算成本项-->
  757. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  758. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  759. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  760. </el-select>
  761. </el-form-item>
  762. <el-form-item v-if="user.company.packageProject == 1">
  763. <template slot="label">
  764. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  765. <span >{{$t('lable.taskGrouping')}}</span>
  766. </template>
  767. <!-- 任务分组 -->
  768. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  769. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  770. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  771. </el-select>
  772. <!-- 项目的阶段 -->
  773. <span v-if="domain.stages != null && domain.stages.length> 0"
  774. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  775. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  776. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  777. @change="changeStages(domain, index)"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  779. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  780. </el-select>
  781. </el-form-item>
  782. <el-form-item :label="$t('other.projectAuditor')" >
  783. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  784. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  785. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  786. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  787. </el-option>
  788. </el-select>
  789. <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>
  790. </el-form-item>
  791. <!--工程专业版本模式下, 各个专业的进度填报 -->
  792. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  793. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  794. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  795. <el-input size="mini" style="width:60px;" v-model="item.progress"
  796. @keyup.native="onProgressChange"
  797. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  798. </span>
  799. </el-form-item>
  800. <!-- 相关维度 -->
  801. <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'">
  802. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :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-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  807. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  808. </el-option>
  809. </el-select>
  810. </el-form-item>
  811. <!-- 相关数值 -->
  812. <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">
  813. <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>
  814. </el-form-item>
  815. <!-- 自定义文本 -->
  816. <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">
  817. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  818. </el-form-item>
  819. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  820. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  821. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  822. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  823. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  824. </el-select>
  825. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  826. </el-form-item>
  827. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  828. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  829. <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>
  830. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  831. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  832. <span v-if="reportTimeType.type == 2">
  833. <!-- <span> -->
  834. <!--时间范围选择 -->
  835. <el-time-picker
  836. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  837. v-model="timeItem.startTime"
  838. :placeholder="$t('time.startTime')"
  839. style="width:120px;"
  840. format="HH:mm"
  841. value-format="HH:mm"
  842. :picker-options="{
  843. start: '00:00',
  844. end: '23:59',
  845. }"
  846. @change="iptChangs()">
  847. </el-time-picker> - <el-time-picker
  848. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  849. v-model="timeItem.endTime"
  850. :placeholder="$t('time.endTime')"
  851. style="width:120px;"
  852. format="HH:mm"
  853. value-format="HH:mm"
  854. :picker-options="{
  855. start: '00:00',
  856. end: '23:59',
  857. minTime: timeItem.startTime
  858. }"
  859. @change="iptChangs()">
  860. </el-time-picker>
  861. </span>
  862. </el-form-item>
  863. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  864. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  865. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  866. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  867. ></el-input>
  868. </el-form-item>
  869. </div>
  870. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  871. </div>
  872. <!--照片的显示 -->
  873. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  874. <el-image v-for="(pic, index) in domain.pics" :key="index"
  875. style="width: 100px; height: 100px; margin-right:10px;"
  876. :src="pic"
  877. :preview-src-list="domain.pics">
  878. </el-image>
  879. </p>
  880. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  881. </div>
  882. <span id="workFormsItemBottom"></span>
  883. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  884. </el-form>
  885. </div>
  886. <span slot="footer" class="dialog-footer">
  887. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  888. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  889. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  890. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  891. <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>
  892. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  893. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  894. </span>
  895. </el-dialog>
  896. <!-- 按周填报 -->
  897. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  898. <!-- 按周填报-已填工时-点击 -->
  899. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  900. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  901. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  902. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  903. <el-table-column prop="state" :label="$t('state.states')">
  904. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  905. </el-table-column>
  906. <!-- <el-table-column label="操作">
  907. <template slot-scope="scope">
  908. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  909. </template>
  910. </el-table-column> -->
  911. </el-table>
  912. <span slot="footer" class="dialog-footer">
  913. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  914. </span>
  915. </el-dialog>
  916. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  917. <el-form-item style="height:30px;margin-top:-72px;">
  918. <!-- <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> -->
  919. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  920. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  921. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  922. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  923. <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>
  924. <el-option
  925. v-for="item in fillProjectList"
  926. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  927. :key="item.id"
  928. :label="item.projectName + '\u3000' + item.projectCode"
  929. :value="item.id">
  930. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  931. <span style="float: right">{{ item.projectName }}</span>
  932. </el-option>
  933. </el-select>
  934. <span style="float:right;margin-right:10px;">选择项目</span>
  935. </el-form-item>
  936. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  937. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  938. <template slot-scope="scope">
  939. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  940. </template>
  941. </el-table-column>
  942. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  943. <template slot-scope="scope">
  944. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  945. <p v-else></p>
  946. </template>
  947. </el-table-column> -->
  948. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  949. <template slot-scope="scope">
  950. <div v-if="scope.row.canFill == 1">
  951. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  952. <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>
  953. <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>
  954. <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>
  955. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  956. </div>
  957. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  958. <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>
  959. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  960. </div>
  961. </div>
  962. <div v-else >
  963. <span style="color:#999999;">不可超前填报</span>
  964. </div>
  965. </template>
  966. </el-table-column>
  967. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  968. <template slot-scope="scope">
  969. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  970. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  971. </template>
  972. </el-table-column>
  973. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  974. <template slot-scope="scope">
  975. <div class="zhiss">
  976. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  977. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  978. </div>
  979. </template>
  980. </el-table-column>
  981. </el-table>
  982. </el-form>
  983. <span slot="footer" class="dialog-footer" >
  984. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  985. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  986. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  987. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  988. <!--针对景昱,先检查工时是否存在异常-->
  989. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  990. </span>
  991. </el-dialog>
  992. <!-- 重庆物奇私人定制的按周填报 -->
  993. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  994. <div class="fillWeekDialogVisiCustom">
  995. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  996. </div>
  997. </el-dialog>
  998. <!-- 选择时间 -->
  999. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1000. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1001. <span slot="footer" class="dialog-footer">
  1002. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1003. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1004. </span>
  1005. </el-dialog>
  1006. <!-- 按周填报弹窗 -->
  1007. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1008. <div>
  1009. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1010. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1011. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1012. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <!--如果设置了工时成本预警的预算成本项-->
  1016. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1017. <p>{{$t('lable.budgetSource')}}</p>
  1018. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1019. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1020. </el-select>
  1021. </div>
  1022. <!-- 任务分组 -->
  1023. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1024. <p>{{$t('lable.taskGrouping')}}</p>
  1025. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1026. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1027. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1028. </el-select>
  1029. </div>
  1030. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1031. <p>{{$t('other.inputStage')}}</p>
  1032. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1033. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1034. </el-select>
  1035. </div>
  1036. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1037. <p>{{$t('other.reviewer')}}</p>
  1038. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1039. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1040. </el-select>
  1041. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1042. </div>
  1043. <template v-if="user.timeType.reportAuditType == 3">
  1044. <div class="zhoFel">
  1045. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1046. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. <div class="zhoFel">
  1052. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1053. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1054. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1055. </el-select>
  1056. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1057. </div>
  1058. <div class="zhoFel">
  1059. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1060. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1061. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1062. </el-select>
  1063. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1064. </div>
  1065. <div class="zhoFel">
  1066. <p>{{ $t('chao-song-ren') }}</p>
  1067. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1068. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1069. </el-select>
  1070. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1071. </div>
  1072. </template>
  1073. <!-- 自定义维度 -->
  1074. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1075. <p>{{user.timeType.customDegreeName}}</p>
  1076. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1077. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1078. </el-select>
  1079. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1080. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1081. </el-select>
  1082. </div>
  1083. <!-- 自定义数值 -->
  1084. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1085. <p>{{user.timeType.customDataName}}</p>
  1086. <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>
  1087. </div>
  1088. <!-- 自定义文本 -->
  1089. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1090. <p>{{user.timeType.customTextName}}</p>
  1091. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1092. </div>
  1093. <!-- 选择任务 -->
  1094. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1095. <p>任务 / 里程碑</p>
  1096. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1097. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1098. </el-select>
  1099. </div>
  1100. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1101. <p>{{$t('other.timeSelection')}}</p>
  1102. <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>
  1103. </div>
  1104. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1105. <p>{{$t('other.chooseDuration')}}</p>
  1106. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1107. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1108. </el-select>
  1109. </div>
  1110. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1111. <p>{{$t('lable.percentageOfTime')}}</p>
  1112. <div style="width:400px;display: flex;align-items: center;">
  1113. <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>
  1114. <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>
  1115. </div>
  1116. </div>
  1117. <div class="zhoFel">
  1118. <p>{{$t('other.workMatters')}}</p>
  1119. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1120. </div>
  1121. </div>
  1122. <span slot="footer" class="dialog-footer">
  1123. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1124. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1125. </span>
  1126. </el-dialog>
  1127. <!--导出报表条件选择 -->
  1128. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1129. <el-form ref="form3" :model="exportParam" >
  1130. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1131. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1132. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1136. <!-- <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>
  1137. <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> -->
  1138. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1139. </el-form-item>
  1140. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1141. <el-date-picker
  1142. v-model="exportParam.dateRange" :editable="false"
  1143. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1144. :range-separator="$t('other.to')"
  1145. type="daterange"
  1146. :start-placeholder="$t('time.startDate')"
  1147. :end-placeholder="$t('time.endDate')"
  1148. ></el-date-picker>
  1149. </el-form-item>
  1150. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1151. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1152. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1153. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1154. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1155. </el-select>
  1156. </el-form-item>
  1157. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1158. <div class="exportReportRadio">
  1159. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1160. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1161. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1162. <i class="el-icon-question"></i>
  1163. </el-tooltip>
  1164. </div>
  1165. </el-form-item>
  1166. </el-form>
  1167. <div slot="footer" class="dialog-footer">
  1168. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1169. </div>
  1170. </el-dialog>
  1171. <!--导出报表条件选择 -->
  1172. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1173. <el-form ref="form3" :model="exportParam" >
  1174. <el-form-item prop="range" :label="$t('time.dateRange')">
  1175. <el-date-picker
  1176. v-model="exportParam.dateRange" :editable="false"
  1177. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1178. :clearable="true"
  1179. :range-separator="$t('other.to')"
  1180. type="daterange"
  1181. :start-placeholder="$t('time.startDate')"
  1182. :end-placeholder="$t('time.endDate')"
  1183. ></el-date-picker>
  1184. </el-form-item>
  1185. </el-form>
  1186. <div slot="footer" class="dialog-footer">
  1187. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1188. </div>
  1189. </el-dialog>
  1190. <!--人员列表 -->
  1191. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1192. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1193. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1194. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1195. <el-table-column type="selection"></el-table-column>
  1196. <el-table-column prop="label" :label="$t('lable.name')" >
  1197. <template slot-scope="scope">
  1198. <span>
  1199. <!-- {{(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}} -->
  1200. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1201. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1202. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1203. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1204. </span>
  1205. <span v-else>
  1206. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1207. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1208. </span>
  1209. </span>
  1210. </template>
  1211. </el-table-column>
  1212. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1213. <template slot-scope="scope">
  1214. <div>
  1215. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1216. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1217. </div>
  1218. </template>
  1219. </el-table-column>
  1220. </el-table>
  1221. </el-tab-pane>
  1222. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1223. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1224. <el-table-column prop="label" :label="$t('lable.name')" >
  1225. <template slot-scope="scope">
  1226. <!-- <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> -->
  1227. <!-- <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> -->
  1228. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1229. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1230. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1231. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1232. </span>
  1233. <span v-else>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1236. </span>
  1237. </template>
  1238. </el-table-column>
  1239. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1240. <template slot-scope="scope">
  1241. <div>
  1242. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1243. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1244. </div>
  1245. </template>
  1246. </el-table-column>
  1247. </el-table>
  1248. </el-tab-pane>
  1249. </el-tabs>
  1250. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1251. <el-table-column type="selection"></el-table-column>
  1252. <el-table-column prop="label" :label="$t('lable.name')" >
  1253. <template slot-scope="scope">
  1254. <div>
  1255. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1256. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1257. </div>
  1258. </template>
  1259. </el-table-column>
  1260. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1261. <template slot-scope="scope">
  1262. <div>
  1263. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1264. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1265. </div>
  1266. </template>
  1267. </el-table-column>
  1268. </el-table>
  1269. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1270. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1271. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1272. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1273. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1274. </div>
  1275. </el-dialog>
  1276. <!-- 日报审核修改 -->
  1277. <el-dialog
  1278. title="日报审核修改"
  1279. :visible.sync="reportLogCheckDialog"
  1280. width="30%"
  1281. :before-close="handleClose">
  1282. <el-form ref="form3" :model="exportReportLogParam" >
  1283. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1284. <el-date-picker
  1285. v-model="exportReportLogParam.dateRange" :editable="false"
  1286. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1287. :range-separator="$t('other.to')"
  1288. type="daterange"
  1289. :start-placeholder="$t('time.startDate')"
  1290. :end-placeholder="$t('time.endDate')"
  1291. ></el-date-picker>
  1292. </el-form-item>
  1293. </el-form>
  1294. <el-link type="primary" @click="exportReportLog">导出日报审核记录数据</el-link>
  1295. <br>
  1296. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1297. <el-link type="primary" @click="importReportLog">导入日报审核记录修改数据</el-link></el-upload>
  1298. <span slot="footer" class="dialog-footer">
  1299. <el-button type="primary" @click="reportLogCheckDialog = false">关闭</el-button>
  1300. </span>
  1301. </el-dialog>
  1302. <!-- 按部门选择人员 -->
  1303. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1304. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1305. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1306. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1307. </el-input>
  1308. <div class="tree" style="height:400px">
  1309. <el-scrollbar style="height:100%">
  1310. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1311. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1312. highlight-current :filter-node-method="filterNode">
  1313. <span class="custom-tree-node" slot-scope="{ node }">
  1314. <span v-if="user.userNameNeedTranslate == '1'">
  1315. <span v-if="node.data.children">
  1316. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1317. </span>
  1318. <span v-else>
  1319. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1320. </span>
  1321. </span>
  1322. <span v-if="user.userNameNeedTranslate != '1'">
  1323. {{ node.label }}
  1324. </span>
  1325. <!-- {{ node.label }} -->
  1326. </span>
  1327. </el-tree>
  1328. </el-scrollbar>
  1329. </div>
  1330. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1331. <div slot="footer" class="dialog-footer">
  1332. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1333. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1334. </div>
  1335. </el-dialog>
  1336. <el-dialog
  1337. v-if="monthWorkTimeDialog"
  1338. :visible.sync="monthWorkTimeDialog"
  1339. :close-on-click-modal="false"
  1340. customClass="customWidth selectworktime"
  1341. width="92%"
  1342. top="60px"
  1343. >
  1344. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1345. <el-tabs v-model="activeName" @tab-click="handleClick">
  1346. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1347. <div class="selectworktime_export" style="margin-top:10px;">
  1348. <div class="selectworktime_export_l">
  1349. <el-date-picker
  1350. class="selecteworktime_datapick"
  1351. v-model="WorktimeDatepickValue"
  1352. value-format="yyyy-MM-dd"
  1353. type="daterange"
  1354. align="right"
  1355. unlink-panels
  1356. :range-separator="$t('other.to')"
  1357. :start-placeholder="$t('time.startDate')"
  1358. :end-placeholder="$t('time.endDate')"
  1359. :default-time="['12:00:00', '12:00:00']"
  1360. size="small"
  1361. popper-class="selecteorktime_datapick_popper"
  1362. @change="showMonthWorkTime()"
  1363. >
  1364. </el-date-picker>
  1365. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1366. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1367. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1368. <!-- 222 -->
  1369. </div>
  1370. <div>
  1371. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1372. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1373. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1374. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1375. </el-input>
  1376. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1377. </div>
  1378. <div style="float: left; height:32px; padding-top:10px;">
  1379. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">待审核</span>
  1380. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">已通过</span>
  1381. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">已驳回</span>
  1382. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">未提交</span>
  1383. </div>
  1384. <div style="float: right; vertical-align: middle;height:32px">
  1385. <el-link
  1386. type="primary"
  1387. @click="exportMembWorkHours()"
  1388. >{{$t('export.exportData')}}</el-link
  1389. >
  1390. </div>
  1391. </div>
  1392. <el-table ref="hasworkTbl"
  1393. :data="monthWorkDataS"
  1394. v-el-table-infinite-scroll="listScroll"
  1395. border
  1396. :height="'70vh'"
  1397. highlight-current-row
  1398. style="width: 100%"
  1399. v-loading="tbload"
  1400. :lazy="true"
  1401. :cell-style="hasworkTblCellStyle"
  1402. >
  1403. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1404. <template slot-scope="scope">
  1405. {{ scope.$index + 1 }}
  1406. </template>
  1407. </el-table-column>
  1408. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1409. <template slot-scope="scope">
  1410. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1411. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1412. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1413. <!-- {{scope.row.name}} -->
  1414. </span>
  1415. </template>
  1416. </el-table-column>
  1417. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1418. <template slot-scope="scope">
  1419. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1420. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1421. </template>
  1422. </el-table-column>
  1423. <el-table-column
  1424. min-width="60"
  1425. v-for="(item, index) in pickDateArray"
  1426. :key="index"
  1427. :label="item"
  1428. align="center"
  1429. >
  1430. <template slot="header" slot-scope="scope">
  1431. <div>{{ scope.column.label.dateStr }}</div>
  1432. <div>{{ scope.column.label.weekStr }}</div>
  1433. </template>
  1434. <template slot-scope="scope">
  1435. <div
  1436. v-if="
  1437. scope.row.worktimeList.filter(
  1438. (w) =>
  1439. w.createDate==item.date
  1440. ).length > 0 &&
  1441. scope.row.worktimeList.filter(
  1442. (w) =>w.createDate==item.date
  1443. )[0].workingTime < reportTimeType.allday
  1444. "
  1445. >
  1446. {{
  1447. scope.row.worktimeList.filter(
  1448. (w) =>w.createDate==item.date
  1449. )[0].workingTime.toFixed(1)
  1450. }}
  1451. </div>
  1452. <div
  1453. v-if="
  1454. scope.row.worktimeList.filter(
  1455. (w) =>w.createDate==item.date
  1456. ).length > 0 &&
  1457. scope.row.worktimeList.filter(
  1458. (w) =>w.createDate==item.date
  1459. )[0].workingTime > reportTimeType.allday
  1460. "
  1461. >
  1462. {{
  1463. scope.row.worktimeList.filter(
  1464. (w) =>w.createDate==item.date
  1465. )[0].workingTime.toFixed(1)
  1466. }}
  1467. </div>
  1468. <div
  1469. v-if="
  1470. scope.row.worktimeList.filter(
  1471. (w) =>w.createDate==item.date
  1472. ).length > 0 &&
  1473. scope.row.worktimeList.filter(
  1474. (w) =>w.createDate==item.date
  1475. )[0].workingTime == reportTimeType.allday
  1476. "
  1477. >
  1478. {{
  1479. scope.row.worktimeList.filter(
  1480. (w) =>w.createDate==item.date
  1481. )[0].workingTime
  1482. }}
  1483. </div>
  1484. <div
  1485. v-if="
  1486. scope.row.worktimeList.filter(
  1487. (w) =>w.createDate==item.date
  1488. ).length == 0
  1489. "
  1490. >
  1491. 0
  1492. </div>
  1493. <div
  1494. v-if="
  1495. scope.row.worktimeList.filter(
  1496. (w) =>w.createDate==item.date
  1497. ).length > 0 &&
  1498. typeof scope.row.worktimeList.filter(
  1499. (w) =>w.createDate==item.date
  1500. )[0].workingTime == 'string'
  1501. "
  1502. >
  1503. {{
  1504. scope.row.worktimeList.filter(
  1505. (w) =>w.createDate==item.date
  1506. )[0].workingTime
  1507. }}
  1508. </div>
  1509. </template>
  1510. </el-table-column>
  1511. </el-table>
  1512. <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>
  1513. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1514. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1515. <label style="font-size: 16px">员工每日已填报工时数</label>
  1516. <el-link
  1517. type="primary"
  1518. style="float: right; margin-right: 60px"
  1519. @click="exportMembWorkHours()"
  1520. >导出已填报数据</el-link
  1521. > -->
  1522. <!-- <el-button >导出</el-button> -->
  1523. <!-- </div> -->
  1524. </el-tab-pane>
  1525. <el-tab-pane label="未提交人员列表" name="second" >
  1526. <div class="selectworktime_export" style="margin-top:10px">
  1527. <div class="selectworktime_export_l">
  1528. <el-date-picker
  1529. class="selecteworktime_datapick"
  1530. v-model="WorktimeDatepickValue"
  1531. value-format="yyyy-MM-dd"
  1532. type="daterange"
  1533. align="right"
  1534. unlink-panels
  1535. :range-separator="$t('other.to')"
  1536. :start-placeholder="$t('time.startDate')"
  1537. :end-placeholder="$t('time.endDate')"
  1538. :default-time="['12:00:00', '12:00:00']"
  1539. size="small"
  1540. popper-class="selecteorktime_datapick_popper"
  1541. @change="showMonthNotWorkTime()"
  1542. >
  1543. </el-date-picker>
  1544. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1545. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1546. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1547. </div>
  1548. <div>
  1549. <div style="margin-top:10px;">
  1550. <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>
  1551. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1552. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1553. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1554. </el-input>
  1555. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1556. <el-link
  1557. type="primary"
  1558. style="float: right; vertical-align: middle;height:32px"
  1559. @click="exportMembNotWorkHours()"
  1560. >{{$t('export.exportData')}}</el-link
  1561. >
  1562. </div>
  1563. </div>
  1564. </div>
  1565. <el-table
  1566. ref="hasworkTbl2"
  1567. :data="monthNotWorkDateS"
  1568. v-el-table-infinite-scroll="notListScroll"
  1569. border
  1570. :height="'70vh'"
  1571. highlight-current-row
  1572. style="width: 100%"
  1573. v-loading="tbload"
  1574. lazy
  1575. >
  1576. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1577. <template slot-scope="scope">
  1578. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1579. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1580. </template>
  1581. </el-table-column>
  1582. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1583. <template slot-scope="scope">
  1584. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1585. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1586. </template>
  1587. </el-table-column>
  1588. <el-table-column
  1589. min-width="200"
  1590. :label="$t('weekDay.date')"
  1591. align="center"
  1592. prop="createDate"
  1593. >
  1594. </el-table-column>
  1595. <el-table-column
  1596. min-width="200"
  1597. :label="$t('state.states')"
  1598. align="center"
  1599. prop="status"
  1600. />
  1601. <el-table-column
  1602. min-width="200"
  1603. :label="$t('other.attendanceData')"
  1604. prop="cardTime"
  1605. align="center"
  1606. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1607. </el-table>
  1608. <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>
  1609. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1610. </el-tab-pane>
  1611. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1612. <div class="selectworktime_export" style="margin-top:10px;">
  1613. <div class="selectworktime_export_l">
  1614. <el-date-picker
  1615. class="selecteworktime_datapick"
  1616. v-model="WorktimeDatepickValue"
  1617. value-format="yyyy-MM-dd"
  1618. type="daterange"
  1619. align="right"
  1620. unlink-panels
  1621. :range-separator="$t('other.to')"
  1622. :start-placeholder="$t('time.startDate')"
  1623. :end-placeholder="$t('time.endDate')"
  1624. :default-time="['12:00:00', '12:00:00']"
  1625. size="small"
  1626. popper-class="selecteorktime_datapick_popper"
  1627. @change="showMonthWorkTimeReminder()"
  1628. >
  1629. </el-date-picker>
  1630. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1631. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1632. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1633. </div>
  1634. <div>
  1635. <div style="margin-top:10px;">
  1636. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1637. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1638. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1639. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1640. </el-input>
  1641. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1642. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1643. </div>
  1644. </div>
  1645. <div style="float: right; vertical-align: middle;height:32px">
  1646. <el-link
  1647. type="primary"
  1648. @click="changeReminder()"
  1649. >{{'变更提醒'}}</el-link
  1650. >
  1651. <el-link
  1652. type="primary"
  1653. @click="exportMembWorkHoursReminder()"
  1654. >{{$t('export.exportData')}}</el-link
  1655. >
  1656. </div>
  1657. </div>
  1658. <el-table ref="hasworkTbl"
  1659. :data="monthWorkDataS"
  1660. v-el-table-infinite-scroll="listScroll"
  1661. border
  1662. :height="'70vh'"
  1663. highlight-current-row
  1664. style="width: 100%"
  1665. v-loading="tbload"
  1666. :lazy="true"
  1667. >
  1668. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1669. <template slot-scope="scope">
  1670. {{ scope.row.createDate}}
  1671. </template>
  1672. </el-table-column>
  1673. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1674. <template slot-scope="scope">
  1675. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1676. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1677. <!-- {{scope.row.name}} -->
  1678. </template>
  1679. </el-table-column>
  1680. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1681. <template slot-scope="scope">
  1682. {{scope.row.invokeValue}}
  1683. </template>
  1684. </el-table-column>
  1685. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1686. <template slot-scope="scope">
  1687. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1688. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1689. </template>
  1690. </el-table-column>
  1691. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1692. <template slot-scope="scope">
  1693. {{ scope.row.workingTime}}
  1694. </template>
  1695. </el-table-column>
  1696. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1697. <template slot-scope="scope">
  1698. {{ scope.row.cardTime}}
  1699. </template>
  1700. </el-table-column>
  1701. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1702. <template slot-scope="scope">
  1703. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1704. </template>
  1705. </el-table-column>
  1706. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1707. <template slot-scope="scope">
  1708. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1709. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1710. </template>
  1711. </el-table-column>
  1712. </el-table>
  1713. <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>
  1714. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1715. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1716. <label style="font-size: 16px">员工每日已填报工时数</label>
  1717. <el-link
  1718. type="primary"
  1719. style="float: right; margin-right: 60px"
  1720. @click="exportMembWorkHours()"
  1721. >导出已填报数据</el-link
  1722. > -->
  1723. <!-- <el-button >导出</el-button> -->
  1724. <!-- </div> -->
  1725. </el-tab-pane>
  1726. </el-tabs>
  1727. </el-dialog>
  1728. <!--驳回弹出框 -->
  1729. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1730. <div>
  1731. <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')" />
  1732. </div>
  1733. <div slot="footer" class="dialog-footer">
  1734. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1735. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1736. </div>
  1737. </el-dialog>
  1738. <!-- 通过弹出框 -->
  1739. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1740. <div>
  1741. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1742. </div>
  1743. <div slot="footer" class="dialog-footer">
  1744. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1745. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1746. </div>
  1747. </el-dialog>
  1748. <!--批量导入日报 -->
  1749. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1750. <p>1. {{$t('other.download')}}
  1751. <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>
  1752. </p>
  1753. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1754. <p style="display: flex;justify-content: center;">
  1755. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1756. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1757. </el-upload>
  1758. </p>
  1759. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1760. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1761. </div>
  1762. </el-dialog>
  1763. <!-- 工时导入记录弹窗 -->
  1764. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1765. <div style="height: 452px">
  1766. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1767. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1768. <el-table-column prop="userName" :label="$t('other.operator')">
  1769. <template slot-scope="scope">
  1770. <div>
  1771. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1772. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1773. </div>
  1774. </template>
  1775. </el-table-column>
  1776. <el-table-column prop="datel" :label="$t('other.document')">
  1777. <template slot-scope="scope">
  1778. <div>
  1779. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1780. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1781. </div>
  1782. </template>
  1783. </el-table-column>
  1784. <el-table-column label="操作" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1785. <template slot-scope="scope">
  1786. <div>
  1787. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1788. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1789. </div>
  1790. </template>
  1791. </el-table-column>
  1792. </el-table>
  1793. <el-col :span="24" class="paginatis">
  1794. <el-pagination
  1795. @size-change="handleSizeChange"
  1796. @current-change="handleCurrentChange"
  1797. :page-sizes="[20 , 50 , 80 , 100]"
  1798. :page-size="20"
  1799. layout="total, sizes, prev, pager, next"
  1800. :total="toViewForm.total"
  1801. style="float:right;"
  1802. ></el-pagination>
  1803. </el-col>
  1804. </div>
  1805. </el-dialog>
  1806. <!--基于企业微信考勤数据的工时导入 -->
  1807. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1808. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1809. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1810. </el-step>
  1811. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1812. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1813. </el-steps>
  1814. <div v-if="active==0" style="padding:30px;height:360px;">
  1815. <div style="margin-top:50px;margin-left:280px;">
  1816. <el-date-picker
  1817. v-model="importWxParam.date" :editable="false"
  1818. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1819. :clearable="true"
  1820. :range-separator="$t('other.to')"
  1821. type="daterange"
  1822. :start-placeholder="$t('time.startDate')"
  1823. :end-placeholder="$t('time.endDate')"
  1824. @change="loadCheckInData"
  1825. ></el-date-picker>
  1826. </div>
  1827. </div>
  1828. <div v-if="active==1" style="padding:10px;">
  1829. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1830. style="width: 100%;margin-top:5px;" >
  1831. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1832. <template slot-scope="scope">
  1833. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1834. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1835. </template>
  1836. </el-table-column>
  1837. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1838. </el-table-column>
  1839. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1840. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1841. <template slot-scope="scope">
  1842. <div>
  1843. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1844. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1845. </div>
  1846. </template>
  1847. </el-table-column>
  1848. <el-table-column prop="departmentName" label="部门" >
  1849. <template slot-scope="scope">
  1850. <div>
  1851. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1852. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1853. </div>
  1854. </template>
  1855. </el-table-column>
  1856. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1857. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1858. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1859. <template slot-scope="scope">
  1860. {{scope.row.workHours.toFixed(1)}}h
  1861. </template>
  1862. </el-table-column>
  1863. </el-table>
  1864. </div>
  1865. <div v-if="active==2" >
  1866. <p style="display: flex;justify-content: center;height:390px;">
  1867. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1868. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1869. </el-upload>
  1870. </p>
  1871. </div>
  1872. <div slot="title">
  1873. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1874. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1875. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1876. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1877. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1878. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1879. </div>
  1880. <span slot="footer">
  1881. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1882. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1883. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1884. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1885. </span>
  1886. </el-dialog>
  1887. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1888. <p style="display: flex;justify-content: center;height:100px;">
  1889. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1890. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1891. </el-upload>
  1892. </p>
  1893. </el-dialog>
  1894. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1895. <div>
  1896. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1897. v-model="deleteReportParam.date" :editable="false"
  1898. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1899. :clearable="true"
  1900. :range-separator="$t('other.to')"
  1901. type="daterange"
  1902. :start-placeholder="$t('time.startDate')"
  1903. :end-placeholder="$t('time.endDate')"
  1904. ></el-date-picker>
  1905. </div>
  1906. <div style="margin-top:10px;">
  1907. <span>请选择部门:</span>
  1908. <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>
  1909. <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>
  1910. </div>
  1911. <div style="margin-top:10px;">
  1912. <span>请选择员工:</span>
  1913. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1914. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1915. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1916. <span v-else>{{item.name}}</span>
  1917. </el-option>
  1918. </el-select>
  1919. </div>
  1920. <span slot="footer">
  1921. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1922. </span>
  1923. </el-dialog>
  1924. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1925. <div>
  1926. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1927. v-model="deleteReportParam.date" :editable="false"
  1928. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1929. :clearable="true"
  1930. :range-separator="$t('other.to')"
  1931. type="daterange"
  1932. :start-placeholder="$t('time.startDate')"
  1933. :end-placeholder="$t('time.endDate')"
  1934. ></el-date-picker>
  1935. </div>
  1936. <div style="margin-top:15px;">
  1937. <span>选择部门:</span>
  1938. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1939. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1940. size="small" v-if="user.userNameNeedTranslate != 1"
  1941. ></el-cascader>
  1942. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1943. </div>
  1944. <span slot="footer">
  1945. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1946. </span>
  1947. </el-dialog>
  1948. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1949. <div>
  1950. <span>选择时间:</span><el-date-picker
  1951. v-model="modImportTime"
  1952. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1953. :clearable="true"
  1954. type="datetime"
  1955. ></el-date-picker>
  1956. <span>选择导入人员:</span><el-select
  1957. v-model="modImportUserId"
  1958. >
  1959. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1960. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1961. <span v-else>{{item.name}}</span>
  1962. </el-option>
  1963. </el-select>
  1964. </div>
  1965. <span slot="footer">
  1966. <el-button @click="confirmChangeModTime" >确认</el-button>
  1967. </span>
  1968. </el-dialog>
  1969. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1970. <div>
  1971. <span>请选择年月:</span>
  1972. <el-date-picker
  1973. v-model="ratioYmonth" :editable="false"
  1974. format="yyyyMM" value-format="yyyyMM"
  1975. type="month"
  1976. ></el-date-picker>
  1977. </div>
  1978. <span slot="footer">
  1979. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1980. </span>
  1981. </el-dialog>
  1982. <!--工时批量代填 -->
  1983. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1984. <div>
  1985. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1986. v-model="importWxParam.date" :editable="false"
  1987. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1988. :clearable="true"
  1989. :range-separator="$t('other.to')"
  1990. type="daterange"
  1991. :start-placeholder="$t('time.startDate')"
  1992. :end-placeholder="$t('time.endDate')"
  1993. @change="loadCheckInData"
  1994. ></el-date-picker>
  1995. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1996. </div>
  1997. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1998. :key="timeStamp"
  1999. style="width: 100%;margin-top:5px;" ref="tab">
  2000. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2001. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2002. <template slot-scope="scope">
  2003. <div>
  2004. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2005. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2006. </div>
  2007. </template>
  2008. </el-table-column>
  2009. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2010. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2011. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2012. <template slot-scope="scope">
  2013. {{scope.row.workHours.toFixed(1)}}h
  2014. </template>
  2015. </el-table-column>
  2016. <!--项目名称列表 -->
  2017. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2018. <template slot-scope="scope">
  2019. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2020. </template>
  2021. </el-table-column>
  2022. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2023. <template slot-scope="scope">
  2024. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2025. </template>
  2026. </el-table-column>
  2027. </el-table>
  2028. </el-dialog>
  2029. <!--基于企业微信考勤数据的工时导入 -->
  2030. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2031. <div style="padding-bottom:10px;">
  2032. <p>{{importResultMsg}}</p>
  2033. </div>
  2034. <!-- <span slot="footer" class="dialog-footer">
  2035. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2036. </span> -->
  2037. </el-dialog>
  2038. <!-- 审核流程展示 -->
  2039. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2040. <div style="padding:20px 40px 20px 0">
  2041. <el-timeline :reverse="false">
  2042. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2043. <!-- {{item.msg}} -->
  2044. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2045. <span v-if="user.userNameNeedTranslate == 1">
  2046. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2047. <span>{{item.msgCon.two}}</span>
  2048. </span>
  2049. </el-timeline-item>
  2050. </el-timeline>
  2051. </div>
  2052. </el-dialog>
  2053. </section>
  2054. </template>
  2055. <script>
  2056. // 左右滑动
  2057. import dragMixin from "@/common/js/tensile.js";
  2058. import util from "../../common/js/util";
  2059. // 自定义select组件
  2060. import selectCat from "@/components/select.vue"
  2061. // 引入自定义级联组件
  2062. import vueCascader from "@/components/cascader.vue"
  2063. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2064. // 重庆物奇定制组件
  2065. import WeeklyCustomization from "./weeklyCustomization.vue"
  2066. import { mapMutations } from 'vuex'
  2067. let _that = this
  2068. export default {
  2069. mixins: [dragMixin],
  2070. components: {
  2071. selectCat,
  2072. vueCascader,
  2073. WeeklyCustomization,
  2074. vueMultipleDept
  2075. },
  2076. data() {
  2077. return {
  2078. showHidden: false,
  2079. pageIndex: 0,
  2080. hasMore: true,
  2081. exportType: 0,
  2082. exportingData: false,
  2083. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2084. jobResponseList:[],
  2085. yisibeiCompId: 3092,
  2086. yuzhongCompId: 3385,
  2087. mingyiName : '成都明夷电子科技有限公司',
  2088. // mingyiName : '明夷',
  2089. modItemDataId: null,
  2090. modImportTime: null,
  2091. modImportUserId: null,
  2092. showModImportTimeDialog: false,
  2093. showBatchSimpleApproveReport: false,
  2094. startDeleting: false,
  2095. showBatchDeleteReport: false,
  2096. deleteReportParam: {date:null, userIds:[]},
  2097. isDenying: false,
  2098. targetWeekDate: null,//填写周报中的周日期
  2099. importCardTimeVisi: false,
  2100. startRatioExporting: false,
  2101. exportUserRatio: false,
  2102. ratioYmonth:null,
  2103. hasWrittenReport: false,
  2104. today:null,
  2105. syncTimeLoading: false,
  2106. seluserText: '',
  2107. translation: '1', // 1、文字, 2、部门, 3、人员
  2108. exportLoad: false,
  2109. getPickerOptions: {
  2110. disabledDate: (time) => {
  2111. var date = new Date();
  2112. var year = date.getFullYear();
  2113. var month = date.getMonth() + 1;
  2114. if (month >= 1 && month <= 9) {
  2115. month = "0" + month;
  2116. }
  2117. var currentdate = year.toString() + month.toString();
  2118. var timeyear = time.getFullYear();
  2119. var timemonth = time.getMonth() + 1;
  2120. if (timemonth >= 1 && timemonth <= 9) {
  2121. timemonth = "0" + timemonth;
  2122. }
  2123. var timedate = timeyear.toString() + timemonth.toString();
  2124. if(this.user.timeType.fillAhead == 0){
  2125. return currentdate < timedate;
  2126. }else{
  2127. return false
  2128. }
  2129. }
  2130. },
  2131. alalal: '8.0',
  2132. timeBasecostList:null,
  2133. tbload: false,
  2134. exportTimeDialog: false,
  2135. searchKeyword: '',
  2136. monthWorkDataS: [],
  2137. monthNotWorkDateS: [],
  2138. pickDateArray:[],
  2139. WorktimeDatepickValue: [],
  2140. activeName:"first",
  2141. isLeave: 0,
  2142. submitingReport: false,
  2143. importResultMsg:null,
  2144. showImportResult:false,
  2145. importingData: false,
  2146. isDraft: 0,
  2147. timeStamp: 0,
  2148. projectColumns:[],
  2149. checkinLoading:false,
  2150. importWxParam:{date:null,},
  2151. active:0,
  2152. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2153. importWxDialog:false,
  2154. importDialog:false,
  2155. denyForm:null,
  2156. denyReasonDialog:false,
  2157. monthWorkTimeDialog: false,
  2158. isSubstitude:false,
  2159. isFill:false,
  2160. unFillList:[],
  2161. fillList:[],
  2162. fillMembList:[],
  2163. fillMembList_leave: [],
  2164. membListVisible: false,
  2165. isBatch:0,//是否是批量填报
  2166. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2167. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2168. 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')],
  2169. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2170. fillStatusList: [],
  2171. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2172. exportReportLogParam:{dateRange:[]},
  2173. exportDialog:false,
  2174. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2175. subProjectList:[],
  2176. canEdit: true,
  2177. originCanEdit: true,
  2178. 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],
  2179. selectTime:null,
  2180. reportTimeType:{},
  2181. curDate:'',
  2182. isAllSelect: false,
  2183. approveDialogVisible:false,
  2184. deptId:null,
  2185. targetUid: null,
  2186. membCount:0,
  2187. selectState:"-1",
  2188. user: JSON.parse(sessionStorage.getItem("user")),
  2189. allUsersList: [],
  2190. showAddMore:false,
  2191. allDate: [],
  2192. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2193. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2194. choseDay: 0,
  2195. tableHeight: 0,
  2196. listLoading: false,
  2197. projectList: [], //项目列表
  2198. fillProjectList: [],
  2199. reportList: [], //日报列表
  2200. reportNames:[], //批量审批列表
  2201. selCon:[], //筛选条件
  2202. selProjectList:[], //筛选后项目列表
  2203. selConShow: true,
  2204. usersList: [], // 全部人员列表
  2205. usersListId: '', // 选中的人员id
  2206. dialogVisible: false, //项目弹窗
  2207. report: '',
  2208. workForm: {
  2209. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2210. domains: [{
  2211. id: null,
  2212. projectId: "",
  2213. workingTime: "",
  2214. timeType:0,
  2215. content: "",
  2216. state: 2,
  2217. multiWorktime:0,
  2218. worktimeList:[],
  2219. degreeId: null,
  2220. auditUserList: [],
  2221. }],
  2222. showRefresh: false,
  2223. },
  2224. workRules: {
  2225. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2226. },
  2227. chooseParticipVisible: false,
  2228. logining: false,
  2229. isDisable: false,
  2230. timeType:[],
  2231. deptMembData: [
  2232. ],
  2233. //部门人员树状结构
  2234. data: [
  2235. {
  2236. id: -1,
  2237. label: this.$t('lable.allStaff'),
  2238. membCount:0
  2239. },
  2240. {
  2241. id: 0,
  2242. label: this.$t('lable.unassigned'),
  2243. }
  2244. ],
  2245. allData:{},
  2246. batchShowData:{},
  2247. option: [],
  2248. deptOptionList: [],
  2249. depData: {
  2250. id: -1,
  2251. label: this.$t('lable.allStaff'),
  2252. },
  2253. defaultProps: {
  2254. children: 'children',
  2255. label: 'label'
  2256. },
  2257. isNew: false,
  2258. selected: false,
  2259. valuet: new Date(),
  2260. domObj: null,
  2261. participator:[],
  2262. chosenMembCount:0,
  2263. jsDay: 0,
  2264. jsTime: 0,
  2265. falsss: false,
  2266. weidu: [],
  2267. weiduList: [],
  2268. yonghuUser: [],
  2269. dateAr: [],
  2270. batchSubFillDialog: false,
  2271. isSubstiS: false,
  2272. fillWeekDialogVisi: false,
  2273. fillWeekDialogVisiCustom: false,
  2274. zhoData: [],
  2275. weekDateRange: [],
  2276. btnZho: false,
  2277. weekDataLoading: false,
  2278. changdu: 6,
  2279. tianxieDialogVisible: false,
  2280. scopess: {},
  2281. zhoBao: {
  2282. time: '',
  2283. workingTime: '',
  2284. progress: '',
  2285. con: '',
  2286. subProjectId: '',
  2287. stage: '',
  2288. subProjectList: [],
  2289. stages: [],
  2290. },
  2291. zhoBaoIdx: '',
  2292. zhoBaoName: '',
  2293. zhis: {},
  2294. dealList: [],
  2295. toViewDialogVisible: false,
  2296. toViewList: [],
  2297. toViewloading: true,
  2298. toViewForm: {
  2299. pageIndex: '1',
  2300. pageSize: '20',
  2301. total: 0,
  2302. },
  2303. toViewloadings: false,
  2304. tabPositionss: 'top',
  2305. monthTotal: 0,
  2306. monthTotalPage: 0,
  2307. monthTotalLages: 20,
  2308. monthWorkData: [],
  2309. monthNotWorkDate: [],
  2310. monthWorkDataS1: [],
  2311. monthnotTotal: 0,
  2312. monthnotTotalPage: 0,
  2313. monthnotTotalLages: 20,
  2314. monthNotWorkDateS1: [],
  2315. deptMembDataText: '',
  2316. isFlag: false,
  2317. isMore: false,
  2318. stateKey: '0',
  2319. expandDate: [],
  2320. notifySelList:[],
  2321. departmentList: [],
  2322. trandepartmentList:[],
  2323. approvalProcessDialog: false,
  2324. approvalProcessData: [],
  2325. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2326. 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')],
  2327. isWeekend: false,
  2328. canCancelInDialog: false,
  2329. approveinData: {},
  2330. approveinDialog: false,
  2331. reportCanDelete: false,
  2332. weeklyFilledTimeDialog: false,
  2333. weeklyFilledTimeList: [],
  2334. weeklyFilledTimeLoading: false,
  2335. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2336. weeklyFilledTimeCanDelete: false,
  2337. weeklyFilledTimeDate: null,
  2338. leaveAllNum: 0,
  2339. dataLoading: false,
  2340. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2341. vacationTime: {},
  2342. integrationProjectList: [],
  2343. totalReportHours: 0, // 合计的工时
  2344. workTimeForMinYi:0,
  2345. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2346. weekIndex: 1,
  2347. weekParentData: {},
  2348. deptIdForNoReport:[],
  2349. deptIdForReminder:[],
  2350. nameAearch: '', // 企业微信姓名搜索
  2351. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2352. deptMembDataLoading: false,
  2353. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2354. {
  2355. id: 4811,
  2356. // id: 10,
  2357. name: '陕西柘中建设工程有限公司'
  2358. }
  2359. ],
  2360. pushWorkTimeLogDig:false,
  2361. pushWorkTimeLogData:[],
  2362. userReportDeptList: [],
  2363. isReminder:true,
  2364. reportLogCheckDialog:false,
  2365. deptIdForHasReport:[],
  2366. };
  2367. },
  2368. watch: {
  2369. deptMembDataText(val) {
  2370. this.$refs.chooseMembTree.filter(val);
  2371. }
  2372. },
  2373. filters: {
  2374. // 过滤
  2375. amounts(value) {
  2376. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2377. return 0
  2378. }
  2379. var zhi = +value + 0
  2380. return zhi.toFixed(1)
  2381. },
  2382. // zhoData
  2383. zhoData(value, arr) {
  2384. var dateArray = value.split("-");
  2385. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2386. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2387. // console.log(arr[date.getDay()])
  2388. // return "周" + "日一二三四五六".charAt(date.getDay());
  2389. return arr[date.getDay()]
  2390. },
  2391. // 过滤数字
  2392. numbers(value) {
  2393. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2394. return 0
  2395. }
  2396. return value
  2397. },
  2398. },
  2399. computed: {},
  2400. mounted() {
  2401. var now = new Date();
  2402. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2403. this.today = t;
  2404. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2405. this.exportParam.dateRange = [startStr,t];
  2406. this.exportReportLogParam.dateRange = [startStr,t];
  2407. this.getAllDate(1);
  2408. this.getReportList();
  2409. this.getProjectList();
  2410. this.getFillProjectList();
  2411. this.getTimeType();
  2412. this.getDepartment();
  2413. this.scrollFunction()
  2414. this.userssHu();
  2415. this.getFirstAndLastDay()
  2416. if(this.user.timeType.reportAuditType == 3){
  2417. this.getAllUsersList()
  2418. }
  2419. if (this.user.company.packageProject == 1) {
  2420. this.getBasecostItemList();
  2421. }
  2422. if(this.user.timeType.userWithMultiDept == 1) {
  2423. this.getDeptMembData();
  2424. }
  2425. if(this.user.timeType.lockWorktime){
  2426. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2427. }
  2428. //设置了下限
  2429. if (this.user.timeType.minReportTime) {
  2430. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2431. }
  2432. const that = this
  2433. if(this.user.userNameNeedTranslate == 1) {
  2434. that.dataLoading = that.$store.state.dataLoading
  2435. this.upDataLoading()
  2436. setTimeout(()=>{
  2437. that.dataLoading = that.$store.state.dataLoading
  2438. }, 1000)
  2439. }
  2440. if (this.user.companyId == this.yuzhongCompId) {
  2441. this.getJobResponList();
  2442. }
  2443. },
  2444. methods: {
  2445. ...mapMutations(['upDataLoading']),
  2446. // 已填工时情况表设置背景色
  2447. hasworkTblCellStyle({ columnIndex, row, column }) {
  2448. if(columnIndex > 2) {
  2449. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2450. const worktimeList = row.worktimeList || []
  2451. const times = this.reportTimeType.allday
  2452. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2453. const isWorkDate = filterData[0] && filterData[0].workingTime
  2454. const state = filterData[0] && filterData[0].state
  2455. if (state == 0 || state == -1) {
  2456. return "backgroundColor: orange"
  2457. } else if (state == 1) {
  2458. //审核通过
  2459. return "backgroundColor: #32CD32"
  2460. } else if (state == 2) {
  2461. return "backgroundColor: red"
  2462. } else {
  2463. return "backgroundColor: #E0E0E0"
  2464. // if(isWorkDate < times) {
  2465. // return "backgroundColor: #FC3D49"
  2466. // }
  2467. // if(isWorkDate > times) {
  2468. // return "backgroundColor: #20a0ff"
  2469. // }
  2470. }
  2471. }
  2472. },
  2473. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2474. isCustomization(userInfo, permissionArray) {
  2475. const { companyId } = userInfo
  2476. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2477. return isReportPictureRequired
  2478. },
  2479. showHiddenFunction() {
  2480. this.showHidden = true;
  2481. },
  2482. // 获取如何信息选的可填写部门
  2483. getDeptMembData() {
  2484. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2485. if (res.code == "ok") {
  2486. let lists = res.data.userReportDeptList || []
  2487. const optimizedList = lists.map(item => ({
  2488. ...item,
  2489. label: item.departmentName,
  2490. value: item.departmentId,
  2491. }));
  2492. this.$set(this, 'userReportDeptList', optimizedList || []);
  2493. } else {
  2494. this.$message({
  2495. message: res.msg,
  2496. type: "error"
  2497. });
  2498. }
  2499. },error => { });
  2500. },
  2501. //任务被选中
  2502. onTaskSelected(domainItem) {
  2503. //取服务
  2504. if (domainItem.taskId) {
  2505. var that = this;
  2506. var param = {taskId:domainItem.taskId};
  2507. if (this.isSubstitude) {
  2508. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2509. param.userId = this.workForm.userId[0];
  2510. }
  2511. }
  2512. this.http.post('/task/getMyTaskService',param, res => {
  2513. if (res.code == "ok") {
  2514. // domainItem.workContentList = res.data;
  2515. that.$set(domainItem, 'sapServiceId', null);
  2516. that.$set(domainItem, 'serviceList', res.data);
  2517. } else {
  2518. this.$message({
  2519. message: res.msg,
  2520. type: "error"
  2521. });
  2522. }
  2523. },error => {
  2524. this.$message({
  2525. message: error,
  2526. type: "error"
  2527. });
  2528. }
  2529. );
  2530. } else {
  2531. //清空服务
  2532. }
  2533. },
  2534. onBatchTimeChange() {
  2535. //反向计算每日工作时长
  2536. if (this.workForm.createDate) {
  2537. let sdate = new Date(this.workForm.createDate[0]);
  2538. let edate = new Date(this.workForm.createDate[1]);
  2539. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2540. console.log('days===', days)
  2541. if (days < 0) {
  2542. return;
  2543. }
  2544. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2545. //总时长发生改变,自动按比例计算
  2546. this.workForm.domains.forEach(d=>{
  2547. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2548. });
  2549. }
  2550. },
  2551. //更新工作内容列表
  2552. updateJobContent(domainItem) {
  2553. var that = this;
  2554. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2555. if (res.code == "ok") {
  2556. // domainItem.workContentList = res.data;
  2557. that.$set(domainItem, 'extraField3', null);
  2558. that.$set(domainItem, 'workContentList', res.data);
  2559. } else {
  2560. this.$message({
  2561. message: res.msg,
  2562. type: "error"
  2563. });
  2564. }
  2565. },error => {
  2566. this.$message({
  2567. message: error,
  2568. type: "error"
  2569. });
  2570. }
  2571. );
  2572. },
  2573. updateResponse(domainItem) {
  2574. var that = this;
  2575. var selectPid = domainItem.projectId;
  2576. domainItem.extraField2 = null;
  2577. domainItem.extraField3 = null;
  2578. if (selectPid && domainItem.extraField1) {
  2579. //是否非项目
  2580. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2581. console.log('==========','isPublic=='+isPublic);
  2582. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2583. console.log(filteredRespList);
  2584. domainItem.filteredRespList = filteredRespList;
  2585. }
  2586. },
  2587. getJobResponList() {
  2588. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2589. if (res.code == "ok") {
  2590. this.jobResponseList = res.data;
  2591. } else {
  2592. this.$message({
  2593. message: res.msg,
  2594. type: "error"
  2595. });
  2596. }
  2597. },error => {
  2598. this.$message({
  2599. message: error,
  2600. type: "error"
  2601. });
  2602. }
  2603. );
  2604. },
  2605. openModImportTime(row) {
  2606. this.showModImportTimeDialog = true;
  2607. this.modItemDataId = row.id;
  2608. },
  2609. delImportTime(row) {
  2610. let rowId = row.id;
  2611. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2612. confirmButtonText: this.$t('btn.determine'),
  2613. cancelButtonText: this.$t('btn.cancel'),
  2614. type: "warning"
  2615. })
  2616. .then(() => {
  2617. this.http.post('/report-import-log/delete',{
  2618. id: rowId
  2619. },res => {
  2620. if (res.code == "ok") {
  2621. this.$message({
  2622. message: '删除成功',
  2623. type: "success"
  2624. });
  2625. this.getToView();
  2626. } else {
  2627. this.$message({
  2628. message: res.msg,
  2629. type: "error"
  2630. });
  2631. }
  2632. },error => {
  2633. this.$message({
  2634. message: error,
  2635. type: "error"
  2636. });
  2637. }
  2638. );
  2639. }).catch(() => {this.startDeleting = false});
  2640. },
  2641. confirmChangeModTime() {
  2642. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2643. this.$message({
  2644. message: '请选择时间',
  2645. type: "error"
  2646. });
  2647. return;
  2648. }
  2649. this.http.post('/report-import-log/changeTime',{
  2650. modLogDateTime: this.modImportTime,
  2651. modImportUserId: this.modImportUserId,
  2652. id: this.modItemDataId
  2653. },res => {
  2654. if (res.code == "ok") {
  2655. this.$message({
  2656. message: '修改成功',
  2657. type: "success"
  2658. });
  2659. this.getToView();
  2660. this.showModImportTimeDialog = false;
  2661. } else {
  2662. this.$message({
  2663. message: res.msg,
  2664. type: "error"
  2665. });
  2666. }
  2667. },error => {
  2668. this.$message({
  2669. message: error,
  2670. type: "error"
  2671. });
  2672. }
  2673. );
  2674. },
  2675. confirmBatchApproveReport() {
  2676. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2677. this.$message({
  2678. message: '请选择日期范围',
  2679. type: "error"
  2680. });
  2681. return;
  2682. }
  2683. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2684. confirmButtonText: this.$t('btn.determine'),
  2685. cancelButtonText: this.$t('btn.cancel'),
  2686. type: "warning"
  2687. })
  2688. .then(() => {
  2689. this.startDeleting = true;
  2690. let obj = {
  2691. startDate: this.deleteReportParam.date[0],
  2692. endDate: this.deleteReportParam.date[1]
  2693. }
  2694. if(this.deleteReportParam.departmentId) {
  2695. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2696. } else {
  2697. obj.departmentId = null
  2698. }
  2699. this.http.post('/report/batchApproveByDate',obj,res => {
  2700. if (res.code == "ok") {
  2701. this.$message({
  2702. message: '审核通过',
  2703. type: "success"
  2704. });
  2705. this.getReportList();
  2706. this.getDepartment();
  2707. this.startDeleting = false;
  2708. } else {
  2709. this.$message({
  2710. message: res.msg,
  2711. type: "error"
  2712. });
  2713. }
  2714. },error => {
  2715. this.$message({
  2716. message: error,
  2717. type: "error"
  2718. });
  2719. }
  2720. );
  2721. }).catch(() => {this.startDeleting = false});
  2722. },
  2723. confirmBatchDelReport() {
  2724. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2725. this.$message({
  2726. message: '请选择部门或人员',
  2727. type: "error"
  2728. });
  2729. return;
  2730. }
  2731. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2732. this.$message({
  2733. message: '请选择日期范围',
  2734. type: "error"
  2735. });
  2736. return;
  2737. }
  2738. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2739. confirmButtonText: this.$t('btn.determine'),
  2740. cancelButtonText: this.$t('btn.cancel'),
  2741. type: "warning"
  2742. })
  2743. .then(() => {
  2744. this.startDeleting = true;
  2745. this.http.post('/report/batchDelete',{
  2746. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2747. startDate: this.deleteReportParam.date[0],
  2748. endDate: this.deleteReportParam.date[1],
  2749. deptId: this.deleteReportParam.deptId[0]
  2750. },res => {
  2751. if (res.code == "ok") {
  2752. this.$message({
  2753. message: this.$t('message.successfullyDeleted'),
  2754. type: "success"
  2755. });
  2756. this.getReportList();
  2757. this.getDepartment();
  2758. this.startDeleting = false;
  2759. } else {
  2760. this.$message({
  2761. message: res.msg,
  2762. type: "error"
  2763. });
  2764. }
  2765. },error => {
  2766. this.$message({
  2767. message: error,
  2768. type: "error"
  2769. });
  2770. }
  2771. );
  2772. }).catch(() => {this.startDeleting = false});
  2773. },
  2774. getRecentlyProject() {
  2775. this.http.post('/project/nearProject',{},res => {
  2776. if(res.code == 'ok'){
  2777. let topObj = {
  2778. label: '最近选择项目',
  2779. peojectList: res.data
  2780. }
  2781. let botomObj = {
  2782. label: '全部项目',
  2783. peojectList: this.fillProjectList
  2784. }
  2785. //最近项目如果在fillProjectList中不存在,需要移除
  2786. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2787. this.integrationProjectList = [topObj, botomObj]
  2788. }else {
  2789. this.$message({
  2790. message: res.msg,
  2791. type: 'error'
  2792. })
  2793. }
  2794. },err => {
  2795. this.$message({
  2796. message: err,
  2797. type: 'error'
  2798. })
  2799. })
  2800. },
  2801. handlePictureCardPreview(file, index) {
  2802. console.log(file, index)
  2803. let arr = []
  2804. let imgArr = this.workForm.domains[index].imgListUrl
  2805. for(var i in imgArr) {
  2806. arr.push(imgArr[i].url)
  2807. }
  2808. console.log(arr, '图片数据')
  2809. const $viewer = this.$viewerApi({
  2810. images: arr
  2811. });
  2812. },
  2813. // 图片上传
  2814. addImg(e, index) {
  2815. console.log(e, '数据')
  2816. let formData = new FormData()
  2817. formData.append('multipartFile', e.file)
  2818. this.http.uploadFile('/common/uploadFile', formData,
  2819. res => {
  2820. if (res.code == "ok") {
  2821. this.$message({
  2822. message: this.$t('uploadedsuccessfully'),
  2823. type: "success"
  2824. });
  2825. if(!this.workForm.domains[index].imgList) {
  2826. this.workForm.domains[index].imgList = []
  2827. this.workForm.domains[index].imgListUrl = []
  2828. }
  2829. this.workForm.domains[index].imgList.push(res.data)
  2830. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2831. } else {
  2832. this.$message({message: res.msg,type: "error"});
  2833. }
  2834. console.log(this.workForm.domains[index])
  2835. },
  2836. error => {this.$message({message: error,type: "error"});
  2837. });
  2838. },
  2839. // 删除图片
  2840. delImg(file,fileList, index) {
  2841. console.log(file, fileList)
  2842. let idx = 0
  2843. for(let i in fileList) {
  2844. if(fileList[i].uid == file.uid) {
  2845. idx = i
  2846. }
  2847. }
  2848. this.workForm.domains[index].imgList.splice(idx, 1)
  2849. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2850. console.log(this.workForm.domains[index])
  2851. },
  2852. test(){
  2853. console.log('test',this.workForm.domains);
  2854. },
  2855. getHour(s1, s2) {
  2856. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2857. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2858. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2859. var ms = s2.getTime() - s1.getTime();
  2860. if (ms < 0) return 0;
  2861. let ma = ms / 1000 / 60 / 60
  2862. return ma; //小时
  2863. },
  2864. refreshWXCardTime(workdate) {
  2865. if (!workdate) return;
  2866. this.syncTimeLoading = true;
  2867. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2868. date: workdate,
  2869. },res => {
  2870. this.syncTimeLoading = false;
  2871. if(res.code == 'ok'){
  2872. this.workForm.time = res.data.time;
  2873. }else {
  2874. this.$message({
  2875. message: res.msg,
  2876. type: 'error'
  2877. })
  2878. }
  2879. },err => {
  2880. this.syncTimeLoading = false;
  2881. this.$message({
  2882. message: err,
  2883. type: 'error'
  2884. })
  2885. })
  2886. },
  2887. refreshAttendance(workdate) {
  2888. if (!workdate) return;
  2889. this.syncTimeLoading = true;
  2890. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2891. startDate: workdate[0],
  2892. endDate: workdate[1]
  2893. },res => {
  2894. this.syncTimeLoading = false;
  2895. if(res.code == 'ok'){
  2896. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2897. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2898. this.totalReportHours = this.workTimeForMinYi;
  2899. }else {
  2900. this.$message({
  2901. message: res.msg,
  2902. type: 'error'
  2903. })
  2904. }
  2905. },err => {
  2906. this.syncTimeLoading = false;
  2907. this.$message({
  2908. message: err,
  2909. type: 'error'
  2910. })
  2911. })
  2912. },
  2913. refreshBeiSengAttendance(workdate) {
  2914. if (!workdate) return;
  2915. this.syncTimeLoading = true;
  2916. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2917. createDate: workdate
  2918. },res => {
  2919. this.syncTimeLoading = false;
  2920. if(res.code == 'ok'){
  2921. this.workForm.time = res.data;
  2922. }else {
  2923. this.$message({
  2924. message: res.msg,
  2925. type: 'error'
  2926. })
  2927. }
  2928. },err => {
  2929. this.syncTimeLoading = false;
  2930. this.$message({
  2931. message: err,
  2932. type: 'error'
  2933. })
  2934. })
  2935. },
  2936. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2937. this.weeklyFilledTimeDialog = true
  2938. this.weeklyFilledTimeLoading = true
  2939. this.weeklyFilledTimeDate = parameterDate
  2940. this.http.post('/report/getReportList',{
  2941. date: parameterDate,
  2942. userId: this.user.id
  2943. },res => {
  2944. this.weeklyFilledTimeLoading = false
  2945. if(res.code == 'ok'){
  2946. this.weeklyFilledTimeList = res.data[0].data
  2947. let candelete = true
  2948. for(let i in this.weeklyFilledTimeList){
  2949. if(this.weeklyFilledTimeList[i].state < 2){
  2950. candelete = false
  2951. }
  2952. }
  2953. this.weeklyFilledTimeCanDelete = candelete
  2954. }else {
  2955. this.$message({
  2956. message: res.msg,
  2957. type: 'error'
  2958. })
  2959. }
  2960. },err => {
  2961. this.weeklyFilledTimeLoading = false
  2962. this.$message({
  2963. message: err,
  2964. type: 'error'
  2965. })
  2966. })
  2967. },
  2968. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2969. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2970. confirmButtonText: this.$t('btn.determine'),
  2971. cancelButtonText: this.$t('btn.cancel'),
  2972. type: "warning"
  2973. })
  2974. .then(() => {
  2975. this.http.post('/report/delete',{
  2976. userId: this.user.id,
  2977. date: this.weeklyFilledTimeDate
  2978. },res => {
  2979. if (res.code == "ok") {
  2980. this.$message({
  2981. message: this.$t('message.successfullyDeleted'),
  2982. type: "success"
  2983. });
  2984. this.getWeeklyWorkTime()
  2985. this.getReportList();
  2986. this.getDepartment();
  2987. this.weeklyFilledTimeDialog = false;
  2988. } else {
  2989. this.$message({
  2990. message: res.msg,
  2991. type: "error"
  2992. });
  2993. }
  2994. },error => {
  2995. this.$message({
  2996. message: error,
  2997. type: "error"
  2998. });
  2999. }
  3000. );
  3001. }).catch(() => {});
  3002. },
  3003. getApprovalProcess(item){
  3004. // console.log('this.date',this.choseDate);
  3005. this.http.post('/report-log/get',{
  3006. creatorId: item.id,
  3007. createDate: sessionStorage.msg
  3008. },res => {
  3009. if(res.code == 'ok'){
  3010. this.approvalProcessDialog = true
  3011. if(this.user.userNameNeedTranslate == 1) {
  3012. for(var i in res.data) {
  3013. let obj = {
  3014. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3015. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3016. }
  3017. res.data[i].msgCon = obj
  3018. }
  3019. }
  3020. this.approvalProcessData = res.data
  3021. console.log(this.approvalProcessData, '数据卡看')
  3022. }else{
  3023. this.$message({
  3024. message: res.msg,
  3025. type: 'error'
  3026. })
  3027. }
  3028. },err => {
  3029. this.$message({
  3030. message: err,
  3031. type: 'error'
  3032. })
  3033. })
  3034. },
  3035. filterNode(value, data) {
  3036. if (!value) return true;
  3037. return data.label.indexOf(value) !== -1;
  3038. },
  3039. triggerCalculateOT(index) {
  3040. var str = this.workForm.domains[index].overtimeHours + ''
  3041. if(str.indexOf('.') != '-1') {
  3042. var s = str.split('.')[0]
  3043. var st = str.split('.')[1]
  3044. var sts = st.split('')
  3045. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3046. }
  3047. },
  3048. searchScreen(e){
  3049. if(e){
  3050. this.monthNotWorkDateS1 = []
  3051. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3052. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3053. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3054. }
  3055. }
  3056. if (this.monthNotWorkDateS1.length > 50) {
  3057. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3058. }else{
  3059. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3060. }
  3061. // if (this.monthNotWorkDateS1.length > 0) {
  3062. // setTimeout(() => {
  3063. // this.tableListenernot()
  3064. // }, 1000);
  3065. // }
  3066. }else{
  3067. this.monthWorkDataS1 = []
  3068. for (let i = 0; i < this.monthWorkData.length; i++) {
  3069. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3070. this.monthWorkDataS1.push(this.monthWorkData[i])
  3071. }
  3072. }
  3073. if (this.monthWorkDataS1.length > 50) {
  3074. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3075. }else{
  3076. this.monthWorkDataS = this.monthWorkDataS1
  3077. }
  3078. // if (this.monthWorkDataS1.length > 0) {
  3079. // setTimeout(() => {
  3080. // this.tableListener()
  3081. // }, 1000);
  3082. // }
  3083. }
  3084. },
  3085. addUpload(data) {
  3086. // var zhi = data.fileName.split('.')[0]
  3087. // var sss = zhi + '.xlsx'
  3088. // return
  3089. var filePath = '/upload/' + data.serverName;
  3090. const a = document.createElement('a'); // 创建a标签
  3091. a.setAttribute('download', data.fileName);// download属性
  3092. a.setAttribute('href', filePath);// href链接
  3093. a.click(); //自执行点击事件
  3094. a.remove();
  3095. },
  3096. restrictNumber(targetId) {
  3097. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3098. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3099. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3100. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3101. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3102. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3103. inpu.value = parseFloat(inpu.value);
  3104. }
  3105. },
  3106. //获取项目下的任务分组
  3107. getTaskGroups(domain, index) {
  3108. domain.groupId=null;
  3109. this.http.post('/task-group/listMyJoinGroup',{
  3110. projectId: domain.projectId,
  3111. isSubstitude: this.isSubstitude ? 1 : 0
  3112. },
  3113. res => {
  3114. if (res.code == "ok") {
  3115. this.workForm.domains[index].taskGroups = res.data;
  3116. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3117. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3118. // this.getGroupStages(domain, index);
  3119. // }
  3120. this.$forceUpdate();
  3121. }
  3122. },
  3123. error => {
  3124. this.$message({
  3125. message: error,
  3126. type: "error"
  3127. });
  3128. }
  3129. );
  3130. },
  3131. //下载填报工时占比报表
  3132. downloadProjectRatio() {
  3133. this.exportUserRatio = true;
  3134. // let now = new Date();
  3135. // let month = now.getMonth();//默认看上个月的
  3136. // let monthStr = month<10? ('0'+month): month;
  3137. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3138. const today = new Date();
  3139. const year = today.getFullYear();
  3140. const month = today.getMonth() + 1;
  3141. let lastMonthYear, lastMonth;
  3142. if (month === 1) {
  3143. lastMonthYear = year - 1;
  3144. lastMonth = 12;
  3145. } else {
  3146. lastMonthYear = year;
  3147. lastMonth = month - 1;
  3148. }
  3149. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3150. console.log('赋值 ==>', this.ratioYmonth)
  3151. },
  3152. confirmDownloadRatio() {
  3153. this.startRatioExporting = true;
  3154. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3155. ymonth: this.ratioYmonth
  3156. },
  3157. res => {
  3158. if (res.code == "ok") {
  3159. this.startRatioExporting = false;
  3160. var filePath = res.data;
  3161. const a = document.createElement('a'); // 创建a标签
  3162. var data = filePath.split("/");
  3163. a.setAttribute('download', data[data.length-1]);// download属性
  3164. a.setAttribute('href', filePath);// href链接
  3165. a.click(); //自执行点击事件
  3166. a.remove();
  3167. } else {
  3168. this.startRatioExporting = false;
  3169. this.$message({
  3170. message: res.msg,
  3171. type: "error"
  3172. });
  3173. }
  3174. },
  3175. error => {
  3176. this.checkinLoading = false;
  3177. this.$message({
  3178. message: error,
  3179. type: "error"
  3180. });
  3181. }
  3182. );
  3183. },
  3184. //下载带企业微信考勤数据的工时统计模板
  3185. downloadCheckInExcel() {
  3186. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3187. startDate: this.importWxParam.date[0],
  3188. endDate: this.importWxParam.date[1],
  3189. },
  3190. res => {
  3191. if (res.code == "ok") {
  3192. var filePath = res.data;
  3193. const a = document.createElement('a'); // 创建a标签
  3194. var data = filePath.split("/");
  3195. a.setAttribute('download', data[data.length-1]);// download属性
  3196. a.setAttribute('href', filePath);// href链接
  3197. a.click(); //自执行点击事件
  3198. a.remove();
  3199. } else {
  3200. this.$message({
  3201. message: res.msg,
  3202. type: "error"
  3203. });
  3204. }
  3205. },
  3206. error => {
  3207. this.checkinLoading = false;
  3208. this.$message({
  3209. message: error,
  3210. type: "error"
  3211. });
  3212. }
  3213. );
  3214. },
  3215. pre() {
  3216. if (this.active == 0) return;
  3217. this.active--;
  3218. },
  3219. next() {
  3220. this.active++;
  3221. },
  3222. triggerTotalTime(index) {
  3223. var item = this.checkinList[index];
  3224. var total = 0.0;
  3225. for (var i=0;i<this.projectColumns.length; i++) {
  3226. var key = this.projectColumns[i];
  3227. if (item[key] != null && item[key] != '') {
  3228. total += parseFloat(item[key]);
  3229. }
  3230. }
  3231. item.totalFillTime = total;
  3232. },
  3233. //提交批量代填的数据
  3234. submitBatchSubFillData() {
  3235. var data = JSON.stringify(this.checkinList);
  3236. this.http.post('/user-corpwx-time/submitProjectTime',{
  3237. json: data,
  3238. projectColumns: JSON.stringify(this.projectColumns)
  3239. },
  3240. res => {
  3241. if (res.code == "ok") {
  3242. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3243. this.importWxDialog = false;
  3244. }
  3245. },
  3246. error => {
  3247. this.checkinLoading = false;
  3248. this.$message({
  3249. message: error,
  3250. type: "error"
  3251. });
  3252. }
  3253. );
  3254. },
  3255. loadCheckInData() {
  3256. if (this.importWxParam.date == null) {
  3257. this.checkinList = [];
  3258. return;
  3259. }
  3260. this.checkinLoading = true;
  3261. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3262. startDate: this.importWxParam.date[0],
  3263. endDate: this.importWxParam.date[1],
  3264. },
  3265. res => {
  3266. if (res.code == "ok") {
  3267. this.checkinLoading = false;
  3268. this.checkinList = res.data.list;
  3269. this.projectColumns = res.data.projects;
  3270. // 自定义表格会导致表格错乱,需重新计算表格
  3271. this.$nextTick(()=>{
  3272. this.$refs.tab.doLayout()
  3273. })
  3274. }
  3275. },
  3276. error => {
  3277. this.checkinLoading = false;
  3278. this.$message({
  3279. message: error,
  3280. type: "error"
  3281. });
  3282. }
  3283. );
  3284. },
  3285. importCardTime(item) {
  3286. //首先判断文件类型
  3287. let str = item.file.name.split(".");
  3288. let format = str[str.length - 1];
  3289. if (format != "xls" && format != "xlsx") {
  3290. this.$message({
  3291. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3292. type: "error"
  3293. });
  3294. } else {
  3295. this.importingData = true;
  3296. let formData = new FormData();
  3297. formData.append("multipartFile", item.file);
  3298. formData.append("companyId", this.user.companyId);
  3299. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3300. res => {
  3301. this.$refs.uploadCardTime.clearFiles();
  3302. this.importingData = false;
  3303. if (res.code == "ok") {
  3304. //换成弹出框,以免有人等了半天回来啥也没看到
  3305. this.$message({
  3306. message: '导入考勤时长成功',
  3307. type: "success"
  3308. });
  3309. } else {
  3310. this.$message({
  3311. message: res.msg,
  3312. type: "error"
  3313. });
  3314. }
  3315. },
  3316. error => {
  3317. this.$refs.upload.clearFiles();
  3318. this.listLoading = false;
  3319. this.$message({
  3320. message: error,
  3321. type: "error"
  3322. });
  3323. });
  3324. }
  3325. },
  3326. batchImportWxData(item) {
  3327. //首先判断文件类型
  3328. let str = item.file.name.split(".");
  3329. let format = str[str.length - 1];
  3330. if (format != "xls" && format != "xlsx") {
  3331. this.$message({
  3332. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3333. type: "error"
  3334. });
  3335. } else {
  3336. this.importingData = true;
  3337. let formData = new FormData();
  3338. formData.append("file", item.file);
  3339. formData.append("companyId", this.user.companyId);
  3340. formData.append("withCheckIn", 1);
  3341. this.http.uploadFile('/report/importData', formData,
  3342. res => {
  3343. this.$refs.upload.clearFiles();
  3344. this.showImportResult = true;
  3345. this.importingData = false;
  3346. if (res.code == "ok") {
  3347. //换成弹出框,以免有人等了半天回来啥也没看到
  3348. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3349. this.getReportList();
  3350. this.importWxDialog = false;
  3351. } else {
  3352. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3353. }
  3354. },
  3355. error => {
  3356. this.$refs.upload.clearFiles();
  3357. this.listLoading = false;
  3358. this.$message({
  3359. message: error,
  3360. type: "error"
  3361. });
  3362. });
  3363. }
  3364. },
  3365. batchImportData(item) {
  3366. //首先判断文件类型
  3367. let str = item.file.name.split(".");
  3368. let format = str[str.length - 1];
  3369. if (format != "xls" && format != "xlsx") {
  3370. this.$message({
  3371. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3372. type: "error"
  3373. });
  3374. } else {
  3375. this.importingData = true;
  3376. let formData = new FormData();
  3377. formData.append("file", item.file);
  3378. formData.append("companyId", this.user.companyId);
  3379. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3380. this.http.uploadFile(url, formData,
  3381. res => {
  3382. this.$refs.upload.clearFiles();
  3383. this.importingData = false;
  3384. this.showImportResult = true;
  3385. if (res.code == "ok") {
  3386. //换成弹出框,以免有人等了半天回来啥也没看到
  3387. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3388. this.getReportList();
  3389. this.importWXDialog = false;
  3390. } else {
  3391. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3392. }
  3393. },
  3394. error => {
  3395. this.$refs.upload.clearFiles();
  3396. this.importingData = false;
  3397. this.$message({
  3398. message: error,
  3399. type: "error"
  3400. });
  3401. });
  3402. }
  3403. },
  3404. userssHu() {
  3405. this.http.post('/time-type/getCompanyTimeSetting',{
  3406. companyId: this.user.companyId
  3407. },
  3408. res => {
  3409. if (res.code == "ok") {
  3410. this.yonghuUser = res.data
  3411. }
  3412. },
  3413. error => {
  3414. this.$message({
  3415. message: error,
  3416. type: "error"
  3417. });
  3418. }
  3419. );
  3420. },
  3421. iptBlur(i) {
  3422. if(this.isBatch == 0) {
  3423. return
  3424. }
  3425. var reqParam = {
  3426. startDate: this.workForm.createDate[0],
  3427. endDate: this.workForm.createDate[1]
  3428. };
  3429. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3430. reqParam.userId = this.workForm.userId[0];
  3431. }
  3432. this.http.post('/report/getWorkDays',reqParam,
  3433. res => {
  3434. if (res.code == "ok") {
  3435. this.jsDay = res.data
  3436. this.chuji(i)
  3437. } else {
  3438. this.$message({
  3439. message: res.msg,
  3440. type: "error"
  3441. });
  3442. }
  3443. },
  3444. error => {
  3445. this.$message({
  3446. message: error,
  3447. type: "error"
  3448. });
  3449. }
  3450. );
  3451. //明夷硬编码获取
  3452. if (this.user.company.companyName == this.mingyiName) {
  3453. this.getWorkTimeForMinYi();
  3454. }
  3455. },
  3456. getWorkTimeForMinYi(){
  3457. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3458. startDate: this.workForm.createDate[0],
  3459. endDate: this.workForm.createDate[1]
  3460. },
  3461. res => {
  3462. if (res.code == "ok") {
  3463. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3464. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3465. this.totalReportHours = this.workTimeForMinYi;
  3466. } else {
  3467. this.$message({
  3468. message: res.msg,
  3469. type: "error"
  3470. });
  3471. this.workForm.createDate = [];
  3472. }
  3473. },
  3474. error => {
  3475. this.$message({
  3476. message: error,
  3477. type: "error"
  3478. });
  3479. }
  3480. );
  3481. },
  3482. chuji(i) {
  3483. if(i == 0) {
  3484. this.seleChn(1)
  3485. } else if(i == 1) {
  3486. this.seleChn(0)
  3487. } else if(i == 2) {
  3488. if(this.workForm.domains[0].multiWorktime > 0) {
  3489. this.iptChangs()
  3490. } else {
  3491. this.iptChang()
  3492. }
  3493. } else if(i == 3) {
  3494. this.seleChn(0)
  3495. }
  3496. },
  3497. seleChn(e,domain) {
  3498. if(e == 1) {
  3499. for(var i in this.workForm.domains) {
  3500. if(this.workForm.domains[i].timeType == 0) {
  3501. this.workForm.domains[i].workingTime = 8
  3502. } else {
  3503. this.workForm.domains[i].workingTime = 4
  3504. }
  3505. }
  3506. }
  3507. var quanbu = 0
  3508. var spl = this.workForm.domains
  3509. var zhi = ''
  3510. for(var i in spl) {
  3511. var sp = +spl[i].workingTime + 0
  3512. zhi = this.jsDay * sp
  3513. quanbu = +quanbu + zhi
  3514. }
  3515. this.jsTime = quanbu
  3516. this.totalReportHours = quanbu
  3517. let worktime = this.jsTime
  3518. // 自动计算加班时长
  3519. if(this.isBatch != 0){
  3520. worktime = this.jsTime / this.jsDay
  3521. }
  3522. if(this.user.timeType.fillOvertime && domain){
  3523. let isover = false
  3524. let alltime = 0
  3525. let allover = 0 //此处alltime同上面的worktime
  3526. for(let d in spl){
  3527. if(spl[d].isOvertime){
  3528. isover = true
  3529. allover += spl[d].overtimeHours*1
  3530. }
  3531. alltime += spl[d].workingTime*1
  3532. }
  3533. if(domain.overtimeHours){
  3534. allover = allover - domain.overtimeHours
  3535. }
  3536. if(worktime*1 > this.user.timeType.allday){
  3537. if(isover){
  3538. if(alltime > (allover + this.user.timeType.allday)){
  3539. this.$set(domain,'isOvertime',true)
  3540. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3541. }else{
  3542. this.$set(domain,'isOvertime',false)
  3543. this.$set(domain,'overtimeHours',null)
  3544. if(alltime < (allover + this.user.timeType.allday)){
  3545. let overtime = allover + this.user.timeType.allday - alltime
  3546. for(let pi in spl){
  3547. if(spl[pi].overtimeHours){
  3548. if((overtime - spl[pi].overtimeHours*1) > 0){
  3549. overtime = overtime - spl[pi].overtimeHours*1
  3550. this.$set(spl[pi],'isOvertime',false)
  3551. this.$set(spl[pi],'overtimeHours',null)
  3552. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3553. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3554. break
  3555. }else{
  3556. this.$set(spl[pi],'isOvertime',false)
  3557. this.$set(spl[pi],'overtimeHours',null)
  3558. break
  3559. }
  3560. }
  3561. }
  3562. }
  3563. }
  3564. }else{
  3565. this.$set(domain,'isOvertime',true)
  3566. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3567. }
  3568. }else{
  3569. for(let di in spl){
  3570. this.$set(spl[di],'isOvertime',false)
  3571. this.$set(spl[di],'overtimeHours',null)
  3572. }
  3573. }
  3574. }
  3575. },
  3576. iptChang() {
  3577. var sl = this.workForm.domains
  3578. let timeArr = []
  3579. for(var i in sl) {
  3580. if(sl[i].startTime && sl[i].endTime) {
  3581. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3582. }
  3583. }
  3584. this.getTimeHours(timeArr)
  3585. // for(let j in arrNum) {
  3586. // this.timeJsonStr += arrNum[j]
  3587. // if(flg) {
  3588. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3589. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3590. // }
  3591. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3592. // flg = true
  3593. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3594. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3595. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3596. // }
  3597. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3598. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3599. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3600. // }
  3601. // }
  3602. },
  3603. iptChangs() {
  3604. var sl = this.workForm.domains
  3605. let timeArr = []
  3606. for(var i in sl) {
  3607. for(var j in sl[i].worktimeList){
  3608. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3609. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3610. }
  3611. }
  3612. }
  3613. this.getTimeHours(timeArr)
  3614. },
  3615. // 调用接口或去数据
  3616. getTimeHours(arr) {
  3617. this.http.post('/report/getHoursByTimeRange',{
  3618. timeJsonStr: JSON.stringify(arr)
  3619. },res => {
  3620. if(res.code === 'ok') {
  3621. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3622. } else {
  3623. this.$message({
  3624. message: res.msg,
  3625. type: 'error'
  3626. })
  3627. }
  3628. },err => {
  3629. this.$message({
  3630. message: err,
  3631. type: 'error'
  3632. })
  3633. })
  3634. },
  3635. // 按周填报调用接口计算时间
  3636. async getWeekHoursByTimeRange(timeRange) {
  3637. const url = '/report/getHoursByTimeRange';
  3638. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3639. var that = this;
  3640. return new Promise((resolve, reject) => {
  3641. this.http.post(url, data, function(res) {
  3642. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3643. }, function(err) {
  3644. reject(err);
  3645. });
  3646. });
  3647. },
  3648. removeTimeItem(item, index) {
  3649. item.worktimeList.splice(index, 1);
  3650. this.iptChangs()
  3651. },
  3652. //添加工时
  3653. addNewWorktime(index, item) {
  3654. if(item.worktimeList == null ) {
  3655. item.worktimeList = []
  3656. }
  3657. item.worktimeList.push({});
  3658. },
  3659. //复制项目
  3660. copyProject(index) {
  3661. var leftProgress = 10;
  3662. if (this.reportTimeType.type == 3) {
  3663. //计算已经待分配工时比例
  3664. let array = this.workForm.domains;
  3665. let totalProgress = 0;
  3666. for (var i=0;i<array.length; i++) {
  3667. totalProgress += array[i].progress;
  3668. }
  3669. if (totalProgress < 100) {
  3670. leftProgress = 100 - totalProgress;
  3671. }
  3672. }
  3673. var newIndex = index+1;
  3674. var itemDomain = {
  3675. projectId: this.workForm.domains[index].projectId,
  3676. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3677. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3678. ),
  3679. content: "",
  3680. progress:leftProgress,
  3681. state:2,//2-表示待提交
  3682. };
  3683. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3684. if (this.reportTimeType.type == 0) {
  3685. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3686. var length = this.workForm.domains.length;
  3687. if (length == 2) {
  3688. this.showAddMore = false;
  3689. }
  3690. }
  3691. this.selectProject(itemDomain, newIndex);
  3692. },
  3693. pushWorkTime(reportId){
  3694. let url=''
  3695. if(this.user.timeType.syncSap == 1){
  3696. url='/report/pushProjectReportToSap'
  3697. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3698. var pushDate = this.date + day;
  3699. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3700. confirmButtonText: '确定',
  3701. cancelButtonText: '取消',
  3702. type: 'info'
  3703. }).then(() => {
  3704. const loading = this.$loading({
  3705. lock: true,
  3706. text: '正在推送中,请耐心等待。',
  3707. spinner: 'el-icon-loading',
  3708. background: 'rgba(0, 0, 0, 0.7)'
  3709. });
  3710. this.http.post(url,{
  3711. pushDate: pushDate,
  3712. reportId: reportId
  3713. },res => {
  3714. loading.close();
  3715. if(res.code == 'ok'){
  3716. this.$message({
  3717. type: 'success',
  3718. message: res.data
  3719. });
  3720. }else{
  3721. this.$message({
  3722. type: 'error',
  3723. message: res.msg
  3724. })
  3725. }
  3726. },err => {
  3727. loading.close();
  3728. this.$message({
  3729. type: 'error',
  3730. message: err
  3731. })
  3732. })
  3733. }).catch(() => {
  3734. });
  3735. }else{
  3736. url='/report/pushReportDataToThird'
  3737. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3738. confirmButtonText: '确定',
  3739. cancelButtonText: '取消',
  3740. type: 'info'
  3741. }).then(() => {
  3742. const loading = this.$loading({
  3743. lock: true,
  3744. text: '正在推送中,请耐心等待。',
  3745. spinner: 'el-icon-loading',
  3746. background: 'rgba(0, 0, 0, 0.7)'
  3747. });
  3748. this.http.post(url,{
  3749. yearMonth: this.date
  3750. },res => {
  3751. loading.close();
  3752. if(res.code == 'ok'){
  3753. this.$message({
  3754. type: 'success',
  3755. message: '推送成功!'
  3756. });
  3757. }else{
  3758. this.$message({
  3759. type: 'error',
  3760. message: res.msg
  3761. })
  3762. }
  3763. },err => {
  3764. loading.close();
  3765. this.$message({
  3766. type: 'error',
  3767. message: err
  3768. })
  3769. })
  3770. }).catch(() => {
  3771. });
  3772. }
  3773. },
  3774. showWorkTime(){
  3775. this.monthWorkTimeDialog = true;
  3776. this.searchKeyword = ''
  3777. this.WorktimeDatepickValue = this.istoMonth()
  3778. if(this.WorktimeDatepickValue.length == 0){
  3779. let newdate = new Date();
  3780. let nowdate = newdate.toLocaleDateString();
  3781. let getauto = this.getAutoWeekDate(nowdate)
  3782. let nowwd = [getauto[0],getauto[6]]
  3783. this.WorktimeDatepickValue = nowwd
  3784. }
  3785. this.showMonthWorkTime()
  3786. },
  3787. handleClick(t,e){
  3788. if (t.name == "second") {
  3789. this.showMonthNotWorkTime()
  3790. }else if(t.name == "first"){
  3791. this.showMonthWorkTime()
  3792. }else if(t.name == "third"){
  3793. this.showMonthWorkTimeReminder()
  3794. }
  3795. },
  3796. //导出员工每日填报工时数
  3797. exportMembWorkHours() {
  3798. this.http.post(
  3799. "/report/exportUserDailyWorkTime",
  3800. {
  3801. // month: this.date,
  3802. startDate: this.WorktimeDatepickValue[0],
  3803. endDate: this.WorktimeDatepickValue[1],
  3804. },
  3805. (res) => {
  3806. if (res.code == "ok") {
  3807. let url = res.data;
  3808. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3809. }
  3810. },
  3811. (error) => {
  3812. this.$message({
  3813. message: error,
  3814. type: "error",
  3815. });
  3816. }
  3817. );
  3818. },
  3819. exportMembWorkHoursReminder() {
  3820. this.http.post(
  3821. "/report/exportUserDailyWorkTimeReminder",
  3822. {
  3823. // month: this.date,
  3824. startDate: this.WorktimeDatepickValue[0],
  3825. endDate: this.WorktimeDatepickValue[1],
  3826. },
  3827. (res) => {
  3828. if (res.code == "ok") {
  3829. let url = res.data;
  3830. this.downloadByA('工时异常表.xlsx', url);
  3831. }
  3832. },
  3833. (error) => {
  3834. this.$message({
  3835. message: error,
  3836. type: "error",
  3837. });
  3838. }
  3839. );
  3840. },
  3841. exportMembNotWorkHours() {
  3842. this.http.post(
  3843. "/report/exportNoReportUserList",
  3844. {
  3845. // month: this.date,
  3846. startDate: this.WorktimeDatepickValue[0],
  3847. endDate: this.WorktimeDatepickValue[1],
  3848. },
  3849. (res) => {
  3850. if (res.code == "ok") {
  3851. let url = res.data;
  3852. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3853. }
  3854. },
  3855. (error) => {
  3856. this.$message({
  3857. message: error,
  3858. type: "error",
  3859. });
  3860. }
  3861. );
  3862. },
  3863. downloadByA(name, url) {
  3864. const a = document.createElement("a"); // 创建a标签
  3865. a.setAttribute("download", name); // download属性
  3866. a.setAttribute("href", url); // href链接
  3867. a.click(); // 自执行点击事件
  3868. a.remove();
  3869. },
  3870. // 是否本月判断
  3871. istoMonth(){
  3872. let todate = new Date()
  3873. let tomonth = todate.getMonth() + 1
  3874. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3875. if(this.date == adate){
  3876. return []
  3877. }else{
  3878. let sedate = new Date(this.date)
  3879. let semonth = sedate.getMonth() + 1
  3880. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3881. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3882. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3883. return [sedates1, sedates2]
  3884. }
  3885. },
  3886. showMonthWorkTime() {
  3887. this.monthTotalPage = 0,
  3888. this.tbload = true
  3889. let parameter={
  3890. startDate: this.WorktimeDatepickValue[0],
  3891. endDate: this.WorktimeDatepickValue[1],
  3892. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3893. }
  3894. this.http.post(
  3895. "/report/getUserDailyWorkTime",
  3896. // "/report/getNoReportUserList",
  3897. parameter,
  3898. (res) => {
  3899. if (res.code == "ok") {
  3900. this.tbload = false;
  3901. this.pickDateArray = res.data.days.map(item => {
  3902. return {
  3903. ...item,
  3904. dateStr: item.label.split('/')[0],
  3905. weekStr: item.label.split('/')[1]
  3906. }
  3907. });
  3908. // console.log('dataarray',res.data.days);
  3909. this.monthWorkData = res.data.list;
  3910. // this.monthWorkDataS = this.monthWorkData
  3911. // this.monthWorkDataS1 = res.data.list
  3912. this.monthTotal = res.data.list.length
  3913. if (this.monthWorkData.length > 50) {
  3914. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3915. }else{
  3916. this.monthWorkDataS = this.monthWorkData
  3917. }
  3918. this.searchScreen(0)
  3919. // this.monthWorkDataS = infoList
  3920. // 判断
  3921. // if (this.monthWorkDataS1.length > 0) {
  3922. // setTimeout(() => {
  3923. // this.tableListener()
  3924. // }, 1000);
  3925. // }
  3926. this.$nextTick(function(){
  3927. this.$refs.hasworkTbl.doLayout();
  3928. });
  3929. // this.$forceUpdate()
  3930. }
  3931. },
  3932. (error) => {
  3933. this.tbload = false
  3934. this.$message({
  3935. message: error,
  3936. type: "error",
  3937. });
  3938. }
  3939. );
  3940. },
  3941. showMonthWorkTimeReminder() {
  3942. this.monthTotalPage = 0,
  3943. this.tbload = true
  3944. let parameter={}
  3945. parameter={
  3946. startDate: this.WorktimeDatepickValue[0],
  3947. endDate: this.WorktimeDatepickValue[1],
  3948. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3949. viewValue:this.isReminder?1:0
  3950. }
  3951. this.http.post(
  3952. "/report/getUserDailyWorkTimeReminder",
  3953. parameter,
  3954. (res) => {
  3955. if (res.code == "ok") {
  3956. this.tbload = false;
  3957. this.monthWorkData = res.data.list;
  3958. this.monthTotal = res.data.list.length
  3959. if (this.monthWorkData.length > 50) {
  3960. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3961. }else{
  3962. this.monthWorkDataS = this.monthWorkData
  3963. }
  3964. this.searchScreen(0)
  3965. this.$nextTick(function(){
  3966. this.$refs.hasworkTbl.doLayout();
  3967. });
  3968. }
  3969. },
  3970. (error) => {
  3971. this.tbload = false
  3972. this.$message({
  3973. message: error,
  3974. type: "error",
  3975. });
  3976. }
  3977. );
  3978. },
  3979. // tableListener(){
  3980. // let that = this;
  3981. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3982. // // 添加scroll监听事件
  3983. // dom.addEventListener("scroll", function () {
  3984. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3985. // if (scrollDistance < 2) {
  3986. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3987. // that.monthTotalPage++; //当前页数自增
  3988. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3989. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3990. // var infoList = arrList.splice(
  3991. // that.monthTotalPage * that.monthTotalLages,
  3992. // that.monthTotalLages
  3993. // );
  3994. // // 数据添加
  3995. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3996. // }
  3997. // }
  3998. // })
  3999. // },
  4000. showMonthNotWorkTime() {
  4001. this.monthTotalPage = 0,
  4002. this.tbload = true,
  4003. this.http.post(
  4004. "/report/getNoReportUserList",
  4005. {
  4006. startDate: this.WorktimeDatepickValue[0],
  4007. endDate: this.WorktimeDatepickValue[1],
  4008. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4009. },
  4010. (res) => {
  4011. if (res.code == "ok") {
  4012. this.tbload = false
  4013. this.monthNotWorkDate = res.data;
  4014. // this.monthNotWorkDateS1 = res.data
  4015. this.monthnotTotal = res.data.length
  4016. // 2222111
  4017. if (this.monthNotWorkDate.length > 50) {
  4018. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4019. } else {
  4020. this.monthNotWorkDateS = this.monthNotWorkDate
  4021. }
  4022. this.searchScreen(1)
  4023. // 判断
  4024. // if (this.monthnotworkDateS1.length > 0) {
  4025. // setTimeout(() => {
  4026. // this.tableListenernot()
  4027. // }, 1000);
  4028. // }
  4029. this.$nextTick(function(){
  4030. this.$refs.hasworkTbl2.doLayout();
  4031. });
  4032. }
  4033. },
  4034. (error) => {
  4035. this.tbload = false
  4036. this.$message({
  4037. message: error,
  4038. type: "error",
  4039. });
  4040. }
  4041. );
  4042. },
  4043. // tableListenernot(){
  4044. // let that = this;
  4045. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4046. // dom.addEventListener("scroll", function () {
  4047. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4048. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4049. // if (scrollDistance2 < 2) {
  4050. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4051. // that.monthnotTotalPage++; //当前页数自增
  4052. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4053. // var infoList = arrList.splice(
  4054. // that.monthnotTotalPage * that.monthnotTotalLages,
  4055. // that.monthnotTotalLages
  4056. // );
  4057. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4058. // }
  4059. // }
  4060. // })
  4061. // },
  4062. listScroll(){
  4063. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4064. this.isMore = true
  4065. setTimeout(()=>{
  4066. this.isMore = false
  4067. },1000)
  4068. }else {
  4069. this.isFlag = true
  4070. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4071. this.monthWorkDataS = datalist
  4072. setTimeout(()=>{
  4073. this.isFlag = false
  4074. },300)
  4075. }
  4076. },
  4077. notListScroll(){
  4078. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4079. this.isMore = true
  4080. setTimeout(()=>{
  4081. this.isMore = false
  4082. },1000)
  4083. }else {
  4084. this.isFlag = true
  4085. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4086. this.monthNotWorkDateS = datalist
  4087. // console.log('length',this.monthNotWorkDateS.length)
  4088. setTimeout(()=>{
  4089. this.isFlag = false
  4090. },300)
  4091. }
  4092. },
  4093. getFirstAndLastDay() {
  4094. // 将选定的月份转换为Date对象
  4095. var monthDate = new Date();
  4096. var year = monthDate.getFullYear();
  4097. var month = monthDate.getMonth();
  4098. // 计算起始日和结束日
  4099. var startDay = new Date(year, month, 1);
  4100. var endDay = new Date(year, month + 1, 0);
  4101. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4102. this.WorktimeDatepickValueForMonth=lastmd
  4103. },
  4104. formatDate(date) {
  4105. var year = date.getFullYear();
  4106. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4107. var day = ("0" + date.getDate()).slice(-2);
  4108. return year + "-" + month + "-" + day;
  4109. },
  4110. // 获取默认这zhou日期参数 222
  4111. getLastWeek(e){
  4112. let newdate = new Date()
  4113. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4114. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4115. if(e==1){
  4116. this.WorktimeDatepickValue = lastwd
  4117. this.showMonthWorkTime()
  4118. }else if(e==2){
  4119. this.WorktimeDatepickValue = lastwd
  4120. this.showMonthWorkTimeReminder()
  4121. }else{
  4122. this.WorktimeDatepickValue = lastwd
  4123. this.showMonthNotWorkTime()
  4124. }
  4125. },
  4126. getThisWeek(e){
  4127. let newdate = new Date();
  4128. let nowdate = newdate.toLocaleDateString();
  4129. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4130. if(e==1){
  4131. this.WorktimeDatepickValue = nowwd
  4132. this.showMonthWorkTime()
  4133. }else if(e==2){
  4134. this.WorktimeDatepickValue = nowwd
  4135. this.showMonthWorkTimeReminder()
  4136. }else{
  4137. this.WorktimeDatepickValue = nowwd
  4138. this.showMonthNotWorkTime()
  4139. }
  4140. },
  4141. getDoubleLastWeek(e){
  4142. let newdate = new Date()
  4143. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4144. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4145. if(e==1){
  4146. this.WorktimeDatepickValue = nextwd
  4147. this.showMonthWorkTime()
  4148. }else if(e==2){
  4149. this.WorktimeDatepickValue = nextwd
  4150. this.showMonthWorkTimeReminder()
  4151. }else{
  4152. this.WorktimeDatepickValue = nextwd
  4153. this.showMonthNotWorkTime()
  4154. }
  4155. },
  4156. alreadyAllDate(stime,etime){
  4157. let diffdate = new Array();
  4158. let i=0;
  4159. while(stime<=etime){
  4160. let dateArray = stime.split("-");
  4161. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4162. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4163. let stimewk = this.weekDay[date.getDay()]
  4164. 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')
  4165. 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])
  4166. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4167. let stime_ts = new Date(stime).getTime();
  4168. let next_date = stime_ts + (24*60*60*1000);
  4169. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4170. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4171. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4172. stime = next_dates_y+next_dates_m+next_dates_d;
  4173. i++;
  4174. }
  4175. return diffdate
  4176. },
  4177. getAutoWeekDate(e) {
  4178. let dateString = e;
  4179. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4180. if (dateString.match(dateStringReg)) {
  4181. let presentDate = new Date(dateString),
  4182. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4183. return Array.from(new Array(7), function (val, index) {
  4184. let formatDate = new Date(
  4185. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4186. );
  4187. return (
  4188. formatDate.getFullYear() +
  4189. "-" +
  4190. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4191. "-" +
  4192. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4193. );
  4194. });
  4195. } else {
  4196. throw new Error(
  4197. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4198. );
  4199. }
  4200. },
  4201. onProgressChange() {
  4202. this.$forceUpdate();
  4203. },
  4204. showChooseMembTree() {
  4205. this.chosenMembCount = this.participator.length;
  4206. this.chooseParticipVisible = true;
  4207. },
  4208. onTreeItemChange() {
  4209. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4210. var list = chosenList.filter(item=>item.isUser == 1);
  4211. this.chosenMembCount = list.length;
  4212. },
  4213. findUserInTree() {
  4214. if (this.filterName == '') {
  4215. this.deptMembData = this.allMembData;
  4216. } else {
  4217. var list = this.findRecursively(this.filterName, this.allMembData);
  4218. this.deptMembData = list;
  4219. }
  4220. },
  4221. findRecursively(username, list) {
  4222. var filterList = [];
  4223. for (var i=0;i<list.length; i++) {
  4224. if (list[i].isUser == 1) {
  4225. if (list[i].label.indexOf(username) >= 0) {
  4226. //匹配上了
  4227. filterList.push(list[i]);
  4228. }
  4229. } else if (list[i].children != null && list[i].children.length > 0) {
  4230. var subList = this.findRecursively(username, list[i].children);
  4231. if (subList.length > 0) {
  4232. subList.forEach(s=>filterList.push(s));
  4233. }
  4234. }
  4235. }
  4236. return filterList;
  4237. },
  4238. //确定选择参与人
  4239. chooseParticip() {
  4240. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4241. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4242. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4243. if (this.user.company.packageProject == 1) {
  4244. if (this.chosenMembList.length > 1) {
  4245. this.$message({
  4246. message: '每次仅支持代填一个人',
  4247. type: "error",
  4248. });
  4249. return;
  4250. }
  4251. }
  4252. this.chooseParticipVisible = false;
  4253. this.workForm.userNames = '';
  4254. this.workForm.userId = [];
  4255. this.participator = [];
  4256. for (var i=0;i<this.chosenMembList.length; i++) {
  4257. this.workForm.userId.push(this.chosenMembList[i].id);
  4258. this.workForm.userNames += this.chosenMembList[i].label+',';
  4259. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4260. this.participator.push(item);
  4261. }
  4262. if (this.workForm.userNames.length > 0) {
  4263. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4264. }
  4265. if(this.user.userNameNeedTranslate == 1) {
  4266. if(this.workForm.userNames) {
  4267. this.workForm.userNames = this.workForm.userNames.split(',')
  4268. }
  4269. }
  4270. },
  4271. notifySel(sel){
  4272. // console.log(sel);
  4273. this.notifySelList = sel
  4274. },
  4275. //微信通知人员填写
  4276. Notify(code) {
  4277. if (this.notifySelList.length == 0) return;
  4278. var ids = '';
  4279. this.notifySelList.forEach(f=>{
  4280. ids += f.id+',';
  4281. })
  4282. this.http.post('/user/pushFillReport',{
  4283. ids: ids, date: this.curDate,
  4284. code: code
  4285. },
  4286. res => {
  4287. if (res.code == "ok") {
  4288. this.$message({
  4289. message: this.$t('message.sentSuccessfully'),
  4290. type: "success"
  4291. });
  4292. }
  4293. },
  4294. error => {
  4295. this.$message({
  4296. message: error,
  4297. type: "error"
  4298. });
  4299. }
  4300. );
  4301. },
  4302. //导出人员列表
  4303. exportMemb() {
  4304. if (this.fillMembList.length == 0) return;
  4305. var ids = '';
  4306. this.fillMembList.forEach(f=>{
  4307. ids += f.id+',';
  4308. })
  4309. this.http.post('/user/exportMembList',{
  4310. ids: ids,isFill: this.isFill, date: this.curDate
  4311. },
  4312. res => {
  4313. if (res.code == "ok") {
  4314. var aTag = document.createElement('a');
  4315. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4316. aTag.href = res.data;
  4317. aTag.click();
  4318. }
  4319. },
  4320. error => {
  4321. this.$message({
  4322. message: error,
  4323. type: "error"
  4324. });
  4325. }
  4326. );
  4327. },
  4328. showMembList(fill) {
  4329. this.membListVisible = true;
  4330. if (fill == 0) {
  4331. this.fillMembList = this.unFillList;
  4332. this.isFill = false;
  4333. let leaveList = []
  4334. let unleaveList = []
  4335. for(let i in this.fillMembList){
  4336. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4337. leaveList.push(this.fillMembList[i])
  4338. }else{
  4339. unleaveList.push(this.fillMembList[i])
  4340. }
  4341. }
  4342. this.fillMembList = unleaveList
  4343. this.fillMembList_leave = leaveList
  4344. } else if(fill == 1){
  4345. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4346. this.isFill = true;
  4347. }else{
  4348. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4349. this.isFill = true;
  4350. }
  4351. },
  4352. //获取自己填写的日报状态
  4353. getReportFillStatus() {
  4354. this.http.post('/report/getReportFillStatus',{
  4355. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4356. },
  4357. res => {
  4358. if (res.code == "ok") {
  4359. this.fillStatusList = res.data;
  4360. this.allDate.forEach(d=>{
  4361. var fillInfo = null;
  4362. d.state = null;
  4363. this.fillStatusList.forEach(s=>{
  4364. var d1 = s.createDate.split('-')[2];
  4365. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4366. if (d1.indexOf('0') == 0) {
  4367. d1 = d1.substring(1,d1.length);
  4368. }
  4369. if (d1 == d2) {
  4370. d.state = s.state;
  4371. d.exceedCardTime = s.exceedCardTime
  4372. }
  4373. })
  4374. })
  4375. this.$forceUpdate();
  4376. }
  4377. },
  4378. error => {
  4379. this.$message({
  4380. message: error,
  4381. type: "error"
  4382. });
  4383. }
  4384. );
  4385. },
  4386. scrollFunction () {
  4387. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4388. if (this.domObj.attachEvent) { // IE
  4389. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4390. } else if (this.domObj.addEventListener) {
  4391. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4392. }
  4393. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4394. },
  4395. mouseScroll(event) { // google 浏览器下
  4396. let detail = event.wheelDelta || event.detail
  4397. let moveForwardStep = -1
  4398. let moveBackStep = 1
  4399. let step = 0
  4400. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4401. event.preventDefault() // 阻止浏览器默认事件
  4402. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4403. },
  4404. // //左右滚动
  4405. // wheel(e){
  4406. // var a = document.getElementById("dateScroll");
  4407. // var scroll_width = 80; //滚动一下的距离
  4408. // var e = e || window.event, v;
  4409. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4410. // if(v>3||-v>3) v=-v;
  4411. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4412. // e.preventDefault(); //阻止浏览器的默认滚动
  4413. // },
  4414. showExportDialog() {
  4415. this.exportType = 0
  4416. this.exportDialog = true;
  4417. },
  4418. showExportTimeDialog() {
  4419. this.exportTimeDialog = true;
  4420. },
  4421. changeAllTime() {
  4422. //总时长发生改变,自动按比例计算
  4423. this.workForm.domains.forEach(d=>{
  4424. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4425. });
  4426. //计算jsTime
  4427. if (this.workForm.createDate) {
  4428. let sdate = new Date(this.workForm.createDate[0]);
  4429. let edate = new Date(this.workForm.createDate[1]);
  4430. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4431. console.log('days===', days)
  4432. if (days < 0) {
  4433. days = 0;
  4434. }
  4435. this.jsTime = this.reportTimeType.allday * days;
  4436. }
  4437. },
  4438. // 是否加班的单机事件
  4439. check() {
  4440. this.selected = !this.selected
  4441. this.isNew = this.selected
  4442. },
  4443. updateSubProject() {
  4444. this.$forceUpdate();
  4445. },
  4446. selectDegreeId(domain, index) {
  4447. this.http.post('/report/defaultDegree',{
  4448. projectId: domain.projectId
  4449. },
  4450. res => {
  4451. if (res.code == "ok") {
  4452. if(res.data) {
  4453. this.workForm.domains[index].degreeId = res.data.id + ''
  4454. this.$forceUpdate();
  4455. }
  4456. }
  4457. },
  4458. error => {
  4459. this.$message({
  4460. message: error,
  4461. type: "error"
  4462. });
  4463. }
  4464. );
  4465. },
  4466. //项目选中了, 加载子项目
  4467. selectProject(domain, index) {
  4468. if(!domain.projectId){
  4469. return;
  4470. }
  4471. // 默认选中上次填写的自定义维度
  4472. if(this.yonghuUser.customDegreeActive == 1) {
  4473. this.selectDegreeId(domain, index)
  4474. }
  4475. // console.log('projectId===',domain.projectId);
  4476. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4477. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4478. this.http.post('/sub-project/list',{
  4479. projectId: domain.projectId,
  4480. isReport: true
  4481. },
  4482. res => {
  4483. //清空之前选中的子项目
  4484. // this.workForm.domains[index].subProjectId = 0;
  4485. if (res.code == "ok") {
  4486. this.workForm.domains[index].subProjectList = res.data;
  4487. this.workForm.domains[index].subProjectId = null;
  4488. this.$forceUpdate();
  4489. }
  4490. },
  4491. error => {
  4492. this.$message({
  4493. message: error,
  4494. type: "error"
  4495. });
  4496. }
  4497. );
  4498. //项目相关的近期任务
  4499. if (this.user.company.packageProject == 1) {
  4500. this.getRecentTaskList(domain, index);
  4501. //获取项目相关专业
  4502. if (this.user.company.packageEngineering == 1) {
  4503. this.getProjectProfessions(domain, index);
  4504. }
  4505. //获取项目下的任务分组
  4506. this.getTaskGroups(domain, index);
  4507. }
  4508. // 获取项目相关的维度
  4509. // domain.degreeId = null
  4510. this.$set(domain,'degreeId',null)
  4511. this.$set(domain,'multiDegrIdArray',null)
  4512. this.dimension(domain, index);
  4513. //获取项目审核人
  4514. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4515. this.getProjectAuditorList(domain, index);
  4516. } else {
  4517. //按分组的负责人来审核
  4518. domain.projectAuditorId = null;
  4519. domain.projectAuditorName = null;
  4520. domain.auditUserList = null;
  4521. }
  4522. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4523. if (this.reportTimeType.type == 3) {
  4524. //新增项目时,自动计算
  4525. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4526. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4527. }
  4528. //加载昱众的工作职责
  4529. if (this.user.companyId == this.yuzhongCompId) {
  4530. this.updateResponse(domain);
  4531. }
  4532. },
  4533. getRecentTaskList(domain, index) {
  4534. //刷新任务时,清空服务
  4535. this.$set(domain, 'sapServiceId', null);
  4536. this.$set(domain, 'taskId', null);
  4537. var param = {
  4538. projectId: domain.projectId,
  4539. isSubstitude:this.isSubstitude?1:0,
  4540. };
  4541. if (domain.groupId) {
  4542. param.groupId = domain.groupId;
  4543. }
  4544. if (domain.stage) {
  4545. param.stage = domain.stage;
  4546. }
  4547. //专业版代填,获取代填员工的任务
  4548. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4549. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4550. this.$message({
  4551. message: '请选择代填的员工',
  4552. type: "error"
  4553. });
  4554. return;
  4555. } else {
  4556. param.userId = this.workForm.userId[0];
  4557. }
  4558. }
  4559. this.http.post('/task/getRecentTask',param,
  4560. res => {
  4561. if (res.code == "ok") {
  4562. this.workForm.domains[index].allTaskList = res.data;
  4563. this.workForm.domains[index].taskList = res.data;
  4564. this.$forceUpdate();
  4565. }
  4566. },
  4567. error => {
  4568. this.$message({
  4569. message: error,
  4570. type: "error"
  4571. });
  4572. }
  4573. );
  4574. },
  4575. //获取项目审核人
  4576. getProjectAuditorList(domainItem, index) {
  4577. if(domainItem.projectId == '') {
  4578. return
  4579. }
  4580. domainItem.projectAuditorId = null;
  4581. domainItem.projectAuditorName = null;
  4582. this.http.post('/project-auditor/getList',{
  4583. projectId: domainItem.projectId,
  4584. },
  4585. res => {
  4586. if (res.code == "ok") {
  4587. domainItem.auditUserList = res.data;
  4588. if (res.data.length==0) {
  4589. this.$message({
  4590. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4591. type: "error"
  4592. });
  4593. } else if (res.data.length==1) {
  4594. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4595. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4596. }
  4597. this.$forceUpdate();
  4598. }
  4599. },
  4600. error => {
  4601. this.$message({
  4602. message: error,
  4603. type: "error"
  4604. });
  4605. }
  4606. );
  4607. },
  4608. // 获取维度数据
  4609. dimension(domain, index) {
  4610. if(domain.projectId == '') {
  4611. return
  4612. }
  4613. this.http.post('/project/getDegreeList',{
  4614. projectId: domain.projectId,
  4615. },
  4616. res => {
  4617. if (res.code == "ok") {
  4618. // console.log("维度数据",res.data);
  4619. this.workForm.domains[index].wuduList = res.data
  4620. // this.workForm = this.workForm
  4621. this.$forceUpdate()
  4622. }
  4623. },
  4624. error => {
  4625. this.$message({
  4626. message: error,
  4627. type: "error"
  4628. });
  4629. }
  4630. );
  4631. },
  4632. //切换任务阶段
  4633. changeStages(domain, index) {
  4634. if (domain.stage == null || domain.stage == '') {
  4635. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4636. } else {
  4637. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4638. }
  4639. this.getRecentTaskList(domain, index);
  4640. this.$forceUpdate();
  4641. },
  4642. getGroupStages(domain, index, keepStage) {
  4643. // console.log(domain);
  4644. if(!domain.groupId){
  4645. domain.projectAuditorId = ''
  4646. domain.stages = []
  4647. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4648. domain.taskId = ''
  4649. domain.sapServiceId = ''
  4650. }
  4651. if(this.user.timeType.reportAuditType >= 1){
  4652. domain.auditUserList = []
  4653. }
  4654. this.$forceUpdate();
  4655. return
  4656. }
  4657. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4658. res => {
  4659. if (res.code == "ok") {
  4660. if (!keepStage) {
  4661. domain.stage = '';
  4662. }
  4663. domain.stages = res.data;
  4664. this.getRecentTaskList(domain, index);
  4665. this.$forceUpdate();
  4666. }
  4667. },
  4668. error => {
  4669. this.$message({
  4670. message: error,
  4671. type: "error"
  4672. });
  4673. });
  4674. //检查当前的项目是否需要获取分组的负责人
  4675. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4676. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4677. res => {
  4678. if (res.code == "ok") {
  4679. domain.getProjectAuditorList = res.data;
  4680. domain.auditUserList = res.data;
  4681. if (res.data.length==1) {
  4682. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4683. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4684. } else if (res.data.length==0) {
  4685. domain.projectAuditorId = null;
  4686. domain.projectAuditorName = null;
  4687. }
  4688. this.$forceUpdate();
  4689. }
  4690. },
  4691. error => {
  4692. this.$message({
  4693. message: error,
  4694. type: "error"
  4695. });
  4696. });
  4697. }
  4698. },
  4699. getProjectProfessions(domain, index) {
  4700. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4701. res => {
  4702. if (res.code == "ok") {
  4703. this.workForm.domains[index].professionProgress = res.data;
  4704. this.$forceUpdate();
  4705. }
  4706. },
  4707. error => {
  4708. this.$message({
  4709. message: error,
  4710. type: "error"
  4711. });
  4712. });
  4713. },
  4714. //删除自己的日报
  4715. deleteReport() {
  4716. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4717. confirmButtonText: this.$t('btn.determine'),
  4718. cancelButtonText: this.$t('btn.cancel'),
  4719. type: "warning"
  4720. })
  4721. .then(() => {
  4722. this.listLoading = true;
  4723. this.http.post('/report/delete',{
  4724. userId: this.user.id,
  4725. date: this.workForm.createDate
  4726. },
  4727. res => {
  4728. this.listLoading = false;
  4729. if (res.code == "ok") {
  4730. this.$message({
  4731. message: this.$t('message.successfullyDeleted'),
  4732. type: "success"
  4733. });
  4734. this.getReportList();
  4735. this.getDepartment();
  4736. this.dialogVisible = false;
  4737. } else {
  4738. this.$message({
  4739. message: res.msg,
  4740. type: "error"
  4741. });
  4742. }
  4743. },
  4744. error => {
  4745. this.listLoading = false;
  4746. this.$message({
  4747. message: error,
  4748. type: "error"
  4749. });
  4750. }
  4751. );
  4752. })
  4753. .catch(() => {});
  4754. },
  4755. // 管理员删除日报
  4756. guanli(item) {
  4757. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4758. let param = {date: this.date + day, userId: item.id};
  4759. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4760. confirmButtonText: this.$t('btn.determine'),
  4761. cancelButtonText: this.$t('btn.cancel'),
  4762. type: "warning"
  4763. })
  4764. .then(() => {
  4765. this.listLoading = true;
  4766. this.http.post('/report/delete',param,
  4767. res => {
  4768. this.listLoading = false;
  4769. if (res.code == "ok") {
  4770. this.$message({
  4771. message: this.$t('message.successfullyDeleted'),
  4772. type: "success"
  4773. });
  4774. this.getReportList();
  4775. this.getDepartment();
  4776. this.dialogVisible = false;
  4777. } else {
  4778. this.$message({
  4779. message: res.msg,
  4780. type: "error"
  4781. });
  4782. }
  4783. },
  4784. error => {
  4785. this.listLoading = false;
  4786. this.$message({
  4787. message: error,
  4788. type: "error"
  4789. });
  4790. }
  4791. );
  4792. })
  4793. .catch(() => {});
  4794. },
  4795. selectAll() {
  4796. if (this.isAllSelect) {
  4797. var keys = [];
  4798. this.reportNames.forEach(b=>{
  4799. keys.push(b.id);
  4800. })
  4801. this.$refs.approveTree.setCheckedKeys(keys);
  4802. } else {
  4803. this.$refs.approveTree.setCheckedKeys([]);
  4804. }
  4805. },
  4806. removeEmptyNode(list) {
  4807. for (var i=0;i<list.length;i++) {
  4808. var cnt = 0;
  4809. if (list[i].membCount == 0) {
  4810. list.splice(i, 1);
  4811. i--;
  4812. } else if (list[i].children != null) {
  4813. this.removeEmptyNode(list[i].children);
  4814. }
  4815. }
  4816. },
  4817. calculateMembCount(list) {
  4818. for (var i in list) {
  4819. var cnt = 0;
  4820. if (list[i].children != null) {
  4821. this.calculateMembCount(list[i].children);
  4822. for (var m in list[i].children) {
  4823. cnt += list[i].children[m].membCount;
  4824. }
  4825. }
  4826. if (list[i].isUser == 1) {
  4827. cnt++;
  4828. this.membCount++;
  4829. }
  4830. list[i].membCount = cnt;
  4831. }
  4832. },
  4833. stateChange() {
  4834. // console.log(this.allData,'alldate');
  4835. this.membCount = 0;
  4836. if (this.selectState == -1) {
  4837. //全部状态
  4838. this.data = this.allData;
  4839. } else {
  4840. //未填报
  4841. this.seluserText = ''
  4842. var newData = JSON.parse(JSON.stringify(this.allData));
  4843. this.filterState(this.selectState, newData);
  4844. this.data = newData;
  4845. }
  4846. this.calculateMembCount(this.data);
  4847. this.data[0].membCount = this.membCount;//总人数
  4848. },
  4849. //按状态过滤部门人员
  4850. filterState(state, list) {
  4851. for (var i =0;i<list.length; i++) {
  4852. var obj = list[i];
  4853. if (obj.isUser == 1) {
  4854. var match = false;
  4855. if (state == -2) {
  4856. if (obj.state == null) {
  4857. match = true;
  4858. }
  4859. } else {
  4860. if (obj.state == state) {
  4861. match = true;
  4862. }
  4863. }
  4864. if (!match) {
  4865. list.splice(i, 1);
  4866. i--;
  4867. } else {
  4868. }
  4869. } else {
  4870. if (obj.children != null) {
  4871. this.filterState(state, obj.children);
  4872. }
  4873. }
  4874. }
  4875. },
  4876. //a按名称过滤部门人员
  4877. async seluserforText(){
  4878. const { userNameNeedTranslate } = this.user
  4879. this.membCount = 0;
  4880. var newData = JSON.parse(JSON.stringify(this.allData));
  4881. let textList = [this.seluserText]
  4882. if(userNameNeedTranslate == 1) {
  4883. this.dataLoading = true
  4884. let res = await this.postData('/user/getEmployeeList', {
  4885. keyword: this.seluserText,
  4886. cursor: '',
  4887. departmentId: -1,
  4888. pageIndex: 1,
  4889. pageSize: 1000
  4890. })
  4891. textList = res.data.records.map(item => item.name)
  4892. this.dataLoading = false
  4893. }
  4894. // return
  4895. console.log(textList, '<=== textList')
  4896. this.seluserforTextin(this.seluserText, newData, textList)
  4897. console.log(newData, 'Data')
  4898. this.data = newData;
  4899. this.calculateMembCount(this.data);
  4900. this.data[0].membCount = this.membCount;//总人数
  4901. },
  4902. seluserforTextin(text, list, textList = []){
  4903. for (var i =0;i<list.length; i++) {
  4904. var obj = list[i];
  4905. if (obj.isUser == 1) {
  4906. var match = false;
  4907. // if (obj.label.indexOf(text) != -1) {
  4908. // match = true
  4909. // }
  4910. if(textList.some(item => item.includes(obj.label))) {
  4911. match = true
  4912. }
  4913. if (!match) {
  4914. list.splice(i, 1);
  4915. i--;
  4916. } else {
  4917. }
  4918. } else {
  4919. if (obj.children != null) {
  4920. this.seluserforTextin(text, obj.children, textList);
  4921. }
  4922. }
  4923. }
  4924. },
  4925. // 当节点发生变化时
  4926. nodeChangeExpand(data) {
  4927. // 保存当前展开的节点
  4928. let flag = false
  4929. this.nodeModelData.some(item => {
  4930. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4931. flag = true
  4932. return true
  4933. }
  4934. })
  4935. if (!flag) { // 不存在则存到数组里
  4936. this.nodeModelData.push(data.id)
  4937. }
  4938. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4939. },
  4940. nodeChangeCollapse(data) {
  4941. console.log(this.nodeModelData)
  4942. this.nodeModelData.some((item, i) => {
  4943. if (item === data.id) {
  4944. this.nodeModelData.length = i
  4945. }
  4946. })
  4947. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4948. },
  4949. // 部门列表点击
  4950. handleNodeClick(data) {
  4951. // this.dealList = data
  4952. this.theValues(data.id, this.allData)
  4953. // this.depData = data;
  4954. var list = [];
  4955. if (data.id == -1) {
  4956. this.deptId = null;
  4957. this.targetUid = null;
  4958. list = this.data;
  4959. } else if (data.isUser == 1) {
  4960. this.deptId = null;
  4961. this.targetUid = data.id;
  4962. } else {
  4963. this.deptId = data.id;
  4964. this.targetUid = null;
  4965. list.push(data);
  4966. }
  4967. this.getReportList();
  4968. if (list.length > 0) {
  4969. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4970. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4971. }
  4972. },
  4973. exportPushLog(){
  4974. this.http.post('/sap-sync-log/export',{},
  4975. res => {
  4976. if (res.code == "ok") {
  4977. var filePath = res.data;
  4978. var fName = '推送日志.xlsx'
  4979. const a = document.createElement('a'); // 创建a标签
  4980. a.setAttribute('download', fName);// download属性
  4981. a.setAttribute('href', filePath);// href链接
  4982. a.click(); //自执行点击事件
  4983. a.remove();
  4984. } else {
  4985. this.$message({
  4986. message: res.msg,
  4987. type: "error"
  4988. });
  4989. }
  4990. },
  4991. error => {
  4992. this.$message({
  4993. message: error,
  4994. type: "error"
  4995. });
  4996. });
  4997. },
  4998. theValues(id, item) {
  4999. for(var i in item) {
  5000. if(item[i].id == id) {
  5001. this.depData = item[i]
  5002. if(id == '-1') {
  5003. this.translation = '1'
  5004. } else {
  5005. if(item[i].children) {
  5006. this.translation = '2'
  5007. } else {
  5008. this.translation = '3'
  5009. }
  5010. }
  5011. return
  5012. } else {
  5013. if(item[i].children) {
  5014. this.theValues(id, item[i].children)
  5015. }
  5016. }
  5017. }
  5018. },
  5019. //获取可以选择的代填的人员列表
  5020. getSubstitudeUserDeptList() {
  5021. if (this.deptMembData.length == 0) {
  5022. this.http.post("/department/listMyMembs", {},
  5023. res => {
  5024. if (res.code == "ok") {
  5025. let noAllData = JSON.parse(JSON.stringify(res.data));
  5026. if (noAllData.length > 0) {
  5027. // if (noAllData[0].label == '全部人员') {
  5028. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5029. noAllData.splice(0,1);
  5030. }
  5031. }
  5032. this.setUserToDept(noAllData);
  5033. this.deptMembData = noAllData;
  5034. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5035. console.log(this.deptMembData, '代填人员数据')
  5036. } else {
  5037. this.$message({
  5038. message: res.msg,
  5039. type: "error"
  5040. });
  5041. }
  5042. },
  5043. error => {
  5044. this.$message({
  5045. message: error,
  5046. type: "error"
  5047. });
  5048. });
  5049. }
  5050. },
  5051. // 获取部门列表
  5052. getDepartmentForApprove() {
  5053. this.http.post( this.port.manage.depList, {},
  5054. res => {
  5055. if (res.code == "ok") {
  5056. var list1 = JSON.parse(JSON.stringify(res.data));
  5057. this.deptOptionList = this.changeArr(list1);
  5058. console.log(this.deptOptionList, '部门')
  5059. } else {
  5060. this.$message({
  5061. message: res.msg,
  5062. type: "error"
  5063. });
  5064. }
  5065. },
  5066. error => {
  5067. this.$message({
  5068. message: error,
  5069. type: "error"
  5070. });
  5071. });
  5072. },
  5073. // 获取部门列表
  5074. getDepartment() {
  5075. //如果没有权限,就不需要获取
  5076. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5077. return;
  5078. }
  5079. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5080. var param = {date:this.date + day};
  5081. this.http.post("/report/getMembList", param,
  5082. res => {
  5083. if (res.code == "ok") {
  5084. if(res.data.length == 0){
  5085. return
  5086. }
  5087. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5088. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5089. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5090. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5091. // if (this.user.role > 0) {
  5092. // }
  5093. list.splice(0,0,{
  5094. id: -1,
  5095. label: this.$t('lable.allStaff'),
  5096. })
  5097. this.membCount = 0;
  5098. //设置员工到部门下面
  5099. this.setUserToDept(list);
  5100. this.data = list;
  5101. // console.log('data',this.data);
  5102. this.expandDate = [this.data[1].id]
  5103. this.allData = list;
  5104. // if (noAllData.length > 0) {
  5105. // if (noAllData[0].label == '全部人员') {
  5106. // noAllData.splice(0,1);
  5107. // }
  5108. // }
  5109. // this.setUserToDept(noAllData);
  5110. // this.deptMembData = noAllData;
  5111. this.option = this.changeArr(list1);
  5112. list[0].membCount = this.membCount;
  5113. if (this.depData.id == -1) {
  5114. this.depData.membCount = this.membCount;
  5115. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5116. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5117. } else {
  5118. if (this.depData.isUser == null) {
  5119. var dep = this.findTargetDept(this.data, this.depData.id);
  5120. var membDeptList = [];
  5121. membDeptList.push(dep);
  5122. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5123. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5124. }
  5125. }
  5126. if (this.depData.isUser == null) {
  5127. if (this.isFill) {
  5128. this.fillMembList = this.fillList;
  5129. } else {
  5130. this.fillMembList = this.unFillList;
  5131. }
  5132. }
  5133. this.leaveAllNum = 0
  5134. for(let i in this.unFillList){
  5135. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5136. this.leaveAllNum += 1
  5137. }
  5138. }
  5139. this.stateChange()
  5140. } else {
  5141. this.$message({
  5142. message: res.msg,
  5143. type: "error"
  5144. });
  5145. }
  5146. },
  5147. error => {
  5148. this.$message({
  5149. message: error,
  5150. type: "error"
  5151. });
  5152. });
  5153. this.getReportFillStatus();
  5154. },
  5155. findTargetDept(list, deptId) {
  5156. var t = null;
  5157. for (var i=0;i<list.length; i++) {
  5158. if (list[i].isUser == null && list[i].id == deptId) {
  5159. t = list[i];
  5160. break;
  5161. }
  5162. }
  5163. if (t == null) {
  5164. for (var i=0;i<list.length; i++) {
  5165. if (list[i].children != null && list[i].children.length > 0) {
  5166. t = this.findTargetDept(list[i].children, deptId);
  5167. if (t != null) {
  5168. break;
  5169. }
  5170. }
  5171. }
  5172. }
  5173. return t;
  5174. },
  5175. getUserMembListFromDeptList(list, isFill) {
  5176. var membList = [];
  5177. for (var i in list) {
  5178. var deptName = list[i].label;
  5179. if (list[i].userList != null) {
  5180. list[i].userList.forEach(element => {
  5181. if (isFill == 0) {
  5182. //获取未填的
  5183. if (element.state == null) {
  5184. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5185. membList.push(obj);
  5186. }
  5187. } else {
  5188. if (element.state != null) {
  5189. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5190. membList.push(obj);
  5191. }
  5192. }
  5193. });
  5194. }
  5195. if (list[i].children != null) {
  5196. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5197. }
  5198. }
  5199. return membList;
  5200. },
  5201. setUserToDept(list) {
  5202. for (var i in list) {
  5203. var cnt = 0;
  5204. if (list[i].children != null) {
  5205. this.setUserToDept(list[i].children);
  5206. for (var m in list[i].children) {
  5207. cnt += list[i].children[m].membCount;
  5208. }
  5209. }
  5210. if (list[i].userList != null) {
  5211. if (list[i].children == null) {
  5212. list[i].children = [];
  5213. }
  5214. list[i].userList.forEach(element => {
  5215. var obj = {
  5216. id: element.id,
  5217. label:element.name,
  5218. state:element.state,
  5219. parentId:element.departmentId,
  5220. isUser:1,
  5221. workingTime: element.workingTime,
  5222. leaveDays: element.leaveDays,
  5223. leaveTimes: element.leaveTimes
  5224. };
  5225. list[i].children.push(obj);
  5226. this.membCount++;
  5227. cnt++;
  5228. });
  5229. }
  5230. list[i].membCount = cnt;
  5231. }
  5232. },
  5233. // 修改数组
  5234. changeArr(arr) {
  5235. for (var i = 0; i < arr.length; i++) {
  5236. if(arr[i].id != -1 && arr[i].id != 0) {
  5237. if (arr[i].children != null && arr[i].children.length>0) {
  5238. arr[i].children = this.changeArr(arr[i].children);
  5239. }
  5240. arr[i].id && (arr[i].value = arr[i].id);
  5241. delete arr[i].id;
  5242. }
  5243. }
  5244. for(var i in arr) {
  5245. if(arr[i].id == -1 || arr[i].id == 0) {
  5246. arr.splice(i,1)
  5247. }
  5248. }
  5249. return arr;
  5250. },
  5251. //时间段范围设置改动,监听
  5252. onTimeTypeChange(timeType) {
  5253. this.seleChn(1)
  5254. this.showAddMore = true;
  5255. for(var i in this.workForm.domains) {
  5256. if (this.workForm.domains[i].timeType == 0) {
  5257. this.showAddMore = false;
  5258. break;
  5259. }
  5260. }
  5261. if (this.showAddMore) {
  5262. //检测数量
  5263. if (this.workForm.domains.length == 2) {
  5264. this.showAddMore = false;
  5265. } else {
  5266. this.showAddMore = true;
  5267. }
  5268. }
  5269. },
  5270. getTimeType() {
  5271. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5272. res => {
  5273. if (res.code == "ok") {
  5274. var t = res.data;
  5275. this.reportTimeType = t;
  5276. if (this.reportTimeType.type > 0) {
  5277. this.showAddMore = true;
  5278. }
  5279. //转化时间格式
  5280. if (t.allday != null) {
  5281. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5282. }
  5283. if (t.am != null) {
  5284. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5285. }
  5286. if (t.pm != null) {
  5287. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5288. }
  5289. let arr = []
  5290. for(var i in res.data.excludeTimeList) {
  5291. let obj = {
  5292. s: res.data.excludeTimeList[i].startTime,
  5293. e: res.data.excludeTimeList[i].endTime,
  5294. }
  5295. arr.push(obj)
  5296. }
  5297. this.vacationTime = arr
  5298. } else {
  5299. this.$message({
  5300. message: res.msg,
  5301. type: "error"
  5302. });
  5303. }
  5304. },
  5305. error => {
  5306. this.listLoading = false;
  5307. this.$message({
  5308. message: error,
  5309. type: "error"
  5310. });
  5311. });
  5312. },
  5313. // 改变月份 -------
  5314. changeMonthOut() {
  5315. this.getAllDate();
  5316. this.getReportList();
  5317. this.getDepartment();
  5318. },
  5319. // 选择日期
  5320. choseDate(i, item) {
  5321. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5322. return
  5323. }
  5324. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5325. this.choseDay = i;
  5326. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5327. sessionStorage.msg = this.date + day,
  5328. this.getReportList();
  5329. this.getDepartment();
  5330. this.curDate = item.date;
  5331. },
  5332. canClick(i, item){
  5333. let nowDate = new Date()
  5334. let nowDateYear = nowDate.getFullYear()
  5335. let itemYear = parseInt(this.date.split('-')[0])
  5336. let nowDateMonth = nowDate.getMonth() + 1
  5337. let itemMonth = parseInt(this.date.split('-')[1])
  5338. let nowDateDay = nowDate.getDate()
  5339. let itemDay = parseInt(item.showDate.split('.')[1])
  5340. if(nowDateYear < itemYear){
  5341. return false
  5342. }else if(nowDateYear == itemYear){
  5343. if(nowDateMonth < itemMonth){
  5344. return false
  5345. }else if(nowDateMonth == itemMonth){
  5346. if(nowDateDay < itemDay){
  5347. return false
  5348. }
  5349. }
  5350. }
  5351. },
  5352. // 获取日期列表
  5353. getAllDate(e) {
  5354. var dayArry = [];
  5355. var day = this.getCountDays();
  5356. let curMonthDay = null;
  5357. for (var k = 1; k <= day; k++) {
  5358. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5359. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5360. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5361. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5362. if(sessionStorage.msg) {
  5363. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5364. this.choseDay = k - 1;
  5365. curMonthDay = str;
  5366. }
  5367. } else {
  5368. if (new Date().getDate() == k) {
  5369. this.choseDay = k - 1;
  5370. }
  5371. }
  5372. } else {
  5373. this.choseDay = 0;
  5374. }
  5375. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5376. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5377. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5378. }
  5379. this.allDate = dayArry;
  5380. //不能超过最大日期
  5381. if (this.choseDay > day-1) {
  5382. this.choseDay = day-1;
  5383. }
  5384. if(sessionStorage.from != 1){
  5385. let nowmonth = new Date().getMonth() + 1
  5386. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5387. let nowdate = new Date().getDate()
  5388. if(nowd == this.date){
  5389. if(e && sessionStorage.msg){
  5390. }else{
  5391. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5392. }
  5393. let nowday = new Date(sessionStorage.msg).getDate()
  5394. this.choseDay = nowday - 1
  5395. let monthdate = new Date(sessionStorage.msg)
  5396. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5397. }else{
  5398. if(e && sessionStorage.msg){
  5399. }else{
  5400. sessionStorage.msg = this.date + '-01'
  5401. }
  5402. let monthdate = new Date(sessionStorage.msg)
  5403. this.choseDay = monthdate.getDate() - 1
  5404. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5405. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5406. }
  5407. }else{
  5408. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5409. }
  5410. //从消息点击跳转过来的,直接加载指定日期
  5411. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5412. this.curDate = sessionStorage.msg;
  5413. sessionStorage.from = 0;
  5414. } else {
  5415. // if (curMonthDay != null) {
  5416. // // this.curDate = curMonthDay;
  5417. // let d = new Date(sessionStorage.msg)
  5418. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5419. // } else {
  5420. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5421. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5422. // }
  5423. }
  5424. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5425. // if(!sessionStorage.msg){
  5426. // let msgday = this.choseDay + 1
  5427. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5428. // }
  5429. this.getReportFillStatus();
  5430. },
  5431. getCountDays() {
  5432. var newstr = this.date.replace(/-/g, "/");
  5433. var curDate = new Date(newstr+'/01');
  5434. var curMonth = curDate.getMonth();
  5435. curDate.setMonth(curMonth + 1);
  5436. curDate.setDate(0);
  5437. return curDate.getDate();
  5438. },
  5439. reqMore() {
  5440. if (this.hasMore) {
  5441. this.pageIndex++;
  5442. this.requestHttpReports();
  5443. }
  5444. },
  5445. //加载日报数据
  5446. requestHttpReports() {
  5447. //请求数据
  5448. this.listLoading = true;
  5449. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5450. let param = {date: this.date + day};
  5451. if (this.deptId) {
  5452. param.deptId = this.deptId;
  5453. }
  5454. if (this.targetUid) {
  5455. param.userId = this.targetUid;
  5456. }
  5457. //传页码
  5458. if (this.hasMore) {
  5459. param.pageIndex = this.pageIndex;
  5460. }
  5461. this.http.post( this.port.report.list, param,
  5462. res => {
  5463. this.listLoading = false;
  5464. if (res.code == "ok") {
  5465. //扩增
  5466. if (res.data.data.length > 0) {
  5467. this.reportList = this.reportList.concat(res.data.data);
  5468. } else if (this.pageIndex > 1){
  5469. this.$message({
  5470. message: '没有更多数据了',
  5471. type: "info"
  5472. });
  5473. }
  5474. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5475. if(document.querySelector("#day"+this.choseDay)){
  5476. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5477. }
  5478. } else {
  5479. this.$message({
  5480. message: res.msg,
  5481. type: "error"
  5482. });
  5483. }
  5484. },
  5485. error => {
  5486. this.listLoading = false;
  5487. this.$message({
  5488. message: error,
  5489. type: "error"
  5490. });
  5491. });
  5492. },
  5493. //获取日报列表
  5494. getReportList() {
  5495. //初始化,重置数据
  5496. this.pageIndex = 0;
  5497. this.hasMore = true;
  5498. this.reportList = [];
  5499. this.requestHttpReports();
  5500. },
  5501. //刷新日报状态,用于审核后更新
  5502. refreshReportData(reportId) {
  5503. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5504. res => {
  5505. if (res.code == "ok") {
  5506. for (var m=0;m<this.reportList.length; m++) {
  5507. var d = this.reportList[m].data;
  5508. var find = d.filter(r=>r.id == reportId);
  5509. if (find.length > 0) {
  5510. find[0].state = res.data.state;
  5511. if (find[0].state == 2) {//被驳回,要可以编辑
  5512. this.reportList[m].state = 2;
  5513. }
  5514. find[0].isDeptAudit = res.data.isDeptAudit;
  5515. find[0].departmentAuditState = res.data.departmentAuditState;
  5516. find[0].projectAuditorName = res.data.projectAuditorName;
  5517. find[0].projectAuditorId = res.data.projectAuditorId;
  5518. find[0].projectAuditState = res.data.projectAuditState;
  5519. find[0].rejectUserid = res.data.rejectUserid;
  5520. find[0].rejectUsername = res.data.rejectUsername;
  5521. find[0].rejectReason = res.data.rejectReason;
  5522. this.$forceUpdate();
  5523. break;
  5524. }
  5525. }
  5526. } else {
  5527. this.$message({
  5528. message: res.msg,
  5529. type: "error"
  5530. });
  5531. }
  5532. },
  5533. error => {
  5534. this.listLoading = false;
  5535. this.$message({
  5536. message: error,
  5537. type: "error"
  5538. });
  5539. });
  5540. },
  5541. //导出员工工时统计
  5542. exportUserTime() {
  5543. this.listLoading = true;
  5544. var param = {};
  5545. if (this.exportParam.dateRange != null) {
  5546. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5547. }
  5548. this.http.post('/department/exportDeptStatistic', param,
  5549. res => {
  5550. this.listLoading = false;
  5551. if (res.code == "ok") {
  5552. location.href = res.data;
  5553. this.exportTimeDialog = false;
  5554. } else {
  5555. this.$message({
  5556. message: res.msg,
  5557. type: "error"
  5558. });
  5559. }
  5560. },
  5561. error => {
  5562. this.listLoading = false;
  5563. this.$message({
  5564. message: error,
  5565. type: "error"
  5566. });
  5567. });
  5568. },
  5569. //导出日报
  5570. exportReport() {
  5571. this.exportingData = true;
  5572. var param = {};
  5573. if (this.exportParam.dateRange != null) {
  5574. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5575. }
  5576. if (this.exportParam.projectId != null) {
  5577. param.projectId = this.exportParam.projectId;
  5578. }
  5579. if (this.exportParam.departmentId != null) {
  5580. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5581. param.departmentIds = this.exportParam.departmentId.join(',')
  5582. }
  5583. param.stateKey = this.stateKey
  5584. // param.departmentId = this.user.departmentId
  5585. console.log(param, '《=== 导出传的参数');
  5586. console.log('开始调用exportReport接口');
  5587. this.http.post(this.port.report.export, param,
  5588. res => {
  5589. this.exportingData = false;
  5590. if (res.code == "ok") {
  5591. var filePath = res.data;
  5592. const a = document.createElement('a'); // 创建a标签
  5593. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5594. a.setAttribute('href', filePath);// href链接
  5595. a.click(); //自执行点击事件
  5596. a.remove();
  5597. this.exportDialog = false;
  5598. } else {
  5599. this.$message({
  5600. message: res.msg,
  5601. type: "error"
  5602. });
  5603. }
  5604. },
  5605. error => {
  5606. this.exportingData = false;
  5607. this.$message({
  5608. message: error,
  5609. type: "error"
  5610. });
  5611. });
  5612. },
  5613. //导出日报审核记录
  5614. exportReportLog() {
  5615. this.exportingData = true;
  5616. var param = {};
  5617. if (this.exportReportLogParam.dateRange != null) {
  5618. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5619. }
  5620. this.http.post('/report-log/exportReportLog', param,
  5621. res => {
  5622. this.exportingData = false;
  5623. if (res.code == "ok") {
  5624. var filePath = res.data;
  5625. const a = document.createElement('a'); // 创建a标签
  5626. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5627. a.setAttribute('href', filePath);// href链接
  5628. a.click(); //自执行点击事件
  5629. a.remove();
  5630. this.exportDialog = false;
  5631. } else {
  5632. this.$message({
  5633. message: res.msg,
  5634. type: "error"
  5635. });
  5636. }
  5637. },
  5638. error => {
  5639. this.exportingData = false;
  5640. this.$message({
  5641. message: error,
  5642. type: "error"
  5643. });
  5644. });
  5645. },
  5646. importReportLog(item){
  5647. //首先判断文件类型
  5648. let str = item.file.name.split(".");
  5649. let format = str[str.length - 1];
  5650. if (format != "xls" && format != "xlsx") {
  5651. this.$message({
  5652. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5653. type: "error"
  5654. });
  5655. } else {
  5656. let formData = new FormData();
  5657. formData.append("multipartFile", item.file);
  5658. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5659. res => {
  5660. this.$refs.upload.clearFiles();
  5661. if (res.code == "ok") {
  5662. this.$message({
  5663. message: res.msg,
  5664. type: "success"
  5665. });
  5666. } else {
  5667. this.$message({
  5668. message: res.msg,
  5669. type: "error"
  5670. });
  5671. }
  5672. },
  5673. error => {
  5674. this.$refs.upload.clearFiles();
  5675. this.$message({
  5676. message: error,
  5677. type: "error"
  5678. });
  5679. });
  5680. }
  5681. },
  5682. //获取项目列表
  5683. getProjectList() {
  5684. this.listLoading = true;
  5685. this.http.post( this.port.project.list, {},
  5686. res => {
  5687. this.listLoading = false;
  5688. if (res.code == "ok") {
  5689. for(var i in res.data) {
  5690. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5691. res.data[i].projectCode = ''
  5692. }
  5693. }
  5694. this.projectList = res.data;
  5695. console.log("项目列表",this.projectList);
  5696. } else {
  5697. this.$message({
  5698. message: res.msg,
  5699. type: "error"
  5700. });
  5701. }
  5702. },
  5703. error => {
  5704. this.listLoading = false;
  5705. this.$message({
  5706. message: error,
  5707. type: "error"
  5708. });
  5709. });
  5710. },
  5711. // 获取填报日报的项目下拉列表
  5712. getFillProjectList() {
  5713. this.http.post( this.port.project.list, {
  5714. forReport: 1
  5715. },res => {
  5716. if (res.code == "ok") {
  5717. for(var i in res.data) {
  5718. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5719. res.data[i].projectCode = ''
  5720. }
  5721. }
  5722. this.fillProjectList = res.data;
  5723. this.getRecentlyProject()
  5724. } else {
  5725. this.$message({
  5726. message: res.msg,
  5727. type: "error"
  5728. });
  5729. }
  5730. },
  5731. error => {
  5732. this.$message({
  5733. message: error,
  5734. type: "error"
  5735. });
  5736. });
  5737. },
  5738. getBasecostItemList() {
  5739. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5740. companyId: this.user.companyId
  5741. },
  5742. res => {
  5743. if (res.code == "ok") {
  5744. this.timeBasecostList = res.data;
  5745. }
  5746. });
  5747. },
  5748. getAIReport(createDate) {
  5749. this.http.post('/report/getAIReport', {},
  5750. res => {
  5751. if (res.code == "ok") {
  5752. var quanbu = 0
  5753. this.jsDay = 1
  5754. var zhi = ''
  5755. var slp = res.data
  5756. for(var i in slp) {
  5757. var sp = +slp[i].workingTime + 0
  5758. zhi = this.jsDay * sp
  5759. quanbu = +quanbu + zhi
  5760. }
  5761. this.jsTime = quanbu
  5762. var aiReportData = res.data;
  5763. this.canCancelInDialog = false
  5764. if(aiReportData.length != 0) {
  5765. var arr = [];
  5766. for(var i in aiReportData) {
  5767. arr.push({
  5768. id: null,
  5769. projectId: aiReportData[i].projectId,
  5770. workingTime: aiReportData[i].workingTime,
  5771. content: '',
  5772. progress:100,
  5773. state: 2,
  5774. timeType: aiReportData[i].timeType,
  5775. subProjectList: aiReportData[i].subProjectList,
  5776. taskList: aiReportData[i].taskList,
  5777. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5778. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5779. taskId: aiReportData[i].taskId,
  5780. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5781. startTime: aiReportData[i].startTime,
  5782. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5783. endTime: aiReportData[i].endTime,
  5784. isOvertime: 0,
  5785. progress:aiReportData[i].progress,
  5786. professionProgress: aiReportData[i].professionProgressList,
  5787. stages:aiReportData[i].stages,
  5788. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5789. pics: null,
  5790. multiWorktime: aiReportData[i].multiWorktime,
  5791. worktimeList: [{}],
  5792. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5793. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5794. wuduList: aiReportData[i].degreeList,
  5795. taskGroups:aiReportData[i].taskGroups,
  5796. customData: aiReportData[i].customData,//自定义的数值
  5797. auditUserList: aiReportData[i].auditUserList,
  5798. projectAuditorId: aiReportData[i].projectAuditorId,
  5799. projectAuditorName: aiReportData[i].projectAuditorName,
  5800. overtimeHours: aiReportData[i].overtimeHours,
  5801. customText: aiReportData[i].customText,
  5802. basecostId: aiReportData[i].basecostId,
  5803. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5804. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5805. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5806. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5807. canEdit: true
  5808. })
  5809. }
  5810. this.workForm.domains = arr;
  5811. } else {
  5812. }
  5813. this.canEdit = true;
  5814. this.originCanEdit = true;
  5815. this.seleChn()
  5816. } else {
  5817. this.$message({
  5818. message: res.msg,
  5819. type: "error"
  5820. });
  5821. }
  5822. },
  5823. error => {
  5824. this.$message({
  5825. message: error,
  5826. type: "error"
  5827. });
  5828. });
  5829. },
  5830. // 获取个人某天的日报 111111
  5831. getReport() {
  5832. this.http.post( this.port.report.getPort, {
  5833. date: this.workForm.createDate
  5834. },
  5835. res => {
  5836. if (res.code == "ok") {
  5837. var quanbu = 0
  5838. this.jsDay = 1
  5839. var zhi = ''
  5840. var slp = res.data.report
  5841. for(var i in slp) {
  5842. var sp = +slp[i].workingTime + 0
  5843. zhi = this.jsDay * sp
  5844. quanbu = +quanbu + zhi
  5845. }
  5846. this.jsTime = quanbu
  5847. var list = res.data;
  5848. this.report = list;
  5849. this.reportTimeType = this.report.timeType;
  5850. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5851. this.isWeekend = !this.report.isWorkDay;
  5852. this.canCancelInDialog = false;
  5853. this.hasWrittenReport = list.report.length != 0;
  5854. if(list.report.length != 0) {
  5855. var arr = [];
  5856. this.canEdit = false;
  5857. let candelete = true
  5858. for(var i in list.report) {
  5859. var flg = null
  5860. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5861. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5862. var filteredRespList = null
  5863. if (targetP.length > 0) {
  5864. var isPublic = targetP[0].isPublic;
  5865. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5866. }
  5867. arr.push({
  5868. id: list.report[i].id,
  5869. projectId: list.report[i].projectId,
  5870. workingTime: list.report[i].workingTime,
  5871. content: list.report[i].content,
  5872. state: list.report[i].state,
  5873. timeType: list.report[i].timeType,
  5874. subProjectList: list.report[i].subProjectList,
  5875. taskList: list.report[i].taskList,
  5876. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5877. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5878. taskId: list.report[i].taskId,
  5879. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5880. startTime: list.report[i].startTime,
  5881. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5882. endTime: list.report[i].endTime,
  5883. isOvertime: flg,
  5884. progress:list.report[i].progress,
  5885. professionProgress: list.report[i].professionProgressList,
  5886. stages:list.report[i].stages,
  5887. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5888. pics: list.report[i].pics,
  5889. multiWorktime: list.report[i].multiWorktime,
  5890. worktimeList: list.report[i].worktimeList,
  5891. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5892. multiDegrIdArray: list.report[i].multiDegrIdList,
  5893. wuduList: list.report[i].degreeList,
  5894. taskGroups:list.report[i].taskGroups,
  5895. customData: list.report[i].customData,//自定义的数值
  5896. auditUserList: list.report[i].auditUserList,
  5897. projectAuditorId: list.report[i].projectAuditorId,
  5898. projectAuditorName: list.report[i].projectAuditorName,
  5899. overtimeHours: list.report[i].overtimeHours,
  5900. customText: list.report[i].customText,
  5901. basecostId: list.report[i].basecostId,
  5902. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5903. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5904. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5905. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5906. canEdit: list.report[i].state >= 2 ? true : false,
  5907. extraField1: list.report[i].extraField1,
  5908. extraField2: list.report[i].extraField2,
  5909. extraField3: list.report[i].extraField3,
  5910. workContentList: list.report[i].workContentList,
  5911. filteredRespList: filteredRespList,
  5912. serviceList: list.report[i].serviceList,
  5913. sapServiceId: list.report[i].sapServiceId,
  5914. reportTargetDeptId: list.report[i].deptId
  5915. })
  5916. if (list.report[i].state >= 2) {
  5917. this.canEdit = true;
  5918. }
  5919. if(list.report[i].state < 2){
  5920. candelete = false
  5921. }
  5922. if (list.report[i].state == 0){
  5923. this.canCancelInDialog = true
  5924. }
  5925. // 加判断
  5926. if(this.user.timeType.choseFromAlbum == 1) {
  5927. let arrList = []
  5928. for(var k in list.report[i].pics) {
  5929. let obj = {
  5930. name: k,
  5931. url: list.report[i].pics[k]
  5932. }
  5933. arrList.push(obj)
  5934. }
  5935. arr[i].imgListUrl = arrList
  5936. arr[i].imgList = list.report[i].pics
  5937. }
  5938. }
  5939. this.reportCanDelete = candelete
  5940. this.workForm = {
  5941. createDate: this.workForm.createDate,
  5942. domains: arr,
  5943. userNames:null,
  5944. userId:null,
  5945. time: list.time,
  5946. showRefresh: list.showRefresh
  5947. }
  5948. console.log('workForm', this.workForm)
  5949. } else {
  5950. this.workForm = {
  5951. createDate: this.workForm.createDate,
  5952. domains: [{
  5953. id: null,
  5954. projectId: "",
  5955. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5956. content: "",
  5957. progress:100,
  5958. state: 2,
  5959. timeType:0,
  5960. multiWorktime: this.reportTimeType.multiWorktime,
  5961. worktimeList:[{}],
  5962. canEdit: true,
  5963. auditorFirst: '',
  5964. auditorSec: '',
  5965. auditorThird: '',
  5966. ccUserid: ''
  5967. }],
  5968. userId:null,
  5969. userNames:null,
  5970. time: this.report.time,
  5971. showRefresh: list.showRefresh
  5972. }
  5973. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5974. this.$set(this.workForm.domains[0],'isOvertime',true)
  5975. if(this.reportTimeType.type != 2){
  5976. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5977. }
  5978. }
  5979. if(this.user.timeType.type == 1) {
  5980. var shuzhi = this.user.timeType.allday + ''
  5981. // console.log('执行一次', shuzhi.indexOf('.'))
  5982. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5983. }
  5984. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5985. //默认给第一个,必填字段
  5986. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5987. }
  5988. this.canEdit = true;
  5989. }
  5990. this.originCanEdit = this.canEdit;
  5991. this.seleChn()
  5992. } else {
  5993. this.$message({
  5994. message: res.msg,
  5995. type: "error"
  5996. });
  5997. }
  5998. },
  5999. error => {
  6000. this.$message({
  6001. message: error,
  6002. type: "error"
  6003. });
  6004. });
  6005. },
  6006. guanbi() {
  6007. this.falsss = false,
  6008. this.workTimeForMinYi=0
  6009. },
  6010. // 打开日报填写
  6011. fillInReport(i, isBatch) {
  6012. this.isWeekend = false
  6013. this.reportCanDelete = false
  6014. // console.log(this.user.timeType.type, '选择时长')
  6015. if(i != 1) {
  6016. this.falsss = false
  6017. } else {
  6018. this.falsss = true
  6019. }
  6020. if (this.isSubstitude) {
  6021. this.getSubstitudeUserDeptList();
  6022. }
  6023. if(i == -1 || this.isSubstitude) {
  6024. this.isDisable = false;
  6025. } else {
  6026. this.isDisable = true;
  6027. }
  6028. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6029. this.isBatch = isBatch;
  6030. if (this.isBatch == 0 && !this.isSubstitude) {
  6031. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6032. let weekday = new Date(this.workForm.createDate).getDay()
  6033. if(this.user.companyId == 817){
  6034. if(weekday == 0){
  6035. this.isWeekend = true
  6036. }
  6037. }else{
  6038. if(weekday == 0 || weekday == 6){
  6039. this.isWeekend = true
  6040. }
  6041. }
  6042. this.getReport(i);
  6043. } else {
  6044. // console.log('执行到了这里')
  6045. this.jsTime = 0
  6046. this.jsDay = 0
  6047. this.workForm = {
  6048. createDate: null,//批量填报没有日期
  6049. domains: [{
  6050. id: null,
  6051. projectId: "",
  6052. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6053. content: "",
  6054. progress:100,
  6055. state: 2,
  6056. timeType:0,
  6057. multiWorktime: this.reportTimeType.multiWorktime,
  6058. worktimeList:[{}],
  6059. canEdit: true,
  6060. }],
  6061. }
  6062. if(this.user.timeType.type == 1) {
  6063. var shuzhi = this.user.timeType.allday + ''
  6064. // console.log('执行二次')
  6065. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6066. }
  6067. // console.log(this.workForm)
  6068. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6069. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6070. }
  6071. this.canEdit = true;
  6072. }
  6073. this.dialogVisible = true;
  6074. },
  6075. //按周填报的弹窗口中编辑单项目相关数据
  6076. setWeekFormReportItem(reportId, i, names, row,sss) {
  6077. console.log(sss)
  6078. this.http.post('/report/getReportById', {
  6079. reportId: reportId
  6080. },
  6081. res => {
  6082. if (res.code == "ok") {
  6083. var data = res.data.report;
  6084. sss.subProjectId = data.subProjectId
  6085. sss.subProjectList = data.subProjectList;
  6086. sss.stage = data.stage
  6087. sss.subProjectList = data.subProjectList
  6088. sss.stages = data.stages
  6089. sss.taskGroups = data.taskGroups;
  6090. sss.auditUserList = data.auditUserList;
  6091. sss.degreeId = data.degreeId;
  6092. sss.customData = data.customData;
  6093. sss.wuduList = data.degreeList;
  6094. this.zhoBaoIdx = i
  6095. this.zhoBaoName = names
  6096. this.zhoBao = sss
  6097. this.zhis = row
  6098. if (sss.groupId) {
  6099. //最后一个参数表示是否保留stage的值,不要重置为空
  6100. this.getGroupStages(this.zhoBao, 0, true)
  6101. }
  6102. this.$forceUpdate();
  6103. }
  6104. });
  6105. },
  6106. // 按周填报里内容的填写
  6107. showWeekItemEdit(item, i, projectId,names, row) {
  6108. if (item.state == 0) {
  6109. this.$message({
  6110. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  6111. type: "error"
  6112. });
  6113. return;
  6114. }
  6115. if (item.state == 1) {
  6116. this.$message({
  6117. message: '已通过状态不可修改',
  6118. type: "error"
  6119. });
  6120. return;
  6121. }
  6122. if(this.user.timeType.notAllowedNoAttendance == 1){
  6123. if(this.zhoData[i].corpTime){
  6124. if(this.zhoData[i].corpTime.workHours == 0){
  6125. this.$message({
  6126. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6127. type: 'error'
  6128. })
  6129. return
  6130. }
  6131. }else{
  6132. this.$message({
  6133. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6134. type: 'error'
  6135. })
  6136. return
  6137. }
  6138. }
  6139. var obj = {}
  6140. obj.projectId = projectId
  6141. this.tianxieDialogVisible = true
  6142. this.scopess = item
  6143. var sss = {}
  6144. if (item.id != null) {
  6145. sss.id = item.id;
  6146. sss.state = item.state;
  6147. } else {
  6148. sss.id = -1;
  6149. sss.state = 3;
  6150. }
  6151. sss.projectId = projectId;
  6152. sss.progress = item.progress
  6153. sss.time = item.time
  6154. sss.content = item.content;
  6155. console.log('333', sss.content)
  6156. if (sss.time == '' && this.reportTimeType.type == 2) {
  6157. //取已填时间范围中最大的一个作为开始时间
  6158. var startTime = '09:00';
  6159. var fillStartTime = '00:00';
  6160. for (var t in this.selProjectList) {
  6161. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6162. if (fillItem.time) {
  6163. if (fillItem.time[1] > fillStartTime) {
  6164. fillStartTime = fillItem.time[1];
  6165. }
  6166. }
  6167. }
  6168. if (fillStartTime == '00:00') {
  6169. fillStartTime = '09:00';
  6170. }
  6171. var fillEndMax = '18:00';
  6172. if (fillStartTime >= '18:00') {
  6173. fillEndMax = '23:59';
  6174. }
  6175. sss.time = [fillStartTime, fillEndMax];
  6176. }
  6177. sss.groupId = item.groupId
  6178. sss.stage = item.stage;
  6179. sss.workingTime = item.workingTime
  6180. sss.projectAuditorId = item.projectAuditorId;
  6181. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6182. //默认选中第一个
  6183. sss.basecostId = this.timeBasecostList[0].id;
  6184. }
  6185. var hasEdited = this.zhoData[i][names].hasEdited;
  6186. if (hasEdited) {
  6187. sss = { ...item }
  6188. //编辑过了
  6189. sss.subProjectId = item.subProjectId
  6190. sss.stage = item.stage
  6191. sss.subProjectList = item.subProjectList
  6192. sss.stages = item.stages
  6193. sss.taskGroups = item.taskGroups;
  6194. console.log(sss.taskGroups, '33333');
  6195. sss.auditUserList = obj.auditUserList;
  6196. sss.degreeId = item.degreeId;
  6197. sss.customData = item.customData;
  6198. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6199. //只有一个审核人,自动设置上去
  6200. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6201. }
  6202. sss.wuduList = item.wuduList;
  6203. this.zhoBaoIdx = i
  6204. this.zhoBaoName = names
  6205. this.zhoBao = sss
  6206. this.zhis = row
  6207. if (sss.groupId) {
  6208. //最后一个参数表示是否保留stage的值,不要重置为空
  6209. this.getGroupStages(this.zhoBao, 0, true)
  6210. }
  6211. this.$forceUpdate();
  6212. this.getWeeklyTaskList(sss)
  6213. console.log('最后的周报 ===>', this.zhoBao)
  6214. } else {
  6215. //第一次打开,获取数据
  6216. if (sss.id == -1) {
  6217. //新填报的
  6218. this.selectProject(obj, 0);
  6219. var that = this
  6220. setTimeout(() =>{
  6221. sss.subProjectId = that.workForm.domains[0].subProjectId
  6222. sss.subProjectList = item.subProjectList;
  6223. sss.stage = that.workForm.domains[0].stage
  6224. sss.subProjectList = that.workForm.domains[0].subProjectList
  6225. sss.stages = that.workForm.domains[0].stages
  6226. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6227. sss.auditUserList = obj.auditUserList;
  6228. sss.degreeId = item.degreeId;
  6229. sss.customData = item.customData;
  6230. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6231. //只有一个审核人,自动设置上去
  6232. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6233. }
  6234. sss.wuduList = row[0].wuduList
  6235. that.zhoBaoIdx = i
  6236. that.zhoBaoName = names
  6237. that.zhoBao = sss
  6238. that.zhis = row
  6239. if (sss.groupId) {
  6240. //最后一个参数表示是否保留stage的值,不要重置为空
  6241. this.getGroupStages(that.zhoBao, 0, false)
  6242. }
  6243. that.$forceUpdate();
  6244. this.getWeeklyTaskList(sss)
  6245. },600);
  6246. } else {
  6247. //编辑填报过的;数据库已经存在的
  6248. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6249. }
  6250. }
  6251. },
  6252. // 按周填报里内容的填写点击确定
  6253. setWeekProItemData() {
  6254. //专业版模式下,任务分组和阶段必填
  6255. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6256. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6257. this.$message({
  6258. message: '任务分组和阶段必填,请检查',
  6259. type: "error"
  6260. });
  6261. return;
  6262. }
  6263. }
  6264. // 检查任务分组
  6265. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6266. this.$message({
  6267. message: '任务分组必填,请检查',
  6268. type: "error"
  6269. });
  6270. return
  6271. }
  6272. //检查子项目是否必填
  6273. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6274. this.$message({
  6275. message: '子项目必填,请检查',
  6276. type: "error"
  6277. });
  6278. return;
  6279. }
  6280. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6281. this.$message({
  6282. message: this.$t('message.Pleaseselectareviewer'),
  6283. type: "error"
  6284. });
  6285. return
  6286. }
  6287. if(this.user.timeType.reportAuditType == 3){
  6288. let auditTips = ''
  6289. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6290. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6291. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6292. if(auditTips){
  6293. auditTips = auditTips.substring(0,auditTips.length - 1)
  6294. this.$message({
  6295. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6296. type: 'error'
  6297. })
  6298. return
  6299. }
  6300. }
  6301. let errtips = ''
  6302. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6303. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6304. errtips += this.user.timeType.customDegreeName + '、'
  6305. }
  6306. }
  6307. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6308. errtips += this.user.timeType.customDataName + '、'
  6309. }
  6310. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6311. errtips += this.user.timeType.customTextName + '、'
  6312. }
  6313. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6314. errtips += this.$t('other.workMatters') +'、'
  6315. }
  6316. if(errtips){
  6317. errtips = errtips.substring(0,errtips.length - 1)
  6318. this.$message({
  6319. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6320. type: 'error'
  6321. })
  6322. return
  6323. }
  6324. this.tianxieDialogVisible = false
  6325. var zhong = this.zhoData
  6326. this.zhoBao.hasEdited = true;
  6327. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6328. this.zhoData = zhong
  6329. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6330. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6331. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6332. },
  6333. // 获取本周
  6334. getCurrentWeek() {
  6335. //今天
  6336. this.targetWeekDate = new Date();
  6337. this.initWeekFormData();
  6338. // this.jiazai()
  6339. },
  6340. // 获取上周
  6341. handleGetPrevWeek() {
  6342. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6343. this.initWeekFormData();
  6344. // this.jiazai()
  6345. },
  6346. // 获取下周
  6347. handleGetNextvWeek() {
  6348. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6349. this.initWeekFormData()
  6350. },
  6351. // 加载动画
  6352. jiazai() {
  6353. this.weekDataLoading = true
  6354. var that = this
  6355. setTimeout(() =>{
  6356. that.weekDataLoading = false
  6357. },1000);
  6358. },
  6359. // 转时间格式
  6360. dealdate(date) {
  6361. const dt = new Date(date)
  6362. const y = dt.getFullYear()
  6363. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6364. const d = (dt.getDate() + '').padStart(2, '0')
  6365. return `${y}-${m}-${d}`
  6366. },
  6367. // 按周填报
  6368. fillInReportss() {
  6369. window.addEventListener('scroll', this.handleScroll, true)
  6370. // this.jiazai()
  6371. this.fillWeekDialogVisi = true
  6372. this.getCurrentWeek();
  6373. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6374. //重新获取工时预警类型的预算项
  6375. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6376. companyId: this.user.companyId
  6377. },
  6378. res => {
  6379. if (res.code == "ok") {
  6380. this.timeBasecostList = res.data;
  6381. }
  6382. });
  6383. }
  6384. },
  6385. fillInReportCustom() {
  6386. this.weekIndex++
  6387. this.weekParentData = {
  6388. isSubstitude: this.isSubstitude
  6389. }
  6390. this.fillWeekDialogVisiCustom = true
  6391. },
  6392. // 按周填报的项目筛选
  6393. selListFun(){
  6394. this.selProjectList = []
  6395. if(this.selCon.length){
  6396. for (let i = 0; i < this.selCon.length; i++) {
  6397. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6398. }
  6399. this.selConShow = false ;
  6400. for (let i in this.zhoData) {
  6401. var obj = this.zhoData[i];
  6402. for(var j in this.selProjectList) {
  6403. var xinzhi = this.selProjectList[j].projectName
  6404. obj[xinzhi] = {}
  6405. obj[xinzhi].time = ''
  6406. obj[xinzhi].content = ''
  6407. obj[xinzhi].progress = 0
  6408. obj[xinzhi].workingTime = 0
  6409. }
  6410. }
  6411. this.initWeekFormData();
  6412. }else{
  6413. this.$message({
  6414. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6415. type:'error'
  6416. })
  6417. }
  6418. },
  6419. setWeekCardTimeData(list) {
  6420. for(let i in list){
  6421. let datei = '';
  6422. if (this.user.timeType.showDdCardtime == 1) {
  6423. datei = list[i].workDate;
  6424. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6425. datei = list[i].createDate;
  6426. } else if (this.user.timeType.syncFanwei == 1) {
  6427. datei = list[i].workDate;
  6428. }
  6429. for(let m in this.zhoData) {
  6430. if(datei == this.zhoData[m].zhoDataTime){
  6431. let item = {
  6432. startTime: list[i].startTime,
  6433. endTime: list[i].endTime,
  6434. workHours: list[i].workHours
  6435. }
  6436. this.$set(this.zhoData[m],'corpTime',item)
  6437. }
  6438. }
  6439. }
  6440. },
  6441. getWeeklyCardTime(){ //按周填报获取考勤信息
  6442. let dateStr = []
  6443. for(let i in this.zhoData){
  6444. dateStr.push(this.zhoData[i].zhoDataTime)
  6445. }
  6446. this.http.post('/report/getWeeklyCardTime',{
  6447. dateStr: JSON.stringify(dateStr)
  6448. },res => {
  6449. if(res.code == 'ok'){
  6450. for(let i in res.data){
  6451. let datei = '';
  6452. if (this.user.timeType.showDdCardtime == 1) {
  6453. datei = res.data[i].workDate.split('-');
  6454. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6455. datei = res.data[i].createDate.split('-');
  6456. }
  6457. for(let m in this.zhoData){
  6458. let datem = new Date(this.zhoData[m].zhoDataTime)
  6459. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6460. let item = {
  6461. startTime: res.data[i].startTime,
  6462. endTime: res.data[i].endTime,
  6463. workHours: res.data[i].workHours
  6464. }
  6465. this.$set(this.zhoData[m],'corpTime',item)
  6466. }
  6467. }
  6468. }
  6469. }else{
  6470. this.$message({
  6471. message: res.msg,
  6472. type: 'error'
  6473. })
  6474. }
  6475. },err => {
  6476. this.$message({
  6477. message: err,
  6478. type: 'error'
  6479. })
  6480. })
  6481. },
  6482. selListqx(){
  6483. this.fillWeekDialogVisi = false
  6484. this.selProjectList = []
  6485. this.selCon = []
  6486. },
  6487. handleScroll() {
  6488. this.changdu = this.projectList.length + 1
  6489. },
  6490. // 自动选择时间点的事件
  6491. // async zhoTimes(item, i) {
  6492. // var iss = i
  6493. // if(item.time == null) {
  6494. // return
  6495. // } else {
  6496. // const zhi = this.zhoData[iss];
  6497. // let he = 0;
  6498. // const timeArr = Object.values(zhi)
  6499. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6500. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6501. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6502. // console.log(data, 'data');
  6503. // zhi.he = `${he}h`;
  6504. // }
  6505. // },
  6506. async zhoTimes(item, index) {
  6507. const zho = this.zhoData[index];
  6508. if (!item.time) {
  6509. return;
  6510. }
  6511. const timeArr = Object.values(zho)
  6512. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6513. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6514. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6515. zho.he = `${totalHours[0]}h`;
  6516. },
  6517. // 判断两个时间段是否重叠
  6518. timeOverlap(idx, dateAr) {
  6519. let zhi = 0
  6520. for (let k in dateAr) {
  6521. if (idx !== k) {
  6522. 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))) {
  6523. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6524. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6525. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6526. }
  6527. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6528. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6529. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6530. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6531. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6532. } else {
  6533. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6534. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6535. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6536. }
  6537. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6538. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6539. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6540. }
  6541. }
  6542. }
  6543. }
  6544. }
  6545. return zhi
  6546. },
  6547. // 计算时间
  6548. getHourMinutes(str, end) {
  6549. var he = 0
  6550. var date2 = '2021/12/12 ' + end +':00'
  6551. var date1 = '2021/12/12 ' + str +':00'
  6552. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6553. var leave1=date3%(24*3600*1000)
  6554. var hours=Math.floor(leave1/(3600*1000))
  6555. var leave2=leave1%(3600*1000)
  6556. var minutes=Math.floor(leave2/(60*1000))
  6557. var shi = hours+'.'+ minutes
  6558. return he += +shi
  6559. },
  6560. // 自动选择事件长度的事件
  6561. zhoXuan(item, i) {
  6562. var iss = i
  6563. if(item.time == null) {
  6564. return
  6565. } else {
  6566. var zhi = this.zhoData[iss]
  6567. var he = 0
  6568. for(var i in zhi) {
  6569. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6570. he += +zhi[i].workingTime
  6571. }
  6572. }
  6573. zhi.he = he + 'h'
  6574. }
  6575. },
  6576. getPushWorkLogData(){
  6577. this.http.post('/sap-sync-log/list', {},
  6578. res => {
  6579. if (res.code == "ok") {
  6580. this.pushWorkTimeLogData = res.data;
  6581. } else {
  6582. this.$message({
  6583. message: res.msg,
  6584. type: "error"
  6585. });
  6586. }
  6587. },
  6588. error => {
  6589. this.$message({
  6590. message: error,
  6591. type: "error"
  6592. });
  6593. });
  6594. },
  6595. // 获取全部人员
  6596. getUsers() {
  6597. this.http.post('/user/getSimpleActiveUserList', {},
  6598. res => {
  6599. if (res.code == "ok") {
  6600. this.usersList = res.data;
  6601. } else {
  6602. this.$message({
  6603. message: res.msg,
  6604. type: "error"
  6605. });
  6606. }
  6607. },
  6608. error => {
  6609. this.$message({
  6610. message: error,
  6611. type: "error"
  6612. });
  6613. });
  6614. },
  6615. // 按时间比例
  6616. addBli(item, i) {
  6617. var iss = i
  6618. if(item.time == null) {
  6619. return
  6620. } else {
  6621. var zhi = this.zhoData[iss]
  6622. var he = 0
  6623. for(var i in zhi) {
  6624. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6625. he += +zhi[i].workingTime
  6626. }
  6627. }
  6628. zhi.he = he.toFixed(1) + 'h'
  6629. }
  6630. },
  6631. //按周填报选择的项目发生变化,需要设置列
  6632. onSelProjectChange() {
  6633. for (let i = 0; i < this.selCon.length; i++) {
  6634. var exists = false;
  6635. for (let j = 0; j < this.selProjectList.length; j++) {
  6636. if (this.selProjectList[j].id == this.selCon[i]) {
  6637. exists = true;
  6638. break;
  6639. }
  6640. }
  6641. if (!exists) {
  6642. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6643. this.selProjectList.push(newProject);
  6644. //添加新项目
  6645. for (var w in this.zhoData) {
  6646. var dayItem = this.zhoData[w];
  6647. var pName = newProject.projectName;
  6648. dayItem[pName] = {};
  6649. dayItem[pName].time = ''
  6650. dayItem[pName].content = ''
  6651. dayItem[pName].progress = 0
  6652. dayItem[pName].workingTime = 0
  6653. }
  6654. }
  6655. }
  6656. //去掉
  6657. for (let j = 0; j < this.selProjectList.length; j++) {
  6658. var exists = false;
  6659. for (let i = 0; i < this.selCon.length; i++) {
  6660. if (this.selProjectList[j].id == this.selCon[i]) {
  6661. exists = true;
  6662. break;
  6663. }
  6664. }
  6665. if (!exists) {
  6666. this.selProjectList.splice(j, 1);
  6667. j--;
  6668. }
  6669. }
  6670. this.loadFilledWeekReportItem();
  6671. //刷新表格
  6672. // this.$refs.weekTable.doLayout();
  6673. },
  6674. //根据选中的项目来刷新填写表格
  6675. loadFilledWeekReportItem() {
  6676. for (var w in this.zhoData) {
  6677. var dayItem = this.zhoData[w];
  6678. for (var i = 0; i < this.selProjectList.length; i++) {
  6679. var curColumnProject = this.selProjectList[i];
  6680. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6681. for (var t in dayItem.reportList) {
  6682. //有日报的项目,不能取消选择
  6683. for (var p in this.fillProjectList) {
  6684. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6685. }
  6686. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6687. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6688. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6689. if (this.reportTimeType.type == 2) {
  6690. //时间段模式
  6691. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6692. }
  6693. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6694. break;
  6695. }
  6696. }
  6697. // dayItem[curColumnProject.projectName] = matchReportItem;
  6698. }
  6699. }
  6700. this.$nextTick(()=>{
  6701. this.$refs.weekTable.doLayout();
  6702. });
  6703. },
  6704. initWeekFormData() {
  6705. this.weekDataLoading = true;
  6706. for (var p in this.fillProjectList) {
  6707. this.fillProjectList[p].canCancel = 1;
  6708. }
  6709. this.http.post('/report/getWeeklyReportData',{
  6710. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6711. },res => {
  6712. this.weekDataLoading = false;
  6713. if(res.code == 'ok'){
  6714. let projectList = res.data.projectList;
  6715. if (projectList.length > 0) {
  6716. //有选择过项目进行填报,直接选中
  6717. this.selProjectList = projectList;
  6718. this.selCon = [];
  6719. for (let i = 0; i < projectList.length; i++) {
  6720. this.selCon.push(projectList[i].id);
  6721. }
  6722. }
  6723. //设置日期
  6724. this.weekDateRange = res.data.dateList;
  6725. this.zhoData = [];
  6726. var arrst = []
  6727. for(var i in this.weekDateRange) {
  6728. var obj = {}
  6729. obj.zhoDataTime = this.weekDateRange[i].date
  6730. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6731. obj.he = this.weekDateRange[i].filledTime;
  6732. obj.canFill = this.weekDateRange[i].canFill;
  6733. // obj.filledTime = this.weekDateRange[i].filledTime;
  6734. obj.reportList = this.weekDateRange[i].reportList;
  6735. //初始化,防止渲染报错
  6736. for (var j = 0; j < this.selProjectList.length; j++) {
  6737. var pName = this.selProjectList[j].projectName
  6738. obj[pName] = {}
  6739. obj[pName].time = ''
  6740. obj[pName].content = ''
  6741. obj[pName].progress = 0
  6742. obj[pName].workingTime = 0
  6743. }
  6744. arrst.push(obj)
  6745. }
  6746. this.zhoData = arrst
  6747. this.setWeekCardTimeData(res.data.cardTimeList);
  6748. this.loadFilledWeekReportItem();
  6749. }else{
  6750. this.$message({
  6751. message: res.msg,
  6752. type: 'error'
  6753. })
  6754. }
  6755. },err => {
  6756. this.$message({
  6757. message: err,
  6758. type: 'error'
  6759. })
  6760. })
  6761. },
  6762. zhoZhi(res, i) {
  6763. var zhi = 0
  6764. for(var i in res) {
  6765. if(i != 'zhoDataTime' && i != 'he') {
  6766. zhi += +res[i]
  6767. }
  6768. }
  6769. res.he = zhi
  6770. },
  6771. zhoBtn(i) {
  6772. // this.zhoData.split(i, 1)
  6773. var arr = this.zhoData
  6774. arr.splice(i, 1)
  6775. },
  6776. zhoAddlast(){
  6777. this.selConShow = true
  6778. },
  6779. closeAddWeeklyReport(){
  6780. this.fillWeekDialogVisi = false
  6781. this.selConShow = true
  6782. this.selProjectList = []
  6783. this.selCon = []
  6784. },
  6785. checkDateWorkTime() {
  6786. //针对苏州景昱,单独的检查逻辑
  6787. if (this.user.companyId == 5978) {
  6788. //调接口,先检查工时是否存在异常
  6789. var zhi = this.zhoData;
  6790. var array = [];
  6791. for(let n in zhi){
  6792. if(zhi[n].he){
  6793. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6794. array.push(workData)
  6795. }
  6796. }
  6797. this.submitingReport = true;
  6798. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6799. res => {
  6800. this.submitingReport = false;
  6801. if (res.code == "ok") {
  6802. this.submitWeekReport(0)
  6803. } else {
  6804. this.$confirm(res.msg, '提示', {
  6805. confirmButtonText: '忽略并提交',
  6806. cancelButtonText: '取消',
  6807. type: 'error'
  6808. }).then(() => {
  6809. this.submitWeekReport(0)
  6810. }).catch(() => {
  6811. });
  6812. }
  6813. },
  6814. error => {
  6815. this.$message({
  6816. message: error,
  6817. type: "error"
  6818. });
  6819. });
  6820. }
  6821. },
  6822. // 提交按周填报
  6823. submitWeekReport(isDraft) {
  6824. var zhi = this.zhoData
  6825. var ll = 0
  6826. if(this.reportTimeType.type == 2) {
  6827. for(var i in zhi) {
  6828. this.dateAr = []
  6829. var alp = []
  6830. var zhis = zhi[i]
  6831. console.log(zhis)
  6832. for(var j in zhis) {
  6833. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6834. let objs = {}
  6835. objs.s = zhis[j].time[0]
  6836. objs.e = zhis[j].time[1]
  6837. objs.p = j
  6838. alp.push(objs)
  6839. }
  6840. }
  6841. console.log(alp)
  6842. this.dateAr = alp
  6843. if (this.reportTimeType.timeCanOverlap == 0) {
  6844. let str = this.$t('message.Filledtimeperiodsoverlap')
  6845. if(this.dateAr.length > 0) {
  6846. const trus = this.fns();
  6847. const overlapDataTime = this.getOverlapData(alp);
  6848. if (overlapDataTime.length > 0) {
  6849. const arrList = overlapDataTime.map((item) => item.p);
  6850. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6851. }
  6852. ll += 1
  6853. if(!trus) {
  6854. this.$message({
  6855. message: str,
  6856. type: 'error'
  6857. })
  6858. return false
  6859. }
  6860. }
  6861. } else {
  6862. if(this.dateAr.length > 0) {
  6863. ll +=1 ;
  6864. }
  6865. }
  6866. }
  6867. if(ll == 0) {
  6868. this.$message({
  6869. message: this.$t('message.Pleasefillinthetime'),
  6870. type: 'error'
  6871. })
  6872. return false
  6873. }
  6874. } else if(this.reportTimeType.type == 1){
  6875. for(var i in zhi) {
  6876. var zhis = zhi[i]
  6877. for(var j in zhis) {
  6878. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6879. ll += 1
  6880. }
  6881. }
  6882. }
  6883. if(ll == 0) {
  6884. this.$message({
  6885. message: this.$t('message.Pleaseselectatime'),
  6886. type: 'error'
  6887. })
  6888. return false
  6889. }
  6890. let overcorp = ''
  6891. for(let n in zhi){
  6892. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6893. overcorp += zhi[n].zhoDataTime + ','
  6894. }
  6895. }
  6896. if(this.user.companyId != 5978 && overcorp != ''){
  6897. overcorp = overcorp.substring(0,overcorp.length - 1)
  6898. this.$message({
  6899. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6900. type: 'error'
  6901. })
  6902. return
  6903. }
  6904. }
  6905. var submits = []
  6906. let formData = new FormData();
  6907. formData.append("draft", isDraft);
  6908. if(this.reportTimeType.multiWorktime == 1){
  6909. for (var i in this.zhoData) {
  6910. var zhoD = this.zhoData[i]
  6911. var flgs = false
  6912. for(var j in zhoD) {
  6913. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6914. flgs = true
  6915. // formData.append("degreeId", "-1");
  6916. formData.append("id", '-1');
  6917. for(var s in this.projectList) {
  6918. if(j == this.projectList[s].projectName) {
  6919. formData.append("projectId", this.projectList[s].id);
  6920. }
  6921. }
  6922. if(this.user.timeType.reportAuditType == 3){
  6923. let audItem = {}
  6924. if(this.user.timeType.auditLevel > 0){
  6925. audItem.auditorFirst = zhoD[j].auditorFirst
  6926. }
  6927. if(this.user.timeType.auditLevel > 1){
  6928. audItem.auditorSec = zhoD[j].auditorSec
  6929. }
  6930. if(this.user.timeType.auditLevel > 2){
  6931. audItem.auditorThird = zhoD[j].auditorThird
  6932. }
  6933. if(zhoD[j].ccUserid){
  6934. audItem.ccUserid = zhoD[j].ccUserid
  6935. }
  6936. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6937. }
  6938. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6939. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6940. formData.append("reportTimeType", this.reportTimeType.type);
  6941. formData.append("endTime", '');
  6942. formData.append("startTime", '');
  6943. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6944. var lix = []
  6945. var objjs = {}
  6946. objjs.startTime = zhoD[j].time[0]
  6947. objjs.endTime = zhoD[j].time[1]
  6948. if (zhoD[j].content == null || zhoD[j].content == '') {
  6949. zhoD[j].content == '-'
  6950. }
  6951. objjs.content = zhoD[j].content
  6952. lix.push(objjs)
  6953. var zhiZhi = JSON.stringify(lix)
  6954. zhiZhi = zhiZhi.replace(/,/g,"@");
  6955. formData.append("content", zhiZhi)
  6956. formData.append("isOvertime", 0)
  6957. formData.append("professionProgress", "[]")
  6958. if (zhoD[j].groupId) {
  6959. formData.append("groupId",zhoD[j].groupId)
  6960. } else {
  6961. //解决后台groupId数组越界的问题
  6962. formData.append("groupId",0)
  6963. }
  6964. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6965. formData.append("createDate",zhoD.zhoDataTime)
  6966. if (zhoD[j].projectAuditorId) {
  6967. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6968. }
  6969. if(zhoD[j].basecostId) {
  6970. formData.append("basecostId", zhoD[j].basecostId);
  6971. } else {
  6972. formData.append("basecostId", 0);
  6973. }
  6974. if(this.user.timeType.customDegreeActive){
  6975. if (this.user.timeType.customDegreeMultiple) {
  6976. if (zhoD[j].multiDegrIdArray) {
  6977. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6978. } else {
  6979. formData.append('multiDegrId','[]')
  6980. }
  6981. } else {
  6982. if (zhoD[j].degreeId) {
  6983. formData.append('degreeId',zhoD[j].degreeId)
  6984. } else {
  6985. formData.append('degreeId','-1')
  6986. }
  6987. }
  6988. }else{
  6989. formData.append("degreeId", "-1");
  6990. }
  6991. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6992. formData.append('customData',zhoD[j].customData)
  6993. }else if(this.user.timeType.customDataActive){
  6994. formData.append('customData',0)
  6995. }
  6996. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6997. formData.append('customText',zhoD[j].customText)
  6998. }else if(this.user.timeType.customTextActive){
  6999. formData.append('customText','-')
  7000. }
  7001. }
  7002. }
  7003. }
  7004. } else {
  7005. for (var i in this.zhoData) {
  7006. var zhoD = this.zhoData[i]
  7007. var flgs = false
  7008. if(this.reportTimeType.type == 2) {
  7009. for(var k in this.selProjectList) {
  7010. var pItem = this.selProjectList[k];
  7011. var pName = pItem.projectName;
  7012. var j = pName;
  7013. console.log('j==周报中的项目='+j);
  7014. if(zhoD[j].time && zhoD[j].time != 'null') {
  7015. flgs = true
  7016. // formData.append("degreeId", "-1");
  7017. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7018. for(var s in this.projectList) {
  7019. if(j == this.projectList[s].projectName) {
  7020. formData.append("projectId", this.projectList[s].id);
  7021. }
  7022. }
  7023. if(this.user.timeType.reportAuditType == 3){
  7024. let audItem = {}
  7025. if(this.user.timeType.auditLevel > 0){
  7026. audItem.auditorFirst = zhoD[j].auditorFirst
  7027. }
  7028. if(this.user.timeType.auditLevel > 1){
  7029. audItem.auditorSec = zhoD[j].auditorSec
  7030. }
  7031. if(this.user.timeType.auditLevel > 2){
  7032. audItem.auditorThird = zhoD[j].auditorThird
  7033. }
  7034. if(zhoD[j].ccUserid){
  7035. audItem.ccUserid = zhoD[j].ccUserid
  7036. }
  7037. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7038. }
  7039. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7040. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7041. formData.append("reportTimeType", this.reportTimeType.type);
  7042. formData.append("endTime", zhoD[j].time[1]);
  7043. formData.append("startTime", zhoD[j].time[0]);
  7044. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7045. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7046. formData.append("isOvertime", 0)
  7047. formData.append("professionProgress", "[]")
  7048. if (zhoD[j].groupId) {
  7049. formData.append("groupId",zhoD[j].groupId)
  7050. } else {
  7051. //解决后台groupId数组越界的问题
  7052. formData.append("groupId",0)
  7053. }
  7054. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7055. formData.append("createDate",zhoD.zhoDataTime)
  7056. if (zhoD[j].projectAuditorId) {
  7057. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7058. }
  7059. if(zhoD[j].basecostId) {
  7060. formData.append("basecostId", zhoD[j].basecostId);
  7061. } else {
  7062. formData.append("basecostId", 0);
  7063. }
  7064. if(this.user.timeType.customDegreeActive){
  7065. if (this.user.timeType.customDegreeMultiple) {
  7066. if (zhoD[j].multiDegrIdArray) {
  7067. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7068. } else {
  7069. formData.append("multiDegrId", "[]");
  7070. }
  7071. } else {
  7072. if (zhoD[j].degreeId) {
  7073. formData.append('degreeId',zhoD[j].degreeId)
  7074. } else {
  7075. formData.append("degreeId", "-1");
  7076. }
  7077. }
  7078. }else{
  7079. formData.append("degreeId", "-1");
  7080. }
  7081. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7082. formData.append('customData',zhoD[j].customData)
  7083. }else if(this.user.timeType.customDataActive){
  7084. formData.append('customData',0)
  7085. }
  7086. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7087. formData.append('customText',zhoD[j].customText)
  7088. }else if(this.user.timeType.customTextActive){
  7089. formData.append('customText','-')
  7090. }
  7091. }
  7092. }
  7093. } else {
  7094. for(var k in this.selProjectList) {
  7095. var pItem = this.selProjectList[k];
  7096. var pName = pItem.projectName;
  7097. var j = pName;
  7098. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7099. flgs = true
  7100. // formData.append("degreeId", "-1");
  7101. console.log('进入了workFpppp==='+j);
  7102. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7103. for(var s in this.projectList) {
  7104. if(j == this.projectList[s].projectName) {
  7105. formData.append("projectId", this.projectList[s].id);
  7106. }
  7107. }
  7108. if(this.user.timeType.reportAuditType == 3){
  7109. let audItem = {}
  7110. if(this.user.timeType.auditLevel > 0){
  7111. audItem.auditorFirst = zhoD[j].auditorFirst
  7112. }
  7113. if(this.user.timeType.auditLevel > 1){
  7114. audItem.auditorSec = zhoD[j].auditorSec
  7115. }
  7116. if(this.user.timeType.auditLevel > 2){
  7117. audItem.auditorThird = zhoD[j].auditorThird
  7118. }
  7119. if(zhoD[j].ccUserid){
  7120. audItem.ccUserid = zhoD[j].ccUserid
  7121. }
  7122. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7123. }
  7124. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7125. // formData.append("subProjectId", zhoD[j].subProjectId);
  7126. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7127. formData.append("reportTimeType", this.reportTimeType.type);
  7128. if(this.reportTimeType.type == 1) {
  7129. formData.append("workingTime", zhoD[j].workingTime);
  7130. } else if(this.reportTimeType.type == 2) {
  7131. formData.append("endTime", zhoD[j].time[1]);
  7132. formData.append("startTime", zhoD[j].time[0]);
  7133. } else if(this.reportTimeType.type == 3) {
  7134. formData.append("progress", zhoD[j].progress);
  7135. formData.append("workingTime", zhoD[j].workingTime);
  7136. }
  7137. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7138. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7139. formData.append("isOvertime", 0)
  7140. formData.append("professionProgress", "[]")
  7141. if (zhoD[j].groupId) {
  7142. formData.append("groupId",zhoD[j].groupId)
  7143. } else {
  7144. //解决后台groupId数组越界的问题
  7145. formData.append("groupId",0)
  7146. }
  7147. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7148. formData.append("createDate",zhoD.zhoDataTime)
  7149. if (zhoD[j].projectAuditorId) {
  7150. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7151. }
  7152. if(zhoD[j].basecostId) {
  7153. formData.append("basecostId", zhoD[j].basecostId);
  7154. } else {
  7155. formData.append("basecostId", 0);
  7156. }
  7157. if(this.user.timeType.customDegreeActive){
  7158. if (this.user.timeType.customDegreeMultiple) {
  7159. if (zhoD[j].multiDegrIdArray) {
  7160. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7161. } else {
  7162. formData.append("multiDegrId", "[]");
  7163. }
  7164. } else {
  7165. if (zhoD[j].degreeId) {
  7166. formData.append('degreeId',zhoD[j].degreeId)
  7167. } else {
  7168. formData.append("degreeId", "-1");
  7169. }
  7170. }
  7171. }else{
  7172. formData.append("degreeId", "-1");
  7173. }
  7174. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7175. formData.append('customData',zhoD[j].customData)
  7176. }else if(this.user.timeType.customDataActive){
  7177. formData.append('customData',0)
  7178. }
  7179. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7180. formData.append('customText',zhoD[j].customText)
  7181. }else if(this.user.timeType.customTextActive){
  7182. formData.append('customText','-')
  7183. }
  7184. }
  7185. }
  7186. }
  7187. }
  7188. }
  7189. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7190. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7191. if(!next) {
  7192. this.$message({
  7193. message: `【${error.join('、')}】请填写任务分组`,
  7194. type: 'error'
  7195. })
  7196. return
  7197. }
  7198. // 自定义维度
  7199. this.submitingReport = true;
  7200. this.http.uploadFile( this.port.report.editPort, formData,
  7201. res => {
  7202. // this.listLoading = false;
  7203. this.submitingReport = false;
  7204. if (res.code == "ok") {
  7205. this.$message({
  7206. message: this.$t('message.fillinsuccessfully'),
  7207. type: "success"
  7208. });
  7209. this.fillWeekDialogVisi = false
  7210. this.selConShow = true
  7211. this.zhoData = []
  7212. this.weekDateRange = ''
  7213. this.getReportList();
  7214. this.getDepartment();
  7215. // 关闭弹窗 并 清空
  7216. this.selProjectList = []
  7217. this.selCon = []
  7218. this.getRecentlyProject()
  7219. } else {
  7220. this.$message({
  7221. message: res.msg,
  7222. type: "error"
  7223. });
  7224. }
  7225. },
  7226. error => {
  7227. this.submitingReport = false;
  7228. this.$message({
  7229. message: error,
  7230. type: "error"
  7231. });
  7232. });
  7233. },
  7234. handleGroupAuditorData(data) {
  7235. const { reportAuditType } = this.user.timeType
  7236. if(reportAuditType != 1 && reportAuditType != 2) {
  7237. return {next: true}
  7238. }
  7239. let arrList = [];
  7240. Object.entries(data).forEach(([key, obj]) => {
  7241. Object.entries(obj).forEach(([projectName, projectData]) => {
  7242. if (projectData.workingTime && !projectData.groupId) {
  7243. arrList.push({
  7244. projectName,
  7245. date: obj.zhoDataTime,
  7246. dateText: obj.zhoDataTimeTxt
  7247. });
  7248. }
  7249. });
  7250. });
  7251. if(arrList.length > 0) {
  7252. return {
  7253. next: false,
  7254. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7255. }
  7256. } else {
  7257. return {
  7258. next: true,
  7259. error: [],
  7260. }
  7261. }
  7262. },
  7263. ChangeHourMinutestr (str) {
  7264. if (str !== "0" && str !== "" && str !== null) {
  7265. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7266. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7267. } else {
  7268. return "";
  7269. }
  7270. },
  7271. // 得到两个日期中间的日期
  7272. getdiffdate(stime,etime){
  7273. //初始化日期列表,数组
  7274. var diffdate = new Array();
  7275. var i=0;
  7276. //开始日期小于等于结束日期,并循环
  7277. while(stime<=etime){
  7278. diffdate[i] = stime;
  7279. //获取开始日期时间戳
  7280. var stime_ts = new Date(stime).getTime();
  7281. //增加一天时间戳后的日期
  7282. var next_date = stime_ts + (24*60*60*1000);
  7283. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7284. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7285. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7286. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7287. stime = next_dates_y+next_dates_m+next_dates_d;
  7288. //增加数组key
  7289. i++;
  7290. }
  7291. return diffdate;
  7292. },
  7293. // 添加模块
  7294. addDomain(i) {
  7295. var leftProgress = 10;
  7296. if (this.reportTimeType.type == 3) {
  7297. //计算已经待分配工时比例
  7298. let array = this.workForm.domains;
  7299. let totalProgress = 0;
  7300. for (var i=0;i<array.length; i++) {
  7301. totalProgress += array[i].progress;
  7302. }
  7303. if (totalProgress < 100) {
  7304. leftProgress = 100 - totalProgress;
  7305. }
  7306. }
  7307. var addItem = {
  7308. projectId: "",
  7309. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7310. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7311. ),
  7312. content: "",
  7313. progress:leftProgress,
  7314. state:2,//2-表示待提交
  7315. multiWorktime: this.reportTimeType.multiWorktime,
  7316. worktimeList:[{}],
  7317. canEdit: true,
  7318. auditorFirst: '',
  7319. auditorSec: '',
  7320. auditorThird: '',
  7321. ccUserid: ''
  7322. // degreeId: '',
  7323. };
  7324. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7325. this.$set(addItem,'isOvertime',true)
  7326. if(this.reportTimeType.type == 3){
  7327. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7328. }
  7329. }
  7330. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7331. //默认给第一个,必填字段
  7332. addItem.basecostId = this.timeBasecostList[0].id;
  7333. }
  7334. this.workForm.domains.push(addItem);
  7335. document.getElementById('workFormsItemBottom').scrollIntoView()
  7336. this.canEdit = true
  7337. if (this.reportTimeType.type == 0) {
  7338. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7339. var length = this.workForm.domains.length;
  7340. if (length == 2) {
  7341. this.showAddMore = false;
  7342. }
  7343. }
  7344. this.chuji()
  7345. this.seleChn()
  7346. },
  7347. // 移除模块
  7348. delDomain(i) {
  7349. this.workForm.domains.splice(i,1)
  7350. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7351. if (!this.originCanEdit) {
  7352. let iscan = false
  7353. for(let i in this.workForm.domains){
  7354. if(this.workForm.domains[i].canEdit){
  7355. iscan = true
  7356. }
  7357. }
  7358. this.canEdit = iscan
  7359. }
  7360. //检测当前剩下的一个,时间类型是否是全天
  7361. if (this.reportTimeType.type == 0) {
  7362. if (this.workForm.domains[0].timeType == 0) {
  7363. this.showAddMore = false;
  7364. } else {
  7365. this.showAddMore = true;
  7366. }
  7367. }
  7368. if(this.user.timeType.multiWorktime == 1) {
  7369. this.iptChangs()
  7370. } else {
  7371. this.seleChn(0)
  7372. }
  7373. },
  7374. // 改变月份
  7375. changeMonth() {
  7376. this.isWeekend = false
  7377. let date = new Date()
  7378. let nowmon = date.getMonth() + 1
  7379. let nowday = date.getDate()
  7380. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7381. if (this.isBatch == 0) {
  7382. if(this.user.timeType.fillAhead == 0){
  7383. let date_a = new Date(this.workForm.createDate)
  7384. if(date_a.getTime() > date.getTime()){
  7385. this.workForm.createDate = nowdate
  7386. }
  7387. }
  7388. //只有按天填报才能获取当天的日报
  7389. if(!this.isSubstitude){
  7390. let weekday = new Date(this.workForm.createDate).getDay()
  7391. if(this.user.companyId == 817){
  7392. if(weekday == 0){
  7393. this.isWeekend = true
  7394. }
  7395. }else{
  7396. if(weekday == 0 || weekday == 6){
  7397. this.isWeekend = true
  7398. }
  7399. }
  7400. this.getReport()
  7401. }
  7402. }else {
  7403. if(this.user.timeType.fillAhead == 0){
  7404. let date_a = new Date(this.workForm.createDate[1])
  7405. if(date_a.getTime() > date.getTime()){
  7406. this.workForm.createDate[1] = nowdate
  7407. let sdate = new Date(this.workForm.createDate[0])
  7408. let edate = new Date(this.workForm.createDate[1])
  7409. if(sdate > edate){
  7410. this.workForm.createDate[0] = this.workForm.createDate[1]
  7411. }
  7412. }
  7413. }
  7414. }
  7415. },
  7416. // 判断时间段
  7417. fns() {
  7418. for (let k in this.dateAr) {
  7419. if (!this.judege(k)) {
  7420. return false
  7421. }
  7422. }
  7423. return true
  7424. },
  7425. judege(idx){
  7426. for (let k in this.dateAr) {
  7427. if (idx !== k) {
  7428. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7429. return false
  7430. }
  7431. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7432. return false
  7433. }
  7434. }
  7435. }
  7436. return true
  7437. },
  7438. getOverlapData(data) {
  7439. let overlapData = [];
  7440. for (let i = 0; i < data.length; i++) {
  7441. for (let j = i + 1; j < data.length; j++) {
  7442. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7443. overlapData.push(data[i], data[j]);
  7444. }
  7445. }
  7446. }
  7447. return overlapData;
  7448. },
  7449. // 保存日报111111
  7450. submitReport(isDraft) {
  7451. this.isDraft = isDraft;
  7452. this.$refs.workForm.validate(valid => {
  7453. if (valid) {
  7454. if (!isDraft) {
  7455. //针对苏州景昱,单独的检查逻辑
  7456. if (this.user.companyId == 5978) {
  7457. //调接口,先检查工时是否存在异常
  7458. var totalTime = 0;
  7459. for (var t=0;t<this.workForm.domains.length; t++) {
  7460. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7461. }
  7462. var array = [];
  7463. if (this.isBatch) {
  7464. var startDate = new Date(this.workForm.createDate[0]);
  7465. var endDate = new Date(this.workForm.createDate[1]);
  7466. if (startDate > endDate) {
  7467. this.$message({
  7468. message: '开始日期不能大于结束日期',
  7469. type: "error"
  7470. });
  7471. return
  7472. } else {
  7473. while(true){
  7474. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7475. array.push(workData);
  7476. startDate.setDate(startDate.getDate() + 1);
  7477. if (startDate > endDate) {
  7478. break;
  7479. }
  7480. }
  7481. }
  7482. } else {
  7483. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7484. array.push(workData)
  7485. }
  7486. this.submitingReport = true;
  7487. var passUserId = this.user.id;
  7488. if (this.isSubstitude) {
  7489. passUserId = this.targetUids;
  7490. }
  7491. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7492. res => {
  7493. this.submitingReport = false;
  7494. if (res.code == "ok") {
  7495. this.submitReportSon()
  7496. } else {
  7497. this.$confirm(res.msg, '提示', {
  7498. confirmButtonText: '忽略并提交',
  7499. cancelButtonText: '取消',
  7500. type: 'error'
  7501. }).then(() => {
  7502. this.submitReportSon()
  7503. }).catch(() => {
  7504. });
  7505. }
  7506. },
  7507. error => {
  7508. this.$message({
  7509. message: error,
  7510. type: "error"
  7511. });
  7512. });
  7513. } else {
  7514. if(this.totalReportHours < this.user.timeType.allday){
  7515. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7516. confirmButtonText: '确定',
  7517. cancelButtonText: '取消',
  7518. type: 'warning'
  7519. }).then(() => {
  7520. this.submitReportSon()
  7521. }).catch(() => {
  7522. });
  7523. }else{
  7524. this.submitReportSon()
  7525. }
  7526. }
  7527. } else {
  7528. //暂存,不需要检查工时是否超过考勤
  7529. this.submitReportSon()
  7530. }
  7531. }
  7532. });
  7533. },
  7534. submitReportSon() {
  7535. this.dateAr = []
  7536. //检查重叠
  7537. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7538. let alp = []
  7539. if(this.user.timeType.multiWorktime != 1) {
  7540. for(var p in this.workForm.domains) {
  7541. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7542. let objs = {}
  7543. objs.s = this.workForm.domains[p].startTime
  7544. objs.e = this.workForm.domains[p].endTime
  7545. alp.push(objs)
  7546. }
  7547. }
  7548. this.dateAr = alp
  7549. if(this.dateAr.length > 0) {
  7550. let trus = this.fns()
  7551. if(!trus) {
  7552. this.$message({
  7553. message: this.$t('message.Filledtimeperiodsoverlap'),
  7554. type: "error"
  7555. });
  7556. return
  7557. }
  7558. }
  7559. } else {
  7560. for(var p in this.workForm.domains) {
  7561. var slll = this.workForm.domains[p]
  7562. for(var o in slll.worktimeList) {
  7563. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7564. let objs = {}
  7565. objs.s = slll.worktimeList[o].startTime
  7566. objs.e = slll.worktimeList[o].endTime
  7567. alp.push(objs)
  7568. }
  7569. }
  7570. }
  7571. this.dateAr = alp
  7572. if(this.dateAr.length > 0) {
  7573. let trus = this.fns()
  7574. if(!trus) {
  7575. this.$message({
  7576. message: this.$t('message.Filledtimeperiodsoverlap'),
  7577. type: "error"
  7578. });
  7579. return
  7580. }
  7581. }
  7582. }
  7583. }
  7584. //检查子项目
  7585. if (this.user.timeType.subProMustFill == 1) {
  7586. for(var p in this.workForm.domains) {
  7587. var oneProItem = this.workForm.domains[p]
  7588. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7589. //没有选择子项目
  7590. this.$message({
  7591. message: '子项目必填,请检查',
  7592. type: "error"
  7593. });
  7594. return
  7595. }
  7596. }
  7597. }
  7598. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7599. if (this.user.companyId == this.yuzhongCompId) {
  7600. for(var p in this.workForm.domains) {
  7601. var oneProItem = this.workForm.domains[p]
  7602. if (!oneProItem.extraField1) {
  7603. this.$message({
  7604. message: '角色必填,请检查',
  7605. type: "error"
  7606. });
  7607. return
  7608. }
  7609. if (!oneProItem.extraField2) {
  7610. this.$message({
  7611. message: '工作职责必填,请检查',
  7612. type: "error"
  7613. });
  7614. return
  7615. }
  7616. if (!oneProItem.extraField3) {
  7617. this.$message({
  7618. message: '工作内容必填,请检查',
  7619. type: "error"
  7620. });
  7621. return
  7622. }
  7623. }
  7624. }
  7625. // return
  7626. //代填的情况,检查人员是否已经选择
  7627. if (this.isSubstitude) {
  7628. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7629. this.$message({
  7630. message: this.$t('message.pleaseselectthepersontofillin'),
  7631. type: "error"
  7632. });
  7633. return;
  7634. }
  7635. }
  7636. //检查时间,全天和上下午不能同时存在
  7637. if (this.reportTimeType.type == 0) {
  7638. var alldayNum = 0;
  7639. var amNum = 0;
  7640. var pmNum = 0;
  7641. for(var i in this.workForm.domains) {
  7642. if (this.workForm.domains[i].timeType == 0) {
  7643. alldayNum ++;
  7644. } else if (this.workForm.domains[i].timeType == 1) {
  7645. amNum++;
  7646. } else if (this.workForm.domains[i].timeType == 2) {
  7647. pmNum++;
  7648. }
  7649. }
  7650. if (alldayNum > 1) {
  7651. this.$message({
  7652. // message: "工作时间-全天,只能选择一次",
  7653. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7654. type: "error"
  7655. });
  7656. return;
  7657. }
  7658. if (amNum > 1) {
  7659. this.$message({
  7660. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7661. type: "error"
  7662. });
  7663. return;
  7664. }
  7665. if (pmNum > 1) {
  7666. this.$message({
  7667. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7668. type: "error"
  7669. });
  7670. return;
  7671. }
  7672. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7673. this.$message({
  7674. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7675. type: "error"
  7676. });
  7677. return;
  7678. }
  7679. } else if (this.reportTimeType.type == 3) {
  7680. //总百分比不能超过100%
  7681. let total = 0;
  7682. this.workForm.domains.forEach(w=>{total += w.progress});
  7683. if (total > 100) {
  7684. this.$message({
  7685. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7686. type: "error"
  7687. });
  7688. return;
  7689. } else if (total < 100) {
  7690. this.$message({
  7691. message: this.$t('message.cannotbesubmitted'),
  7692. type: "error"
  7693. });
  7694. return;
  7695. }
  7696. }
  7697. this.listLoading = true;
  7698. let formData = new FormData();
  7699. formData.append("draft", this.isDraft);
  7700. var totalTime = 0;
  7701. for (var t=0;t<this.workForm.domains.length; t++) {
  7702. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7703. }
  7704. //批量填报不校验考勤时长,交给后台校验
  7705. if (!this.isBatch) {
  7706. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7707. if (this.workForm.time){
  7708. if (this.workForm.time.workHours == 0){
  7709. this.$message({
  7710. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7711. type: 'error'
  7712. })
  7713. return
  7714. }
  7715. }else{
  7716. this.$message({
  7717. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7718. type: 'error'
  7719. })
  7720. return
  7721. }
  7722. }
  7723. }
  7724. //针对凡己和景昱,此处不校验考勤时长
  7725. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7726. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7727. this.$message({
  7728. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7729. type: "error"
  7730. });
  7731. return;
  7732. }
  7733. }
  7734. for(var i in this.workForm.domains) {
  7735. // 检查任务/里程碑是否为必填
  7736. let taskRequired = this.user.timeType.taskRequired
  7737. if(taskRequired == 1) {
  7738. if(!this.workForm.domains[i].taskId) {
  7739. this.$message({
  7740. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7741. type: "error"
  7742. });
  7743. return
  7744. }
  7745. }
  7746. if(this.user.timeType.reportAuditType == 3){
  7747. let audItem = {}
  7748. let auditRule = ''
  7749. if(this.workForm.domains[i].id){
  7750. audItem.reportId = this.workForm.domains[i].id
  7751. }
  7752. if(this.user.timeType.auditLevel > 0){
  7753. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7754. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7755. }
  7756. if(this.user.timeType.auditLevel > 1){
  7757. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7758. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7759. }
  7760. if(this.user.timeType.auditLevel > 2){
  7761. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7762. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7763. }
  7764. if(this.workForm.domains[i].ccUserid){
  7765. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7766. }
  7767. if(auditRule){
  7768. auditRule = auditRule.substring(0,auditRule.length - 1)
  7769. this.$message({
  7770. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7771. type: 'error'
  7772. })
  7773. return
  7774. }
  7775. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7776. }
  7777. if (this.user.timeType.customDegreeActive) {
  7778. if (this.user.timeType.customDegreeMultiple) {
  7779. //多选
  7780. if (this.workForm.domains[i].multiDegrIdArray) {
  7781. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7782. degreeArray = degreeArray.replace(/,/g,"@");
  7783. formData.append("multiDegrId", degreeArray);
  7784. } else {
  7785. formData.append("multiDegrId", '[]');
  7786. }
  7787. } else {
  7788. //单选
  7789. if (this.workForm.domains[i].degreeId) {
  7790. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7791. } else {
  7792. formData.append("degreeId", -1);
  7793. }
  7794. }
  7795. } else {
  7796. formData.append("degreeId", -1);
  7797. }
  7798. if(this.workForm.domains[i].customData) {
  7799. // var sss = this.workForm.domains[i].degreeId.toString()
  7800. formData.append("customData", this.workForm.domains[i].customData);
  7801. } else {
  7802. formData.append("customData", 0);
  7803. }
  7804. if(this.workForm.domains[i].customText) {
  7805. formData.append("customText", this.workForm.domains[i].customText);
  7806. } else {
  7807. formData.append("customText", '-');
  7808. }
  7809. if (this.workForm.domains[i].id) {
  7810. formData.append("id", this.workForm.domains[i].id);
  7811. } else {
  7812. formData.append("id", -1);
  7813. }
  7814. formData.append("projectId", this.workForm.domains[i].projectId);
  7815. if (this.workForm.domains[i].subProjectId) {
  7816. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7817. } else {
  7818. formData.append("subProjectId", 0);
  7819. }
  7820. if (this.workForm.domains[i].groupId) {
  7821. formData.append("groupId", this.workForm.domains[i].groupId);
  7822. } else {
  7823. formData.append("groupId", 0);
  7824. }
  7825. if (this.workForm.domains[i].taskId) {
  7826. formData.append("taskId", this.workForm.domains[i].taskId);
  7827. } else {
  7828. formData.append("taskId", 0);
  7829. }
  7830. if (this.workForm.domains[i].taskFinish == true) {
  7831. formData.append("taskFinish", 1);
  7832. } else {
  7833. formData.append("taskFinish", 0);
  7834. }
  7835. formData.append("reportTimeType", this.reportTimeType.type);
  7836. if (this.reportTimeType.type == 0) {
  7837. formData.append("timeType", this.workForm.domains[i].timeType);
  7838. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7839. formData.append("workingTime", workingTime);
  7840. } else if (this.reportTimeType.type == 1){
  7841. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7842. } else if (this.reportTimeType.type == 2) {
  7843. formData.append("endTime", this.workForm.domains[i].endTime);
  7844. formData.append("startTime", this.workForm.domains[i].startTime);
  7845. } else if (this.reportTimeType.type == 3) {
  7846. //按比例分配
  7847. formData.append("progress", this.workForm.domains[i].progress);
  7848. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7849. }
  7850. if(this.user.timeType.choseFromAlbum == 1 ) {
  7851. console.log(this.workForm.domains[i].imgList)
  7852. if(this.workForm.domains[i].imgList) {
  7853. let imgListFor = this.workForm.domains[i].imgList
  7854. for(var b in imgListFor) {
  7855. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7856. }
  7857. console.log(imgListFor)
  7858. let m = JSON.stringify(imgListFor);
  7859. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7860. formData.append("picStr", m);
  7861. } else {
  7862. formData.append("picStr", '[]');
  7863. }
  7864. }
  7865. //处理多个时间事项
  7866. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7867. if (this.reportTimeType.multiWorktime == 1) {
  7868. //检查时间是否有重叠
  7869. var workList = this.workForm.domains[i].worktimeList;
  7870. for (var j=0;j<workList.length; j++) {
  7871. var curItem = workList[j];
  7872. //检查开始时间是否大于结束时间
  7873. if (curItem.startTime >= curItem.endTime) {
  7874. this.$message({
  7875. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7876. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7877. type: "error"
  7878. });
  7879. return;
  7880. }
  7881. //时间不可重叠
  7882. if (this.reportTimeType.timeCanOverlap == 0) {
  7883. for (var p = j+1;p<workList.length; p++) {
  7884. var jItem = workList[p];
  7885. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7886. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7887. this.$message({
  7888. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7889. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7890. type: "error"
  7891. });
  7892. return;
  7893. }
  7894. }
  7895. }
  7896. }
  7897. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7898. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7899. formData.append("content", m);
  7900. } else {
  7901. if (this.workForm.domains[i].content) {
  7902. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7903. m = m.replace(/,/g,",");
  7904. console.log(m, '需要传值的数据')
  7905. // formData.append("content", this.workForm.domains[i].content);
  7906. formData.append("content", m);
  7907. } else {
  7908. formData.append("content", '-');
  7909. }
  7910. }
  7911. if (this.isBatch == 0) {
  7912. formData.append("createDate", this.workForm.createDate);
  7913. } else {
  7914. //批量填报,时间范围
  7915. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7916. }
  7917. if(this.workForm.domains[i].isOvertime) {
  7918. formData.append("isOvertime", 1);
  7919. } else {
  7920. formData.append("isOvertime", 0);
  7921. }
  7922. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7923. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7924. } else {
  7925. formData.append("overtimeHours", 0);
  7926. }
  7927. if(this.workForm.domains[i].basecostId) {
  7928. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7929. } else {
  7930. formData.append("basecostId", 0);
  7931. }
  7932. if (this.workForm.userId != null) {
  7933. var targetUids = '';
  7934. this.workForm.userId.forEach(u=>{
  7935. targetUids += u + '@';
  7936. });
  7937. if (targetUids.length > 0) {
  7938. targetUids = targetUids.substring(0, targetUids.length -1);
  7939. formData.append("targetUids", targetUids);
  7940. }
  7941. }
  7942. //项目专业进度
  7943. if (this.workForm.domains[i].professionProgress) {
  7944. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7945. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7946. formData.append("professionProgress", m);
  7947. } else {
  7948. formData.append("professionProgress", "[]");
  7949. }
  7950. if (this.workForm.domains[i].stage) {
  7951. formData.append("stage", this.workForm.domains[i].stage);
  7952. } else {
  7953. formData.append("stage", "-");
  7954. }
  7955. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7956. if (this.workForm.domains[i].projectAuditorId) {
  7957. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7958. } else {
  7959. // console.log('执行到了这里')
  7960. // console.log(this.user.timeType.reportAuditType)
  7961. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7962. this.$message({
  7963. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7964. type: "error"
  7965. });
  7966. return;
  7967. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7968. //分组负责人先审核, 确定是选择了任务分组
  7969. if (this.workForm.domains[i].taskGroups.length == 0) {
  7970. this.$message({
  7971. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7972. type: "error"
  7973. });
  7974. } else if (!this.workForm.domains[i].groupId) {
  7975. // console.log(this.workForm.domains[i]);
  7976. this.$message({
  7977. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7978. type: "error"
  7979. });
  7980. } else {
  7981. this.$message({
  7982. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7983. type: "error"
  7984. });
  7985. }
  7986. return;
  7987. }
  7988. }
  7989. if (this.user.companyId == this.yuzhongCompId) {
  7990. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7991. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7992. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7993. }
  7994. //依斯贝的服务Id
  7995. if (this.user.companyId == this.yisibeiCompId) {
  7996. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7997. }
  7998. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7999. this.$message({
  8000. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  8001. type: "error"
  8002. });
  8003. return
  8004. }
  8005. if(this.user.timeType.userWithMultiDept == 1) {
  8006. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8007. }
  8008. }
  8009. this.submitingReport = true;
  8010. this.http.uploadFile( this.port.report.editPort, formData,
  8011. res => {
  8012. this.listLoading = false;
  8013. this.submitingReport = false;
  8014. if (res.code == "ok") {
  8015. if(res.msg!=null){
  8016. this.$message({
  8017. dangerouslyUseHTMLString: true,
  8018. message: res.msg,
  8019. type: "warning",
  8020. showClose: true,
  8021. duration: 0
  8022. });
  8023. }else{
  8024. this.$message({
  8025. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8026. type: "success"
  8027. });
  8028. }
  8029. this.dialogVisible = false;
  8030. this.jsDay = 0
  8031. this.jsTime = 0
  8032. this.getReportList();
  8033. this.getDepartment();
  8034. this.getRecentlyProject()
  8035. } else {
  8036. this.$message({
  8037. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8038. type: "error"
  8039. });
  8040. }
  8041. },
  8042. error => {
  8043. this.listLoading = false;
  8044. this.submitingReport = false;
  8045. this.$message({
  8046. message: error,
  8047. type: "error"
  8048. });
  8049. });
  8050. },
  8051. // 判断是展示那个工时导入
  8052. imports() {
  8053. if(this.user.timeType.syncCorpwxTime == 0) {
  8054. this.importDialog = true
  8055. } else {
  8056. this.importWxDialog = true
  8057. }
  8058. },
  8059. // 跳转
  8060. junpToDeskTop(id) {
  8061. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8062. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8063. },
  8064. // 通过日报
  8065. approve(id, item) {
  8066. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8067. this.approveinData = {
  8068. id: id,
  8069. date: this.date +day,
  8070. reportIds: item.id
  8071. }
  8072. if(this.user.timeType.needEvaluate == 1){
  8073. this.$set(this.approveinData,'evaluate','')
  8074. this.approveinDialog = true
  8075. }else{
  8076. this.logining = true;
  8077. this.approveinfun()
  8078. }
  8079. },
  8080. approveinfun(){
  8081. this.http.post( this.port.report.approve, this.approveinData,
  8082. res => {
  8083. this.logining = false;
  8084. if (res.code == "ok") {
  8085. this.approveinDialog = false
  8086. this.$message({
  8087. message: this.$t('message.Reviewsucceeded'),
  8088. type: "success"
  8089. });
  8090. this.refreshReportData(this.approveinData.reportIds);
  8091. this.getDepartment();
  8092. } else {
  8093. this.$message({
  8094. message: res.msg,
  8095. type: "error"
  8096. });
  8097. }
  8098. },
  8099. error => {
  8100. this.logining = false;
  8101. this.$message({
  8102. message: error,
  8103. type: "error"
  8104. });
  8105. });
  8106. },
  8107. //撤回日报
  8108. cancel(item,e) {
  8109. // console.log('can can need',item);
  8110. this.logining = true;
  8111. var ids = '';
  8112. var data = e ? item : item.data;
  8113. data.forEach(element => {
  8114. if(element.id){
  8115. ids +=(element.id+',');
  8116. }
  8117. });
  8118. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8119. res => {
  8120. this.logining = false;
  8121. if (res.code == "ok") {
  8122. this.$message({
  8123. message:this.$t('message.Withdrawalsucceeded'),
  8124. type: "success"
  8125. });
  8126. this.getReportList();
  8127. if(e){this.getReport()}
  8128. this.getDepartment();
  8129. } else {
  8130. this.$message({
  8131. message: res.msg,
  8132. type: "error"
  8133. });
  8134. }
  8135. },
  8136. error => {
  8137. this.logining = false;
  8138. this.$message({
  8139. message: error,
  8140. type: "error"
  8141. });
  8142. });
  8143. },
  8144. showDenyDialog(id,i, item) {
  8145. this.denyReasonDialog = true;
  8146. this.isDenying = false;
  8147. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8148. var ids = item.id;
  8149. // var data = item.data;
  8150. // data.forEach(element => {
  8151. // ids +=(element.id+',');
  8152. // });
  8153. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8154. },
  8155. // 未通过日报
  8156. deny() {
  8157. this.logining = true;
  8158. this.isDenying = true;
  8159. this.http.post( this.port.report.deny, this.denyForm,
  8160. res => {
  8161. this.logining = false;
  8162. this.isDenying = false;
  8163. if (res.code == "ok") {
  8164. this.$message({
  8165. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8166. type: "success"
  8167. });
  8168. this.refreshReportData(this.denyForm.reportIds);
  8169. this.getDepartment();
  8170. this.denyReasonDialog = false;
  8171. } else {
  8172. this.$message({
  8173. message: res.msg,
  8174. type: "error"
  8175. });
  8176. }
  8177. },
  8178. error => {
  8179. this.logining = false;
  8180. this.$message({
  8181. message: error,
  8182. type: "error"
  8183. });
  8184. });
  8185. },
  8186. // 查看工时记录弹窗
  8187. toView() {
  8188. this.toViewDialogVisible = true
  8189. this.toViewloading = true
  8190. this.getToView()
  8191. },
  8192. getToView() {
  8193. this.http.post( '/report-import-log/getList', this.toViewForm,
  8194. res => {
  8195. this.toViewloading = false;
  8196. if (res.code == "ok") {
  8197. // console.log(res.data, '数据数据')
  8198. this.toViewList = res.data.records
  8199. this.toViewForm.total = res.data.total
  8200. } else {
  8201. this.toViewloading = false;
  8202. this.$message({
  8203. message: res.msg,
  8204. type: "error"
  8205. });
  8206. }
  8207. })
  8208. },
  8209. // 触发 selectCat 组件更改他的值
  8210. selectCatCli(obj) {
  8211. // console.log(obj, '看看')
  8212. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8213. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8214. },
  8215. vueCasader(obj) {
  8216. console.log(obj, '看看值', this.departmentList)
  8217. if(obj.distinction == 1 && obj.item) {
  8218. let arr = []
  8219. arr.push(obj.item.value)
  8220. this.exportParam.departmentId = arr
  8221. }
  8222. if(obj.distinction == '10' && obj) {
  8223. const { id, other } = obj
  8224. this.workForm.domains[other].reportTargetDeptId = id
  8225. }
  8226. if(obj.distinction == '14' && obj) {
  8227. let arr = []
  8228. arr.push(obj.id)
  8229. this.deptIdForHasReport = arr
  8230. this.showMonthWorkTime()
  8231. }
  8232. if(obj.distinction == '15' && obj) {
  8233. let arr = []
  8234. arr.push(obj.id)
  8235. this.deptIdForNoReport = arr
  8236. this.showMonthNotWorkTime()
  8237. }
  8238. if(obj.distinction == '16' && obj) {
  8239. let arr = []
  8240. arr.push(obj.id)
  8241. this.deptIdForReminder = arr
  8242. this.showMonthWorkTimeReminder()
  8243. }
  8244. },
  8245. //分页
  8246. handleCurrentChange(val) {
  8247. this.toViewForm.pageIndex = val;
  8248. this.getToView();
  8249. },
  8250. handleSizeChange(val) {
  8251. this.toViewForm.pageSize = val;
  8252. this.getToView();
  8253. },
  8254. getAllUsersList(){
  8255. this.http.post('/user/getSimpleActiveUserList',{
  8256. },res => {
  8257. if(res.code == 'ok'){
  8258. this.allUsersList = res.data
  8259. }else{
  8260. this.$message({
  8261. message: res.msg,
  8262. type: 'error'
  8263. })
  8264. }
  8265. },err => {
  8266. this.$message({
  8267. message: err,
  8268. type: 'error'
  8269. })
  8270. })
  8271. },
  8272. //景昱变更提醒
  8273. changeReminder(item){
  8274. console.log("============",item)
  8275. let parameter={
  8276. startDate: this.WorktimeDatepickValue[0],
  8277. endDate: this.WorktimeDatepickValue[1],
  8278. }
  8279. if(item){
  8280. parameter.createDate=item.createDate,
  8281. parameter.userId=item.userId
  8282. }
  8283. this.http.post('/report/changeReminder',parameter,res => {
  8284. if(res.code == 'ok'){
  8285. this.$message({
  8286. message: res.msg,
  8287. type: 'success'
  8288. })
  8289. }else{
  8290. this.$message({
  8291. message: res.msg,
  8292. type: 'error'
  8293. })
  8294. }
  8295. },err => {
  8296. this.$message({
  8297. message: err,
  8298. type: 'error'
  8299. })
  8300. })
  8301. },
  8302. //景昱取消异常
  8303. cancelReminder(item){
  8304. let parameter={}
  8305. if(item){
  8306. parameter.createDate=item.createDate,
  8307. parameter.userId=item.userId
  8308. }
  8309. this.http.post('/report/cancelReminder',parameter,res => {
  8310. if(res.code == 'ok'){
  8311. this.$message({
  8312. message: res.msg,
  8313. type: 'success'
  8314. })
  8315. }else{
  8316. this.$message({
  8317. message: res.msg,
  8318. type: 'error'
  8319. })
  8320. }
  8321. },err => {
  8322. this.$message({
  8323. message: err,
  8324. type: 'error'
  8325. })
  8326. })
  8327. this.showMonthWorkTimeReminder()
  8328. },
  8329. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8330. fillWeekCustomClne() {
  8331. this.fillWeekDialogVisiCustom = false
  8332. },
  8333. fillWeekCustomSubmit() {
  8334. this.getReportList();
  8335. this.getDepartment();
  8336. this.getRecentlyProject()
  8337. },
  8338. // 待填日报姓名搜索
  8339. nameAearchSeek(flg) {
  8340. if(!this.nameAearch) {
  8341. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8342. return
  8343. }
  8344. if(flg) {
  8345. this.enterpriseWechatgetUser()
  8346. }
  8347. },
  8348. handleThreeData(userList) {
  8349. console.log(userList, '人员数据')
  8350. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8351. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8352. },
  8353. // 过滤树节点
  8354. filterTreeNodes(treeData, filterKeywords) {
  8355. return treeData.filter((node) => {
  8356. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8357. if (node.children && node.children.length > 0) {
  8358. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8359. }
  8360. return true;
  8361. }
  8362. if (node.children && node.children.length > 0) {
  8363. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8364. return node.children.length > 0;
  8365. }
  8366. return false;
  8367. });
  8368. },
  8369. // 企业微信获取人员
  8370. enterpriseWechatgetUser() {
  8371. this.deptMembDataLoading = true
  8372. this.http.post('/user/getEmployeeList',{
  8373. departmentId: -1,
  8374. pageIndex: 1,
  8375. pageSize: 100,
  8376. keyword: this.nameAearch,
  8377. status: '',
  8378. roleId: '',
  8379. cursor: '',
  8380. onlyDirect: '',
  8381. matchingType: ''
  8382. },res => {
  8383. if(res.code == 'ok'){
  8384. this.deptMembDataLoading = false
  8385. const userListName = res.data.records.map(item => item.name)
  8386. this.handleThreeData(userListName)
  8387. }else{
  8388. this.deptMembDataLoading = false
  8389. this.$message({
  8390. message: res.msg,
  8391. type: 'error'
  8392. })
  8393. }
  8394. },err => {
  8395. this.deptMembDataLoading = false
  8396. this.$message({
  8397. message: err,
  8398. type: 'error'
  8399. })
  8400. })
  8401. },
  8402. // 按周填报获取相关任务
  8403. async getWeeklyTaskList(item) {
  8404. console.log(item, '<=== 数据')
  8405. const { projectId, groupId, stage, taskId } = item
  8406. console.log(projectId, groupId, stage)
  8407. let parms = { projectId, isSubstitude: 0 }
  8408. groupId ? parms.groupId = groupId : ''
  8409. stage ? parms.stage = stage : ''
  8410. const { data } = await this.postData('/task/getRecentTask', parms)
  8411. this.zhoBao.taskId = taskId
  8412. this.$set(this.zhoBao, 'taskList', data)
  8413. console.log(this.zhoBao)
  8414. },
  8415. // 封装 post 请求
  8416. postData(url, params) {
  8417. return new Promise((resolve, reject) => {
  8418. this.http.post(url, { ...params },
  8419. res => {
  8420. resolve(res)
  8421. },
  8422. error => {
  8423. this.$message({
  8424. message: error,
  8425. type: "error"
  8426. });
  8427. reject(error)
  8428. })
  8429. })
  8430. },
  8431. // 自定义事件
  8432. selectCal(obj) {
  8433. console.log(obj, '传数据来源')
  8434. if(obj.distinction == '1') {
  8435. this.zhoBao.projectAuditorId = obj.id
  8436. } else if(obj.distinction == '2') {
  8437. this.zhoBao.auditorFirst = obj.id
  8438. } else if(obj.distinction == '3') {
  8439. this.zhoBao.auditorSec = obj.id
  8440. } else if(obj.distinction == '4') {
  8441. this.zhoBao.auditorThird = obj.id
  8442. } else if(obj.distinction == '5') {
  8443. this.zhoBao.ccUserid = obj.id
  8444. } else if(obj.distinction == '12') {
  8445. this.usersListId = obj.id
  8446. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8447. this.searchKeyword = obj.name
  8448. } else {
  8449. this.searchKeyword = ''
  8450. }
  8451. this.searchScreen(0)
  8452. } else if(obj.distinction == '13') {
  8453. this.usersListId = obj.id
  8454. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8455. this.searchKeyword = obj.name
  8456. } else {
  8457. this.searchKeyword = ''
  8458. }
  8459. this.searchScreen(1)
  8460. }
  8461. }
  8462. },
  8463. created() {
  8464. this.getUsers()
  8465. let height = window.innerHeight;
  8466. this.tableHeight = height - 178;
  8467. const that = this;
  8468. window.onresize = function temp() {
  8469. that.tableHeight = window.innerHeight - 178;
  8470. };
  8471. this.toViewForm.companyId = this.user.companyId
  8472. this.initDrag([{
  8473. type: "LR",
  8474. domClass: {
  8475. // 中间分割线的名字
  8476. resize: "line-line",
  8477. // 左侧盒子的名字
  8478. left: "box-left",
  8479. // 右侧盒子的名字
  8480. right: "box-right",
  8481. // 父级的名字
  8482. box: "box-father",
  8483. },
  8484. otherInfo: {
  8485. // 限制左边栏最低宽度
  8486. leftWidth: 120,
  8487. },
  8488. },
  8489. {
  8490. type: "LR",
  8491. domClass: {
  8492. // 中间分割线的名字
  8493. resize: "line-second",
  8494. // 左侧盒子的名字
  8495. left: "left-laowang",
  8496. // 右侧盒子的名字
  8497. right: "box-second-father",
  8498. // 父级的名字
  8499. box: "grand",
  8500. },
  8501. otherInfo: {
  8502. // 限制左边栏最低宽度
  8503. leftWidth: 120,
  8504. },
  8505. },
  8506. ]);
  8507. }
  8508. };
  8509. </script>
  8510. <style lang="scss" scoped>
  8511. .fillWeekDialogVisiCustom {
  8512. width: 100%;
  8513. height: 70vh;
  8514. }
  8515. .fillWeekCustom {
  8516. .el-dialog__body {
  8517. padding: 20px 20px !important;
  8518. }
  8519. }
  8520. .photos {
  8521. position: relative;
  8522. display: flex;
  8523. flex-wrap: wrap;
  8524. }
  8525. .photos_img {
  8526. width: 120px;
  8527. height: 120px;
  8528. margin-right: 20px;
  8529. margin-bottom: 20px;
  8530. cursor: pointer;
  8531. img {
  8532. width: 100%;
  8533. height: 100%;
  8534. }
  8535. }
  8536. .paginatis {
  8537. padding: 10px 10px;
  8538. background: #f2f2f2;
  8539. }
  8540. .waiting {
  8541. color:orange;
  8542. }
  8543. .filledReportStyle {
  8544. color:#32CD32;
  8545. }
  8546. .RejectStyle {
  8547. color:red;
  8548. }
  8549. .waitSubmitStyle{
  8550. color: #409eff;
  8551. }
  8552. .chooseDate {
  8553. .waiting {
  8554. color: #20a0ff;
  8555. }
  8556. .filledReportStyle {
  8557. color:#20a0ff;
  8558. }
  8559. .RejectStyle {
  8560. color: #20a0ff;
  8561. }
  8562. .waitSubmitStyle{
  8563. color: #20a0ff;
  8564. }
  8565. }
  8566. .allDaily {
  8567. width:100%;
  8568. }
  8569. .report_title {
  8570. padding:10px 0;
  8571. color:#666;
  8572. }
  8573. .clearfix {
  8574. overflow-x: auto;
  8575. white-space: nowrap;
  8576. padding: 15px 0 10px 0;
  8577. // overflow-y: hidden;
  8578. .date_item {
  8579. padding: 0 3px;
  8580. cursor: pointer;
  8581. position: relative;
  8582. }
  8583. .chooseDate {
  8584. position: absolute;
  8585. bottom: -3px;
  8586. width: 37px;
  8587. height: 2px;
  8588. left: 14px;
  8589. background: #20a0ff;
  8590. }
  8591. }
  8592. .one_daily {
  8593. i {
  8594. color: #9ed0ff;
  8595. margin-right: 5px;
  8596. }
  8597. .one_daily_body {
  8598. padding: 10px 0px;
  8599. p {
  8600. margin: 0;
  8601. line-height: 30px;
  8602. }
  8603. }
  8604. ul {
  8605. padding: 0;
  8606. }
  8607. }
  8608. .checkbtn {
  8609. float: right;
  8610. margin-top: -10px;
  8611. }
  8612. .selConStyle{
  8613. margin-top:9rem;
  8614. margin-bottom:11rem;
  8615. .selConStyle_title{
  8616. height: 3rem;
  8617. text-align: center;
  8618. font-size: 17px;
  8619. }
  8620. .el-select{
  8621. margin: 0 15%;
  8622. width: 70%;
  8623. }
  8624. }
  8625. </style>
  8626. <style lang="scss">
  8627. /*去除upload组件过渡效果*/
  8628. .photos .el-upload-list__item {
  8629. transition: none !important;
  8630. }
  8631. .daily {
  8632. .el-card__body {
  8633. height: 80%;
  8634. overflow-y: auto;
  8635. }
  8636. .el-card__header {
  8637. padding: 0 20px;
  8638. }
  8639. }
  8640. .membListClass{
  8641. .el-dialog__body{
  8642. padding-top: 10px;
  8643. }
  8644. }
  8645. // .editReportDialog .el-dialog__footer{
  8646. // position: sticky;
  8647. // bottom: 0;
  8648. // background: #fff;
  8649. // height: 70px;
  8650. // z-index: 1010;
  8651. // }
  8652. .editReportDialog{
  8653. min-width: 800px;
  8654. }
  8655. .touruxiangmu{
  8656. max-width: 1000px;
  8657. }
  8658. </style>
  8659. <style scoped>
  8660. /* 项目标签的样式 */
  8661. .el-tag + .el-tag {
  8662. margin-left: 10px;
  8663. }
  8664. .button-new-tag {
  8665. margin-left: 10px;
  8666. height: 32px;
  8667. line-height: 30px;
  8668. padding-top: 0;
  8669. padding-bottom: 0;
  8670. }
  8671. .input-new-tag {
  8672. width: 90px;
  8673. margin-left: 10px;
  8674. vertical-align: bottom;
  8675. }
  8676. .selectworktime .el-table__fixed-body-wrapper{
  8677. top: 48px !important;
  8678. }
  8679. .selectworktime_export .selectworktime_export_l{
  8680. width: 650px;
  8681. float: left;
  8682. height: 42px;
  8683. }
  8684. .approvalProcessBox{
  8685. margin-left: 30px;
  8686. font-size: 14px;
  8687. line-height: 16px;
  8688. cursor: pointer;
  8689. }
  8690. .approvalProcessBox i {
  8691. margin-right: 0;
  8692. height: 16px;
  8693. width: 16px;
  8694. display: inline-block;
  8695. transform: scale(1.2);
  8696. position: relative;
  8697. top: 0.5px;
  8698. color: #409eff;
  8699. }
  8700. .approvalProcessBox .approvalProcessClick{
  8701. cursor: pointer;
  8702. color: #409eff;
  8703. font-size: 14px;
  8704. }
  8705. .approvalProcessBox:hover .approvalProcessClick{
  8706. color: #3485fb;
  8707. }
  8708. </style>
  8709. <style lang="scss" scoped>
  8710. .bionicClass {
  8711. -webkit-appearance: none;
  8712. background-color: #FFF;
  8713. background-image: none;
  8714. border-radius: 4px;
  8715. border: 1px solid #DCDFE6;
  8716. box-sizing: border-box;
  8717. color: #606266;
  8718. display: inline-block;
  8719. height: 40px;
  8720. line-height: 40px;
  8721. outline: 0;
  8722. padding: 0 15px;
  8723. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8724. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8725. width: 350px;
  8726. cursor: pointer;
  8727. .bionicClassText {
  8728. color: #C0C4CC;
  8729. }
  8730. }
  8731. // 加班样式
  8732. .overtime {
  8733. display: inline-block;
  8734. margin-left: 20px;
  8735. input {
  8736. display: inline-block;
  8737. margin-top: 5px;
  8738. }
  8739. }
  8740. .plus {
  8741. display: inline-block;
  8742. }
  8743. // .tages {
  8744. // float: right;
  8745. // }
  8746. .overtime {
  8747. display: inline-block;
  8748. margin-left: 30px;
  8749. }
  8750. .bloks {
  8751. display: inline-block;
  8752. width: 380px;
  8753. }
  8754. .zhiss {
  8755. display: flex;
  8756. justify-content: space-around;
  8757. align-items: center;
  8758. }
  8759. .zhoFel {
  8760. display: flex;
  8761. justify-content: space-between;
  8762. align-items: center;
  8763. }
  8764. // 左右滑动样式
  8765. .line {
  8766. width: 30px;
  8767. /* height: 500px; */
  8768. background: #f2f2f2;
  8769. cursor: w-resize;
  8770. }
  8771. .box-father {
  8772. border: 8px solid #000;
  8773. }
  8774. .line-second {
  8775. width: 10px;
  8776. /* background: red; */
  8777. }
  8778. .flex {
  8779. display: flex;
  8780. width: 100%;
  8781. }
  8782. .box-left {
  8783. flex: 0 0 400px;
  8784. /* height: 600px; */
  8785. /* background: blue; */
  8786. }
  8787. .box-right {
  8788. /* height: 600px; */
  8789. /* background: green; */
  8790. flex: 1;
  8791. }
  8792. .box-postion {
  8793. width: 200px;
  8794. /* height: 400px; */
  8795. background: #ccc;
  8796. }
  8797. .custom-tree-node {
  8798. flex: 1;
  8799. display: flex;
  8800. align-items: center;
  8801. justify-content: space-between;
  8802. font-size: 14px;
  8803. padding-right: 8px;
  8804. }
  8805. .daitianrbao {
  8806. width: 100%;
  8807. box-sizing: border-box;
  8808. height: 40px;
  8809. border-radius: 4px;
  8810. border: 1px solid #DCDFE6;
  8811. overflow: hidden;
  8812. text-overflow: ellipsis;
  8813. display: flex;
  8814. // align-items: center;
  8815. }
  8816. .daitianrbao .spnn {
  8817. display: inline-block;
  8818. box-sizing: border-box;
  8819. padding: 0 15px;
  8820. overflow: hidden;
  8821. text-overflow: ellipsis;
  8822. }
  8823. .daitianrbao .hover {
  8824. color: #DCDFE6 !important;
  8825. }
  8826. </style>