daily.vue 486 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223
  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;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <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">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <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'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{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)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <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">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <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')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <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')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. 未填
  126. <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')}}
  127. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <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>
  133. <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>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  136. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  137. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  138. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  139. <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>
  140. <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>
  141. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  142. <!--部门负责人给个导出工时的功能 -->
  143. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  144. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  146. <el-link type="primary" v-if="user.roleName == '超级管理员' && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">日报审核修改</el-link>
  147. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  148. </span>
  149. </div>
  150. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  151. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  152. <i class="fa fa-circle"></i>
  153. <!-- {{item1.name}} -->
  154. <span v-if="user.userNameNeedTranslate == '1'">
  155. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  156. </span>
  157. <span v-if="user.userNameNeedTranslate != '1'">
  158. {{item1.name}}
  159. </span>
  160. <span style="margin-left:30px;">
  161. <span style="margin-right:20px;">
  162. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  163. <!-- 工作总时长: -->
  164. {{$t('other.totalWorkingHours')}}
  165. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  166. <span >{{item1.reportTime | amounts}}</span>h
  167. </span>
  168. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  169. <i class="iconfont firerock-iconliucheng1"></i>
  170. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  171. <!-- 审批流程 -->
  172. {{$t('other.approvalProcess')}}
  173. </span>
  174. </span>
  175. </span>
  176. <div class="checkbtn" style="padding-right:20px;">
  177. <!--编辑和删除日报-->
  178. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill == 1" type="primary" size="small" @click="isSubstitude=false;fillInReportCustom()">{{$t('btn.editWorkReport')}}</el-button>
  179. <el-button v-if="item1.state >= 2 && user.id == item1.id && user.timeType.enableNewWeeklyfill != 1" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  180. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  181. </div>
  182. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  183. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  184. </div>
  185. <div class="one_daily_body">
  186. <el-timeline>
  187. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  188. <el-card shadow="never">
  189. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  190. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  191. <span v-if="user.company.packageEngineering == 0">
  192. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  193. <span v-if="user.timeType.reportAuditType == 7" >
  194. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  195. <span v-if="item2.deptAuditorName">、</span>
  196. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  197. </span>
  198. <span v-else>
  199. <span v-if="item2.isDeptAudit==0">
  200. <span v-if="item2.projectAuditState==0">
  201. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  202. <span v-if="item2.projectAuditorName != null">(
  203. <!-- {{item2.projectAuditorName}} -->
  204. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  205. )</span>
  206. <!-- 审核 --> {{$t('other.audit')}}
  207. </span>
  208. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  209. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  210. <span v-if="item2.projectAuditorName != null">(
  211. <!-- {{item2.projectAuditorName}} -->
  212. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  213. )</span>
  214. <!-- 审核通过 --> {{$t('state.approved')}}
  215. </span>
  216. </span>
  217. <span v-else-if="item2.isDeptAudit==1">
  218. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  219. ({{$t('other.await')}}
  220. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  221. {{$t('other.audit')}})
  222. </span>
  223. </span>
  224. ]</span>
  225. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  226. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  227. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  228. </span>
  229. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  230. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  231. </span>
  232. <!-- <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> -->
  233. <span v-if="user.company.packageEngineering == 1">
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  238. (
  239. <!-- <span v-if="user.userNameNeedTranslate != 1">
  240. {{item2.projectAuditorName}}
  241. </span>
  242. <span v-if="user.userNameNeedTranslate == 1">
  243. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  244. </span> -->
  245. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  246. )
  247. </span>{{$t('other.audit')}} ]</span>
  248. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  249. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  250. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  251. </span>
  252. <!--每个项目上单独审核 -->
  253. <span style="float:right;">
  254. <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>
  255. <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"
  256. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  257. <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"
  258. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  259. <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"
  260. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  261. <!--自己可以撤回待审核状态的报告 -->
  262. <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>
  263. </span>
  264. </p>
  265. <p v-if="user.companyId == yuzhongCompId">
  266. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  267. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  268. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  269. <!--任务分组和阶段 -->
  270. <p v-if="item2.groupId != 0">
  271. {{$t('other.taskGroup')}}:{{item2.groupName}}
  272. <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>
  273. </p>
  274. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  275. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  276. <!-- 自定义日报文本 -->
  277. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  278. <p v-if="user.company.packageEngineering == 1">
  279. {{$t('other.professionalProgress')}}:
  280. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  281. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  282. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhetongguo"></i>
  286. </el-tooltip>
  287. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  288. <i class="iconfont firerock-iconshenhebohui"></i>
  289. </el-tooltip>
  290. </span>
  291. </p>
  292. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  293. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  294. </p>
  295. <div v-if="item2.multiWorktime==0">
  296. <p style="display: inline-block;">{{$t('time.duration')}}:
  297. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  298. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  299. {{item2.time.toFixed(1)}}h
  300. <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>
  301. </p>
  302. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  303. </div>
  304. <div v-if="item2.multiWorktime==1" >
  305. <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>
  306. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  307. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  308. <p style="display: inline-block;">{{$t('time.duration')}}:
  309. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  310. {{timeItem.time.toFixed(1)}}h
  311. </p>
  312. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  313. </div>
  314. </div>
  315. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  316. <!--照片的显示 -->
  317. <p v-if="item2.pics != null && item2.pics.length > 0">
  318. <el-image v-for="(pic, index) in item2.pics" :key="index"
  319. style="width: 100px; height: 100px; margin-right:10px;"
  320. :src="pic"
  321. :preview-src-list="item2.pics">
  322. </el-image>
  323. </p>
  324. </el-card>
  325. </el-timeline-item>
  326. </el-timeline>
  327. </div>
  328. </div>
  329. <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>
  330. <!-- 简陋的无报告提示 -->
  331. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </el-card>
  338. </div>
  339. <!-- 工时推送日志弹窗 -->
  340. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  341. <template>
  342. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  343. </template>
  344. <template>
  345. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  346. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  347. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  348. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  349. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  350. <el-table-column prop="result" label="推送结果" width="250">
  351. <template slot-scope="scope">
  352. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  353. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  357. </el-table>
  358. </template>
  359. <span slot="footer" class="dialog-footer">
  360. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  361. </span>
  362. </el-dialog>
  363. <!-- 填写日报的dialog -->
  364. <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">
  365. <div style="height: 65vh;overflow: auto;">
  366. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  367. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  368. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  369. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  370. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  371. <span class="spnn" v-if="workForm.userNames">
  372. <span v-for="(item, index) in workForm.userNames" :key="index">
  373. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  374. <span v-if="index < workForm.userNames.length - 1">,</span>
  375. </span>
  376. </span>
  377. <span class="spnn hover" v-else>
  378. {{$t('defaultText.pleaseSelectAsubstitute')}}
  379. </span>
  380. </div>
  381. </el-form-item>
  382. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  383. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  384. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  385. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  386. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  387. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  388. <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>
  389. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  390. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  391. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  392. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  393. <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>
  394. <!-- AI智能填报 -->
  395. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  396. </el-form-item>
  397. <!--考勤时长显示-->
  398. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  399. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  400. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  401. </span>
  402. <!--批量填报和批量代填不显示考勤记录-->
  403. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  404. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  405. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  406. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  407. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  408. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  409. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  410. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  411. @click="refreshAttendance(workForm.createDate)"></el-button>
  412. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  413. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  414. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  415. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  416. </el-form-item>
  417. <!-- 000000 -->
  418. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  419. <div v-if="reportTimeType.multiWorktime==0">
  420. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  421. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  422. <el-select v-model="domain.timeType" style="width:200px;"
  423. v-if="reportTimeType.type == 0"
  424. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  426. @change="onTimeTypeChange(domain.timeType)">
  427. <el-option
  428. v-for="item in timeType"
  429. :key="item.value"
  430. :label="item.label"
  431. :value="item.value">
  432. </el-option>
  433. </el-select>
  434. <!-- 数字时长选择 -->
  435. <el-select v-model="domain.workingTime" style="width:200px;"
  436. v-if="reportTimeType.type == 1"
  437. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  438. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  439. @change="seleChn(0,domain)">
  440. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  441. </el-select>
  442. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  443. <span v-if="reportTimeType.type == 2">
  444. <!--时间范围选择 -->
  445. <el-time-picker
  446. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  447. v-model="domain.startTime"
  448. :placeholder="$t('time.startTime')"
  449. style="width:120px;"
  450. format="HH:mm"
  451. value-format="HH:mm"
  452. :picker-options="{
  453. start: '08:00',
  454. end: '23:30'
  455. }"
  456. @change="iptChang()">
  457. </el-time-picker> - <el-time-picker
  458. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  459. v-model="domain.endTime"
  460. :placeholder="$t('time.endTime')"
  461. style="width:120px;"
  462. format="HH:mm"
  463. value-format="HH:mm"
  464. :picker-options="{
  465. start: '08:00',
  466. end: '23:30',
  467. minTime: domain.startTime
  468. }"
  469. @change="iptChang()">
  470. </el-time-picker>
  471. </span>
  472. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  473. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  474. <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>
  475. </div>
  476. </el-form-item>
  477. <el-form-item label="填报部门" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  478. :prop="'domains.' + index + '.reportTargetDeptId'"
  479. :rules="{ required: true, message: '请选择部门', trigger: ['change','blur'] }">
  480. <el-select v-model="domain.reportTargetDeptId" :placeholder="'请选择部门'" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  481. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  482. <span style="float: left">
  483. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  484. </span>
  485. </el-option>
  486. </el-select>
  487. <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>
  488. </el-form-item>
  489. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  490. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  491. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  492. @change="selectProject(domain, index)"
  493. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  494. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  495. <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">
  496. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  497. <span style="float: right;">{{ item.projectName }}</span>
  498. </el-option>
  499. </el-option-group>
  500. </el-select>
  501. <!--昱众不显示子项目-->
  502. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  503. <span style="margin-left:45px;">
  504. {{$t('lable.subproject')}}</span>
  505. <!--子项目 -->
  506. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  507. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  508. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  509. </el-select>
  510. </template>
  511. <template v-if="user.companyId == yuzhongCompId">
  512. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  513. <!--角色选择 -->
  514. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  515. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  516. <el-option
  517. v-for="item in roleList"
  518. :key="item.value"
  519. :label="item.label"
  520. :value="item.value">
  521. </el-option>
  522. </el-select>
  523. </template>
  524. <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%;"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  526. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  527. </el-link>
  528. <!-- <el-link type="primary" v-if="canEdit"
  529. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  530. </el-form-item>
  531. <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">
  532. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  533. </el-form-item>
  534. <!--如果设置了工时成本预警的预算成本项-->
  535. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  536. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  537. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  538. </el-select>
  539. </el-form-item>
  540. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  541. <template slot="label">
  542. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2">*</span>
  543. <span >{{$t('lable.taskGrouping')}}</span>
  544. </template>
  545. <!-- 任务分组 -->
  546. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  547. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  548. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  549. </el-select>
  550. <template v-if="user.companyId == yuzhongCompId">
  551. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  552. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  553. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  554. <el-option
  555. v-for="item in domain.filteredRespList"
  556. :key="item.id"
  557. :label="item.jobRespon"
  558. :value="item.id">
  559. </el-option>
  560. </el-select>
  561. </template>
  562. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  563. <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>
  564. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  565. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  566. @change="changeStages(domain, index)"
  567. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  568. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  569. </el-select>
  570. </template>
  571. </el-form-item>
  572. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  573. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  574. <template slot="label">
  575. <span style="color:#FF0000;">*</span>
  576. <span >{{$t('other.projectAuditor')}}</span>
  577. </template>
  578. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  579. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  580. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  581. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  582. </el-option>
  583. </el-select>
  584. <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>
  585. </el-form-item>
  586. </div>
  587. <el-form-item v-if="user.companyId == yuzhongCompId">
  588. <template slot="label">
  589. <span style="color:#FF0000;">*</span>
  590. <span >工作内容</span>
  591. </template>
  592. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  593. :disabled="(workForm.domains[index].state>=2?false:true)" >
  594. <el-option
  595. v-for="item in domain.workContentList"
  596. :key="item.id"
  597. :label="item.workContext"
  598. :value="item.id">
  599. </el-option>
  600. </el-select>
  601. </el-form-item>
  602. <!-- 111111 -->
  603. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  604. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  605. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  606. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  607. <span v-else>{{item.name}}</span>
  608. </el-option>
  609. </el-select>
  610. <template v-if="user.timeType.auditLevel > 1">
  611. <i class="el-icon-right"></i>
  612. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  613. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  614. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  615. <span v-else>{{item.name}}</span>
  616. </el-option>
  617. </el-select>
  618. </template>
  619. <template v-if="user.timeType.auditLevel > 2">
  620. <i class="el-icon-right"></i>
  621. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  622. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  623. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  624. <span v-else>{{item.name}}</span>
  625. </el-option>
  626. </el-select>
  627. </template>
  628. </el-form-item>
  629. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  630. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  631. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  632. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  633. <span v-else>{{item.name}}</span>
  634. </el-option>
  635. </el-select>
  636. </el-form-item>
  637. <!-- 相关维度/自定义维度 -->
  638. <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'">
  639. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  640. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  641. </el-option>
  642. </el-select>
  643. </el-form-item>
  644. <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'">
  645. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  646. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  647. </el-option>
  648. </el-select>
  649. </el-form-item>
  650. <!-- 相关数值 -->
  651. <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">
  652. <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>
  653. </el-form-item>
  654. <!-- 自定义文本 -->
  655. <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">
  656. <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>
  657. </el-form-item>
  658. <!--按比例填报-->
  659. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  660. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  661. <div style="width:400px;">
  662. <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>
  663. <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>
  664. </div>
  665. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  666. <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>
  667. </div>
  668. </el-form-item>
  669. <!--工程专业版本模式下, 各个专业的进度填报 -->
  670. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  671. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  672. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  673. <el-input size="mini" style="width:60px;" v-model="item.progress"
  674. @keyup.native="onProgressChange"
  675. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  676. </span>
  677. </el-form-item>
  678. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  679. <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))" >
  680. <template slot="label" v-if="user.timeType.taskRequired == 1">
  681. <span style="color:#FF0000;">*</span>
  682. <span >任务</span>
  683. </template>
  684. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  685. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  686. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  687. </el-select>
  688. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  689. </el-form-item>
  690. <!--针对依斯贝的SAP服务-->
  691. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  692. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  693. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  694. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  695. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  696. </el-select>
  697. </el-form-item>
  698. <!--工作事项-->
  699. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  700. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  701. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  702. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  703. </el-form-item>
  704. <!-- 拍照上传 -->
  705. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  706. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  707. <div class="photos">
  708. <div>
  709. <el-upload
  710. list-type="picture-card"
  711. :http-request="(file) => {return addImg(file, index)}"
  712. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  713. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  714. :file-list="domain.imgListUrl" :limit="9"
  715. :disabled="workForm.domains[index].state>=2?false:true">
  716. <i class="el-icon-plus"></i>
  717. </el-upload>
  718. </div>
  719. </div>
  720. </el-form-item>
  721. </div>
  722. <!--多个工作事项填报的情况 -->
  723. <div v-if="reportTimeType.multiWorktime==1">
  724. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  725. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  726. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  727. @change="selectProject(domain, index)"
  728. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  729. <!-- <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">
  730. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  731. <span style="float: right;">{{ item.projectName }}</span>
  732. </el-option> -->
  733. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  734. <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">
  735. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  736. <span style="float: right;">{{ item.projectName }}</span>
  737. </el-option>
  738. </el-option-group>
  739. </el-select>
  740. <template v-if="user.timeType.mainProjectState != 1">
  741. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  742. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  743. <!--子项目 -->
  744. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  745. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  746. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  747. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  748. </el-select>
  749. </template>
  750. <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;"
  751. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  752. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  753. </el-link>
  754. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  755. <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>
  756. </div>
  757. <!-- <el-link type="primary" v-if="canEdit"
  758. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  759. </el-form-item>
  760. <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">
  761. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  762. </el-form-item>
  763. <!--如果设置了工时成本预警的预算成本项-->
  764. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  765. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  766. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  767. </el-select>
  768. </el-form-item>
  769. <el-form-item v-if="user.company.packageProject == 1">
  770. <template slot="label">
  771. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  772. <span >{{$t('lable.taskGrouping')}}</span>
  773. </template>
  774. <!-- 任务分组 -->
  775. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  776. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  777. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  778. </el-select>
  779. <!-- 项目的阶段 -->
  780. <span v-if="domain.stages != null && domain.stages.length> 0"
  781. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  782. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  783. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  784. @change="changeStages(domain, index)"
  785. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  786. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  787. </el-select>
  788. </el-form-item>
  789. <el-form-item :label="$t('other.projectAuditor')" >
  790. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  791. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  792. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  793. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  794. </el-option>
  795. </el-select>
  796. <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>
  797. </el-form-item>
  798. <!--工程专业版本模式下, 各个专业的进度填报 -->
  799. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  800. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  801. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  802. <el-input size="mini" style="width:60px;" v-model="item.progress"
  803. @keyup.native="onProgressChange"
  804. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  805. </span>
  806. </el-form-item>
  807. <!-- 相关维度 -->
  808. <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'">
  809. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  810. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  811. </el-option>
  812. </el-select>
  813. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  814. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  815. </el-option>
  816. </el-select>
  817. </el-form-item>
  818. <!-- 相关数值 -->
  819. <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">
  820. <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>
  821. </el-form-item>
  822. <!-- 自定义文本 -->
  823. <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">
  824. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  825. </el-form-item>
  826. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  827. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  828. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  830. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  831. </el-select>
  832. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  833. </el-form-item>
  834. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  835. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  836. <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>
  837. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  838. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  839. <span v-if="reportTimeType.type == 2">
  840. <!-- <span> -->
  841. <!--时间范围选择 -->
  842. <el-time-picker
  843. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  844. v-model="timeItem.startTime"
  845. :placeholder="$t('time.startTime')"
  846. style="width:120px;"
  847. format="HH:mm"
  848. value-format="HH:mm"
  849. :picker-options="{
  850. start: '00:00',
  851. end: '23:59',
  852. }"
  853. @change="iptChangs()">
  854. </el-time-picker> - <el-time-picker
  855. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  856. v-model="timeItem.endTime"
  857. :placeholder="$t('time.endTime')"
  858. style="width:120px;"
  859. format="HH:mm"
  860. value-format="HH:mm"
  861. :picker-options="{
  862. start: '00:00',
  863. end: '23:59',
  864. minTime: timeItem.startTime
  865. }"
  866. @change="iptChangs()">
  867. </el-time-picker>
  868. </span>
  869. </el-form-item>
  870. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  871. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  872. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  873. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  874. ></el-input>
  875. </el-form-item>
  876. </div>
  877. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  878. </div>
  879. <!--照片的显示 -->
  880. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  881. <el-image v-for="(pic, index) in domain.pics" :key="index"
  882. style="width: 100px; height: 100px; margin-right:10px;"
  883. :src="pic"
  884. :preview-src-list="domain.pics">
  885. </el-image>
  886. </p>
  887. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  888. </div>
  889. <span id="workFormsItemBottom"></span>
  890. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  891. </el-form>
  892. </div>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  895. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  896. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  897. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  898. <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>
  899. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  900. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  901. </span>
  902. </el-dialog>
  903. <!-- 按周填报 -->
  904. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  905. <!-- 按周填报-已填工时-点击 -->
  906. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  907. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  908. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  909. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  910. <el-table-column prop="state" :label="$t('state.states')">
  911. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  912. </el-table-column>
  913. </el-table>
  914. <span slot="footer" class="dialog-footer">
  915. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  916. </span>
  917. </el-dialog>
  918. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  919. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  920. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  921. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  922. <span class="spnn" v-if="workForm.userNames">
  923. <span v-for="(item, index) in workForm.userNames" :key="index">
  924. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  925. <span v-if="index < workForm.userNames.length - 1">,</span>
  926. </span>
  927. </span>
  928. <span class="spnn hover" v-else>
  929. {{$t('defaultText.pleaseSelectAsubstitute')}}
  930. </span>
  931. </div>
  932. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">下一步</el-button>
  933. </div>
  934. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  935. <el-form-item style="height:30px;margin-top:-72px;">
  936. <!-- <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> -->
  937. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  938. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  939. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  940. <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>
  941. <el-option
  942. v-for="item in fillProjectList"
  943. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  944. :key="item.id"
  945. :label="item.projectName + '\u3000' + item.projectCode"
  946. :value="item.id">
  947. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  948. <span style="float: right">{{ item.projectName }}</span>
  949. </el-option>
  950. </el-select>
  951. <span style="float:right;margin-right:10px;">选择项目</span>
  952. </el-form-item>
  953. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  954. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  955. <template slot-scope="scope">
  956. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  957. </template>
  958. </el-table-column>
  959. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  960. <template slot-scope="scope">
  961. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  962. <p v-else></p>
  963. </template>
  964. </el-table-column> -->
  965. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  966. <template slot-scope="scope">
  967. <div v-if="scope.row.canFill == 1">
  968. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  969. <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>
  970. <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>
  971. <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>
  972. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  973. </div>
  974. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  975. <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>
  976. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  977. </div>
  978. </div>
  979. <div v-else >
  980. <span style="color:#999999;">不可超前填报</span>
  981. </div>
  982. </template>
  983. </el-table-column>
  984. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  985. <template slot-scope="scope">
  986. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  987. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  988. </template>
  989. </el-table-column>
  990. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  991. <template slot-scope="scope">
  992. <div class="zhiss">
  993. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  994. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  995. </div>
  996. </template>
  997. </el-table-column>
  998. </el-table>
  999. </el-form>
  1000. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1001. <span v-if="isSubstitude" style="float:left;color:orange;">*正在为【{{workForm.userNames}}】代填</span>
  1002. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1003. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1004. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1005. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1006. <!--针对景昱,先检查工时是否存在异常-->
  1007. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1008. </span>
  1009. </el-dialog>
  1010. <!-- 重庆物奇私人定制的按周填报 -->
  1011. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1012. <div class="fillWeekDialogVisiCustom">
  1013. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1014. </div>
  1015. </el-dialog>
  1016. <!-- 选择时间 -->
  1017. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1018. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1019. <span slot="footer" class="dialog-footer">
  1020. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1021. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1022. </span>
  1023. </el-dialog>
  1024. <!-- 按周填报弹窗 -->
  1025. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1026. <div>
  1027. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1028. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1029. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1030. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1031. </el-select>
  1032. </div>
  1033. <!--如果设置了工时成本预警的预算成本项-->
  1034. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1035. <p>{{$t('lable.budgetSource')}}</p>
  1036. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1037. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1038. </el-select>
  1039. </div>
  1040. <!-- 任务分组 -->
  1041. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1042. <p>{{$t('lable.taskGrouping')}}</p>
  1043. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1044. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1045. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1046. </el-select>
  1047. </div>
  1048. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1049. <p>{{$t('other.inputStage')}}</p>
  1050. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1051. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1052. </el-select>
  1053. </div>
  1054. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1055. <p>{{$t('other.reviewer')}}</p>
  1056. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1057. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1058. </el-select>
  1059. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1060. </div>
  1061. <template v-if="user.timeType.reportAuditType == 3">
  1062. <div class="zhoFel">
  1063. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1064. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1065. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1066. </el-select>
  1067. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1068. </div>
  1069. <div class="zhoFel">
  1070. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1071. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1072. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1073. </el-select>
  1074. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1075. </div>
  1076. <div class="zhoFel">
  1077. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1078. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1079. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1080. </el-select>
  1081. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1082. </div>
  1083. <div class="zhoFel">
  1084. <p>{{ $t('chao-song-ren') }}</p>
  1085. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1086. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1087. </el-select>
  1088. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1089. </div>
  1090. </template>
  1091. <!-- 自定义维度 -->
  1092. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1093. <p>{{user.timeType.customDegreeName}}</p>
  1094. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1095. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1096. </el-select>
  1097. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1098. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1099. </el-select>
  1100. </div>
  1101. <!-- 自定义数值 -->
  1102. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1103. <p>{{user.timeType.customDataName}}</p>
  1104. <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>
  1105. </div>
  1106. <!-- 自定义文本 -->
  1107. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1108. <p>{{user.timeType.customTextName}}</p>
  1109. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1110. </div>
  1111. <!-- 选择任务 -->
  1112. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1113. <p>任务 / 里程碑</p>
  1114. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1115. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1116. </el-select>
  1117. </div>
  1118. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1119. <p>{{$t('other.timeSelection')}}</p>
  1120. <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>
  1121. </div>
  1122. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1123. <p>{{$t('other.chooseDuration')}}</p>
  1124. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1125. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1126. </el-select>
  1127. </div>
  1128. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1129. <p>{{$t('lable.percentageOfTime')}}</p>
  1130. <div style="width:400px;display: flex;align-items: center;">
  1131. <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>
  1132. <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>
  1133. </div>
  1134. </div>
  1135. <div class="zhoFel">
  1136. <p>{{$t('other.workMatters')}}</p>
  1137. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1138. </div>
  1139. </div>
  1140. <span slot="footer" class="dialog-footer">
  1141. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1142. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1143. </span>
  1144. </el-dialog>
  1145. <!--导出报表条件选择 -->
  1146. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1147. <el-form ref="form3" :model="exportParam" >
  1148. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1149. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1150. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1151. </el-select>
  1152. </el-form-item>
  1153. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1154. <!-- <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>
  1155. <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> -->
  1156. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1157. </el-form-item>
  1158. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1159. <el-date-picker
  1160. v-model="exportParam.dateRange" :editable="false"
  1161. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1162. :range-separator="$t('other.to')"
  1163. type="daterange"
  1164. :start-placeholder="$t('time.startDate')"
  1165. :end-placeholder="$t('time.endDate')"
  1166. ></el-date-picker>
  1167. </el-form-item>
  1168. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1169. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1170. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1171. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1172. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1173. </el-select>
  1174. </el-form-item>
  1175. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1176. <div class="exportReportRadio">
  1177. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1178. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1179. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1180. <i class="el-icon-question"></i>
  1181. </el-tooltip>
  1182. </div>
  1183. </el-form-item>
  1184. </el-form>
  1185. <div slot="footer" class="dialog-footer">
  1186. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1187. </div>
  1188. </el-dialog>
  1189. <!--导出报表条件选择 -->
  1190. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1191. <el-form ref="form3" :model="exportParam" >
  1192. <el-form-item prop="range" :label="$t('time.dateRange')">
  1193. <el-date-picker
  1194. v-model="exportParam.dateRange" :editable="false"
  1195. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1196. :clearable="true"
  1197. :range-separator="$t('other.to')"
  1198. type="daterange"
  1199. :start-placeholder="$t('time.startDate')"
  1200. :end-placeholder="$t('time.endDate')"
  1201. ></el-date-picker>
  1202. </el-form-item>
  1203. </el-form>
  1204. <div slot="footer" class="dialog-footer">
  1205. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1206. </div>
  1207. </el-dialog>
  1208. <!--人员列表 -->
  1209. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1210. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1211. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1212. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1213. <el-table-column type="selection"></el-table-column>
  1214. <el-table-column prop="label" :label="$t('lable.name')" >
  1215. <template slot-scope="scope">
  1216. <span>
  1217. <!-- {{(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}} -->
  1218. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1219. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1221. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1222. </span>
  1223. <span v-else>
  1224. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1225. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1226. </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-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1241. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1242. <el-table-column prop="label" :label="$t('lable.name')" >
  1243. <template slot-scope="scope">
  1244. <!-- <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> -->
  1245. <!-- <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> -->
  1246. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1247. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1248. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1249. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1250. </span>
  1251. <span v-else>
  1252. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1253. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1254. </span>
  1255. </template>
  1256. </el-table-column>
  1257. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1258. <template slot-scope="scope">
  1259. <div>
  1260. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1261. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1262. </div>
  1263. </template>
  1264. </el-table-column>
  1265. </el-table>
  1266. </el-tab-pane>
  1267. </el-tabs>
  1268. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1269. <el-table-column type="selection"></el-table-column>
  1270. <el-table-column prop="label" :label="$t('lable.name')" >
  1271. <template slot-scope="scope">
  1272. <div>
  1273. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1275. </div>
  1276. </template>
  1277. </el-table-column>
  1278. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1279. <template slot-scope="scope">
  1280. <div>
  1281. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1282. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1283. </div>
  1284. </template>
  1285. </el-table-column>
  1286. </el-table>
  1287. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1288. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1289. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1290. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1291. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1292. </div>
  1293. </el-dialog>
  1294. <!-- 日报审核修改 -->
  1295. <el-dialog
  1296. title="日报审核修改"
  1297. :visible.sync="reportLogCheckDialog"
  1298. width="30%"
  1299. :before-close="handleClose">
  1300. <el-form ref="form3" :model="exportReportLogParam" >
  1301. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1302. <el-date-picker
  1303. v-model="exportReportLogParam.dateRange" :editable="false"
  1304. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1305. :range-separator="$t('other.to')"
  1306. type="daterange"
  1307. :start-placeholder="$t('time.startDate')"
  1308. :end-placeholder="$t('time.endDate')"
  1309. ></el-date-picker>
  1310. </el-form-item>
  1311. </el-form>
  1312. <el-link type="primary" @click="exportReportLog">导出日报审核记录数据</el-link>
  1313. <br>
  1314. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1315. <el-link type="primary" @click="importReportLog">导入日报审核记录修改数据</el-link></el-upload>
  1316. <span slot="footer" class="dialog-footer">
  1317. <el-button type="primary" @click="reportLogCheckDialog = false">关闭</el-button>
  1318. </span>
  1319. </el-dialog>
  1320. <!-- 按部门选择人员 -->
  1321. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1322. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1323. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1324. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1325. </el-input>
  1326. <div class="tree" style="height:400px">
  1327. <el-scrollbar style="height:100%">
  1328. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1329. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1330. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1331. <span class="custom-tree-node" slot-scope="{ node }">
  1332. <span v-if="user.userNameNeedTranslate == '1'">
  1333. <span v-if="node.data.children">
  1334. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1335. </span>
  1336. <span v-else>
  1337. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1338. </span>
  1339. </span>
  1340. <span v-if="user.userNameNeedTranslate != '1'">
  1341. {{ node.label }}
  1342. </span>
  1343. <!-- {{ node.label }} -->
  1344. </span>
  1345. </el-tree>
  1346. </el-scrollbar>
  1347. </div>
  1348. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1349. <div slot="footer" class="dialog-footer">
  1350. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1351. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1352. </div>
  1353. </el-dialog>
  1354. <el-dialog
  1355. v-if="monthWorkTimeDialog"
  1356. :visible.sync="monthWorkTimeDialog"
  1357. :close-on-click-modal="false"
  1358. customClass="customWidth selectworktime"
  1359. width="92%"
  1360. top="60px"
  1361. >
  1362. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1363. <el-tabs v-model="activeName" @tab-click="handleClick">
  1364. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1365. <div class="selectworktime_export" style="margin-top:10px;">
  1366. <div class="selectworktime_export_l">
  1367. <el-date-picker
  1368. class="selecteworktime_datapick"
  1369. v-model="WorktimeDatepickValue"
  1370. value-format="yyyy-MM-dd"
  1371. type="daterange"
  1372. align="right"
  1373. unlink-panels
  1374. :range-separator="$t('other.to')"
  1375. :start-placeholder="$t('time.startDate')"
  1376. :end-placeholder="$t('time.endDate')"
  1377. :default-time="['12:00:00', '12:00:00']"
  1378. size="small"
  1379. popper-class="selecteorktime_datapick_popper"
  1380. @change="showMonthWorkTime()"
  1381. >
  1382. </el-date-picker>
  1383. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1384. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1385. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1386. <!-- 222 -->
  1387. </div>
  1388. <div>
  1389. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1390. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1391. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1392. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1393. </el-input>
  1394. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1395. </div>
  1396. <div style="float: left; height:32px; padding-top:10px;">
  1397. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">待审核</span>
  1398. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">已通过</span>
  1399. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">已驳回/漏填</span>
  1400. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">未提交</span>
  1401. </div>
  1402. <div style="float: right; vertical-align: middle;height:32px">
  1403. <el-link
  1404. type="primary"
  1405. @click="exportMembWorkHours()"
  1406. >{{$t('export.exportData')}}</el-link
  1407. >
  1408. </div>
  1409. </div>
  1410. <el-table ref="hasworkTbl"
  1411. :data="monthWorkDataS"
  1412. v-el-table-infinite-scroll="listScroll"
  1413. border
  1414. :height="'70vh'"
  1415. highlight-current-row
  1416. style="width: 100%"
  1417. v-loading="tbload"
  1418. :lazy="true"
  1419. :cell-style="hasworkTblCellStyle"
  1420. >
  1421. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1422. <template slot-scope="scope">
  1423. {{ scope.$index + 1 }}
  1424. </template>
  1425. </el-table-column>
  1426. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1427. <template slot-scope="scope">
  1428. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1429. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1430. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1431. <!-- {{scope.row.name}} -->
  1432. </span>
  1433. </template>
  1434. </el-table-column>
  1435. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1436. <template slot-scope="scope">
  1437. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1438. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1439. </template>
  1440. </el-table-column>
  1441. <el-table-column
  1442. min-width="60"
  1443. v-for="(item, index) in pickDateArray"
  1444. :key="index"
  1445. :label="item"
  1446. align="center"
  1447. >
  1448. <template slot="header" slot-scope="scope">
  1449. <div>{{ scope.column.label.dateStr }}</div>
  1450. <div>{{ scope.column.label.weekStr }}</div>
  1451. </template>
  1452. <template slot-scope="scope">
  1453. <div
  1454. v-if="
  1455. scope.row.worktimeList.filter(
  1456. (w) =>
  1457. w.createDate==item.date
  1458. ).length > 0 &&
  1459. scope.row.worktimeList.filter(
  1460. (w) =>w.createDate==item.date
  1461. )[0].workingTime < reportTimeType.allday
  1462. "
  1463. >
  1464. {{
  1465. scope.row.worktimeList.filter(
  1466. (w) =>w.createDate==item.date
  1467. )[0].workingTime.toFixed(1)
  1468. }}
  1469. </div>
  1470. <div
  1471. v-if="
  1472. scope.row.worktimeList.filter(
  1473. (w) =>w.createDate==item.date
  1474. ).length > 0 &&
  1475. scope.row.worktimeList.filter(
  1476. (w) =>w.createDate==item.date
  1477. )[0].workingTime > reportTimeType.allday
  1478. "
  1479. >
  1480. {{
  1481. scope.row.worktimeList.filter(
  1482. (w) =>w.createDate==item.date
  1483. )[0].workingTime.toFixed(1)
  1484. }}
  1485. </div>
  1486. <div
  1487. v-if="
  1488. scope.row.worktimeList.filter(
  1489. (w) =>w.createDate==item.date
  1490. ).length > 0 &&
  1491. scope.row.worktimeList.filter(
  1492. (w) =>w.createDate==item.date
  1493. )[0].workingTime == reportTimeType.allday
  1494. "
  1495. >
  1496. {{
  1497. scope.row.worktimeList.filter(
  1498. (w) =>w.createDate==item.date
  1499. )[0].workingTime
  1500. }}
  1501. </div>
  1502. <div
  1503. v-if="
  1504. scope.row.worktimeList.filter(
  1505. (w) =>w.createDate==item.date
  1506. ).length == 0
  1507. "
  1508. >
  1509. 0
  1510. </div>
  1511. <div
  1512. v-if="
  1513. scope.row.worktimeList.filter(
  1514. (w) =>w.createDate==item.date
  1515. ).length > 0 &&
  1516. typeof scope.row.worktimeList.filter(
  1517. (w) =>w.createDate==item.date
  1518. )[0].workingTime == 'string'
  1519. "
  1520. >
  1521. {{
  1522. scope.row.worktimeList.filter(
  1523. (w) =>w.createDate==item.date
  1524. )[0].workingTime
  1525. }}
  1526. </div>
  1527. </template>
  1528. </el-table-column>
  1529. </el-table>
  1530. <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>
  1531. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1532. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1533. <label style="font-size: 16px">员工每日已填报工时数</label>
  1534. <el-link
  1535. type="primary"
  1536. style="float: right; margin-right: 60px"
  1537. @click="exportMembWorkHours()"
  1538. >导出已填报数据</el-link
  1539. > -->
  1540. <!-- <el-button >导出</el-button> -->
  1541. <!-- </div> -->
  1542. </el-tab-pane>
  1543. <el-tab-pane label="未提交人员列表" name="second" >
  1544. <div class="selectworktime_export" style="margin-top:10px">
  1545. <div class="selectworktime_export_l">
  1546. <el-date-picker
  1547. class="selecteworktime_datapick"
  1548. v-model="WorktimeDatepickValue"
  1549. value-format="yyyy-MM-dd"
  1550. type="daterange"
  1551. align="right"
  1552. unlink-panels
  1553. :range-separator="$t('other.to')"
  1554. :start-placeholder="$t('time.startDate')"
  1555. :end-placeholder="$t('time.endDate')"
  1556. :default-time="['12:00:00', '12:00:00']"
  1557. size="small"
  1558. popper-class="selecteorktime_datapick_popper"
  1559. @change="showMonthNotWorkTime()"
  1560. >
  1561. </el-date-picker>
  1562. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1563. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1564. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1565. </div>
  1566. <div>
  1567. <div style="margin-top:10px;">
  1568. <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>
  1569. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1570. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1571. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1572. </el-input>
  1573. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1574. <el-link
  1575. type="primary"
  1576. style="float: right; vertical-align: middle;height:32px"
  1577. @click="exportMembNotWorkHours()"
  1578. >{{$t('export.exportData')}}</el-link
  1579. >
  1580. </div>
  1581. </div>
  1582. </div>
  1583. <el-table
  1584. ref="hasworkTbl2"
  1585. :data="monthNotWorkDateS"
  1586. v-el-table-infinite-scroll="notListScroll"
  1587. border
  1588. :height="'70vh'"
  1589. highlight-current-row
  1590. style="width: 100%"
  1591. v-loading="tbload"
  1592. lazy
  1593. >
  1594. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1595. <template slot-scope="scope">
  1596. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1597. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1598. </template>
  1599. </el-table-column>
  1600. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1601. <template slot-scope="scope">
  1602. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1603. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1604. </template>
  1605. </el-table-column>
  1606. <el-table-column
  1607. min-width="200"
  1608. :label="$t('weekDay.date')"
  1609. align="center"
  1610. prop="createDate"
  1611. >
  1612. </el-table-column>
  1613. <el-table-column
  1614. min-width="200"
  1615. :label="$t('state.states')"
  1616. align="center"
  1617. prop="status"
  1618. />
  1619. <el-table-column
  1620. min-width="200"
  1621. :label="$t('other.attendanceData')"
  1622. prop="cardTime"
  1623. align="center"
  1624. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1625. </el-table>
  1626. <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>
  1627. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1628. </el-tab-pane>
  1629. <el-tab-pane v-if="user.companyId==5978" :label="'工时异常明细'" name="third">
  1630. <div class="selectworktime_export" style="margin-top:10px;">
  1631. <div class="selectworktime_export_l">
  1632. <el-date-picker
  1633. class="selecteworktime_datapick"
  1634. v-model="WorktimeDatepickValue"
  1635. value-format="yyyy-MM-dd"
  1636. type="daterange"
  1637. align="right"
  1638. unlink-panels
  1639. :range-separator="$t('other.to')"
  1640. :start-placeholder="$t('time.startDate')"
  1641. :end-placeholder="$t('time.endDate')"
  1642. :default-time="['12:00:00', '12:00:00']"
  1643. size="small"
  1644. popper-class="selecteorktime_datapick_popper"
  1645. @change="showMonthWorkTimeReminder()"
  1646. >
  1647. </el-date-picker>
  1648. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1649. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1650. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1651. </div>
  1652. <div>
  1653. <div style="margin-top:10px;">
  1654. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1655. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1656. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1657. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1658. </el-input>
  1659. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1660. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">是否异常</el-checkbox>
  1661. </div>
  1662. </div>
  1663. <div style="float: right; vertical-align: middle;height:32px">
  1664. <el-link
  1665. type="primary"
  1666. @click="changeReminder()"
  1667. >{{'变更提醒'}}</el-link
  1668. >
  1669. <el-link
  1670. type="primary"
  1671. @click="exportMembWorkHoursReminder()"
  1672. >{{$t('export.exportData')}}</el-link
  1673. >
  1674. </div>
  1675. </div>
  1676. <el-table ref="hasworkTbl"
  1677. :data="monthWorkDataS"
  1678. v-el-table-infinite-scroll="listScroll"
  1679. border
  1680. :height="'70vh'"
  1681. highlight-current-row
  1682. style="width: 100%"
  1683. v-loading="tbload"
  1684. :lazy="true"
  1685. >
  1686. <el-table-column width="120" type="index" fixed="left" :label="'日期'">
  1687. <template slot-scope="scope">
  1688. {{ scope.row.createDate}}
  1689. </template>
  1690. </el-table-column>
  1691. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1692. <template slot-scope="scope">
  1693. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1694. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1695. <!-- {{scope.row.name}} -->
  1696. </template>
  1697. </el-table-column>
  1698. <el-table-column width="100" prop="invokeValue" fixed="left" :label="'费用类型'">
  1699. <template slot-scope="scope">
  1700. {{scope.row.invokeValue}}
  1701. </template>
  1702. </el-table-column>
  1703. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1704. <template slot-scope="scope">
  1705. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1706. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1707. </template>
  1708. </el-table-column>
  1709. <el-table-column width="160" type="index" fixed="left" :label="'填报工时'">
  1710. <template slot-scope="scope">
  1711. {{ scope.row.workingTime}}
  1712. </template>
  1713. </el-table-column>
  1714. <el-table-column width="160" type="index" fixed="left" :label="'考勤工时'">
  1715. <template slot-scope="scope">
  1716. {{ scope.row.cardTime}}
  1717. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1718. </template>
  1719. </el-table-column>
  1720. <el-table-column width="160" type="index" fixed="left" :label="'是否异常'">
  1721. <template slot-scope="scope">
  1722. {{ scope.row.exceedCardTime==0?'否':'是'}}
  1723. </template>
  1724. </el-table-column>
  1725. <el-table-column width="160" type="index" fixed="left" :label="'催办'">
  1726. <template slot-scope="scope">
  1727. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{'变更提醒'}}</el-link>
  1728. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{'取消异常'}}</el-link>
  1729. </template>
  1730. </el-table-column>
  1731. </el-table>
  1732. <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>
  1733. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1734. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1735. <label style="font-size: 16px">员工每日已填报工时数</label>
  1736. <el-link
  1737. type="primary"
  1738. style="float: right; margin-right: 60px"
  1739. @click="exportMembWorkHours()"
  1740. >导出已填报数据</el-link
  1741. > -->
  1742. <!-- <el-button >导出</el-button> -->
  1743. <!-- </div> -->
  1744. </el-tab-pane>
  1745. </el-tabs>
  1746. </el-dialog>
  1747. <!--驳回弹出框 -->
  1748. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1749. <div>
  1750. <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')" />
  1751. </div>
  1752. <div slot="footer" class="dialog-footer">
  1753. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1754. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1755. </div>
  1756. </el-dialog>
  1757. <!-- 通过弹出框 -->
  1758. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1759. <div>
  1760. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1761. </div>
  1762. <div slot="footer" class="dialog-footer">
  1763. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1764. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1765. </div>
  1766. </el-dialog>
  1767. <!--批量导入日报 -->
  1768. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1769. <p>1. {{$t('other.download')}}
  1770. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./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>
  1771. </p>
  1772. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1773. <p style="display: flex;justify-content: center;">
  1774. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1775. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1776. </el-upload>
  1777. </p>
  1778. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1779. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1780. </div>
  1781. </el-dialog>
  1782. <!-- 工时导入记录弹窗 -->
  1783. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1784. <div style="height: 452px">
  1785. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1786. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1787. <el-table-column prop="userName" :label="$t('other.operator')">
  1788. <template slot-scope="scope">
  1789. <div>
  1790. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1791. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1792. </div>
  1793. </template>
  1794. </el-table-column>
  1795. <el-table-column prop="datel" :label="$t('other.document')">
  1796. <template slot-scope="scope">
  1797. <div>
  1798. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1799. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1800. </div>
  1801. </template>
  1802. </el-table-column>
  1803. <el-table-column label="操作" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1804. <template slot-scope="scope">
  1805. <div>
  1806. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1807. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1808. </div>
  1809. </template>
  1810. </el-table-column>
  1811. </el-table>
  1812. <el-col :span="24" class="paginatis">
  1813. <el-pagination
  1814. @size-change="handleSizeChange"
  1815. @current-change="handleCurrentChange"
  1816. :page-sizes="[20 , 50 , 80 , 100]"
  1817. :page-size="20"
  1818. layout="total, sizes, prev, pager, next"
  1819. :total="toViewForm.total"
  1820. style="float:right;"
  1821. ></el-pagination>
  1822. </el-col>
  1823. </div>
  1824. </el-dialog>
  1825. <!--基于企业微信考勤数据的工时导入 -->
  1826. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1827. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1828. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1829. </el-step>
  1830. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1831. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1832. </el-steps>
  1833. <div v-if="active==0" style="padding:30px;height:360px;">
  1834. <div style="margin-top:50px;margin-left:280px;">
  1835. <el-date-picker
  1836. v-model="importWxParam.date" :editable="false"
  1837. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1838. :clearable="true"
  1839. :range-separator="$t('other.to')"
  1840. type="daterange"
  1841. :start-placeholder="$t('time.startDate')"
  1842. :end-placeholder="$t('time.endDate')"
  1843. @change="loadCheckInData"
  1844. ></el-date-picker>
  1845. </div>
  1846. </div>
  1847. <div v-if="active==1" style="padding:10px;">
  1848. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1849. style="width: 100%;margin-top:5px;" >
  1850. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1851. <template slot-scope="scope">
  1852. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1853. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1854. </template>
  1855. </el-table-column>
  1856. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1857. </el-table-column>
  1858. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1859. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1860. <template slot-scope="scope">
  1861. <div>
  1862. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1863. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1864. </div>
  1865. </template>
  1866. </el-table-column>
  1867. <el-table-column prop="departmentName" label="部门" >
  1868. <template slot-scope="scope">
  1869. <div>
  1870. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1871. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1872. </div>
  1873. </template>
  1874. </el-table-column>
  1875. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1876. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1877. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1878. <template slot-scope="scope">
  1879. {{scope.row.workHours.toFixed(1)}}h
  1880. </template>
  1881. </el-table-column>
  1882. </el-table>
  1883. </div>
  1884. <div v-if="active==2" >
  1885. <p style="display: flex;justify-content: center;height:390px;">
  1886. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1887. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1888. </el-upload>
  1889. </p>
  1890. </div>
  1891. <div slot="title">
  1892. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1893. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1894. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1895. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1896. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1897. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1898. </div>
  1899. <span slot="footer">
  1900. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1901. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1902. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1903. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1904. </span>
  1905. </el-dialog>
  1906. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1907. <p style="display: flex;justify-content: center;height:100px;">
  1908. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1909. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1910. </el-upload>
  1911. </p>
  1912. </el-dialog>
  1913. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1914. <div>
  1915. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1916. v-model="deleteReportParam.date" :editable="false"
  1917. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1918. :clearable="true"
  1919. :range-separator="$t('other.to')"
  1920. type="daterange"
  1921. :start-placeholder="$t('time.startDate')"
  1922. :end-placeholder="$t('time.endDate')"
  1923. ></el-date-picker>
  1924. </div>
  1925. <div style="margin-top:10px;">
  1926. <span>请选择部门:</span>
  1927. <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>
  1928. <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>
  1929. </div>
  1930. <div style="margin-top:10px;">
  1931. <span>请选择员工:</span>
  1932. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1933. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1934. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1935. <span v-else>{{item.name}}</span>
  1936. </el-option>
  1937. </el-select>
  1938. </div>
  1939. <span slot="footer">
  1940. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1941. </span>
  1942. </el-dialog>
  1943. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1944. <div>
  1945. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1946. v-model="deleteReportParam.date" :editable="false"
  1947. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1948. :clearable="true"
  1949. :range-separator="$t('other.to')"
  1950. type="daterange"
  1951. :start-placeholder="$t('time.startDate')"
  1952. :end-placeholder="$t('time.endDate')"
  1953. ></el-date-picker>
  1954. </div>
  1955. <div style="margin-top:15px;">
  1956. <span>选择部门:</span>
  1957. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1958. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1959. size="small" v-if="user.userNameNeedTranslate != 1"
  1960. ></el-cascader>
  1961. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1962. </div>
  1963. <span slot="footer">
  1964. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1965. </span>
  1966. </el-dialog>
  1967. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1968. <div>
  1969. <span>选择时间:</span><el-date-picker
  1970. v-model="modImportTime"
  1971. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1972. :clearable="true"
  1973. type="datetime"
  1974. ></el-date-picker>
  1975. <span>选择导入人员:</span><el-select
  1976. v-model="modImportUserId"
  1977. >
  1978. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1979. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1980. <span v-else>{{item.name}}</span>
  1981. </el-option>
  1982. </el-select>
  1983. </div>
  1984. <span slot="footer">
  1985. <el-button @click="confirmChangeModTime" >确认</el-button>
  1986. </span>
  1987. </el-dialog>
  1988. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1989. <div>
  1990. <span>请选择年月:</span>
  1991. <el-date-picker
  1992. v-model="ratioYmonth" :editable="false"
  1993. format="yyyyMM" value-format="yyyyMM"
  1994. type="month"
  1995. ></el-date-picker>
  1996. </div>
  1997. <span slot="footer">
  1998. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1999. </span>
  2000. </el-dialog>
  2001. <!--工时批量代填 -->
  2002. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2003. <div>
  2004. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2005. v-model="importWxParam.date" :editable="false"
  2006. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2007. :clearable="true"
  2008. :range-separator="$t('other.to')"
  2009. type="daterange"
  2010. :start-placeholder="$t('time.startDate')"
  2011. :end-placeholder="$t('time.endDate')"
  2012. @change="loadCheckInData"
  2013. ></el-date-picker>
  2014. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2015. </div>
  2016. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2017. :key="timeStamp"
  2018. style="width: 100%;margin-top:5px;" ref="tab">
  2019. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2020. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2021. <template slot-scope="scope">
  2022. <div>
  2023. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2024. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2025. </div>
  2026. </template>
  2027. </el-table-column>
  2028. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2029. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2030. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2031. <template slot-scope="scope">
  2032. {{scope.row.workHours.toFixed(1)}}h
  2033. </template>
  2034. </el-table-column>
  2035. <!--项目名称列表 -->
  2036. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2037. <template slot-scope="scope">
  2038. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2039. </template>
  2040. </el-table-column>
  2041. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2042. <template slot-scope="scope">
  2043. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2044. </template>
  2045. </el-table-column>
  2046. </el-table>
  2047. </el-dialog>
  2048. <!--基于企业微信考勤数据的工时导入 -->
  2049. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2050. <div style="padding-bottom:10px;">
  2051. <p>{{importResultMsg}}</p>
  2052. </div>
  2053. <!-- <span slot="footer" class="dialog-footer">
  2054. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2055. </span> -->
  2056. </el-dialog>
  2057. <!-- 审核流程展示 -->
  2058. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2059. <div style="padding:20px 40px 20px 0">
  2060. <el-timeline :reverse="false">
  2061. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2062. <!-- {{item.msg}} -->
  2063. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2064. <span v-if="user.userNameNeedTranslate == 1">
  2065. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2066. <span>{{item.msgCon.two}}</span>
  2067. </span>
  2068. </el-timeline-item>
  2069. </el-timeline>
  2070. </div>
  2071. </el-dialog>
  2072. </section>
  2073. </template>
  2074. <script>
  2075. // 左右滑动
  2076. import dragMixin from "@/common/js/tensile.js";
  2077. import util from "../../common/js/util";
  2078. // 自定义select组件
  2079. import selectCat from "@/components/select.vue"
  2080. // 引入自定义级联组件
  2081. import vueCascader from "@/components/cascader.vue"
  2082. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2083. // 重庆物奇定制组件
  2084. import WeeklyCustomization from "./weeklyCustomization.vue"
  2085. import { mapMutations } from 'vuex'
  2086. let _that = this
  2087. export default {
  2088. mixins: [dragMixin],
  2089. components: {
  2090. selectCat,
  2091. vueCascader,
  2092. WeeklyCustomization,
  2093. vueMultipleDept
  2094. },
  2095. data() {
  2096. return {
  2097. substitudeStep: 1,
  2098. showHidden: false,
  2099. pageIndex: 0,
  2100. hasMore: true,
  2101. exportType: 0,
  2102. exportingData: false,
  2103. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2104. jobResponseList:[],
  2105. yisibeiCompId: 3092,
  2106. yuzhongCompId: 3385,
  2107. mingyiName : '成都明夷电子科技有限公司',
  2108. // mingyiName : '明夷',
  2109. modItemDataId: null,
  2110. modImportTime: null,
  2111. modImportUserId: null,
  2112. showModImportTimeDialog: false,
  2113. showBatchSimpleApproveReport: false,
  2114. startDeleting: false,
  2115. showBatchDeleteReport: false,
  2116. deleteReportParam: {date:null, userIds:[]},
  2117. isDenying: false,
  2118. targetWeekDate: null,//填写周报中的周日期
  2119. importCardTimeVisi: false,
  2120. startRatioExporting: false,
  2121. exportUserRatio: false,
  2122. ratioYmonth:null,
  2123. hasWrittenReport: false,
  2124. today:null,
  2125. syncTimeLoading: false,
  2126. seluserText: '',
  2127. translation: '1', // 1、文字, 2、部门, 3、人员
  2128. exportLoad: false,
  2129. getPickerOptions: {
  2130. disabledDate: (time) => {
  2131. var date = new Date();
  2132. var year = date.getFullYear();
  2133. var month = date.getMonth() + 1;
  2134. if (month >= 1 && month <= 9) {
  2135. month = "0" + month;
  2136. }
  2137. var currentdate = year.toString() + month.toString();
  2138. var timeyear = time.getFullYear();
  2139. var timemonth = time.getMonth() + 1;
  2140. if (timemonth >= 1 && timemonth <= 9) {
  2141. timemonth = "0" + timemonth;
  2142. }
  2143. var timedate = timeyear.toString() + timemonth.toString();
  2144. if(this.user.timeType.fillAhead == 0){
  2145. return currentdate < timedate;
  2146. }else{
  2147. return false
  2148. }
  2149. }
  2150. },
  2151. alalal: '8.0',
  2152. timeBasecostList:null,
  2153. tbload: false,
  2154. exportTimeDialog: false,
  2155. searchKeyword: '',
  2156. monthWorkDataS: [],
  2157. monthNotWorkDateS: [],
  2158. pickDateArray:[],
  2159. WorktimeDatepickValue: [],
  2160. activeName:"first",
  2161. isLeave: 0,
  2162. submitingReport: false,
  2163. importResultMsg:null,
  2164. showImportResult:false,
  2165. importingData: false,
  2166. isDraft: 0,
  2167. timeStamp: 0,
  2168. projectColumns:[],
  2169. checkinLoading:false,
  2170. importWxParam:{date:null,},
  2171. active:0,
  2172. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2173. importWxDialog:false,
  2174. importDialog:false,
  2175. denyForm:null,
  2176. denyReasonDialog:false,
  2177. monthWorkTimeDialog: false,
  2178. isSubstitude:false,
  2179. isFill:false,
  2180. unFillList:[],
  2181. fillList:[],
  2182. fillMembList:[],
  2183. fillMembList_leave: [],
  2184. membListVisible: false,
  2185. isBatch:0,//是否是批量填报
  2186. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2187. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2188. 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')],
  2189. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2190. fillStatusList: [],
  2191. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2192. exportReportLogParam:{dateRange:[]},
  2193. exportDialog:false,
  2194. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2195. subProjectList:[],
  2196. canEdit: true,
  2197. originCanEdit: true,
  2198. 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],
  2199. selectTime:null,
  2200. reportTimeType:{},
  2201. curDate:'',
  2202. isAllSelect: false,
  2203. approveDialogVisible:false,
  2204. deptId:null,
  2205. targetUid: null,
  2206. membCount:0,
  2207. selectState:"-1",
  2208. user: JSON.parse(sessionStorage.getItem("user")),
  2209. allUsersList: [],
  2210. showAddMore:false,
  2211. allDate: [],
  2212. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2213. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2214. choseDay: 0,
  2215. tableHeight: 0,
  2216. listLoading: false,
  2217. projectList: [], //项目列表
  2218. fillProjectList: [],
  2219. reportList: [], //日报列表
  2220. reportNames:[], //批量审批列表
  2221. selCon:[], //筛选条件
  2222. selProjectList:[], //筛选后项目列表
  2223. selConShow: true,
  2224. usersList: [], // 全部人员列表
  2225. usersListId: '', // 选中的人员id
  2226. dialogVisible: false, //项目弹窗
  2227. report: '',
  2228. workForm: {
  2229. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2230. domains: [{
  2231. id: null,
  2232. projectId: "",
  2233. workingTime: "",
  2234. timeType:0,
  2235. content: "",
  2236. state: 2,
  2237. multiWorktime:0,
  2238. worktimeList:[],
  2239. degreeId: null,
  2240. auditUserList: [],
  2241. }],
  2242. showRefresh: false,
  2243. },
  2244. workRules: {
  2245. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2246. },
  2247. chooseParticipVisible: false,
  2248. logining: false,
  2249. isDisable: false,
  2250. timeType:[],
  2251. deptMembData: [
  2252. ],
  2253. //部门人员树状结构
  2254. data: [
  2255. {
  2256. id: -1,
  2257. label: this.$t('lable.allStaff'),
  2258. membCount:0
  2259. },
  2260. {
  2261. id: 0,
  2262. label: this.$t('lable.unassigned'),
  2263. }
  2264. ],
  2265. allData:{},
  2266. batchShowData:{},
  2267. option: [],
  2268. deptOptionList: [],
  2269. depData: {
  2270. id: -1,
  2271. label: this.$t('lable.allStaff'),
  2272. },
  2273. defaultProps: {
  2274. children: 'children',
  2275. label: 'label'
  2276. },
  2277. isNew: false,
  2278. selected: false,
  2279. valuet: new Date(),
  2280. domObj: null,
  2281. participator:[],
  2282. chosenMembCount:0,
  2283. jsDay: 0,
  2284. jsTime: 0,
  2285. falsss: false,
  2286. weidu: [],
  2287. weiduList: [],
  2288. yonghuUser: [],
  2289. dateAr: [],
  2290. batchSubFillDialog: false,
  2291. isSubstiS: false,
  2292. fillWeekDialogVisi: false,
  2293. fillWeekDialogVisiCustom: false,
  2294. zhoData: [],
  2295. weekDateRange: [],
  2296. btnZho: false,
  2297. weekDataLoading: false,
  2298. changdu: 6,
  2299. tianxieDialogVisible: false,
  2300. scopess: {},
  2301. zhoBao: {
  2302. time: '',
  2303. workingTime: '',
  2304. progress: '',
  2305. con: '',
  2306. subProjectId: '',
  2307. stage: '',
  2308. subProjectList: [],
  2309. stages: [],
  2310. },
  2311. zhoBaoIdx: '',
  2312. zhoBaoName: '',
  2313. zhis: {},
  2314. dealList: [],
  2315. toViewDialogVisible: false,
  2316. toViewList: [],
  2317. toViewloading: true,
  2318. toViewForm: {
  2319. pageIndex: '1',
  2320. pageSize: '20',
  2321. total: 0,
  2322. },
  2323. toViewloadings: false,
  2324. tabPositionss: 'top',
  2325. monthTotal: 0,
  2326. monthTotalPage: 0,
  2327. monthTotalLages: 20,
  2328. monthWorkData: [],
  2329. monthNotWorkDate: [],
  2330. monthWorkDataS1: [],
  2331. monthnotTotal: 0,
  2332. monthnotTotalPage: 0,
  2333. monthnotTotalLages: 20,
  2334. monthNotWorkDateS1: [],
  2335. deptMembDataText: '',
  2336. isFlag: false,
  2337. isMore: false,
  2338. stateKey: '0',
  2339. expandDate: [],
  2340. notifySelList:[],
  2341. departmentList: [],
  2342. trandepartmentList:[],
  2343. approvalProcessDialog: false,
  2344. approvalProcessData: [],
  2345. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2346. 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')],
  2347. isWeekend: false,
  2348. canCancelInDialog: false,
  2349. approveinData: {},
  2350. approveinDialog: false,
  2351. reportCanDelete: false,
  2352. weeklyFilledTimeDialog: false,
  2353. weeklyFilledTimeList: [],
  2354. weeklyFilledTimeLoading: false,
  2355. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2356. weeklyFilledTimeCanDelete: false,
  2357. weeklyFilledTimeDate: null,
  2358. leaveAllNum: 0,
  2359. dataLoading: false,
  2360. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2361. vacationTime: {},
  2362. integrationProjectList: [],
  2363. totalReportHours: 0, // 合计的工时
  2364. workTimeForMinYi:0,
  2365. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2366. weekIndex: 1,
  2367. weekParentData: {},
  2368. deptIdForNoReport:[],
  2369. deptIdForReminder:[],
  2370. nameAearch: '', // 企业微信姓名搜索
  2371. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2372. deptMembDataLoading: false,
  2373. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2374. {
  2375. id: 4811,
  2376. // id: 10,
  2377. name: '陕西柘中建设工程有限公司'
  2378. }
  2379. ],
  2380. pushWorkTimeLogDig:false,
  2381. pushWorkTimeLogData:[],
  2382. userReportDeptList: [],
  2383. isReminder:true,
  2384. reportLogCheckDialog:false,
  2385. deptIdForHasReport:[],
  2386. };
  2387. },
  2388. watch: {
  2389. deptMembDataText(val) {
  2390. this.$refs.chooseMembTree.filter(val);
  2391. }
  2392. },
  2393. filters: {
  2394. // 过滤
  2395. amounts(value) {
  2396. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2397. return 0
  2398. }
  2399. var zhi = +value + 0
  2400. return zhi.toFixed(1)
  2401. },
  2402. // zhoData
  2403. zhoData(value, arr) {
  2404. var dateArray = value.split("-");
  2405. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2406. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2407. // console.log(arr[date.getDay()])
  2408. // return "周" + "日一二三四五六".charAt(date.getDay());
  2409. return arr[date.getDay()]
  2410. },
  2411. // 过滤数字
  2412. numbers(value) {
  2413. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2414. return 0
  2415. }
  2416. return value
  2417. },
  2418. },
  2419. computed: {},
  2420. mounted() {
  2421. var now = new Date();
  2422. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2423. this.today = t;
  2424. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2425. this.exportParam.dateRange = [startStr,t];
  2426. this.exportReportLogParam.dateRange = [startStr,t];
  2427. this.getAllDate(1);
  2428. this.getReportList();
  2429. this.getProjectList();
  2430. this.getFillProjectList();
  2431. this.getTimeType();
  2432. this.getDepartment();
  2433. this.scrollFunction()
  2434. this.userssHu();
  2435. this.getFirstAndLastDay()
  2436. if(this.user.timeType.reportAuditType == 3){
  2437. this.getAllUsersList()
  2438. }
  2439. if (this.user.company.packageProject == 1) {
  2440. this.getBasecostItemList();
  2441. }
  2442. if(this.user.timeType.userWithMultiDept == 1) {
  2443. this.getDeptMembData();
  2444. }
  2445. if(this.user.timeType.lockWorktime){
  2446. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2447. }
  2448. //设置了下限
  2449. if (this.user.timeType.minReportTime) {
  2450. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2451. }
  2452. const that = this
  2453. if(this.user.userNameNeedTranslate == 1) {
  2454. that.dataLoading = that.$store.state.dataLoading
  2455. this.upDataLoading()
  2456. setTimeout(()=>{
  2457. that.dataLoading = that.$store.state.dataLoading
  2458. }, 1000)
  2459. }
  2460. if (this.user.companyId == this.yuzhongCompId) {
  2461. this.getJobResponList();
  2462. }
  2463. },
  2464. methods: {
  2465. ...mapMutations(['upDataLoading']),
  2466. // 已填工时情况表设置背景色
  2467. hasworkTblCellStyle({ columnIndex, row, column }) {
  2468. if(columnIndex > 2) {
  2469. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2470. const worktimeList = row.worktimeList || []
  2471. const times = this.reportTimeType.allday
  2472. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2473. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2474. const missReport = filterData[0] && filterData[0].missReport;
  2475. const state = filterData[0] && filterData[0].state
  2476. if (missReport) {
  2477. return "backgroundColor: red"
  2478. } else {
  2479. if (state == 0 || state == -1) {
  2480. return "backgroundColor: orange"
  2481. } else if (state == 1) {
  2482. //审核通过
  2483. return "backgroundColor: #32CD32"
  2484. } else if (state == 2) {
  2485. return "backgroundColor: red"
  2486. } else {
  2487. return "backgroundColor: #E0E0E0"
  2488. }
  2489. }
  2490. }
  2491. },
  2492. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2493. isCustomization(userInfo, permissionArray) {
  2494. const { companyId } = userInfo
  2495. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2496. return isReportPictureRequired
  2497. },
  2498. showHiddenFunction() {
  2499. this.showHidden = true;
  2500. },
  2501. // 获取如何信息选的可填写部门
  2502. getDeptMembData() {
  2503. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2504. if (res.code == "ok") {
  2505. let lists = res.data.userReportDeptList || []
  2506. const optimizedList = lists.map(item => ({
  2507. ...item,
  2508. label: item.departmentName,
  2509. value: item.departmentId,
  2510. }));
  2511. this.$set(this, 'userReportDeptList', optimizedList || []);
  2512. } else {
  2513. this.$message({
  2514. message: res.msg,
  2515. type: "error"
  2516. });
  2517. }
  2518. },error => { });
  2519. },
  2520. //任务被选中
  2521. onTaskSelected(domainItem) {
  2522. //取服务
  2523. if (domainItem.taskId) {
  2524. var that = this;
  2525. var param = {taskId:domainItem.taskId};
  2526. if (this.isSubstitude) {
  2527. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2528. param.userId = this.workForm.userId[0];
  2529. }
  2530. }
  2531. this.http.post('/task/getMyTaskService',param, res => {
  2532. if (res.code == "ok") {
  2533. // domainItem.workContentList = res.data;
  2534. that.$set(domainItem, 'sapServiceId', null);
  2535. that.$set(domainItem, 'serviceList', res.data);
  2536. } else {
  2537. this.$message({
  2538. message: res.msg,
  2539. type: "error"
  2540. });
  2541. }
  2542. },error => {
  2543. this.$message({
  2544. message: error,
  2545. type: "error"
  2546. });
  2547. }
  2548. );
  2549. } else {
  2550. //清空服务
  2551. }
  2552. },
  2553. onBatchTimeChange() {
  2554. //反向计算每日工作时长
  2555. if (this.workForm.createDate) {
  2556. let sdate = new Date(this.workForm.createDate[0]);
  2557. let edate = new Date(this.workForm.createDate[1]);
  2558. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2559. console.log('days===', days)
  2560. if (days < 0) {
  2561. return;
  2562. }
  2563. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2564. //总时长发生改变,自动按比例计算
  2565. this.workForm.domains.forEach(d=>{
  2566. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2567. });
  2568. }
  2569. },
  2570. //更新工作内容列表
  2571. updateJobContent(domainItem) {
  2572. var that = this;
  2573. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2574. if (res.code == "ok") {
  2575. // domainItem.workContentList = res.data;
  2576. that.$set(domainItem, 'extraField3', null);
  2577. that.$set(domainItem, 'workContentList', res.data);
  2578. } else {
  2579. this.$message({
  2580. message: res.msg,
  2581. type: "error"
  2582. });
  2583. }
  2584. },error => {
  2585. this.$message({
  2586. message: error,
  2587. type: "error"
  2588. });
  2589. }
  2590. );
  2591. },
  2592. updateResponse(domainItem) {
  2593. var that = this;
  2594. var selectPid = domainItem.projectId;
  2595. domainItem.extraField2 = null;
  2596. domainItem.extraField3 = null;
  2597. if (selectPid && domainItem.extraField1) {
  2598. //是否非项目
  2599. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2600. console.log('==========','isPublic=='+isPublic);
  2601. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2602. console.log(filteredRespList);
  2603. domainItem.filteredRespList = filteredRespList;
  2604. }
  2605. },
  2606. getJobResponList() {
  2607. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2608. if (res.code == "ok") {
  2609. this.jobResponseList = res.data;
  2610. } else {
  2611. this.$message({
  2612. message: res.msg,
  2613. type: "error"
  2614. });
  2615. }
  2616. },error => {
  2617. this.$message({
  2618. message: error,
  2619. type: "error"
  2620. });
  2621. }
  2622. );
  2623. },
  2624. openModImportTime(row) {
  2625. this.showModImportTimeDialog = true;
  2626. this.modItemDataId = row.id;
  2627. },
  2628. delImportTime(row) {
  2629. let rowId = row.id;
  2630. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2631. confirmButtonText: this.$t('btn.determine'),
  2632. cancelButtonText: this.$t('btn.cancel'),
  2633. type: "warning"
  2634. })
  2635. .then(() => {
  2636. this.http.post('/report-import-log/delete',{
  2637. id: rowId
  2638. },res => {
  2639. if (res.code == "ok") {
  2640. this.$message({
  2641. message: '删除成功',
  2642. type: "success"
  2643. });
  2644. this.getToView();
  2645. } else {
  2646. this.$message({
  2647. message: res.msg,
  2648. type: "error"
  2649. });
  2650. }
  2651. },error => {
  2652. this.$message({
  2653. message: error,
  2654. type: "error"
  2655. });
  2656. }
  2657. );
  2658. }).catch(() => {this.startDeleting = false});
  2659. },
  2660. confirmChangeModTime() {
  2661. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2662. this.$message({
  2663. message: '请选择时间',
  2664. type: "error"
  2665. });
  2666. return;
  2667. }
  2668. this.http.post('/report-import-log/changeTime',{
  2669. modLogDateTime: this.modImportTime,
  2670. modImportUserId: this.modImportUserId,
  2671. id: this.modItemDataId
  2672. },res => {
  2673. if (res.code == "ok") {
  2674. this.$message({
  2675. message: '修改成功',
  2676. type: "success"
  2677. });
  2678. this.getToView();
  2679. this.showModImportTimeDialog = false;
  2680. } else {
  2681. this.$message({
  2682. message: res.msg,
  2683. type: "error"
  2684. });
  2685. }
  2686. },error => {
  2687. this.$message({
  2688. message: error,
  2689. type: "error"
  2690. });
  2691. }
  2692. );
  2693. },
  2694. confirmBatchApproveReport() {
  2695. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2696. this.$message({
  2697. message: '请选择日期范围',
  2698. type: "error"
  2699. });
  2700. return;
  2701. }
  2702. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2703. confirmButtonText: this.$t('btn.determine'),
  2704. cancelButtonText: this.$t('btn.cancel'),
  2705. type: "warning"
  2706. })
  2707. .then(() => {
  2708. this.startDeleting = true;
  2709. let obj = {
  2710. startDate: this.deleteReportParam.date[0],
  2711. endDate: this.deleteReportParam.date[1]
  2712. }
  2713. if(this.deleteReportParam.departmentId) {
  2714. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2715. } else {
  2716. obj.departmentId = null
  2717. }
  2718. this.http.post('/report/batchApproveByDate',obj,res => {
  2719. if (res.code == "ok") {
  2720. this.$message({
  2721. message: '审核通过',
  2722. type: "success"
  2723. });
  2724. this.getReportList();
  2725. this.getDepartment();
  2726. this.startDeleting = false;
  2727. } else {
  2728. this.$message({
  2729. message: res.msg,
  2730. type: "error"
  2731. });
  2732. }
  2733. },error => {
  2734. this.$message({
  2735. message: error,
  2736. type: "error"
  2737. });
  2738. }
  2739. );
  2740. }).catch(() => {this.startDeleting = false});
  2741. },
  2742. confirmBatchDelReport() {
  2743. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2744. this.$message({
  2745. message: '请选择部门或人员',
  2746. type: "error"
  2747. });
  2748. return;
  2749. }
  2750. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2751. this.$message({
  2752. message: '请选择日期范围',
  2753. type: "error"
  2754. });
  2755. return;
  2756. }
  2757. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2758. confirmButtonText: this.$t('btn.determine'),
  2759. cancelButtonText: this.$t('btn.cancel'),
  2760. type: "warning"
  2761. })
  2762. .then(() => {
  2763. this.startDeleting = true;
  2764. this.http.post('/report/batchDelete',{
  2765. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2766. startDate: this.deleteReportParam.date[0],
  2767. endDate: this.deleteReportParam.date[1],
  2768. deptId: this.deleteReportParam.deptId[0]
  2769. },res => {
  2770. if (res.code == "ok") {
  2771. this.$message({
  2772. message: this.$t('message.successfullyDeleted'),
  2773. type: "success"
  2774. });
  2775. this.getReportList();
  2776. this.getDepartment();
  2777. this.startDeleting = false;
  2778. } else {
  2779. this.$message({
  2780. message: res.msg,
  2781. type: "error"
  2782. });
  2783. }
  2784. },error => {
  2785. this.$message({
  2786. message: error,
  2787. type: "error"
  2788. });
  2789. }
  2790. );
  2791. }).catch(() => {this.startDeleting = false});
  2792. },
  2793. getRecentlyProject() {
  2794. this.http.post('/project/nearProject',{},res => {
  2795. if(res.code == 'ok'){
  2796. let topObj = {
  2797. label: '最近选择项目',
  2798. peojectList: res.data
  2799. }
  2800. let botomObj = {
  2801. label: '全部项目',
  2802. peojectList: this.fillProjectList
  2803. }
  2804. //最近项目如果在fillProjectList中不存在,需要移除
  2805. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2806. this.integrationProjectList = [topObj, botomObj]
  2807. }else {
  2808. this.$message({
  2809. message: res.msg,
  2810. type: 'error'
  2811. })
  2812. }
  2813. },err => {
  2814. this.$message({
  2815. message: err,
  2816. type: 'error'
  2817. })
  2818. })
  2819. },
  2820. handlePictureCardPreview(file, index) {
  2821. console.log(file, index)
  2822. let arr = []
  2823. let imgArr = this.workForm.domains[index].imgListUrl
  2824. for(var i in imgArr) {
  2825. arr.push(imgArr[i].url)
  2826. }
  2827. console.log(arr, '图片数据')
  2828. const $viewer = this.$viewerApi({
  2829. images: arr
  2830. });
  2831. },
  2832. // 图片上传
  2833. addImg(e, index) {
  2834. console.log(e, '数据')
  2835. let formData = new FormData()
  2836. formData.append('multipartFile', e.file)
  2837. this.http.uploadFile('/common/uploadFile', formData,
  2838. res => {
  2839. if (res.code == "ok") {
  2840. this.$message({
  2841. message: this.$t('uploadedsuccessfully'),
  2842. type: "success"
  2843. });
  2844. if(!this.workForm.domains[index].imgList) {
  2845. this.workForm.domains[index].imgList = []
  2846. this.workForm.domains[index].imgListUrl = []
  2847. }
  2848. this.workForm.domains[index].imgList.push(res.data)
  2849. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2850. } else {
  2851. this.$message({message: res.msg,type: "error"});
  2852. }
  2853. console.log(this.workForm.domains[index])
  2854. },
  2855. error => {this.$message({message: error,type: "error"});
  2856. });
  2857. },
  2858. // 删除图片
  2859. delImg(file,fileList, index) {
  2860. console.log(file, fileList)
  2861. let idx = 0
  2862. for(let i in fileList) {
  2863. if(fileList[i].uid == file.uid) {
  2864. idx = i
  2865. }
  2866. }
  2867. this.workForm.domains[index].imgList.splice(idx, 1)
  2868. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2869. console.log(this.workForm.domains[index])
  2870. },
  2871. test(){
  2872. console.log('test',this.workForm.domains);
  2873. },
  2874. getHour(s1, s2) {
  2875. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2876. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2877. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2878. var ms = s2.getTime() - s1.getTime();
  2879. if (ms < 0) return 0;
  2880. let ma = ms / 1000 / 60 / 60
  2881. return ma; //小时
  2882. },
  2883. refreshWXCardTime(workdate) {
  2884. if (!workdate) return;
  2885. this.syncTimeLoading = true;
  2886. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2887. date: workdate,
  2888. },res => {
  2889. this.syncTimeLoading = false;
  2890. if(res.code == 'ok'){
  2891. this.workForm.time = res.data.time;
  2892. }else {
  2893. this.$message({
  2894. message: res.msg,
  2895. type: 'error'
  2896. })
  2897. }
  2898. },err => {
  2899. this.syncTimeLoading = false;
  2900. this.$message({
  2901. message: err,
  2902. type: 'error'
  2903. })
  2904. })
  2905. },
  2906. refreshAttendance(workdate) {
  2907. if (!workdate) return;
  2908. this.syncTimeLoading = true;
  2909. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2910. startDate: workdate[0],
  2911. endDate: workdate[1]
  2912. },res => {
  2913. this.syncTimeLoading = false;
  2914. if(res.code == 'ok'){
  2915. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2916. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2917. this.totalReportHours = this.workTimeForMinYi;
  2918. }else {
  2919. this.$message({
  2920. message: res.msg,
  2921. type: 'error'
  2922. })
  2923. }
  2924. },err => {
  2925. this.syncTimeLoading = false;
  2926. this.$message({
  2927. message: err,
  2928. type: 'error'
  2929. })
  2930. })
  2931. },
  2932. refreshBeiSengAttendance(workdate) {
  2933. if (!workdate) return;
  2934. this.syncTimeLoading = true;
  2935. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2936. createDate: workdate
  2937. },res => {
  2938. this.syncTimeLoading = false;
  2939. if(res.code == 'ok'){
  2940. this.workForm.time = res.data;
  2941. }else {
  2942. this.$message({
  2943. message: res.msg,
  2944. type: 'error'
  2945. })
  2946. }
  2947. },err => {
  2948. this.syncTimeLoading = false;
  2949. this.$message({
  2950. message: err,
  2951. type: 'error'
  2952. })
  2953. })
  2954. },
  2955. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2956. this.weeklyFilledTimeDialog = true
  2957. this.weeklyFilledTimeLoading = true
  2958. this.weeklyFilledTimeDate = parameterDate
  2959. this.http.post('/report/getReportList',{
  2960. date: parameterDate,
  2961. userId: this.user.id
  2962. },res => {
  2963. this.weeklyFilledTimeLoading = false
  2964. if(res.code == 'ok'){
  2965. this.weeklyFilledTimeList = res.data[0].data
  2966. let candelete = true
  2967. for(let i in this.weeklyFilledTimeList){
  2968. if(this.weeklyFilledTimeList[i].state < 2){
  2969. candelete = false
  2970. }
  2971. }
  2972. this.weeklyFilledTimeCanDelete = candelete
  2973. }else {
  2974. this.$message({
  2975. message: res.msg,
  2976. type: 'error'
  2977. })
  2978. }
  2979. },err => {
  2980. this.weeklyFilledTimeLoading = false
  2981. this.$message({
  2982. message: err,
  2983. type: 'error'
  2984. })
  2985. })
  2986. },
  2987. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2988. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2989. confirmButtonText: this.$t('btn.determine'),
  2990. cancelButtonText: this.$t('btn.cancel'),
  2991. type: "warning"
  2992. })
  2993. .then(() => {
  2994. this.http.post('/report/delete',{
  2995. userId: this.user.id,
  2996. date: this.weeklyFilledTimeDate
  2997. },res => {
  2998. if (res.code == "ok") {
  2999. this.$message({
  3000. message: this.$t('message.successfullyDeleted'),
  3001. type: "success"
  3002. });
  3003. this.getWeeklyWorkTime()
  3004. this.getReportList();
  3005. this.getDepartment();
  3006. this.weeklyFilledTimeDialog = false;
  3007. } else {
  3008. this.$message({
  3009. message: res.msg,
  3010. type: "error"
  3011. });
  3012. }
  3013. },error => {
  3014. this.$message({
  3015. message: error,
  3016. type: "error"
  3017. });
  3018. }
  3019. );
  3020. }).catch(() => {});
  3021. },
  3022. getApprovalProcess(item){
  3023. // console.log('this.date',this.choseDate);
  3024. this.http.post('/report-log/get',{
  3025. creatorId: item.id,
  3026. createDate: sessionStorage.msg
  3027. },res => {
  3028. if(res.code == 'ok'){
  3029. this.approvalProcessDialog = true
  3030. if(this.user.userNameNeedTranslate == 1) {
  3031. for(var i in res.data) {
  3032. let obj = {
  3033. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3034. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3035. }
  3036. res.data[i].msgCon = obj
  3037. }
  3038. }
  3039. this.approvalProcessData = res.data
  3040. console.log(this.approvalProcessData, '数据卡看')
  3041. }else{
  3042. this.$message({
  3043. message: res.msg,
  3044. type: 'error'
  3045. })
  3046. }
  3047. },err => {
  3048. this.$message({
  3049. message: err,
  3050. type: 'error'
  3051. })
  3052. })
  3053. },
  3054. filterNode(value, data) {
  3055. if (!value) return true;
  3056. return data.label.indexOf(value) !== -1;
  3057. },
  3058. triggerCalculateOT(index) {
  3059. var str = this.workForm.domains[index].overtimeHours + ''
  3060. if(str.indexOf('.') != '-1') {
  3061. var s = str.split('.')[0]
  3062. var st = str.split('.')[1]
  3063. var sts = st.split('')
  3064. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3065. }
  3066. },
  3067. searchScreen(e){
  3068. if(e){
  3069. this.monthNotWorkDateS1 = []
  3070. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3071. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3072. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3073. }
  3074. }
  3075. if (this.monthNotWorkDateS1.length > 50) {
  3076. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3077. }else{
  3078. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3079. }
  3080. // if (this.monthNotWorkDateS1.length > 0) {
  3081. // setTimeout(() => {
  3082. // this.tableListenernot()
  3083. // }, 1000);
  3084. // }
  3085. }else{
  3086. this.monthWorkDataS1 = []
  3087. for (let i = 0; i < this.monthWorkData.length; i++) {
  3088. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3089. this.monthWorkDataS1.push(this.monthWorkData[i])
  3090. }
  3091. }
  3092. if (this.monthWorkDataS1.length > 50) {
  3093. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3094. }else{
  3095. this.monthWorkDataS = this.monthWorkDataS1
  3096. }
  3097. // if (this.monthWorkDataS1.length > 0) {
  3098. // setTimeout(() => {
  3099. // this.tableListener()
  3100. // }, 1000);
  3101. // }
  3102. }
  3103. },
  3104. addUpload(data) {
  3105. // var zhi = data.fileName.split('.')[0]
  3106. // var sss = zhi + '.xlsx'
  3107. // return
  3108. var filePath = '/upload/' + data.serverName;
  3109. const a = document.createElement('a'); // 创建a标签
  3110. a.setAttribute('download', data.fileName);// download属性
  3111. a.setAttribute('href', filePath);// href链接
  3112. a.click(); //自执行点击事件
  3113. a.remove();
  3114. },
  3115. restrictNumber(targetId) {
  3116. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3117. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3118. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3119. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3120. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3121. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3122. inpu.value = parseFloat(inpu.value);
  3123. }
  3124. },
  3125. //获取项目下的任务分组
  3126. getTaskGroups(domain, index) {
  3127. domain.groupId=null;
  3128. this.http.post('/task-group/listMyJoinGroup',{
  3129. projectId: domain.projectId,
  3130. isSubstitude: this.isSubstitude ? 1 : 0
  3131. },
  3132. res => {
  3133. if (res.code == "ok") {
  3134. this.workForm.domains[index].taskGroups = res.data;
  3135. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3136. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3137. // this.getGroupStages(domain, index);
  3138. // }
  3139. this.$forceUpdate();
  3140. }
  3141. },
  3142. error => {
  3143. this.$message({
  3144. message: error,
  3145. type: "error"
  3146. });
  3147. }
  3148. );
  3149. },
  3150. //下载填报工时占比报表
  3151. downloadProjectRatio() {
  3152. this.exportUserRatio = true;
  3153. // let now = new Date();
  3154. // let month = now.getMonth();//默认看上个月的
  3155. // let monthStr = month<10? ('0'+month): month;
  3156. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3157. const today = new Date();
  3158. const year = today.getFullYear();
  3159. const month = today.getMonth() + 1;
  3160. let lastMonthYear, lastMonth;
  3161. if (month === 1) {
  3162. lastMonthYear = year - 1;
  3163. lastMonth = 12;
  3164. } else {
  3165. lastMonthYear = year;
  3166. lastMonth = month - 1;
  3167. }
  3168. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3169. console.log('赋值 ==>', this.ratioYmonth)
  3170. },
  3171. confirmDownloadRatio() {
  3172. this.startRatioExporting = true;
  3173. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3174. ymonth: this.ratioYmonth
  3175. },
  3176. res => {
  3177. if (res.code == "ok") {
  3178. this.startRatioExporting = false;
  3179. var filePath = res.data;
  3180. const a = document.createElement('a'); // 创建a标签
  3181. var data = filePath.split("/");
  3182. a.setAttribute('download', data[data.length-1]);// download属性
  3183. a.setAttribute('href', filePath);// href链接
  3184. a.click(); //自执行点击事件
  3185. a.remove();
  3186. } else {
  3187. this.startRatioExporting = false;
  3188. this.$message({
  3189. message: res.msg,
  3190. type: "error"
  3191. });
  3192. }
  3193. },
  3194. error => {
  3195. this.checkinLoading = false;
  3196. this.$message({
  3197. message: error,
  3198. type: "error"
  3199. });
  3200. }
  3201. );
  3202. },
  3203. //下载带企业微信考勤数据的工时统计模板
  3204. downloadCheckInExcel() {
  3205. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3206. startDate: this.importWxParam.date[0],
  3207. endDate: this.importWxParam.date[1],
  3208. },
  3209. res => {
  3210. if (res.code == "ok") {
  3211. var filePath = res.data;
  3212. const a = document.createElement('a'); // 创建a标签
  3213. var data = filePath.split("/");
  3214. a.setAttribute('download', data[data.length-1]);// download属性
  3215. a.setAttribute('href', filePath);// href链接
  3216. a.click(); //自执行点击事件
  3217. a.remove();
  3218. } else {
  3219. this.$message({
  3220. message: res.msg,
  3221. type: "error"
  3222. });
  3223. }
  3224. },
  3225. error => {
  3226. this.checkinLoading = false;
  3227. this.$message({
  3228. message: error,
  3229. type: "error"
  3230. });
  3231. }
  3232. );
  3233. },
  3234. pre() {
  3235. if (this.active == 0) return;
  3236. this.active--;
  3237. },
  3238. next() {
  3239. this.active++;
  3240. },
  3241. triggerTotalTime(index) {
  3242. var item = this.checkinList[index];
  3243. var total = 0.0;
  3244. for (var i=0;i<this.projectColumns.length; i++) {
  3245. var key = this.projectColumns[i];
  3246. if (item[key] != null && item[key] != '') {
  3247. total += parseFloat(item[key]);
  3248. }
  3249. }
  3250. item.totalFillTime = total;
  3251. },
  3252. //提交批量代填的数据
  3253. submitBatchSubFillData() {
  3254. var data = JSON.stringify(this.checkinList);
  3255. this.http.post('/user-corpwx-time/submitProjectTime',{
  3256. json: data,
  3257. projectColumns: JSON.stringify(this.projectColumns)
  3258. },
  3259. res => {
  3260. if (res.code == "ok") {
  3261. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3262. this.importWxDialog = false;
  3263. }
  3264. },
  3265. error => {
  3266. this.checkinLoading = false;
  3267. this.$message({
  3268. message: error,
  3269. type: "error"
  3270. });
  3271. }
  3272. );
  3273. },
  3274. loadCheckInData() {
  3275. if (this.importWxParam.date == null) {
  3276. this.checkinList = [];
  3277. return;
  3278. }
  3279. this.checkinLoading = true;
  3280. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  3281. startDate: this.importWxParam.date[0],
  3282. endDate: this.importWxParam.date[1],
  3283. },
  3284. res => {
  3285. if (res.code == "ok") {
  3286. this.checkinLoading = false;
  3287. this.checkinList = res.data.list;
  3288. this.projectColumns = res.data.projects;
  3289. // 自定义表格会导致表格错乱,需重新计算表格
  3290. this.$nextTick(()=>{
  3291. this.$refs.tab.doLayout()
  3292. })
  3293. }
  3294. },
  3295. error => {
  3296. this.checkinLoading = false;
  3297. this.$message({
  3298. message: error,
  3299. type: "error"
  3300. });
  3301. }
  3302. );
  3303. },
  3304. importCardTime(item) {
  3305. //首先判断文件类型
  3306. let str = item.file.name.split(".");
  3307. let format = str[str.length - 1];
  3308. if (format != "xls" && format != "xlsx") {
  3309. this.$message({
  3310. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3311. type: "error"
  3312. });
  3313. } else {
  3314. this.importingData = true;
  3315. let formData = new FormData();
  3316. formData.append("multipartFile", item.file);
  3317. formData.append("companyId", this.user.companyId);
  3318. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3319. res => {
  3320. this.$refs.uploadCardTime.clearFiles();
  3321. this.importingData = false;
  3322. if (res.code == "ok") {
  3323. //换成弹出框,以免有人等了半天回来啥也没看到
  3324. this.$message({
  3325. message: '导入考勤时长成功',
  3326. type: "success"
  3327. });
  3328. } else {
  3329. this.$message({
  3330. message: res.msg,
  3331. type: "error"
  3332. });
  3333. }
  3334. },
  3335. error => {
  3336. this.$refs.upload.clearFiles();
  3337. this.listLoading = false;
  3338. this.$message({
  3339. message: error,
  3340. type: "error"
  3341. });
  3342. });
  3343. }
  3344. },
  3345. batchImportWxData(item) {
  3346. //首先判断文件类型
  3347. let str = item.file.name.split(".");
  3348. let format = str[str.length - 1];
  3349. if (format != "xls" && format != "xlsx") {
  3350. this.$message({
  3351. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3352. type: "error"
  3353. });
  3354. } else {
  3355. this.importingData = true;
  3356. let formData = new FormData();
  3357. formData.append("file", item.file);
  3358. formData.append("companyId", this.user.companyId);
  3359. formData.append("withCheckIn", 1);
  3360. this.http.uploadFile('/report/importData', formData,
  3361. res => {
  3362. this.$refs.upload.clearFiles();
  3363. this.showImportResult = true;
  3364. this.importingData = false;
  3365. if (res.code == "ok") {
  3366. //换成弹出框,以免有人等了半天回来啥也没看到
  3367. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3368. this.getReportList();
  3369. this.importWxDialog = false;
  3370. } else {
  3371. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3372. }
  3373. },
  3374. error => {
  3375. this.$refs.upload.clearFiles();
  3376. this.listLoading = false;
  3377. this.$message({
  3378. message: error,
  3379. type: "error"
  3380. });
  3381. });
  3382. }
  3383. },
  3384. batchImportData(item) {
  3385. //首先判断文件类型
  3386. let str = item.file.name.split(".");
  3387. let format = str[str.length - 1];
  3388. if (format != "xls" && format != "xlsx") {
  3389. this.$message({
  3390. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3391. type: "error"
  3392. });
  3393. } else {
  3394. this.importingData = true;
  3395. let formData = new FormData();
  3396. formData.append("file", item.file);
  3397. formData.append("companyId", this.user.companyId);
  3398. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3399. this.http.uploadFile(url, formData,
  3400. res => {
  3401. this.$refs.upload.clearFiles();
  3402. this.importingData = false;
  3403. this.showImportResult = true;
  3404. if (res.code == "ok") {
  3405. //换成弹出框,以免有人等了半天回来啥也没看到
  3406. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3407. this.getReportList();
  3408. this.importWXDialog = false;
  3409. } else {
  3410. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3411. }
  3412. },
  3413. error => {
  3414. this.$refs.upload.clearFiles();
  3415. this.importingData = false;
  3416. this.$message({
  3417. message: error,
  3418. type: "error"
  3419. });
  3420. });
  3421. }
  3422. },
  3423. userssHu() {
  3424. this.http.post('/time-type/getCompanyTimeSetting',{
  3425. companyId: this.user.companyId
  3426. },
  3427. res => {
  3428. if (res.code == "ok") {
  3429. this.yonghuUser = res.data
  3430. }
  3431. },
  3432. error => {
  3433. this.$message({
  3434. message: error,
  3435. type: "error"
  3436. });
  3437. }
  3438. );
  3439. },
  3440. iptBlur(i) {
  3441. if(this.isBatch == 0) {
  3442. return
  3443. }
  3444. var reqParam = {
  3445. startDate: this.workForm.createDate[0],
  3446. endDate: this.workForm.createDate[1]
  3447. };
  3448. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3449. reqParam.userId = this.workForm.userId[0];
  3450. }
  3451. this.http.post('/report/getWorkDays',reqParam,
  3452. res => {
  3453. if (res.code == "ok") {
  3454. this.jsDay = res.data
  3455. this.chuji(i)
  3456. } else {
  3457. this.$message({
  3458. message: res.msg,
  3459. type: "error"
  3460. });
  3461. }
  3462. },
  3463. error => {
  3464. this.$message({
  3465. message: error,
  3466. type: "error"
  3467. });
  3468. }
  3469. );
  3470. //明夷硬编码获取
  3471. if (this.user.company.companyName == this.mingyiName) {
  3472. this.getWorkTimeForMinYi();
  3473. }
  3474. },
  3475. getWorkTimeForMinYi(){
  3476. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3477. startDate: this.workForm.createDate[0],
  3478. endDate: this.workForm.createDate[1]
  3479. },
  3480. res => {
  3481. if (res.code == "ok") {
  3482. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3483. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3484. this.totalReportHours = this.workTimeForMinYi;
  3485. } else {
  3486. this.$message({
  3487. message: res.msg,
  3488. type: "error"
  3489. });
  3490. this.workForm.createDate = [];
  3491. }
  3492. },
  3493. error => {
  3494. this.$message({
  3495. message: error,
  3496. type: "error"
  3497. });
  3498. }
  3499. );
  3500. },
  3501. chuji(i) {
  3502. if(i == 0) {
  3503. this.seleChn(1)
  3504. } else if(i == 1) {
  3505. this.seleChn(0)
  3506. } else if(i == 2) {
  3507. if(this.workForm.domains[0].multiWorktime > 0) {
  3508. this.iptChangs()
  3509. } else {
  3510. this.iptChang()
  3511. }
  3512. } else if(i == 3) {
  3513. this.seleChn(0)
  3514. }
  3515. },
  3516. seleChn(e,domain) {
  3517. if(e == 1) {
  3518. for(var i in this.workForm.domains) {
  3519. if(this.workForm.domains[i].timeType == 0) {
  3520. this.workForm.domains[i].workingTime = 8
  3521. } else {
  3522. this.workForm.domains[i].workingTime = 4
  3523. }
  3524. }
  3525. }
  3526. var quanbu = 0
  3527. var spl = this.workForm.domains
  3528. var zhi = ''
  3529. for(var i in spl) {
  3530. var sp = +spl[i].workingTime + 0
  3531. zhi = this.jsDay * sp
  3532. quanbu = +quanbu + zhi
  3533. }
  3534. this.jsTime = quanbu
  3535. this.totalReportHours = quanbu
  3536. let worktime = this.jsTime
  3537. // 自动计算加班时长
  3538. if(this.isBatch != 0){
  3539. worktime = this.jsTime / this.jsDay
  3540. }
  3541. if(this.user.timeType.fillOvertime && domain){
  3542. let isover = false
  3543. let alltime = 0
  3544. let allover = 0 //此处alltime同上面的worktime
  3545. for(let d in spl){
  3546. if(spl[d].isOvertime){
  3547. isover = true
  3548. allover += spl[d].overtimeHours*1
  3549. }
  3550. alltime += spl[d].workingTime*1
  3551. }
  3552. if(domain.overtimeHours){
  3553. allover = allover - domain.overtimeHours
  3554. }
  3555. if(worktime*1 > this.user.timeType.allday){
  3556. if(isover){
  3557. if(alltime > (allover + this.user.timeType.allday)){
  3558. this.$set(domain,'isOvertime',true)
  3559. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3560. }else{
  3561. this.$set(domain,'isOvertime',false)
  3562. this.$set(domain,'overtimeHours',null)
  3563. if(alltime < (allover + this.user.timeType.allday)){
  3564. let overtime = allover + this.user.timeType.allday - alltime
  3565. for(let pi in spl){
  3566. if(spl[pi].overtimeHours){
  3567. if((overtime - spl[pi].overtimeHours*1) > 0){
  3568. overtime = overtime - spl[pi].overtimeHours*1
  3569. this.$set(spl[pi],'isOvertime',false)
  3570. this.$set(spl[pi],'overtimeHours',null)
  3571. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3572. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3573. break
  3574. }else{
  3575. this.$set(spl[pi],'isOvertime',false)
  3576. this.$set(spl[pi],'overtimeHours',null)
  3577. break
  3578. }
  3579. }
  3580. }
  3581. }
  3582. }
  3583. }else{
  3584. this.$set(domain,'isOvertime',true)
  3585. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3586. }
  3587. }else{
  3588. for(let di in spl){
  3589. this.$set(spl[di],'isOvertime',false)
  3590. this.$set(spl[di],'overtimeHours',null)
  3591. }
  3592. }
  3593. }
  3594. },
  3595. iptChang() {
  3596. var sl = this.workForm.domains
  3597. let timeArr = []
  3598. for(var i in sl) {
  3599. if(sl[i].startTime && sl[i].endTime) {
  3600. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3601. }
  3602. }
  3603. this.getTimeHours(timeArr)
  3604. // for(let j in arrNum) {
  3605. // this.timeJsonStr += arrNum[j]
  3606. // if(flg) {
  3607. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3608. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3609. // }
  3610. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3611. // flg = true
  3612. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3613. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3614. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3615. // }
  3616. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3617. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3618. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3619. // }
  3620. // }
  3621. },
  3622. iptChangs() {
  3623. var sl = this.workForm.domains
  3624. let timeArr = []
  3625. for(var i in sl) {
  3626. for(var j in sl[i].worktimeList){
  3627. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3628. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3629. }
  3630. }
  3631. }
  3632. this.getTimeHours(timeArr)
  3633. },
  3634. // 调用接口或去数据
  3635. getTimeHours(arr) {
  3636. this.http.post('/report/getHoursByTimeRange',{
  3637. timeJsonStr: JSON.stringify(arr)
  3638. },res => {
  3639. if(res.code === 'ok') {
  3640. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3641. } else {
  3642. this.$message({
  3643. message: res.msg,
  3644. type: 'error'
  3645. })
  3646. }
  3647. },err => {
  3648. this.$message({
  3649. message: err,
  3650. type: 'error'
  3651. })
  3652. })
  3653. },
  3654. // 按周填报调用接口计算时间
  3655. async getWeekHoursByTimeRange(timeRange) {
  3656. const url = '/report/getHoursByTimeRange';
  3657. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3658. var that = this;
  3659. return new Promise((resolve, reject) => {
  3660. this.http.post(url, data, function(res) {
  3661. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3662. }, function(err) {
  3663. reject(err);
  3664. });
  3665. });
  3666. },
  3667. removeTimeItem(item, index) {
  3668. item.worktimeList.splice(index, 1);
  3669. this.iptChangs()
  3670. },
  3671. //添加工时
  3672. addNewWorktime(index, item) {
  3673. if(item.worktimeList == null ) {
  3674. item.worktimeList = []
  3675. }
  3676. item.worktimeList.push({});
  3677. },
  3678. //复制项目
  3679. copyProject(index) {
  3680. var leftProgress = 10;
  3681. if (this.reportTimeType.type == 3) {
  3682. //计算已经待分配工时比例
  3683. let array = this.workForm.domains;
  3684. let totalProgress = 0;
  3685. for (var i=0;i<array.length; i++) {
  3686. totalProgress += array[i].progress;
  3687. }
  3688. if (totalProgress < 100) {
  3689. leftProgress = 100 - totalProgress;
  3690. }
  3691. }
  3692. var newIndex = index+1;
  3693. var itemDomain = {
  3694. projectId: this.workForm.domains[index].projectId,
  3695. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3696. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3697. ),
  3698. content: "",
  3699. progress:leftProgress,
  3700. state:2,//2-表示待提交
  3701. };
  3702. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3703. if (this.reportTimeType.type == 0) {
  3704. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3705. var length = this.workForm.domains.length;
  3706. if (length == 2) {
  3707. this.showAddMore = false;
  3708. }
  3709. }
  3710. this.selectProject(itemDomain, newIndex);
  3711. },
  3712. pushWorkTime(reportId){
  3713. let url=''
  3714. if(this.user.timeType.syncSap == 1){
  3715. url='/report/pushProjectReportToSap'
  3716. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3717. var pushDate = this.date + day;
  3718. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3719. confirmButtonText: '确定',
  3720. cancelButtonText: '取消',
  3721. type: 'info'
  3722. }).then(() => {
  3723. const loading = this.$loading({
  3724. lock: true,
  3725. text: '正在推送中,请耐心等待。',
  3726. spinner: 'el-icon-loading',
  3727. background: 'rgba(0, 0, 0, 0.7)'
  3728. });
  3729. this.http.post(url,{
  3730. pushDate: pushDate,
  3731. reportId: reportId
  3732. },res => {
  3733. loading.close();
  3734. if(res.code == 'ok'){
  3735. this.$message({
  3736. type: 'success',
  3737. message: res.data
  3738. });
  3739. }else{
  3740. this.$message({
  3741. type: 'error',
  3742. message: res.msg
  3743. })
  3744. }
  3745. },err => {
  3746. loading.close();
  3747. this.$message({
  3748. type: 'error',
  3749. message: err
  3750. })
  3751. })
  3752. }).catch(() => {
  3753. });
  3754. }else{
  3755. url='/report/pushReportDataToThird'
  3756. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3757. confirmButtonText: '确定',
  3758. cancelButtonText: '取消',
  3759. type: 'info'
  3760. }).then(() => {
  3761. const loading = this.$loading({
  3762. lock: true,
  3763. text: '正在推送中,请耐心等待。',
  3764. spinner: 'el-icon-loading',
  3765. background: 'rgba(0, 0, 0, 0.7)'
  3766. });
  3767. this.http.post(url,{
  3768. yearMonth: this.date
  3769. },res => {
  3770. loading.close();
  3771. if(res.code == 'ok'){
  3772. this.$message({
  3773. type: 'success',
  3774. message: '推送成功!'
  3775. });
  3776. }else{
  3777. this.$message({
  3778. type: 'error',
  3779. message: res.msg
  3780. })
  3781. }
  3782. },err => {
  3783. loading.close();
  3784. this.$message({
  3785. type: 'error',
  3786. message: err
  3787. })
  3788. })
  3789. }).catch(() => {
  3790. });
  3791. }
  3792. },
  3793. showWorkTime(){
  3794. this.monthWorkTimeDialog = true;
  3795. this.searchKeyword = ''
  3796. this.WorktimeDatepickValue = this.istoMonth()
  3797. if(this.WorktimeDatepickValue.length == 0){
  3798. let newdate = new Date();
  3799. let nowdate = newdate.toLocaleDateString();
  3800. let getauto = this.getAutoWeekDate(nowdate)
  3801. let nowwd = [getauto[0],getauto[6]]
  3802. this.WorktimeDatepickValue = nowwd
  3803. }
  3804. this.showMonthWorkTime()
  3805. },
  3806. handleClick(t,e){
  3807. if (t.name == "second") {
  3808. this.showMonthNotWorkTime()
  3809. }else if(t.name == "first"){
  3810. this.showMonthWorkTime()
  3811. }else if(t.name == "third"){
  3812. this.showMonthWorkTimeReminder()
  3813. }
  3814. },
  3815. //导出员工每日填报工时数
  3816. exportMembWorkHours() {
  3817. this.http.post(
  3818. "/report/exportUserDailyWorkTime",
  3819. {
  3820. // month: this.date,
  3821. startDate: this.WorktimeDatepickValue[0],
  3822. endDate: this.WorktimeDatepickValue[1],
  3823. },
  3824. (res) => {
  3825. if (res.code == "ok") {
  3826. let url = res.data;
  3827. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3828. }
  3829. },
  3830. (error) => {
  3831. this.$message({
  3832. message: error,
  3833. type: "error",
  3834. });
  3835. }
  3836. );
  3837. },
  3838. exportMembWorkHoursReminder() {
  3839. this.http.post(
  3840. "/report/exportUserDailyWorkTimeReminder",
  3841. {
  3842. // month: this.date,
  3843. startDate: this.WorktimeDatepickValue[0],
  3844. endDate: this.WorktimeDatepickValue[1],
  3845. },
  3846. (res) => {
  3847. if (res.code == "ok") {
  3848. let url = res.data;
  3849. this.downloadByA('工时异常表.xlsx', url);
  3850. }
  3851. },
  3852. (error) => {
  3853. this.$message({
  3854. message: error,
  3855. type: "error",
  3856. });
  3857. }
  3858. );
  3859. },
  3860. exportMembNotWorkHours() {
  3861. this.http.post(
  3862. "/report/exportNoReportUserList",
  3863. {
  3864. // month: this.date,
  3865. startDate: this.WorktimeDatepickValue[0],
  3866. endDate: this.WorktimeDatepickValue[1],
  3867. },
  3868. (res) => {
  3869. if (res.code == "ok") {
  3870. let url = res.data;
  3871. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3872. }
  3873. },
  3874. (error) => {
  3875. this.$message({
  3876. message: error,
  3877. type: "error",
  3878. });
  3879. }
  3880. );
  3881. },
  3882. downloadByA(name, url) {
  3883. const a = document.createElement("a"); // 创建a标签
  3884. a.setAttribute("download", name); // download属性
  3885. a.setAttribute("href", url); // href链接
  3886. a.click(); // 自执行点击事件
  3887. a.remove();
  3888. },
  3889. // 是否本月判断
  3890. istoMonth(){
  3891. let todate = new Date()
  3892. let tomonth = todate.getMonth() + 1
  3893. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3894. if(this.date == adate){
  3895. return []
  3896. }else{
  3897. let sedate = new Date(this.date)
  3898. let semonth = sedate.getMonth() + 1
  3899. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3900. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3901. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3902. return [sedates1, sedates2]
  3903. }
  3904. },
  3905. showMonthWorkTime() {
  3906. this.monthTotalPage = 0,
  3907. this.tbload = true
  3908. let parameter={
  3909. startDate: this.WorktimeDatepickValue[0],
  3910. endDate: this.WorktimeDatepickValue[1],
  3911. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3912. }
  3913. this.http.post(
  3914. "/report/getUserDailyWorkTime",
  3915. // "/report/getNoReportUserList",
  3916. parameter,
  3917. (res) => {
  3918. if (res.code == "ok") {
  3919. this.tbload = false;
  3920. this.pickDateArray = res.data.days.map(item => {
  3921. return {
  3922. ...item,
  3923. dateStr: item.label.split('/')[0],
  3924. weekStr: item.label.split('/')[1]
  3925. }
  3926. });
  3927. // console.log('dataarray',res.data.days);
  3928. this.monthWorkData = res.data.list;
  3929. // this.monthWorkDataS = this.monthWorkData
  3930. // this.monthWorkDataS1 = res.data.list
  3931. this.monthTotal = res.data.list.length
  3932. if (this.monthWorkData.length > 50) {
  3933. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3934. }else{
  3935. this.monthWorkDataS = this.monthWorkData
  3936. }
  3937. this.searchScreen(0)
  3938. // this.monthWorkDataS = infoList
  3939. // 判断
  3940. // if (this.monthWorkDataS1.length > 0) {
  3941. // setTimeout(() => {
  3942. // this.tableListener()
  3943. // }, 1000);
  3944. // }
  3945. this.$nextTick(function(){
  3946. this.$refs.hasworkTbl.doLayout();
  3947. });
  3948. // this.$forceUpdate()
  3949. }
  3950. },
  3951. (error) => {
  3952. this.tbload = false
  3953. this.$message({
  3954. message: error,
  3955. type: "error",
  3956. });
  3957. }
  3958. );
  3959. },
  3960. showMonthWorkTimeReminder() {
  3961. this.monthTotalPage = 0,
  3962. this.tbload = true
  3963. let parameter={}
  3964. parameter={
  3965. startDate: this.WorktimeDatepickValue[0],
  3966. endDate: this.WorktimeDatepickValue[1],
  3967. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  3968. viewValue:this.isReminder?1:0
  3969. }
  3970. this.http.post(
  3971. "/report/getUserDailyWorkTimeReminder",
  3972. parameter,
  3973. (res) => {
  3974. if (res.code == "ok") {
  3975. this.tbload = false;
  3976. this.monthWorkData = res.data.list;
  3977. this.monthTotal = res.data.list.length
  3978. if (this.monthWorkData.length > 50) {
  3979. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3980. }else{
  3981. this.monthWorkDataS = this.monthWorkData
  3982. }
  3983. this.searchScreen(0)
  3984. this.$nextTick(function(){
  3985. this.$refs.hasworkTbl.doLayout();
  3986. });
  3987. }
  3988. },
  3989. (error) => {
  3990. this.tbload = false
  3991. this.$message({
  3992. message: error,
  3993. type: "error",
  3994. });
  3995. }
  3996. );
  3997. },
  3998. // tableListener(){
  3999. // let that = this;
  4000. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4001. // // 添加scroll监听事件
  4002. // dom.addEventListener("scroll", function () {
  4003. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4004. // if (scrollDistance < 2) {
  4005. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4006. // that.monthTotalPage++; //当前页数自增
  4007. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4008. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4009. // var infoList = arrList.splice(
  4010. // that.monthTotalPage * that.monthTotalLages,
  4011. // that.monthTotalLages
  4012. // );
  4013. // // 数据添加
  4014. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4015. // }
  4016. // }
  4017. // })
  4018. // },
  4019. showMonthNotWorkTime() {
  4020. this.monthTotalPage = 0,
  4021. this.tbload = true,
  4022. this.http.post(
  4023. "/report/getNoReportUserList",
  4024. {
  4025. startDate: this.WorktimeDatepickValue[0],
  4026. endDate: this.WorktimeDatepickValue[1],
  4027. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4028. },
  4029. (res) => {
  4030. if (res.code == "ok") {
  4031. this.tbload = false
  4032. this.monthNotWorkDate = res.data;
  4033. // this.monthNotWorkDateS1 = res.data
  4034. this.monthnotTotal = res.data.length
  4035. // 2222111
  4036. if (this.monthNotWorkDate.length > 50) {
  4037. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4038. } else {
  4039. this.monthNotWorkDateS = this.monthNotWorkDate
  4040. }
  4041. this.searchScreen(1)
  4042. // 判断
  4043. // if (this.monthnotworkDateS1.length > 0) {
  4044. // setTimeout(() => {
  4045. // this.tableListenernot()
  4046. // }, 1000);
  4047. // }
  4048. this.$nextTick(function(){
  4049. this.$refs.hasworkTbl2.doLayout();
  4050. });
  4051. }
  4052. },
  4053. (error) => {
  4054. this.tbload = false
  4055. this.$message({
  4056. message: error,
  4057. type: "error",
  4058. });
  4059. }
  4060. );
  4061. },
  4062. // tableListenernot(){
  4063. // let that = this;
  4064. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4065. // dom.addEventListener("scroll", function () {
  4066. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4067. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4068. // if (scrollDistance2 < 2) {
  4069. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4070. // that.monthnotTotalPage++; //当前页数自增
  4071. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4072. // var infoList = arrList.splice(
  4073. // that.monthnotTotalPage * that.monthnotTotalLages,
  4074. // that.monthnotTotalLages
  4075. // );
  4076. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4077. // }
  4078. // }
  4079. // })
  4080. // },
  4081. listScroll(){
  4082. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4083. this.isMore = true
  4084. setTimeout(()=>{
  4085. this.isMore = false
  4086. },1000)
  4087. }else {
  4088. this.isFlag = true
  4089. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4090. this.monthWorkDataS = datalist
  4091. setTimeout(()=>{
  4092. this.isFlag = false
  4093. },300)
  4094. }
  4095. },
  4096. notListScroll(){
  4097. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4098. this.isMore = true
  4099. setTimeout(()=>{
  4100. this.isMore = false
  4101. },1000)
  4102. }else {
  4103. this.isFlag = true
  4104. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4105. this.monthNotWorkDateS = datalist
  4106. // console.log('length',this.monthNotWorkDateS.length)
  4107. setTimeout(()=>{
  4108. this.isFlag = false
  4109. },300)
  4110. }
  4111. },
  4112. getFirstAndLastDay() {
  4113. // 将选定的月份转换为Date对象
  4114. var monthDate = new Date();
  4115. var year = monthDate.getFullYear();
  4116. var month = monthDate.getMonth();
  4117. // 计算起始日和结束日
  4118. var startDay = new Date(year, month, 1);
  4119. var endDay = new Date(year, month + 1, 0);
  4120. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4121. this.WorktimeDatepickValueForMonth=lastmd
  4122. },
  4123. formatDate(date) {
  4124. var year = date.getFullYear();
  4125. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4126. var day = ("0" + date.getDate()).slice(-2);
  4127. return year + "-" + month + "-" + day;
  4128. },
  4129. // 获取默认这zhou日期参数 222
  4130. getLastWeek(e){
  4131. let newdate = new Date()
  4132. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4133. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4134. if(e==1){
  4135. this.WorktimeDatepickValue = lastwd
  4136. this.showMonthWorkTime()
  4137. }else if(e==2){
  4138. this.WorktimeDatepickValue = lastwd
  4139. this.showMonthWorkTimeReminder()
  4140. }else{
  4141. this.WorktimeDatepickValue = lastwd
  4142. this.showMonthNotWorkTime()
  4143. }
  4144. },
  4145. getThisWeek(e){
  4146. let newdate = new Date();
  4147. let nowdate = newdate.toLocaleDateString();
  4148. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4149. if(e==1){
  4150. this.WorktimeDatepickValue = nowwd
  4151. this.showMonthWorkTime()
  4152. }else if(e==2){
  4153. this.WorktimeDatepickValue = nowwd
  4154. this.showMonthWorkTimeReminder()
  4155. }else{
  4156. this.WorktimeDatepickValue = nowwd
  4157. this.showMonthNotWorkTime()
  4158. }
  4159. },
  4160. getDoubleLastWeek(e){
  4161. let newdate = new Date()
  4162. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4163. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4164. if(e==1){
  4165. this.WorktimeDatepickValue = nextwd
  4166. this.showMonthWorkTime()
  4167. }else if(e==2){
  4168. this.WorktimeDatepickValue = nextwd
  4169. this.showMonthWorkTimeReminder()
  4170. }else{
  4171. this.WorktimeDatepickValue = nextwd
  4172. this.showMonthNotWorkTime()
  4173. }
  4174. },
  4175. alreadyAllDate(stime,etime){
  4176. let diffdate = new Array();
  4177. let i=0;
  4178. while(stime<=etime){
  4179. let dateArray = stime.split("-");
  4180. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4181. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4182. let stimewk = this.weekDay[date.getDay()]
  4183. 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')
  4184. 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])
  4185. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4186. let stime_ts = new Date(stime).getTime();
  4187. let next_date = stime_ts + (24*60*60*1000);
  4188. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4189. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4190. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4191. stime = next_dates_y+next_dates_m+next_dates_d;
  4192. i++;
  4193. }
  4194. return diffdate
  4195. },
  4196. getAutoWeekDate(e) {
  4197. let dateString = e;
  4198. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4199. if (dateString.match(dateStringReg)) {
  4200. let presentDate = new Date(dateString),
  4201. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4202. return Array.from(new Array(7), function (val, index) {
  4203. let formatDate = new Date(
  4204. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4205. );
  4206. return (
  4207. formatDate.getFullYear() +
  4208. "-" +
  4209. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4210. "-" +
  4211. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4212. );
  4213. });
  4214. } else {
  4215. throw new Error(
  4216. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4217. );
  4218. }
  4219. },
  4220. onProgressChange() {
  4221. this.$forceUpdate();
  4222. },
  4223. showChooseMembTree() {
  4224. this.chosenMembCount = this.participator.length;
  4225. this.chooseParticipVisible = true;
  4226. },
  4227. onTreeItemChange() {
  4228. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4229. var list = chosenList.filter(item=>item.isUser == 1);
  4230. this.chosenMembCount = list.length;
  4231. },
  4232. findUserInTree() {
  4233. if (this.filterName == '') {
  4234. this.deptMembData = this.allMembData;
  4235. } else {
  4236. var list = this.findRecursively(this.filterName, this.allMembData);
  4237. this.deptMembData = list;
  4238. }
  4239. },
  4240. findRecursively(username, list) {
  4241. var filterList = [];
  4242. for (var i=0;i<list.length; i++) {
  4243. if (list[i].isUser == 1) {
  4244. if (list[i].label.indexOf(username) >= 0) {
  4245. //匹配上了
  4246. filterList.push(list[i]);
  4247. }
  4248. } else if (list[i].children != null && list[i].children.length > 0) {
  4249. var subList = this.findRecursively(username, list[i].children);
  4250. if (subList.length > 0) {
  4251. subList.forEach(s=>filterList.push(s));
  4252. }
  4253. }
  4254. }
  4255. return filterList;
  4256. },
  4257. //确定选择参与人
  4258. chooseParticip() {
  4259. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4260. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4261. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4262. if (this.user.company.packageProject == 1) {
  4263. if (this.chosenMembList.length > 1) {
  4264. this.$message({
  4265. message: '每次仅支持代填一个人',
  4266. type: "error",
  4267. });
  4268. return;
  4269. }
  4270. }
  4271. this.chooseParticipVisible = false;
  4272. this.workForm.userNames = '';
  4273. this.workForm.userId = [];
  4274. this.participator = [];
  4275. for (var i=0;i<this.chosenMembList.length; i++) {
  4276. this.workForm.userId.push(this.chosenMembList[i].id);
  4277. this.workForm.userNames += this.chosenMembList[i].label+',';
  4278. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4279. this.participator.push(item);
  4280. }
  4281. if (this.workForm.userNames.length > 0) {
  4282. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4283. }
  4284. if(this.user.userNameNeedTranslate == 1) {
  4285. if(this.workForm.userNames) {
  4286. this.workForm.userNames = this.workForm.userNames.split(',')
  4287. }
  4288. }
  4289. },
  4290. notifySel(sel){
  4291. // console.log(sel);
  4292. this.notifySelList = sel
  4293. },
  4294. //微信通知人员填写
  4295. Notify(code) {
  4296. if (this.notifySelList.length == 0) return;
  4297. var ids = '';
  4298. this.notifySelList.forEach(f=>{
  4299. ids += f.id+',';
  4300. })
  4301. this.http.post('/user/pushFillReport',{
  4302. ids: ids, date: this.curDate,
  4303. code: code
  4304. },
  4305. res => {
  4306. if (res.code == "ok") {
  4307. this.$message({
  4308. message: this.$t('message.sentSuccessfully'),
  4309. type: "success"
  4310. });
  4311. }
  4312. },
  4313. error => {
  4314. this.$message({
  4315. message: error,
  4316. type: "error"
  4317. });
  4318. }
  4319. );
  4320. },
  4321. //导出人员列表
  4322. exportMemb() {
  4323. if (this.fillMembList.length == 0) return;
  4324. var ids = '';
  4325. this.fillMembList.forEach(f=>{
  4326. ids += f.id+',';
  4327. })
  4328. this.http.post('/user/exportMembList',{
  4329. ids: ids,isFill: this.isFill, date: this.curDate
  4330. },
  4331. res => {
  4332. if (res.code == "ok") {
  4333. var aTag = document.createElement('a');
  4334. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4335. aTag.href = res.data;
  4336. aTag.click();
  4337. }
  4338. },
  4339. error => {
  4340. this.$message({
  4341. message: error,
  4342. type: "error"
  4343. });
  4344. }
  4345. );
  4346. },
  4347. showMembList(fill) {
  4348. this.membListVisible = true;
  4349. if (fill == 0) {
  4350. this.fillMembList = this.unFillList;
  4351. this.isFill = false;
  4352. let leaveList = []
  4353. let unleaveList = []
  4354. for(let i in this.fillMembList){
  4355. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4356. leaveList.push(this.fillMembList[i])
  4357. }else{
  4358. unleaveList.push(this.fillMembList[i])
  4359. }
  4360. }
  4361. this.fillMembList = unleaveList
  4362. this.fillMembList_leave = leaveList
  4363. } else if(fill == 1){
  4364. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4365. this.isFill = true;
  4366. }else{
  4367. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4368. this.isFill = true;
  4369. }
  4370. },
  4371. //获取自己填写的日报状态
  4372. getReportFillStatus() {
  4373. this.http.post('/report/getReportFillStatus',{
  4374. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4375. },
  4376. res => {
  4377. if (res.code == "ok") {
  4378. this.fillStatusList = res.data;
  4379. this.allDate.forEach(d=>{
  4380. var fillInfo = null;
  4381. d.state = null;
  4382. this.fillStatusList.forEach(s=>{
  4383. var d1 = s.createDate.split('-')[2];
  4384. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4385. if (d1.indexOf('0') == 0) {
  4386. d1 = d1.substring(1,d1.length);
  4387. }
  4388. if (d1 == d2) {
  4389. d.state = s.state;
  4390. d.missReport = s.missReport;//是否漏填
  4391. d.exceedCardTime = s.exceedCardTime
  4392. }
  4393. })
  4394. })
  4395. this.$forceUpdate();
  4396. }
  4397. },
  4398. error => {
  4399. this.$message({
  4400. message: error,
  4401. type: "error"
  4402. });
  4403. }
  4404. );
  4405. },
  4406. scrollFunction () {
  4407. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4408. if (this.domObj.attachEvent) { // IE
  4409. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4410. } else if (this.domObj.addEventListener) {
  4411. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4412. }
  4413. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4414. },
  4415. mouseScroll(event) { // google 浏览器下
  4416. let detail = event.wheelDelta || event.detail
  4417. let moveForwardStep = -1
  4418. let moveBackStep = 1
  4419. let step = 0
  4420. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4421. event.preventDefault() // 阻止浏览器默认事件
  4422. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4423. },
  4424. // //左右滚动
  4425. // wheel(e){
  4426. // var a = document.getElementById("dateScroll");
  4427. // var scroll_width = 80; //滚动一下的距离
  4428. // var e = e || window.event, v;
  4429. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4430. // if(v>3||-v>3) v=-v;
  4431. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4432. // e.preventDefault(); //阻止浏览器的默认滚动
  4433. // },
  4434. showExportDialog() {
  4435. this.exportType = 0
  4436. this.exportDialog = true;
  4437. },
  4438. showExportTimeDialog() {
  4439. this.exportTimeDialog = true;
  4440. },
  4441. changeAllTime() {
  4442. //总时长发生改变,自动按比例计算
  4443. this.workForm.domains.forEach(d=>{
  4444. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4445. });
  4446. //计算jsTime
  4447. if (this.workForm.createDate) {
  4448. let sdate = new Date(this.workForm.createDate[0]);
  4449. let edate = new Date(this.workForm.createDate[1]);
  4450. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4451. console.log('days===', days)
  4452. if (days < 0) {
  4453. days = 0;
  4454. }
  4455. this.jsTime = this.reportTimeType.allday * days;
  4456. }
  4457. },
  4458. // 是否加班的单机事件
  4459. check() {
  4460. this.selected = !this.selected
  4461. this.isNew = this.selected
  4462. },
  4463. updateSubProject() {
  4464. this.$forceUpdate();
  4465. },
  4466. selectDegreeId(domain, index) {
  4467. this.http.post('/report/defaultDegree',{
  4468. projectId: domain.projectId
  4469. },
  4470. res => {
  4471. if (res.code == "ok") {
  4472. if(res.data) {
  4473. this.workForm.domains[index].degreeId = res.data.id + ''
  4474. this.$forceUpdate();
  4475. }
  4476. }
  4477. },
  4478. error => {
  4479. this.$message({
  4480. message: error,
  4481. type: "error"
  4482. });
  4483. }
  4484. );
  4485. },
  4486. //项目选中了, 加载子项目
  4487. selectProject(domain, index) {
  4488. if(!domain.projectId){
  4489. return;
  4490. }
  4491. // 默认选中上次填写的自定义维度
  4492. if(this.yonghuUser.customDegreeActive == 1) {
  4493. this.selectDegreeId(domain, index)
  4494. }
  4495. // console.log('projectId===',domain.projectId);
  4496. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4497. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4498. this.http.post('/sub-project/list',{
  4499. projectId: domain.projectId,
  4500. isReport: true
  4501. },
  4502. res => {
  4503. //清空之前选中的子项目
  4504. // this.workForm.domains[index].subProjectId = 0;
  4505. if (res.code == "ok") {
  4506. this.workForm.domains[index].subProjectList = res.data;
  4507. this.workForm.domains[index].subProjectId = null;
  4508. this.$forceUpdate();
  4509. }
  4510. },
  4511. error => {
  4512. this.$message({
  4513. message: error,
  4514. type: "error"
  4515. });
  4516. }
  4517. );
  4518. //项目相关的近期任务
  4519. if (this.user.company.packageProject == 1) {
  4520. this.getRecentTaskList(domain, index);
  4521. //获取项目相关专业
  4522. if (this.user.company.packageEngineering == 1) {
  4523. this.getProjectProfessions(domain, index);
  4524. }
  4525. //获取项目下的任务分组
  4526. this.getTaskGroups(domain, index);
  4527. }
  4528. // 获取项目相关的维度
  4529. // domain.degreeId = null
  4530. this.$set(domain,'degreeId',null)
  4531. this.$set(domain,'multiDegrIdArray',null)
  4532. this.dimension(domain, index);
  4533. //获取项目审核人
  4534. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4535. this.getProjectAuditorList(domain, index);
  4536. } else {
  4537. //按分组的负责人来审核
  4538. domain.projectAuditorId = null;
  4539. domain.projectAuditorName = null;
  4540. domain.auditUserList = null;
  4541. }
  4542. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4543. if (this.reportTimeType.type == 3) {
  4544. //新增项目时,自动计算
  4545. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4546. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4547. }
  4548. //加载昱众的工作职责
  4549. if (this.user.companyId == this.yuzhongCompId) {
  4550. this.updateResponse(domain);
  4551. }
  4552. },
  4553. getRecentTaskList(domain, index) {
  4554. //刷新任务时,清空服务
  4555. this.$set(domain, 'sapServiceId', null);
  4556. this.$set(domain, 'taskId', null);
  4557. var param = {
  4558. projectId: domain.projectId,
  4559. isSubstitude:this.isSubstitude?1:0,
  4560. };
  4561. if (domain.groupId) {
  4562. param.groupId = domain.groupId;
  4563. }
  4564. if (domain.stage) {
  4565. param.stage = domain.stage;
  4566. }
  4567. //专业版代填,获取代填员工的任务
  4568. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4569. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4570. this.$message({
  4571. message: '请选择代填的员工',
  4572. type: "error"
  4573. });
  4574. return;
  4575. } else {
  4576. param.userId = this.workForm.userId[0];
  4577. }
  4578. }
  4579. this.http.post('/task/getRecentTask',param,
  4580. res => {
  4581. if (res.code == "ok") {
  4582. this.workForm.domains[index].allTaskList = res.data;
  4583. this.workForm.domains[index].taskList = res.data;
  4584. this.$forceUpdate();
  4585. }
  4586. },
  4587. error => {
  4588. this.$message({
  4589. message: error,
  4590. type: "error"
  4591. });
  4592. }
  4593. );
  4594. },
  4595. //获取项目审核人
  4596. getProjectAuditorList(domainItem, index) {
  4597. if(domainItem.projectId == '') {
  4598. return
  4599. }
  4600. domainItem.projectAuditorId = null;
  4601. domainItem.projectAuditorName = null;
  4602. this.http.post('/project-auditor/getList',{
  4603. projectId: domainItem.projectId,
  4604. },
  4605. res => {
  4606. if (res.code == "ok") {
  4607. domainItem.auditUserList = res.data;
  4608. if (res.data.length==0) {
  4609. this.$message({
  4610. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4611. type: "error"
  4612. });
  4613. } else if (res.data.length==1) {
  4614. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4615. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4616. }
  4617. this.$forceUpdate();
  4618. }
  4619. },
  4620. error => {
  4621. this.$message({
  4622. message: error,
  4623. type: "error"
  4624. });
  4625. }
  4626. );
  4627. },
  4628. // 获取维度数据
  4629. dimension(domain, index) {
  4630. if(domain.projectId == '') {
  4631. return
  4632. }
  4633. this.http.post('/project/getDegreeList',{
  4634. projectId: domain.projectId,
  4635. },
  4636. res => {
  4637. if (res.code == "ok") {
  4638. // console.log("维度数据",res.data);
  4639. this.workForm.domains[index].wuduList = res.data
  4640. // this.workForm = this.workForm
  4641. this.$forceUpdate()
  4642. }
  4643. },
  4644. error => {
  4645. this.$message({
  4646. message: error,
  4647. type: "error"
  4648. });
  4649. }
  4650. );
  4651. },
  4652. //切换任务阶段
  4653. changeStages(domain, index) {
  4654. if (domain.stage == null || domain.stage == '') {
  4655. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4656. } else {
  4657. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4658. }
  4659. this.getRecentTaskList(domain, index);
  4660. this.$forceUpdate();
  4661. },
  4662. getGroupStages(domain, index, keepStage) {
  4663. // console.log(domain);
  4664. if(!domain.groupId){
  4665. domain.projectAuditorId = ''
  4666. domain.stages = []
  4667. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4668. domain.taskId = ''
  4669. domain.sapServiceId = ''
  4670. }
  4671. if(this.user.timeType.reportAuditType >= 1){
  4672. domain.auditUserList = []
  4673. }
  4674. this.$forceUpdate();
  4675. return
  4676. }
  4677. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4678. res => {
  4679. if (res.code == "ok") {
  4680. if (!keepStage) {
  4681. domain.stage = '';
  4682. }
  4683. domain.stages = res.data;
  4684. this.getRecentTaskList(domain, index);
  4685. this.$forceUpdate();
  4686. }
  4687. },
  4688. error => {
  4689. this.$message({
  4690. message: error,
  4691. type: "error"
  4692. });
  4693. });
  4694. //检查当前的项目是否需要获取分组的负责人
  4695. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4696. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4697. res => {
  4698. if (res.code == "ok") {
  4699. domain.getProjectAuditorList = res.data;
  4700. domain.auditUserList = res.data;
  4701. if (res.data.length==1) {
  4702. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4703. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4704. } else if (res.data.length==0) {
  4705. domain.projectAuditorId = null;
  4706. domain.projectAuditorName = null;
  4707. }
  4708. this.$forceUpdate();
  4709. }
  4710. },
  4711. error => {
  4712. this.$message({
  4713. message: error,
  4714. type: "error"
  4715. });
  4716. });
  4717. }
  4718. },
  4719. getProjectProfessions(domain, index) {
  4720. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4721. res => {
  4722. if (res.code == "ok") {
  4723. this.workForm.domains[index].professionProgress = res.data;
  4724. this.$forceUpdate();
  4725. }
  4726. },
  4727. error => {
  4728. this.$message({
  4729. message: error,
  4730. type: "error"
  4731. });
  4732. });
  4733. },
  4734. //删除自己的日报
  4735. deleteReport() {
  4736. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4737. confirmButtonText: this.$t('btn.determine'),
  4738. cancelButtonText: this.$t('btn.cancel'),
  4739. type: "warning"
  4740. })
  4741. .then(() => {
  4742. this.listLoading = true;
  4743. this.http.post('/report/delete',{
  4744. userId: this.user.id,
  4745. date: this.workForm.createDate
  4746. },
  4747. res => {
  4748. this.listLoading = false;
  4749. if (res.code == "ok") {
  4750. this.$message({
  4751. message: this.$t('message.successfullyDeleted'),
  4752. type: "success"
  4753. });
  4754. this.getReportList();
  4755. this.getDepartment();
  4756. this.dialogVisible = false;
  4757. } else {
  4758. this.$message({
  4759. message: res.msg,
  4760. type: "error"
  4761. });
  4762. }
  4763. },
  4764. error => {
  4765. this.listLoading = false;
  4766. this.$message({
  4767. message: error,
  4768. type: "error"
  4769. });
  4770. }
  4771. );
  4772. })
  4773. .catch(() => {});
  4774. },
  4775. // 管理员删除日报
  4776. guanli(item) {
  4777. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4778. let param = {date: this.date + day, userId: item.id};
  4779. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4780. confirmButtonText: this.$t('btn.determine'),
  4781. cancelButtonText: this.$t('btn.cancel'),
  4782. type: "warning"
  4783. })
  4784. .then(() => {
  4785. this.listLoading = true;
  4786. this.http.post('/report/delete',param,
  4787. res => {
  4788. this.listLoading = false;
  4789. if (res.code == "ok") {
  4790. this.$message({
  4791. message: this.$t('message.successfullyDeleted'),
  4792. type: "success"
  4793. });
  4794. this.getReportList();
  4795. this.getDepartment();
  4796. this.dialogVisible = false;
  4797. } else {
  4798. this.$message({
  4799. message: res.msg,
  4800. type: "error"
  4801. });
  4802. }
  4803. },
  4804. error => {
  4805. this.listLoading = false;
  4806. this.$message({
  4807. message: error,
  4808. type: "error"
  4809. });
  4810. }
  4811. );
  4812. })
  4813. .catch(() => {});
  4814. },
  4815. selectAll() {
  4816. if (this.isAllSelect) {
  4817. var keys = [];
  4818. this.reportNames.forEach(b=>{
  4819. keys.push(b.id);
  4820. })
  4821. this.$refs.approveTree.setCheckedKeys(keys);
  4822. } else {
  4823. this.$refs.approveTree.setCheckedKeys([]);
  4824. }
  4825. },
  4826. removeEmptyNode(list) {
  4827. for (var i=0;i<list.length;i++) {
  4828. var cnt = 0;
  4829. if (list[i].membCount == 0) {
  4830. list.splice(i, 1);
  4831. i--;
  4832. } else if (list[i].children != null) {
  4833. this.removeEmptyNode(list[i].children);
  4834. }
  4835. }
  4836. },
  4837. calculateMembCount(list) {
  4838. for (var i in list) {
  4839. var cnt = 0;
  4840. if (list[i].children != null) {
  4841. this.calculateMembCount(list[i].children);
  4842. for (var m in list[i].children) {
  4843. cnt += list[i].children[m].membCount;
  4844. }
  4845. }
  4846. if (list[i].isUser == 1) {
  4847. cnt++;
  4848. this.membCount++;
  4849. }
  4850. list[i].membCount = cnt;
  4851. }
  4852. },
  4853. stateChange() {
  4854. // console.log(this.allData,'alldate');
  4855. this.membCount = 0;
  4856. if (this.selectState == -1) {
  4857. //全部状态
  4858. this.data = this.allData;
  4859. } else {
  4860. //未填报
  4861. this.seluserText = ''
  4862. var newData = JSON.parse(JSON.stringify(this.allData));
  4863. this.filterState(this.selectState, newData);
  4864. this.data = newData;
  4865. }
  4866. this.calculateMembCount(this.data);
  4867. this.data[0].membCount = this.membCount;//总人数
  4868. },
  4869. //按状态过滤部门人员
  4870. filterState(state, list) {
  4871. for (var i =0;i<list.length; i++) {
  4872. var obj = list[i];
  4873. if (obj.isUser == 1) {
  4874. var match = false;
  4875. if (state == -2) {
  4876. if (obj.state == null) {
  4877. match = true;
  4878. }
  4879. } else {
  4880. if (obj.state == state) {
  4881. match = true;
  4882. }
  4883. }
  4884. if (!match) {
  4885. list.splice(i, 1);
  4886. i--;
  4887. } else {
  4888. }
  4889. } else {
  4890. if (obj.children != null) {
  4891. this.filterState(state, obj.children);
  4892. }
  4893. }
  4894. }
  4895. },
  4896. //a按名称过滤部门人员
  4897. async seluserforText(){
  4898. const { userNameNeedTranslate } = this.user
  4899. this.membCount = 0;
  4900. var newData = JSON.parse(JSON.stringify(this.allData));
  4901. let textList = [this.seluserText]
  4902. if(userNameNeedTranslate == 1) {
  4903. this.dataLoading = true
  4904. let res = await this.postData('/user/getEmployeeList', {
  4905. keyword: this.seluserText,
  4906. cursor: '',
  4907. departmentId: -1,
  4908. pageIndex: 1,
  4909. pageSize: 1000
  4910. })
  4911. textList = res.data.records.map(item => item.name)
  4912. this.dataLoading = false
  4913. }
  4914. // return
  4915. console.log(textList, '<=== textList')
  4916. this.seluserforTextin(this.seluserText, newData, textList)
  4917. console.log(newData, 'Data')
  4918. this.data = newData;
  4919. this.calculateMembCount(this.data);
  4920. this.data[0].membCount = this.membCount;//总人数
  4921. },
  4922. seluserforTextin(text, list, textList = []){
  4923. for (var i =0;i<list.length; i++) {
  4924. var obj = list[i];
  4925. if (obj.isUser == 1) {
  4926. var match = false;
  4927. // if (obj.label.indexOf(text) != -1) {
  4928. // match = true
  4929. // }
  4930. if(textList.some(item => item.includes(obj.label))) {
  4931. match = true
  4932. }
  4933. if (!match) {
  4934. list.splice(i, 1);
  4935. i--;
  4936. } else {
  4937. }
  4938. } else {
  4939. if (obj.children != null) {
  4940. this.seluserforTextin(text, obj.children, textList);
  4941. }
  4942. }
  4943. }
  4944. },
  4945. // 当节点发生变化时
  4946. nodeChangeExpand(data) {
  4947. // 保存当前展开的节点
  4948. let flag = false
  4949. this.nodeModelData.some(item => {
  4950. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4951. flag = true
  4952. return true
  4953. }
  4954. })
  4955. if (!flag) { // 不存在则存到数组里
  4956. this.nodeModelData.push(data.id)
  4957. }
  4958. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4959. },
  4960. nodeChangeCollapse(data) {
  4961. console.log(this.nodeModelData)
  4962. this.nodeModelData.some((item, i) => {
  4963. if (item === data.id) {
  4964. this.nodeModelData.length = i
  4965. }
  4966. })
  4967. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4968. },
  4969. // 部门列表点击
  4970. handleNodeClick(data) {
  4971. // this.dealList = data
  4972. this.theValues(data.id, this.allData)
  4973. // this.depData = data;
  4974. var list = [];
  4975. if (data.id == -1) {
  4976. this.deptId = null;
  4977. this.targetUid = null;
  4978. list = this.data;
  4979. } else if (data.isUser == 1) {
  4980. this.deptId = null;
  4981. this.targetUid = data.id;
  4982. } else {
  4983. this.deptId = data.id;
  4984. this.targetUid = null;
  4985. list.push(data);
  4986. }
  4987. this.getReportList();
  4988. if (list.length > 0) {
  4989. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4990. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4991. }
  4992. },
  4993. exportPushLog(){
  4994. this.http.post('/sap-sync-log/export',{},
  4995. res => {
  4996. if (res.code == "ok") {
  4997. var filePath = res.data;
  4998. var fName = '推送日志.xlsx'
  4999. const a = document.createElement('a'); // 创建a标签
  5000. a.setAttribute('download', fName);// download属性
  5001. a.setAttribute('href', filePath);// href链接
  5002. a.click(); //自执行点击事件
  5003. a.remove();
  5004. } else {
  5005. this.$message({
  5006. message: res.msg,
  5007. type: "error"
  5008. });
  5009. }
  5010. },
  5011. error => {
  5012. this.$message({
  5013. message: error,
  5014. type: "error"
  5015. });
  5016. });
  5017. },
  5018. theValues(id, item) {
  5019. for(var i in item) {
  5020. if(item[i].id == id) {
  5021. this.depData = item[i]
  5022. if(id == '-1') {
  5023. this.translation = '1'
  5024. } else {
  5025. if(item[i].children) {
  5026. this.translation = '2'
  5027. } else {
  5028. this.translation = '3'
  5029. }
  5030. }
  5031. return
  5032. } else {
  5033. if(item[i].children) {
  5034. this.theValues(id, item[i].children)
  5035. }
  5036. }
  5037. }
  5038. },
  5039. //获取可以选择的代填的人员列表
  5040. getSubstitudeUserDeptList() {
  5041. if (this.deptMembData.length == 0) {
  5042. this.http.post("/department/listMyMembs", {},
  5043. res => {
  5044. if (res.code == "ok") {
  5045. let noAllData = JSON.parse(JSON.stringify(res.data));
  5046. if (noAllData.length > 0) {
  5047. // if (noAllData[0].label == '全部人员') {
  5048. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5049. noAllData.splice(0,1);
  5050. }
  5051. }
  5052. this.setUserToDept(noAllData);
  5053. this.deptMembData = noAllData;
  5054. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5055. console.log(this.deptMembData, '代填人员数据')
  5056. } else {
  5057. this.$message({
  5058. message: res.msg,
  5059. type: "error"
  5060. });
  5061. }
  5062. },
  5063. error => {
  5064. this.$message({
  5065. message: error,
  5066. type: "error"
  5067. });
  5068. });
  5069. }
  5070. },
  5071. // 获取部门列表
  5072. getDepartmentForApprove() {
  5073. this.http.post( this.port.manage.depList, {},
  5074. res => {
  5075. if (res.code == "ok") {
  5076. var list1 = JSON.parse(JSON.stringify(res.data));
  5077. this.deptOptionList = this.changeArr(list1);
  5078. console.log(this.deptOptionList, '部门')
  5079. } else {
  5080. this.$message({
  5081. message: res.msg,
  5082. type: "error"
  5083. });
  5084. }
  5085. },
  5086. error => {
  5087. this.$message({
  5088. message: error,
  5089. type: "error"
  5090. });
  5091. });
  5092. },
  5093. // 获取部门列表
  5094. getDepartment() {
  5095. //如果没有权限,就不需要获取
  5096. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5097. return;
  5098. }
  5099. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5100. var param = {date:this.date + day};
  5101. this.http.post("/report/getMembList", param,
  5102. res => {
  5103. if (res.code == "ok") {
  5104. if(res.data.length == 0){
  5105. return
  5106. }
  5107. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5108. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5109. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5110. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5111. // if (this.user.role > 0) {
  5112. // }
  5113. list.splice(0,0,{
  5114. id: -1,
  5115. label: this.$t('lable.allStaff'),
  5116. })
  5117. this.membCount = 0;
  5118. //设置员工到部门下面
  5119. this.setUserToDept(list);
  5120. this.data = list;
  5121. // console.log('data',this.data);
  5122. this.expandDate = [this.data[1].id]
  5123. this.allData = list;
  5124. // if (noAllData.length > 0) {
  5125. // if (noAllData[0].label == '全部人员') {
  5126. // noAllData.splice(0,1);
  5127. // }
  5128. // }
  5129. // this.setUserToDept(noAllData);
  5130. // this.deptMembData = noAllData;
  5131. this.option = this.changeArr(list1);
  5132. list[0].membCount = this.membCount;
  5133. if (this.depData.id == -1) {
  5134. this.depData.membCount = this.membCount;
  5135. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5136. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5137. } else {
  5138. if (this.depData.isUser == null) {
  5139. var dep = this.findTargetDept(this.data, this.depData.id);
  5140. var membDeptList = [];
  5141. membDeptList.push(dep);
  5142. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5143. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5144. }
  5145. }
  5146. if (this.depData.isUser == null) {
  5147. if (this.isFill) {
  5148. this.fillMembList = this.fillList;
  5149. } else {
  5150. this.fillMembList = this.unFillList;
  5151. }
  5152. }
  5153. this.leaveAllNum = 0
  5154. for(let i in this.unFillList){
  5155. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5156. this.leaveAllNum += 1
  5157. }
  5158. }
  5159. this.stateChange()
  5160. } else {
  5161. this.$message({
  5162. message: res.msg,
  5163. type: "error"
  5164. });
  5165. }
  5166. },
  5167. error => {
  5168. this.$message({
  5169. message: error,
  5170. type: "error"
  5171. });
  5172. });
  5173. this.getReportFillStatus();
  5174. },
  5175. findTargetDept(list, deptId) {
  5176. var t = null;
  5177. for (var i=0;i<list.length; i++) {
  5178. if (list[i].isUser == null && list[i].id == deptId) {
  5179. t = list[i];
  5180. break;
  5181. }
  5182. }
  5183. if (t == null) {
  5184. for (var i=0;i<list.length; i++) {
  5185. if (list[i].children != null && list[i].children.length > 0) {
  5186. t = this.findTargetDept(list[i].children, deptId);
  5187. if (t != null) {
  5188. break;
  5189. }
  5190. }
  5191. }
  5192. }
  5193. return t;
  5194. },
  5195. getUserMembListFromDeptList(list, isFill) {
  5196. var membList = [];
  5197. for (var i in list) {
  5198. var deptName = list[i].label;
  5199. if (list[i].userList != null) {
  5200. list[i].userList.forEach(element => {
  5201. if (isFill == 0) {
  5202. //获取未填的
  5203. if (element.state == null) {
  5204. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5205. membList.push(obj);
  5206. }
  5207. } else {
  5208. if (element.state != null) {
  5209. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5210. membList.push(obj);
  5211. }
  5212. }
  5213. });
  5214. }
  5215. if (list[i].children != null) {
  5216. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5217. }
  5218. }
  5219. return membList;
  5220. },
  5221. setUserToDept(list) {
  5222. for (var i in list) {
  5223. var cnt = 0;
  5224. if (list[i].children != null) {
  5225. this.setUserToDept(list[i].children);
  5226. for (var m in list[i].children) {
  5227. cnt += list[i].children[m].membCount;
  5228. }
  5229. }
  5230. if (list[i].userList != null) {
  5231. if (list[i].children == null) {
  5232. list[i].children = [];
  5233. }
  5234. list[i].userList.forEach(element => {
  5235. var obj = {
  5236. id: element.id,
  5237. label:element.name,
  5238. state:element.state,
  5239. parentId:element.departmentId,
  5240. isUser:1,
  5241. workingTime: element.workingTime,
  5242. leaveDays: element.leaveDays,
  5243. leaveTimes: element.leaveTimes
  5244. };
  5245. list[i].children.push(obj);
  5246. this.membCount++;
  5247. cnt++;
  5248. });
  5249. }
  5250. list[i].membCount = cnt;
  5251. }
  5252. },
  5253. // 修改数组
  5254. changeArr(arr) {
  5255. for (var i = 0; i < arr.length; i++) {
  5256. if(arr[i].id != -1 && arr[i].id != 0) {
  5257. if (arr[i].children != null && arr[i].children.length>0) {
  5258. arr[i].children = this.changeArr(arr[i].children);
  5259. }
  5260. arr[i].id && (arr[i].value = arr[i].id);
  5261. delete arr[i].id;
  5262. }
  5263. }
  5264. for(var i in arr) {
  5265. if(arr[i].id == -1 || arr[i].id == 0) {
  5266. arr.splice(i,1)
  5267. }
  5268. }
  5269. return arr;
  5270. },
  5271. //时间段范围设置改动,监听
  5272. onTimeTypeChange(timeType) {
  5273. this.seleChn(1)
  5274. this.showAddMore = true;
  5275. for(var i in this.workForm.domains) {
  5276. if (this.workForm.domains[i].timeType == 0) {
  5277. this.showAddMore = false;
  5278. break;
  5279. }
  5280. }
  5281. if (this.showAddMore) {
  5282. //检测数量
  5283. if (this.workForm.domains.length == 2) {
  5284. this.showAddMore = false;
  5285. } else {
  5286. this.showAddMore = true;
  5287. }
  5288. }
  5289. },
  5290. getTimeType() {
  5291. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5292. res => {
  5293. if (res.code == "ok") {
  5294. var t = res.data;
  5295. this.reportTimeType = t;
  5296. if (this.reportTimeType.type > 0) {
  5297. this.showAddMore = true;
  5298. }
  5299. //转化时间格式
  5300. if (t.allday != null) {
  5301. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5302. }
  5303. if (t.am != null) {
  5304. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5305. }
  5306. if (t.pm != null) {
  5307. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5308. }
  5309. let arr = []
  5310. for(var i in res.data.excludeTimeList) {
  5311. let obj = {
  5312. s: res.data.excludeTimeList[i].startTime,
  5313. e: res.data.excludeTimeList[i].endTime,
  5314. }
  5315. arr.push(obj)
  5316. }
  5317. this.vacationTime = arr
  5318. } else {
  5319. this.$message({
  5320. message: res.msg,
  5321. type: "error"
  5322. });
  5323. }
  5324. },
  5325. error => {
  5326. this.listLoading = false;
  5327. this.$message({
  5328. message: error,
  5329. type: "error"
  5330. });
  5331. });
  5332. },
  5333. // 改变月份 -------
  5334. changeMonthOut() {
  5335. this.getAllDate();
  5336. this.getReportList();
  5337. this.getDepartment();
  5338. },
  5339. // 选择日期
  5340. choseDate(i, item) {
  5341. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5342. return
  5343. }
  5344. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5345. this.choseDay = i;
  5346. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5347. sessionStorage.msg = this.date + day,
  5348. this.getReportList();
  5349. this.getDepartment();
  5350. this.curDate = item.date;
  5351. },
  5352. canClick(i, item){
  5353. let nowDate = new Date()
  5354. let nowDateYear = nowDate.getFullYear()
  5355. let itemYear = parseInt(this.date.split('-')[0])
  5356. let nowDateMonth = nowDate.getMonth() + 1
  5357. let itemMonth = parseInt(this.date.split('-')[1])
  5358. let nowDateDay = nowDate.getDate()
  5359. let itemDay = parseInt(item.showDate.split('.')[1])
  5360. if(nowDateYear < itemYear){
  5361. return false
  5362. }else if(nowDateYear == itemYear){
  5363. if(nowDateMonth < itemMonth){
  5364. return false
  5365. }else if(nowDateMonth == itemMonth){
  5366. if(nowDateDay < itemDay){
  5367. return false
  5368. }
  5369. }
  5370. }
  5371. },
  5372. // 获取日期列表
  5373. getAllDate(e) {
  5374. var dayArry = [];
  5375. var day = this.getCountDays();
  5376. let curMonthDay = null;
  5377. for (var k = 1; k <= day; k++) {
  5378. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5379. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5380. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5381. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5382. if(sessionStorage.msg) {
  5383. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5384. this.choseDay = k - 1;
  5385. curMonthDay = str;
  5386. }
  5387. } else {
  5388. if (new Date().getDate() == k) {
  5389. this.choseDay = k - 1;
  5390. }
  5391. }
  5392. } else {
  5393. this.choseDay = 0;
  5394. }
  5395. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5396. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5397. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5398. }
  5399. this.allDate = dayArry;
  5400. //不能超过最大日期
  5401. if (this.choseDay > day-1) {
  5402. this.choseDay = day-1;
  5403. }
  5404. if(sessionStorage.from != 1){
  5405. let nowmonth = new Date().getMonth() + 1
  5406. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5407. let nowdate = new Date().getDate()
  5408. if(nowd == this.date){
  5409. if(e && sessionStorage.msg){
  5410. }else{
  5411. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5412. }
  5413. let nowday = new Date(sessionStorage.msg).getDate()
  5414. this.choseDay = nowday - 1
  5415. let monthdate = new Date(sessionStorage.msg)
  5416. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5417. }else{
  5418. if(e && sessionStorage.msg){
  5419. }else{
  5420. sessionStorage.msg = this.date + '-01'
  5421. }
  5422. let monthdate = new Date(sessionStorage.msg)
  5423. this.choseDay = monthdate.getDate() - 1
  5424. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5425. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5426. }
  5427. }else{
  5428. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5429. }
  5430. //从消息点击跳转过来的,直接加载指定日期
  5431. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5432. this.curDate = sessionStorage.msg;
  5433. sessionStorage.from = 0;
  5434. } else {
  5435. // if (curMonthDay != null) {
  5436. // // this.curDate = curMonthDay;
  5437. // let d = new Date(sessionStorage.msg)
  5438. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5439. // } else {
  5440. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5441. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5442. // }
  5443. }
  5444. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5445. // if(!sessionStorage.msg){
  5446. // let msgday = this.choseDay + 1
  5447. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5448. // }
  5449. this.getReportFillStatus();
  5450. },
  5451. getCountDays() {
  5452. var newstr = this.date.replace(/-/g, "/");
  5453. var curDate = new Date(newstr+'/01');
  5454. var curMonth = curDate.getMonth();
  5455. curDate.setMonth(curMonth + 1);
  5456. curDate.setDate(0);
  5457. return curDate.getDate();
  5458. },
  5459. reqMore() {
  5460. if (this.hasMore) {
  5461. this.pageIndex++;
  5462. this.requestHttpReports();
  5463. }
  5464. },
  5465. //加载日报数据
  5466. requestHttpReports() {
  5467. //请求数据
  5468. this.listLoading = true;
  5469. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5470. let param = {date: this.date + day};
  5471. if (this.deptId) {
  5472. param.deptId = this.deptId;
  5473. }
  5474. if (this.targetUid) {
  5475. param.userId = this.targetUid;
  5476. }
  5477. //传页码
  5478. if (this.hasMore) {
  5479. param.pageIndex = this.pageIndex;
  5480. }
  5481. this.http.post( this.port.report.list, param,
  5482. res => {
  5483. this.listLoading = false;
  5484. if (res.code == "ok") {
  5485. //扩增
  5486. if (res.data.data.length > 0) {
  5487. this.reportList = this.reportList.concat(res.data.data);
  5488. } else if (this.pageIndex > 1){
  5489. this.$message({
  5490. message: '没有更多数据了',
  5491. type: "info"
  5492. });
  5493. }
  5494. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5495. if(document.querySelector("#day"+this.choseDay)){
  5496. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5497. }
  5498. } else {
  5499. this.$message({
  5500. message: res.msg,
  5501. type: "error"
  5502. });
  5503. }
  5504. },
  5505. error => {
  5506. this.listLoading = false;
  5507. this.$message({
  5508. message: error,
  5509. type: "error"
  5510. });
  5511. });
  5512. },
  5513. //获取日报列表
  5514. getReportList() {
  5515. //初始化,重置数据
  5516. this.pageIndex = 0;
  5517. this.hasMore = true;
  5518. this.reportList = [];
  5519. this.requestHttpReports();
  5520. },
  5521. //刷新日报状态,用于审核后更新
  5522. refreshReportData(reportId) {
  5523. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5524. res => {
  5525. if (res.code == "ok") {
  5526. for (var m=0;m<this.reportList.length; m++) {
  5527. var d = this.reportList[m].data;
  5528. var find = d.filter(r=>r.id == reportId);
  5529. if (find.length > 0) {
  5530. find[0].state = res.data.state;
  5531. if (find[0].state == 2) {//被驳回,要可以编辑
  5532. this.reportList[m].state = 2;
  5533. }
  5534. find[0].isDeptAudit = res.data.isDeptAudit;
  5535. find[0].departmentAuditState = res.data.departmentAuditState;
  5536. find[0].projectAuditorName = res.data.projectAuditorName;
  5537. find[0].projectAuditorId = res.data.projectAuditorId;
  5538. find[0].projectAuditState = res.data.projectAuditState;
  5539. find[0].rejectUserid = res.data.rejectUserid;
  5540. find[0].rejectUsername = res.data.rejectUsername;
  5541. find[0].rejectReason = res.data.rejectReason;
  5542. this.$forceUpdate();
  5543. break;
  5544. }
  5545. }
  5546. } else {
  5547. this.$message({
  5548. message: res.msg,
  5549. type: "error"
  5550. });
  5551. }
  5552. },
  5553. error => {
  5554. this.listLoading = false;
  5555. this.$message({
  5556. message: error,
  5557. type: "error"
  5558. });
  5559. });
  5560. },
  5561. //导出员工工时统计
  5562. exportUserTime() {
  5563. this.listLoading = true;
  5564. var param = {};
  5565. if (this.exportParam.dateRange != null) {
  5566. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5567. }
  5568. this.http.post('/department/exportDeptStatistic', param,
  5569. res => {
  5570. this.listLoading = false;
  5571. if (res.code == "ok") {
  5572. location.href = res.data;
  5573. this.exportTimeDialog = false;
  5574. } else {
  5575. this.$message({
  5576. message: res.msg,
  5577. type: "error"
  5578. });
  5579. }
  5580. },
  5581. error => {
  5582. this.listLoading = false;
  5583. this.$message({
  5584. message: error,
  5585. type: "error"
  5586. });
  5587. });
  5588. },
  5589. //导出日报
  5590. exportReport() {
  5591. this.exportingData = true;
  5592. var param = {};
  5593. if (this.exportParam.dateRange != null) {
  5594. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5595. }
  5596. if (this.exportParam.projectId != null) {
  5597. param.projectId = this.exportParam.projectId;
  5598. }
  5599. if (this.exportParam.departmentId != null) {
  5600. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5601. param.departmentIds = this.exportParam.departmentId.join(',')
  5602. }
  5603. param.stateKey = this.stateKey
  5604. // param.departmentId = this.user.departmentId
  5605. console.log(param, '《=== 导出传的参数');
  5606. console.log('开始调用exportReport接口');
  5607. this.http.post(this.port.report.export, param,
  5608. res => {
  5609. this.exportingData = false;
  5610. if (res.code == "ok") {
  5611. var filePath = res.data;
  5612. const a = document.createElement('a'); // 创建a标签
  5613. a.setAttribute('download', this.$t('projectexport') + '.xlsx');// download属性
  5614. a.setAttribute('href', filePath);// href链接
  5615. a.click(); //自执行点击事件
  5616. a.remove();
  5617. this.exportDialog = false;
  5618. } else {
  5619. this.$message({
  5620. message: res.msg,
  5621. type: "error"
  5622. });
  5623. }
  5624. },
  5625. error => {
  5626. this.exportingData = false;
  5627. this.$message({
  5628. message: error,
  5629. type: "error"
  5630. });
  5631. });
  5632. },
  5633. //导出日报审核记录
  5634. exportReportLog() {
  5635. this.exportingData = true;
  5636. var param = {};
  5637. if (this.exportReportLogParam.dateRange != null) {
  5638. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5639. }
  5640. this.http.post('/report-log/exportReportLog', param,
  5641. res => {
  5642. this.exportingData = false;
  5643. if (res.code == "ok") {
  5644. var filePath = res.data;
  5645. const a = document.createElement('a'); // 创建a标签
  5646. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5647. a.setAttribute('href', filePath);// href链接
  5648. a.click(); //自执行点击事件
  5649. a.remove();
  5650. this.exportDialog = false;
  5651. } else {
  5652. this.$message({
  5653. message: res.msg,
  5654. type: "error"
  5655. });
  5656. }
  5657. },
  5658. error => {
  5659. this.exportingData = false;
  5660. this.$message({
  5661. message: error,
  5662. type: "error"
  5663. });
  5664. });
  5665. },
  5666. restUserCardTime(item){
  5667. let param={}
  5668. param.userId=item.userId
  5669. param.createDate=item.createDate
  5670. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5671. res => {
  5672. if (res.code == "ok") {
  5673. this.showMonthWorkTimeReminder()
  5674. } else {
  5675. this.$message({
  5676. message: res.msg,
  5677. type: "error"
  5678. });
  5679. }
  5680. },
  5681. error => {
  5682. this.$message({
  5683. message: error,
  5684. type: "error"
  5685. });
  5686. });
  5687. },
  5688. importReportLog(item){
  5689. //首先判断文件类型
  5690. let str = item.file.name.split(".");
  5691. let format = str[str.length - 1];
  5692. if (format != "xls" && format != "xlsx") {
  5693. this.$message({
  5694. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5695. type: "error"
  5696. });
  5697. } else {
  5698. const loading = this.$loading({
  5699. lock: true,
  5700. text: '正在导入修改中,请耐心等待。',
  5701. spinner: 'el-icon-loading',
  5702. background: 'rgba(0, 0, 0, 0.7)'
  5703. });
  5704. let formData = new FormData();
  5705. formData.append("multipartFile", item.file);
  5706. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5707. res => {
  5708. this.$refs.upload.clearFiles();
  5709. loading.close();
  5710. if (res.code == "ok") {
  5711. this.$message({
  5712. message: res.msg,
  5713. type: "success"
  5714. });
  5715. } else {
  5716. this.$message({
  5717. message: res.msg,
  5718. type: "error"
  5719. });
  5720. }
  5721. },
  5722. error => {
  5723. this.$refs.upload.clearFiles();
  5724. loading.close();
  5725. this.$message({
  5726. message: error,
  5727. type: "error"
  5728. });
  5729. });
  5730. }
  5731. },
  5732. //获取项目列表
  5733. getProjectList() {
  5734. this.listLoading = true;
  5735. this.http.post( this.port.project.list, {},
  5736. res => {
  5737. this.listLoading = false;
  5738. if (res.code == "ok") {
  5739. for(var i in res.data) {
  5740. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5741. res.data[i].projectCode = ''
  5742. }
  5743. }
  5744. this.projectList = res.data;
  5745. console.log("项目列表",this.projectList);
  5746. } else {
  5747. this.$message({
  5748. message: res.msg,
  5749. type: "error"
  5750. });
  5751. }
  5752. },
  5753. error => {
  5754. this.listLoading = false;
  5755. this.$message({
  5756. message: error,
  5757. type: "error"
  5758. });
  5759. });
  5760. },
  5761. // 获取填报日报的项目下拉列表
  5762. getFillProjectList() {
  5763. this.http.post( this.port.project.list, {
  5764. forReport: 1
  5765. },res => {
  5766. if (res.code == "ok") {
  5767. for(var i in res.data) {
  5768. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5769. res.data[i].projectCode = ''
  5770. }
  5771. }
  5772. this.fillProjectList = res.data;
  5773. this.getRecentlyProject()
  5774. } else {
  5775. this.$message({
  5776. message: res.msg,
  5777. type: "error"
  5778. });
  5779. }
  5780. },
  5781. error => {
  5782. this.$message({
  5783. message: error,
  5784. type: "error"
  5785. });
  5786. });
  5787. },
  5788. getBasecostItemList() {
  5789. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5790. companyId: this.user.companyId
  5791. },
  5792. res => {
  5793. if (res.code == "ok") {
  5794. this.timeBasecostList = res.data;
  5795. }
  5796. });
  5797. },
  5798. getAIReport(createDate) {
  5799. this.http.post('/report/getAIReport', {},
  5800. res => {
  5801. if (res.code == "ok") {
  5802. var quanbu = 0
  5803. this.jsDay = 1
  5804. var zhi = ''
  5805. var slp = res.data
  5806. for(var i in slp) {
  5807. var sp = +slp[i].workingTime + 0
  5808. zhi = this.jsDay * sp
  5809. quanbu = +quanbu + zhi
  5810. }
  5811. this.jsTime = quanbu
  5812. var aiReportData = res.data;
  5813. this.canCancelInDialog = false
  5814. if(aiReportData.length != 0) {
  5815. var arr = [];
  5816. for(var i in aiReportData) {
  5817. arr.push({
  5818. id: null,
  5819. projectId: aiReportData[i].projectId,
  5820. workingTime: aiReportData[i].workingTime,
  5821. content: '',
  5822. progress:100,
  5823. state: 2,
  5824. timeType: aiReportData[i].timeType,
  5825. subProjectList: aiReportData[i].subProjectList,
  5826. taskList: aiReportData[i].taskList,
  5827. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5828. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5829. taskId: aiReportData[i].taskId,
  5830. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5831. startTime: aiReportData[i].startTime,
  5832. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5833. endTime: aiReportData[i].endTime,
  5834. isOvertime: 0,
  5835. progress:aiReportData[i].progress,
  5836. professionProgress: aiReportData[i].professionProgressList,
  5837. stages:aiReportData[i].stages,
  5838. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5839. pics: null,
  5840. multiWorktime: aiReportData[i].multiWorktime || 0,
  5841. worktimeList: [{}],
  5842. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5843. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5844. wuduList: aiReportData[i].degreeList,
  5845. taskGroups:aiReportData[i].taskGroups,
  5846. customData: aiReportData[i].customData,//自定义的数值
  5847. auditUserList: aiReportData[i].auditUserList,
  5848. projectAuditorId: aiReportData[i].projectAuditorId,
  5849. projectAuditorName: aiReportData[i].projectAuditorName,
  5850. overtimeHours: aiReportData[i].overtimeHours,
  5851. customText: aiReportData[i].customText,
  5852. basecostId: aiReportData[i].basecostId,
  5853. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5854. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5855. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5856. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5857. canEdit: true
  5858. })
  5859. }
  5860. this.workForm.domains = arr;
  5861. } else {
  5862. }
  5863. this.canEdit = true;
  5864. this.originCanEdit = true;
  5865. this.seleChn()
  5866. } else {
  5867. this.$message({
  5868. message: res.msg,
  5869. type: "error"
  5870. });
  5871. }
  5872. },
  5873. error => {
  5874. this.$message({
  5875. message: error,
  5876. type: "error"
  5877. });
  5878. });
  5879. },
  5880. // 获取个人某天的日报 111111
  5881. getReport() {
  5882. this.http.post( this.port.report.getPort, {
  5883. date: this.workForm.createDate
  5884. },
  5885. res => {
  5886. if (res.code == "ok") {
  5887. var quanbu = 0
  5888. this.jsDay = 1
  5889. var zhi = ''
  5890. var slp = res.data.report
  5891. for(var i in slp) {
  5892. var sp = +slp[i].workingTime + 0
  5893. zhi = this.jsDay * sp
  5894. quanbu = +quanbu + zhi
  5895. }
  5896. this.jsTime = quanbu
  5897. var list = res.data;
  5898. this.report = list;
  5899. this.reportTimeType = this.report.timeType;
  5900. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5901. this.isWeekend = !this.report.isWorkDay;
  5902. this.canCancelInDialog = false;
  5903. this.hasWrittenReport = list.report.length != 0;
  5904. if(list.report.length != 0) {
  5905. var arr = [];
  5906. this.canEdit = false;
  5907. let candelete = true
  5908. for(var i in list.report) {
  5909. var flg = null
  5910. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5911. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5912. var filteredRespList = null
  5913. if (targetP.length > 0) {
  5914. var isPublic = targetP[0].isPublic;
  5915. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5916. }
  5917. arr.push({
  5918. id: list.report[i].id,
  5919. projectId: list.report[i].projectId,
  5920. workingTime: list.report[i].workingTime,
  5921. content: list.report[i].content,
  5922. state: list.report[i].state,
  5923. timeType: list.report[i].timeType,
  5924. subProjectList: list.report[i].subProjectList,
  5925. taskList: list.report[i].taskList,
  5926. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5927. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5928. taskId: list.report[i].taskId,
  5929. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5930. startTime: list.report[i].startTime,
  5931. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5932. endTime: list.report[i].endTime,
  5933. isOvertime: flg,
  5934. progress:list.report[i].progress,
  5935. professionProgress: list.report[i].professionProgressList,
  5936. stages:list.report[i].stages,
  5937. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5938. pics: list.report[i].pics,
  5939. multiWorktime: list.report[i].multiWorktime,
  5940. worktimeList: list.report[i].worktimeList,
  5941. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5942. multiDegrIdArray: list.report[i].multiDegrIdList,
  5943. wuduList: list.report[i].degreeList,
  5944. taskGroups:list.report[i].taskGroups,
  5945. customData: list.report[i].customData,//自定义的数值
  5946. auditUserList: list.report[i].auditUserList,
  5947. projectAuditorId: list.report[i].projectAuditorId,
  5948. projectAuditorName: list.report[i].projectAuditorName,
  5949. overtimeHours: list.report[i].overtimeHours,
  5950. customText: list.report[i].customText,
  5951. basecostId: list.report[i].basecostId,
  5952. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5953. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5954. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5955. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5956. canEdit: list.report[i].state >= 2 ? true : false,
  5957. extraField1: list.report[i].extraField1,
  5958. extraField2: list.report[i].extraField2,
  5959. extraField3: list.report[i].extraField3,
  5960. workContentList: list.report[i].workContentList,
  5961. filteredRespList: filteredRespList,
  5962. serviceList: list.report[i].serviceList,
  5963. sapServiceId: list.report[i].sapServiceId,
  5964. reportTargetDeptId: list.report[i].deptId
  5965. })
  5966. if (list.report[i].state >= 2) {
  5967. this.canEdit = true;
  5968. }
  5969. if(list.report[i].state < 2){
  5970. candelete = false
  5971. }
  5972. if (list.report[i].state == 0){
  5973. this.canCancelInDialog = true
  5974. }
  5975. // 加判断
  5976. if(this.user.timeType.choseFromAlbum == 1) {
  5977. let arrList = []
  5978. for(var k in list.report[i].pics) {
  5979. let obj = {
  5980. name: k,
  5981. url: list.report[i].pics[k]
  5982. }
  5983. arrList.push(obj)
  5984. }
  5985. arr[i].imgListUrl = arrList
  5986. arr[i].imgList = list.report[i].pics
  5987. }
  5988. }
  5989. this.reportCanDelete = candelete
  5990. this.workForm = {
  5991. createDate: this.workForm.createDate,
  5992. domains: arr,
  5993. userNames:null,
  5994. userId:null,
  5995. time: list.time,
  5996. showRefresh: list.showRefresh
  5997. }
  5998. console.log('workForm', this.workForm)
  5999. } else {
  6000. this.workForm = {
  6001. createDate: this.workForm.createDate,
  6002. domains: [{
  6003. id: null,
  6004. projectId: "",
  6005. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6006. content: "",
  6007. progress:100,
  6008. state: 2,
  6009. timeType:0,
  6010. multiWorktime: this.reportTimeType.multiWorktime,
  6011. worktimeList:[{}],
  6012. canEdit: true,
  6013. auditorFirst: '',
  6014. auditorSec: '',
  6015. auditorThird: '',
  6016. ccUserid: ''
  6017. }],
  6018. userId:null,
  6019. userNames:null,
  6020. time: this.report.time,
  6021. showRefresh: list.showRefresh
  6022. }
  6023. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6024. this.$set(this.workForm.domains[0],'isOvertime',true)
  6025. if(this.reportTimeType.type != 2){
  6026. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6027. }
  6028. }
  6029. if(this.user.timeType.type == 1) {
  6030. var shuzhi = this.user.timeType.allday + ''
  6031. // console.log('执行一次', shuzhi.indexOf('.'))
  6032. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6033. }
  6034. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6035. //默认给第一个,必填字段
  6036. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6037. }
  6038. this.canEdit = true;
  6039. }
  6040. this.originCanEdit = this.canEdit;
  6041. this.seleChn()
  6042. } else {
  6043. this.$message({
  6044. message: res.msg,
  6045. type: "error"
  6046. });
  6047. }
  6048. },
  6049. error => {
  6050. this.$message({
  6051. message: error,
  6052. type: "error"
  6053. });
  6054. });
  6055. },
  6056. guanbi() {
  6057. this.falsss = false,
  6058. this.workTimeForMinYi=0
  6059. },
  6060. // 打开日报填写
  6061. fillInReport(i, isBatch) {
  6062. this.isWeekend = false
  6063. this.reportCanDelete = false
  6064. // console.log(this.user.timeType.type, '选择时长')
  6065. if(i != 1) {
  6066. this.falsss = false
  6067. } else {
  6068. this.falsss = true
  6069. }
  6070. if (this.isSubstitude) {
  6071. this.getSubstitudeUserDeptList();
  6072. }
  6073. if(i == -1 || this.isSubstitude) {
  6074. this.isDisable = false;
  6075. } else {
  6076. this.isDisable = true;
  6077. }
  6078. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6079. this.isBatch = isBatch;
  6080. if (this.isBatch == 0 && !this.isSubstitude) {
  6081. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6082. let weekday = new Date(this.workForm.createDate).getDay()
  6083. if(this.user.companyId == 817){
  6084. if(weekday == 0){
  6085. this.isWeekend = true
  6086. }
  6087. }else{
  6088. if(weekday == 0 || weekday == 6){
  6089. this.isWeekend = true
  6090. }
  6091. }
  6092. this.getReport(i);
  6093. } else {
  6094. // console.log('执行到了这里')
  6095. this.jsTime = 0
  6096. this.jsDay = 0
  6097. this.workForm = {
  6098. createDate: null,//批量填报没有日期
  6099. domains: [{
  6100. id: null,
  6101. projectId: "",
  6102. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6103. content: "",
  6104. progress:100,
  6105. state: 2,
  6106. timeType:0,
  6107. multiWorktime: this.reportTimeType.multiWorktime,
  6108. worktimeList:[{}],
  6109. canEdit: true,
  6110. }],
  6111. }
  6112. if(this.user.timeType.type == 1) {
  6113. var shuzhi = this.user.timeType.allday + ''
  6114. // console.log('执行二次')
  6115. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6116. }
  6117. // console.log(this.workForm)
  6118. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6119. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6120. }
  6121. this.canEdit = true;
  6122. }
  6123. this.dialogVisible = true;
  6124. },
  6125. //按周填报的弹窗口中编辑单项目相关数据
  6126. setWeekFormReportItem(reportId, i, names, row,sss) {
  6127. console.log(sss)
  6128. this.http.post('/report/getReportById', {
  6129. reportId: reportId
  6130. },
  6131. res => {
  6132. if (res.code == "ok") {
  6133. var data = res.data.report;
  6134. sss.subProjectId = data.subProjectId
  6135. sss.subProjectList = data.subProjectList;
  6136. sss.stage = data.stage
  6137. sss.subProjectList = data.subProjectList
  6138. sss.stages = data.stages
  6139. sss.taskGroups = data.taskGroups;
  6140. sss.auditUserList = data.auditUserList;
  6141. sss.degreeId = data.degreeId;
  6142. sss.customData = data.customData;
  6143. sss.wuduList = data.degreeList;
  6144. this.zhoBaoIdx = i
  6145. this.zhoBaoName = names
  6146. this.zhoBao = sss
  6147. this.zhis = row
  6148. if (sss.groupId) {
  6149. //最后一个参数表示是否保留stage的值,不要重置为空
  6150. this.getGroupStages(this.zhoBao, 0, true)
  6151. }
  6152. this.$forceUpdate();
  6153. }
  6154. });
  6155. },
  6156. // 按周填报里内容的填写
  6157. showWeekItemEdit(item, i, projectId,names, row) {
  6158. if (item.state == 0) {
  6159. this.$message({
  6160. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  6161. type: "error"
  6162. });
  6163. return;
  6164. }
  6165. if (item.state == 1) {
  6166. this.$message({
  6167. message: '已通过状态不可修改',
  6168. type: "error"
  6169. });
  6170. return;
  6171. }
  6172. if(this.user.timeType.notAllowedNoAttendance == 1){
  6173. if(this.zhoData[i].corpTime){
  6174. if(this.zhoData[i].corpTime.workHours == 0){
  6175. this.$message({
  6176. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6177. type: 'error'
  6178. })
  6179. return
  6180. }
  6181. }else{
  6182. this.$message({
  6183. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6184. type: 'error'
  6185. })
  6186. return
  6187. }
  6188. }
  6189. var obj = {}
  6190. obj.projectId = projectId
  6191. this.tianxieDialogVisible = true
  6192. this.scopess = item
  6193. var sss = {}
  6194. if (item.id != null) {
  6195. sss.id = item.id;
  6196. sss.state = item.state;
  6197. } else {
  6198. sss.id = -1;
  6199. sss.state = 3;
  6200. }
  6201. sss.projectId = projectId;
  6202. sss.progress = item.progress
  6203. sss.time = item.time
  6204. sss.content = item.content;
  6205. console.log('333', sss.content)
  6206. if (sss.time == '' && this.reportTimeType.type == 2) {
  6207. //取已填时间范围中最大的一个作为开始时间
  6208. var startTime = '09:00';
  6209. var fillStartTime = '00:00';
  6210. for (var t in this.selProjectList) {
  6211. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6212. if (fillItem.time) {
  6213. if (fillItem.time[1] > fillStartTime) {
  6214. fillStartTime = fillItem.time[1];
  6215. }
  6216. }
  6217. }
  6218. if (fillStartTime == '00:00') {
  6219. fillStartTime = '09:00';
  6220. }
  6221. var fillEndMax = '18:00';
  6222. if (fillStartTime >= '18:00') {
  6223. fillEndMax = '23:59';
  6224. }
  6225. sss.time = [fillStartTime, fillEndMax];
  6226. }
  6227. sss.groupId = item.groupId
  6228. sss.stage = item.stage;
  6229. sss.workingTime = item.workingTime
  6230. sss.projectAuditorId = item.projectAuditorId;
  6231. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6232. //默认选中第一个
  6233. sss.basecostId = this.timeBasecostList[0].id;
  6234. }
  6235. var hasEdited = this.zhoData[i][names].hasEdited;
  6236. if (hasEdited) {
  6237. sss = { ...item }
  6238. //编辑过了
  6239. sss.subProjectId = item.subProjectId
  6240. sss.stage = item.stage
  6241. sss.subProjectList = item.subProjectList
  6242. sss.stages = item.stages
  6243. sss.taskGroups = item.taskGroups;
  6244. console.log(sss.taskGroups, '33333');
  6245. sss.auditUserList = obj.auditUserList;
  6246. sss.degreeId = item.degreeId;
  6247. sss.customData = item.customData;
  6248. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6249. //只有一个审核人,自动设置上去
  6250. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6251. }
  6252. sss.wuduList = item.wuduList;
  6253. this.zhoBaoIdx = i
  6254. this.zhoBaoName = names
  6255. this.zhoBao = sss
  6256. this.zhis = row
  6257. if (sss.groupId) {
  6258. //最后一个参数表示是否保留stage的值,不要重置为空
  6259. this.getGroupStages(this.zhoBao, 0, true)
  6260. }
  6261. this.$forceUpdate();
  6262. this.getWeeklyTaskList(sss)
  6263. console.log('最后的周报 ===>', this.zhoBao)
  6264. } else {
  6265. //第一次打开,获取数据
  6266. if (sss.id == -1) {
  6267. //新填报的
  6268. this.selectProject(obj, 0);
  6269. var that = this
  6270. setTimeout(() =>{
  6271. sss.subProjectId = that.workForm.domains[0].subProjectId
  6272. sss.subProjectList = item.subProjectList;
  6273. sss.stage = that.workForm.domains[0].stage
  6274. sss.subProjectList = that.workForm.domains[0].subProjectList
  6275. sss.stages = that.workForm.domains[0].stages
  6276. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6277. sss.auditUserList = obj.auditUserList;
  6278. sss.degreeId = item.degreeId;
  6279. sss.customData = item.customData;
  6280. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6281. //只有一个审核人,自动设置上去
  6282. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6283. }
  6284. sss.wuduList = row[0].wuduList
  6285. that.zhoBaoIdx = i
  6286. that.zhoBaoName = names
  6287. that.zhoBao = sss
  6288. that.zhis = row
  6289. if (sss.groupId) {
  6290. //最后一个参数表示是否保留stage的值,不要重置为空
  6291. this.getGroupStages(that.zhoBao, 0, false)
  6292. }
  6293. that.$forceUpdate();
  6294. this.getWeeklyTaskList(sss)
  6295. },600);
  6296. } else {
  6297. //编辑填报过的;数据库已经存在的
  6298. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6299. }
  6300. }
  6301. },
  6302. // 按周填报里内容的填写点击确定
  6303. setWeekProItemData() {
  6304. //专业版模式下,任务分组和阶段必填
  6305. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6306. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6307. this.$message({
  6308. message: '任务分组和阶段必填,请检查',
  6309. type: "error"
  6310. });
  6311. return;
  6312. }
  6313. }
  6314. // 检查任务分组
  6315. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6316. this.$message({
  6317. message: '任务分组必填,请检查',
  6318. type: "error"
  6319. });
  6320. return
  6321. }
  6322. //检查子项目是否必填
  6323. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6324. this.$message({
  6325. message: '子项目必填,请检查',
  6326. type: "error"
  6327. });
  6328. return;
  6329. }
  6330. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6331. this.$message({
  6332. message: this.$t('message.Pleaseselectareviewer'),
  6333. type: "error"
  6334. });
  6335. return
  6336. }
  6337. if(this.user.timeType.reportAuditType == 3){
  6338. let auditTips = ''
  6339. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6340. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6341. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6342. if(auditTips){
  6343. auditTips = auditTips.substring(0,auditTips.length - 1)
  6344. this.$message({
  6345. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6346. type: 'error'
  6347. })
  6348. return
  6349. }
  6350. }
  6351. let errtips = ''
  6352. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6353. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6354. errtips += this.user.timeType.customDegreeName + '、'
  6355. }
  6356. }
  6357. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6358. errtips += this.user.timeType.customDataName + '、'
  6359. }
  6360. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6361. errtips += this.user.timeType.customTextName + '、'
  6362. }
  6363. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6364. errtips += this.$t('other.workMatters') +'、'
  6365. }
  6366. if(errtips){
  6367. errtips = errtips.substring(0,errtips.length - 1)
  6368. this.$message({
  6369. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6370. type: 'error'
  6371. })
  6372. return
  6373. }
  6374. this.tianxieDialogVisible = false
  6375. var zhong = this.zhoData
  6376. this.zhoBao.hasEdited = true;
  6377. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6378. this.zhoData = zhong
  6379. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6380. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6381. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6382. },
  6383. // 获取本周
  6384. getCurrentWeek() {
  6385. //今天
  6386. this.targetWeekDate = new Date();
  6387. this.initWeekFormData();
  6388. // this.jiazai()
  6389. },
  6390. // 获取上周
  6391. handleGetPrevWeek() {
  6392. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6393. this.initWeekFormData();
  6394. // this.jiazai()
  6395. },
  6396. // 获取下周
  6397. handleGetNextvWeek() {
  6398. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6399. this.initWeekFormData()
  6400. },
  6401. // 加载动画
  6402. jiazai() {
  6403. this.weekDataLoading = true
  6404. var that = this
  6405. setTimeout(() =>{
  6406. that.weekDataLoading = false
  6407. },1000);
  6408. },
  6409. // 转时间格式
  6410. dealdate(date) {
  6411. const dt = new Date(date)
  6412. const y = dt.getFullYear()
  6413. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6414. const d = (dt.getDate() + '').padStart(2, '0')
  6415. return `${y}-${m}-${d}`
  6416. },
  6417. // 按周填报
  6418. fillInReportss() {
  6419. window.addEventListener('scroll', this.handleScroll, true)
  6420. // this.jiazai()
  6421. this.fillWeekDialogVisi = true;
  6422. if (this.isSubstitude) {
  6423. this.substitudeStep = 1;
  6424. this.getSubstitudeUserDeptList();
  6425. } else {
  6426. this.getCurrentWeek();
  6427. }
  6428. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6429. //重新获取工时预警类型的预算项
  6430. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6431. companyId: this.user.companyId
  6432. },
  6433. res => {
  6434. if (res.code == "ok") {
  6435. this.timeBasecostList = res.data;
  6436. }
  6437. });
  6438. }
  6439. },
  6440. fillInReportCustom() {
  6441. this.weekIndex++
  6442. this.weekParentData = {
  6443. isSubstitude: this.isSubstitude
  6444. }
  6445. this.fillWeekDialogVisiCustom = true
  6446. },
  6447. // 按周填报的项目筛选
  6448. selListFun(){
  6449. this.selProjectList = []
  6450. if(this.selCon.length){
  6451. for (let i = 0; i < this.selCon.length; i++) {
  6452. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6453. }
  6454. this.selConShow = false ;
  6455. for (let i in this.zhoData) {
  6456. var obj = this.zhoData[i];
  6457. for(var j in this.selProjectList) {
  6458. var xinzhi = this.selProjectList[j].projectName
  6459. obj[xinzhi] = {}
  6460. obj[xinzhi].time = ''
  6461. obj[xinzhi].content = ''
  6462. obj[xinzhi].progress = 0
  6463. obj[xinzhi].workingTime = 0
  6464. }
  6465. }
  6466. this.initWeekFormData();
  6467. }else{
  6468. this.$message({
  6469. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6470. type:'error'
  6471. })
  6472. }
  6473. },
  6474. setWeekCardTimeData(list) {
  6475. for(let i in list){
  6476. let datei = '';
  6477. if (this.user.timeType.showDdCardtime == 1) {
  6478. datei = list[i].workDate;
  6479. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6480. datei = list[i].createDate;
  6481. } else if (this.user.timeType.syncFanwei == 1) {
  6482. datei = list[i].workDate;
  6483. }
  6484. for(let m in this.zhoData) {
  6485. if(datei == this.zhoData[m].zhoDataTime){
  6486. let item = {
  6487. startTime: list[i].startTime,
  6488. endTime: list[i].endTime,
  6489. workHours: list[i].workHours
  6490. }
  6491. this.$set(this.zhoData[m],'corpTime',item)
  6492. }
  6493. }
  6494. }
  6495. },
  6496. getWeeklyCardTime(){ //按周填报获取考勤信息
  6497. let dateStr = []
  6498. for(let i in this.zhoData){
  6499. dateStr.push(this.zhoData[i].zhoDataTime)
  6500. }
  6501. this.http.post('/report/getWeeklyCardTime',{
  6502. dateStr: JSON.stringify(dateStr)
  6503. },res => {
  6504. if(res.code == 'ok'){
  6505. for(let i in res.data){
  6506. let datei = '';
  6507. if (this.user.timeType.showDdCardtime == 1) {
  6508. datei = res.data[i].workDate.split('-');
  6509. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6510. datei = res.data[i].createDate.split('-');
  6511. }
  6512. for(let m in this.zhoData){
  6513. let datem = new Date(this.zhoData[m].zhoDataTime)
  6514. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6515. let item = {
  6516. startTime: res.data[i].startTime,
  6517. endTime: res.data[i].endTime,
  6518. workHours: res.data[i].workHours
  6519. }
  6520. this.$set(this.zhoData[m],'corpTime',item)
  6521. }
  6522. }
  6523. }
  6524. }else{
  6525. this.$message({
  6526. message: res.msg,
  6527. type: 'error'
  6528. })
  6529. }
  6530. },err => {
  6531. this.$message({
  6532. message: err,
  6533. type: 'error'
  6534. })
  6535. })
  6536. },
  6537. selListqx(){
  6538. this.fillWeekDialogVisi = false
  6539. this.selProjectList = []
  6540. this.selCon = []
  6541. },
  6542. handleScroll() {
  6543. this.changdu = this.projectList.length + 1
  6544. },
  6545. // 自动选择时间点的事件
  6546. // async zhoTimes(item, i) {
  6547. // var iss = i
  6548. // if(item.time == null) {
  6549. // return
  6550. // } else {
  6551. // const zhi = this.zhoData[iss];
  6552. // let he = 0;
  6553. // const timeArr = Object.values(zhi)
  6554. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6555. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6556. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6557. // console.log(data, 'data');
  6558. // zhi.he = `${he}h`;
  6559. // }
  6560. // },
  6561. async zhoTimes(item, index) {
  6562. const zho = this.zhoData[index];
  6563. if (!item.time) {
  6564. return;
  6565. }
  6566. const timeArr = Object.values(zho)
  6567. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6568. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6569. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6570. zho.he = `${totalHours[0]}h`;
  6571. },
  6572. // 判断两个时间段是否重叠
  6573. timeOverlap(idx, dateAr) {
  6574. let zhi = 0
  6575. for (let k in dateAr) {
  6576. if (idx !== k) {
  6577. 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))) {
  6578. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6579. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6580. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6581. }
  6582. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6583. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6584. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6585. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6586. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6587. } else {
  6588. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6589. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6590. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6591. }
  6592. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6593. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6594. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6595. }
  6596. }
  6597. }
  6598. }
  6599. }
  6600. return zhi
  6601. },
  6602. // 计算时间
  6603. getHourMinutes(str, end) {
  6604. var he = 0
  6605. var date2 = '2021/12/12 ' + end +':00'
  6606. var date1 = '2021/12/12 ' + str +':00'
  6607. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6608. var leave1=date3%(24*3600*1000)
  6609. var hours=Math.floor(leave1/(3600*1000))
  6610. var leave2=leave1%(3600*1000)
  6611. var minutes=Math.floor(leave2/(60*1000))
  6612. var shi = hours+'.'+ minutes
  6613. return he += +shi
  6614. },
  6615. // 自动选择事件长度的事件
  6616. zhoXuan(item, i) {
  6617. var iss = i
  6618. if(item.time == null) {
  6619. return
  6620. } else {
  6621. var zhi = this.zhoData[iss]
  6622. var he = 0
  6623. for(var i in zhi) {
  6624. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6625. he += +zhi[i].workingTime
  6626. }
  6627. }
  6628. zhi.he = he + 'h'
  6629. }
  6630. },
  6631. getPushWorkLogData(){
  6632. this.http.post('/sap-sync-log/list', {},
  6633. res => {
  6634. if (res.code == "ok") {
  6635. this.pushWorkTimeLogData = res.data;
  6636. } else {
  6637. this.$message({
  6638. message: res.msg,
  6639. type: "error"
  6640. });
  6641. }
  6642. },
  6643. error => {
  6644. this.$message({
  6645. message: error,
  6646. type: "error"
  6647. });
  6648. });
  6649. },
  6650. // 获取全部人员
  6651. getUsers() {
  6652. this.http.post('/user/getSimpleActiveUserList', {},
  6653. res => {
  6654. if (res.code == "ok") {
  6655. this.usersList = res.data;
  6656. } else {
  6657. this.$message({
  6658. message: res.msg,
  6659. type: "error"
  6660. });
  6661. }
  6662. },
  6663. error => {
  6664. this.$message({
  6665. message: error,
  6666. type: "error"
  6667. });
  6668. });
  6669. },
  6670. // 按时间比例
  6671. addBli(item, i) {
  6672. var iss = i
  6673. if(item.time == null) {
  6674. return
  6675. } else {
  6676. var zhi = this.zhoData[iss]
  6677. var he = 0
  6678. for(var i in zhi) {
  6679. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6680. he += +zhi[i].workingTime
  6681. }
  6682. }
  6683. zhi.he = he.toFixed(1) + 'h'
  6684. }
  6685. },
  6686. //按周填报选择的项目发生变化,需要设置列
  6687. onSelProjectChange() {
  6688. for (let i = 0; i < this.selCon.length; i++) {
  6689. var exists = false;
  6690. for (let j = 0; j < this.selProjectList.length; j++) {
  6691. if (this.selProjectList[j].id == this.selCon[i]) {
  6692. exists = true;
  6693. break;
  6694. }
  6695. }
  6696. if (!exists) {
  6697. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6698. this.selProjectList.push(newProject);
  6699. //添加新项目
  6700. for (var w in this.zhoData) {
  6701. var dayItem = this.zhoData[w];
  6702. var pName = newProject.projectName;
  6703. dayItem[pName] = {};
  6704. dayItem[pName].time = ''
  6705. dayItem[pName].content = ''
  6706. dayItem[pName].progress = 0
  6707. dayItem[pName].workingTime = 0
  6708. }
  6709. }
  6710. }
  6711. //去掉
  6712. for (let j = 0; j < this.selProjectList.length; j++) {
  6713. var exists = false;
  6714. for (let i = 0; i < this.selCon.length; i++) {
  6715. if (this.selProjectList[j].id == this.selCon[i]) {
  6716. exists = true;
  6717. break;
  6718. }
  6719. }
  6720. if (!exists) {
  6721. this.selProjectList.splice(j, 1);
  6722. j--;
  6723. }
  6724. }
  6725. this.loadFilledWeekReportItem();
  6726. //刷新表格
  6727. // this.$refs.weekTable.doLayout();
  6728. },
  6729. //根据选中的项目来刷新填写表格
  6730. loadFilledWeekReportItem() {
  6731. for (var w in this.zhoData) {
  6732. var dayItem = this.zhoData[w];
  6733. for (var i = 0; i < this.selProjectList.length; i++) {
  6734. var curColumnProject = this.selProjectList[i];
  6735. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6736. for (var t in dayItem.reportList) {
  6737. //有日报的项目,不能取消选择
  6738. for (var p in this.fillProjectList) {
  6739. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6740. }
  6741. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6742. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6743. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6744. if (this.reportTimeType.type == 2) {
  6745. //时间段模式
  6746. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6747. }
  6748. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6749. break;
  6750. }
  6751. }
  6752. // dayItem[curColumnProject.projectName] = matchReportItem;
  6753. }
  6754. }
  6755. this.$nextTick(()=>{
  6756. this.$refs.weekTable.doLayout();
  6757. });
  6758. },
  6759. initWeekFormData() {
  6760. this.weekDataLoading = true;
  6761. for (var p in this.fillProjectList) {
  6762. this.fillProjectList[p].canCancel = 1;
  6763. }
  6764. var param = {
  6765. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6766. };
  6767. if (this.isSubstitude) {
  6768. //传代填人的userId
  6769. param.targetUserId = this.workForm.userId[0];
  6770. }
  6771. this.http.post('/report/getWeeklyReportData',param,res => {
  6772. this.weekDataLoading = false;
  6773. if(res.code == 'ok'){
  6774. let projectList = res.data.projectList;
  6775. if (projectList.length > 0) {
  6776. //有选择过项目进行填报,直接选中
  6777. this.selProjectList = projectList;
  6778. this.selCon = [];
  6779. for (let i = 0; i < projectList.length; i++) {
  6780. this.selCon.push(projectList[i].id);
  6781. }
  6782. }
  6783. //设置日期
  6784. this.weekDateRange = res.data.dateList;
  6785. this.zhoData = [];
  6786. var arrst = []
  6787. for(var i in this.weekDateRange) {
  6788. var obj = {}
  6789. obj.zhoDataTime = this.weekDateRange[i].date
  6790. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6791. obj.he = this.weekDateRange[i].filledTime;
  6792. obj.canFill = this.weekDateRange[i].canFill;
  6793. // obj.filledTime = this.weekDateRange[i].filledTime;
  6794. obj.reportList = this.weekDateRange[i].reportList;
  6795. //初始化,防止渲染报错
  6796. for (var j = 0; j < this.selProjectList.length; j++) {
  6797. var pName = this.selProjectList[j].projectName
  6798. obj[pName] = {}
  6799. obj[pName].time = ''
  6800. obj[pName].content = ''
  6801. obj[pName].progress = 0
  6802. obj[pName].workingTime = 0
  6803. }
  6804. arrst.push(obj)
  6805. }
  6806. this.zhoData = arrst
  6807. this.setWeekCardTimeData(res.data.cardTimeList);
  6808. this.loadFilledWeekReportItem();
  6809. }else{
  6810. this.$message({
  6811. message: res.msg,
  6812. type: 'error'
  6813. })
  6814. }
  6815. },err => {
  6816. this.$message({
  6817. message: err,
  6818. type: 'error'
  6819. })
  6820. })
  6821. },
  6822. zhoZhi(res, i) {
  6823. var zhi = 0
  6824. for(var i in res) {
  6825. if(i != 'zhoDataTime' && i != 'he') {
  6826. zhi += +res[i]
  6827. }
  6828. }
  6829. res.he = zhi
  6830. },
  6831. zhoBtn(i) {
  6832. // this.zhoData.split(i, 1)
  6833. var arr = this.zhoData
  6834. arr.splice(i, 1)
  6835. },
  6836. zhoAddlast(){
  6837. this.selConShow = true
  6838. },
  6839. closeAddWeeklyReport(){
  6840. this.fillWeekDialogVisi = false
  6841. this.selConShow = true
  6842. this.selProjectList = []
  6843. this.selCon = []
  6844. },
  6845. checkDateWorkTime() {
  6846. //针对苏州景昱,单独的检查逻辑
  6847. if (this.user.companyId == 5978) {
  6848. //调接口,先检查工时是否存在异常
  6849. var zhi = this.zhoData;
  6850. var array = [];
  6851. for(let n in zhi){
  6852. if(zhi[n].he){
  6853. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6854. array.push(workData)
  6855. }
  6856. }
  6857. this.submitingReport = true;
  6858. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6859. res => {
  6860. this.submitingReport = false;
  6861. if (res.code == "ok") {
  6862. this.submitWeekReport(0)
  6863. } else {
  6864. this.$confirm(res.msg, '提示', {
  6865. confirmButtonText: '忽略并提交',
  6866. cancelButtonText: '取消',
  6867. type: 'error'
  6868. }).then(() => {
  6869. this.submitWeekReport(0)
  6870. }).catch(() => {
  6871. });
  6872. }
  6873. },
  6874. error => {
  6875. this.$message({
  6876. message: error,
  6877. type: "error"
  6878. });
  6879. });
  6880. }
  6881. },
  6882. // 提交按周填报
  6883. submitWeekReport(isDraft) {
  6884. var zhi = this.zhoData
  6885. var ll = 0
  6886. if(this.reportTimeType.type == 2) {
  6887. for(var i in zhi) {
  6888. this.dateAr = []
  6889. var alp = []
  6890. var zhis = zhi[i]
  6891. console.log(zhis)
  6892. for(var j in zhis) {
  6893. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6894. let objs = {}
  6895. objs.s = zhis[j].time[0]
  6896. objs.e = zhis[j].time[1]
  6897. objs.p = j
  6898. alp.push(objs)
  6899. }
  6900. }
  6901. console.log(alp)
  6902. this.dateAr = alp
  6903. if (this.reportTimeType.timeCanOverlap == 0) {
  6904. let str = this.$t('message.Filledtimeperiodsoverlap')
  6905. if(this.dateAr.length > 0) {
  6906. const trus = this.fns();
  6907. const overlapDataTime = this.getOverlapData(alp);
  6908. if (overlapDataTime.length > 0) {
  6909. const arrList = overlapDataTime.map((item) => item.p);
  6910. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6911. }
  6912. ll += 1
  6913. if(!trus) {
  6914. this.$message({
  6915. message: str,
  6916. type: 'error'
  6917. })
  6918. return false
  6919. }
  6920. }
  6921. } else {
  6922. if(this.dateAr.length > 0) {
  6923. ll +=1 ;
  6924. }
  6925. }
  6926. }
  6927. if(ll == 0) {
  6928. this.$message({
  6929. message: this.$t('message.Pleasefillinthetime'),
  6930. type: 'error'
  6931. })
  6932. return false
  6933. }
  6934. } else if(this.reportTimeType.type == 1){
  6935. for(var i in zhi) {
  6936. var zhis = zhi[i]
  6937. for(var j in zhis) {
  6938. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6939. ll += 1
  6940. }
  6941. }
  6942. }
  6943. if(ll == 0) {
  6944. this.$message({
  6945. message: this.$t('message.Pleaseselectatime'),
  6946. type: 'error'
  6947. })
  6948. return false
  6949. }
  6950. let overcorp = ''
  6951. for(let n in zhi){
  6952. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6953. overcorp += zhi[n].zhoDataTime + ','
  6954. }
  6955. }
  6956. if(this.user.companyId != 5978 && overcorp != ''){
  6957. overcorp = overcorp.substring(0,overcorp.length - 1)
  6958. this.$message({
  6959. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6960. type: 'error'
  6961. })
  6962. return
  6963. }
  6964. }
  6965. var submits = []
  6966. let formData = new FormData();
  6967. formData.append("draft", isDraft);
  6968. if(this.reportTimeType.multiWorktime == 1){
  6969. for (var i in this.zhoData) {
  6970. var zhoD = this.zhoData[i]
  6971. var flgs = false
  6972. for(var j in zhoD) {
  6973. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6974. flgs = true
  6975. // formData.append("degreeId", "-1");
  6976. formData.append("id", '-1');
  6977. if (this.isSubstitude) {
  6978. formData.append('targetUids',this.workForm.userId[0]);
  6979. }
  6980. for(var s in this.projectList) {
  6981. if(j == this.projectList[s].projectName) {
  6982. formData.append("projectId", this.projectList[s].id);
  6983. }
  6984. }
  6985. if(this.user.timeType.reportAuditType == 3){
  6986. let audItem = {}
  6987. if(this.user.timeType.auditLevel > 0){
  6988. audItem.auditorFirst = zhoD[j].auditorFirst
  6989. }
  6990. if(this.user.timeType.auditLevel > 1){
  6991. audItem.auditorSec = zhoD[j].auditorSec
  6992. }
  6993. if(this.user.timeType.auditLevel > 2){
  6994. audItem.auditorThird = zhoD[j].auditorThird
  6995. }
  6996. if(zhoD[j].ccUserid){
  6997. audItem.ccUserid = zhoD[j].ccUserid
  6998. }
  6999. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7000. }
  7001. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7002. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7003. formData.append("reportTimeType", this.reportTimeType.type);
  7004. formData.append("endTime", '');
  7005. formData.append("startTime", '');
  7006. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7007. var lix = []
  7008. var objjs = {}
  7009. objjs.startTime = zhoD[j].time[0]
  7010. objjs.endTime = zhoD[j].time[1]
  7011. if (zhoD[j].content == null || zhoD[j].content == '') {
  7012. zhoD[j].content == '-'
  7013. }
  7014. objjs.content = zhoD[j].content
  7015. lix.push(objjs)
  7016. var zhiZhi = JSON.stringify(lix)
  7017. zhiZhi = zhiZhi.replace(/,/g,"@");
  7018. formData.append("content", zhiZhi)
  7019. formData.append("isOvertime", 0)
  7020. formData.append("professionProgress", "[]")
  7021. if (zhoD[j].groupId) {
  7022. formData.append("groupId",zhoD[j].groupId)
  7023. } else {
  7024. //解决后台groupId数组越界的问题
  7025. formData.append("groupId",0)
  7026. }
  7027. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7028. formData.append("createDate",zhoD.zhoDataTime)
  7029. if (zhoD[j].projectAuditorId) {
  7030. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7031. }
  7032. if(zhoD[j].basecostId) {
  7033. formData.append("basecostId", zhoD[j].basecostId);
  7034. } else {
  7035. formData.append("basecostId", 0);
  7036. }
  7037. if(this.user.timeType.customDegreeActive){
  7038. if (this.user.timeType.customDegreeMultiple) {
  7039. if (zhoD[j].multiDegrIdArray) {
  7040. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7041. } else {
  7042. formData.append('multiDegrId','[]')
  7043. }
  7044. } else {
  7045. if (zhoD[j].degreeId) {
  7046. formData.append('degreeId',zhoD[j].degreeId)
  7047. } else {
  7048. formData.append('degreeId','-1')
  7049. }
  7050. }
  7051. }else{
  7052. formData.append("degreeId", "-1");
  7053. }
  7054. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7055. formData.append('customData',zhoD[j].customData)
  7056. }else if(this.user.timeType.customDataActive){
  7057. formData.append('customData',0)
  7058. }
  7059. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7060. formData.append('customText',zhoD[j].customText)
  7061. }else if(this.user.timeType.customTextActive){
  7062. formData.append('customText','-')
  7063. }
  7064. }
  7065. }
  7066. }
  7067. } else {
  7068. for (var i in this.zhoData) {
  7069. var zhoD = this.zhoData[i]
  7070. var flgs = false
  7071. if(this.reportTimeType.type == 2) {
  7072. for(var k in this.selProjectList) {
  7073. var pItem = this.selProjectList[k];
  7074. var pName = pItem.projectName;
  7075. var j = pName;
  7076. console.log('j==周报中的项目='+j);
  7077. if(zhoD[j].time && zhoD[j].time != 'null') {
  7078. flgs = true
  7079. // formData.append("degreeId", "-1");
  7080. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7081. if (this.isSubstitude) {
  7082. formData.append('targetUids',this.workForm.userId[0]);
  7083. }
  7084. for(var s in this.projectList) {
  7085. if(j == this.projectList[s].projectName) {
  7086. formData.append("projectId", this.projectList[s].id);
  7087. }
  7088. }
  7089. if(this.user.timeType.reportAuditType == 3){
  7090. let audItem = {}
  7091. if(this.user.timeType.auditLevel > 0){
  7092. audItem.auditorFirst = zhoD[j].auditorFirst
  7093. }
  7094. if(this.user.timeType.auditLevel > 1){
  7095. audItem.auditorSec = zhoD[j].auditorSec
  7096. }
  7097. if(this.user.timeType.auditLevel > 2){
  7098. audItem.auditorThird = zhoD[j].auditorThird
  7099. }
  7100. if(zhoD[j].ccUserid){
  7101. audItem.ccUserid = zhoD[j].ccUserid
  7102. }
  7103. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7104. }
  7105. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7106. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7107. formData.append("reportTimeType", this.reportTimeType.type);
  7108. formData.append("endTime", zhoD[j].time[1]);
  7109. formData.append("startTime", zhoD[j].time[0]);
  7110. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7111. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7112. formData.append("isOvertime", 0)
  7113. formData.append("professionProgress", "[]")
  7114. if (zhoD[j].groupId) {
  7115. formData.append("groupId",zhoD[j].groupId)
  7116. } else {
  7117. //解决后台groupId数组越界的问题
  7118. formData.append("groupId",0)
  7119. }
  7120. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7121. formData.append("createDate",zhoD.zhoDataTime)
  7122. if (zhoD[j].projectAuditorId) {
  7123. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7124. }
  7125. if(zhoD[j].basecostId) {
  7126. formData.append("basecostId", zhoD[j].basecostId);
  7127. } else {
  7128. formData.append("basecostId", 0);
  7129. }
  7130. if(this.user.timeType.customDegreeActive){
  7131. if (this.user.timeType.customDegreeMultiple) {
  7132. if (zhoD[j].multiDegrIdArray) {
  7133. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7134. } else {
  7135. formData.append("multiDegrId", "[]");
  7136. }
  7137. } else {
  7138. if (zhoD[j].degreeId) {
  7139. formData.append('degreeId',zhoD[j].degreeId)
  7140. } else {
  7141. formData.append("degreeId", "-1");
  7142. }
  7143. }
  7144. }else{
  7145. formData.append("degreeId", "-1");
  7146. }
  7147. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7148. formData.append('customData',zhoD[j].customData)
  7149. }else if(this.user.timeType.customDataActive){
  7150. formData.append('customData',0)
  7151. }
  7152. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7153. formData.append('customText',zhoD[j].customText)
  7154. }else if(this.user.timeType.customTextActive){
  7155. formData.append('customText','-')
  7156. }
  7157. }
  7158. }
  7159. } else {
  7160. for(var k in this.selProjectList) {
  7161. var pItem = this.selProjectList[k];
  7162. var pName = pItem.projectName;
  7163. var j = pName;
  7164. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7165. flgs = true
  7166. // formData.append("degreeId", "-1");
  7167. console.log('进入了workFpppp==='+j);
  7168. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7169. if (this.isSubstitude) {
  7170. formData.append('targetUids',this.workForm.userId[0]);
  7171. }
  7172. for(var s in this.projectList) {
  7173. if(j == this.projectList[s].projectName) {
  7174. formData.append("projectId", this.projectList[s].id);
  7175. }
  7176. }
  7177. if(this.user.timeType.reportAuditType == 3){
  7178. let audItem = {}
  7179. if(this.user.timeType.auditLevel > 0){
  7180. audItem.auditorFirst = zhoD[j].auditorFirst
  7181. }
  7182. if(this.user.timeType.auditLevel > 1){
  7183. audItem.auditorSec = zhoD[j].auditorSec
  7184. }
  7185. if(this.user.timeType.auditLevel > 2){
  7186. audItem.auditorThird = zhoD[j].auditorThird
  7187. }
  7188. if(zhoD[j].ccUserid){
  7189. audItem.ccUserid = zhoD[j].ccUserid
  7190. }
  7191. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7192. }
  7193. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7194. // formData.append("subProjectId", zhoD[j].subProjectId);
  7195. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7196. formData.append("reportTimeType", this.reportTimeType.type);
  7197. if(this.reportTimeType.type == 1) {
  7198. formData.append("workingTime", zhoD[j].workingTime);
  7199. } else if(this.reportTimeType.type == 2) {
  7200. formData.append("endTime", zhoD[j].time[1]);
  7201. formData.append("startTime", zhoD[j].time[0]);
  7202. } else if(this.reportTimeType.type == 3) {
  7203. formData.append("progress", zhoD[j].progress);
  7204. formData.append("workingTime", zhoD[j].workingTime);
  7205. }
  7206. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7207. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7208. formData.append("isOvertime", 0)
  7209. formData.append("professionProgress", "[]")
  7210. if (zhoD[j].groupId) {
  7211. formData.append("groupId",zhoD[j].groupId)
  7212. } else {
  7213. //解决后台groupId数组越界的问题
  7214. formData.append("groupId",0)
  7215. }
  7216. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7217. formData.append("createDate",zhoD.zhoDataTime)
  7218. if (zhoD[j].projectAuditorId) {
  7219. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7220. }
  7221. if(zhoD[j].basecostId) {
  7222. formData.append("basecostId", zhoD[j].basecostId);
  7223. } else {
  7224. formData.append("basecostId", 0);
  7225. }
  7226. if(this.user.timeType.customDegreeActive){
  7227. if (this.user.timeType.customDegreeMultiple) {
  7228. if (zhoD[j].multiDegrIdArray) {
  7229. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7230. } else {
  7231. formData.append("multiDegrId", "[]");
  7232. }
  7233. } else {
  7234. if (zhoD[j].degreeId) {
  7235. formData.append('degreeId',zhoD[j].degreeId)
  7236. } else {
  7237. formData.append("degreeId", "-1");
  7238. }
  7239. }
  7240. }else{
  7241. formData.append("degreeId", "-1");
  7242. }
  7243. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7244. formData.append('customData',zhoD[j].customData)
  7245. }else if(this.user.timeType.customDataActive){
  7246. formData.append('customData',0)
  7247. }
  7248. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7249. formData.append('customText',zhoD[j].customText)
  7250. }else if(this.user.timeType.customTextActive){
  7251. formData.append('customText','-')
  7252. }
  7253. }
  7254. }
  7255. }
  7256. }
  7257. }
  7258. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7259. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7260. if(!next) {
  7261. this.$message({
  7262. message: `【${error.join('、')}】请填写任务分组`,
  7263. type: 'error'
  7264. })
  7265. return
  7266. }
  7267. // 自定义维度
  7268. this.submitingReport = true;
  7269. this.http.uploadFile( this.port.report.editPort, formData,
  7270. res => {
  7271. // this.listLoading = false;
  7272. this.submitingReport = false;
  7273. if (res.code == "ok") {
  7274. this.$message({
  7275. message: this.$t('message.fillinsuccessfully'),
  7276. type: "success"
  7277. });
  7278. this.fillWeekDialogVisi = false
  7279. this.selConShow = true
  7280. this.zhoData = []
  7281. this.weekDateRange = ''
  7282. this.getReportList();
  7283. this.getDepartment();
  7284. // 关闭弹窗 并 清空
  7285. this.selProjectList = []
  7286. this.selCon = []
  7287. this.getRecentlyProject()
  7288. } else {
  7289. this.$message({
  7290. message: res.msg,
  7291. type: "error"
  7292. });
  7293. }
  7294. },
  7295. error => {
  7296. this.submitingReport = false;
  7297. this.$message({
  7298. message: error,
  7299. type: "error"
  7300. });
  7301. });
  7302. },
  7303. handleGroupAuditorData(data) {
  7304. const { reportAuditType } = this.user.timeType
  7305. if(reportAuditType != 1 && reportAuditType != 2) {
  7306. return {next: true}
  7307. }
  7308. let arrList = [];
  7309. Object.entries(data).forEach(([key, obj]) => {
  7310. Object.entries(obj).forEach(([projectName, projectData]) => {
  7311. if (projectData.workingTime && !projectData.groupId) {
  7312. arrList.push({
  7313. projectName,
  7314. date: obj.zhoDataTime,
  7315. dateText: obj.zhoDataTimeTxt
  7316. });
  7317. }
  7318. });
  7319. });
  7320. if(arrList.length > 0) {
  7321. return {
  7322. next: false,
  7323. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  7324. }
  7325. } else {
  7326. return {
  7327. next: true,
  7328. error: [],
  7329. }
  7330. }
  7331. },
  7332. ChangeHourMinutestr (str) {
  7333. if (str !== "0" && str !== "" && str !== null) {
  7334. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7335. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7336. } else {
  7337. return "";
  7338. }
  7339. },
  7340. // 得到两个日期中间的日期
  7341. getdiffdate(stime,etime){
  7342. //初始化日期列表,数组
  7343. var diffdate = new Array();
  7344. var i=0;
  7345. //开始日期小于等于结束日期,并循环
  7346. while(stime<=etime){
  7347. diffdate[i] = stime;
  7348. //获取开始日期时间戳
  7349. var stime_ts = new Date(stime).getTime();
  7350. //增加一天时间戳后的日期
  7351. var next_date = stime_ts + (24*60*60*1000);
  7352. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7353. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7354. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7355. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7356. stime = next_dates_y+next_dates_m+next_dates_d;
  7357. //增加数组key
  7358. i++;
  7359. }
  7360. return diffdate;
  7361. },
  7362. // 添加模块
  7363. addDomain(i) {
  7364. var leftProgress = 10;
  7365. if (this.reportTimeType.type == 3) {
  7366. //计算已经待分配工时比例
  7367. let array = this.workForm.domains;
  7368. let totalProgress = 0;
  7369. for (var i=0;i<array.length; i++) {
  7370. totalProgress += array[i].progress;
  7371. }
  7372. if (totalProgress < 100) {
  7373. leftProgress = 100 - totalProgress;
  7374. }
  7375. }
  7376. var addItem = {
  7377. projectId: "",
  7378. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7379. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7380. ),
  7381. content: "",
  7382. progress:leftProgress,
  7383. state:2,//2-表示待提交
  7384. multiWorktime: this.reportTimeType.multiWorktime,
  7385. worktimeList:[{}],
  7386. canEdit: true,
  7387. auditorFirst: '',
  7388. auditorSec: '',
  7389. auditorThird: '',
  7390. ccUserid: ''
  7391. // degreeId: '',
  7392. };
  7393. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7394. this.$set(addItem,'isOvertime',true)
  7395. if(this.reportTimeType.type == 3){
  7396. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7397. }
  7398. }
  7399. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7400. //默认给第一个,必填字段
  7401. addItem.basecostId = this.timeBasecostList[0].id;
  7402. }
  7403. this.workForm.domains.push(addItem);
  7404. document.getElementById('workFormsItemBottom').scrollIntoView()
  7405. this.canEdit = true
  7406. if (this.reportTimeType.type == 0) {
  7407. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7408. var length = this.workForm.domains.length;
  7409. if (length == 2) {
  7410. this.showAddMore = false;
  7411. }
  7412. }
  7413. this.chuji()
  7414. this.seleChn()
  7415. },
  7416. // 移除模块
  7417. delDomain(i) {
  7418. this.workForm.domains.splice(i,1)
  7419. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7420. if (!this.originCanEdit) {
  7421. let iscan = false
  7422. for(let i in this.workForm.domains){
  7423. if(this.workForm.domains[i].canEdit){
  7424. iscan = true
  7425. }
  7426. }
  7427. this.canEdit = iscan
  7428. }
  7429. //检测当前剩下的一个,时间类型是否是全天
  7430. if (this.reportTimeType.type == 0) {
  7431. if (this.workForm.domains[0].timeType == 0) {
  7432. this.showAddMore = false;
  7433. } else {
  7434. this.showAddMore = true;
  7435. }
  7436. }
  7437. if(this.user.timeType.multiWorktime == 1) {
  7438. this.iptChangs()
  7439. } else {
  7440. this.seleChn(0)
  7441. }
  7442. },
  7443. // 改变月份
  7444. changeMonth() {
  7445. this.isWeekend = false
  7446. let date = new Date()
  7447. let nowmon = date.getMonth() + 1
  7448. let nowday = date.getDate()
  7449. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7450. if (this.isBatch == 0) {
  7451. if(this.user.timeType.fillAhead == 0){
  7452. let date_a = new Date(this.workForm.createDate)
  7453. if(date_a.getTime() > date.getTime()){
  7454. this.workForm.createDate = nowdate
  7455. }
  7456. }
  7457. //只有按天填报才能获取当天的日报
  7458. if(!this.isSubstitude){
  7459. let weekday = new Date(this.workForm.createDate).getDay()
  7460. if(this.user.companyId == 817){
  7461. if(weekday == 0){
  7462. this.isWeekend = true
  7463. }
  7464. }else{
  7465. if(weekday == 0 || weekday == 6){
  7466. this.isWeekend = true
  7467. }
  7468. }
  7469. this.getReport()
  7470. }
  7471. }else {
  7472. if(this.user.timeType.fillAhead == 0){
  7473. let date_a = new Date(this.workForm.createDate[1])
  7474. if(date_a.getTime() > date.getTime()){
  7475. this.workForm.createDate[1] = nowdate
  7476. let sdate = new Date(this.workForm.createDate[0])
  7477. let edate = new Date(this.workForm.createDate[1])
  7478. if(sdate > edate){
  7479. this.workForm.createDate[0] = this.workForm.createDate[1]
  7480. }
  7481. }
  7482. }
  7483. }
  7484. },
  7485. // 判断时间段
  7486. fns() {
  7487. for (let k in this.dateAr) {
  7488. if (!this.judege(k)) {
  7489. return false
  7490. }
  7491. }
  7492. return true
  7493. },
  7494. judege(idx){
  7495. for (let k in this.dateAr) {
  7496. if (idx !== k) {
  7497. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7498. return false
  7499. }
  7500. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7501. return false
  7502. }
  7503. }
  7504. }
  7505. return true
  7506. },
  7507. getOverlapData(data) {
  7508. let overlapData = [];
  7509. for (let i = 0; i < data.length; i++) {
  7510. for (let j = i + 1; j < data.length; j++) {
  7511. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7512. overlapData.push(data[i], data[j]);
  7513. }
  7514. }
  7515. }
  7516. return overlapData;
  7517. },
  7518. // 保存日报111111
  7519. submitReport(isDraft) {
  7520. this.isDraft = isDraft;
  7521. this.$refs.workForm.validate(valid => {
  7522. if (valid) {
  7523. if (!isDraft) {
  7524. //针对苏州景昱,单独的检查逻辑
  7525. if (this.user.companyId == 5978) {
  7526. //调接口,先检查工时是否存在异常
  7527. var totalTime = 0;
  7528. for (var t=0;t<this.workForm.domains.length; t++) {
  7529. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7530. }
  7531. var array = [];
  7532. if (this.isBatch) {
  7533. var startDate = new Date(this.workForm.createDate[0]);
  7534. var endDate = new Date(this.workForm.createDate[1]);
  7535. if (startDate > endDate) {
  7536. this.$message({
  7537. message: '开始日期不能大于结束日期',
  7538. type: "error"
  7539. });
  7540. return
  7541. } else {
  7542. while(true){
  7543. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7544. array.push(workData);
  7545. startDate.setDate(startDate.getDate() + 1);
  7546. if (startDate > endDate) {
  7547. break;
  7548. }
  7549. }
  7550. }
  7551. } else {
  7552. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7553. array.push(workData)
  7554. }
  7555. this.submitingReport = true;
  7556. var passUserId = this.user.id;
  7557. if (this.isSubstitude) {
  7558. passUserId = this.targetUids;
  7559. }
  7560. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7561. res => {
  7562. this.submitingReport = false;
  7563. if (res.code == "ok") {
  7564. this.submitReportSon()
  7565. } else {
  7566. this.$confirm(res.msg, '提示', {
  7567. confirmButtonText: '忽略并提交',
  7568. cancelButtonText: '取消',
  7569. type: 'error'
  7570. }).then(() => {
  7571. this.submitReportSon()
  7572. }).catch(() => {
  7573. });
  7574. }
  7575. },
  7576. error => {
  7577. this.$message({
  7578. message: error,
  7579. type: "error"
  7580. });
  7581. });
  7582. } else {
  7583. if(this.totalReportHours < this.user.timeType.allday){
  7584. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  7585. confirmButtonText: '确定',
  7586. cancelButtonText: '取消',
  7587. type: 'warning'
  7588. }).then(() => {
  7589. this.submitReportSon()
  7590. }).catch(() => {
  7591. });
  7592. }else{
  7593. this.submitReportSon()
  7594. }
  7595. }
  7596. } else {
  7597. //暂存,不需要检查工时是否超过考勤
  7598. this.submitReportSon()
  7599. }
  7600. }
  7601. });
  7602. },
  7603. submitReportSon() {
  7604. this.dateAr = []
  7605. //检查重叠
  7606. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7607. let alp = []
  7608. if(this.user.timeType.multiWorktime != 1) {
  7609. for(var p in this.workForm.domains) {
  7610. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7611. let objs = {}
  7612. objs.s = this.workForm.domains[p].startTime
  7613. objs.e = this.workForm.domains[p].endTime
  7614. alp.push(objs)
  7615. }
  7616. }
  7617. this.dateAr = alp
  7618. if(this.dateAr.length > 0) {
  7619. let trus = this.fns()
  7620. if(!trus) {
  7621. this.$message({
  7622. message: this.$t('message.Filledtimeperiodsoverlap'),
  7623. type: "error"
  7624. });
  7625. return
  7626. }
  7627. }
  7628. } else {
  7629. for(var p in this.workForm.domains) {
  7630. var slll = this.workForm.domains[p]
  7631. for(var o in slll.worktimeList) {
  7632. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7633. let objs = {}
  7634. objs.s = slll.worktimeList[o].startTime
  7635. objs.e = slll.worktimeList[o].endTime
  7636. alp.push(objs)
  7637. }
  7638. }
  7639. }
  7640. this.dateAr = alp
  7641. if(this.dateAr.length > 0) {
  7642. let trus = this.fns()
  7643. if(!trus) {
  7644. this.$message({
  7645. message: this.$t('message.Filledtimeperiodsoverlap'),
  7646. type: "error"
  7647. });
  7648. return
  7649. }
  7650. }
  7651. }
  7652. }
  7653. //检查子项目
  7654. if (this.user.timeType.subProMustFill == 1) {
  7655. for(var p in this.workForm.domains) {
  7656. var oneProItem = this.workForm.domains[p]
  7657. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7658. //没有选择子项目
  7659. this.$message({
  7660. message: '子项目必填,请检查',
  7661. type: "error"
  7662. });
  7663. return
  7664. }
  7665. }
  7666. }
  7667. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7668. if (this.user.companyId == this.yuzhongCompId) {
  7669. for(var p in this.workForm.domains) {
  7670. var oneProItem = this.workForm.domains[p]
  7671. if (!oneProItem.extraField1) {
  7672. this.$message({
  7673. message: '角色必填,请检查',
  7674. type: "error"
  7675. });
  7676. return
  7677. }
  7678. if (!oneProItem.extraField2) {
  7679. this.$message({
  7680. message: '工作职责必填,请检查',
  7681. type: "error"
  7682. });
  7683. return
  7684. }
  7685. if (!oneProItem.extraField3) {
  7686. this.$message({
  7687. message: '工作内容必填,请检查',
  7688. type: "error"
  7689. });
  7690. return
  7691. }
  7692. }
  7693. }
  7694. // return
  7695. //代填的情况,检查人员是否已经选择
  7696. if (this.isSubstitude) {
  7697. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7698. this.$message({
  7699. message: this.$t('message.pleaseselectthepersontofillin'),
  7700. type: "error"
  7701. });
  7702. return;
  7703. }
  7704. }
  7705. //检查时间,全天和上下午不能同时存在
  7706. if (this.reportTimeType.type == 0) {
  7707. var alldayNum = 0;
  7708. var amNum = 0;
  7709. var pmNum = 0;
  7710. for(var i in this.workForm.domains) {
  7711. if (this.workForm.domains[i].timeType == 0) {
  7712. alldayNum ++;
  7713. } else if (this.workForm.domains[i].timeType == 1) {
  7714. amNum++;
  7715. } else if (this.workForm.domains[i].timeType == 2) {
  7716. pmNum++;
  7717. }
  7718. }
  7719. if (alldayNum > 1) {
  7720. this.$message({
  7721. // message: "工作时间-全天,只能选择一次",
  7722. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7723. type: "error"
  7724. });
  7725. return;
  7726. }
  7727. if (amNum > 1) {
  7728. this.$message({
  7729. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7730. type: "error"
  7731. });
  7732. return;
  7733. }
  7734. if (pmNum > 1) {
  7735. this.$message({
  7736. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7737. type: "error"
  7738. });
  7739. return;
  7740. }
  7741. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7742. this.$message({
  7743. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7744. type: "error"
  7745. });
  7746. return;
  7747. }
  7748. } else if (this.reportTimeType.type == 3) {
  7749. //总百分比不能超过100%
  7750. let total = 0;
  7751. this.workForm.domains.forEach(w=>{total += w.progress});
  7752. if (total > 100) {
  7753. this.$message({
  7754. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7755. type: "error"
  7756. });
  7757. return;
  7758. } else if (total < 100) {
  7759. this.$message({
  7760. message: this.$t('message.cannotbesubmitted'),
  7761. type: "error"
  7762. });
  7763. return;
  7764. }
  7765. }
  7766. this.listLoading = true;
  7767. let formData = new FormData();
  7768. formData.append("draft", this.isDraft);
  7769. var totalTime = 0;
  7770. for (var t=0;t<this.workForm.domains.length; t++) {
  7771. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7772. }
  7773. //批量填报不校验考勤时长,交给后台校验
  7774. if (!this.isBatch) {
  7775. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7776. if (this.workForm.time){
  7777. if (this.workForm.time.workHours == 0){
  7778. this.$message({
  7779. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7780. type: 'error'
  7781. })
  7782. return
  7783. }
  7784. }else{
  7785. this.$message({
  7786. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7787. type: 'error'
  7788. })
  7789. return
  7790. }
  7791. }
  7792. }
  7793. //针对凡己和景昱,此处不校验考勤时长
  7794. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7795. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7796. this.$message({
  7797. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7798. type: "error"
  7799. });
  7800. return;
  7801. }
  7802. }
  7803. for(var i in this.workForm.domains) {
  7804. // 检查任务/里程碑是否为必填
  7805. let taskRequired = this.user.timeType.taskRequired
  7806. if(taskRequired == 1) {
  7807. if(!this.workForm.domains[i].taskId) {
  7808. this.$message({
  7809. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7810. type: "error"
  7811. });
  7812. return
  7813. }
  7814. }
  7815. if(this.user.timeType.reportAuditType == 3){
  7816. let audItem = {}
  7817. let auditRule = ''
  7818. if(this.workForm.domains[i].id){
  7819. audItem.reportId = this.workForm.domains[i].id
  7820. }
  7821. if(this.user.timeType.auditLevel > 0){
  7822. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7823. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7824. }
  7825. if(this.user.timeType.auditLevel > 1){
  7826. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7827. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7828. }
  7829. if(this.user.timeType.auditLevel > 2){
  7830. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7831. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7832. }
  7833. if(this.workForm.domains[i].ccUserid){
  7834. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7835. }
  7836. if(auditRule){
  7837. auditRule = auditRule.substring(0,auditRule.length - 1)
  7838. this.$message({
  7839. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7840. type: 'error'
  7841. })
  7842. return
  7843. }
  7844. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7845. }
  7846. if (this.user.timeType.customDegreeActive) {
  7847. if (this.user.timeType.customDegreeMultiple) {
  7848. //多选
  7849. if (this.workForm.domains[i].multiDegrIdArray) {
  7850. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7851. degreeArray = degreeArray.replace(/,/g,"@");
  7852. formData.append("multiDegrId", degreeArray);
  7853. } else {
  7854. formData.append("multiDegrId", '[]');
  7855. }
  7856. } else {
  7857. //单选
  7858. if (this.workForm.domains[i].degreeId) {
  7859. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7860. } else {
  7861. formData.append("degreeId", -1);
  7862. }
  7863. }
  7864. } else {
  7865. formData.append("degreeId", -1);
  7866. }
  7867. if(this.workForm.domains[i].customData) {
  7868. // var sss = this.workForm.domains[i].degreeId.toString()
  7869. formData.append("customData", this.workForm.domains[i].customData);
  7870. } else {
  7871. formData.append("customData", 0);
  7872. }
  7873. if(this.workForm.domains[i].customText) {
  7874. formData.append("customText", this.workForm.domains[i].customText);
  7875. } else {
  7876. formData.append("customText", '-');
  7877. }
  7878. if (this.workForm.domains[i].id) {
  7879. formData.append("id", this.workForm.domains[i].id);
  7880. } else {
  7881. formData.append("id", -1);
  7882. }
  7883. formData.append("projectId", this.workForm.domains[i].projectId);
  7884. if (this.workForm.domains[i].subProjectId) {
  7885. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7886. } else {
  7887. formData.append("subProjectId", 0);
  7888. }
  7889. if (this.workForm.domains[i].groupId) {
  7890. formData.append("groupId", this.workForm.domains[i].groupId);
  7891. } else {
  7892. formData.append("groupId", 0);
  7893. }
  7894. if (this.workForm.domains[i].taskId) {
  7895. formData.append("taskId", this.workForm.domains[i].taskId);
  7896. } else {
  7897. formData.append("taskId", 0);
  7898. }
  7899. if (this.workForm.domains[i].taskFinish == true) {
  7900. formData.append("taskFinish", 1);
  7901. } else {
  7902. formData.append("taskFinish", 0);
  7903. }
  7904. formData.append("reportTimeType", this.reportTimeType.type);
  7905. if (this.reportTimeType.type == 0) {
  7906. formData.append("timeType", this.workForm.domains[i].timeType);
  7907. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7908. formData.append("workingTime", workingTime);
  7909. } else if (this.reportTimeType.type == 1){
  7910. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7911. } else if (this.reportTimeType.type == 2) {
  7912. formData.append("endTime", this.workForm.domains[i].endTime);
  7913. formData.append("startTime", this.workForm.domains[i].startTime);
  7914. } else if (this.reportTimeType.type == 3) {
  7915. //按比例分配
  7916. formData.append("progress", this.workForm.domains[i].progress);
  7917. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7918. }
  7919. if(this.user.timeType.choseFromAlbum == 1 ) {
  7920. console.log(this.workForm.domains[i].imgList)
  7921. if(this.workForm.domains[i].imgList) {
  7922. let imgListFor = this.workForm.domains[i].imgList
  7923. for(var b in imgListFor) {
  7924. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7925. }
  7926. console.log(imgListFor)
  7927. let m = JSON.stringify(imgListFor);
  7928. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7929. formData.append("picStr", m);
  7930. } else {
  7931. formData.append("picStr", '[]');
  7932. }
  7933. }
  7934. //处理多个时间事项
  7935. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7936. if (this.reportTimeType.multiWorktime == 1) {
  7937. //检查时间是否有重叠
  7938. var workList = this.workForm.domains[i].worktimeList;
  7939. for (var j=0;j<workList.length; j++) {
  7940. var curItem = workList[j];
  7941. //检查开始时间是否大于结束时间
  7942. if (curItem.startTime >= curItem.endTime) {
  7943. this.$message({
  7944. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7945. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7946. type: "error"
  7947. });
  7948. return;
  7949. }
  7950. //时间不可重叠
  7951. if (this.reportTimeType.timeCanOverlap == 0) {
  7952. for (var p = j+1;p<workList.length; p++) {
  7953. var jItem = workList[p];
  7954. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7955. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7956. this.$message({
  7957. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7958. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7959. type: "error"
  7960. });
  7961. return;
  7962. }
  7963. }
  7964. }
  7965. }
  7966. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7967. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7968. formData.append("content", m);
  7969. } else {
  7970. if (this.workForm.domains[i].content) {
  7971. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7972. m = m.replace(/,/g,",");
  7973. console.log(m, '需要传值的数据')
  7974. // formData.append("content", this.workForm.domains[i].content);
  7975. formData.append("content", m);
  7976. } else {
  7977. formData.append("content", '-');
  7978. }
  7979. }
  7980. if (this.isBatch == 0) {
  7981. formData.append("createDate", this.workForm.createDate);
  7982. } else {
  7983. //批量填报,时间范围
  7984. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7985. }
  7986. if(this.workForm.domains[i].isOvertime) {
  7987. formData.append("isOvertime", 1);
  7988. } else {
  7989. formData.append("isOvertime", 0);
  7990. }
  7991. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7992. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7993. } else {
  7994. formData.append("overtimeHours", 0);
  7995. }
  7996. if(this.workForm.domains[i].basecostId) {
  7997. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7998. } else {
  7999. formData.append("basecostId", 0);
  8000. }
  8001. if (this.workForm.userId != null) {
  8002. var targetUids = '';
  8003. this.workForm.userId.forEach(u=>{
  8004. targetUids += u + '@';
  8005. });
  8006. if (targetUids.length > 0) {
  8007. targetUids = targetUids.substring(0, targetUids.length -1);
  8008. formData.append("targetUids", targetUids);
  8009. }
  8010. }
  8011. //项目专业进度
  8012. if (this.workForm.domains[i].professionProgress) {
  8013. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8014. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8015. formData.append("professionProgress", m);
  8016. } else {
  8017. formData.append("professionProgress", "[]");
  8018. }
  8019. if (this.workForm.domains[i].stage) {
  8020. formData.append("stage", this.workForm.domains[i].stage);
  8021. } else {
  8022. formData.append("stage", "-");
  8023. }
  8024. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  8025. if (this.workForm.domains[i].projectAuditorId) {
  8026. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8027. } else {
  8028. // console.log('执行到了这里')
  8029. // console.log(this.user.timeType.reportAuditType)
  8030. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8031. this.$message({
  8032. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8033. type: "error"
  8034. });
  8035. return;
  8036. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  8037. //分组负责人先审核, 确定是选择了任务分组
  8038. if (this.workForm.domains[i].taskGroups.length == 0) {
  8039. this.$message({
  8040. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8041. type: "error"
  8042. });
  8043. } else if (!this.workForm.domains[i].groupId) {
  8044. // console.log(this.workForm.domains[i]);
  8045. this.$message({
  8046. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8047. type: "error"
  8048. });
  8049. } else {
  8050. this.$message({
  8051. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  8052. type: "error"
  8053. });
  8054. }
  8055. return;
  8056. }
  8057. }
  8058. if (this.user.companyId == this.yuzhongCompId) {
  8059. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8060. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8061. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8062. }
  8063. //依斯贝的服务Id
  8064. if (this.user.companyId == this.yisibeiCompId) {
  8065. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8066. }
  8067. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8068. this.$message({
  8069. message: `请选择【${this.workForm.domains[i].projectName}】项目下的任务分组`,
  8070. type: "error"
  8071. });
  8072. return
  8073. }
  8074. if(this.user.timeType.userWithMultiDept == 1) {
  8075. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8076. }
  8077. }
  8078. this.submitingReport = true;
  8079. this.http.uploadFile( this.port.report.editPort, formData,
  8080. res => {
  8081. this.listLoading = false;
  8082. this.submitingReport = false;
  8083. if (res.code == "ok") {
  8084. if(res.msg!=null){
  8085. this.$message({
  8086. dangerouslyUseHTMLString: true,
  8087. message: res.msg,
  8088. type: "warning",
  8089. showClose: true,
  8090. duration: 0
  8091. });
  8092. }else{
  8093. this.$message({
  8094. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8095. type: "success"
  8096. });
  8097. }
  8098. this.dialogVisible = false;
  8099. this.jsDay = 0
  8100. this.jsTime = 0
  8101. this.getReportList();
  8102. this.getDepartment();
  8103. this.getRecentlyProject()
  8104. } else {
  8105. this.$message({
  8106. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8107. type: "error"
  8108. });
  8109. }
  8110. },
  8111. error => {
  8112. this.listLoading = false;
  8113. this.submitingReport = false;
  8114. this.$message({
  8115. message: error,
  8116. type: "error"
  8117. });
  8118. });
  8119. },
  8120. // 判断是展示那个工时导入
  8121. imports() {
  8122. if(this.user.timeType.syncCorpwxTime == 0) {
  8123. this.importDialog = true
  8124. } else {
  8125. this.importWxDialog = true
  8126. }
  8127. },
  8128. // 跳转
  8129. junpToDeskTop(id) {
  8130. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8131. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8132. },
  8133. // 通过日报
  8134. approve(id, item) {
  8135. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8136. this.approveinData = {
  8137. id: id,
  8138. date: this.date +day,
  8139. reportIds: item.id
  8140. }
  8141. if(this.user.timeType.needEvaluate == 1){
  8142. this.$set(this.approveinData,'evaluate','')
  8143. this.approveinDialog = true
  8144. }else{
  8145. this.logining = true;
  8146. this.approveinfun()
  8147. }
  8148. },
  8149. approveinfun(){
  8150. this.http.post( this.port.report.approve, this.approveinData,
  8151. res => {
  8152. this.logining = false;
  8153. if (res.code == "ok") {
  8154. this.approveinDialog = false
  8155. this.$message({
  8156. message: this.$t('message.Reviewsucceeded'),
  8157. type: "success"
  8158. });
  8159. this.refreshReportData(this.approveinData.reportIds);
  8160. this.getDepartment();
  8161. } else {
  8162. this.$message({
  8163. message: res.msg,
  8164. type: "error"
  8165. });
  8166. }
  8167. },
  8168. error => {
  8169. this.logining = false;
  8170. this.$message({
  8171. message: error,
  8172. type: "error"
  8173. });
  8174. });
  8175. },
  8176. //撤回日报
  8177. cancel(item,e) {
  8178. // console.log('can can need',item);
  8179. this.logining = true;
  8180. var ids = '';
  8181. var data = e ? item : item.data;
  8182. data.forEach(element => {
  8183. if(element.id){
  8184. ids +=(element.id+',');
  8185. }
  8186. });
  8187. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8188. res => {
  8189. this.logining = false;
  8190. if (res.code == "ok") {
  8191. this.$message({
  8192. message:this.$t('message.Withdrawalsucceeded'),
  8193. type: "success"
  8194. });
  8195. this.getReportList();
  8196. if(e){this.getReport()}
  8197. this.getDepartment();
  8198. } else {
  8199. this.$message({
  8200. message: res.msg,
  8201. type: "error"
  8202. });
  8203. }
  8204. },
  8205. error => {
  8206. this.logining = false;
  8207. this.$message({
  8208. message: error,
  8209. type: "error"
  8210. });
  8211. });
  8212. },
  8213. showDenyDialog(id,i, item) {
  8214. this.denyReasonDialog = true;
  8215. this.isDenying = false;
  8216. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8217. var ids = item.id;
  8218. // var data = item.data;
  8219. // data.forEach(element => {
  8220. // ids +=(element.id+',');
  8221. // });
  8222. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8223. },
  8224. // 未通过日报
  8225. deny() {
  8226. this.logining = true;
  8227. this.isDenying = true;
  8228. this.http.post( this.port.report.deny, this.denyForm,
  8229. res => {
  8230. this.logining = false;
  8231. this.isDenying = false;
  8232. if (res.code == "ok") {
  8233. this.$message({
  8234. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8235. type: "success"
  8236. });
  8237. this.refreshReportData(this.denyForm.reportIds);
  8238. this.getDepartment();
  8239. this.denyReasonDialog = false;
  8240. } else {
  8241. this.$message({
  8242. message: res.msg,
  8243. type: "error"
  8244. });
  8245. }
  8246. },
  8247. error => {
  8248. this.logining = false;
  8249. this.$message({
  8250. message: error,
  8251. type: "error"
  8252. });
  8253. });
  8254. },
  8255. // 查看工时记录弹窗
  8256. toView() {
  8257. this.toViewDialogVisible = true
  8258. this.toViewloading = true
  8259. this.getToView()
  8260. },
  8261. getToView() {
  8262. this.http.post( '/report-import-log/getList', this.toViewForm,
  8263. res => {
  8264. this.toViewloading = false;
  8265. if (res.code == "ok") {
  8266. // console.log(res.data, '数据数据')
  8267. this.toViewList = res.data.records
  8268. this.toViewForm.total = res.data.total
  8269. } else {
  8270. this.toViewloading = false;
  8271. this.$message({
  8272. message: res.msg,
  8273. type: "error"
  8274. });
  8275. }
  8276. })
  8277. },
  8278. // 触发 selectCat 组件更改他的值
  8279. selectCatCli(obj) {
  8280. // console.log(obj, '看看')
  8281. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8282. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8283. },
  8284. vueCasader(obj) {
  8285. console.log(obj, '看看值', this.departmentList)
  8286. if(obj.distinction == 1 && obj.item) {
  8287. let arr = []
  8288. arr.push(obj.item.value)
  8289. this.exportParam.departmentId = arr
  8290. }
  8291. if(obj.distinction == '10' && obj) {
  8292. const { id, other } = obj
  8293. this.workForm.domains[other].reportTargetDeptId = id
  8294. }
  8295. if(obj.distinction == '14' && obj) {
  8296. let arr = []
  8297. arr.push(obj.id)
  8298. this.deptIdForHasReport = arr
  8299. this.showMonthWorkTime()
  8300. }
  8301. if(obj.distinction == '15' && obj) {
  8302. let arr = []
  8303. arr.push(obj.id)
  8304. this.deptIdForNoReport = arr
  8305. this.showMonthNotWorkTime()
  8306. }
  8307. if(obj.distinction == '16' && obj) {
  8308. let arr = []
  8309. arr.push(obj.id)
  8310. this.deptIdForReminder = arr
  8311. this.showMonthWorkTimeReminder()
  8312. }
  8313. },
  8314. //分页
  8315. handleCurrentChange(val) {
  8316. this.toViewForm.pageIndex = val;
  8317. this.getToView();
  8318. },
  8319. handleSizeChange(val) {
  8320. this.toViewForm.pageSize = val;
  8321. this.getToView();
  8322. },
  8323. getAllUsersList(){
  8324. this.http.post('/user/getSimpleActiveUserList',{
  8325. },res => {
  8326. if(res.code == 'ok'){
  8327. this.allUsersList = res.data
  8328. }else{
  8329. this.$message({
  8330. message: res.msg,
  8331. type: 'error'
  8332. })
  8333. }
  8334. },err => {
  8335. this.$message({
  8336. message: err,
  8337. type: 'error'
  8338. })
  8339. })
  8340. },
  8341. //景昱变更提醒
  8342. changeReminder(item){
  8343. console.log("============",item)
  8344. let parameter={
  8345. startDate: this.WorktimeDatepickValue[0],
  8346. endDate: this.WorktimeDatepickValue[1],
  8347. }
  8348. if(item){
  8349. parameter.createDate=item.createDate,
  8350. parameter.userId=item.userId
  8351. }
  8352. this.http.post('/report/changeReminder',parameter,res => {
  8353. if(res.code == 'ok'){
  8354. this.$message({
  8355. message: res.msg,
  8356. type: 'success'
  8357. })
  8358. }else{
  8359. this.$message({
  8360. message: res.msg,
  8361. type: 'error'
  8362. })
  8363. }
  8364. },err => {
  8365. this.$message({
  8366. message: err,
  8367. type: 'error'
  8368. })
  8369. })
  8370. },
  8371. //景昱取消异常
  8372. cancelReminder(item){
  8373. let parameter={}
  8374. if(item){
  8375. parameter.createDate=item.createDate,
  8376. parameter.userId=item.userId
  8377. }
  8378. this.http.post('/report/cancelReminder',parameter,res => {
  8379. if(res.code == 'ok'){
  8380. this.$message({
  8381. message: res.msg,
  8382. type: 'success'
  8383. })
  8384. }else{
  8385. this.$message({
  8386. message: res.msg,
  8387. type: 'error'
  8388. })
  8389. }
  8390. },err => {
  8391. this.$message({
  8392. message: err,
  8393. type: 'error'
  8394. })
  8395. })
  8396. this.showMonthWorkTimeReminder()
  8397. },
  8398. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8399. fillWeekCustomClne() {
  8400. this.fillWeekDialogVisiCustom = false
  8401. },
  8402. fillWeekCustomSubmit() {
  8403. this.getReportList();
  8404. this.getDepartment();
  8405. this.getRecentlyProject()
  8406. },
  8407. // 待填日报姓名搜索
  8408. nameAearchSeek(flg) {
  8409. if(!this.nameAearch) {
  8410. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8411. return
  8412. }
  8413. if(flg) {
  8414. this.enterpriseWechatgetUser()
  8415. }
  8416. },
  8417. handleThreeData(userList) {
  8418. console.log(userList, '人员数据')
  8419. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8420. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8421. },
  8422. // 过滤树节点
  8423. filterTreeNodes(treeData, filterKeywords) {
  8424. return treeData.filter((node) => {
  8425. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8426. if (node.children && node.children.length > 0) {
  8427. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8428. }
  8429. return true;
  8430. }
  8431. if (node.children && node.children.length > 0) {
  8432. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8433. return node.children.length > 0;
  8434. }
  8435. return false;
  8436. });
  8437. },
  8438. // 企业微信获取人员
  8439. enterpriseWechatgetUser() {
  8440. this.deptMembDataLoading = true
  8441. this.http.post('/user/getEmployeeList',{
  8442. departmentId: -1,
  8443. pageIndex: 1,
  8444. pageSize: 100,
  8445. keyword: this.nameAearch,
  8446. status: '',
  8447. roleId: '',
  8448. cursor: '',
  8449. onlyDirect: '',
  8450. matchingType: ''
  8451. },res => {
  8452. if(res.code == 'ok'){
  8453. this.deptMembDataLoading = false
  8454. const userListName = res.data.records.map(item => item.name)
  8455. this.handleThreeData(userListName)
  8456. setTimeout(() => {
  8457. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8458. }, 200)
  8459. }else{
  8460. this.deptMembDataLoading = false
  8461. this.$message({
  8462. message: res.msg,
  8463. type: 'error'
  8464. })
  8465. }
  8466. },err => {
  8467. this.deptMembDataLoading = false
  8468. this.$message({
  8469. message: err,
  8470. type: 'error'
  8471. })
  8472. })
  8473. },
  8474. changeTreeNodeStatus(node) {
  8475. console.log(node)
  8476. let allZt = true
  8477. node.expanded = allZt
  8478. for (let i = 0; i < node.childNodes.length; i++) {
  8479. node.childNodes[i].expanded = allZt
  8480. if (node.childNodes[i].childNodes.length > 0) {
  8481. this.changeTreeNodeStatus(node.childNodes[i])
  8482. }
  8483. }
  8484. },
  8485. // 按周填报获取相关任务
  8486. async getWeeklyTaskList(item) {
  8487. console.log(item, '<=== 数据')
  8488. const { projectId, groupId, stage, taskId } = item
  8489. console.log(projectId, groupId, stage)
  8490. let parms = { projectId, isSubstitude: 0 }
  8491. groupId ? parms.groupId = groupId : ''
  8492. stage ? parms.stage = stage : ''
  8493. const { data } = await this.postData('/task/getRecentTask', parms)
  8494. this.zhoBao.taskId = taskId
  8495. this.$set(this.zhoBao, 'taskList', data)
  8496. console.log(this.zhoBao)
  8497. },
  8498. // 封装 post 请求
  8499. postData(url, params) {
  8500. return new Promise((resolve, reject) => {
  8501. this.http.post(url, { ...params },
  8502. res => {
  8503. resolve(res)
  8504. },
  8505. error => {
  8506. this.$message({
  8507. message: error,
  8508. type: "error"
  8509. });
  8510. reject(error)
  8511. })
  8512. })
  8513. },
  8514. // 自定义事件
  8515. selectCal(obj) {
  8516. console.log(obj, '传数据来源')
  8517. if(obj.distinction == '1') {
  8518. this.zhoBao.projectAuditorId = obj.id
  8519. } else if(obj.distinction == '2') {
  8520. this.zhoBao.auditorFirst = obj.id
  8521. } else if(obj.distinction == '3') {
  8522. this.zhoBao.auditorSec = obj.id
  8523. } else if(obj.distinction == '4') {
  8524. this.zhoBao.auditorThird = obj.id
  8525. } else if(obj.distinction == '5') {
  8526. this.zhoBao.ccUserid = obj.id
  8527. } else if(obj.distinction == '12') {
  8528. this.usersListId = obj.id
  8529. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8530. this.searchKeyword = obj.name
  8531. } else {
  8532. this.searchKeyword = ''
  8533. }
  8534. this.searchScreen(0)
  8535. } else if(obj.distinction == '13') {
  8536. this.usersListId = obj.id
  8537. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8538. this.searchKeyword = obj.name
  8539. } else {
  8540. this.searchKeyword = ''
  8541. }
  8542. this.searchScreen(1)
  8543. }
  8544. }
  8545. },
  8546. created() {
  8547. this.getUsers()
  8548. let height = window.innerHeight;
  8549. this.tableHeight = height - 178;
  8550. const that = this;
  8551. window.onresize = function temp() {
  8552. that.tableHeight = window.innerHeight - 178;
  8553. };
  8554. this.toViewForm.companyId = this.user.companyId
  8555. this.initDrag([{
  8556. type: "LR",
  8557. domClass: {
  8558. // 中间分割线的名字
  8559. resize: "line-line",
  8560. // 左侧盒子的名字
  8561. left: "box-left",
  8562. // 右侧盒子的名字
  8563. right: "box-right",
  8564. // 父级的名字
  8565. box: "box-father",
  8566. },
  8567. otherInfo: {
  8568. // 限制左边栏最低宽度
  8569. leftWidth: 120,
  8570. },
  8571. },
  8572. {
  8573. type: "LR",
  8574. domClass: {
  8575. // 中间分割线的名字
  8576. resize: "line-second",
  8577. // 左侧盒子的名字
  8578. left: "left-laowang",
  8579. // 右侧盒子的名字
  8580. right: "box-second-father",
  8581. // 父级的名字
  8582. box: "grand",
  8583. },
  8584. otherInfo: {
  8585. // 限制左边栏最低宽度
  8586. leftWidth: 120,
  8587. },
  8588. },
  8589. ]);
  8590. }
  8591. };
  8592. </script>
  8593. <style lang="scss" scoped>
  8594. .fillWeekDialogVisiCustom {
  8595. width: 100%;
  8596. height: 70vh;
  8597. }
  8598. .fillWeekCustom {
  8599. .el-dialog__body {
  8600. padding: 20px 20px !important;
  8601. }
  8602. }
  8603. .photos {
  8604. position: relative;
  8605. display: flex;
  8606. flex-wrap: wrap;
  8607. }
  8608. .photos_img {
  8609. width: 120px;
  8610. height: 120px;
  8611. margin-right: 20px;
  8612. margin-bottom: 20px;
  8613. cursor: pointer;
  8614. img {
  8615. width: 100%;
  8616. height: 100%;
  8617. }
  8618. }
  8619. .paginatis {
  8620. padding: 10px 10px;
  8621. background: #f2f2f2;
  8622. }
  8623. .waiting {
  8624. color:orange;
  8625. }
  8626. .filledReportStyle {
  8627. color:#32CD32;
  8628. }
  8629. .RejectStyle {
  8630. color:red;
  8631. }
  8632. .waitSubmitStyle{
  8633. color: #409eff;
  8634. }
  8635. .chooseDate {
  8636. .waiting {
  8637. color: #20a0ff;
  8638. }
  8639. .filledReportStyle {
  8640. color:#20a0ff;
  8641. }
  8642. .RejectStyle {
  8643. color: #20a0ff;
  8644. }
  8645. .waitSubmitStyle{
  8646. color: #20a0ff;
  8647. }
  8648. }
  8649. .allDaily {
  8650. width:100%;
  8651. }
  8652. .report_title {
  8653. padding:10px 0;
  8654. color:#666;
  8655. }
  8656. .clearfix {
  8657. overflow-x: auto;
  8658. white-space: nowrap;
  8659. padding: 15px 0 10px 0;
  8660. // overflow-y: hidden;
  8661. .date_item {
  8662. padding: 0 3px;
  8663. cursor: pointer;
  8664. position: relative;
  8665. }
  8666. .chooseDate {
  8667. position: absolute;
  8668. bottom: -3px;
  8669. width: 37px;
  8670. height: 2px;
  8671. left: 14px;
  8672. background: #20a0ff;
  8673. }
  8674. }
  8675. .one_daily {
  8676. i {
  8677. color: #9ed0ff;
  8678. margin-right: 5px;
  8679. }
  8680. .one_daily_body {
  8681. padding: 10px 0px;
  8682. p {
  8683. margin: 0;
  8684. line-height: 30px;
  8685. }
  8686. }
  8687. ul {
  8688. padding: 0;
  8689. }
  8690. }
  8691. .checkbtn {
  8692. float: right;
  8693. margin-top: -10px;
  8694. }
  8695. .selConStyle{
  8696. margin-top:9rem;
  8697. margin-bottom:11rem;
  8698. .selConStyle_title{
  8699. height: 3rem;
  8700. text-align: center;
  8701. font-size: 17px;
  8702. }
  8703. .el-select{
  8704. margin: 0 15%;
  8705. width: 70%;
  8706. }
  8707. }
  8708. </style>
  8709. <style lang="scss">
  8710. /*去除upload组件过渡效果*/
  8711. .photos .el-upload-list__item {
  8712. transition: none !important;
  8713. }
  8714. .daily {
  8715. .el-card__body {
  8716. height: 80%;
  8717. overflow-y: auto;
  8718. }
  8719. .el-card__header {
  8720. padding: 0 20px;
  8721. }
  8722. }
  8723. .membListClass{
  8724. .el-dialog__body{
  8725. padding-top: 10px;
  8726. }
  8727. }
  8728. // .editReportDialog .el-dialog__footer{
  8729. // position: sticky;
  8730. // bottom: 0;
  8731. // background: #fff;
  8732. // height: 70px;
  8733. // z-index: 1010;
  8734. // }
  8735. .editReportDialog{
  8736. min-width: 800px;
  8737. }
  8738. .touruxiangmu{
  8739. max-width: 1000px;
  8740. }
  8741. </style>
  8742. <style scoped>
  8743. /* 项目标签的样式 */
  8744. .el-tag + .el-tag {
  8745. margin-left: 10px;
  8746. }
  8747. .button-new-tag {
  8748. margin-left: 10px;
  8749. height: 32px;
  8750. line-height: 30px;
  8751. padding-top: 0;
  8752. padding-bottom: 0;
  8753. }
  8754. .input-new-tag {
  8755. width: 90px;
  8756. margin-left: 10px;
  8757. vertical-align: bottom;
  8758. }
  8759. .selectworktime .el-table__fixed-body-wrapper{
  8760. top: 48px !important;
  8761. }
  8762. .selectworktime_export .selectworktime_export_l{
  8763. width: 650px;
  8764. float: left;
  8765. height: 42px;
  8766. }
  8767. .approvalProcessBox{
  8768. margin-left: 30px;
  8769. font-size: 14px;
  8770. line-height: 16px;
  8771. cursor: pointer;
  8772. }
  8773. .approvalProcessBox i {
  8774. margin-right: 0;
  8775. height: 16px;
  8776. width: 16px;
  8777. display: inline-block;
  8778. transform: scale(1.2);
  8779. position: relative;
  8780. top: 0.5px;
  8781. color: #409eff;
  8782. }
  8783. .approvalProcessBox .approvalProcessClick{
  8784. cursor: pointer;
  8785. color: #409eff;
  8786. font-size: 14px;
  8787. }
  8788. .approvalProcessBox:hover .approvalProcessClick{
  8789. color: #3485fb;
  8790. }
  8791. </style>
  8792. <style lang="scss" scoped>
  8793. .bionicClass {
  8794. -webkit-appearance: none;
  8795. background-color: #FFF;
  8796. background-image: none;
  8797. border-radius: 4px;
  8798. border: 1px solid #DCDFE6;
  8799. box-sizing: border-box;
  8800. color: #606266;
  8801. display: inline-block;
  8802. height: 40px;
  8803. line-height: 40px;
  8804. outline: 0;
  8805. padding: 0 15px;
  8806. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8807. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8808. width: 350px;
  8809. cursor: pointer;
  8810. .bionicClassText {
  8811. color: #C0C4CC;
  8812. }
  8813. }
  8814. // 加班样式
  8815. .overtime {
  8816. display: inline-block;
  8817. margin-left: 20px;
  8818. input {
  8819. display: inline-block;
  8820. margin-top: 5px;
  8821. }
  8822. }
  8823. .plus {
  8824. display: inline-block;
  8825. }
  8826. // .tages {
  8827. // float: right;
  8828. // }
  8829. .overtime {
  8830. display: inline-block;
  8831. margin-left: 30px;
  8832. }
  8833. .bloks {
  8834. display: inline-block;
  8835. width: 380px;
  8836. }
  8837. .zhiss {
  8838. display: flex;
  8839. justify-content: space-around;
  8840. align-items: center;
  8841. }
  8842. .zhoFel {
  8843. display: flex;
  8844. justify-content: space-between;
  8845. align-items: center;
  8846. }
  8847. // 左右滑动样式
  8848. .line {
  8849. width: 30px;
  8850. /* height: 500px; */
  8851. background: #f2f2f2;
  8852. cursor: w-resize;
  8853. }
  8854. .box-father {
  8855. border: 8px solid #000;
  8856. }
  8857. .line-second {
  8858. width: 10px;
  8859. /* background: red; */
  8860. }
  8861. .flex {
  8862. display: flex;
  8863. width: 100%;
  8864. }
  8865. .box-left {
  8866. flex: 0 0 400px;
  8867. /* height: 600px; */
  8868. /* background: blue; */
  8869. }
  8870. .box-right {
  8871. /* height: 600px; */
  8872. /* background: green; */
  8873. flex: 1;
  8874. }
  8875. .box-postion {
  8876. width: 200px;
  8877. /* height: 400px; */
  8878. background: #ccc;
  8879. }
  8880. .custom-tree-node {
  8881. flex: 1;
  8882. display: flex;
  8883. align-items: center;
  8884. justify-content: space-between;
  8885. font-size: 14px;
  8886. padding-right: 8px;
  8887. }
  8888. .daitianrbao {
  8889. width: 100%;
  8890. box-sizing: border-box;
  8891. height: 40px;
  8892. border-radius: 4px;
  8893. border: 1px solid #DCDFE6;
  8894. overflow: hidden;
  8895. text-overflow: ellipsis;
  8896. display: flex;
  8897. // align-items: center;
  8898. }
  8899. .daitianrbao .spnn {
  8900. display: inline-block;
  8901. box-sizing: border-box;
  8902. padding: 0 15px;
  8903. overflow: hidden;
  8904. text-overflow: ellipsis;
  8905. }
  8906. .daitianrbao .hover {
  8907. color: #DCDFE6 !important;
  8908. }
  8909. </style>