daily.vue 467 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. <!--针对景昱-->
  22. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  23. <i class="el-icon-warning" style="color:red;"></i>
  24. </el-tooltip>
  25. </div>
  26. </div>
  27. </span>
  28. </div>
  29. </div>
  30. <div style="display:flex;">
  31. <div class="grand flex">
  32. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  33. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  34. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  35. </div> -->
  36. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  37. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  38. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  39. </el-input>
  40. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  41. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  42. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  43. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  44. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  45. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  46. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  47. </el-select>
  48. </div>
  49. <div>
  50. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  51. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  52. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  53. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  54. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  55. </span>
  56. <div style="position: absolute;right: 15px;">
  57. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  58. <!-- 未填报 -->
  59. {{$t('state.DidNotFillIn')}}
  60. </span>
  61. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  62. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  63. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  64. </span>
  65. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  66. <!-- 待审核 -->
  67. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  70. <!-- 已通过 -->
  71. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  74. <!-- 未通过 -->
  75. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  78. <!-- 待提交 -->
  79. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. </div>
  82. </span>
  83. </el-tree>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  88. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  89. -
  90. -
  91. -
  92. </div>
  93. </div>
  94. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  95. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  96. <div class="allDaily" style="float:left;flex-grow:1">
  97. <!--系统管理员和部门负责人 -->
  98. <div class="report_title" style="display:flex;justify-content: space-between;">
  99. <span>
  100. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  101. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  102. <!-- {{depData != null ?depData.label:""}} -->
  103. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  104. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  105. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  106. </span>
  107. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  108. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  109. </span>
  110. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  111. <span v-if="targetUid == null">
  112. <!-- - 已提交 -->
  113. -{{$t('state.hasBeenSubmitted')}}
  114. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  115. <!-- 待提交 -->
  116. {{$t('state.waitingsubmit')}}
  117. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  118. <!-- 漏填 -->
  119. <!-- {{$t('state.missFillReport')}} -->
  120. 未填
  121. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  122. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  123. </span>
  124. </span>
  125. </span>
  126. <span style="float:right;">
  127. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  128. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  129. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  130. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  131. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  132. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  133. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  134. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  135. <!--部门负责人给个导出工时的功能 -->
  136. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  137. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  138. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  139. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  140. </span>
  141. </div>
  142. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  143. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  144. <i class="fa fa-circle"></i>
  145. <!-- {{item1.name}} -->
  146. <span v-if="user.userNameNeedTranslate == '1'">
  147. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  148. </span>
  149. <span v-if="user.userNameNeedTranslate != '1'">
  150. {{item1.name}}
  151. </span>
  152. <span style="margin-left:30px;">
  153. <span style="margin-right:20px;">
  154. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  155. <!-- 工作总时长: -->
  156. {{$t('other.totalWorkingHours')}}
  157. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  158. <span >{{item1.reportTime | amounts}}</span>h
  159. </span>
  160. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  161. <i class="iconfont firerock-iconliucheng1"></i>
  162. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  163. <!-- 审批流程 -->
  164. {{$t('other.approvalProcess')}}
  165. </span>
  166. </span>
  167. </span>
  168. <div class="checkbtn" style="padding-right:20px;">
  169. <!--编辑和删除日报-->
  170. <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>
  171. <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>
  172. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  173. </div>
  174. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  175. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  176. </div>
  177. <div class="one_daily_body">
  178. <el-timeline>
  179. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  180. <el-card shadow="never">
  181. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  182. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  183. <span v-if="user.company.packageEngineering == 0">
  184. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  185. <span v-if="item2.isDeptAudit==0">
  186. <span v-if="item2.projectAuditState==0">
  187. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  188. <span v-if="item2.projectAuditorName != null">(
  189. <!-- {{item2.projectAuditorName}} -->
  190. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  191. )</span>
  192. <!-- 审核 --> {{$t('other.audit')}}
  193. </span>
  194. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  195. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  196. <span v-if="item2.projectAuditorName != null">(
  197. <!-- {{item2.projectAuditorName}} -->
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  199. )</span>
  200. <!-- 审核通过 --> {{$t('state.approved')}}
  201. </span>
  202. </span>
  203. <span v-else-if="item2.isDeptAudit==1">
  204. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  205. ({{$t('other.await')}}
  206. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  207. {{$t('other.audit')}})
  208. </span>
  209. ]</span>
  210. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  211. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  212. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  213. </span>
  214. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  215. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  216. </span>
  217. <!-- <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> -->
  218. <span v-if="user.company.packageEngineering == 1">
  219. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  220. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  221. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  222. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  223. (
  224. <!-- <span v-if="user.userNameNeedTranslate != 1">
  225. {{item2.projectAuditorName}}
  226. </span>
  227. <span v-if="user.userNameNeedTranslate == 1">
  228. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  229. </span> -->
  230. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  231. )
  232. </span>{{$t('other.audit')}} ]</span>
  233. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  234. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  235. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  236. </span>
  237. <!--每个项目上单独审核 -->
  238. <span style="float:right;">
  239. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  240. <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"
  241. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  242. <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"
  243. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  244. <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"
  245. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  246. <!--自己可以撤回待审核状态的报告 -->
  247. <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>
  248. </span>
  249. </p>
  250. <p v-if="user.companyId == yuzhongCompId">
  251. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  252. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  253. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  254. <!--任务分组和阶段 -->
  255. <p v-if="item2.groupId != 0">
  256. {{$t('other.taskGroup')}}:{{item2.groupName}}
  257. <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>
  258. </p>
  259. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  260. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  261. <!-- 自定义日报文本 -->
  262. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  263. <p v-if="user.company.packageEngineering == 1">
  264. {{$t('other.professionalProgress')}}:
  265. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  266. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  267. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  268. </el-tooltip>
  269. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  270. <i class="iconfont firerock-iconshenhetongguo"></i>
  271. </el-tooltip>
  272. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  273. <i class="iconfont firerock-iconshenhebohui"></i>
  274. </el-tooltip>
  275. </span>
  276. </p>
  277. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  278. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  279. </p>
  280. <div v-if="item2.multiWorktime==0">
  281. <p style="display: inline-block;">{{$t('time.duration')}}:
  282. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  283. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  284. {{item2.time.toFixed(1)}}h
  285. <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>
  286. </p>
  287. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  288. </div>
  289. <div v-if="item2.multiWorktime==1" >
  290. <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>
  291. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  292. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  295. {{timeItem.time.toFixed(1)}}h
  296. </p>
  297. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  298. </div>
  299. </div>
  300. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  301. <!--照片的显示 -->
  302. <p v-if="item2.pics != null && item2.pics.length > 0">
  303. <el-image v-for="(pic, index) in item2.pics" :key="index"
  304. style="width: 100px; height: 100px; margin-right:10px;"
  305. :src="pic"
  306. :preview-src-list="item2.pics">
  307. </el-image>
  308. </p>
  309. </el-card>
  310. </el-timeline-item>
  311. </el-timeline>
  312. </div>
  313. </div>
  314. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  315. <!-- 简陋的无报告提示 -->
  316. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  317. </div>
  318. </div>
  319. </div>
  320. </div>
  321. </div>
  322. </el-card>
  323. </div>
  324. <!-- 工时推送日志弹窗 -->
  325. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  326. <template>
  327. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  328. </template>
  329. <template>
  330. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  331. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  332. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  333. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  334. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  335. <el-table-column prop="result" label="推送结果" width="250">
  336. <template slot-scope="scope">
  337. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  338. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  339. </template>
  340. </el-table-column>
  341. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  342. </el-table>
  343. </template>
  344. <span slot="footer" class="dialog-footer">
  345. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  346. </span>
  347. </el-dialog>
  348. <!-- 填写日报的dialog -->
  349. <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">
  350. <div style="height: 65vh;overflow: auto;">
  351. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  352. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  353. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  354. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  355. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  356. <span class="spnn" v-if="workForm.userNames">
  357. <span v-for="(item, index) in workForm.userNames" :key="index">
  358. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  359. <span v-if="index < workForm.userNames.length - 1">,</span>
  360. </span>
  361. </span>
  362. <span class="spnn hover" v-else>
  363. {{$t('defaultText.pleaseSelectAsubstitute')}}
  364. </span>
  365. </div>
  366. </el-form-item>
  367. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  368. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  369. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  370. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  371. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  372. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  373. <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>
  374. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  375. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  376. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  377. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  378. <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>
  379. <!-- AI智能填报 -->
  380. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  381. </el-form-item>
  382. <!--考勤时长显示-->
  383. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  384. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  385. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  386. </span>
  387. <!--批量填报和批量代填不显示考勤记录-->
  388. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  389. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  390. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  391. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  392. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  393. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  394. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  395. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  396. @click="refreshAttendance(workForm.createDate)"></el-button>
  397. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  398. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  399. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  400. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  401. </el-form-item>
  402. <!-- 000000 -->
  403. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  404. <div v-if="reportTimeType.multiWorktime==0">
  405. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  406. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  407. <el-select v-model="domain.timeType" style="width:200px;"
  408. v-if="reportTimeType.type == 0"
  409. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  410. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  411. @change="onTimeTypeChange(domain.timeType)">
  412. <el-option
  413. v-for="item in timeType"
  414. :key="item.value"
  415. :label="item.label"
  416. :value="item.value">
  417. </el-option>
  418. </el-select>
  419. <!-- 数字时长选择 -->
  420. <el-select v-model="domain.workingTime" style="width:200px;"
  421. v-if="reportTimeType.type == 1"
  422. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  423. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  424. @change="seleChn(0,domain)">
  425. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  426. </el-select>
  427. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  428. <span v-if="reportTimeType.type == 2">
  429. <!--时间范围选择 -->
  430. <el-time-picker
  431. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  432. v-model="domain.startTime"
  433. :placeholder="$t('time.startTime')"
  434. style="width:120px;"
  435. format="HH:mm"
  436. value-format="HH:mm"
  437. :picker-options="{
  438. start: '08:00',
  439. end: '23:30'
  440. }"
  441. @change="iptChang()">
  442. </el-time-picker> - <el-time-picker
  443. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  444. v-model="domain.endTime"
  445. :placeholder="$t('time.endTime')"
  446. style="width:120px;"
  447. format="HH:mm"
  448. value-format="HH:mm"
  449. :picker-options="{
  450. start: '08:00',
  451. end: '23:30',
  452. minTime: domain.startTime
  453. }"
  454. @change="iptChang()">
  455. </el-time-picker>
  456. </span>
  457. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  458. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  459. <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>
  460. </div>
  461. </el-form-item>
  462. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  463. :prop="'domains.' + index + '.reportTargetDeptId'"
  464. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  465. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  466. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  467. <span style="float: left">
  468. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  469. </span>
  470. </el-option>
  471. </el-select>
  472. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  473. </el-form-item>
  474. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  475. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  476. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  477. @change="selectProject(domain, index)"
  478. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  479. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  480. <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">
  481. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  482. <span style="float: right;">{{ item.projectName }}</span>
  483. </el-option>
  484. </el-option-group>
  485. </el-select>
  486. <!--昱众不显示子项目-->
  487. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  488. <span style="margin-left:45px;">
  489. {{$t('lable.subproject')}}</span>
  490. <!--子项目 -->
  491. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  492. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  493. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  494. </el-select>
  495. </template>
  496. <template v-if="user.companyId == yuzhongCompId">
  497. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  498. <!--角色选择 -->
  499. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  500. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  501. <el-option
  502. v-for="item in roleList"
  503. :key="item.value"
  504. :label="item.label"
  505. :value="item.value">
  506. </el-option>
  507. </el-select>
  508. </template>
  509. <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%;"
  510. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  511. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  512. </el-link>
  513. <!-- <el-link type="primary" v-if="canEdit"
  514. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  515. </el-form-item>
  516. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  517. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  518. </el-form-item>
  519. <!--如果设置了工时成本预警的预算成本项-->
  520. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  521. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  522. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  523. </el-select>
  524. </el-form-item>
  525. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  526. <template slot="label">
  527. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  528. <span >{{$t('lable.taskGrouping')}}</span>
  529. </template>
  530. <!-- 任务分组 -->
  531. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  532. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  533. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  534. </el-select>
  535. <template v-if="user.companyId == yuzhongCompId">
  536. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  537. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  538. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  539. <el-option
  540. v-for="item in domain.filteredRespList"
  541. :key="item.id"
  542. :label="item.jobRespon"
  543. :value="item.id">
  544. </el-option>
  545. </el-select>
  546. </template>
  547. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  548. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  549. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  550. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  551. @change="changeStages(domain, index)"
  552. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  553. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  554. </el-select>
  555. </template>
  556. </el-form-item>
  557. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  558. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  559. <template slot="label">
  560. <span style="color:#FF0000;">*</span>
  561. <span >{{$t('other.projectAuditor')}}</span>
  562. </template>
  563. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  564. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  565. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  566. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  567. </el-option>
  568. </el-select>
  569. <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>
  570. </el-form-item>
  571. </div>
  572. <el-form-item v-if="user.companyId == yuzhongCompId">
  573. <template slot="label">
  574. <span style="color:#FF0000;">*</span>
  575. <span >工作内容</span>
  576. </template>
  577. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  578. :disabled="(workForm.domains[index].state>=2?false:true)" >
  579. <el-option
  580. v-for="item in domain.workContentList"
  581. :key="item.id"
  582. :label="item.workContext"
  583. :value="item.id">
  584. </el-option>
  585. </el-select>
  586. </el-form-item>
  587. <!-- 111111 -->
  588. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  589. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  590. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  591. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  592. <span v-else>{{item.name}}</span>
  593. </el-option>
  594. </el-select>
  595. <template v-if="user.timeType.auditLevel > 1">
  596. <i class="el-icon-right"></i>
  597. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  598. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  599. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  600. <span v-else>{{item.name}}</span>
  601. </el-option>
  602. </el-select>
  603. </template>
  604. <template v-if="user.timeType.auditLevel > 2">
  605. <i class="el-icon-right"></i>
  606. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  607. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  608. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  609. <span v-else>{{item.name}}</span>
  610. </el-option>
  611. </el-select>
  612. </template>
  613. </el-form-item>
  614. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  615. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  616. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  617. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  618. <span v-else>{{item.name}}</span>
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <!-- 相关维度/自定义维度 -->
  623. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && !yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.degreeId'">
  624. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  625. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  626. </el-option>
  627. </el-select>
  628. </el-form-item>
  629. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1 && yonghuUser.customDegreeMultiple" :rules="user.timeType.customDegreeStatus == 1 && domain.wuduList != undefined && domain.wuduList.length != 0 ? { required: true, message: $t('defaultText.pleaseChoose') + yonghuUser.customDegreeName, trigger: ['change','blur'] } : null" :prop="'domains.' + index + '.multiDegrIdArray'">
  630. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  631. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  632. </el-option>
  633. </el-select>
  634. </el-form-item>
  635. <!-- 相关数值 -->
  636. <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">
  637. <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>
  638. </el-form-item>
  639. <!-- 自定义文本 -->
  640. <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">
  641. <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>
  642. </el-form-item>
  643. <!--按比例填报-->
  644. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  645. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  646. <div style="width:400px;">
  647. <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>
  648. <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>
  649. </div>
  650. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  651. <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>
  652. </div>
  653. </el-form-item>
  654. <!--工程专业版本模式下, 各个专业的进度填报 -->
  655. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  656. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  657. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  658. <el-input size="mini" style="width:60px;" v-model="item.progress"
  659. @keyup.native="onProgressChange"
  660. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  661. </span>
  662. </el-form-item>
  663. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  664. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  665. <template slot="label" v-if="user.timeType.taskRequired == 1">
  666. <span style="color:#FF0000;">*</span>
  667. <span >任务</span>
  668. </template>
  669. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  670. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  671. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  672. </el-select>
  673. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  674. </el-form-item>
  675. <!--针对依斯贝的SAP服务-->
  676. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  677. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  678. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  679. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  680. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  681. </el-select>
  682. </el-form-item>
  683. <!--工作事项-->
  684. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  685. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  686. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  687. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  688. </el-form-item>
  689. <!-- 拍照上传 -->
  690. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  691. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  692. <div class="photos">
  693. <div>
  694. <el-upload
  695. list-type="picture-card"
  696. :http-request="(file) => {return addImg(file, index)}"
  697. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  698. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  699. :file-list="domain.imgListUrl" :limit="9"
  700. :disabled="workForm.domains[index].state>=2?false:true">
  701. <i class="el-icon-plus"></i>
  702. </el-upload>
  703. </div>
  704. </div>
  705. </el-form-item>
  706. </div>
  707. <!--多个工作事项填报的情况 -->
  708. <div v-if="reportTimeType.multiWorktime==1">
  709. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  710. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  711. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  712. @change="selectProject(domain, index)"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  714. <!-- <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">
  715. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  716. <span style="float: right;">{{ item.projectName }}</span>
  717. </el-option> -->
  718. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  719. <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">
  720. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  721. <span style="float: right;">{{ item.projectName }}</span>
  722. </el-option>
  723. </el-option-group>
  724. </el-select>
  725. <template v-if="user.timeType.mainProjectState != 1">
  726. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  727. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  728. <!--子项目 -->
  729. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  730. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  731. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  732. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  733. </el-select>
  734. </template>
  735. <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;"
  736. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  737. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  738. </el-link>
  739. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  740. <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>
  741. </div>
  742. <!-- <el-link type="primary" v-if="canEdit"
  743. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  744. </el-form-item>
  745. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  746. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  747. </el-form-item>
  748. <!--如果设置了工时成本预警的预算成本项-->
  749. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  750. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  751. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  752. </el-select>
  753. </el-form-item>
  754. <el-form-item v-if="user.company.packageProject == 1">
  755. <template slot="label">
  756. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  757. <span >{{$t('lable.taskGrouping')}}</span>
  758. </template>
  759. <!-- 任务分组 -->
  760. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  761. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  762. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  763. </el-select>
  764. <!-- 项目的阶段 -->
  765. <span v-if="domain.stages != null && domain.stages.length> 0"
  766. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  767. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  768. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  769. @change="changeStages(domain, index)"
  770. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  771. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  772. </el-select>
  773. </el-form-item>
  774. <el-form-item :label="$t('other.projectAuditor')" >
  775. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  776. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  777. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  778. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  779. </el-option>
  780. </el-select>
  781. <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>
  782. </el-form-item>
  783. <!--工程专业版本模式下, 各个专业的进度填报 -->
  784. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  785. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  786. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  787. <el-input size="mini" style="width:60px;" v-model="item.progress"
  788. @keyup.native="onProgressChange"
  789. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  790. </span>
  791. </el-form-item>
  792. <!-- 相关维度 -->
  793. <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'">
  794. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  795. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  796. </el-option>
  797. </el-select>
  798. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  799. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  800. </el-option>
  801. </el-select>
  802. </el-form-item>
  803. <!-- 相关数值 -->
  804. <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">
  805. <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>
  806. </el-form-item>
  807. <!-- 自定义文本 -->
  808. <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">
  809. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  810. </el-form-item>
  811. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  812. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  813. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  814. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  815. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  816. </el-select>
  817. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  818. </el-form-item>
  819. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  820. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  821. <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>
  822. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  823. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  824. <span v-if="reportTimeType.type == 2">
  825. <!-- <span> -->
  826. <!--时间范围选择 -->
  827. <el-time-picker
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  829. v-model="timeItem.startTime"
  830. :placeholder="$t('time.startTime')"
  831. style="width:120px;"
  832. format="HH:mm"
  833. value-format="HH:mm"
  834. :picker-options="{
  835. start: '00:00',
  836. end: '23:59',
  837. }"
  838. @change="iptChangs()">
  839. </el-time-picker> - <el-time-picker
  840. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  841. v-model="timeItem.endTime"
  842. :placeholder="$t('time.endTime')"
  843. style="width:120px;"
  844. format="HH:mm"
  845. value-format="HH:mm"
  846. :picker-options="{
  847. start: '00:00',
  848. end: '23:59',
  849. minTime: timeItem.startTime
  850. }"
  851. @change="iptChangs()">
  852. </el-time-picker>
  853. </span>
  854. </el-form-item>
  855. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  856. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  857. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  858. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  859. ></el-input>
  860. </el-form-item>
  861. </div>
  862. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  863. </div>
  864. <!--照片的显示 -->
  865. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  866. <el-image v-for="(pic, index) in domain.pics" :key="index"
  867. style="width: 100px; height: 100px; margin-right:10px;"
  868. :src="pic"
  869. :preview-src-list="domain.pics">
  870. </el-image>
  871. </p>
  872. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  873. </div>
  874. <span id="workFormsItemBottom"></span>
  875. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  876. </el-form>
  877. </div>
  878. <span slot="footer" class="dialog-footer">
  879. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  880. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  881. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  882. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  883. <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>
  884. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  885. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  886. </span>
  887. </el-dialog>
  888. <!-- 按周填报 -->
  889. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  890. <!-- 按周填报-已填工时-点击 -->
  891. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  892. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  893. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  894. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  895. <el-table-column prop="state" :label="$t('state.states')">
  896. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  897. </el-table-column>
  898. <!-- <el-table-column label="操作">
  899. <template slot-scope="scope">
  900. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  901. </template>
  902. </el-table-column> -->
  903. </el-table>
  904. <span slot="footer" class="dialog-footer">
  905. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  906. </span>
  907. </el-dialog>
  908. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  909. <el-form-item style="height:30px;margin-top:-72px;">
  910. <!-- <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> -->
  911. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  912. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  913. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  914. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  915. <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>
  916. <el-option
  917. v-for="item in fillProjectList"
  918. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  919. :key="item.id"
  920. :label="item.projectName + '\u3000' + item.projectCode"
  921. :value="item.id">
  922. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  923. <span style="float: right">{{ item.projectName }}</span>
  924. </el-option>
  925. </el-select>
  926. <span style="float:right;margin-right:10px;">选择项目</span>
  927. </el-form-item>
  928. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  929. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  930. <template slot-scope="scope">
  931. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  932. </template>
  933. </el-table-column>
  934. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  935. <template slot-scope="scope">
  936. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  937. <p v-else></p>
  938. </template>
  939. </el-table-column> -->
  940. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  941. <template slot-scope="scope">
  942. <div v-if="scope.row.canFill == 1">
  943. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  944. <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>
  945. <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>
  946. <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>
  947. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  948. </div>
  949. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  950. <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>
  951. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  952. </div>
  953. </div>
  954. <div v-else >
  955. <span style="color:#999999;">不可超前填报</span>
  956. </div>
  957. </template>
  958. </el-table-column>
  959. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  960. <template slot-scope="scope">
  961. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  962. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  963. </template>
  964. </el-table-column>
  965. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  966. <template slot-scope="scope">
  967. <div class="zhiss">
  968. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  969. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  970. </div>
  971. </template>
  972. </el-table-column>
  973. </el-table>
  974. </el-form>
  975. <span slot="footer" class="dialog-footer" >
  976. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  977. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  978. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  979. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  980. <!--针对景昱,先检查工时是否存在异常-->
  981. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  982. </span>
  983. </el-dialog>
  984. <!-- 重庆物奇私人定制的按周填报 -->
  985. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  986. <div class="fillWeekDialogVisiCustom">
  987. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  988. </div>
  989. </el-dialog>
  990. <!-- 选择时间 -->
  991. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  992. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  993. <span slot="footer" class="dialog-footer">
  994. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  995. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  996. </span>
  997. </el-dialog>
  998. <!-- 按周填报弹窗 -->
  999. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1000. <div>
  1001. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1002. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1003. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1004. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1005. </el-select>
  1006. </div>
  1007. <!--如果设置了工时成本预警的预算成本项-->
  1008. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1009. <p>{{$t('lable.budgetSource')}}</p>
  1010. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1011. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1012. </el-select>
  1013. </div>
  1014. <!-- 任务分组 -->
  1015. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1016. <p>{{$t('lable.taskGrouping')}}</p>
  1017. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1018. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1019. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1020. </el-select>
  1021. </div>
  1022. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1023. <p>{{$t('other.inputStage')}}</p>
  1024. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1025. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1026. </el-select>
  1027. </div>
  1028. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1029. <p>{{$t('other.reviewer')}}</p>
  1030. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1031. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1032. </el-select>
  1033. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1034. </div>
  1035. <template v-if="user.timeType.reportAuditType == 3">
  1036. <div class="zhoFel">
  1037. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1038. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1039. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1040. </el-select>
  1041. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1042. </div>
  1043. <div class="zhoFel">
  1044. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1045. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1046. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1047. </el-select>
  1048. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1049. </div>
  1050. <div class="zhoFel">
  1051. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1052. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1053. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1054. </el-select>
  1055. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1056. </div>
  1057. <div class="zhoFel">
  1058. <p>{{ $t('chao-song-ren') }}</p>
  1059. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1060. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1061. </el-select>
  1062. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1063. </div>
  1064. </template>
  1065. <!-- 自定义维度 -->
  1066. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1067. <p>{{user.timeType.customDegreeName}}</p>
  1068. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1069. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1070. </el-select>
  1071. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1072. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1073. </el-select>
  1074. </div>
  1075. <!-- 自定义数值 -->
  1076. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1077. <p>{{user.timeType.customDataName}}</p>
  1078. <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>
  1079. </div>
  1080. <!-- 自定义文本 -->
  1081. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1082. <p>{{user.timeType.customTextName}}</p>
  1083. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1084. </div>
  1085. <!-- 选择任务 -->
  1086. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1087. <p>任务 / 里程碑</p>
  1088. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1089. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1090. </el-select>
  1091. </div>
  1092. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1093. <p>{{$t('other.timeSelection')}}</p>
  1094. <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>
  1095. </div>
  1096. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1097. <p>{{$t('other.chooseDuration')}}</p>
  1098. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1099. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1100. </el-select>
  1101. </div>
  1102. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1103. <p>{{$t('lable.percentageOfTime')}}</p>
  1104. <div style="width:400px;display: flex;align-items: center;">
  1105. <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>
  1106. <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>
  1107. </div>
  1108. </div>
  1109. <div class="zhoFel">
  1110. <p>{{$t('other.workMatters')}}</p>
  1111. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1112. </div>
  1113. </div>
  1114. <span slot="footer" class="dialog-footer">
  1115. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1116. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1117. </span>
  1118. </el-dialog>
  1119. <!--导出报表条件选择 -->
  1120. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1121. <el-form ref="form3" :model="exportParam" >
  1122. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1123. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1124. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1125. </el-select>
  1126. </el-form-item>
  1127. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1128. <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>
  1129. <vueCascader :size="'medium'" :widthStr="'350'" :clearable="true" :subjectId="exportParam.departmentId" :subject="option" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1130. </el-form-item>
  1131. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1132. <el-date-picker
  1133. v-model="exportParam.dateRange" :editable="false"
  1134. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1135. :range-separator="$t('other.to')"
  1136. type="daterange"
  1137. :start-placeholder="$t('time.startDate')"
  1138. :end-placeholder="$t('time.endDate')"
  1139. ></el-date-picker>
  1140. </el-form-item>
  1141. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1142. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1143. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1144. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1145. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1146. </el-select>
  1147. </el-form-item>
  1148. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1149. <div class="exportReportRadio">
  1150. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1151. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1152. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1153. <i class="el-icon-question"></i>
  1154. </el-tooltip>
  1155. </div>
  1156. </el-form-item>
  1157. </el-form>
  1158. <div slot="footer" class="dialog-footer">
  1159. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1160. </div>
  1161. </el-dialog>
  1162. <!--导出报表条件选择 -->
  1163. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1164. <el-form ref="form3" :model="exportParam" >
  1165. <el-form-item prop="range" :label="$t('time.dateRange')">
  1166. <el-date-picker
  1167. v-model="exportParam.dateRange" :editable="false"
  1168. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1169. :clearable="true"
  1170. :range-separator="$t('other.to')"
  1171. type="daterange"
  1172. :start-placeholder="$t('time.startDate')"
  1173. :end-placeholder="$t('time.endDate')"
  1174. ></el-date-picker>
  1175. </el-form-item>
  1176. </el-form>
  1177. <div slot="footer" class="dialog-footer">
  1178. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1179. </div>
  1180. </el-dialog>
  1181. <!--人员列表 -->
  1182. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1183. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1184. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1185. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1186. <el-table-column type="selection"></el-table-column>
  1187. <el-table-column prop="label" :label="$t('lable.name')" >
  1188. <template slot-scope="scope">
  1189. <span>
  1190. <!-- {{(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}} -->
  1191. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1192. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1194. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1195. </span>
  1196. <span v-else>
  1197. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1198. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1199. </span>
  1200. </span>
  1201. </template>
  1202. </el-table-column>
  1203. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1204. <template slot-scope="scope">
  1205. <div>
  1206. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1208. </div>
  1209. </template>
  1210. </el-table-column>
  1211. </el-table>
  1212. </el-tab-pane>
  1213. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1214. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1215. <el-table-column prop="label" :label="$t('lable.name')" >
  1216. <template slot-scope="scope">
  1217. <!-- <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> -->
  1218. <!-- <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> -->
  1219. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1220. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1221. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1222. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1223. </span>
  1224. <span v-else>
  1225. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1226. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1227. </span>
  1228. </template>
  1229. </el-table-column>
  1230. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. </el-table>
  1239. </el-tab-pane>
  1240. </el-tabs>
  1241. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1242. <el-table-column type="selection"></el-table-column>
  1243. <el-table-column prop="label" :label="$t('lable.name')" >
  1244. <template slot-scope="scope">
  1245. <div>
  1246. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1247. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1248. </div>
  1249. </template>
  1250. </el-table-column>
  1251. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1252. <template slot-scope="scope">
  1253. <div>
  1254. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1255. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1256. </div>
  1257. </template>
  1258. </el-table-column>
  1259. </el-table>
  1260. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1261. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1262. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1263. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1264. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1265. </div>
  1266. </el-dialog>
  1267. <!-- 按部门选择人员 -->
  1268. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1269. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1270. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1271. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1272. </el-input>
  1273. <div class="tree" style="height:400px">
  1274. <el-scrollbar style="height:100%">
  1275. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1276. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1277. highlight-current :filter-node-method="filterNode">
  1278. <span class="custom-tree-node" slot-scope="{ node }">
  1279. <span v-if="user.userNameNeedTranslate == '1'">
  1280. <span v-if="node.data.children">
  1281. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1282. </span>
  1283. <span v-else>
  1284. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1285. </span>
  1286. </span>
  1287. <span v-if="user.userNameNeedTranslate != '1'">
  1288. {{ node.label }}
  1289. </span>
  1290. <!-- {{ node.label }} -->
  1291. </span>
  1292. </el-tree>
  1293. </el-scrollbar>
  1294. </div>
  1295. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1296. <div slot="footer" class="dialog-footer">
  1297. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1298. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1299. </div>
  1300. </el-dialog>
  1301. <el-dialog
  1302. v-if="monthWorkTimeDialog"
  1303. :visible.sync="monthWorkTimeDialog"
  1304. :close-on-click-modal="false"
  1305. customClass="customWidth selectworktime"
  1306. width="1200px"
  1307. title=""
  1308. >
  1309. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1310. <el-tabs v-model="activeName" @tab-click="handleClick">
  1311. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1312. <div class="selectworktime_export" style="margin-top:10px;">
  1313. <div class="selectworktime_export_l">
  1314. <el-date-picker
  1315. class="selecteworktime_datapick"
  1316. v-model="WorktimeDatepickValue"
  1317. value-format="yyyy-MM-dd"
  1318. type="daterange"
  1319. align="right"
  1320. unlink-panels
  1321. :range-separator="$t('other.to')"
  1322. :start-placeholder="$t('time.startDate')"
  1323. :end-placeholder="$t('time.endDate')"
  1324. :default-time="['12:00:00', '12:00:00']"
  1325. size="small"
  1326. popper-class="selecteorktime_datapick_popper"
  1327. @change="showMonthWorkTime()"
  1328. >
  1329. </el-date-picker>
  1330. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1331. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1332. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1333. <!-- 222 -->
  1334. </div>
  1335. <div>
  1336. <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">
  1337. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1338. </el-input>
  1339. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1340. </div>
  1341. <div style="float: right; vertical-align: middle;height:32px">
  1342. <el-link
  1343. type="primary"
  1344. @click="exportMembWorkHours()"
  1345. >{{$t('export.exportData')}}</el-link
  1346. >
  1347. </div>
  1348. </div>
  1349. <el-table ref="hasworkTbl"
  1350. :data="monthWorkDataS"
  1351. v-el-table-infinite-scroll="listScroll"
  1352. border
  1353. :height="500"
  1354. highlight-current-row
  1355. style="width: 100%"
  1356. v-loading="tbload"
  1357. :lazy="true"
  1358. >
  1359. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1360. <template slot-scope="scope">
  1361. {{ scope.$index + 1 }}
  1362. </template>
  1363. </el-table-column>
  1364. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1365. <template slot-scope="scope">
  1366. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1367. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1368. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1369. <!-- {{scope.row.name}} -->
  1370. </span>
  1371. </template>
  1372. </el-table-column>
  1373. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1374. <template slot-scope="scope">
  1375. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1376. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1377. </template>
  1378. </el-table-column>
  1379. <el-table-column
  1380. min-width="105"
  1381. v-for="(item, index) in pickDateArray"
  1382. :key="index"
  1383. :label="item.label"
  1384. align="center"
  1385. >
  1386. <template slot-scope="scope">
  1387. <div
  1388. style="color: red"
  1389. v-if="
  1390. scope.row.worktimeList.filter(
  1391. (w) =>
  1392. w.createDate==item.date
  1393. ).length > 0 &&
  1394. scope.row.worktimeList.filter(
  1395. (w) =>w.createDate==item.date
  1396. )[0].workingTime < reportTimeType.allday
  1397. "
  1398. >
  1399. {{
  1400. scope.row.worktimeList.filter(
  1401. (w) =>w.createDate==item.date
  1402. )[0].workingTime.toFixed(1)
  1403. }}
  1404. </div>
  1405. <div
  1406. style="color: #20a0ff"
  1407. v-if="
  1408. scope.row.worktimeList.filter(
  1409. (w) =>w.createDate==item.date
  1410. ).length > 0 &&
  1411. scope.row.worktimeList.filter(
  1412. (w) =>w.createDate==item.date
  1413. )[0].workingTime > reportTimeType.allday
  1414. "
  1415. >
  1416. {{
  1417. scope.row.worktimeList.filter(
  1418. (w) =>w.createDate==item.date
  1419. )[0].workingTime.toFixed(1)
  1420. }}
  1421. </div>
  1422. <div
  1423. v-if="
  1424. scope.row.worktimeList.filter(
  1425. (w) =>w.createDate==item.date
  1426. ).length > 0 &&
  1427. scope.row.worktimeList.filter(
  1428. (w) =>w.createDate==item.date
  1429. )[0].workingTime == reportTimeType.allday
  1430. "
  1431. >
  1432. {{
  1433. scope.row.worktimeList.filter(
  1434. (w) =>w.createDate==item.date
  1435. )[0].workingTime
  1436. }}
  1437. </div>
  1438. <div
  1439. v-if="
  1440. scope.row.worktimeList.filter(
  1441. (w) =>w.createDate==item.date
  1442. ).length == 0
  1443. "
  1444. >
  1445. 0
  1446. </div>
  1447. <div
  1448. v-if="
  1449. scope.row.worktimeList.filter(
  1450. (w) =>w.createDate==item.date
  1451. ).length > 0 &&
  1452. typeof scope.row.worktimeList.filter(
  1453. (w) =>w.createDate==item.date
  1454. )[0].workingTime == 'string'
  1455. "
  1456. >
  1457. {{
  1458. scope.row.worktimeList.filter(
  1459. (w) =>w.createDate==item.date
  1460. )[0].workingTime
  1461. }}
  1462. </div>
  1463. </template>
  1464. </el-table-column>
  1465. </el-table>
  1466. <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>
  1467. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1468. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1469. <label style="font-size: 16px">员工每日已填报工时数</label>
  1470. <el-link
  1471. type="primary"
  1472. style="float: right; margin-right: 60px"
  1473. @click="exportMembWorkHours()"
  1474. >导出已填报数据</el-link
  1475. > -->
  1476. <!-- <el-button >导出</el-button> -->
  1477. <!-- </div> -->
  1478. </el-tab-pane>
  1479. <el-tab-pane label="未提交人员列表" name="second" >
  1480. <div class="selectworktime_export" style="margin-top:10px">
  1481. <div class="selectworktime_export_l">
  1482. <el-date-picker
  1483. class="selecteworktime_datapick"
  1484. v-model="WorktimeDatepickValue"
  1485. value-format="yyyy-MM-dd"
  1486. type="daterange"
  1487. align="right"
  1488. unlink-panels
  1489. :range-separator="$t('other.to')"
  1490. :start-placeholder="$t('time.startDate')"
  1491. :end-placeholder="$t('time.endDate')"
  1492. :default-time="['12:00:00', '12:00:00']"
  1493. size="small"
  1494. popper-class="selecteorktime_datapick_popper"
  1495. @change="showMonthNotWorkTime()"
  1496. >
  1497. </el-date-picker>
  1498. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1499. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1500. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1501. </div>
  1502. <div>
  1503. <div style="margin-top:10px;">
  1504. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1505. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1506. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1507. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1508. </el-input>
  1509. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1510. <el-link
  1511. type="primary"
  1512. style="float: right; vertical-align: middle;height:32px"
  1513. @click="exportMembNotWorkHours()"
  1514. >{{$t('export.exportData')}}</el-link
  1515. >
  1516. </div>
  1517. </div>
  1518. </div>
  1519. <el-table
  1520. ref="hasworkTbl2"
  1521. :data="monthNotWorkDateS"
  1522. v-el-table-infinite-scroll="notListScroll"
  1523. border
  1524. :height="500"
  1525. highlight-current-row
  1526. style="width: 100%"
  1527. v-loading="tbload"
  1528. lazy
  1529. >
  1530. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1531. <template slot-scope="scope">
  1532. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1533. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1534. </template>
  1535. </el-table-column>
  1536. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1537. <template slot-scope="scope">
  1538. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1539. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1540. </template>
  1541. </el-table-column>
  1542. <el-table-column
  1543. min-width="200"
  1544. :label="$t('weekDay.date')"
  1545. align="center"
  1546. prop="createDate"
  1547. >
  1548. </el-table-column>
  1549. <el-table-column
  1550. min-width="200"
  1551. :label="$t('state.states')"
  1552. align="center"
  1553. prop="status"
  1554. />
  1555. <el-table-column
  1556. min-width="200"
  1557. :label="$t('other.attendanceData')"
  1558. prop="cardTime"
  1559. align="center"
  1560. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1561. </el-table>
  1562. <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>
  1563. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1564. </el-tab-pane>
  1565. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1566. <div class="selectworktime_export" style="margin-top:10px;">
  1567. <div class="selectworktime_export_l">
  1568. <el-date-picker
  1569. class="selecteworktime_datapick"
  1570. v-model="WorktimeDatepickValue"
  1571. value-format="yyyy-MM-dd"
  1572. type="daterange"
  1573. align="right"
  1574. unlink-panels
  1575. :range-separator="$t('other.to')"
  1576. :start-placeholder="$t('time.startDate')"
  1577. :end-placeholder="$t('time.endDate')"
  1578. :default-time="['12:00:00', '12:00:00']"
  1579. size="small"
  1580. popper-class="selecteorktime_datapick_popper"
  1581. @change="showMonthWorkTimeReminder()"
  1582. >
  1583. </el-date-picker>
  1584. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1585. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1586. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1587. </div>
  1588. <div>
  1589. <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">
  1590. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1591. </el-input>
  1592. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1593. </div>
  1594. <div style="float: right; vertical-align: middle;height:32px">
  1595. <el-link
  1596. type="primary"
  1597. @click="changeReminder()"
  1598. >{{'变更提醒'}}</el-link
  1599. >
  1600. <el-link
  1601. type="primary"
  1602. @click="exportMembWorkHoursReminder()"
  1603. >{{$t('export.exportData')}}</el-link
  1604. >
  1605. </div>
  1606. </div>
  1607. <el-table ref="hasworkTbl"
  1608. :data="monthWorkDataS"
  1609. v-el-table-infinite-scroll="listScroll"
  1610. border
  1611. :height="500"
  1612. highlight-current-row
  1613. style="width: 100%"
  1614. v-loading="tbload"
  1615. :lazy="true"
  1616. >
  1617. <el-table-column width="180" type="index" fixed="left" :label="'日期'">
  1618. <template slot-scope="scope">
  1619. {{ scope.row.createDate}}
  1620. </template>
  1621. </el-table-column>
  1622. <el-table-column width="160" prop="name" fixed="left" :label="$t('lable.name')">
  1623. <template slot-scope="scope">
  1624. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1625. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1626. <!-- {{scope.row.name}} -->
  1627. </template>
  1628. </el-table-column>
  1629. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1630. <template slot-scope="scope">
  1631. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1632. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1633. </template>
  1634. </el-table-column>
  1635. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1636. <template slot-scope="scope">
  1637. {{ scope.row.workingTime}}
  1638. </template>
  1639. </el-table-column>
  1640. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1641. <template slot-scope="scope">
  1642. {{ scope.row.cardTime}}
  1643. </template>
  1644. </el-table-column>
  1645. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1646. <template slot-scope="scope">
  1647. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1648. </template>
  1649. </el-table-column>
  1650. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1651. <template slot-scope="scope">
  1652. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1653. </template>
  1654. </el-table-column>
  1655. </el-table>
  1656. <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>
  1657. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1658. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1659. <label style="font-size: 16px">员工每日已填报工时数</label>
  1660. <el-link
  1661. type="primary"
  1662. style="float: right; margin-right: 60px"
  1663. @click="exportMembWorkHours()"
  1664. >导出已填报数据</el-link
  1665. > -->
  1666. <!-- <el-button >导出</el-button> -->
  1667. <!-- </div> -->
  1668. </el-tab-pane>
  1669. </el-tabs>
  1670. </el-dialog>
  1671. <!--驳回弹出框 -->
  1672. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1673. <div>
  1674. <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')" />
  1675. </div>
  1676. <div slot="footer" class="dialog-footer">
  1677. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1678. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1679. </div>
  1680. </el-dialog>
  1681. <!-- 通过弹出框 -->
  1682. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1683. <div>
  1684. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1685. </div>
  1686. <div slot="footer" class="dialog-footer">
  1687. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1688. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1689. </div>
  1690. </el-dialog>
  1691. <!--批量导入日报 -->
  1692. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1693. <p>1. {{$t('other.download')}}
  1694. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1695. </p>
  1696. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1697. <p style="display: flex;justify-content: center;">
  1698. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1699. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1700. </el-upload>
  1701. </p>
  1702. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1703. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1704. </div>
  1705. </el-dialog>
  1706. <!-- 工时导入记录弹窗 -->
  1707. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1708. <div style="height: 452px">
  1709. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1710. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1711. <el-table-column prop="userName" :label="$t('other.operator')">
  1712. <template slot-scope="scope">
  1713. <div>
  1714. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1715. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1716. </div>
  1717. </template>
  1718. </el-table-column>
  1719. <el-table-column prop="datel" :label="$t('other.document')">
  1720. <template slot-scope="scope">
  1721. <div>
  1722. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1723. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1724. </div>
  1725. </template>
  1726. </el-table-column>
  1727. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1728. <template slot-scope="scope">
  1729. <div>
  1730. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1731. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1732. </div>
  1733. </template>
  1734. </el-table-column>
  1735. </el-table>
  1736. <el-col :span="24" class="paginatis">
  1737. <el-pagination
  1738. @size-change="handleSizeChange"
  1739. @current-change="handleCurrentChange"
  1740. :page-sizes="[20 , 50 , 80 , 100]"
  1741. :page-size="20"
  1742. layout="total, sizes, prev, pager, next"
  1743. :total="toViewForm.total"
  1744. style="float:right;"
  1745. ></el-pagination>
  1746. </el-col>
  1747. </div>
  1748. </el-dialog>
  1749. <!--基于企业微信考勤数据的工时导入 -->
  1750. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1751. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1752. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1753. </el-step>
  1754. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1755. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1756. </el-steps>
  1757. <div v-if="active==0" style="padding:30px;height:360px;">
  1758. <div style="margin-top:50px;margin-left:280px;">
  1759. <el-date-picker
  1760. v-model="importWxParam.date" :editable="false"
  1761. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1762. :clearable="true"
  1763. :range-separator="$t('other.to')"
  1764. type="daterange"
  1765. :start-placeholder="$t('time.startDate')"
  1766. :end-placeholder="$t('time.endDate')"
  1767. @change="loadCheckInData"
  1768. ></el-date-picker>
  1769. </div>
  1770. </div>
  1771. <div v-if="active==1" style="padding:10px;">
  1772. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1773. style="width: 100%;margin-top:5px;" >
  1774. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1775. <template slot-scope="scope">
  1776. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1777. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1778. </template>
  1779. </el-table-column>
  1780. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1781. </el-table-column>
  1782. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1783. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1784. <template slot-scope="scope">
  1785. <div>
  1786. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1787. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1788. </div>
  1789. </template>
  1790. </el-table-column>
  1791. <el-table-column prop="departmentName" label="部门" >
  1792. <template slot-scope="scope">
  1793. <div>
  1794. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1795. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1796. </div>
  1797. </template>
  1798. </el-table-column>
  1799. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1800. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1801. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1802. <template slot-scope="scope">
  1803. {{scope.row.workHours.toFixed(1)}}h
  1804. </template>
  1805. </el-table-column>
  1806. </el-table>
  1807. </div>
  1808. <div v-if="active==2" >
  1809. <p style="display: flex;justify-content: center;height:390px;">
  1810. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1811. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1812. </el-upload>
  1813. </p>
  1814. </div>
  1815. <div slot="title">
  1816. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1817. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1818. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1819. <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>
  1820. <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>
  1821. <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>
  1822. </div>
  1823. <span slot="footer">
  1824. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1825. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1826. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1827. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1828. </span>
  1829. </el-dialog>
  1830. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1831. <p style="display: flex;justify-content: center;height:100px;">
  1832. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1833. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1834. </el-upload>
  1835. </p>
  1836. </el-dialog>
  1837. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1838. <div>
  1839. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1840. v-model="deleteReportParam.date" :editable="false"
  1841. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1842. :clearable="true"
  1843. :range-separator="$t('other.to')"
  1844. type="daterange"
  1845. :start-placeholder="$t('time.startDate')"
  1846. :end-placeholder="$t('time.endDate')"
  1847. ></el-date-picker>
  1848. </div>
  1849. <div style="margin-top:10px;">
  1850. <span>请选择部门:</span>
  1851. <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>
  1852. <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>
  1853. </div>
  1854. <div style="margin-top:10px;">
  1855. <span>请选择员工:</span>
  1856. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1857. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1858. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1859. <span v-else>{{item.name}}</span>
  1860. </el-option>
  1861. </el-select>
  1862. </div>
  1863. <span slot="footer">
  1864. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1865. </span>
  1866. </el-dialog>
  1867. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1868. <div>
  1869. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1870. v-model="deleteReportParam.date" :editable="false"
  1871. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1872. :clearable="true"
  1873. :range-separator="$t('other.to')"
  1874. type="daterange"
  1875. :start-placeholder="$t('time.startDate')"
  1876. :end-placeholder="$t('time.endDate')"
  1877. ></el-date-picker>
  1878. </div>
  1879. <div style="margin-top:15px;">
  1880. <span>选择部门:</span>
  1881. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1882. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1883. size="small" v-if="user.userNameNeedTranslate != 1"
  1884. ></el-cascader>
  1885. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1886. </div>
  1887. <span slot="footer">
  1888. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1889. </span>
  1890. </el-dialog>
  1891. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1892. <div>
  1893. <span>选择时间:</span><el-date-picker
  1894. v-model="modImportTime"
  1895. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1896. :clearable="true"
  1897. type="datetime"
  1898. ></el-date-picker>
  1899. <span>选择导入人员:</span><el-select
  1900. v-model="modImportUserId"
  1901. >
  1902. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1903. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1904. <span v-else>{{item.name}}</span>
  1905. </el-option>
  1906. </el-select>
  1907. </div>
  1908. <span slot="footer">
  1909. <el-button @click="confirmChangeModTime" >确认</el-button>
  1910. </span>
  1911. </el-dialog>
  1912. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1913. <div>
  1914. <span>请选择年月:</span>
  1915. <el-date-picker
  1916. v-model="ratioYmonth" :editable="false"
  1917. format="yyyyMM" value-format="yyyyMM"
  1918. type="month"
  1919. ></el-date-picker>
  1920. </div>
  1921. <span slot="footer">
  1922. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1923. </span>
  1924. </el-dialog>
  1925. <!--工时批量代填 -->
  1926. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1927. <div>
  1928. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1929. v-model="importWxParam.date" :editable="false"
  1930. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1931. :clearable="true"
  1932. :range-separator="$t('other.to')"
  1933. type="daterange"
  1934. :start-placeholder="$t('time.startDate')"
  1935. :end-placeholder="$t('time.endDate')"
  1936. @change="loadCheckInData"
  1937. ></el-date-picker>
  1938. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1939. </div>
  1940. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1941. :key="timeStamp"
  1942. style="width: 100%;margin-top:5px;" ref="tab">
  1943. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1944. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1945. <template slot-scope="scope">
  1946. <div>
  1947. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1948. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1949. </div>
  1950. </template>
  1951. </el-table-column>
  1952. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1953. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1954. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1955. <template slot-scope="scope">
  1956. {{scope.row.workHours.toFixed(1)}}h
  1957. </template>
  1958. </el-table-column>
  1959. <!--项目名称列表 -->
  1960. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1961. <template slot-scope="scope">
  1962. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1963. </template>
  1964. </el-table-column>
  1965. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1966. <template slot-scope="scope">
  1967. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1968. </template>
  1969. </el-table-column>
  1970. </el-table>
  1971. </el-dialog>
  1972. <!--基于企业微信考勤数据的工时导入 -->
  1973. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1974. <div style="padding-bottom:10px;">
  1975. <p>{{importResultMsg}}</p>
  1976. </div>
  1977. <!-- <span slot="footer" class="dialog-footer">
  1978. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1979. </span> -->
  1980. </el-dialog>
  1981. <!-- 审核流程展示 -->
  1982. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1983. <div style="padding:20px 40px 20px 0">
  1984. <el-timeline :reverse="false">
  1985. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1986. <!-- {{item.msg}} -->
  1987. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1988. <span v-if="user.userNameNeedTranslate == 1">
  1989. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  1990. <span>{{item.msgCon.two}}</span>
  1991. </span>
  1992. </el-timeline-item>
  1993. </el-timeline>
  1994. </div>
  1995. </el-dialog>
  1996. </section>
  1997. </template>
  1998. <script>
  1999. // 左右滑动
  2000. import dragMixin from "@/common/js/tensile.js";
  2001. import util from "../../common/js/util";
  2002. // 自定义select组件
  2003. import selectCat from "@/components/select.vue"
  2004. // 引入自定义级联组件
  2005. import vueCascader from "@/components/cascader.vue"
  2006. // 重庆物奇定制组件
  2007. import WeeklyCustomization from "./weeklyCustomization.vue"
  2008. import { mapMutations } from 'vuex'
  2009. let _that = this
  2010. export default {
  2011. mixins: [dragMixin],
  2012. components: {
  2013. selectCat,
  2014. vueCascader,
  2015. WeeklyCustomization
  2016. },
  2017. data() {
  2018. return {
  2019. pageIndex: 0,
  2020. hasMore: true,
  2021. exportType: 0,
  2022. exportingData: false,
  2023. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2024. jobResponseList:[],
  2025. yisibeiCompId: 3092,
  2026. yuzhongCompId: 3385,
  2027. mingyiName : '成都明夷电子科技有限公司',
  2028. // mingyiName : '明夷',
  2029. modItemDataId: null,
  2030. modImportTime: null,
  2031. modImportUserId: null,
  2032. showModImportTimeDialog: false,
  2033. showBatchSimpleApproveReport: false,
  2034. startDeleting: false,
  2035. showBatchDeleteReport: false,
  2036. deleteReportParam: {date:null, userIds:[]},
  2037. isDenying: false,
  2038. targetWeekDate: null,//填写周报中的周日期
  2039. importCardTimeVisi: false,
  2040. startRatioExporting: false,
  2041. exportUserRatio: false,
  2042. ratioYmonth:null,
  2043. hasWrittenReport: false,
  2044. today:null,
  2045. syncTimeLoading: false,
  2046. seluserText: '',
  2047. translation: '1', // 1、文字, 2、部门, 3、人员
  2048. exportLoad: false,
  2049. getPickerOptions: {
  2050. disabledDate: (time) => {
  2051. var date = new Date();
  2052. var year = date.getFullYear();
  2053. var month = date.getMonth() + 1;
  2054. if (month >= 1 && month <= 9) {
  2055. month = "0" + month;
  2056. }
  2057. var currentdate = year.toString() + month.toString();
  2058. var timeyear = time.getFullYear();
  2059. var timemonth = time.getMonth() + 1;
  2060. if (timemonth >= 1 && timemonth <= 9) {
  2061. timemonth = "0" + timemonth;
  2062. }
  2063. var timedate = timeyear.toString() + timemonth.toString();
  2064. if(this.user.timeType.fillAhead == 0){
  2065. return currentdate < timedate;
  2066. }else{
  2067. return false
  2068. }
  2069. }
  2070. },
  2071. alalal: '8.0',
  2072. timeBasecostList:null,
  2073. tbload: false,
  2074. exportTimeDialog: false,
  2075. searchKeyword: '',
  2076. monthWorkDataS: [],
  2077. monthNotWorkDateS: [],
  2078. pickDateArray:[],
  2079. WorktimeDatepickValue: [],
  2080. activeName:"first",
  2081. isLeave: 0,
  2082. submitingReport: false,
  2083. importResultMsg:null,
  2084. showImportResult:false,
  2085. importingData: false,
  2086. isDraft: 0,
  2087. timeStamp: 0,
  2088. projectColumns:[],
  2089. checkinLoading:false,
  2090. importWxParam:{date:null,},
  2091. active:0,
  2092. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2093. importWxDialog:false,
  2094. importDialog:false,
  2095. denyForm:null,
  2096. denyReasonDialog:false,
  2097. monthWorkTimeDialog: false,
  2098. isSubstitude:false,
  2099. isFill:false,
  2100. unFillList:[],
  2101. fillList:[],
  2102. fillMembList:[],
  2103. fillMembList_leave: [],
  2104. membListVisible: false,
  2105. isBatch:0,//是否是批量填报
  2106. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2107. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2108. 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')],
  2109. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2110. fillStatusList: [],
  2111. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2112. exportDialog:false,
  2113. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2114. subProjectList:[],
  2115. canEdit: true,
  2116. originCanEdit: true,
  2117. timeRange:[0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0],
  2118. selectTime:null,
  2119. reportTimeType:{},
  2120. curDate:'',
  2121. isAllSelect: false,
  2122. approveDialogVisible:false,
  2123. deptId:null,
  2124. targetUid: null,
  2125. membCount:0,
  2126. selectState:"-1",
  2127. user: JSON.parse(sessionStorage.getItem("user")),
  2128. allUsersList: [],
  2129. showAddMore:false,
  2130. allDate: [],
  2131. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2132. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2133. choseDay: 0,
  2134. tableHeight: 0,
  2135. listLoading: false,
  2136. projectList: [], //项目列表
  2137. fillProjectList: [],
  2138. reportList: [], //日报列表
  2139. reportNames:[], //批量审批列表
  2140. selCon:[], //筛选条件
  2141. selProjectList:[], //筛选后项目列表
  2142. selConShow: true,
  2143. usersList: [], // 全部人员列表
  2144. usersListId: '', // 选中的人员id
  2145. dialogVisible: false, //项目弹窗
  2146. report: '',
  2147. workForm: {
  2148. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2149. domains: [{
  2150. id: null,
  2151. projectId: "",
  2152. workingTime: "",
  2153. timeType:0,
  2154. content: "",
  2155. state: 2,
  2156. multiWorktime:0,
  2157. worktimeList:[],
  2158. degreeId: null,
  2159. auditUserList: [],
  2160. }],
  2161. showRefresh: false,
  2162. },
  2163. workRules: {
  2164. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2165. },
  2166. chooseParticipVisible: false,
  2167. logining: false,
  2168. isDisable: false,
  2169. timeType:[],
  2170. deptMembData: [
  2171. ],
  2172. //部门人员树状结构
  2173. data: [
  2174. {
  2175. id: -1,
  2176. label: this.$t('lable.allStaff'),
  2177. membCount:0
  2178. },
  2179. {
  2180. id: 0,
  2181. label: this.$t('lable.unassigned'),
  2182. }
  2183. ],
  2184. allData:{},
  2185. batchShowData:{},
  2186. option: [],
  2187. deptOptionList: [],
  2188. depData: {
  2189. id: -1,
  2190. label: this.$t('lable.allStaff'),
  2191. },
  2192. defaultProps: {
  2193. children: 'children',
  2194. label: 'label'
  2195. },
  2196. isNew: false,
  2197. selected: false,
  2198. valuet: new Date(),
  2199. domObj: null,
  2200. participator:[],
  2201. chosenMembCount:0,
  2202. jsDay: 0,
  2203. jsTime: 0,
  2204. falsss: false,
  2205. weidu: [],
  2206. weiduList: [],
  2207. yonghuUser: [],
  2208. dateAr: [],
  2209. batchSubFillDialog: false,
  2210. isSubstiS: false,
  2211. fillWeekDialogVisi: false,
  2212. fillWeekDialogVisiCustom: false,
  2213. zhoData: [],
  2214. weekDateRange: [],
  2215. btnZho: false,
  2216. weekDataLoading: false,
  2217. changdu: 6,
  2218. tianxieDialogVisible: false,
  2219. scopess: {},
  2220. zhoBao: {
  2221. time: '',
  2222. workingTime: '',
  2223. progress: '',
  2224. con: '',
  2225. subProjectId: '',
  2226. stage: '',
  2227. subProjectList: [],
  2228. stages: [],
  2229. },
  2230. zhoBaoIdx: '',
  2231. zhoBaoName: '',
  2232. zhis: {},
  2233. dealList: [],
  2234. toViewDialogVisible: false,
  2235. toViewList: [],
  2236. toViewloading: true,
  2237. toViewForm: {
  2238. pageIndex: '1',
  2239. pageSize: '20',
  2240. total: 0,
  2241. },
  2242. toViewloadings: false,
  2243. tabPositionss: 'top',
  2244. monthTotal: 0,
  2245. monthTotalPage: 0,
  2246. monthTotalLages: 20,
  2247. monthWorkData: [],
  2248. monthNotWorkDate: [],
  2249. monthWorkDataS1: [],
  2250. monthnotTotal: 0,
  2251. monthnotTotalPage: 0,
  2252. monthnotTotalLages: 20,
  2253. monthNotWorkDateS1: [],
  2254. deptMembDataText: '',
  2255. isFlag: false,
  2256. isMore: false,
  2257. stateKey: '0',
  2258. expandDate: [],
  2259. notifySelList:[],
  2260. departmentList: [],
  2261. approvalProcessDialog: false,
  2262. approvalProcessData: [],
  2263. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2264. 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')],
  2265. isWeekend: false,
  2266. canCancelInDialog: false,
  2267. approveinData: {},
  2268. approveinDialog: false,
  2269. reportCanDelete: false,
  2270. weeklyFilledTimeDialog: false,
  2271. weeklyFilledTimeList: [],
  2272. weeklyFilledTimeLoading: false,
  2273. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2274. weeklyFilledTimeCanDelete: false,
  2275. weeklyFilledTimeDate: null,
  2276. leaveAllNum: 0,
  2277. dataLoading: false,
  2278. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2279. vacationTime: {},
  2280. integrationProjectList: [],
  2281. totalReportHours: 0, // 合计的工时
  2282. workTimeForMinYi:0,
  2283. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2284. weekIndex: 1,
  2285. weekParentData: {},
  2286. deptIdForNoReport:[],
  2287. nameAearch: '', // 企业微信姓名搜索
  2288. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2289. deptMembDataLoading: false,
  2290. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2291. {
  2292. id: 4811,
  2293. // id: 10,
  2294. name: '陕西柘中建设工程有限公司'
  2295. }
  2296. ],
  2297. pushWorkTimeLogDig:false,
  2298. pushWorkTimeLogData:[],
  2299. userReportDeptList: []
  2300. };
  2301. },
  2302. watch: {
  2303. deptMembDataText(val) {
  2304. this.$refs.chooseMembTree.filter(val);
  2305. }
  2306. },
  2307. filters: {
  2308. // 过滤
  2309. amounts(value) {
  2310. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2311. return 0
  2312. }
  2313. var zhi = +value + 0
  2314. return zhi.toFixed(1)
  2315. },
  2316. // zhoData
  2317. zhoData(value, arr) {
  2318. var dateArray = value.split("-");
  2319. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2320. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2321. // console.log(arr[date.getDay()])
  2322. // return "周" + "日一二三四五六".charAt(date.getDay());
  2323. return arr[date.getDay()]
  2324. },
  2325. // 过滤数字
  2326. numbers(value) {
  2327. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2328. return 0
  2329. }
  2330. return value
  2331. },
  2332. },
  2333. computed: {},
  2334. mounted() {
  2335. var now = new Date();
  2336. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2337. this.today = t;
  2338. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2339. this.exportParam.dateRange = [startStr,t];
  2340. this.getAllDate(1);
  2341. this.getReportList();
  2342. this.getProjectList();
  2343. this.getFillProjectList();
  2344. this.getTimeType();
  2345. this.getDepartment();
  2346. this.scrollFunction()
  2347. this.userssHu();
  2348. this.getFirstAndLastDay()
  2349. if(this.user.timeType.reportAuditType == 3){
  2350. this.getAllUsersList()
  2351. }
  2352. if (this.user.company.packageProject == 1) {
  2353. this.getBasecostItemList();
  2354. }
  2355. if(this.user.timeType.userWithMultiDept == 1) {
  2356. this.getDeptMembData();
  2357. }
  2358. if(this.user.timeType.lockWorktime){
  2359. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2360. }
  2361. //设置了下限
  2362. if (this.user.timeType.minReportTime) {
  2363. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2364. }
  2365. const that = this
  2366. if(this.user.userNameNeedTranslate == 1) {
  2367. that.dataLoading = that.$store.state.dataLoading
  2368. this.upDataLoading()
  2369. setTimeout(()=>{
  2370. that.dataLoading = that.$store.state.dataLoading
  2371. }, 1000)
  2372. }
  2373. if (this.user.companyId == this.yuzhongCompId) {
  2374. this.getJobResponList();
  2375. }
  2376. },
  2377. methods: {
  2378. ...mapMutations(['upDataLoading']),
  2379. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2380. isCustomization(userInfo, permissionArray) {
  2381. const { companyId } = userInfo
  2382. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2383. return isReportPictureRequired
  2384. },
  2385. // 获取如何信息选的可填写部门
  2386. getDeptMembData() {
  2387. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2388. if (res.code == "ok") {
  2389. let lists = res.data.userReportDeptList || []
  2390. const optimizedList = lists.map(item => ({
  2391. ...item,
  2392. label: item.departmentName,
  2393. value: item.departmentId,
  2394. }));
  2395. this.$set(this, 'userReportDeptList', optimizedList || []);
  2396. } else {
  2397. this.$message({
  2398. message: res.msg,
  2399. type: "error"
  2400. });
  2401. }
  2402. },error => { });
  2403. },
  2404. //任务被选中
  2405. onTaskSelected(domainItem) {
  2406. //取服务
  2407. if (domainItem.taskId) {
  2408. var that = this;
  2409. var param = {taskId:domainItem.taskId};
  2410. if (this.isSubstitude) {
  2411. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2412. param.userId = this.workForm.userId[0];
  2413. }
  2414. }
  2415. this.http.post('/task/getMyTaskService',param, res => {
  2416. if (res.code == "ok") {
  2417. // domainItem.workContentList = res.data;
  2418. that.$set(domainItem, 'sapServiceId', null);
  2419. that.$set(domainItem, 'serviceList', res.data);
  2420. } else {
  2421. this.$message({
  2422. message: res.msg,
  2423. type: "error"
  2424. });
  2425. }
  2426. },error => {
  2427. this.$message({
  2428. message: error,
  2429. type: "error"
  2430. });
  2431. }
  2432. );
  2433. } else {
  2434. //清空服务
  2435. }
  2436. },
  2437. onBatchTimeChange() {
  2438. //反向计算每日工作时长
  2439. if (this.workForm.createDate) {
  2440. let sdate = new Date(this.workForm.createDate[0]);
  2441. let edate = new Date(this.workForm.createDate[1]);
  2442. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2443. console.log('days===', days)
  2444. if (days < 0) {
  2445. return;
  2446. }
  2447. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2448. //总时长发生改变,自动按比例计算
  2449. this.workForm.domains.forEach(d=>{
  2450. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2451. });
  2452. }
  2453. },
  2454. //更新工作内容列表
  2455. updateJobContent(domainItem) {
  2456. var that = this;
  2457. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2458. if (res.code == "ok") {
  2459. // domainItem.workContentList = res.data;
  2460. that.$set(domainItem, 'extraField3', null);
  2461. that.$set(domainItem, 'workContentList', res.data);
  2462. } else {
  2463. this.$message({
  2464. message: res.msg,
  2465. type: "error"
  2466. });
  2467. }
  2468. },error => {
  2469. this.$message({
  2470. message: error,
  2471. type: "error"
  2472. });
  2473. }
  2474. );
  2475. },
  2476. updateResponse(domainItem) {
  2477. var that = this;
  2478. var selectPid = domainItem.projectId;
  2479. domainItem.extraField2 = null;
  2480. domainItem.extraField3 = null;
  2481. if (selectPid && domainItem.extraField1) {
  2482. //是否非项目
  2483. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2484. console.log('==========','isPublic=='+isPublic);
  2485. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2486. console.log(filteredRespList);
  2487. domainItem.filteredRespList = filteredRespList;
  2488. }
  2489. },
  2490. getJobResponList() {
  2491. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2492. if (res.code == "ok") {
  2493. this.jobResponseList = res.data;
  2494. } else {
  2495. this.$message({
  2496. message: res.msg,
  2497. type: "error"
  2498. });
  2499. }
  2500. },error => {
  2501. this.$message({
  2502. message: error,
  2503. type: "error"
  2504. });
  2505. }
  2506. );
  2507. },
  2508. openModImportTime(row) {
  2509. this.showModImportTimeDialog = true;
  2510. this.modItemDataId = row.id;
  2511. },
  2512. delImportTime(row) {
  2513. let rowId = row.id;
  2514. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2515. confirmButtonText: this.$t('btn.determine'),
  2516. cancelButtonText: this.$t('btn.cancel'),
  2517. type: "warning"
  2518. })
  2519. .then(() => {
  2520. this.http.post('/report-import-log/delete',{
  2521. id: rowId
  2522. },res => {
  2523. if (res.code == "ok") {
  2524. this.$message({
  2525. message: '删除成功',
  2526. type: "success"
  2527. });
  2528. this.getToView();
  2529. } else {
  2530. this.$message({
  2531. message: res.msg,
  2532. type: "error"
  2533. });
  2534. }
  2535. },error => {
  2536. this.$message({
  2537. message: error,
  2538. type: "error"
  2539. });
  2540. }
  2541. );
  2542. }).catch(() => {this.startDeleting = false});
  2543. },
  2544. confirmChangeModTime() {
  2545. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2546. this.$message({
  2547. message: '请选择时间',
  2548. type: "error"
  2549. });
  2550. return;
  2551. }
  2552. this.http.post('/report-import-log/changeTime',{
  2553. modLogDateTime: this.modImportTime,
  2554. modImportUserId: this.modImportUserId,
  2555. id: this.modItemDataId
  2556. },res => {
  2557. if (res.code == "ok") {
  2558. this.$message({
  2559. message: '修改成功',
  2560. type: "success"
  2561. });
  2562. this.getToView();
  2563. this.showModImportTimeDialog = false;
  2564. } else {
  2565. this.$message({
  2566. message: res.msg,
  2567. type: "error"
  2568. });
  2569. }
  2570. },error => {
  2571. this.$message({
  2572. message: error,
  2573. type: "error"
  2574. });
  2575. }
  2576. );
  2577. },
  2578. confirmBatchApproveReport() {
  2579. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2580. this.$message({
  2581. message: '请选择日期范围',
  2582. type: "error"
  2583. });
  2584. return;
  2585. }
  2586. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2587. confirmButtonText: this.$t('btn.determine'),
  2588. cancelButtonText: this.$t('btn.cancel'),
  2589. type: "warning"
  2590. })
  2591. .then(() => {
  2592. this.startDeleting = true;
  2593. let obj = {
  2594. startDate: this.deleteReportParam.date[0],
  2595. endDate: this.deleteReportParam.date[1]
  2596. }
  2597. if(this.deleteReportParam.departmentId) {
  2598. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2599. } else {
  2600. obj.departmentId = null
  2601. }
  2602. this.http.post('/report/batchApproveByDate',obj,res => {
  2603. if (res.code == "ok") {
  2604. this.$message({
  2605. message: '审核通过',
  2606. type: "success"
  2607. });
  2608. this.getReportList();
  2609. this.getDepartment();
  2610. this.startDeleting = false;
  2611. } else {
  2612. this.$message({
  2613. message: res.msg,
  2614. type: "error"
  2615. });
  2616. }
  2617. },error => {
  2618. this.$message({
  2619. message: error,
  2620. type: "error"
  2621. });
  2622. }
  2623. );
  2624. }).catch(() => {this.startDeleting = false});
  2625. },
  2626. confirmBatchDelReport() {
  2627. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2628. this.$message({
  2629. message: '请选择部门或人员',
  2630. type: "error"
  2631. });
  2632. return;
  2633. }
  2634. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2635. this.$message({
  2636. message: '请选择日期范围',
  2637. type: "error"
  2638. });
  2639. return;
  2640. }
  2641. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2642. confirmButtonText: this.$t('btn.determine'),
  2643. cancelButtonText: this.$t('btn.cancel'),
  2644. type: "warning"
  2645. })
  2646. .then(() => {
  2647. this.startDeleting = true;
  2648. this.http.post('/report/batchDelete',{
  2649. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2650. startDate: this.deleteReportParam.date[0],
  2651. endDate: this.deleteReportParam.date[1],
  2652. deptId: this.deleteReportParam.deptId[0]
  2653. },res => {
  2654. if (res.code == "ok") {
  2655. this.$message({
  2656. message: this.$t('message.successfullyDeleted'),
  2657. type: "success"
  2658. });
  2659. this.getReportList();
  2660. this.getDepartment();
  2661. this.startDeleting = false;
  2662. } else {
  2663. this.$message({
  2664. message: res.msg,
  2665. type: "error"
  2666. });
  2667. }
  2668. },error => {
  2669. this.$message({
  2670. message: error,
  2671. type: "error"
  2672. });
  2673. }
  2674. );
  2675. }).catch(() => {this.startDeleting = false});
  2676. },
  2677. getRecentlyProject() {
  2678. this.http.post('/project/nearProject',{},res => {
  2679. if(res.code == 'ok'){
  2680. let topObj = {
  2681. label: '最近选择项目',
  2682. peojectList: res.data
  2683. }
  2684. let botomObj = {
  2685. label: '全部项目',
  2686. peojectList: this.fillProjectList
  2687. }
  2688. //最近项目如果在fillProjectList中不存在,需要移除
  2689. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2690. this.integrationProjectList = [topObj, botomObj]
  2691. }else {
  2692. this.$message({
  2693. message: res.msg,
  2694. type: 'error'
  2695. })
  2696. }
  2697. },err => {
  2698. this.$message({
  2699. message: err,
  2700. type: 'error'
  2701. })
  2702. })
  2703. },
  2704. handlePictureCardPreview(file, index) {
  2705. console.log(file, index)
  2706. let arr = []
  2707. let imgArr = this.workForm.domains[index].imgListUrl
  2708. for(var i in imgArr) {
  2709. arr.push(imgArr[i].url)
  2710. }
  2711. console.log(arr, '图片数据')
  2712. const $viewer = this.$viewerApi({
  2713. images: arr
  2714. });
  2715. },
  2716. // 图片上传
  2717. addImg(e, index) {
  2718. console.log(e, '数据')
  2719. let formData = new FormData()
  2720. formData.append('multipartFile', e.file)
  2721. this.http.uploadFile('/common/uploadFile', formData,
  2722. res => {
  2723. if (res.code == "ok") {
  2724. this.$message({
  2725. message: this.$t('uploadedsuccessfully'),
  2726. type: "success"
  2727. });
  2728. if(!this.workForm.domains[index].imgList) {
  2729. this.workForm.domains[index].imgList = []
  2730. this.workForm.domains[index].imgListUrl = []
  2731. }
  2732. this.workForm.domains[index].imgList.push(res.data)
  2733. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2734. } else {
  2735. this.$message({message: res.msg,type: "error"});
  2736. }
  2737. console.log(this.workForm.domains[index])
  2738. },
  2739. error => {this.$message({message: error,type: "error"});
  2740. });
  2741. },
  2742. // 删除图片
  2743. delImg(file,fileList, index) {
  2744. console.log(file, fileList)
  2745. let idx = 0
  2746. for(let i in fileList) {
  2747. if(fileList[i].uid == file.uid) {
  2748. idx = i
  2749. }
  2750. }
  2751. this.workForm.domains[index].imgList.splice(idx, 1)
  2752. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2753. console.log(this.workForm.domains[index])
  2754. },
  2755. test(){
  2756. console.log('test',this.workForm.domains);
  2757. },
  2758. getHour(s1, s2) {
  2759. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2760. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2761. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2762. var ms = s2.getTime() - s1.getTime();
  2763. if (ms < 0) return 0;
  2764. let ma = ms / 1000 / 60 / 60
  2765. return ma; //小时
  2766. },
  2767. refreshWXCardTime(workdate) {
  2768. if (!workdate) return;
  2769. this.syncTimeLoading = true;
  2770. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2771. date: workdate,
  2772. },res => {
  2773. this.syncTimeLoading = false;
  2774. if(res.code == 'ok'){
  2775. this.workForm.time = res.data.time;
  2776. }else {
  2777. this.$message({
  2778. message: res.msg,
  2779. type: 'error'
  2780. })
  2781. }
  2782. },err => {
  2783. this.syncTimeLoading = false;
  2784. this.$message({
  2785. message: err,
  2786. type: 'error'
  2787. })
  2788. })
  2789. },
  2790. refreshAttendance(workdate) {
  2791. if (!workdate) return;
  2792. this.syncTimeLoading = true;
  2793. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2794. startDate: workdate[0],
  2795. endDate: workdate[1]
  2796. },res => {
  2797. this.syncTimeLoading = false;
  2798. if(res.code == 'ok'){
  2799. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2800. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2801. this.totalReportHours = this.workTimeForMinYi;
  2802. }else {
  2803. this.$message({
  2804. message: res.msg,
  2805. type: 'error'
  2806. })
  2807. }
  2808. },err => {
  2809. this.syncTimeLoading = false;
  2810. this.$message({
  2811. message: err,
  2812. type: 'error'
  2813. })
  2814. })
  2815. },
  2816. refreshBeiSengAttendance(workdate) {
  2817. if (!workdate) return;
  2818. this.syncTimeLoading = true;
  2819. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2820. createDate: workdate
  2821. },res => {
  2822. this.syncTimeLoading = false;
  2823. if(res.code == 'ok'){
  2824. this.workForm.time = res.data;
  2825. }else {
  2826. this.$message({
  2827. message: res.msg,
  2828. type: 'error'
  2829. })
  2830. }
  2831. },err => {
  2832. this.syncTimeLoading = false;
  2833. this.$message({
  2834. message: err,
  2835. type: 'error'
  2836. })
  2837. })
  2838. },
  2839. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2840. this.weeklyFilledTimeDialog = true
  2841. this.weeklyFilledTimeLoading = true
  2842. this.weeklyFilledTimeDate = parameterDate
  2843. this.http.post('/report/getReportList',{
  2844. date: parameterDate,
  2845. userId: this.user.id
  2846. },res => {
  2847. this.weeklyFilledTimeLoading = false
  2848. if(res.code == 'ok'){
  2849. this.weeklyFilledTimeList = res.data[0].data
  2850. let candelete = true
  2851. for(let i in this.weeklyFilledTimeList){
  2852. if(this.weeklyFilledTimeList[i].state < 2){
  2853. candelete = false
  2854. }
  2855. }
  2856. this.weeklyFilledTimeCanDelete = candelete
  2857. }else {
  2858. this.$message({
  2859. message: res.msg,
  2860. type: 'error'
  2861. })
  2862. }
  2863. },err => {
  2864. this.weeklyFilledTimeLoading = false
  2865. this.$message({
  2866. message: err,
  2867. type: 'error'
  2868. })
  2869. })
  2870. },
  2871. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2872. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2873. confirmButtonText: this.$t('btn.determine'),
  2874. cancelButtonText: this.$t('btn.cancel'),
  2875. type: "warning"
  2876. })
  2877. .then(() => {
  2878. this.http.post('/report/delete',{
  2879. userId: this.user.id,
  2880. date: this.weeklyFilledTimeDate
  2881. },res => {
  2882. if (res.code == "ok") {
  2883. this.$message({
  2884. message: this.$t('message.successfullyDeleted'),
  2885. type: "success"
  2886. });
  2887. this.getWeeklyWorkTime()
  2888. this.getReportList();
  2889. this.getDepartment();
  2890. this.weeklyFilledTimeDialog = false;
  2891. } else {
  2892. this.$message({
  2893. message: res.msg,
  2894. type: "error"
  2895. });
  2896. }
  2897. },error => {
  2898. this.$message({
  2899. message: error,
  2900. type: "error"
  2901. });
  2902. }
  2903. );
  2904. }).catch(() => {});
  2905. },
  2906. getApprovalProcess(item){
  2907. // console.log('this.date',this.choseDate);
  2908. this.http.post('/report-log/get',{
  2909. creatorId: item.id,
  2910. createDate: sessionStorage.msg
  2911. },res => {
  2912. if(res.code == 'ok'){
  2913. this.approvalProcessDialog = true
  2914. if(this.user.userNameNeedTranslate == 1) {
  2915. for(var i in res.data) {
  2916. let obj = {
  2917. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2918. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2919. }
  2920. res.data[i].msgCon = obj
  2921. }
  2922. }
  2923. this.approvalProcessData = res.data
  2924. console.log(this.approvalProcessData, '数据卡看')
  2925. }else{
  2926. this.$message({
  2927. message: res.msg,
  2928. type: 'error'
  2929. })
  2930. }
  2931. },err => {
  2932. this.$message({
  2933. message: err,
  2934. type: 'error'
  2935. })
  2936. })
  2937. },
  2938. filterNode(value, data) {
  2939. if (!value) return true;
  2940. return data.label.indexOf(value) !== -1;
  2941. },
  2942. triggerCalculateOT(index) {
  2943. var str = this.workForm.domains[index].overtimeHours + ''
  2944. if(str.indexOf('.') != '-1') {
  2945. var s = str.split('.')[0]
  2946. var st = str.split('.')[1]
  2947. var sts = st.split('')
  2948. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2949. }
  2950. },
  2951. searchScreen(e){
  2952. if(e){
  2953. this.monthNotWorkDateS1 = []
  2954. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2955. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2956. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2957. }
  2958. }
  2959. if (this.monthNotWorkDateS1.length > 50) {
  2960. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2961. }else{
  2962. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2963. }
  2964. // if (this.monthNotWorkDateS1.length > 0) {
  2965. // setTimeout(() => {
  2966. // this.tableListenernot()
  2967. // }, 1000);
  2968. // }
  2969. }else{
  2970. this.monthWorkDataS1 = []
  2971. for (let i = 0; i < this.monthWorkData.length; i++) {
  2972. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2973. this.monthWorkDataS1.push(this.monthWorkData[i])
  2974. }
  2975. }
  2976. if (this.monthWorkDataS1.length > 50) {
  2977. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2978. }else{
  2979. this.monthWorkDataS = this.monthWorkDataS1
  2980. }
  2981. // if (this.monthWorkDataS1.length > 0) {
  2982. // setTimeout(() => {
  2983. // this.tableListener()
  2984. // }, 1000);
  2985. // }
  2986. }
  2987. },
  2988. addUpload(data) {
  2989. // var zhi = data.fileName.split('.')[0]
  2990. // var sss = zhi + '.xlsx'
  2991. // return
  2992. var filePath = '/upload/' + data.serverName;
  2993. const a = document.createElement('a'); // 创建a标签
  2994. a.setAttribute('download', data.fileName);// download属性
  2995. a.setAttribute('href', filePath);// href链接
  2996. a.click(); //自执行点击事件
  2997. a.remove();
  2998. },
  2999. restrictNumber(targetId) {
  3000. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3001. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3002. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3003. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3004. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3005. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3006. inpu.value = parseFloat(inpu.value);
  3007. }
  3008. },
  3009. //获取项目下的任务分组
  3010. getTaskGroups(domain, index) {
  3011. domain.groupId=null;
  3012. this.http.post('/task-group/listMyJoinGroup',{
  3013. projectId: domain.projectId,
  3014. isSubstitude: this.isSubstitude ? 1 : 0
  3015. },
  3016. res => {
  3017. if (res.code == "ok") {
  3018. this.workForm.domains[index].taskGroups = res.data;
  3019. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3020. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3021. // this.getGroupStages(domain, index);
  3022. // }
  3023. this.$forceUpdate();
  3024. }
  3025. },
  3026. error => {
  3027. this.$message({
  3028. message: error,
  3029. type: "error"
  3030. });
  3031. }
  3032. );
  3033. },
  3034. //下载填报工时占比报表
  3035. downloadProjectRatio() {
  3036. this.exportUserRatio = true;
  3037. // let now = new Date();
  3038. // let month = now.getMonth();//默认看上个月的
  3039. // let monthStr = month<10? ('0'+month): month;
  3040. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3041. const today = new Date();
  3042. const year = today.getFullYear();
  3043. const month = today.getMonth() + 1;
  3044. let lastMonthYear, lastMonth;
  3045. if (month === 1) {
  3046. lastMonthYear = year - 1;
  3047. lastMonth = 12;
  3048. } else {
  3049. lastMonthYear = year;
  3050. lastMonth = month - 1;
  3051. }
  3052. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3053. console.log('赋值 ==>', this.ratioYmonth)
  3054. },
  3055. confirmDownloadRatio() {
  3056. this.startRatioExporting = true;
  3057. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3058. ymonth: this.ratioYmonth
  3059. },
  3060. res => {
  3061. if (res.code == "ok") {
  3062. this.startRatioExporting = false;
  3063. var filePath = res.data;
  3064. const a = document.createElement('a'); // 创建a标签
  3065. var data = filePath.split("/");
  3066. a.setAttribute('download', data[data.length-1]);// download属性
  3067. a.setAttribute('href', filePath);// href链接
  3068. a.click(); //自执行点击事件
  3069. a.remove();
  3070. } else {
  3071. this.startRatioExporting = false;
  3072. this.$message({
  3073. message: res.msg,
  3074. type: "error"
  3075. });
  3076. }
  3077. },
  3078. error => {
  3079. this.checkinLoading = false;
  3080. this.$message({
  3081. message: error,
  3082. type: "error"
  3083. });
  3084. }
  3085. );
  3086. },
  3087. //下载带企业微信考勤数据的工时统计模板
  3088. downloadCheckInExcel() {
  3089. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3090. startDate: this.importWxParam.date[0],
  3091. endDate: this.importWxParam.date[1],
  3092. },
  3093. res => {
  3094. if (res.code == "ok") {
  3095. var filePath = res.data;
  3096. const a = document.createElement('a'); // 创建a标签
  3097. var data = filePath.split("/");
  3098. a.setAttribute('download', data[data.length-1]);// download属性
  3099. a.setAttribute('href', filePath);// href链接
  3100. a.click(); //自执行点击事件
  3101. a.remove();
  3102. } else {
  3103. this.$message({
  3104. message: res.msg,
  3105. type: "error"
  3106. });
  3107. }
  3108. },
  3109. error => {
  3110. this.checkinLoading = false;
  3111. this.$message({
  3112. message: error,
  3113. type: "error"
  3114. });
  3115. }
  3116. );
  3117. },
  3118. pre() {
  3119. if (this.active == 0) return;
  3120. this.active--;
  3121. },
  3122. next() {
  3123. this.active++;
  3124. },
  3125. triggerTotalTime(index) {
  3126. var item = this.checkinList[index];
  3127. var total = 0.0;
  3128. for (var i=0;i<this.projectColumns.length; i++) {
  3129. var key = this.projectColumns[i];
  3130. if (item[key] != null && item[key] != '') {
  3131. total += parseFloat(item[key]);
  3132. }
  3133. }
  3134. item.totalFillTime = total;
  3135. },
  3136. //提交批量代填的数据
  3137. submitBatchSubFillData() {
  3138. var data = JSON.stringify(this.checkinList);
  3139. this.http.post('/user-corpwx-time/submitProjectTime',{
  3140. json: data,
  3141. projectColumns: JSON.stringify(this.projectColumns)
  3142. },
  3143. res => {
  3144. if (res.code == "ok") {
  3145. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3146. this.importWxDialog = false;
  3147. }
  3148. },
  3149. error => {
  3150. this.checkinLoading = false;
  3151. this.$message({
  3152. message: error,
  3153. type: "error"
  3154. });
  3155. }
  3156. );
  3157. },
  3158. loadCheckInData() {
  3159. if (this.importWxParam.date == null) {
  3160. this.checkinList = [];
  3161. return;
  3162. }
  3163. this.checkinLoading = true;
  3164. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3165. startDate: this.importWxParam.date[0],
  3166. endDate: this.importWxParam.date[1],
  3167. },
  3168. res => {
  3169. if (res.code == "ok") {
  3170. this.checkinLoading = false;
  3171. this.checkinList = res.data.list;
  3172. this.projectColumns = res.data.projects;
  3173. // 自定义表格会导致表格错乱,需重新计算表格
  3174. this.$nextTick(()=>{
  3175. this.$refs.tab.doLayout()
  3176. })
  3177. }
  3178. },
  3179. error => {
  3180. this.checkinLoading = false;
  3181. this.$message({
  3182. message: error,
  3183. type: "error"
  3184. });
  3185. }
  3186. );
  3187. },
  3188. importCardTime(item) {
  3189. //首先判断文件类型
  3190. let str = item.file.name.split(".");
  3191. let format = str[str.length - 1];
  3192. if (format != "xls" && format != "xlsx") {
  3193. this.$message({
  3194. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3195. type: "error"
  3196. });
  3197. } else {
  3198. this.importingData = true;
  3199. let formData = new FormData();
  3200. formData.append("multipartFile", item.file);
  3201. formData.append("companyId", this.user.companyId);
  3202. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3203. res => {
  3204. this.$refs.uploadCardTime.clearFiles();
  3205. this.importingData = false;
  3206. if (res.code == "ok") {
  3207. //换成弹出框,以免有人等了半天回来啥也没看到
  3208. this.$message({
  3209. message: '导入考勤时长成功',
  3210. type: "success"
  3211. });
  3212. } else {
  3213. this.$message({
  3214. message: res.msg,
  3215. type: "error"
  3216. });
  3217. }
  3218. },
  3219. error => {
  3220. this.$refs.upload.clearFiles();
  3221. this.listLoading = false;
  3222. this.$message({
  3223. message: error,
  3224. type: "error"
  3225. });
  3226. });
  3227. }
  3228. },
  3229. batchImportWxData(item) {
  3230. //首先判断文件类型
  3231. let str = item.file.name.split(".");
  3232. let format = str[str.length - 1];
  3233. if (format != "xls" && format != "xlsx") {
  3234. this.$message({
  3235. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3236. type: "error"
  3237. });
  3238. } else {
  3239. this.importingData = true;
  3240. let formData = new FormData();
  3241. formData.append("file", item.file);
  3242. formData.append("companyId", this.user.companyId);
  3243. formData.append("withCheckIn", 1);
  3244. this.http.uploadFile('/report/importData', formData,
  3245. res => {
  3246. this.$refs.upload.clearFiles();
  3247. this.showImportResult = true;
  3248. this.importingData = false;
  3249. if (res.code == "ok") {
  3250. //换成弹出框,以免有人等了半天回来啥也没看到
  3251. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3252. this.getReportList();
  3253. this.importWxDialog = false;
  3254. } else {
  3255. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3256. }
  3257. },
  3258. error => {
  3259. this.$refs.upload.clearFiles();
  3260. this.listLoading = false;
  3261. this.$message({
  3262. message: error,
  3263. type: "error"
  3264. });
  3265. });
  3266. }
  3267. },
  3268. batchImportData(item) {
  3269. //首先判断文件类型
  3270. let str = item.file.name.split(".");
  3271. let format = str[str.length - 1];
  3272. if (format != "xls" && format != "xlsx") {
  3273. this.$message({
  3274. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3275. type: "error"
  3276. });
  3277. } else {
  3278. this.importingData = true;
  3279. let formData = new FormData();
  3280. formData.append("file", item.file);
  3281. formData.append("companyId", this.user.companyId);
  3282. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3283. this.http.uploadFile(url, formData,
  3284. res => {
  3285. this.$refs.upload.clearFiles();
  3286. this.importingData = false;
  3287. this.showImportResult = true;
  3288. if (res.code == "ok") {
  3289. //换成弹出框,以免有人等了半天回来啥也没看到
  3290. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3291. this.getReportList();
  3292. this.importWXDialog = false;
  3293. } else {
  3294. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3295. }
  3296. },
  3297. error => {
  3298. this.$refs.upload.clearFiles();
  3299. this.importingData = false;
  3300. this.$message({
  3301. message: error,
  3302. type: "error"
  3303. });
  3304. });
  3305. }
  3306. },
  3307. userssHu() {
  3308. this.http.post('/time-type/getCompanyTimeSetting',{
  3309. companyId: this.user.companyId
  3310. },
  3311. res => {
  3312. if (res.code == "ok") {
  3313. this.yonghuUser = res.data
  3314. }
  3315. },
  3316. error => {
  3317. this.$message({
  3318. message: error,
  3319. type: "error"
  3320. });
  3321. }
  3322. );
  3323. },
  3324. iptBlur(i) {
  3325. if(this.isBatch == 0) {
  3326. return
  3327. }
  3328. var reqParam = {
  3329. startDate: this.workForm.createDate[0],
  3330. endDate: this.workForm.createDate[1]
  3331. };
  3332. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3333. reqParam.userId = this.workForm.userId[0];
  3334. }
  3335. this.http.post('/report/getWorkDays',reqParam,
  3336. res => {
  3337. if (res.code == "ok") {
  3338. this.jsDay = res.data
  3339. this.chuji(i)
  3340. } else {
  3341. this.$message({
  3342. message: res.msg,
  3343. type: "error"
  3344. });
  3345. }
  3346. },
  3347. error => {
  3348. this.$message({
  3349. message: error,
  3350. type: "error"
  3351. });
  3352. }
  3353. );
  3354. //明夷硬编码获取
  3355. if (this.user.company.companyName == this.mingyiName) {
  3356. this.getWorkTimeForMinYi();
  3357. }
  3358. },
  3359. getWorkTimeForMinYi(){
  3360. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3361. startDate: this.workForm.createDate[0],
  3362. endDate: this.workForm.createDate[1]
  3363. },
  3364. res => {
  3365. if (res.code == "ok") {
  3366. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3367. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3368. this.totalReportHours = this.workTimeForMinYi;
  3369. } else {
  3370. this.$message({
  3371. message: res.msg,
  3372. type: "error"
  3373. });
  3374. this.workForm.createDate = [];
  3375. }
  3376. },
  3377. error => {
  3378. this.$message({
  3379. message: error,
  3380. type: "error"
  3381. });
  3382. }
  3383. );
  3384. },
  3385. chuji(i) {
  3386. if(i == 0) {
  3387. this.seleChn(1)
  3388. } else if(i == 1) {
  3389. this.seleChn(0)
  3390. } else if(i == 2) {
  3391. if(this.workForm.domains[0].multiWorktime > 0) {
  3392. this.iptChangs()
  3393. } else {
  3394. this.iptChang()
  3395. }
  3396. } else if(i == 3) {
  3397. this.seleChn(0)
  3398. }
  3399. },
  3400. seleChn(e,domain) {
  3401. if(e == 1) {
  3402. for(var i in this.workForm.domains) {
  3403. if(this.workForm.domains[i].timeType == 0) {
  3404. this.workForm.domains[i].workingTime = 8
  3405. } else {
  3406. this.workForm.domains[i].workingTime = 4
  3407. }
  3408. }
  3409. }
  3410. var quanbu = 0
  3411. var spl = this.workForm.domains
  3412. var zhi = ''
  3413. for(var i in spl) {
  3414. var sp = +spl[i].workingTime + 0
  3415. zhi = this.jsDay * sp
  3416. quanbu = +quanbu + zhi
  3417. }
  3418. this.jsTime = quanbu
  3419. this.totalReportHours = quanbu
  3420. let worktime = this.jsTime
  3421. // 自动计算加班时长
  3422. if(this.isBatch != 0){
  3423. worktime = this.jsTime / this.jsDay
  3424. }
  3425. if(this.user.timeType.fillOvertime && domain){
  3426. let isover = false
  3427. let alltime = 0
  3428. let allover = 0 //此处alltime同上面的worktime
  3429. for(let d in spl){
  3430. if(spl[d].isOvertime){
  3431. isover = true
  3432. allover += spl[d].overtimeHours*1
  3433. }
  3434. alltime += spl[d].workingTime*1
  3435. }
  3436. if(domain.overtimeHours){
  3437. allover = allover - domain.overtimeHours
  3438. }
  3439. if(worktime*1 > this.user.timeType.allday){
  3440. if(isover){
  3441. if(alltime > (allover + this.user.timeType.allday)){
  3442. this.$set(domain,'isOvertime',true)
  3443. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3444. }else{
  3445. this.$set(domain,'isOvertime',false)
  3446. this.$set(domain,'overtimeHours',null)
  3447. if(alltime < (allover + this.user.timeType.allday)){
  3448. let overtime = allover + this.user.timeType.allday - alltime
  3449. for(let pi in spl){
  3450. if(spl[pi].overtimeHours){
  3451. if((overtime - spl[pi].overtimeHours*1) > 0){
  3452. overtime = overtime - spl[pi].overtimeHours*1
  3453. this.$set(spl[pi],'isOvertime',false)
  3454. this.$set(spl[pi],'overtimeHours',null)
  3455. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3456. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3457. break
  3458. }else{
  3459. this.$set(spl[pi],'isOvertime',false)
  3460. this.$set(spl[pi],'overtimeHours',null)
  3461. break
  3462. }
  3463. }
  3464. }
  3465. }
  3466. }
  3467. }else{
  3468. this.$set(domain,'isOvertime',true)
  3469. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3470. }
  3471. }else{
  3472. for(let di in spl){
  3473. this.$set(spl[di],'isOvertime',false)
  3474. this.$set(spl[di],'overtimeHours',null)
  3475. }
  3476. }
  3477. }
  3478. },
  3479. iptChang() {
  3480. var sl = this.workForm.domains
  3481. let timeArr = []
  3482. for(var i in sl) {
  3483. if(sl[i].startTime && sl[i].endTime) {
  3484. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3485. }
  3486. }
  3487. this.getTimeHours(timeArr)
  3488. // for(let j in arrNum) {
  3489. // this.timeJsonStr += arrNum[j]
  3490. // if(flg) {
  3491. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3492. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3493. // }
  3494. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3495. // flg = true
  3496. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3497. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3498. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3499. // }
  3500. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3501. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3502. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3503. // }
  3504. // }
  3505. },
  3506. iptChangs() {
  3507. var sl = this.workForm.domains
  3508. let timeArr = []
  3509. for(var i in sl) {
  3510. for(var j in sl[i].worktimeList){
  3511. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3512. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3513. }
  3514. }
  3515. }
  3516. this.getTimeHours(timeArr)
  3517. },
  3518. // 调用接口或去数据
  3519. getTimeHours(arr) {
  3520. this.http.post('/report/getHoursByTimeRange',{
  3521. timeJsonStr: JSON.stringify(arr)
  3522. },res => {
  3523. if(res.code === 'ok') {
  3524. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3525. } else {
  3526. this.$message({
  3527. message: res.msg,
  3528. type: 'error'
  3529. })
  3530. }
  3531. },err => {
  3532. this.$message({
  3533. message: err,
  3534. type: 'error'
  3535. })
  3536. })
  3537. },
  3538. // 按周填报调用接口计算时间
  3539. async getWeekHoursByTimeRange(timeRange) {
  3540. const url = '/report/getHoursByTimeRange';
  3541. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3542. var that = this;
  3543. return new Promise((resolve, reject) => {
  3544. this.http.post(url, data, function(res) {
  3545. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3546. }, function(err) {
  3547. reject(err);
  3548. });
  3549. });
  3550. },
  3551. removeTimeItem(item, index) {
  3552. item.worktimeList.splice(index, 1);
  3553. this.iptChangs()
  3554. },
  3555. //添加工时
  3556. addNewWorktime(index, item) {
  3557. if(item.worktimeList == null ) {
  3558. item.worktimeList = []
  3559. }
  3560. item.worktimeList.push({});
  3561. },
  3562. //复制项目
  3563. copyProject(index) {
  3564. var leftProgress = 10;
  3565. if (this.reportTimeType.type == 3) {
  3566. //计算已经待分配工时比例
  3567. let array = this.workForm.domains;
  3568. let totalProgress = 0;
  3569. for (var i=0;i<array.length; i++) {
  3570. totalProgress += array[i].progress;
  3571. }
  3572. if (totalProgress < 100) {
  3573. leftProgress = 100 - totalProgress;
  3574. }
  3575. }
  3576. var newIndex = index+1;
  3577. var itemDomain = {
  3578. projectId: this.workForm.domains[index].projectId,
  3579. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3580. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3581. ),
  3582. content: "",
  3583. progress:leftProgress,
  3584. state:2,//2-表示待提交
  3585. };
  3586. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3587. if (this.reportTimeType.type == 0) {
  3588. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3589. var length = this.workForm.domains.length;
  3590. if (length == 2) {
  3591. this.showAddMore = false;
  3592. }
  3593. }
  3594. this.selectProject(itemDomain, newIndex);
  3595. },
  3596. pushWorkTime(reportId){
  3597. let url=''
  3598. if(this.user.timeType.syncSap == 1){
  3599. url='/report/pushProjectReportToSap'
  3600. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3601. var pushDate = this.date + day;
  3602. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3603. confirmButtonText: '确定',
  3604. cancelButtonText: '取消',
  3605. type: 'info'
  3606. }).then(() => {
  3607. const loading = this.$loading({
  3608. lock: true,
  3609. text: '正在推送中,请耐心等待。',
  3610. spinner: 'el-icon-loading',
  3611. background: 'rgba(0, 0, 0, 0.7)'
  3612. });
  3613. this.http.post(url,{
  3614. pushDate: pushDate,
  3615. reportId: reportId
  3616. },res => {
  3617. loading.close();
  3618. if(res.code == 'ok'){
  3619. this.$message({
  3620. type: 'success',
  3621. message: res.data
  3622. });
  3623. }else{
  3624. this.$message({
  3625. type: 'error',
  3626. message: res.msg
  3627. })
  3628. }
  3629. },err => {
  3630. loading.close();
  3631. this.$message({
  3632. type: 'error',
  3633. message: err
  3634. })
  3635. })
  3636. }).catch(() => {
  3637. });
  3638. }else{
  3639. url='/report/pushReportDataToThird'
  3640. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3641. confirmButtonText: '确定',
  3642. cancelButtonText: '取消',
  3643. type: 'info'
  3644. }).then(() => {
  3645. const loading = this.$loading({
  3646. lock: true,
  3647. text: '正在推送中,请耐心等待。',
  3648. spinner: 'el-icon-loading',
  3649. background: 'rgba(0, 0, 0, 0.7)'
  3650. });
  3651. this.http.post(url,{
  3652. yearMonth: this.date
  3653. },res => {
  3654. loading.close();
  3655. if(res.code == 'ok'){
  3656. this.$message({
  3657. type: 'success',
  3658. message: '推送成功!'
  3659. });
  3660. }else{
  3661. this.$message({
  3662. type: 'error',
  3663. message: res.msg
  3664. })
  3665. }
  3666. },err => {
  3667. loading.close();
  3668. this.$message({
  3669. type: 'error',
  3670. message: err
  3671. })
  3672. })
  3673. }).catch(() => {
  3674. });
  3675. }
  3676. },
  3677. showWorkTime(){
  3678. this.monthWorkTimeDialog = true;
  3679. this.searchKeyword = ''
  3680. this.WorktimeDatepickValue = this.istoMonth()
  3681. if(this.WorktimeDatepickValue.length == 0){
  3682. let newdate = new Date();
  3683. let nowdate = newdate.toLocaleDateString();
  3684. let getauto = this.getAutoWeekDate(nowdate)
  3685. let nowwd = [getauto[0],getauto[6]]
  3686. this.WorktimeDatepickValue = nowwd
  3687. }
  3688. this.showMonthWorkTime()
  3689. },
  3690. handleClick(t,e){
  3691. if (t.name == "second") {
  3692. this.showMonthNotWorkTime()
  3693. }else if(t.name == "first"){
  3694. this.showMonthWorkTime()
  3695. }else if(t.name == "third"){
  3696. this.showMonthWorkTimeReminder()
  3697. }
  3698. },
  3699. //导出员工每日填报工时数
  3700. exportMembWorkHours() {
  3701. this.http.post(
  3702. "/report/exportUserDailyWorkTime",
  3703. {
  3704. // month: this.date,
  3705. startDate: this.WorktimeDatepickValue[0],
  3706. endDate: this.WorktimeDatepickValue[1],
  3707. },
  3708. (res) => {
  3709. if (res.code == "ok") {
  3710. let url = res.data;
  3711. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3712. }
  3713. },
  3714. (error) => {
  3715. this.$message({
  3716. message: error,
  3717. type: "error",
  3718. });
  3719. }
  3720. );
  3721. },
  3722. exportMembWorkHoursReminder() {
  3723. this.http.post(
  3724. "/report/exportUserDailyWorkTimeReminder",
  3725. {
  3726. // month: this.date,
  3727. startDate: this.WorktimeDatepickValue[0],
  3728. endDate: this.WorktimeDatepickValue[1],
  3729. },
  3730. (res) => {
  3731. if (res.code == "ok") {
  3732. let url = res.data;
  3733. this.downloadByA('工时异常表.xlsx', url);
  3734. }
  3735. },
  3736. (error) => {
  3737. this.$message({
  3738. message: error,
  3739. type: "error",
  3740. });
  3741. }
  3742. );
  3743. },
  3744. exportMembNotWorkHours() {
  3745. this.http.post(
  3746. "/report/exportNoReportUserList",
  3747. {
  3748. // month: this.date,
  3749. startDate: this.WorktimeDatepickValue[0],
  3750. endDate: this.WorktimeDatepickValue[1],
  3751. },
  3752. (res) => {
  3753. if (res.code == "ok") {
  3754. let url = res.data;
  3755. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3756. }
  3757. },
  3758. (error) => {
  3759. this.$message({
  3760. message: error,
  3761. type: "error",
  3762. });
  3763. }
  3764. );
  3765. },
  3766. downloadByA(name, url) {
  3767. const a = document.createElement("a"); // 创建a标签
  3768. a.setAttribute("download", name); // download属性
  3769. a.setAttribute("href", url); // href链接
  3770. a.click(); // 自执行点击事件
  3771. a.remove();
  3772. },
  3773. // 是否本月判断
  3774. istoMonth(){
  3775. let todate = new Date()
  3776. let tomonth = todate.getMonth() + 1
  3777. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3778. if(this.date == adate){
  3779. return []
  3780. }else{
  3781. let sedate = new Date(this.date)
  3782. let semonth = sedate.getMonth() + 1
  3783. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3784. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3785. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3786. return [sedates1, sedates2]
  3787. }
  3788. },
  3789. showMonthWorkTime() {
  3790. this.monthTotalPage = 0,
  3791. this.tbload = true
  3792. let parameter={
  3793. startDate: this.WorktimeDatepickValue[0],
  3794. endDate: this.WorktimeDatepickValue[1],
  3795. }
  3796. this.http.post(
  3797. "/report/getUserDailyWorkTime",
  3798. // "/report/getNoReportUserList",
  3799. parameter,
  3800. (res) => {
  3801. if (res.code == "ok") {
  3802. this.tbload = false;
  3803. this.pickDateArray = res.data.days;
  3804. // console.log('dataarray',res.data.days);
  3805. this.monthWorkData = res.data.list;
  3806. // this.monthWorkDataS = this.monthWorkData
  3807. // this.monthWorkDataS1 = res.data.list
  3808. this.monthTotal = res.data.list.length
  3809. if (this.monthWorkData.length > 50) {
  3810. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3811. }else{
  3812. this.monthWorkDataS = this.monthWorkData
  3813. }
  3814. this.searchScreen(0)
  3815. // this.monthWorkDataS = infoList
  3816. // 判断
  3817. // if (this.monthWorkDataS1.length > 0) {
  3818. // setTimeout(() => {
  3819. // this.tableListener()
  3820. // }, 1000);
  3821. // }
  3822. this.$nextTick(function(){
  3823. this.$refs.hasworkTbl.doLayout();
  3824. });
  3825. // this.$forceUpdate()
  3826. }
  3827. },
  3828. (error) => {
  3829. this.tbload = false
  3830. this.$message({
  3831. message: error,
  3832. type: "error",
  3833. });
  3834. }
  3835. );
  3836. },
  3837. showMonthWorkTimeReminder() {
  3838. this.monthTotalPage = 0,
  3839. this.tbload = true
  3840. let parameter={}
  3841. parameter={
  3842. startDate: this.WorktimeDatepickValue[0],
  3843. endDate: this.WorktimeDatepickValue[1],
  3844. }
  3845. this.http.post(
  3846. "/report/getUserDailyWorkTimeReminder",
  3847. parameter,
  3848. (res) => {
  3849. if (res.code == "ok") {
  3850. this.tbload = false;
  3851. this.monthWorkData = res.data.list;
  3852. this.monthTotal = res.data.list.length
  3853. if (this.monthWorkData.length > 50) {
  3854. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3855. }else{
  3856. this.monthWorkDataS = this.monthWorkData
  3857. }
  3858. this.searchScreen(0)
  3859. this.$nextTick(function(){
  3860. this.$refs.hasworkTbl.doLayout();
  3861. });
  3862. }
  3863. },
  3864. (error) => {
  3865. this.tbload = false
  3866. this.$message({
  3867. message: error,
  3868. type: "error",
  3869. });
  3870. }
  3871. );
  3872. },
  3873. // tableListener(){
  3874. // let that = this;
  3875. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3876. // // 添加scroll监听事件
  3877. // dom.addEventListener("scroll", function () {
  3878. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3879. // if (scrollDistance < 2) {
  3880. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3881. // that.monthTotalPage++; //当前页数自增
  3882. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3883. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3884. // var infoList = arrList.splice(
  3885. // that.monthTotalPage * that.monthTotalLages,
  3886. // that.monthTotalLages
  3887. // );
  3888. // // 数据添加
  3889. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3890. // }
  3891. // }
  3892. // })
  3893. // },
  3894. showMonthNotWorkTime() {
  3895. this.monthTotalPage = 0,
  3896. this.tbload = true,
  3897. this.http.post(
  3898. "/report/getNoReportUserList",
  3899. {
  3900. startDate: this.WorktimeDatepickValue[0],
  3901. endDate: this.WorktimeDatepickValue[1],
  3902. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3903. },
  3904. (res) => {
  3905. if (res.code == "ok") {
  3906. this.tbload = false
  3907. this.monthNotWorkDate = res.data;
  3908. // this.monthNotWorkDateS1 = res.data
  3909. this.monthnotTotal = res.data.length
  3910. // 2222111
  3911. if (this.monthNotWorkDate.length > 50) {
  3912. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3913. } else {
  3914. this.monthNotWorkDateS = this.monthNotWorkDate
  3915. }
  3916. this.searchScreen(1)
  3917. // 判断
  3918. // if (this.monthnotworkDateS1.length > 0) {
  3919. // setTimeout(() => {
  3920. // this.tableListenernot()
  3921. // }, 1000);
  3922. // }
  3923. this.$nextTick(function(){
  3924. this.$refs.hasworkTbl2.doLayout();
  3925. });
  3926. }
  3927. },
  3928. (error) => {
  3929. this.tbload = false
  3930. this.$message({
  3931. message: error,
  3932. type: "error",
  3933. });
  3934. }
  3935. );
  3936. },
  3937. // tableListenernot(){
  3938. // let that = this;
  3939. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3940. // dom.addEventListener("scroll", function () {
  3941. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3942. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3943. // if (scrollDistance2 < 2) {
  3944. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3945. // that.monthnotTotalPage++; //当前页数自增
  3946. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3947. // var infoList = arrList.splice(
  3948. // that.monthnotTotalPage * that.monthnotTotalLages,
  3949. // that.monthnotTotalLages
  3950. // );
  3951. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3952. // }
  3953. // }
  3954. // })
  3955. // },
  3956. listScroll(){
  3957. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3958. this.isMore = true
  3959. setTimeout(()=>{
  3960. this.isMore = false
  3961. },1000)
  3962. }else {
  3963. this.isFlag = true
  3964. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3965. this.monthWorkDataS = datalist
  3966. setTimeout(()=>{
  3967. this.isFlag = false
  3968. },300)
  3969. }
  3970. },
  3971. notListScroll(){
  3972. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3973. this.isMore = true
  3974. setTimeout(()=>{
  3975. this.isMore = false
  3976. },1000)
  3977. }else {
  3978. this.isFlag = true
  3979. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3980. this.monthNotWorkDateS = datalist
  3981. // console.log('length',this.monthNotWorkDateS.length)
  3982. setTimeout(()=>{
  3983. this.isFlag = false
  3984. },300)
  3985. }
  3986. },
  3987. getFirstAndLastDay() {
  3988. // 将选定的月份转换为Date对象
  3989. var monthDate = new Date();
  3990. var year = monthDate.getFullYear();
  3991. var month = monthDate.getMonth();
  3992. // 计算起始日和结束日
  3993. var startDay = new Date(year, month, 1);
  3994. var endDay = new Date(year, month + 1, 0);
  3995. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  3996. this.WorktimeDatepickValueForMonth=lastmd
  3997. },
  3998. formatDate(date) {
  3999. var year = date.getFullYear();
  4000. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4001. var day = ("0" + date.getDate()).slice(-2);
  4002. return year + "-" + month + "-" + day;
  4003. },
  4004. // 获取默认这zhou日期参数 222
  4005. getLastWeek(e){
  4006. let newdate = new Date()
  4007. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4008. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4009. if(e==1){
  4010. this.WorktimeDatepickValue = lastwd
  4011. this.showMonthWorkTime()
  4012. }else if(e==2){
  4013. this.WorktimeDatepickValue = lastwd
  4014. this.showMonthWorkTimeReminder()
  4015. }else{
  4016. this.WorktimeDatepickValue = lastwd
  4017. this.showMonthNotWorkTime()
  4018. }
  4019. },
  4020. getThisWeek(e){
  4021. let newdate = new Date();
  4022. let nowdate = newdate.toLocaleDateString();
  4023. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4024. if(e==1){
  4025. this.WorktimeDatepickValue = nowwd
  4026. this.showMonthWorkTime()
  4027. }else if(e==2){
  4028. this.WorktimeDatepickValue = nowwd
  4029. this.showMonthWorkTimeReminder()
  4030. }else{
  4031. this.WorktimeDatepickValue = nowwd
  4032. this.showMonthNotWorkTime()
  4033. }
  4034. },
  4035. getDoubleLastWeek(e){
  4036. let newdate = new Date()
  4037. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4038. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4039. if(e==1){
  4040. this.WorktimeDatepickValue = nextwd
  4041. this.showMonthWorkTime()
  4042. }else if(e==2){
  4043. this.WorktimeDatepickValue = nextwd
  4044. this.showMonthWorkTimeReminder()
  4045. }else{
  4046. this.WorktimeDatepickValue = nextwd
  4047. this.showMonthNotWorkTime()
  4048. }
  4049. },
  4050. alreadyAllDate(stime,etime){
  4051. let diffdate = new Array();
  4052. let i=0;
  4053. while(stime<=etime){
  4054. let dateArray = stime.split("-");
  4055. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4056. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4057. let stimewk = this.weekDay[date.getDay()]
  4058. 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')
  4059. 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])
  4060. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4061. let stime_ts = new Date(stime).getTime();
  4062. let next_date = stime_ts + (24*60*60*1000);
  4063. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4064. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4065. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4066. stime = next_dates_y+next_dates_m+next_dates_d;
  4067. i++;
  4068. }
  4069. return diffdate
  4070. },
  4071. getAutoWeekDate(e) {
  4072. let dateString = e;
  4073. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4074. if (dateString.match(dateStringReg)) {
  4075. let presentDate = new Date(dateString),
  4076. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4077. return Array.from(new Array(7), function (val, index) {
  4078. let formatDate = new Date(
  4079. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4080. );
  4081. return (
  4082. formatDate.getFullYear() +
  4083. "-" +
  4084. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4085. "-" +
  4086. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4087. );
  4088. });
  4089. } else {
  4090. throw new Error(
  4091. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4092. );
  4093. }
  4094. },
  4095. onProgressChange() {
  4096. this.$forceUpdate();
  4097. },
  4098. showChooseMembTree() {
  4099. this.chosenMembCount = this.participator.length;
  4100. this.chooseParticipVisible = true;
  4101. },
  4102. onTreeItemChange() {
  4103. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4104. var list = chosenList.filter(item=>item.isUser == 1);
  4105. this.chosenMembCount = list.length;
  4106. },
  4107. findUserInTree() {
  4108. if (this.filterName == '') {
  4109. this.deptMembData = this.allMembData;
  4110. } else {
  4111. var list = this.findRecursively(this.filterName, this.allMembData);
  4112. this.deptMembData = list;
  4113. }
  4114. },
  4115. findRecursively(username, list) {
  4116. var filterList = [];
  4117. for (var i=0;i<list.length; i++) {
  4118. if (list[i].isUser == 1) {
  4119. if (list[i].label.indexOf(username) >= 0) {
  4120. //匹配上了
  4121. filterList.push(list[i]);
  4122. }
  4123. } else if (list[i].children != null && list[i].children.length > 0) {
  4124. var subList = this.findRecursively(username, list[i].children);
  4125. if (subList.length > 0) {
  4126. subList.forEach(s=>filterList.push(s));
  4127. }
  4128. }
  4129. }
  4130. return filterList;
  4131. },
  4132. //确定选择参与人
  4133. chooseParticip() {
  4134. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4135. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4136. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4137. if (this.user.company.packageProject == 1) {
  4138. if (this.chosenMembList.length > 1) {
  4139. this.$message({
  4140. message: '每次仅支持代填一个人',
  4141. type: "error",
  4142. });
  4143. return;
  4144. }
  4145. }
  4146. this.chooseParticipVisible = false;
  4147. this.workForm.userNames = '';
  4148. this.workForm.userId = [];
  4149. this.participator = [];
  4150. for (var i=0;i<this.chosenMembList.length; i++) {
  4151. this.workForm.userId.push(this.chosenMembList[i].id);
  4152. this.workForm.userNames += this.chosenMembList[i].label+',';
  4153. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4154. this.participator.push(item);
  4155. }
  4156. if (this.workForm.userNames.length > 0) {
  4157. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4158. }
  4159. if(this.user.userNameNeedTranslate == 1) {
  4160. if(this.workForm.userNames) {
  4161. this.workForm.userNames = this.workForm.userNames.split(',')
  4162. }
  4163. }
  4164. },
  4165. notifySel(sel){
  4166. // console.log(sel);
  4167. this.notifySelList = sel
  4168. },
  4169. //微信通知人员填写
  4170. Notify(code) {
  4171. if (this.notifySelList.length == 0) return;
  4172. var ids = '';
  4173. this.notifySelList.forEach(f=>{
  4174. ids += f.id+',';
  4175. })
  4176. this.http.post('/user/pushFillReport',{
  4177. ids: ids, date: this.curDate,
  4178. code: code
  4179. },
  4180. res => {
  4181. if (res.code == "ok") {
  4182. this.$message({
  4183. message: this.$t('message.sentSuccessfully'),
  4184. type: "success"
  4185. });
  4186. }
  4187. },
  4188. error => {
  4189. this.$message({
  4190. message: error,
  4191. type: "error"
  4192. });
  4193. }
  4194. );
  4195. },
  4196. //导出人员列表
  4197. exportMemb() {
  4198. if (this.fillMembList.length == 0) return;
  4199. var ids = '';
  4200. this.fillMembList.forEach(f=>{
  4201. ids += f.id+',';
  4202. })
  4203. this.http.post('/user/exportMembList',{
  4204. ids: ids,isFill: this.isFill, date: this.curDate
  4205. },
  4206. res => {
  4207. if (res.code == "ok") {
  4208. var aTag = document.createElement('a');
  4209. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4210. aTag.href = res.data;
  4211. aTag.click();
  4212. }
  4213. },
  4214. error => {
  4215. this.$message({
  4216. message: error,
  4217. type: "error"
  4218. });
  4219. }
  4220. );
  4221. },
  4222. showMembList(fill) {
  4223. this.membListVisible = true;
  4224. if (fill == 0) {
  4225. this.fillMembList = this.unFillList;
  4226. this.isFill = false;
  4227. let leaveList = []
  4228. let unleaveList = []
  4229. for(let i in this.fillMembList){
  4230. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4231. leaveList.push(this.fillMembList[i])
  4232. }else{
  4233. unleaveList.push(this.fillMembList[i])
  4234. }
  4235. }
  4236. this.fillMembList = unleaveList
  4237. this.fillMembList_leave = leaveList
  4238. } else if(fill == 1){
  4239. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4240. this.isFill = true;
  4241. }else{
  4242. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4243. this.isFill = true;
  4244. }
  4245. },
  4246. //获取自己填写的日报状态
  4247. getReportFillStatus() {
  4248. this.http.post('/report/getReportFillStatus',{
  4249. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4250. },
  4251. res => {
  4252. if (res.code == "ok") {
  4253. this.fillStatusList = res.data;
  4254. this.allDate.forEach(d=>{
  4255. var fillInfo = null;
  4256. d.state = null;
  4257. this.fillStatusList.forEach(s=>{
  4258. var d1 = s.createDate.split('-')[2];
  4259. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4260. if (d1.indexOf('0') == 0) {
  4261. d1 = d1.substring(1,d1.length);
  4262. }
  4263. if (d1 == d2) {
  4264. d.state = s.state;
  4265. d.exceedCardTime = s.exceedCardTime
  4266. }
  4267. })
  4268. })
  4269. this.$forceUpdate();
  4270. }
  4271. },
  4272. error => {
  4273. this.$message({
  4274. message: error,
  4275. type: "error"
  4276. });
  4277. }
  4278. );
  4279. },
  4280. scrollFunction () {
  4281. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4282. if (this.domObj.attachEvent) { // IE
  4283. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4284. } else if (this.domObj.addEventListener) {
  4285. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4286. }
  4287. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4288. },
  4289. mouseScroll(event) { // google 浏览器下
  4290. let detail = event.wheelDelta || event.detail
  4291. let moveForwardStep = -1
  4292. let moveBackStep = 1
  4293. let step = 0
  4294. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4295. event.preventDefault() // 阻止浏览器默认事件
  4296. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4297. },
  4298. // //左右滚动
  4299. // wheel(e){
  4300. // var a = document.getElementById("dateScroll");
  4301. // var scroll_width = 80; //滚动一下的距离
  4302. // var e = e || window.event, v;
  4303. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4304. // if(v>3||-v>3) v=-v;
  4305. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4306. // e.preventDefault(); //阻止浏览器的默认滚动
  4307. // },
  4308. showExportDialog() {
  4309. this.exportType = 0
  4310. this.exportDialog = true;
  4311. },
  4312. showExportTimeDialog() {
  4313. this.exportTimeDialog = true;
  4314. },
  4315. changeAllTime() {
  4316. //总时长发生改变,自动按比例计算
  4317. this.workForm.domains.forEach(d=>{
  4318. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4319. });
  4320. //计算jsTime
  4321. if (this.workForm.createDate) {
  4322. let sdate = new Date(this.workForm.createDate[0]);
  4323. let edate = new Date(this.workForm.createDate[1]);
  4324. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4325. console.log('days===', days)
  4326. if (days < 0) {
  4327. days = 0;
  4328. }
  4329. this.jsTime = this.reportTimeType.allday * days;
  4330. }
  4331. },
  4332. // 是否加班的单机事件
  4333. check() {
  4334. this.selected = !this.selected
  4335. this.isNew = this.selected
  4336. },
  4337. updateSubProject() {
  4338. this.$forceUpdate();
  4339. },
  4340. selectDegreeId(domain, index) {
  4341. this.http.post('/report/defaultDegree',{
  4342. projectId: domain.projectId
  4343. },
  4344. res => {
  4345. if (res.code == "ok") {
  4346. if(res.data) {
  4347. this.workForm.domains[index].degreeId = res.data.id + ''
  4348. this.$forceUpdate();
  4349. }
  4350. }
  4351. },
  4352. error => {
  4353. this.$message({
  4354. message: error,
  4355. type: "error"
  4356. });
  4357. }
  4358. );
  4359. },
  4360. //项目选中了, 加载子项目
  4361. selectProject(domain, index) {
  4362. if(!domain.projectId){
  4363. return;
  4364. }
  4365. // 默认选中上次填写的自定义维度
  4366. if(this.yonghuUser.customDegreeActive == 1) {
  4367. this.selectDegreeId(domain, index)
  4368. }
  4369. // console.log('projectId===',domain.projectId);
  4370. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4371. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4372. this.http.post('/sub-project/list',{
  4373. projectId: domain.projectId,
  4374. isReport: true
  4375. },
  4376. res => {
  4377. //清空之前选中的子项目
  4378. // this.workForm.domains[index].subProjectId = 0;
  4379. if (res.code == "ok") {
  4380. this.workForm.domains[index].subProjectList = res.data;
  4381. this.workForm.domains[index].subProjectId = null;
  4382. this.$forceUpdate();
  4383. }
  4384. },
  4385. error => {
  4386. this.$message({
  4387. message: error,
  4388. type: "error"
  4389. });
  4390. }
  4391. );
  4392. //项目相关的近期任务
  4393. if (this.user.company.packageProject == 1) {
  4394. this.getRecentTaskList(domain, index);
  4395. //获取项目相关专业
  4396. if (this.user.company.packageEngineering == 1) {
  4397. this.getProjectProfessions(domain, index);
  4398. }
  4399. //获取项目下的任务分组
  4400. this.getTaskGroups(domain, index);
  4401. }
  4402. // 获取项目相关的维度
  4403. // domain.degreeId = null
  4404. this.$set(domain,'degreeId',null)
  4405. this.$set(domain,'multiDegrIdArray',null)
  4406. this.dimension(domain, index);
  4407. //获取项目审核人
  4408. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4409. this.getProjectAuditorList(domain, index);
  4410. } else {
  4411. //按分组的负责人来审核
  4412. domain.projectAuditorId = null;
  4413. domain.projectAuditorName = null;
  4414. domain.auditUserList = null;
  4415. }
  4416. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4417. if (this.reportTimeType.type == 3) {
  4418. //新增项目时,自动计算
  4419. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4420. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4421. }
  4422. //加载昱众的工作职责
  4423. if (this.user.companyId == this.yuzhongCompId) {
  4424. this.updateResponse(domain);
  4425. }
  4426. },
  4427. getRecentTaskList(domain, index) {
  4428. //刷新任务时,清空服务
  4429. this.$set(domain, 'sapServiceId', null);
  4430. this.$set(domain, 'taskId', null);
  4431. var param = {
  4432. projectId: domain.projectId,
  4433. isSubstitude:this.isSubstitude?1:0,
  4434. };
  4435. if (domain.groupId) {
  4436. param.groupId = domain.groupId;
  4437. }
  4438. if (domain.stage) {
  4439. param.stage = domain.stage;
  4440. }
  4441. //专业版代填,获取代填员工的任务
  4442. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4443. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4444. this.$message({
  4445. message: '请选择代填的员工',
  4446. type: "error"
  4447. });
  4448. return;
  4449. } else {
  4450. param.userId = this.workForm.userId[0];
  4451. }
  4452. }
  4453. this.http.post('/task/getRecentTask',param,
  4454. res => {
  4455. if (res.code == "ok") {
  4456. this.workForm.domains[index].allTaskList = res.data;
  4457. this.workForm.domains[index].taskList = res.data;
  4458. this.$forceUpdate();
  4459. }
  4460. },
  4461. error => {
  4462. this.$message({
  4463. message: error,
  4464. type: "error"
  4465. });
  4466. }
  4467. );
  4468. },
  4469. //获取项目审核人
  4470. getProjectAuditorList(domainItem, index) {
  4471. if(domainItem.projectId == '') {
  4472. return
  4473. }
  4474. domainItem.projectAuditorId = null;
  4475. domainItem.projectAuditorName = null;
  4476. this.http.post('/project-auditor/getList',{
  4477. projectId: domainItem.projectId,
  4478. },
  4479. res => {
  4480. if (res.code == "ok") {
  4481. domainItem.auditUserList = res.data;
  4482. if (res.data.length==0) {
  4483. this.$message({
  4484. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4485. type: "error"
  4486. });
  4487. } else if (res.data.length==1) {
  4488. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4489. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4490. }
  4491. this.$forceUpdate();
  4492. }
  4493. },
  4494. error => {
  4495. this.$message({
  4496. message: error,
  4497. type: "error"
  4498. });
  4499. }
  4500. );
  4501. },
  4502. // 获取维度数据
  4503. dimension(domain, index) {
  4504. if(domain.projectId == '') {
  4505. return
  4506. }
  4507. this.http.post('/project/getDegreeList',{
  4508. projectId: domain.projectId,
  4509. },
  4510. res => {
  4511. if (res.code == "ok") {
  4512. // console.log("维度数据",res.data);
  4513. this.workForm.domains[index].wuduList = res.data
  4514. // this.workForm = this.workForm
  4515. this.$forceUpdate()
  4516. }
  4517. },
  4518. error => {
  4519. this.$message({
  4520. message: error,
  4521. type: "error"
  4522. });
  4523. }
  4524. );
  4525. },
  4526. //切换任务阶段
  4527. changeStages(domain, index) {
  4528. if (domain.stage == null || domain.stage == '') {
  4529. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4530. } else {
  4531. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4532. }
  4533. this.getRecentTaskList(domain, index);
  4534. this.$forceUpdate();
  4535. },
  4536. getGroupStages(domain, index, keepStage) {
  4537. // console.log(domain);
  4538. if(!domain.groupId){
  4539. domain.projectAuditorId = ''
  4540. domain.stages = []
  4541. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4542. domain.taskId = ''
  4543. domain.sapServiceId = ''
  4544. }
  4545. if(this.user.timeType.reportAuditType >= 1){
  4546. domain.auditUserList = []
  4547. }
  4548. this.$forceUpdate();
  4549. return
  4550. }
  4551. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4552. res => {
  4553. if (res.code == "ok") {
  4554. if (!keepStage) {
  4555. domain.stage = '';
  4556. }
  4557. domain.stages = res.data;
  4558. this.getRecentTaskList(domain, index);
  4559. this.$forceUpdate();
  4560. }
  4561. },
  4562. error => {
  4563. this.$message({
  4564. message: error,
  4565. type: "error"
  4566. });
  4567. });
  4568. //检查当前的项目是否需要获取分组的负责人
  4569. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4570. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4571. res => {
  4572. if (res.code == "ok") {
  4573. domain.getProjectAuditorList = res.data;
  4574. domain.auditUserList = res.data;
  4575. if (res.data.length==1) {
  4576. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4577. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4578. } else if (res.data.length==0) {
  4579. domain.projectAuditorId = null;
  4580. domain.projectAuditorName = null;
  4581. }
  4582. this.$forceUpdate();
  4583. }
  4584. },
  4585. error => {
  4586. this.$message({
  4587. message: error,
  4588. type: "error"
  4589. });
  4590. });
  4591. }
  4592. },
  4593. getProjectProfessions(domain, index) {
  4594. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4595. res => {
  4596. if (res.code == "ok") {
  4597. this.workForm.domains[index].professionProgress = res.data;
  4598. this.$forceUpdate();
  4599. }
  4600. },
  4601. error => {
  4602. this.$message({
  4603. message: error,
  4604. type: "error"
  4605. });
  4606. });
  4607. },
  4608. //删除自己的日报
  4609. deleteReport() {
  4610. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4611. confirmButtonText: this.$t('btn.determine'),
  4612. cancelButtonText: this.$t('btn.cancel'),
  4613. type: "warning"
  4614. })
  4615. .then(() => {
  4616. this.listLoading = true;
  4617. this.http.post('/report/delete',{
  4618. userId: this.user.id,
  4619. date: this.workForm.createDate
  4620. },
  4621. res => {
  4622. this.listLoading = false;
  4623. if (res.code == "ok") {
  4624. this.$message({
  4625. message: this.$t('message.successfullyDeleted'),
  4626. type: "success"
  4627. });
  4628. this.getReportList();
  4629. this.getDepartment();
  4630. this.dialogVisible = false;
  4631. } else {
  4632. this.$message({
  4633. message: res.msg,
  4634. type: "error"
  4635. });
  4636. }
  4637. },
  4638. error => {
  4639. this.listLoading = false;
  4640. this.$message({
  4641. message: error,
  4642. type: "error"
  4643. });
  4644. }
  4645. );
  4646. })
  4647. .catch(() => {});
  4648. },
  4649. // 管理员删除日报
  4650. guanli(item) {
  4651. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4652. let param = {date: this.date + day, userId: item.id};
  4653. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4654. confirmButtonText: this.$t('btn.determine'),
  4655. cancelButtonText: this.$t('btn.cancel'),
  4656. type: "warning"
  4657. })
  4658. .then(() => {
  4659. this.listLoading = true;
  4660. this.http.post('/report/delete',param,
  4661. res => {
  4662. this.listLoading = false;
  4663. if (res.code == "ok") {
  4664. this.$message({
  4665. message: this.$t('message.successfullyDeleted'),
  4666. type: "success"
  4667. });
  4668. this.getReportList();
  4669. this.getDepartment();
  4670. this.dialogVisible = false;
  4671. } else {
  4672. this.$message({
  4673. message: res.msg,
  4674. type: "error"
  4675. });
  4676. }
  4677. },
  4678. error => {
  4679. this.listLoading = false;
  4680. this.$message({
  4681. message: error,
  4682. type: "error"
  4683. });
  4684. }
  4685. );
  4686. })
  4687. .catch(() => {});
  4688. },
  4689. selectAll() {
  4690. if (this.isAllSelect) {
  4691. var keys = [];
  4692. this.reportNames.forEach(b=>{
  4693. keys.push(b.id);
  4694. })
  4695. this.$refs.approveTree.setCheckedKeys(keys);
  4696. } else {
  4697. this.$refs.approveTree.setCheckedKeys([]);
  4698. }
  4699. },
  4700. removeEmptyNode(list) {
  4701. for (var i=0;i<list.length;i++) {
  4702. var cnt = 0;
  4703. if (list[i].membCount == 0) {
  4704. list.splice(i, 1);
  4705. i--;
  4706. } else if (list[i].children != null) {
  4707. this.removeEmptyNode(list[i].children);
  4708. }
  4709. }
  4710. },
  4711. calculateMembCount(list) {
  4712. for (var i in list) {
  4713. var cnt = 0;
  4714. if (list[i].children != null) {
  4715. this.calculateMembCount(list[i].children);
  4716. for (var m in list[i].children) {
  4717. cnt += list[i].children[m].membCount;
  4718. }
  4719. }
  4720. if (list[i].isUser == 1) {
  4721. cnt++;
  4722. this.membCount++;
  4723. }
  4724. list[i].membCount = cnt;
  4725. }
  4726. },
  4727. stateChange() {
  4728. // console.log(this.allData,'alldate');
  4729. this.membCount = 0;
  4730. if (this.selectState == -1) {
  4731. //全部状态
  4732. this.data = this.allData;
  4733. } else {
  4734. //未填报
  4735. this.seluserText = ''
  4736. var newData = JSON.parse(JSON.stringify(this.allData));
  4737. this.filterState(this.selectState, newData);
  4738. this.data = newData;
  4739. }
  4740. this.calculateMembCount(this.data);
  4741. this.data[0].membCount = this.membCount;//总人数
  4742. },
  4743. //按状态过滤部门人员
  4744. filterState(state, list) {
  4745. for (var i =0;i<list.length; i++) {
  4746. var obj = list[i];
  4747. if (obj.isUser == 1) {
  4748. var match = false;
  4749. if (state == -2) {
  4750. if (obj.state == null) {
  4751. match = true;
  4752. }
  4753. } else {
  4754. if (obj.state == state) {
  4755. match = true;
  4756. }
  4757. }
  4758. if (!match) {
  4759. list.splice(i, 1);
  4760. i--;
  4761. } else {
  4762. }
  4763. } else {
  4764. if (obj.children != null) {
  4765. this.filterState(state, obj.children);
  4766. }
  4767. }
  4768. }
  4769. },
  4770. //a按名称过滤部门人员
  4771. async seluserforText(){
  4772. const { userNameNeedTranslate } = this.user
  4773. this.membCount = 0;
  4774. var newData = JSON.parse(JSON.stringify(this.allData));
  4775. let textList = [this.seluserText]
  4776. if(userNameNeedTranslate == 1) {
  4777. this.dataLoading = true
  4778. let res = await this.postData('/user/getEmployeeList', {
  4779. keyword: this.seluserText,
  4780. cursor: '',
  4781. departmentId: -1,
  4782. pageIndex: 1,
  4783. pageSize: 1000
  4784. })
  4785. textList = res.data.records.map(item => item.name)
  4786. this.dataLoading = false
  4787. }
  4788. // return
  4789. console.log(textList, '<=== textList')
  4790. this.seluserforTextin(this.seluserText, newData, textList)
  4791. console.log(newData, 'Data')
  4792. this.data = newData;
  4793. this.calculateMembCount(this.data);
  4794. this.data[0].membCount = this.membCount;//总人数
  4795. },
  4796. seluserforTextin(text, list, textList = []){
  4797. for (var i =0;i<list.length; i++) {
  4798. var obj = list[i];
  4799. if (obj.isUser == 1) {
  4800. var match = false;
  4801. // if (obj.label.indexOf(text) != -1) {
  4802. // match = true
  4803. // }
  4804. if(textList.some(item => item.includes(obj.label))) {
  4805. match = true
  4806. }
  4807. if (!match) {
  4808. list.splice(i, 1);
  4809. i--;
  4810. } else {
  4811. }
  4812. } else {
  4813. if (obj.children != null) {
  4814. this.seluserforTextin(text, obj.children, textList);
  4815. }
  4816. }
  4817. }
  4818. },
  4819. // 当节点发生变化时
  4820. nodeChangeExpand(data) {
  4821. // 保存当前展开的节点
  4822. let flag = false
  4823. this.nodeModelData.some(item => {
  4824. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4825. flag = true
  4826. return true
  4827. }
  4828. })
  4829. if (!flag) { // 不存在则存到数组里
  4830. this.nodeModelData.push(data.id)
  4831. }
  4832. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4833. },
  4834. nodeChangeCollapse(data) {
  4835. console.log(this.nodeModelData)
  4836. this.nodeModelData.some((item, i) => {
  4837. if (item === data.id) {
  4838. this.nodeModelData.length = i
  4839. }
  4840. })
  4841. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4842. },
  4843. // 部门列表点击
  4844. handleNodeClick(data) {
  4845. // this.dealList = data
  4846. this.theValues(data.id, this.allData)
  4847. // this.depData = data;
  4848. var list = [];
  4849. if (data.id == -1) {
  4850. this.deptId = null;
  4851. this.targetUid = null;
  4852. list = this.data;
  4853. } else if (data.isUser == 1) {
  4854. this.deptId = null;
  4855. this.targetUid = data.id;
  4856. } else {
  4857. this.deptId = data.id;
  4858. this.targetUid = null;
  4859. list.push(data);
  4860. }
  4861. this.getReportList();
  4862. if (list.length > 0) {
  4863. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4864. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4865. }
  4866. },
  4867. exportPushLog(){
  4868. this.http.post('/sap-sync-log/export',{},
  4869. res => {
  4870. if (res.code == "ok") {
  4871. var filePath = res.data;
  4872. var fName = '推送日志.xlsx'
  4873. const a = document.createElement('a'); // 创建a标签
  4874. a.setAttribute('download', fName);// download属性
  4875. a.setAttribute('href', filePath);// href链接
  4876. a.click(); //自执行点击事件
  4877. a.remove();
  4878. } else {
  4879. this.$message({
  4880. message: res.msg,
  4881. type: "error"
  4882. });
  4883. }
  4884. },
  4885. error => {
  4886. this.$message({
  4887. message: error,
  4888. type: "error"
  4889. });
  4890. });
  4891. },
  4892. theValues(id, item) {
  4893. for(var i in item) {
  4894. if(item[i].id == id) {
  4895. this.depData = item[i]
  4896. if(id == '-1') {
  4897. this.translation = '1'
  4898. } else {
  4899. if(item[i].children) {
  4900. this.translation = '2'
  4901. } else {
  4902. this.translation = '3'
  4903. }
  4904. }
  4905. return
  4906. } else {
  4907. if(item[i].children) {
  4908. this.theValues(id, item[i].children)
  4909. }
  4910. }
  4911. }
  4912. },
  4913. //获取可以选择的代填的人员列表
  4914. getSubstitudeUserDeptList() {
  4915. if (this.deptMembData.length == 0) {
  4916. this.http.post("/department/listMyMembs", {},
  4917. res => {
  4918. if (res.code == "ok") {
  4919. let noAllData = JSON.parse(JSON.stringify(res.data));
  4920. if (noAllData.length > 0) {
  4921. // if (noAllData[0].label == '全部人员') {
  4922. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4923. noAllData.splice(0,1);
  4924. }
  4925. }
  4926. this.setUserToDept(noAllData);
  4927. this.deptMembData = noAllData;
  4928. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4929. console.log(this.deptMembData, '代填人员数据')
  4930. } else {
  4931. this.$message({
  4932. message: res.msg,
  4933. type: "error"
  4934. });
  4935. }
  4936. },
  4937. error => {
  4938. this.$message({
  4939. message: error,
  4940. type: "error"
  4941. });
  4942. });
  4943. }
  4944. },
  4945. // 获取部门列表
  4946. getDepartmentForApprove() {
  4947. this.http.post( this.port.manage.depList, {},
  4948. res => {
  4949. if (res.code == "ok") {
  4950. var list1 = JSON.parse(JSON.stringify(res.data));
  4951. this.deptOptionList = this.changeArr(list1);
  4952. console.log(this.deptOptionList, '部门')
  4953. } else {
  4954. this.$message({
  4955. message: res.msg,
  4956. type: "error"
  4957. });
  4958. }
  4959. },
  4960. error => {
  4961. this.$message({
  4962. message: error,
  4963. type: "error"
  4964. });
  4965. });
  4966. },
  4967. // 获取部门列表
  4968. getDepartment() {
  4969. //如果没有权限,就不需要获取
  4970. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4971. return;
  4972. }
  4973. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4974. var param = {date:this.date + day};
  4975. this.http.post("/report/getMembList", param,
  4976. res => {
  4977. if (res.code == "ok") {
  4978. if(res.data.length == 0){
  4979. return
  4980. }
  4981. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4982. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4983. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4984. // if (this.user.role > 0) {
  4985. // }
  4986. list.splice(0,0,{
  4987. id: -1,
  4988. label: this.$t('lable.allStaff'),
  4989. })
  4990. this.membCount = 0;
  4991. //设置员工到部门下面
  4992. this.setUserToDept(list);
  4993. this.data = list;
  4994. // console.log('data',this.data);
  4995. this.expandDate = [this.data[1].id]
  4996. this.allData = list;
  4997. // if (noAllData.length > 0) {
  4998. // if (noAllData[0].label == '全部人员') {
  4999. // noAllData.splice(0,1);
  5000. // }
  5001. // }
  5002. // this.setUserToDept(noAllData);
  5003. // this.deptMembData = noAllData;
  5004. this.option = this.changeArr(list1);
  5005. list[0].membCount = this.membCount;
  5006. if (this.depData.id == -1) {
  5007. this.depData.membCount = this.membCount;
  5008. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5009. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5010. } else {
  5011. if (this.depData.isUser == null) {
  5012. var dep = this.findTargetDept(this.data, this.depData.id);
  5013. var membDeptList = [];
  5014. membDeptList.push(dep);
  5015. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5016. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5017. }
  5018. }
  5019. if (this.depData.isUser == null) {
  5020. if (this.isFill) {
  5021. this.fillMembList = this.fillList;
  5022. } else {
  5023. this.fillMembList = this.unFillList;
  5024. }
  5025. }
  5026. this.leaveAllNum = 0
  5027. for(let i in this.unFillList){
  5028. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5029. this.leaveAllNum += 1
  5030. }
  5031. }
  5032. this.stateChange()
  5033. } else {
  5034. this.$message({
  5035. message: res.msg,
  5036. type: "error"
  5037. });
  5038. }
  5039. },
  5040. error => {
  5041. this.$message({
  5042. message: error,
  5043. type: "error"
  5044. });
  5045. });
  5046. this.getReportFillStatus();
  5047. },
  5048. findTargetDept(list, deptId) {
  5049. var t = null;
  5050. for (var i=0;i<list.length; i++) {
  5051. if (list[i].isUser == null && list[i].id == deptId) {
  5052. t = list[i];
  5053. break;
  5054. }
  5055. }
  5056. if (t == null) {
  5057. for (var i=0;i<list.length; i++) {
  5058. if (list[i].children != null && list[i].children.length > 0) {
  5059. t = this.findTargetDept(list[i].children, deptId);
  5060. if (t != null) {
  5061. break;
  5062. }
  5063. }
  5064. }
  5065. }
  5066. return t;
  5067. },
  5068. getUserMembListFromDeptList(list, isFill) {
  5069. var membList = [];
  5070. for (var i in list) {
  5071. var deptName = list[i].label;
  5072. if (list[i].userList != null) {
  5073. list[i].userList.forEach(element => {
  5074. if (isFill == 0) {
  5075. //获取未填的
  5076. if (element.state == null) {
  5077. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5078. membList.push(obj);
  5079. }
  5080. } else {
  5081. if (element.state != null) {
  5082. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5083. membList.push(obj);
  5084. }
  5085. }
  5086. });
  5087. }
  5088. if (list[i].children != null) {
  5089. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5090. }
  5091. }
  5092. return membList;
  5093. },
  5094. setUserToDept(list) {
  5095. for (var i in list) {
  5096. var cnt = 0;
  5097. if (list[i].children != null) {
  5098. this.setUserToDept(list[i].children);
  5099. for (var m in list[i].children) {
  5100. cnt += list[i].children[m].membCount;
  5101. }
  5102. }
  5103. if (list[i].userList != null) {
  5104. if (list[i].children == null) {
  5105. list[i].children = [];
  5106. }
  5107. list[i].userList.forEach(element => {
  5108. var obj = {
  5109. id: element.id,
  5110. label:element.name,
  5111. state:element.state,
  5112. parentId:element.departmentId,
  5113. isUser:1,
  5114. workingTime: element.workingTime,
  5115. leaveDays: element.leaveDays,
  5116. leaveTimes: element.leaveTimes
  5117. };
  5118. list[i].children.push(obj);
  5119. this.membCount++;
  5120. cnt++;
  5121. });
  5122. }
  5123. list[i].membCount = cnt;
  5124. }
  5125. },
  5126. // 修改数组
  5127. changeArr(arr) {
  5128. for (var i = 0; i < arr.length; i++) {
  5129. if(arr[i].id != -1 && arr[i].id != 0) {
  5130. if (arr[i].children != null && arr[i].children.length>0) {
  5131. arr[i].children = this.changeArr(arr[i].children);
  5132. }
  5133. arr[i].id && (arr[i].value = arr[i].id);
  5134. delete arr[i].id;
  5135. }
  5136. }
  5137. for(var i in arr) {
  5138. if(arr[i].id == -1 || arr[i].id == 0) {
  5139. arr.splice(i,1)
  5140. }
  5141. }
  5142. return arr;
  5143. },
  5144. //时间段范围设置改动,监听
  5145. onTimeTypeChange(timeType) {
  5146. this.seleChn(1)
  5147. this.showAddMore = true;
  5148. for(var i in this.workForm.domains) {
  5149. if (this.workForm.domains[i].timeType == 0) {
  5150. this.showAddMore = false;
  5151. break;
  5152. }
  5153. }
  5154. if (this.showAddMore) {
  5155. //检测数量
  5156. if (this.workForm.domains.length == 2) {
  5157. this.showAddMore = false;
  5158. } else {
  5159. this.showAddMore = true;
  5160. }
  5161. }
  5162. },
  5163. getTimeType() {
  5164. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5165. res => {
  5166. if (res.code == "ok") {
  5167. var t = res.data;
  5168. this.reportTimeType = t;
  5169. if (this.reportTimeType.type > 0) {
  5170. this.showAddMore = true;
  5171. }
  5172. //转化时间格式
  5173. if (t.allday != null) {
  5174. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5175. }
  5176. if (t.am != null) {
  5177. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5178. }
  5179. if (t.pm != null) {
  5180. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5181. }
  5182. let arr = []
  5183. for(var i in res.data.excludeTimeList) {
  5184. let obj = {
  5185. s: res.data.excludeTimeList[i].startTime,
  5186. e: res.data.excludeTimeList[i].endTime,
  5187. }
  5188. arr.push(obj)
  5189. }
  5190. this.vacationTime = arr
  5191. } else {
  5192. this.$message({
  5193. message: res.msg,
  5194. type: "error"
  5195. });
  5196. }
  5197. },
  5198. error => {
  5199. this.listLoading = false;
  5200. this.$message({
  5201. message: error,
  5202. type: "error"
  5203. });
  5204. });
  5205. },
  5206. // 改变月份 -------
  5207. changeMonthOut() {
  5208. this.getAllDate();
  5209. this.getReportList();
  5210. this.getDepartment();
  5211. },
  5212. // 选择日期
  5213. choseDate(i, item) {
  5214. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5215. return
  5216. }
  5217. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5218. this.choseDay = i;
  5219. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5220. sessionStorage.msg = this.date + day,
  5221. this.getReportList();
  5222. this.getDepartment();
  5223. this.curDate = item.date;
  5224. },
  5225. canClick(i, item){
  5226. let nowDate = new Date()
  5227. let nowDateYear = nowDate.getFullYear()
  5228. let itemYear = parseInt(this.date.split('-')[0])
  5229. let nowDateMonth = nowDate.getMonth() + 1
  5230. let itemMonth = parseInt(this.date.split('-')[1])
  5231. let nowDateDay = nowDate.getDate()
  5232. let itemDay = parseInt(item.showDate.split('.')[1])
  5233. if(nowDateYear < itemYear){
  5234. return false
  5235. }else if(nowDateYear == itemYear){
  5236. if(nowDateMonth < itemMonth){
  5237. return false
  5238. }else if(nowDateMonth == itemMonth){
  5239. if(nowDateDay < itemDay){
  5240. return false
  5241. }
  5242. }
  5243. }
  5244. },
  5245. // 获取日期列表
  5246. getAllDate(e) {
  5247. var dayArry = [];
  5248. var day = this.getCountDays();
  5249. let curMonthDay = null;
  5250. for (var k = 1; k <= day; k++) {
  5251. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5252. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5253. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5254. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5255. if(sessionStorage.msg) {
  5256. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5257. this.choseDay = k - 1;
  5258. curMonthDay = str;
  5259. }
  5260. } else {
  5261. if (new Date().getDate() == k) {
  5262. this.choseDay = k - 1;
  5263. }
  5264. }
  5265. } else {
  5266. this.choseDay = 0;
  5267. }
  5268. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5269. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5270. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5271. }
  5272. this.allDate = dayArry;
  5273. //不能超过最大日期
  5274. if (this.choseDay > day-1) {
  5275. this.choseDay = day-1;
  5276. }
  5277. if(sessionStorage.from != 1){
  5278. let nowmonth = new Date().getMonth() + 1
  5279. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5280. let nowdate = new Date().getDate()
  5281. if(nowd == this.date){
  5282. if(e && sessionStorage.msg){
  5283. }else{
  5284. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5285. }
  5286. let nowday = new Date(sessionStorage.msg).getDate()
  5287. this.choseDay = nowday - 1
  5288. let monthdate = new Date(sessionStorage.msg)
  5289. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5290. }else{
  5291. if(e && sessionStorage.msg){
  5292. }else{
  5293. sessionStorage.msg = this.date + '-01'
  5294. }
  5295. let monthdate = new Date(sessionStorage.msg)
  5296. this.choseDay = monthdate.getDate() - 1
  5297. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5298. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5299. }
  5300. }else{
  5301. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5302. }
  5303. //从消息点击跳转过来的,直接加载指定日期
  5304. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5305. this.curDate = sessionStorage.msg;
  5306. sessionStorage.from = 0;
  5307. } else {
  5308. // if (curMonthDay != null) {
  5309. // // this.curDate = curMonthDay;
  5310. // let d = new Date(sessionStorage.msg)
  5311. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5312. // } else {
  5313. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5314. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5315. // }
  5316. }
  5317. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5318. // if(!sessionStorage.msg){
  5319. // let msgday = this.choseDay + 1
  5320. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5321. // }
  5322. this.getReportFillStatus();
  5323. },
  5324. getCountDays() {
  5325. var newstr = this.date.replace(/-/g, "/");
  5326. var curDate = new Date(newstr+'/01');
  5327. var curMonth = curDate.getMonth();
  5328. curDate.setMonth(curMonth + 1);
  5329. curDate.setDate(0);
  5330. return curDate.getDate();
  5331. },
  5332. reqMore() {
  5333. if (this.hasMore) {
  5334. this.pageIndex++;
  5335. this.requestHttpReports();
  5336. }
  5337. },
  5338. //加载日报数据
  5339. requestHttpReports() {
  5340. //请求数据
  5341. this.listLoading = true;
  5342. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5343. let param = {date: this.date + day};
  5344. if (this.deptId) {
  5345. param.deptId = this.deptId;
  5346. }
  5347. if (this.targetUid) {
  5348. param.userId = this.targetUid;
  5349. }
  5350. //传页码
  5351. if (this.hasMore) {
  5352. param.pageIndex = this.pageIndex;
  5353. }
  5354. this.http.post( this.port.report.list, param,
  5355. res => {
  5356. this.listLoading = false;
  5357. if (res.code == "ok") {
  5358. //扩增
  5359. this.reportList = this.reportList.concat(res.data.data);
  5360. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5361. if(document.querySelector("#day"+this.choseDay)){
  5362. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5363. }
  5364. } else {
  5365. this.$message({
  5366. message: res.msg,
  5367. type: "error"
  5368. });
  5369. }
  5370. },
  5371. error => {
  5372. this.listLoading = false;
  5373. this.$message({
  5374. message: error,
  5375. type: "error"
  5376. });
  5377. });
  5378. },
  5379. //获取日报列表
  5380. getReportList() {
  5381. //初始化,重置数据
  5382. this.pageIndex = 0;
  5383. this.hasMore = true;
  5384. this.reportList = [];
  5385. this.requestHttpReports();
  5386. },
  5387. //刷新日报状态,用于审核后更新
  5388. refreshReportData(reportId) {
  5389. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5390. res => {
  5391. if (res.code == "ok") {
  5392. for (var m=0;m<this.reportList.length; m++) {
  5393. var d = this.reportList[m].data;
  5394. var find = d.filter(r=>r.id == reportId);
  5395. if (find.length > 0) {
  5396. find[0].state = res.data.state;
  5397. if (find[0].state == 2) {//被驳回,要可以编辑
  5398. this.reportList[m].state = 2;
  5399. }
  5400. find[0].isDeptAudit = res.data.isDeptAudit;
  5401. find[0].departmentAuditState = res.data.departmentAuditState;
  5402. find[0].projectAuditorName = res.data.projectAuditorName;
  5403. find[0].projectAuditorId = res.data.projectAuditorId;
  5404. find[0].projectAuditState = res.data.projectAuditState;
  5405. find[0].rejectUserid = res.data.rejectUserid;
  5406. find[0].rejectUsername = res.data.rejectUsername;
  5407. find[0].rejectReason = res.data.rejectReason;
  5408. this.$forceUpdate();
  5409. break;
  5410. }
  5411. }
  5412. } else {
  5413. this.$message({
  5414. message: res.msg,
  5415. type: "error"
  5416. });
  5417. }
  5418. },
  5419. error => {
  5420. this.listLoading = false;
  5421. this.$message({
  5422. message: error,
  5423. type: "error"
  5424. });
  5425. });
  5426. },
  5427. //导出员工工时统计
  5428. exportUserTime() {
  5429. this.listLoading = true;
  5430. var param = {};
  5431. if (this.exportParam.dateRange != null) {
  5432. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5433. }
  5434. this.http.post('/department/exportDeptStatistic', param,
  5435. res => {
  5436. this.listLoading = false;
  5437. if (res.code == "ok") {
  5438. location.href = res.data;
  5439. this.exportTimeDialog = false;
  5440. } else {
  5441. this.$message({
  5442. message: res.msg,
  5443. type: "error"
  5444. });
  5445. }
  5446. },
  5447. error => {
  5448. this.listLoading = false;
  5449. this.$message({
  5450. message: error,
  5451. type: "error"
  5452. });
  5453. });
  5454. },
  5455. //导出日报
  5456. exportReport() {
  5457. this.exportingData = true;
  5458. var param = {};
  5459. if (this.exportParam.dateRange != null) {
  5460. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5461. }
  5462. if (this.exportParam.projectId != null) {
  5463. param.projectId = this.exportParam.projectId;
  5464. }
  5465. if (this.exportParam.departmentId != null) {
  5466. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5467. }
  5468. param.stateKey = this.stateKey
  5469. // param.departmentId = this.user.departmentId
  5470. console.log(param, '《=== 导出传的参数');
  5471. console.log('开始调用exportReport接口');
  5472. this.http.post(this.port.report.export, param,
  5473. res => {
  5474. this.exportingData = false;
  5475. if (res.code == "ok") {
  5476. location.href = res.data;
  5477. this.exportDialog = false;
  5478. } else {
  5479. this.$message({
  5480. message: res.msg,
  5481. type: "error"
  5482. });
  5483. }
  5484. },
  5485. error => {
  5486. this.exportingData = false;
  5487. this.$message({
  5488. message: error,
  5489. type: "error"
  5490. });
  5491. });
  5492. },
  5493. //获取项目列表
  5494. getProjectList() {
  5495. this.listLoading = true;
  5496. this.http.post( this.port.project.list, {},
  5497. res => {
  5498. this.listLoading = false;
  5499. if (res.code == "ok") {
  5500. for(var i in res.data) {
  5501. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5502. res.data[i].projectCode = ''
  5503. }
  5504. }
  5505. this.projectList = res.data;
  5506. console.log("项目列表",this.projectList);
  5507. } else {
  5508. this.$message({
  5509. message: res.msg,
  5510. type: "error"
  5511. });
  5512. }
  5513. },
  5514. error => {
  5515. this.listLoading = false;
  5516. this.$message({
  5517. message: error,
  5518. type: "error"
  5519. });
  5520. });
  5521. },
  5522. // 获取填报日报的项目下拉列表
  5523. getFillProjectList() {
  5524. this.http.post( this.port.project.list, {
  5525. forReport: 1
  5526. },res => {
  5527. if (res.code == "ok") {
  5528. for(var i in res.data) {
  5529. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5530. res.data[i].projectCode = ''
  5531. }
  5532. }
  5533. this.fillProjectList = res.data;
  5534. this.getRecentlyProject()
  5535. } else {
  5536. this.$message({
  5537. message: res.msg,
  5538. type: "error"
  5539. });
  5540. }
  5541. },
  5542. error => {
  5543. this.$message({
  5544. message: error,
  5545. type: "error"
  5546. });
  5547. });
  5548. },
  5549. getBasecostItemList() {
  5550. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5551. companyId: this.user.companyId
  5552. },
  5553. res => {
  5554. if (res.code == "ok") {
  5555. this.timeBasecostList = res.data;
  5556. }
  5557. });
  5558. },
  5559. getAIReport(createDate) {
  5560. this.http.post('/report/getAIReport', {},
  5561. res => {
  5562. if (res.code == "ok") {
  5563. var quanbu = 0
  5564. this.jsDay = 1
  5565. var zhi = ''
  5566. var slp = res.data
  5567. for(var i in slp) {
  5568. var sp = +slp[i].workingTime + 0
  5569. zhi = this.jsDay * sp
  5570. quanbu = +quanbu + zhi
  5571. }
  5572. this.jsTime = quanbu
  5573. var aiReportData = res.data;
  5574. this.canCancelInDialog = false
  5575. if(aiReportData.length != 0) {
  5576. var arr = [];
  5577. for(var i in aiReportData) {
  5578. arr.push({
  5579. id: null,
  5580. projectId: aiReportData[i].projectId,
  5581. workingTime: aiReportData[i].workingTime,
  5582. content: '',
  5583. progress:100,
  5584. state: 2,
  5585. timeType: aiReportData[i].timeType,
  5586. subProjectList: aiReportData[i].subProjectList,
  5587. taskList: aiReportData[i].taskList,
  5588. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5589. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5590. taskId: aiReportData[i].taskId,
  5591. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5592. startTime: aiReportData[i].startTime,
  5593. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5594. endTime: aiReportData[i].endTime,
  5595. isOvertime: 0,
  5596. progress:aiReportData[i].progress,
  5597. professionProgress: aiReportData[i].professionProgressList,
  5598. stages:aiReportData[i].stages,
  5599. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5600. pics: null,
  5601. multiWorktime: aiReportData[i].multiWorktime,
  5602. worktimeList: [{}],
  5603. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5604. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5605. wuduList: aiReportData[i].degreeList,
  5606. taskGroups:aiReportData[i].taskGroups,
  5607. customData: aiReportData[i].customData,//自定义的数值
  5608. auditUserList: aiReportData[i].auditUserList,
  5609. projectAuditorId: aiReportData[i].projectAuditorId,
  5610. projectAuditorName: aiReportData[i].projectAuditorName,
  5611. overtimeHours: aiReportData[i].overtimeHours,
  5612. customText: aiReportData[i].customText,
  5613. basecostId: aiReportData[i].basecostId,
  5614. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5615. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5616. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5617. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5618. canEdit: true
  5619. })
  5620. }
  5621. this.workForm.domains = arr;
  5622. } else {
  5623. }
  5624. this.canEdit = true;
  5625. this.originCanEdit = true;
  5626. this.seleChn()
  5627. } else {
  5628. this.$message({
  5629. message: res.msg,
  5630. type: "error"
  5631. });
  5632. }
  5633. },
  5634. error => {
  5635. this.$message({
  5636. message: error,
  5637. type: "error"
  5638. });
  5639. });
  5640. },
  5641. // 获取个人某天的日报 111111
  5642. getReport() {
  5643. this.http.post( this.port.report.getPort, {
  5644. date: this.workForm.createDate
  5645. },
  5646. res => {
  5647. if (res.code == "ok") {
  5648. var quanbu = 0
  5649. this.jsDay = 1
  5650. var zhi = ''
  5651. var slp = res.data.report
  5652. for(var i in slp) {
  5653. var sp = +slp[i].workingTime + 0
  5654. zhi = this.jsDay * sp
  5655. quanbu = +quanbu + zhi
  5656. }
  5657. this.jsTime = quanbu
  5658. var list = res.data;
  5659. this.report = list;
  5660. this.reportTimeType = this.report.timeType;
  5661. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5662. this.isWeekend = !this.report.isWorkDay;
  5663. this.canCancelInDialog = false;
  5664. this.hasWrittenReport = list.report.length != 0;
  5665. if(list.report.length != 0) {
  5666. var arr = [];
  5667. this.canEdit = false;
  5668. let candelete = true
  5669. for(var i in list.report) {
  5670. var flg = null
  5671. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5672. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5673. var filteredRespList = null
  5674. if (targetP.length > 0) {
  5675. var isPublic = targetP[0].isPublic;
  5676. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5677. }
  5678. arr.push({
  5679. id: list.report[i].id,
  5680. projectId: list.report[i].projectId,
  5681. workingTime: list.report[i].workingTime,
  5682. content: list.report[i].content,
  5683. state: list.report[i].state,
  5684. timeType: list.report[i].timeType,
  5685. subProjectList: list.report[i].subProjectList,
  5686. taskList: list.report[i].taskList,
  5687. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5688. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5689. taskId: list.report[i].taskId,
  5690. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5691. startTime: list.report[i].startTime,
  5692. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5693. endTime: list.report[i].endTime,
  5694. isOvertime: flg,
  5695. progress:list.report[i].progress,
  5696. professionProgress: list.report[i].professionProgressList,
  5697. stages:list.report[i].stages,
  5698. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5699. pics: list.report[i].pics,
  5700. multiWorktime: list.report[i].multiWorktime,
  5701. worktimeList: list.report[i].worktimeList,
  5702. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5703. multiDegrIdArray: list.report[i].multiDegrIdList,
  5704. wuduList: list.report[i].degreeList,
  5705. taskGroups:list.report[i].taskGroups,
  5706. customData: list.report[i].customData,//自定义的数值
  5707. auditUserList: list.report[i].auditUserList,
  5708. projectAuditorId: list.report[i].projectAuditorId,
  5709. projectAuditorName: list.report[i].projectAuditorName,
  5710. overtimeHours: list.report[i].overtimeHours,
  5711. customText: list.report[i].customText,
  5712. basecostId: list.report[i].basecostId,
  5713. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5714. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5715. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5716. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5717. canEdit: list.report[i].state >= 2 ? true : false,
  5718. extraField1: list.report[i].extraField1,
  5719. extraField2: list.report[i].extraField2,
  5720. extraField3: list.report[i].extraField3,
  5721. workContentList: list.report[i].workContentList,
  5722. filteredRespList: filteredRespList,
  5723. serviceList: list.report[i].serviceList,
  5724. sapServiceId: list.report[i].sapServiceId,
  5725. reportTargetDeptId: list.report[i].deptId
  5726. })
  5727. if (list.report[i].state >= 2) {
  5728. this.canEdit = true;
  5729. }
  5730. if(list.report[i].state < 2){
  5731. candelete = false
  5732. }
  5733. if (list.report[i].state == 0){
  5734. this.canCancelInDialog = true
  5735. }
  5736. // 加判断
  5737. if(this.user.timeType.choseFromAlbum == 1) {
  5738. let arrList = []
  5739. for(var k in list.report[i].pics) {
  5740. let obj = {
  5741. name: k,
  5742. url: list.report[i].pics[k]
  5743. }
  5744. arrList.push(obj)
  5745. }
  5746. arr[i].imgListUrl = arrList
  5747. arr[i].imgList = list.report[i].pics
  5748. }
  5749. }
  5750. this.reportCanDelete = candelete
  5751. this.workForm = {
  5752. createDate: this.workForm.createDate,
  5753. domains: arr,
  5754. userNames:null,
  5755. userId:null,
  5756. time: list.time,
  5757. showRefresh: list.showRefresh
  5758. }
  5759. console.log('workForm', this.workForm)
  5760. } else {
  5761. this.workForm = {
  5762. createDate: this.workForm.createDate,
  5763. domains: [{
  5764. id: null,
  5765. projectId: "",
  5766. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5767. content: "",
  5768. progress:100,
  5769. state: 2,
  5770. timeType:0,
  5771. multiWorktime: this.reportTimeType.multiWorktime,
  5772. worktimeList:[{}],
  5773. canEdit: true,
  5774. auditorFirst: '',
  5775. auditorSec: '',
  5776. auditorThird: '',
  5777. ccUserid: ''
  5778. }],
  5779. userId:null,
  5780. userNames:null,
  5781. time: this.report.time,
  5782. showRefresh: list.showRefresh
  5783. }
  5784. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5785. this.$set(this.workForm.domains[0],'isOvertime',true)
  5786. if(this.reportTimeType.type != 2){
  5787. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5788. }
  5789. }
  5790. if(this.user.timeType.type == 1) {
  5791. var shuzhi = this.user.timeType.allday + ''
  5792. // console.log('执行一次', shuzhi.indexOf('.'))
  5793. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5794. }
  5795. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5796. //默认给第一个,必填字段
  5797. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5798. }
  5799. this.canEdit = true;
  5800. }
  5801. this.originCanEdit = this.canEdit;
  5802. this.seleChn()
  5803. } else {
  5804. this.$message({
  5805. message: res.msg,
  5806. type: "error"
  5807. });
  5808. }
  5809. },
  5810. error => {
  5811. this.$message({
  5812. message: error,
  5813. type: "error"
  5814. });
  5815. });
  5816. },
  5817. guanbi() {
  5818. this.falsss = false,
  5819. this.workTimeForMinYi=0
  5820. },
  5821. // 打开日报填写
  5822. fillInReport(i, isBatch) {
  5823. this.isWeekend = false
  5824. this.reportCanDelete = false
  5825. // console.log(this.user.timeType.type, '选择时长')
  5826. if(i != 1) {
  5827. this.falsss = false
  5828. } else {
  5829. this.falsss = true
  5830. }
  5831. if (this.isSubstitude) {
  5832. this.getSubstitudeUserDeptList();
  5833. }
  5834. if(i == -1 || this.isSubstitude) {
  5835. this.isDisable = false;
  5836. } else {
  5837. this.isDisable = true;
  5838. }
  5839. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5840. this.isBatch = isBatch;
  5841. if (this.isBatch == 0 && !this.isSubstitude) {
  5842. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5843. let weekday = new Date(this.workForm.createDate).getDay()
  5844. if(this.user.companyId == 817){
  5845. if(weekday == 0){
  5846. this.isWeekend = true
  5847. }
  5848. }else{
  5849. if(weekday == 0 || weekday == 6){
  5850. this.isWeekend = true
  5851. }
  5852. }
  5853. this.getReport(i);
  5854. } else {
  5855. // console.log('执行到了这里')
  5856. this.jsTime = 0
  5857. this.jsDay = 0
  5858. this.workForm = {
  5859. createDate: null,//批量填报没有日期
  5860. domains: [{
  5861. id: null,
  5862. projectId: "",
  5863. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5864. content: "",
  5865. progress:100,
  5866. state: 2,
  5867. timeType:0,
  5868. multiWorktime: this.reportTimeType.multiWorktime,
  5869. worktimeList:[{}],
  5870. canEdit: true,
  5871. }],
  5872. }
  5873. if(this.user.timeType.type == 1) {
  5874. var shuzhi = this.user.timeType.allday + ''
  5875. // console.log('执行二次')
  5876. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5877. }
  5878. // console.log(this.workForm)
  5879. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5880. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5881. }
  5882. this.canEdit = true;
  5883. }
  5884. this.dialogVisible = true;
  5885. },
  5886. //按周填报的弹窗口中编辑单项目相关数据
  5887. setWeekFormReportItem(reportId, i, names, row,sss) {
  5888. console.log(sss)
  5889. this.http.post('/report/getReportById', {
  5890. reportId: reportId
  5891. },
  5892. res => {
  5893. if (res.code == "ok") {
  5894. var data = res.data.report;
  5895. sss.subProjectId = data.subProjectId
  5896. sss.subProjectList = data.subProjectList;
  5897. sss.stage = data.stage
  5898. sss.subProjectList = data.subProjectList
  5899. sss.stages = data.stages
  5900. sss.taskGroups = data.taskGroups;
  5901. sss.auditUserList = data.auditUserList;
  5902. sss.degreeId = data.degreeId;
  5903. sss.customData = data.customData;
  5904. sss.wuduList = data.degreeList;
  5905. this.zhoBaoIdx = i
  5906. this.zhoBaoName = names
  5907. this.zhoBao = sss
  5908. this.zhis = row
  5909. if (sss.groupId) {
  5910. //最后一个参数表示是否保留stage的值,不要重置为空
  5911. this.getGroupStages(this.zhoBao, 0, true)
  5912. }
  5913. this.$forceUpdate();
  5914. }
  5915. });
  5916. },
  5917. // 按周填报里内容的填写
  5918. tianxies(item, i, names, row) {
  5919. if (item.state == 0) {
  5920. this.$message({
  5921. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5922. type: "error"
  5923. });
  5924. return;
  5925. }
  5926. if (item.state == 1) {
  5927. this.$message({
  5928. message: '已通过状态不可修改',
  5929. type: "error"
  5930. });
  5931. return;
  5932. }
  5933. if(this.user.timeType.notAllowedNoAttendance == 1){
  5934. if(this.zhoData[i].corpTime){
  5935. if(this.zhoData[i].corpTime.workHours == 0){
  5936. this.$message({
  5937. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5938. type: 'error'
  5939. })
  5940. return
  5941. }
  5942. }else{
  5943. this.$message({
  5944. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5945. type: 'error'
  5946. })
  5947. return
  5948. }
  5949. }
  5950. var idd = ''
  5951. var obj = {}
  5952. for(var l in this.projectList) {
  5953. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5954. }
  5955. obj.projectId = idd
  5956. this.tianxieDialogVisible = true
  5957. this.scopess = item
  5958. console.log(item, '《==== 当前的对象')
  5959. var sss = {}
  5960. if (item.id != null) {
  5961. sss.id = item.id;
  5962. sss.state = item.state;
  5963. } else {
  5964. sss.id = -1;
  5965. sss.state = 3;
  5966. }
  5967. sss.projectId = idd;
  5968. sss.progress = item.progress
  5969. sss.time = item.time
  5970. sss.content = item.content;
  5971. console.log('333', sss.content)
  5972. if (sss.time == '' && this.reportTimeType.type == 2) {
  5973. //取已填时间范围中最大的一个作为开始时间
  5974. var startTime = '09:00';
  5975. var fillStartTime = '00:00';
  5976. for (var t in this.selProjectList) {
  5977. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5978. if (fillItem.time) {
  5979. if (fillItem.time[1] > fillStartTime) {
  5980. fillStartTime = fillItem.time[1];
  5981. }
  5982. }
  5983. }
  5984. if (fillStartTime == '00:00') {
  5985. fillStartTime = '09:00';
  5986. }
  5987. var fillEndMax = '18:00';
  5988. if (fillStartTime >= '18:00') {
  5989. fillEndMax = '23:59';
  5990. }
  5991. sss.time = [fillStartTime, fillEndMax];
  5992. }
  5993. sss.groupId = item.groupId
  5994. sss.stage = item.stage;
  5995. sss.workingTime = item.workingTime
  5996. sss.projectAuditorId = item.projectAuditorId;
  5997. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5998. //默认选中第一个
  5999. sss.basecostId = this.timeBasecostList[0].id;
  6000. }
  6001. var hasEdited = this.zhoData[i][names].hasEdited;
  6002. if (hasEdited) {
  6003. sss = { ...item }
  6004. //编辑过了
  6005. sss.subProjectId = item.subProjectId
  6006. sss.stage = item.stage
  6007. sss.subProjectList = item.subProjectList
  6008. sss.stages = item.stages
  6009. sss.taskGroups = item.taskGroups;
  6010. console.log(sss.taskGroups, '33333');
  6011. sss.auditUserList = obj.auditUserList;
  6012. sss.degreeId = item.degreeId;
  6013. sss.customData = item.customData;
  6014. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6015. //只有一个审核人,自动设置上去
  6016. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6017. }
  6018. sss.wuduList = item.wuduList;
  6019. this.zhoBaoIdx = i
  6020. this.zhoBaoName = names
  6021. this.zhoBao = sss
  6022. this.zhis = row
  6023. if (sss.groupId) {
  6024. //最后一个参数表示是否保留stage的值,不要重置为空
  6025. this.getGroupStages(this.zhoBao, 0, true)
  6026. }
  6027. this.$forceUpdate();
  6028. this.getWeeklyTaskList(sss)
  6029. console.log('最后的周报 ===>', this.zhoBao)
  6030. } else {
  6031. //第一次打开,获取数据
  6032. if (sss.id == -1) {
  6033. //新填报的
  6034. this.selectProject(obj, 0);
  6035. var that = this
  6036. setTimeout(() =>{
  6037. sss.subProjectId = that.workForm.domains[0].subProjectId
  6038. sss.subProjectList = item.subProjectList;
  6039. sss.stage = that.workForm.domains[0].stage
  6040. sss.subProjectList = that.workForm.domains[0].subProjectList
  6041. sss.stages = that.workForm.domains[0].stages
  6042. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6043. sss.auditUserList = obj.auditUserList;
  6044. sss.degreeId = item.degreeId;
  6045. sss.customData = item.customData;
  6046. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6047. //只有一个审核人,自动设置上去
  6048. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6049. }
  6050. sss.wuduList = row[0].wuduList
  6051. that.zhoBaoIdx = i
  6052. that.zhoBaoName = names
  6053. that.zhoBao = sss
  6054. that.zhis = row
  6055. if (sss.groupId) {
  6056. //最后一个参数表示是否保留stage的值,不要重置为空
  6057. this.getGroupStages(that.zhoBao, 0, false)
  6058. }
  6059. that.$forceUpdate();
  6060. this.getWeeklyTaskList(sss)
  6061. },600);
  6062. } else {
  6063. //编辑填报过的;数据库已经存在的
  6064. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6065. }
  6066. }
  6067. },
  6068. // 按周填报里内容的填写点击确定
  6069. setWeekProItemData() {
  6070. //专业版模式下,任务分组和阶段必填
  6071. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6072. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6073. this.$message({
  6074. message: '任务分组和阶段必填,请检查',
  6075. type: "error"
  6076. });
  6077. return;
  6078. }
  6079. }
  6080. // 检查任务分组
  6081. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6082. this.$message({
  6083. message: '任务分组必填,请检查',
  6084. type: "error"
  6085. });
  6086. return
  6087. }
  6088. //检查子项目是否必填
  6089. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6090. this.$message({
  6091. message: '子项目必填,请检查',
  6092. type: "error"
  6093. });
  6094. return;
  6095. }
  6096. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6097. this.$message({
  6098. message: this.$t('message.Pleaseselectareviewer'),
  6099. type: "error"
  6100. });
  6101. return
  6102. }
  6103. if(this.user.timeType.reportAuditType == 3){
  6104. let auditTips = ''
  6105. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6106. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6107. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6108. if(auditTips){
  6109. auditTips = auditTips.substring(0,auditTips.length - 1)
  6110. this.$message({
  6111. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6112. type: 'error'
  6113. })
  6114. return
  6115. }
  6116. }
  6117. let errtips = ''
  6118. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6119. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6120. errtips += this.user.timeType.customDegreeName + '、'
  6121. }
  6122. }
  6123. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6124. errtips += this.user.timeType.customDataName + '、'
  6125. }
  6126. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6127. errtips += this.user.timeType.customTextName + '、'
  6128. }
  6129. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6130. errtips += this.$t('other.workMatters') +'、'
  6131. }
  6132. if(errtips){
  6133. errtips = errtips.substring(0,errtips.length - 1)
  6134. this.$message({
  6135. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6136. type: 'error'
  6137. })
  6138. return
  6139. }
  6140. this.tianxieDialogVisible = false
  6141. var zhong = this.zhoData
  6142. this.zhoBao.hasEdited = true;
  6143. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6144. this.zhoData = zhong
  6145. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6146. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6147. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6148. },
  6149. // 获取本周
  6150. getCurrentWeek() {
  6151. //今天
  6152. this.targetWeekDate = new Date();
  6153. this.initWeekFormData();
  6154. // this.jiazai()
  6155. },
  6156. // 获取上周
  6157. handleGetPrevWeek() {
  6158. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6159. this.initWeekFormData();
  6160. // this.jiazai()
  6161. },
  6162. // 获取下周
  6163. handleGetNextvWeek() {
  6164. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6165. this.initWeekFormData()
  6166. },
  6167. // 加载动画
  6168. jiazai() {
  6169. this.weekDataLoading = true
  6170. var that = this
  6171. setTimeout(() =>{
  6172. that.weekDataLoading = false
  6173. },1000);
  6174. },
  6175. // 转时间格式
  6176. dealdate(date) {
  6177. const dt = new Date(date)
  6178. const y = dt.getFullYear()
  6179. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6180. const d = (dt.getDate() + '').padStart(2, '0')
  6181. return `${y}-${m}-${d}`
  6182. },
  6183. // 按周填报
  6184. fillInReportss() {
  6185. window.addEventListener('scroll', this.handleScroll, true)
  6186. // this.jiazai()
  6187. this.fillWeekDialogVisi = true
  6188. this.getCurrentWeek();
  6189. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6190. //重新获取工时预警类型的预算项
  6191. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6192. companyId: this.user.companyId
  6193. },
  6194. res => {
  6195. if (res.code == "ok") {
  6196. this.timeBasecostList = res.data;
  6197. }
  6198. });
  6199. }
  6200. },
  6201. fillInReportCustom() {
  6202. this.weekIndex++
  6203. this.weekParentData = {
  6204. isSubstitude: this.isSubstitude
  6205. }
  6206. this.fillWeekDialogVisiCustom = true
  6207. },
  6208. // 按周填报的项目筛选
  6209. selListFun(){
  6210. this.selProjectList = []
  6211. if(this.selCon.length){
  6212. for (let i = 0; i < this.selCon.length; i++) {
  6213. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6214. }
  6215. this.selConShow = false ;
  6216. for (let i in this.zhoData) {
  6217. var obj = this.zhoData[i];
  6218. for(var j in this.selProjectList) {
  6219. var xinzhi = this.selProjectList[j].projectName
  6220. obj[xinzhi] = {}
  6221. obj[xinzhi].time = ''
  6222. obj[xinzhi].content = ''
  6223. obj[xinzhi].progress = 0
  6224. obj[xinzhi].workingTime = 0
  6225. }
  6226. }
  6227. this.initWeekFormData();
  6228. }else{
  6229. this.$message({
  6230. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6231. type:'error'
  6232. })
  6233. }
  6234. },
  6235. setWeekCardTimeData(list) {
  6236. for(let i in list){
  6237. let datei = '';
  6238. if (this.user.timeType.showDdCardtime == 1) {
  6239. datei = list[i].workDate;
  6240. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6241. datei = list[i].createDate;
  6242. } else if (this.user.timeType.syncFanwei == 1) {
  6243. datei = list[i].workDate;
  6244. }
  6245. for(let m in this.zhoData) {
  6246. if(datei == this.zhoData[m].zhoDataTime){
  6247. let item = {
  6248. startTime: list[i].startTime,
  6249. endTime: list[i].endTime,
  6250. workHours: list[i].workHours
  6251. }
  6252. this.$set(this.zhoData[m],'corpTime',item)
  6253. }
  6254. }
  6255. }
  6256. },
  6257. getWeeklyCardTime(){ //按周填报获取考勤信息
  6258. let dateStr = []
  6259. for(let i in this.zhoData){
  6260. dateStr.push(this.zhoData[i].zhoDataTime)
  6261. }
  6262. this.http.post('/report/getWeeklyCardTime',{
  6263. dateStr: JSON.stringify(dateStr)
  6264. },res => {
  6265. if(res.code == 'ok'){
  6266. for(let i in res.data){
  6267. let datei = '';
  6268. if (this.user.timeType.showDdCardtime == 1) {
  6269. datei = res.data[i].workDate.split('-');
  6270. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6271. datei = res.data[i].createDate.split('-');
  6272. }
  6273. for(let m in this.zhoData){
  6274. let datem = new Date(this.zhoData[m].zhoDataTime)
  6275. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6276. let item = {
  6277. startTime: res.data[i].startTime,
  6278. endTime: res.data[i].endTime,
  6279. workHours: res.data[i].workHours
  6280. }
  6281. this.$set(this.zhoData[m],'corpTime',item)
  6282. }
  6283. }
  6284. }
  6285. }else{
  6286. this.$message({
  6287. message: res.msg,
  6288. type: 'error'
  6289. })
  6290. }
  6291. },err => {
  6292. this.$message({
  6293. message: err,
  6294. type: 'error'
  6295. })
  6296. })
  6297. },
  6298. selListqx(){
  6299. this.fillWeekDialogVisi = false
  6300. this.selProjectList = []
  6301. this.selCon = []
  6302. },
  6303. handleScroll() {
  6304. this.changdu = this.projectList.length + 1
  6305. },
  6306. // 自动选择时间点的事件
  6307. // async zhoTimes(item, i) {
  6308. // var iss = i
  6309. // if(item.time == null) {
  6310. // return
  6311. // } else {
  6312. // const zhi = this.zhoData[iss];
  6313. // let he = 0;
  6314. // const timeArr = Object.values(zhi)
  6315. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6316. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6317. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6318. // console.log(data, 'data');
  6319. // zhi.he = `${he}h`;
  6320. // }
  6321. // },
  6322. async zhoTimes(item, index) {
  6323. const zho = this.zhoData[index];
  6324. if (!item.time) {
  6325. return;
  6326. }
  6327. const timeArr = Object.values(zho)
  6328. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6329. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6330. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6331. zho.he = `${totalHours[0]}h`;
  6332. },
  6333. // 判断两个时间段是否重叠
  6334. timeOverlap(idx, dateAr) {
  6335. let zhi = 0
  6336. for (let k in dateAr) {
  6337. if (idx !== k) {
  6338. 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))) {
  6339. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6340. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6341. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6342. }
  6343. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6344. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6345. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6346. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6347. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6348. } else {
  6349. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6350. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6351. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6352. }
  6353. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6354. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6355. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6356. }
  6357. }
  6358. }
  6359. }
  6360. }
  6361. return zhi
  6362. },
  6363. // 计算时间
  6364. getHourMinutes(str, end) {
  6365. var he = 0
  6366. var date2 = '2021/12/12 ' + end +':00'
  6367. var date1 = '2021/12/12 ' + str +':00'
  6368. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6369. var leave1=date3%(24*3600*1000)
  6370. var hours=Math.floor(leave1/(3600*1000))
  6371. var leave2=leave1%(3600*1000)
  6372. var minutes=Math.floor(leave2/(60*1000))
  6373. var shi = hours+'.'+ minutes
  6374. return he += +shi
  6375. },
  6376. // 自动选择事件长度的事件
  6377. zhoXuan(item, i) {
  6378. var iss = i
  6379. if(item.time == null) {
  6380. return
  6381. } else {
  6382. var zhi = this.zhoData[iss]
  6383. var he = 0
  6384. for(var i in zhi) {
  6385. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6386. he += +zhi[i].workingTime
  6387. }
  6388. }
  6389. zhi.he = he + 'h'
  6390. }
  6391. },
  6392. getPushWorkLogData(){
  6393. this.http.post('/sap-sync-log/list', {},
  6394. res => {
  6395. if (res.code == "ok") {
  6396. this.pushWorkTimeLogData = res.data;
  6397. } else {
  6398. this.$message({
  6399. message: res.msg,
  6400. type: "error"
  6401. });
  6402. }
  6403. },
  6404. error => {
  6405. this.$message({
  6406. message: error,
  6407. type: "error"
  6408. });
  6409. });
  6410. },
  6411. // 获取全部人员
  6412. getUsers() {
  6413. this.http.post('/user/getSimpleActiveUserList', {},
  6414. res => {
  6415. if (res.code == "ok") {
  6416. this.usersList = res.data;
  6417. } else {
  6418. this.$message({
  6419. message: res.msg,
  6420. type: "error"
  6421. });
  6422. }
  6423. },
  6424. error => {
  6425. this.$message({
  6426. message: error,
  6427. type: "error"
  6428. });
  6429. });
  6430. },
  6431. // 按时间比例
  6432. addBli(item, i) {
  6433. var iss = i
  6434. if(item.time == null) {
  6435. return
  6436. } else {
  6437. var zhi = this.zhoData[iss]
  6438. var he = 0
  6439. for(var i in zhi) {
  6440. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6441. he += +zhi[i].workingTime
  6442. }
  6443. }
  6444. zhi.he = he.toFixed(1) + 'h'
  6445. }
  6446. },
  6447. //按周填报选择的项目发生变化,需要设置列
  6448. onSelProjectChange() {
  6449. for (let i = 0; i < this.selCon.length; i++) {
  6450. var exists = false;
  6451. for (let j = 0; j < this.selProjectList.length; j++) {
  6452. if (this.selProjectList[j].id == this.selCon[i]) {
  6453. exists = true;
  6454. break;
  6455. }
  6456. }
  6457. if (!exists) {
  6458. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6459. this.selProjectList.push(newProject);
  6460. //添加新项目
  6461. for (var w in this.zhoData) {
  6462. var dayItem = this.zhoData[w];
  6463. var pName = newProject.projectName;
  6464. dayItem[pName] = {};
  6465. dayItem[pName].time = ''
  6466. dayItem[pName].content = ''
  6467. dayItem[pName].progress = 0
  6468. dayItem[pName].workingTime = 0
  6469. }
  6470. }
  6471. }
  6472. //去掉
  6473. for (let j = 0; j < this.selProjectList.length; j++) {
  6474. var exists = false;
  6475. for (let i = 0; i < this.selCon.length; i++) {
  6476. if (this.selProjectList[j].id == this.selCon[i]) {
  6477. exists = true;
  6478. break;
  6479. }
  6480. }
  6481. if (!exists) {
  6482. this.selProjectList.splice(j, 1);
  6483. j--;
  6484. }
  6485. }
  6486. this.loadFilledWeekReportItem();
  6487. //刷新表格
  6488. // this.$refs.weekTable.doLayout();
  6489. },
  6490. //根据选中的项目来刷新填写表格
  6491. loadFilledWeekReportItem() {
  6492. for (var w in this.zhoData) {
  6493. var dayItem = this.zhoData[w];
  6494. for (var i = 0; i < this.selProjectList.length; i++) {
  6495. var curColumnProject = this.selProjectList[i];
  6496. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6497. for (var t in dayItem.reportList) {
  6498. //有日报的项目,不能取消选择
  6499. for (var p in this.fillProjectList) {
  6500. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6501. }
  6502. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6503. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6504. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6505. if (this.reportTimeType.type == 2) {
  6506. //时间段模式
  6507. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6508. }
  6509. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6510. break;
  6511. }
  6512. }
  6513. // dayItem[curColumnProject.projectName] = matchReportItem;
  6514. }
  6515. }
  6516. this.$nextTick(()=>{
  6517. this.$refs.weekTable.doLayout();
  6518. });
  6519. },
  6520. initWeekFormData() {
  6521. this.weekDataLoading = true;
  6522. for (var p in this.fillProjectList) {
  6523. this.fillProjectList[p].canCancel = 1;
  6524. }
  6525. this.http.post('/report/getWeeklyReportData',{
  6526. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6527. },res => {
  6528. this.weekDataLoading = false;
  6529. if(res.code == 'ok'){
  6530. let projectList = res.data.projectList;
  6531. if (projectList.length > 0) {
  6532. //有选择过项目进行填报,直接选中
  6533. this.selProjectList = projectList;
  6534. this.selCon = [];
  6535. for (let i = 0; i < projectList.length; i++) {
  6536. this.selCon.push(projectList[i].id);
  6537. }
  6538. }
  6539. //设置日期
  6540. this.weekDateRange = res.data.dateList;
  6541. this.zhoData = [];
  6542. var arrst = []
  6543. for(var i in this.weekDateRange) {
  6544. var obj = {}
  6545. obj.zhoDataTime = this.weekDateRange[i].date
  6546. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6547. obj.he = this.weekDateRange[i].filledTime;
  6548. obj.canFill = this.weekDateRange[i].canFill;
  6549. // obj.filledTime = this.weekDateRange[i].filledTime;
  6550. obj.reportList = this.weekDateRange[i].reportList;
  6551. //初始化,防止渲染报错
  6552. for (var j = 0; j < this.selProjectList.length; j++) {
  6553. var pName = this.selProjectList[j].projectName
  6554. obj[pName] = {}
  6555. obj[pName].time = ''
  6556. obj[pName].content = ''
  6557. obj[pName].progress = 0
  6558. obj[pName].workingTime = 0
  6559. }
  6560. arrst.push(obj)
  6561. }
  6562. this.zhoData = arrst
  6563. this.setWeekCardTimeData(res.data.cardTimeList);
  6564. this.loadFilledWeekReportItem();
  6565. }else{
  6566. this.$message({
  6567. message: res.msg,
  6568. type: 'error'
  6569. })
  6570. }
  6571. },err => {
  6572. this.$message({
  6573. message: err,
  6574. type: 'error'
  6575. })
  6576. })
  6577. },
  6578. zhoZhi(res, i) {
  6579. var zhi = 0
  6580. for(var i in res) {
  6581. if(i != 'zhoDataTime' && i != 'he') {
  6582. zhi += +res[i]
  6583. }
  6584. }
  6585. res.he = zhi
  6586. },
  6587. zhoBtn(i) {
  6588. // this.zhoData.split(i, 1)
  6589. var arr = this.zhoData
  6590. arr.splice(i, 1)
  6591. },
  6592. zhoAddlast(){
  6593. this.selConShow = true
  6594. },
  6595. closeAddWeeklyReport(){
  6596. this.fillWeekDialogVisi = false
  6597. this.selConShow = true
  6598. this.selProjectList = []
  6599. this.selCon = []
  6600. },
  6601. checkDateWorkTime() {
  6602. //针对苏州景昱,单独的检查逻辑
  6603. if (this.user.companyId == 5978) {
  6604. //调接口,先检查工时是否存在异常
  6605. var zhi = this.zhoData;
  6606. var array = [];
  6607. for(let n in zhi){
  6608. if(zhi[n].he){
  6609. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6610. array.push(workData)
  6611. }
  6612. }
  6613. this.submitingReport = true;
  6614. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6615. res => {
  6616. this.submitingReport = false;
  6617. if (res.code == "ok") {
  6618. this.submitWeekReport(0)
  6619. } else {
  6620. this.$confirm(res.msg, '提示', {
  6621. confirmButtonText: '忽略并提交',
  6622. cancelButtonText: '取消',
  6623. type: 'error'
  6624. }).then(() => {
  6625. this.submitWeekReport(0)
  6626. }).catch(() => {
  6627. });
  6628. }
  6629. },
  6630. error => {
  6631. this.$message({
  6632. message: error,
  6633. type: "error"
  6634. });
  6635. });
  6636. }
  6637. },
  6638. // 提交按周填报
  6639. submitWeekReport(isDraft) {
  6640. var zhi = this.zhoData
  6641. var ll = 0
  6642. if(this.reportTimeType.type == 2) {
  6643. for(var i in zhi) {
  6644. this.dateAr = []
  6645. var alp = []
  6646. var zhis = zhi[i]
  6647. console.log(zhis)
  6648. for(var j in zhis) {
  6649. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6650. let objs = {}
  6651. objs.s = zhis[j].time[0]
  6652. objs.e = zhis[j].time[1]
  6653. objs.p = j
  6654. alp.push(objs)
  6655. }
  6656. }
  6657. console.log(alp)
  6658. this.dateAr = alp
  6659. if (this.reportTimeType.timeCanOverlap == 0) {
  6660. let str = this.$t('message.Filledtimeperiodsoverlap')
  6661. if(this.dateAr.length > 0) {
  6662. const trus = this.fns();
  6663. const overlapDataTime = this.getOverlapData(alp);
  6664. if (overlapDataTime.length > 0) {
  6665. const arrList = overlapDataTime.map((item) => item.p);
  6666. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6667. }
  6668. ll += 1
  6669. if(!trus) {
  6670. this.$message({
  6671. message: str,
  6672. type: 'error'
  6673. })
  6674. return false
  6675. }
  6676. }
  6677. } else {
  6678. if(this.dateAr.length > 0) {
  6679. ll +=1 ;
  6680. }
  6681. }
  6682. }
  6683. if(ll == 0) {
  6684. this.$message({
  6685. message: this.$t('message.Pleasefillinthetime'),
  6686. type: 'error'
  6687. })
  6688. return false
  6689. }
  6690. } else if(this.reportTimeType.type == 1){
  6691. for(var i in zhi) {
  6692. var zhis = zhi[i]
  6693. for(var j in zhis) {
  6694. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6695. ll += 1
  6696. }
  6697. }
  6698. }
  6699. if(ll == 0) {
  6700. this.$message({
  6701. message: this.$t('message.Pleaseselectatime'),
  6702. type: 'error'
  6703. })
  6704. return false
  6705. }
  6706. let overcorp = ''
  6707. for(let n in zhi){
  6708. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6709. overcorp += zhi[n].zhoDataTime + ','
  6710. }
  6711. }
  6712. if(this.user.companyId != 5978 && overcorp != ''){
  6713. overcorp = overcorp.substring(0,overcorp.length - 1)
  6714. this.$message({
  6715. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6716. type: 'error'
  6717. })
  6718. return
  6719. }
  6720. }
  6721. var submits = []
  6722. let formData = new FormData();
  6723. formData.append("draft", isDraft);
  6724. if(this.reportTimeType.multiWorktime == 1){
  6725. for (var i in this.zhoData) {
  6726. var zhoD = this.zhoData[i]
  6727. var flgs = false
  6728. for(var j in zhoD) {
  6729. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6730. flgs = true
  6731. // formData.append("degreeId", "-1");
  6732. formData.append("id", '-1');
  6733. for(var s in this.projectList) {
  6734. if(j == this.projectList[s].projectName) {
  6735. formData.append("projectId", this.projectList[s].id);
  6736. }
  6737. }
  6738. if(this.user.timeType.reportAuditType == 3){
  6739. let audItem = {}
  6740. if(this.user.timeType.auditLevel > 0){
  6741. audItem.auditorFirst = zhoD[j].auditorFirst
  6742. }
  6743. if(this.user.timeType.auditLevel > 1){
  6744. audItem.auditorSec = zhoD[j].auditorSec
  6745. }
  6746. if(this.user.timeType.auditLevel > 2){
  6747. audItem.auditorThird = zhoD[j].auditorThird
  6748. }
  6749. if(zhoD[j].ccUserid){
  6750. audItem.ccUserid = zhoD[j].ccUserid
  6751. }
  6752. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6753. }
  6754. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6755. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6756. formData.append("reportTimeType", this.reportTimeType.type);
  6757. formData.append("endTime", '');
  6758. formData.append("startTime", '');
  6759. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6760. var lix = []
  6761. var objjs = {}
  6762. objjs.startTime = zhoD[j].time[0]
  6763. objjs.endTime = zhoD[j].time[1]
  6764. if (zhoD[j].content == null || zhoD[j].content == '') {
  6765. zhoD[j].content == '-'
  6766. }
  6767. objjs.content = zhoD[j].content
  6768. lix.push(objjs)
  6769. var zhiZhi = JSON.stringify(lix)
  6770. zhiZhi = zhiZhi.replace(/,/g,"@");
  6771. formData.append("content", zhiZhi)
  6772. formData.append("isOvertime", 0)
  6773. formData.append("professionProgress", "[]")
  6774. if (zhoD[j].groupId) {
  6775. formData.append("groupId",zhoD[j].groupId)
  6776. } else {
  6777. //解决后台groupId数组越界的问题
  6778. formData.append("groupId",0)
  6779. }
  6780. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6781. formData.append("createDate",zhoD.zhoDataTime)
  6782. if (zhoD[j].projectAuditorId) {
  6783. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6784. }
  6785. if(zhoD[j].basecostId) {
  6786. formData.append("basecostId", zhoD[j].basecostId);
  6787. } else {
  6788. formData.append("basecostId", 0);
  6789. }
  6790. if(this.user.timeType.customDegreeActive){
  6791. if (this.user.timeType.customDegreeMultiple) {
  6792. if (zhoD[j].multiDegrIdArray) {
  6793. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6794. } else {
  6795. formData.append('multiDegrId','[]')
  6796. }
  6797. } else {
  6798. if (zhoD[j].degreeId) {
  6799. formData.append('degreeId',zhoD[j].degreeId)
  6800. } else {
  6801. formData.append('degreeId','-1')
  6802. }
  6803. }
  6804. }else{
  6805. formData.append("degreeId", "-1");
  6806. }
  6807. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6808. formData.append('customData',zhoD[j].customData)
  6809. }else if(this.user.timeType.customDataActive){
  6810. formData.append('customData',0)
  6811. }
  6812. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6813. formData.append('customText',zhoD[j].customText)
  6814. }else if(this.user.timeType.customTextActive){
  6815. formData.append('customText','-')
  6816. }
  6817. }
  6818. }
  6819. }
  6820. } else {
  6821. for (var i in this.zhoData) {
  6822. var zhoD = this.zhoData[i]
  6823. var flgs = false
  6824. if(this.reportTimeType.type == 2) {
  6825. for(var k in this.selProjectList) {
  6826. var pItem = this.selProjectList[k];
  6827. var pName = pItem.projectName;
  6828. var j = pName;
  6829. console.log('j==周报中的项目='+j);
  6830. if(zhoD[j].time && zhoD[j].time != 'null') {
  6831. flgs = true
  6832. // formData.append("degreeId", "-1");
  6833. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6834. for(var s in this.projectList) {
  6835. if(j == this.projectList[s].projectName) {
  6836. formData.append("projectId", this.projectList[s].id);
  6837. }
  6838. }
  6839. if(this.user.timeType.reportAuditType == 3){
  6840. let audItem = {}
  6841. if(this.user.timeType.auditLevel > 0){
  6842. audItem.auditorFirst = zhoD[j].auditorFirst
  6843. }
  6844. if(this.user.timeType.auditLevel > 1){
  6845. audItem.auditorSec = zhoD[j].auditorSec
  6846. }
  6847. if(this.user.timeType.auditLevel > 2){
  6848. audItem.auditorThird = zhoD[j].auditorThird
  6849. }
  6850. if(zhoD[j].ccUserid){
  6851. audItem.ccUserid = zhoD[j].ccUserid
  6852. }
  6853. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6854. }
  6855. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6856. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6857. formData.append("reportTimeType", this.reportTimeType.type);
  6858. formData.append("endTime", zhoD[j].time[1]);
  6859. formData.append("startTime", zhoD[j].time[0]);
  6860. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6861. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6862. formData.append("isOvertime", 0)
  6863. formData.append("professionProgress", "[]")
  6864. if (zhoD[j].groupId) {
  6865. formData.append("groupId",zhoD[j].groupId)
  6866. } else {
  6867. //解决后台groupId数组越界的问题
  6868. formData.append("groupId",0)
  6869. }
  6870. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6871. formData.append("createDate",zhoD.zhoDataTime)
  6872. if (zhoD[j].projectAuditorId) {
  6873. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6874. }
  6875. if(zhoD[j].basecostId) {
  6876. formData.append("basecostId", zhoD[j].basecostId);
  6877. } else {
  6878. formData.append("basecostId", 0);
  6879. }
  6880. if(this.user.timeType.customDegreeActive){
  6881. if (this.user.timeType.customDegreeMultiple) {
  6882. if (zhoD[j].multiDegrIdArray) {
  6883. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6884. } else {
  6885. formData.append("multiDegrId", "[]");
  6886. }
  6887. } else {
  6888. if (zhoD[j].degreeId) {
  6889. formData.append('degreeId',zhoD[j].degreeId)
  6890. } else {
  6891. formData.append("degreeId", "-1");
  6892. }
  6893. }
  6894. }else{
  6895. formData.append("degreeId", "-1");
  6896. }
  6897. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6898. formData.append('customData',zhoD[j].customData)
  6899. }else if(this.user.timeType.customDataActive){
  6900. formData.append('customData',0)
  6901. }
  6902. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6903. formData.append('customText',zhoD[j].customText)
  6904. }else if(this.user.timeType.customTextActive){
  6905. formData.append('customText','-')
  6906. }
  6907. }
  6908. }
  6909. } else {
  6910. for(var k in this.selProjectList) {
  6911. var pItem = this.selProjectList[k];
  6912. var pName = pItem.projectName;
  6913. var j = pName;
  6914. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6915. flgs = true
  6916. // formData.append("degreeId", "-1");
  6917. console.log('进入了workFpppp==='+j);
  6918. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6919. for(var s in this.projectList) {
  6920. if(j == this.projectList[s].projectName) {
  6921. formData.append("projectId", this.projectList[s].id);
  6922. }
  6923. }
  6924. if(this.user.timeType.reportAuditType == 3){
  6925. let audItem = {}
  6926. if(this.user.timeType.auditLevel > 0){
  6927. audItem.auditorFirst = zhoD[j].auditorFirst
  6928. }
  6929. if(this.user.timeType.auditLevel > 1){
  6930. audItem.auditorSec = zhoD[j].auditorSec
  6931. }
  6932. if(this.user.timeType.auditLevel > 2){
  6933. audItem.auditorThird = zhoD[j].auditorThird
  6934. }
  6935. if(zhoD[j].ccUserid){
  6936. audItem.ccUserid = zhoD[j].ccUserid
  6937. }
  6938. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6939. }
  6940. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6941. // formData.append("subProjectId", zhoD[j].subProjectId);
  6942. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6943. formData.append("reportTimeType", this.reportTimeType.type);
  6944. if(this.reportTimeType.type == 1) {
  6945. formData.append("workingTime", zhoD[j].workingTime);
  6946. } else if(this.reportTimeType.type == 2) {
  6947. formData.append("endTime", zhoD[j].time[1]);
  6948. formData.append("startTime", zhoD[j].time[0]);
  6949. } else if(this.reportTimeType.type == 3) {
  6950. formData.append("progress", zhoD[j].progress);
  6951. formData.append("workingTime", zhoD[j].workingTime);
  6952. }
  6953. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6954. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6955. formData.append("isOvertime", 0)
  6956. formData.append("professionProgress", "[]")
  6957. if (zhoD[j].groupId) {
  6958. formData.append("groupId",zhoD[j].groupId)
  6959. } else {
  6960. //解决后台groupId数组越界的问题
  6961. formData.append("groupId",0)
  6962. }
  6963. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6964. formData.append("createDate",zhoD.zhoDataTime)
  6965. if (zhoD[j].projectAuditorId) {
  6966. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6967. }
  6968. if(zhoD[j].basecostId) {
  6969. formData.append("basecostId", zhoD[j].basecostId);
  6970. } else {
  6971. formData.append("basecostId", 0);
  6972. }
  6973. if(this.user.timeType.customDegreeActive){
  6974. if (this.user.timeType.customDegreeMultiple) {
  6975. if (zhoD[j].multiDegrIdArray) {
  6976. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6977. } else {
  6978. formData.append("multiDegrId", "[]");
  6979. }
  6980. } else {
  6981. if (zhoD[j].degreeId) {
  6982. formData.append('degreeId',zhoD[j].degreeId)
  6983. } else {
  6984. formData.append("degreeId", "-1");
  6985. }
  6986. }
  6987. }else{
  6988. formData.append("degreeId", "-1");
  6989. }
  6990. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6991. formData.append('customData',zhoD[j].customData)
  6992. }else if(this.user.timeType.customDataActive){
  6993. formData.append('customData',0)
  6994. }
  6995. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6996. formData.append('customText',zhoD[j].customText)
  6997. }else if(this.user.timeType.customTextActive){
  6998. formData.append('customText','-')
  6999. }
  7000. }
  7001. }
  7002. }
  7003. }
  7004. }
  7005. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7006. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7007. if(!next) {
  7008. this.$message({
  7009. message: `【${error.join('、')}】请填写任务分组`,
  7010. type: 'error'
  7011. })
  7012. return
  7013. }
  7014. // 自定义维度
  7015. this.submitingReport = true;
  7016. this.http.uploadFile( this.port.report.editPort, formData,
  7017. res => {
  7018. // this.listLoading = false;
  7019. this.submitingReport = false;
  7020. if (res.code == "ok") {
  7021. this.$message({
  7022. message: this.$t('message.fillinsuccessfully'),
  7023. type: "success"
  7024. });
  7025. this.fillWeekDialogVisi = false
  7026. this.selConShow = true
  7027. this.zhoData = []
  7028. this.weekDateRange = ''
  7029. this.getReportList();
  7030. this.getDepartment();
  7031. // 关闭弹窗 并 清空
  7032. this.selProjectList = []
  7033. this.selCon = []
  7034. this.getRecentlyProject()
  7035. } else {
  7036. this.$message({
  7037. message: res.msg,
  7038. type: "error"
  7039. });
  7040. }
  7041. },
  7042. error => {
  7043. this.submitingReport = false;
  7044. this.$message({
  7045. message: error,
  7046. type: "error"
  7047. });
  7048. });
  7049. },
  7050. handleGroupAuditorData(data) {
  7051. const { reportAuditType } = this.user.timeType
  7052. if(reportAuditType != 1 && reportAuditType != 2) {
  7053. return {next: true}
  7054. }
  7055. let arrList = [];
  7056. Object.entries(data).forEach(([key, obj]) => {
  7057. Object.entries(obj).forEach(([projectName, projectData]) => {
  7058. if (projectData.workingTime && !projectData.groupId) {
  7059. arrList.push({
  7060. projectName,
  7061. date: obj.zhoDataTime,
  7062. dateText: obj.zhoDataTimeTxt
  7063. });
  7064. }
  7065. });
  7066. });
  7067. if(arrList.length > 0) {
  7068. return {
  7069. next: false,
  7070. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7071. }
  7072. } else {
  7073. return {
  7074. next: true,
  7075. error: [],
  7076. }
  7077. }
  7078. },
  7079. ChangeHourMinutestr (str) {
  7080. if (str !== "0" && str !== "" && str !== null) {
  7081. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7082. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7083. } else {
  7084. return "";
  7085. }
  7086. },
  7087. // 得到两个日期中间的日期
  7088. getdiffdate(stime,etime){
  7089. //初始化日期列表,数组
  7090. var diffdate = new Array();
  7091. var i=0;
  7092. //开始日期小于等于结束日期,并循环
  7093. while(stime<=etime){
  7094. diffdate[i] = stime;
  7095. //获取开始日期时间戳
  7096. var stime_ts = new Date(stime).getTime();
  7097. //增加一天时间戳后的日期
  7098. var next_date = stime_ts + (24*60*60*1000);
  7099. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7100. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7101. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7102. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7103. stime = next_dates_y+next_dates_m+next_dates_d;
  7104. //增加数组key
  7105. i++;
  7106. }
  7107. return diffdate;
  7108. },
  7109. // 添加模块
  7110. addDomain(i) {
  7111. var leftProgress = 10;
  7112. if (this.reportTimeType.type == 3) {
  7113. //计算已经待分配工时比例
  7114. let array = this.workForm.domains;
  7115. let totalProgress = 0;
  7116. for (var i=0;i<array.length; i++) {
  7117. totalProgress += array[i].progress;
  7118. }
  7119. if (totalProgress < 100) {
  7120. leftProgress = 100 - totalProgress;
  7121. }
  7122. }
  7123. var addItem = {
  7124. projectId: "",
  7125. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7126. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7127. ),
  7128. content: "",
  7129. progress:leftProgress,
  7130. state:2,//2-表示待提交
  7131. multiWorktime: this.reportTimeType.multiWorktime,
  7132. worktimeList:[{}],
  7133. canEdit: true,
  7134. auditorFirst: '',
  7135. auditorSec: '',
  7136. auditorThird: '',
  7137. ccUserid: ''
  7138. // degreeId: '',
  7139. };
  7140. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7141. this.$set(addItem,'isOvertime',true)
  7142. if(this.reportTimeType.type == 3){
  7143. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7144. }
  7145. }
  7146. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7147. //默认给第一个,必填字段
  7148. addItem.basecostId = this.timeBasecostList[0].id;
  7149. }
  7150. this.workForm.domains.push(addItem);
  7151. document.getElementById('workFormsItemBottom').scrollIntoView()
  7152. this.canEdit = true
  7153. if (this.reportTimeType.type == 0) {
  7154. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7155. var length = this.workForm.domains.length;
  7156. if (length == 2) {
  7157. this.showAddMore = false;
  7158. }
  7159. }
  7160. this.chuji()
  7161. this.seleChn()
  7162. },
  7163. // 移除模块
  7164. delDomain(i) {
  7165. this.workForm.domains.splice(i,1)
  7166. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7167. if (!this.originCanEdit) {
  7168. let iscan = false
  7169. for(let i in this.workForm.domains){
  7170. if(this.workForm.domains[i].canEdit){
  7171. iscan = true
  7172. }
  7173. }
  7174. this.canEdit = iscan
  7175. }
  7176. //检测当前剩下的一个,时间类型是否是全天
  7177. if (this.reportTimeType.type == 0) {
  7178. if (this.workForm.domains[0].timeType == 0) {
  7179. this.showAddMore = false;
  7180. } else {
  7181. this.showAddMore = true;
  7182. }
  7183. }
  7184. if(this.user.timeType.multiWorktime == 1) {
  7185. this.iptChangs()
  7186. } else {
  7187. this.seleChn(0)
  7188. }
  7189. },
  7190. // 改变月份
  7191. changeMonth() {
  7192. this.isWeekend = false
  7193. let date = new Date()
  7194. let nowmon = date.getMonth() + 1
  7195. let nowday = date.getDate()
  7196. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7197. if (this.isBatch == 0) {
  7198. if(this.user.timeType.fillAhead == 0){
  7199. let date_a = new Date(this.workForm.createDate)
  7200. if(date_a.getTime() > date.getTime()){
  7201. this.workForm.createDate = nowdate
  7202. }
  7203. }
  7204. //只有按天填报才能获取当天的日报
  7205. if(!this.isSubstitude){
  7206. let weekday = new Date(this.workForm.createDate).getDay()
  7207. if(this.user.companyId == 817){
  7208. if(weekday == 0){
  7209. this.isWeekend = true
  7210. }
  7211. }else{
  7212. if(weekday == 0 || weekday == 6){
  7213. this.isWeekend = true
  7214. }
  7215. }
  7216. this.getReport()
  7217. }
  7218. }else {
  7219. if(this.user.timeType.fillAhead == 0){
  7220. let date_a = new Date(this.workForm.createDate[1])
  7221. if(date_a.getTime() > date.getTime()){
  7222. this.workForm.createDate[1] = nowdate
  7223. let sdate = new Date(this.workForm.createDate[0])
  7224. let edate = new Date(this.workForm.createDate[1])
  7225. if(sdate > edate){
  7226. this.workForm.createDate[0] = this.workForm.createDate[1]
  7227. }
  7228. }
  7229. }
  7230. }
  7231. },
  7232. // 判断时间段
  7233. fns() {
  7234. for (let k in this.dateAr) {
  7235. if (!this.judege(k)) {
  7236. return false
  7237. }
  7238. }
  7239. return true
  7240. },
  7241. judege(idx){
  7242. for (let k in this.dateAr) {
  7243. if (idx !== k) {
  7244. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7245. return false
  7246. }
  7247. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7248. return false
  7249. }
  7250. }
  7251. }
  7252. return true
  7253. },
  7254. getOverlapData(data) {
  7255. let overlapData = [];
  7256. for (let i = 0; i < data.length; i++) {
  7257. for (let j = i + 1; j < data.length; j++) {
  7258. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7259. overlapData.push(data[i], data[j]);
  7260. }
  7261. }
  7262. }
  7263. return overlapData;
  7264. },
  7265. // 保存日报111111
  7266. submitReport(isDraft) {
  7267. this.isDraft = isDraft;
  7268. this.$refs.workForm.validate(valid => {
  7269. if (valid) {
  7270. if (!isDraft) {
  7271. //针对苏州景昱,单独的检查逻辑
  7272. if (this.user.companyId == 5978) {
  7273. //调接口,先检查工时是否存在异常
  7274. var totalTime = 0;
  7275. for (var t=0;t<this.workForm.domains.length; t++) {
  7276. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7277. }
  7278. var array = [];
  7279. if (this.isBatch) {
  7280. var startDate = new Date(this.workForm.createDate[0]);
  7281. var endDate = new Date(this.workForm.createDate[1]);
  7282. if (startDate > endDate) {
  7283. this.$message({
  7284. message: '开始日期不能大于结束日期',
  7285. type: "error"
  7286. });
  7287. return
  7288. } else {
  7289. while(true){
  7290. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7291. array.push(workData);
  7292. startDate.setDate(startDate.getDate() + 1);
  7293. if (startDate > endDate) {
  7294. break;
  7295. }
  7296. }
  7297. }
  7298. } else {
  7299. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7300. array.push(workData)
  7301. }
  7302. this.submitingReport = true;
  7303. var passUserId = this.user.id;
  7304. if (this.isSubstitude) {
  7305. passUserId = this.targetUids;
  7306. }
  7307. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7308. res => {
  7309. this.submitingReport = false;
  7310. if (res.code == "ok") {
  7311. this.submitReportSon()
  7312. } else {
  7313. this.$confirm(res.msg, '提示', {
  7314. confirmButtonText: '忽略并提交',
  7315. cancelButtonText: '取消',
  7316. type: 'error'
  7317. }).then(() => {
  7318. this.submitReportSon()
  7319. }).catch(() => {
  7320. });
  7321. }
  7322. },
  7323. error => {
  7324. this.$message({
  7325. message: error,
  7326. type: "error"
  7327. });
  7328. });
  7329. } else {
  7330. if(this.totalReportHours < this.user.timeType.allday){
  7331. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7332. confirmButtonText: '确定',
  7333. cancelButtonText: '取消',
  7334. type: 'warning'
  7335. }).then(() => {
  7336. this.submitReportSon()
  7337. }).catch(() => {
  7338. });
  7339. }else{
  7340. this.submitReportSon()
  7341. }
  7342. }
  7343. } else {
  7344. //暂存,不需要检查工时是否超过考勤
  7345. this.submitReportSon()
  7346. }
  7347. }
  7348. });
  7349. },
  7350. submitReportSon() {
  7351. this.dateAr = []
  7352. //检查重叠
  7353. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7354. let alp = []
  7355. if(this.user.timeType.multiWorktime != 1) {
  7356. for(var p in this.workForm.domains) {
  7357. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7358. let objs = {}
  7359. objs.s = this.workForm.domains[p].startTime
  7360. objs.e = this.workForm.domains[p].endTime
  7361. alp.push(objs)
  7362. }
  7363. }
  7364. this.dateAr = alp
  7365. if(this.dateAr.length > 0) {
  7366. let trus = this.fns()
  7367. if(!trus) {
  7368. this.$message({
  7369. message: this.$t('message.Filledtimeperiodsoverlap'),
  7370. type: "error"
  7371. });
  7372. return
  7373. }
  7374. }
  7375. } else {
  7376. for(var p in this.workForm.domains) {
  7377. var slll = this.workForm.domains[p]
  7378. for(var o in slll.worktimeList) {
  7379. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7380. let objs = {}
  7381. objs.s = slll.worktimeList[o].startTime
  7382. objs.e = slll.worktimeList[o].endTime
  7383. alp.push(objs)
  7384. }
  7385. }
  7386. }
  7387. this.dateAr = alp
  7388. if(this.dateAr.length > 0) {
  7389. let trus = this.fns()
  7390. if(!trus) {
  7391. this.$message({
  7392. message: this.$t('message.Filledtimeperiodsoverlap'),
  7393. type: "error"
  7394. });
  7395. return
  7396. }
  7397. }
  7398. }
  7399. }
  7400. //检查子项目
  7401. if (this.user.timeType.subProMustFill == 1) {
  7402. for(var p in this.workForm.domains) {
  7403. var oneProItem = this.workForm.domains[p]
  7404. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7405. //没有选择子项目
  7406. this.$message({
  7407. message: '子项目必填,请检查',
  7408. type: "error"
  7409. });
  7410. return
  7411. }
  7412. }
  7413. }
  7414. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7415. if (this.user.companyId == this.yuzhongCompId) {
  7416. for(var p in this.workForm.domains) {
  7417. var oneProItem = this.workForm.domains[p]
  7418. if (!oneProItem.extraField1) {
  7419. this.$message({
  7420. message: '角色必填,请检查',
  7421. type: "error"
  7422. });
  7423. return
  7424. }
  7425. if (!oneProItem.extraField2) {
  7426. this.$message({
  7427. message: '工作职责必填,请检查',
  7428. type: "error"
  7429. });
  7430. return
  7431. }
  7432. if (!oneProItem.extraField3) {
  7433. this.$message({
  7434. message: '工作内容必填,请检查',
  7435. type: "error"
  7436. });
  7437. return
  7438. }
  7439. }
  7440. }
  7441. // return
  7442. //代填的情况,检查人员是否已经选择
  7443. if (this.isSubstitude) {
  7444. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7445. this.$message({
  7446. message: this.$t('message.pleaseselectthepersontofillin'),
  7447. type: "error"
  7448. });
  7449. return;
  7450. }
  7451. }
  7452. //检查时间,全天和上下午不能同时存在
  7453. if (this.reportTimeType.type == 0) {
  7454. var alldayNum = 0;
  7455. var amNum = 0;
  7456. var pmNum = 0;
  7457. for(var i in this.workForm.domains) {
  7458. if (this.workForm.domains[i].timeType == 0) {
  7459. alldayNum ++;
  7460. } else if (this.workForm.domains[i].timeType == 1) {
  7461. amNum++;
  7462. } else if (this.workForm.domains[i].timeType == 2) {
  7463. pmNum++;
  7464. }
  7465. }
  7466. if (alldayNum > 1) {
  7467. this.$message({
  7468. // message: "工作时间-全天,只能选择一次",
  7469. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7470. type: "error"
  7471. });
  7472. return;
  7473. }
  7474. if (amNum > 1) {
  7475. this.$message({
  7476. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7477. type: "error"
  7478. });
  7479. return;
  7480. }
  7481. if (pmNum > 1) {
  7482. this.$message({
  7483. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7484. type: "error"
  7485. });
  7486. return;
  7487. }
  7488. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7489. this.$message({
  7490. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7491. type: "error"
  7492. });
  7493. return;
  7494. }
  7495. } else if (this.reportTimeType.type == 3) {
  7496. //总百分比不能超过100%
  7497. let total = 0;
  7498. this.workForm.domains.forEach(w=>{total += w.progress});
  7499. if (total > 100) {
  7500. this.$message({
  7501. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7502. type: "error"
  7503. });
  7504. return;
  7505. } else if (total < 100) {
  7506. this.$message({
  7507. message: this.$t('message.cannotbesubmitted'),
  7508. type: "error"
  7509. });
  7510. return;
  7511. }
  7512. }
  7513. this.listLoading = true;
  7514. let formData = new FormData();
  7515. formData.append("draft", this.isDraft);
  7516. var totalTime = 0;
  7517. for (var t=0;t<this.workForm.domains.length; t++) {
  7518. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7519. }
  7520. //批量填报不校验考勤时长,交给后台校验
  7521. if (!this.isBatch) {
  7522. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7523. if (this.workForm.time){
  7524. if (this.workForm.time.workHours == 0){
  7525. this.$message({
  7526. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7527. type: 'error'
  7528. })
  7529. return
  7530. }
  7531. }else{
  7532. this.$message({
  7533. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7534. type: 'error'
  7535. })
  7536. return
  7537. }
  7538. }
  7539. }
  7540. //针对凡己和景昱,此处不校验考勤时长
  7541. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7542. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7543. this.$message({
  7544. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7545. type: "error"
  7546. });
  7547. return;
  7548. }
  7549. }
  7550. for(var i in this.workForm.domains) {
  7551. // 检查任务/里程碑是否为必填
  7552. let taskRequired = this.user.timeType.taskRequired
  7553. if(taskRequired == 1) {
  7554. if(!this.workForm.domains[i].taskId) {
  7555. this.$message({
  7556. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7557. type: "error"
  7558. });
  7559. return
  7560. }
  7561. }
  7562. if(this.user.timeType.reportAuditType == 3){
  7563. let audItem = {}
  7564. let auditRule = ''
  7565. if(this.workForm.domains[i].id){
  7566. audItem.reportId = this.workForm.domains[i].id
  7567. }
  7568. if(this.user.timeType.auditLevel > 0){
  7569. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7570. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7571. }
  7572. if(this.user.timeType.auditLevel > 1){
  7573. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7574. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7575. }
  7576. if(this.user.timeType.auditLevel > 2){
  7577. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7578. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7579. }
  7580. if(this.workForm.domains[i].ccUserid){
  7581. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7582. }
  7583. if(auditRule){
  7584. auditRule = auditRule.substring(0,auditRule.length - 1)
  7585. this.$message({
  7586. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7587. type: 'error'
  7588. })
  7589. return
  7590. }
  7591. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7592. }
  7593. if (this.user.timeType.customDegreeActive) {
  7594. if (this.user.timeType.customDegreeMultiple) {
  7595. //多选
  7596. if (this.workForm.domains[i].multiDegrIdArray) {
  7597. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7598. degreeArray = degreeArray.replace(/,/g,"@");
  7599. formData.append("multiDegrId", degreeArray);
  7600. } else {
  7601. formData.append("multiDegrId", '[]');
  7602. }
  7603. } else {
  7604. //单选
  7605. if (this.workForm.domains[i].degreeId) {
  7606. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7607. } else {
  7608. formData.append("degreeId", -1);
  7609. }
  7610. }
  7611. } else {
  7612. formData.append("degreeId", -1);
  7613. }
  7614. if(this.workForm.domains[i].customData) {
  7615. // var sss = this.workForm.domains[i].degreeId.toString()
  7616. formData.append("customData", this.workForm.domains[i].customData);
  7617. } else {
  7618. formData.append("customData", 0);
  7619. }
  7620. if(this.workForm.domains[i].customText) {
  7621. formData.append("customText", this.workForm.domains[i].customText);
  7622. } else {
  7623. formData.append("customText", '-');
  7624. }
  7625. if (this.workForm.domains[i].id) {
  7626. formData.append("id", this.workForm.domains[i].id);
  7627. } else {
  7628. formData.append("id", -1);
  7629. }
  7630. formData.append("projectId", this.workForm.domains[i].projectId);
  7631. if (this.workForm.domains[i].subProjectId) {
  7632. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7633. } else {
  7634. formData.append("subProjectId", 0);
  7635. }
  7636. if (this.workForm.domains[i].groupId) {
  7637. formData.append("groupId", this.workForm.domains[i].groupId);
  7638. } else {
  7639. formData.append("groupId", 0);
  7640. }
  7641. if (this.workForm.domains[i].taskId) {
  7642. formData.append("taskId", this.workForm.domains[i].taskId);
  7643. } else {
  7644. formData.append("taskId", 0);
  7645. }
  7646. if (this.workForm.domains[i].taskFinish == true) {
  7647. formData.append("taskFinish", 1);
  7648. } else {
  7649. formData.append("taskFinish", 0);
  7650. }
  7651. formData.append("reportTimeType", this.reportTimeType.type);
  7652. if (this.reportTimeType.type == 0) {
  7653. formData.append("timeType", this.workForm.domains[i].timeType);
  7654. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7655. formData.append("workingTime", workingTime);
  7656. } else if (this.reportTimeType.type == 1){
  7657. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7658. } else if (this.reportTimeType.type == 2) {
  7659. formData.append("endTime", this.workForm.domains[i].endTime);
  7660. formData.append("startTime", this.workForm.domains[i].startTime);
  7661. } else if (this.reportTimeType.type == 3) {
  7662. //按比例分配
  7663. formData.append("progress", this.workForm.domains[i].progress);
  7664. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7665. }
  7666. if(this.user.timeType.choseFromAlbum == 1 ) {
  7667. console.log(this.workForm.domains[i].imgList)
  7668. if(this.workForm.domains[i].imgList) {
  7669. let imgListFor = this.workForm.domains[i].imgList
  7670. for(var b in imgListFor) {
  7671. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7672. }
  7673. console.log(imgListFor)
  7674. let m = JSON.stringify(imgListFor);
  7675. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7676. formData.append("picStr", m);
  7677. } else {
  7678. formData.append("picStr", '[]');
  7679. }
  7680. }
  7681. //处理多个时间事项
  7682. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7683. if (this.reportTimeType.multiWorktime == 1) {
  7684. //检查时间是否有重叠
  7685. var workList = this.workForm.domains[i].worktimeList;
  7686. for (var j=0;j<workList.length; j++) {
  7687. var curItem = workList[j];
  7688. //检查开始时间是否大于结束时间
  7689. if (curItem.startTime >= curItem.endTime) {
  7690. this.$message({
  7691. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7692. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7693. type: "error"
  7694. });
  7695. return;
  7696. }
  7697. //时间不可重叠
  7698. if (this.reportTimeType.timeCanOverlap == 0) {
  7699. for (var p = j+1;p<workList.length; p++) {
  7700. var jItem = workList[p];
  7701. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7702. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7703. this.$message({
  7704. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7705. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7706. type: "error"
  7707. });
  7708. return;
  7709. }
  7710. }
  7711. }
  7712. }
  7713. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7714. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7715. formData.append("content", m);
  7716. } else {
  7717. if (this.workForm.domains[i].content) {
  7718. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7719. m = m.replace(/,/g,",");
  7720. console.log(m, '需要传值的数据')
  7721. // formData.append("content", this.workForm.domains[i].content);
  7722. formData.append("content", m);
  7723. } else {
  7724. formData.append("content", '-');
  7725. }
  7726. }
  7727. if (this.isBatch == 0) {
  7728. formData.append("createDate", this.workForm.createDate);
  7729. } else {
  7730. //批量填报,时间范围
  7731. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7732. }
  7733. if(this.workForm.domains[i].isOvertime) {
  7734. formData.append("isOvertime", 1);
  7735. } else {
  7736. formData.append("isOvertime", 0);
  7737. }
  7738. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7739. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7740. } else {
  7741. formData.append("overtimeHours", 0);
  7742. }
  7743. if(this.workForm.domains[i].basecostId) {
  7744. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7745. } else {
  7746. formData.append("basecostId", 0);
  7747. }
  7748. if (this.workForm.userId != null) {
  7749. var targetUids = '';
  7750. this.workForm.userId.forEach(u=>{
  7751. targetUids += u + '@';
  7752. });
  7753. if (targetUids.length > 0) {
  7754. targetUids = targetUids.substring(0, targetUids.length -1);
  7755. formData.append("targetUids", targetUids);
  7756. }
  7757. }
  7758. //项目专业进度
  7759. if (this.workForm.domains[i].professionProgress) {
  7760. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7761. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7762. formData.append("professionProgress", m);
  7763. } else {
  7764. formData.append("professionProgress", "[]");
  7765. }
  7766. if (this.workForm.domains[i].stage) {
  7767. formData.append("stage", this.workForm.domains[i].stage);
  7768. } else {
  7769. formData.append("stage", "-");
  7770. }
  7771. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7772. if (this.workForm.domains[i].projectAuditorId) {
  7773. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7774. } else {
  7775. // console.log('执行到了这里')
  7776. // console.log(this.user.timeType.reportAuditType)
  7777. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7778. this.$message({
  7779. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7780. type: "error"
  7781. });
  7782. return;
  7783. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7784. //分组负责人先审核, 确定是选择了任务分组
  7785. if (this.workForm.domains[i].taskGroups.length == 0) {
  7786. this.$message({
  7787. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7788. type: "error"
  7789. });
  7790. } else if (!this.workForm.domains[i].groupId) {
  7791. // console.log(this.workForm.domains[i]);
  7792. this.$message({
  7793. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7794. type: "error"
  7795. });
  7796. } else {
  7797. this.$message({
  7798. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7799. type: "error"
  7800. });
  7801. }
  7802. return;
  7803. }
  7804. }
  7805. if (this.user.companyId == this.yuzhongCompId) {
  7806. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7807. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7808. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7809. }
  7810. //依斯贝的服务Id
  7811. if (this.user.companyId == this.yisibeiCompId) {
  7812. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7813. }
  7814. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  7815. this.$message({
  7816. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  7817. type: "error"
  7818. });
  7819. return
  7820. }
  7821. if(this.user.timeType.userWithMultiDept == 1) {
  7822. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId || '');
  7823. }
  7824. }
  7825. this.submitingReport = true;
  7826. this.http.uploadFile( this.port.report.editPort, formData,
  7827. res => {
  7828. this.listLoading = false;
  7829. this.submitingReport = false;
  7830. if (res.code == "ok") {
  7831. if(res.msg!=null){
  7832. this.$message({
  7833. dangerouslyUseHTMLString: true,
  7834. message: res.msg,
  7835. type: "warning",
  7836. showClose: true,
  7837. duration: 0
  7838. });
  7839. }else{
  7840. this.$message({
  7841. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7842. type: "success"
  7843. });
  7844. }
  7845. this.dialogVisible = false;
  7846. this.jsDay = 0
  7847. this.jsTime = 0
  7848. this.getReportList();
  7849. this.getDepartment();
  7850. this.getRecentlyProject()
  7851. } else {
  7852. this.$message({
  7853. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7854. type: "error"
  7855. });
  7856. }
  7857. },
  7858. error => {
  7859. this.listLoading = false;
  7860. this.submitingReport = false;
  7861. this.$message({
  7862. message: error,
  7863. type: "error"
  7864. });
  7865. });
  7866. },
  7867. // 判断是展示那个工时导入
  7868. imports() {
  7869. if(this.user.timeType.syncCorpwxTime == 0) {
  7870. this.importDialog = true
  7871. } else {
  7872. this.importWxDialog = true
  7873. }
  7874. },
  7875. // 跳转
  7876. junpToDeskTop(id) {
  7877. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7878. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7879. },
  7880. // 通过日报
  7881. approve(id, item) {
  7882. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7883. this.approveinData = {
  7884. id: id,
  7885. date: this.date +day,
  7886. reportIds: item.id
  7887. }
  7888. if(this.user.timeType.needEvaluate == 1){
  7889. this.$set(this.approveinData,'evaluate','')
  7890. this.approveinDialog = true
  7891. }else{
  7892. this.logining = true;
  7893. this.approveinfun()
  7894. }
  7895. },
  7896. approveinfun(){
  7897. this.http.post( this.port.report.approve, this.approveinData,
  7898. res => {
  7899. this.logining = false;
  7900. if (res.code == "ok") {
  7901. this.approveinDialog = false
  7902. this.$message({
  7903. message: this.$t('message.Reviewsucceeded'),
  7904. type: "success"
  7905. });
  7906. this.refreshReportData(this.approveinData.reportIds);
  7907. this.getDepartment();
  7908. } else {
  7909. this.$message({
  7910. message: res.msg,
  7911. type: "error"
  7912. });
  7913. }
  7914. },
  7915. error => {
  7916. this.logining = false;
  7917. this.$message({
  7918. message: error,
  7919. type: "error"
  7920. });
  7921. });
  7922. },
  7923. //撤回日报
  7924. cancel(item,e) {
  7925. // console.log('can can need',item);
  7926. this.logining = true;
  7927. var ids = '';
  7928. var data = e ? item : item.data;
  7929. data.forEach(element => {
  7930. if(element.id){
  7931. ids +=(element.id+',');
  7932. }
  7933. });
  7934. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7935. res => {
  7936. this.logining = false;
  7937. if (res.code == "ok") {
  7938. this.$message({
  7939. message:this.$t('message.Withdrawalsucceeded'),
  7940. type: "success"
  7941. });
  7942. this.getReportList();
  7943. if(e){this.getReport()}
  7944. this.getDepartment();
  7945. } else {
  7946. this.$message({
  7947. message: res.msg,
  7948. type: "error"
  7949. });
  7950. }
  7951. },
  7952. error => {
  7953. this.logining = false;
  7954. this.$message({
  7955. message: error,
  7956. type: "error"
  7957. });
  7958. });
  7959. },
  7960. showDenyDialog(id,i, item) {
  7961. this.denyReasonDialog = true;
  7962. this.isDenying = false;
  7963. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7964. var ids = item.id;
  7965. // var data = item.data;
  7966. // data.forEach(element => {
  7967. // ids +=(element.id+',');
  7968. // });
  7969. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7970. },
  7971. // 未通过日报
  7972. deny() {
  7973. this.logining = true;
  7974. this.isDenying = true;
  7975. this.http.post( this.port.report.deny, this.denyForm,
  7976. res => {
  7977. this.logining = false;
  7978. this.isDenying = false;
  7979. if (res.code == "ok") {
  7980. this.$message({
  7981. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7982. type: "success"
  7983. });
  7984. this.refreshReportData(this.denyForm.reportIds);
  7985. this.getDepartment();
  7986. this.denyReasonDialog = false;
  7987. } else {
  7988. this.$message({
  7989. message: res.msg,
  7990. type: "error"
  7991. });
  7992. }
  7993. },
  7994. error => {
  7995. this.logining = false;
  7996. this.$message({
  7997. message: error,
  7998. type: "error"
  7999. });
  8000. });
  8001. },
  8002. // 查看工时记录弹窗
  8003. toView() {
  8004. this.toViewDialogVisible = true
  8005. this.toViewloading = true
  8006. this.getToView()
  8007. },
  8008. getToView() {
  8009. this.http.post( '/report-import-log/getList', this.toViewForm,
  8010. res => {
  8011. this.toViewloading = false;
  8012. if (res.code == "ok") {
  8013. // console.log(res.data, '数据数据')
  8014. this.toViewList = res.data.records
  8015. this.toViewForm.total = res.data.total
  8016. } else {
  8017. this.toViewloading = false;
  8018. this.$message({
  8019. message: res.msg,
  8020. type: "error"
  8021. });
  8022. }
  8023. })
  8024. },
  8025. // 触发 selectCat 组件更改他的值
  8026. selectCatCli(obj) {
  8027. // console.log(obj, '看看')
  8028. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8029. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8030. },
  8031. vueCasader(obj) {
  8032. console.log(obj, '看看值')
  8033. if(obj.distinction == 1 && obj.item) {
  8034. let arr = []
  8035. arr.push(obj.item.value)
  8036. this.exportParam.departmentId = arr
  8037. }
  8038. if(obj.distinction == '10' && obj) {
  8039. const { id, other } = obj
  8040. this.workForm.domains[other].reportTargetDeptId = id
  8041. }
  8042. },
  8043. //分页
  8044. handleCurrentChange(val) {
  8045. this.toViewForm.pageIndex = val;
  8046. this.getToView();
  8047. },
  8048. handleSizeChange(val) {
  8049. this.toViewForm.pageSize = val;
  8050. this.getToView();
  8051. },
  8052. getAllUsersList(){
  8053. this.http.post('/user/getSimpleActiveUserList',{
  8054. },res => {
  8055. if(res.code == 'ok'){
  8056. this.allUsersList = res.data
  8057. }else{
  8058. this.$message({
  8059. message: res.msg,
  8060. type: 'error'
  8061. })
  8062. }
  8063. },err => {
  8064. this.$message({
  8065. message: err,
  8066. type: 'error'
  8067. })
  8068. })
  8069. },
  8070. //景昱变更提醒
  8071. changeReminder(item){
  8072. console.log("============",item)
  8073. let parameter={}
  8074. if(item){
  8075. parameter={
  8076. createDate:item.createDate,
  8077. userId:item.userId,
  8078. }
  8079. }
  8080. this.http.post('/report/changeReminder',parameter,res => {
  8081. if(res.code == 'ok'){
  8082. this.$message({
  8083. message: res.msg,
  8084. type: 'success'
  8085. })
  8086. }else{
  8087. this.$message({
  8088. message: res.msg,
  8089. type: 'error'
  8090. })
  8091. }
  8092. },err => {
  8093. this.$message({
  8094. message: err,
  8095. type: 'error'
  8096. })
  8097. })
  8098. },
  8099. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8100. fillWeekCustomClne() {
  8101. this.fillWeekDialogVisiCustom = false
  8102. },
  8103. fillWeekCustomSubmit() {
  8104. this.getReportList();
  8105. this.getDepartment();
  8106. this.getRecentlyProject()
  8107. },
  8108. // 待填日报姓名搜索
  8109. nameAearchSeek(flg) {
  8110. if(!this.nameAearch) {
  8111. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8112. return
  8113. }
  8114. if(flg) {
  8115. this.enterpriseWechatgetUser()
  8116. }
  8117. },
  8118. handleThreeData(userList) {
  8119. console.log(userList, '人员数据')
  8120. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8121. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8122. },
  8123. // 过滤树节点
  8124. filterTreeNodes(treeData, filterKeywords) {
  8125. return treeData.filter((node) => {
  8126. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8127. if (node.children && node.children.length > 0) {
  8128. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8129. }
  8130. return true;
  8131. }
  8132. if (node.children && node.children.length > 0) {
  8133. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8134. return node.children.length > 0;
  8135. }
  8136. return false;
  8137. });
  8138. },
  8139. // 企业微信获取人员
  8140. enterpriseWechatgetUser() {
  8141. this.deptMembDataLoading = true
  8142. this.http.post('/user/getEmployeeList',{
  8143. departmentId: -1,
  8144. pageIndex: 1,
  8145. pageSize: 100,
  8146. keyword: this.nameAearch,
  8147. status: '',
  8148. roleId: '',
  8149. cursor: '',
  8150. onlyDirect: '',
  8151. matchingType: ''
  8152. },res => {
  8153. if(res.code == 'ok'){
  8154. this.deptMembDataLoading = false
  8155. const userListName = res.data.records.map(item => item.name)
  8156. this.handleThreeData(userListName)
  8157. }else{
  8158. this.deptMembDataLoading = false
  8159. this.$message({
  8160. message: res.msg,
  8161. type: 'error'
  8162. })
  8163. }
  8164. },err => {
  8165. this.deptMembDataLoading = false
  8166. this.$message({
  8167. message: err,
  8168. type: 'error'
  8169. })
  8170. })
  8171. },
  8172. // 按周填报获取相关任务
  8173. async getWeeklyTaskList(item) {
  8174. console.log(item, '<=== 数据')
  8175. const { projectId, groupId, stage, taskId } = item
  8176. console.log(projectId, groupId, stage)
  8177. let parms = { projectId, isSubstitude: 0 }
  8178. groupId ? parms.groupId = groupId : ''
  8179. stage ? parms.stage = stage : ''
  8180. const { data } = await this.postData('/task/getRecentTask', parms)
  8181. this.zhoBao.taskId = taskId
  8182. this.$set(this.zhoBao, 'taskList', data)
  8183. console.log(this.zhoBao)
  8184. },
  8185. // 封装 post 请求
  8186. postData(url, params) {
  8187. return new Promise((resolve, reject) => {
  8188. this.http.post(url, { ...params },
  8189. res => {
  8190. resolve(res)
  8191. },
  8192. error => {
  8193. this.$message({
  8194. message: error,
  8195. type: "error"
  8196. });
  8197. reject(error)
  8198. })
  8199. })
  8200. },
  8201. // 自定义事件
  8202. selectCal(obj) {
  8203. console.log(obj, '传数据来源')
  8204. if(obj.distinction == '1') {
  8205. this.zhoBao.projectAuditorId = obj.id
  8206. } else if(obj.distinction == '2') {
  8207. this.zhoBao.auditorFirst = obj.id
  8208. } else if(obj.distinction == '3') {
  8209. this.zhoBao.auditorSec = obj.id
  8210. } else if(obj.distinction == '4') {
  8211. this.zhoBao.auditorThird = obj.id
  8212. } else if(obj.distinction == '5') {
  8213. this.zhoBao.ccUserid = obj.id
  8214. } else if(obj.distinction == '12') {
  8215. this.usersListId = obj.id
  8216. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8217. this.searchKeyword = obj.name
  8218. } else {
  8219. this.searchKeyword = ''
  8220. }
  8221. this.searchScreen(0)
  8222. } else if(obj.distinction == '13') {
  8223. this.usersListId = obj.id
  8224. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8225. this.searchKeyword = obj.name
  8226. } else {
  8227. this.searchKeyword = ''
  8228. }
  8229. this.searchScreen(1)
  8230. }
  8231. }
  8232. },
  8233. created() {
  8234. this.getUsers()
  8235. let height = window.innerHeight;
  8236. this.tableHeight = height - 178;
  8237. const that = this;
  8238. window.onresize = function temp() {
  8239. that.tableHeight = window.innerHeight - 178;
  8240. };
  8241. this.toViewForm.companyId = this.user.companyId
  8242. this.initDrag([{
  8243. type: "LR",
  8244. domClass: {
  8245. // 中间分割线的名字
  8246. resize: "line-line",
  8247. // 左侧盒子的名字
  8248. left: "box-left",
  8249. // 右侧盒子的名字
  8250. right: "box-right",
  8251. // 父级的名字
  8252. box: "box-father",
  8253. },
  8254. otherInfo: {
  8255. // 限制左边栏最低宽度
  8256. leftWidth: 120,
  8257. },
  8258. },
  8259. {
  8260. type: "LR",
  8261. domClass: {
  8262. // 中间分割线的名字
  8263. resize: "line-second",
  8264. // 左侧盒子的名字
  8265. left: "left-laowang",
  8266. // 右侧盒子的名字
  8267. right: "box-second-father",
  8268. // 父级的名字
  8269. box: "grand",
  8270. },
  8271. otherInfo: {
  8272. // 限制左边栏最低宽度
  8273. leftWidth: 120,
  8274. },
  8275. },
  8276. ]);
  8277. }
  8278. };
  8279. </script>
  8280. <style lang="scss" scoped>
  8281. .fillWeekDialogVisiCustom {
  8282. width: 100%;
  8283. height: 70vh;
  8284. }
  8285. .fillWeekCustom {
  8286. .el-dialog__body {
  8287. padding: 20px 20px !important;
  8288. }
  8289. }
  8290. .photos {
  8291. position: relative;
  8292. display: flex;
  8293. flex-wrap: wrap;
  8294. }
  8295. .photos_img {
  8296. width: 120px;
  8297. height: 120px;
  8298. margin-right: 20px;
  8299. margin-bottom: 20px;
  8300. cursor: pointer;
  8301. img {
  8302. width: 100%;
  8303. height: 100%;
  8304. }
  8305. }
  8306. .paginatis {
  8307. padding: 10px 10px;
  8308. background: #f2f2f2;
  8309. }
  8310. .waiting {
  8311. color:orange;
  8312. }
  8313. .filledReportStyle {
  8314. color:#32CD32;
  8315. }
  8316. .RejectStyle {
  8317. color:red;
  8318. }
  8319. .waitSubmitStyle{
  8320. color: #409eff;
  8321. }
  8322. .chooseDate {
  8323. .waiting {
  8324. color: #20a0ff;
  8325. }
  8326. .filledReportStyle {
  8327. color:#20a0ff;
  8328. }
  8329. .RejectStyle {
  8330. color: #20a0ff;
  8331. }
  8332. .waitSubmitStyle{
  8333. color: #20a0ff;
  8334. }
  8335. }
  8336. .allDaily {
  8337. width:100%;
  8338. }
  8339. .report_title {
  8340. padding:10px 0;
  8341. color:#666;
  8342. }
  8343. .clearfix {
  8344. overflow-x: auto;
  8345. white-space: nowrap;
  8346. padding: 15px 0 10px 0;
  8347. // overflow-y: hidden;
  8348. .date_item {
  8349. padding: 0 3px;
  8350. cursor: pointer;
  8351. position: relative;
  8352. }
  8353. .chooseDate {
  8354. position: absolute;
  8355. bottom: -3px;
  8356. width: 37px;
  8357. height: 2px;
  8358. left: 14px;
  8359. background: #20a0ff;
  8360. }
  8361. }
  8362. .one_daily {
  8363. i {
  8364. color: #9ed0ff;
  8365. margin-right: 5px;
  8366. }
  8367. .one_daily_body {
  8368. padding: 10px 0px;
  8369. p {
  8370. margin: 0;
  8371. line-height: 30px;
  8372. }
  8373. }
  8374. ul {
  8375. padding: 0;
  8376. }
  8377. }
  8378. .checkbtn {
  8379. float: right;
  8380. margin-top: -10px;
  8381. }
  8382. .selConStyle{
  8383. margin-top:9rem;
  8384. margin-bottom:11rem;
  8385. .selConStyle_title{
  8386. height: 3rem;
  8387. text-align: center;
  8388. font-size: 17px;
  8389. }
  8390. .el-select{
  8391. margin: 0 15%;
  8392. width: 70%;
  8393. }
  8394. }
  8395. </style>
  8396. <style lang="scss">
  8397. /*去除upload组件过渡效果*/
  8398. .photos .el-upload-list__item {
  8399. transition: none !important;
  8400. }
  8401. .daily {
  8402. .el-card__body {
  8403. height: 80%;
  8404. overflow-y: auto;
  8405. }
  8406. .el-card__header {
  8407. padding: 0 20px;
  8408. }
  8409. }
  8410. .membListClass{
  8411. .el-dialog__body{
  8412. padding-top: 10px;
  8413. }
  8414. }
  8415. // .editReportDialog .el-dialog__footer{
  8416. // position: sticky;
  8417. // bottom: 0;
  8418. // background: #fff;
  8419. // height: 70px;
  8420. // z-index: 1010;
  8421. // }
  8422. .editReportDialog{
  8423. min-width: 800px;
  8424. }
  8425. .touruxiangmu{
  8426. max-width: 1000px;
  8427. }
  8428. </style>
  8429. <style scoped>
  8430. /* 项目标签的样式 */
  8431. .el-tag + .el-tag {
  8432. margin-left: 10px;
  8433. }
  8434. .button-new-tag {
  8435. margin-left: 10px;
  8436. height: 32px;
  8437. line-height: 30px;
  8438. padding-top: 0;
  8439. padding-bottom: 0;
  8440. }
  8441. .input-new-tag {
  8442. width: 90px;
  8443. margin-left: 10px;
  8444. vertical-align: bottom;
  8445. }
  8446. .selectworktime .el-table__fixed-body-wrapper{
  8447. top: 48px !important;
  8448. }
  8449. .selectworktime_export .selectworktime_export_l{
  8450. width: 650px;
  8451. float: left;
  8452. height: 42px;
  8453. }
  8454. .approvalProcessBox{
  8455. margin-left: 30px;
  8456. font-size: 14px;
  8457. line-height: 16px;
  8458. cursor: pointer;
  8459. }
  8460. .approvalProcessBox i {
  8461. margin-right: 0;
  8462. height: 16px;
  8463. width: 16px;
  8464. display: inline-block;
  8465. transform: scale(1.2);
  8466. position: relative;
  8467. top: 0.5px;
  8468. color: #409eff;
  8469. }
  8470. .approvalProcessBox .approvalProcessClick{
  8471. cursor: pointer;
  8472. color: #409eff;
  8473. font-size: 14px;
  8474. }
  8475. .approvalProcessBox:hover .approvalProcessClick{
  8476. color: #3485fb;
  8477. }
  8478. </style>
  8479. <style lang="scss" scoped>
  8480. // 加班样式
  8481. .overtime {
  8482. display: inline-block;
  8483. margin-left: 20px;
  8484. input {
  8485. display: inline-block;
  8486. margin-top: 5px;
  8487. }
  8488. }
  8489. .plus {
  8490. display: inline-block;
  8491. }
  8492. // .tages {
  8493. // float: right;
  8494. // }
  8495. .overtime {
  8496. display: inline-block;
  8497. margin-left: 30px;
  8498. }
  8499. .bloks {
  8500. display: inline-block;
  8501. width: 380px;
  8502. }
  8503. .zhiss {
  8504. display: flex;
  8505. justify-content: space-around;
  8506. align-items: center;
  8507. }
  8508. .zhoFel {
  8509. display: flex;
  8510. justify-content: space-between;
  8511. align-items: center;
  8512. }
  8513. // 左右滑动样式
  8514. .line {
  8515. width: 30px;
  8516. /* height: 500px; */
  8517. background: #f2f2f2;
  8518. cursor: w-resize;
  8519. }
  8520. .box-father {
  8521. border: 8px solid #000;
  8522. }
  8523. .line-second {
  8524. width: 10px;
  8525. /* background: red; */
  8526. }
  8527. .flex {
  8528. display: flex;
  8529. width: 100%;
  8530. }
  8531. .box-left {
  8532. flex: 0 0 400px;
  8533. /* height: 600px; */
  8534. /* background: blue; */
  8535. }
  8536. .box-right {
  8537. /* height: 600px; */
  8538. /* background: green; */
  8539. flex: 1;
  8540. }
  8541. .box-postion {
  8542. width: 200px;
  8543. /* height: 400px; */
  8544. background: #ccc;
  8545. }
  8546. .custom-tree-node {
  8547. flex: 1;
  8548. display: flex;
  8549. align-items: center;
  8550. justify-content: space-between;
  8551. font-size: 14px;
  8552. padding-right: 8px;
  8553. }
  8554. .daitianrbao {
  8555. width: 100%;
  8556. box-sizing: border-box;
  8557. height: 40px;
  8558. border-radius: 4px;
  8559. border: 1px solid #DCDFE6;
  8560. overflow: hidden;
  8561. text-overflow: ellipsis;
  8562. display: flex;
  8563. // align-items: center;
  8564. }
  8565. .daitianrbao .spnn {
  8566. display: inline-block;
  8567. box-sizing: border-box;
  8568. padding: 0 15px;
  8569. overflow: hidden;
  8570. text-overflow: ellipsis;
  8571. }
  8572. .daitianrbao .hover {
  8573. color: #DCDFE6 !important;
  8574. }
  8575. </style>