daily.vue 418 KB

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