daily.vue 491 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277
  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. {{ $t('other.unfilled') }}
  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">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</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 && user.timeType.enableNewWeeklyfill != 2" 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()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <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>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <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>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  165. <!-- 工作总时长: -->
  166. {{$t('other.totalWorkingHours')}}
  167. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  168. <span >{{item1.reportTime | amounts}}</span>h
  169. </span>
  170. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  171. <i class="iconfont firerock-iconliucheng1"></i>
  172. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  173. <!-- 审批流程 -->
  174. {{$t('other.approvalProcess')}}
  175. </span>
  176. </span>
  177. </span>
  178. <div class="checkbtn" style="padding-right:20px;">
  179. <!--编辑和删除日报-->
  180. <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>
  181. <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>
  182. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  183. </div>
  184. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  185. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <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>
  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="primary" :loading="logining"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <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"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <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"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <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>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <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>
  275. </p>
  276. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  277. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  278. <!-- 自定义日报文本 -->
  279. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  280. <p v-if="user.company.packageEngineering == 1">
  281. {{$t('other.professionalProgress')}}:
  282. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  283. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  284. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  285. </el-tooltip>
  286. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  287. <i class="iconfont firerock-iconshenhetongguo"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhebohui"></i>
  291. </el-tooltip>
  292. </span>
  293. </p>
  294. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  295. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  296. </p>
  297. <div v-if="item2.multiWorktime==0">
  298. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  299. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  300. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  301. {{item2.time.toFixed(1)}}h
  302. <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>
  303. </p>
  304. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  305. <span style="margin-right:10px;">{{item2.progress}}%</span>
  306. </p>
  307. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  308. </div>
  309. <div v-if="item2.multiWorktime==1" >
  310. <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>
  311. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  312. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  313. <p style="display: inline-block;">{{$t('time.duration')}}:
  314. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  315. {{timeItem.time.toFixed(1)}}h
  316. </p>
  317. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  318. </div>
  319. </div>
  320. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  321. <!--照片的显示 -->
  322. <p v-if="item2.pics != null && item2.pics.length > 0">
  323. <el-image v-for="(pic, index) in item2.pics" :key="index"
  324. style="width: 100px; height: 100px; margin-right:10px;"
  325. :src="pic"
  326. :preview-src-list="item2.pics">
  327. </el-image>
  328. </p>
  329. </el-card>
  330. </el-timeline-item>
  331. </el-timeline>
  332. </div>
  333. </div>
  334. <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;">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  335. <!-- 简陋的无报告提示 -->
  336. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. </el-card>
  343. </div>
  344. <!-- 工时推送日志弹窗 -->
  345. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  346. <template>
  347. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  348. </template>
  349. <template>
  350. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  351. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  352. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  353. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  354. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  355. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  356. <template slot-scope="scope">
  357. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  358. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  359. </template>
  360. </el-table-column>
  361. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  362. </el-table>
  363. </template>
  364. <span slot="footer" class="dialog-footer">
  365. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  366. </span>
  367. </el-dialog>
  368. <!-- 填写日报的dialog -->
  369. <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">
  370. <div style="height: 65vh;overflow: auto;">
  371. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  372. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  373. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  374. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  375. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  376. <span class="spnn" v-if="workForm.userNames">
  377. <span v-for="(item, index) in workForm.userNames" :key="index">
  378. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  379. <span v-if="index < workForm.userNames.length - 1">,</span>
  380. </span>
  381. </span>
  382. <span class="spnn hover" v-else>
  383. {{$t('defaultText.pleaseSelectAsubstitute')}}
  384. </span>
  385. </div>
  386. </el-form-item>
  387. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  388. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  389. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  390. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  391. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  392. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  393. <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>
  394. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  395. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  396. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  397. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  398. <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>
  399. <!-- AI智能填报 -->
  400. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  401. </el-form-item>
  402. <!--考勤时长显示-->
  403. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  404. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  405. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  406. </span>
  407. <!--批量填报和批量代填不显示考勤记录-->
  408. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  409. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  410. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  411. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  412. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  413. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  414. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  415. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  416. @click="refreshAttendance(workForm.createDate)"></el-button>
  417. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  418. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  419. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  420. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  421. </el-form-item>
  422. <!-- 000000 -->
  423. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  424. <div v-if="reportTimeType.multiWorktime==0">
  425. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  426. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  427. <el-select v-model="domain.timeType" style="width:200px;"
  428. v-if="reportTimeType.type == 0"
  429. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  430. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  431. @change="onTimeTypeChange(domain.timeType)">
  432. <el-option
  433. v-for="item in timeType"
  434. :key="item.value"
  435. :label="item.label"
  436. :value="item.value">
  437. </el-option>
  438. </el-select>
  439. <!-- 数字时长选择 -->
  440. <el-select v-model="domain.workingTime" style="width:200px;"
  441. v-if="reportTimeType.type == 1"
  442. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  443. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  444. @change="seleChn(0,domain)">
  445. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  446. </el-select>
  447. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  448. <span v-if="reportTimeType.type == 2">
  449. <!--时间范围选择 -->
  450. <el-time-picker
  451. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  452. v-model="domain.startTime"
  453. :placeholder="$t('time.startTime')"
  454. style="width:120px;"
  455. format="HH:mm"
  456. value-format="HH:mm"
  457. :picker-options="{
  458. start: '08:00',
  459. end: '23:30'
  460. }"
  461. @change="iptChang()">
  462. </el-time-picker> - <el-time-picker
  463. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  464. v-model="domain.endTime"
  465. :placeholder="$t('time.endTime')"
  466. style="width:120px;"
  467. format="HH:mm"
  468. value-format="HH:mm"
  469. :picker-options="{
  470. start: '08:00',
  471. end: '23:30',
  472. minTime: domain.startTime
  473. }"
  474. @change="iptChang()">
  475. </el-time-picker>
  476. </span>
  477. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  478. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  479. <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>
  480. </div>
  481. </el-form-item>
  482. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  483. :prop="'domains.' + index + '.reportTargetDeptId'"
  484. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  485. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  486. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  487. <span style="float: left">
  488. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  489. </span>
  490. </el-option>
  491. </el-select>
  492. <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>
  493. </el-form-item>
  494. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  495. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  496. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  497. @change="selectProject(domain, index)"
  498. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  499. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  500. <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">
  501. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  502. <span style="float: right;">{{ item.projectName }}</span>
  503. </el-option>
  504. </el-option-group>
  505. </el-select>
  506. <!--昱众不显示子项目-->
  507. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  508. <span style="margin-left:45px;">
  509. {{$t('lable.subproject')}}</span>
  510. <!--子项目 -->
  511. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  512. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  513. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  514. </el-select>
  515. </template>
  516. <template v-if="user.companyId == yuzhongCompId">
  517. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  518. <!--角色选择 -->
  519. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  520. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  521. <el-option
  522. v-for="item in roleList"
  523. :key="item.value"
  524. :label="item.label"
  525. :value="item.value">
  526. </el-option>
  527. </el-select>
  528. </template>
  529. <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%;"
  530. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  531. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  532. </el-link>
  533. <!-- <el-link type="primary" v-if="canEdit"
  534. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  535. </el-form-item>
  536. <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">
  537. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  538. </el-form-item>
  539. <!--如果设置了工时成本预警的预算成本项-->
  540. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  541. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  542. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  543. </el-select>
  544. </el-form-item>
  545. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  546. <template slot="label">
  547. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  548. <span >{{$t('lable.taskGrouping')}}</span>
  549. </template>
  550. <!-- 任务分组 -->
  551. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  552. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  553. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  554. </el-select>
  555. <template v-if="user.companyId == yuzhongCompId">
  556. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  557. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  558. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  559. <el-option
  560. v-for="item in domain.filteredRespList"
  561. :key="item.id"
  562. :label="item.jobRespon"
  563. :value="item.id">
  564. </el-option>
  565. </el-select>
  566. </template>
  567. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  568. <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>
  569. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  570. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  571. @change="changeStages(domain, index)"
  572. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  573. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  574. </el-select>
  575. </template>
  576. </el-form-item>
  577. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && domain.auditUserList">
  578. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  579. <template slot="label">
  580. <span style="color:#FF0000;">*</span>
  581. <span >{{$t('other.projectAuditor')}}</span>
  582. </template>
  583. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  584. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  585. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  586. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  587. </el-option>
  588. </el-select>
  589. <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>
  590. </el-form-item>
  591. </div>
  592. <el-form-item v-if="user.companyId == yuzhongCompId">
  593. <template slot="label">
  594. <span style="color:#FF0000;">*</span>
  595. <span >{{ $t('gongZuoNeiRong') }}</span>
  596. </template>
  597. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  598. :disabled="(workForm.domains[index].state>=2?false:true)" >
  599. <el-option
  600. v-for="item in domain.workContentList"
  601. :key="item.id"
  602. :label="item.workContext"
  603. :value="item.id">
  604. </el-option>
  605. </el-select>
  606. </el-form-item>
  607. <!-- 111111 -->
  608. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  609. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  610. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  611. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  612. <span v-else>{{item.name}}</span>
  613. </el-option>
  614. </el-select>
  615. <template v-if="user.timeType.auditLevel > 1">
  616. <i class="el-icon-right"></i>
  617. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  618. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  619. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  620. <span v-else>{{item.name}}</span>
  621. </el-option>
  622. </el-select>
  623. </template>
  624. <template v-if="user.timeType.auditLevel > 2">
  625. <i class="el-icon-right"></i>
  626. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  627. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  628. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  629. <span v-else>{{item.name}}</span>
  630. </el-option>
  631. </el-select>
  632. </template>
  633. </el-form-item>
  634. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  635. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  636. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  637. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  638. <span v-else>{{item.name}}</span>
  639. </el-option>
  640. </el-select>
  641. </el-form-item>
  642. <!-- 相关维度/自定义维度 -->
  643. <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'">
  644. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  645. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  646. </el-option>
  647. </el-select>
  648. </el-form-item>
  649. <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'">
  650. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  651. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  652. </el-option>
  653. </el-select>
  654. </el-form-item>
  655. <!-- 相关数值 -->
  656. <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">
  657. <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>
  658. </el-form-item>
  659. <!-- 自定义文本 -->
  660. <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">
  661. <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>
  662. </el-form-item>
  663. <!--按比例填报-->
  664. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  665. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  666. <div style="width:400px;">
  667. <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>
  668. <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>
  669. </div>
  670. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  671. <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>
  672. </div>
  673. </el-form-item>
  674. <!--工程专业版本模式下, 各个专业的进度填报 -->
  675. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  676. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  677. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  678. <el-input size="mini" style="width:60px;" v-model="item.progress"
  679. @keyup.native="onProgressChange"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  681. </span>
  682. </el-form-item>
  683. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  684. <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))" >
  685. <template slot="label" v-if="user.timeType.taskRequired == 1">
  686. <span style="color:#FF0000;">*</span>
  687. <span >{{ $t('other.task') }}</span>
  688. </template>
  689. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  690. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  691. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  692. </el-select>
  693. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  694. </el-form-item>
  695. <!--针对依斯贝的SAP服务-->
  696. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  697. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  698. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  699. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  700. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  701. </el-select>
  702. </el-form-item>
  703. <!--工作事项-->
  704. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  705. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  706. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  707. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  708. </el-form-item>
  709. <!-- 拍照上传 -->
  710. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  711. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  712. <div class="photos">
  713. <div>
  714. <el-upload
  715. list-type="picture-card"
  716. :http-request="(file) => {return addImg(file, index)}"
  717. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  718. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  719. :file-list="domain.imgListUrl" :limit="9"
  720. :disabled="workForm.domains[index].state>=2?false:true">
  721. <i class="el-icon-plus"></i>
  722. </el-upload>
  723. </div>
  724. </div>
  725. </el-form-item>
  726. </div>
  727. <!--多个工作事项填报的情况 -->
  728. <div v-if="reportTimeType.multiWorktime==1">
  729. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  730. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  731. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  732. @change="selectProject(domain, index)"
  733. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  734. <!-- <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">
  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 v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  739. <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">
  740. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  741. <span style="float: right;">{{ item.projectName }}</span>
  742. </el-option>
  743. </el-option-group>
  744. </el-select>
  745. <template v-if="user.timeType.mainProjectState != 1">
  746. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  747. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  748. <!--子项目 -->
  749. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  750. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  751. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  752. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  753. </el-select>
  754. </template>
  755. <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;"
  756. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  757. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  758. </el-link>
  759. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  760. <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>
  761. </div>
  762. <!-- <el-link type="primary" v-if="canEdit"
  763. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  764. </el-form-item>
  765. <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">
  766. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  767. </el-form-item>
  768. <!--如果设置了工时成本预警的预算成本项-->
  769. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  770. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  771. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  772. </el-select>
  773. </el-form-item>
  774. <el-form-item v-if="user.company.packageProject == 1">
  775. <template slot="label">
  776. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  777. <span >{{$t('lable.taskGrouping')}}</span>
  778. </template>
  779. <!-- 任务分组 -->
  780. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  781. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  782. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  783. </el-select>
  784. <!-- 项目的阶段 -->
  785. <span v-if="domain.stages != null && domain.stages.length> 0"
  786. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  787. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  788. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  789. @change="changeStages(domain, index)"
  790. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  791. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  792. </el-select>
  793. </el-form-item>
  794. <el-form-item :label="$t('other.projectAuditor')" >
  795. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  796. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  797. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  798. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  799. </el-option>
  800. </el-select>
  801. <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>
  802. </el-form-item>
  803. <!--工程专业版本模式下, 各个专业的进度填报 -->
  804. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  805. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  806. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  807. <el-input size="mini" style="width:60px;" v-model="item.progress"
  808. @keyup.native="onProgressChange"
  809. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  810. </span>
  811. </el-form-item>
  812. <!-- 相关维度 -->
  813. <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'">
  814. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  815. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  816. </el-option>
  817. </el-select>
  818. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  819. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  820. </el-option>
  821. </el-select>
  822. </el-form-item>
  823. <!-- 相关数值 -->
  824. <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">
  825. <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>
  826. </el-form-item>
  827. <!-- 自定义文本 -->
  828. <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">
  829. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  830. </el-form-item>
  831. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  832. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  833. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  834. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  835. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  836. </el-select>
  837. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  838. </el-form-item>
  839. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  840. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  841. <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>
  842. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  843. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  844. <span v-if="reportTimeType.type == 2">
  845. <!-- <span> -->
  846. <!--时间范围选择 -->
  847. <el-time-picker
  848. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  849. v-model="timeItem.startTime"
  850. :placeholder="$t('time.startTime')"
  851. style="width:120px;"
  852. format="HH:mm"
  853. value-format="HH:mm"
  854. :picker-options="{
  855. start: '00:00',
  856. end: '23:59',
  857. }"
  858. @change="iptChangs()">
  859. </el-time-picker> - <el-time-picker
  860. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  861. v-model="timeItem.endTime"
  862. :placeholder="$t('time.endTime')"
  863. style="width:120px;"
  864. format="HH:mm"
  865. value-format="HH:mm"
  866. :picker-options="{
  867. start: '00:00',
  868. end: '23:59',
  869. minTime: timeItem.startTime
  870. }"
  871. @change="iptChangs()">
  872. </el-time-picker>
  873. </span>
  874. </el-form-item>
  875. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  876. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  877. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  878. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  879. ></el-input>
  880. </el-form-item>
  881. </div>
  882. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  883. </div>
  884. <!--照片的显示 -->
  885. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  886. <el-image v-for="(pic, index) in domain.pics" :key="index"
  887. style="width: 100px; height: 100px; margin-right:10px;"
  888. :src="pic"
  889. :preview-src-list="domain.pics">
  890. </el-image>
  891. </p>
  892. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  893. </div>
  894. <span id="workFormsItemBottom"></span>
  895. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  896. </el-form>
  897. </div>
  898. <span slot="footer" class="dialog-footer">
  899. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  900. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  901. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  902. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  903. <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>
  904. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  905. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  906. </span>
  907. </el-dialog>
  908. <!-- 按周填报 -->
  909. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  910. <!-- 按周填报-已填工时-点击 -->
  911. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  912. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  913. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  914. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  915. <el-table-column prop="state" :label="$t('state.states')">
  916. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  917. </el-table-column>
  918. </el-table>
  919. <span slot="footer" class="dialog-footer">
  920. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  921. </span>
  922. </el-dialog>
  923. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  924. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  925. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  926. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  927. <span class="spnn" v-if="workForm.userNames">
  928. <span v-for="(item, index) in workForm.userNames" :key="index">
  929. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  930. <span v-if="index < workForm.userNames.length - 1">,</span>
  931. </span>
  932. </span>
  933. <span class="spnn hover" v-else>
  934. {{$t('defaultText.pleaseSelectAsubstitute')}}
  935. </span>
  936. </div>
  937. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  938. </div>
  939. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  940. <el-form-item style="height:30px;margin-top:-72px;">
  941. <!-- <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> -->
  942. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  943. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  944. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  945. <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>
  946. <el-option
  947. v-for="item in fillProjectList"
  948. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  949. :key="item.id"
  950. :label="item.projectName + '\u3000' + item.projectCode"
  951. :value="item.id">
  952. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  953. <span style="float: right">{{ item.projectName }}</span>
  954. </el-option>
  955. </el-select>
  956. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  957. </el-form-item>
  958. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  959. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  960. <template slot-scope="scope">
  961. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  962. </template>
  963. </el-table-column>
  964. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  965. <template slot-scope="scope">
  966. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  967. <p v-else></p>
  968. </template>
  969. </el-table-column> -->
  970. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  971. <template slot-scope="scope">
  972. <div v-if="scope.row.canFill == 1">
  973. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  974. <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>
  975. <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>
  976. <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>
  977. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  978. </div>
  979. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  980. <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>
  981. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  982. </div>
  983. </div>
  984. <div v-else >
  985. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  986. </div>
  987. </template>
  988. </el-table-column>
  989. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  990. <template slot-scope="scope">
  991. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  992. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  993. </template>
  994. </el-table-column>
  995. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  996. <template slot-scope="scope">
  997. <div class="zhiss">
  998. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  999. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1000. </div>
  1001. </template>
  1002. </el-table-column>
  1003. </el-table>
  1004. </el-form>
  1005. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1006. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1007. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1008. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1009. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1010. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1011. <!--针对景昱,先检查工时是否存在异常-->
  1012. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1013. </span>
  1014. </el-dialog>
  1015. <!-- 重庆物奇私人定制的按周填报 -->
  1016. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1017. <div class="fillWeekDialogVisiCustom">
  1018. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1019. </div>
  1020. </el-dialog>
  1021. <!-- enableNewWeeklyfill==2 -->
  1022. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1023. <div class="fillWeekDialogVisiCustom">
  1024. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1025. </div>
  1026. </el-dialog>
  1027. <!-- 选择时间 -->
  1028. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1029. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1030. <span slot="footer" class="dialog-footer">
  1031. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1032. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1033. </span>
  1034. </el-dialog>
  1035. <!-- 按周填报弹窗 -->
  1036. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1037. <div>
  1038. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1039. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1040. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1041. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1042. </el-select>
  1043. </div>
  1044. <!--如果设置了工时成本预警的预算成本项-->
  1045. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1046. <p>{{$t('lable.budgetSource')}}</p>
  1047. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1048. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1049. </el-select>
  1050. </div>
  1051. <!-- 任务分组 -->
  1052. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1053. <p>{{$t('lable.taskGrouping')}}</p>
  1054. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1055. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1056. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. </div>
  1059. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1060. <p>{{$t('other.inputStage')}}</p>
  1061. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1062. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1063. </el-select>
  1064. </div>
  1065. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1066. <p>{{$t('other.reviewer')}}</p>
  1067. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1068. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1069. </el-select>
  1070. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1071. </div>
  1072. <template v-if="user.timeType.reportAuditType == 3">
  1073. <div class="zhoFel">
  1074. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1075. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1076. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1077. </el-select>
  1078. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1079. </div>
  1080. <div class="zhoFel">
  1081. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1082. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1083. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1084. </el-select>
  1085. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1086. </div>
  1087. <div class="zhoFel">
  1088. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1089. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1090. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1091. </el-select>
  1092. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1093. </div>
  1094. <div class="zhoFel">
  1095. <p>{{ $t('chao-song-ren') }}</p>
  1096. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1097. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1098. </el-select>
  1099. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1100. </div>
  1101. </template>
  1102. <!-- 自定义维度 -->
  1103. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1104. <p>{{user.timeType.customDegreeName}}</p>
  1105. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1106. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1107. </el-select>
  1108. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1109. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1110. </el-select>
  1111. </div>
  1112. <!-- 自定义数值 -->
  1113. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1114. <p>{{user.timeType.customDataName}}</p>
  1115. <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>
  1116. </div>
  1117. <!-- 自定义文本 -->
  1118. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1119. <p>{{user.timeType.customTextName}}</p>
  1120. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1121. </div>
  1122. <!-- 选择任务 -->
  1123. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1124. <p>{{ $t('renWuLiChengBei') }}</p>
  1125. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1126. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1127. </el-select>
  1128. </div>
  1129. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1130. <p>{{$t('other.timeSelection')}}</p>
  1131. <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>
  1132. </div>
  1133. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1134. <p>{{$t('other.chooseDuration')}}</p>
  1135. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1136. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1137. </el-select>
  1138. </div>
  1139. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1140. <p>{{$t('lable.percentageOfTime')}}</p>
  1141. <div style="width:400px;display: flex;align-items: center;">
  1142. <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>
  1143. <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>
  1144. </div>
  1145. </div>
  1146. <div class="zhoFel">
  1147. <p>{{$t('other.workMatters')}}</p>
  1148. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1149. </div>
  1150. </div>
  1151. <span slot="footer" class="dialog-footer">
  1152. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1153. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1154. </span>
  1155. </el-dialog>
  1156. <!--导出报表条件选择 -->
  1157. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1158. <el-form ref="form3" :model="exportParam" >
  1159. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1160. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1161. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1162. </el-select>
  1163. </el-form-item>
  1164. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1165. <!-- <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>
  1166. <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> -->
  1167. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1168. </el-form-item>
  1169. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1170. <el-date-picker
  1171. v-model="exportParam.dateRange" :editable="false"
  1172. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1173. :range-separator="$t('other.to')"
  1174. type="daterange"
  1175. :start-placeholder="$t('time.startDate')"
  1176. :end-placeholder="$t('time.endDate')"
  1177. ></el-date-picker>
  1178. </el-form-item>
  1179. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1180. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1181. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1182. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1183. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1184. </el-select>
  1185. </el-form-item>
  1186. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1187. <div class="exportReportRadio">
  1188. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1189. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1190. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1191. <i class="el-icon-question"></i>
  1192. </el-tooltip>
  1193. </div>
  1194. </el-form-item>
  1195. </el-form>
  1196. <div slot="footer" class="dialog-footer">
  1197. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1198. </div>
  1199. </el-dialog>
  1200. <!--导出报表条件选择 -->
  1201. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1202. <el-form ref="form3" :model="exportParam" >
  1203. <el-form-item prop="range" :label="$t('time.dateRange')">
  1204. <el-date-picker
  1205. v-model="exportParam.dateRange" :editable="false"
  1206. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1207. :clearable="true"
  1208. :range-separator="$t('other.to')"
  1209. type="daterange"
  1210. :start-placeholder="$t('time.startDate')"
  1211. :end-placeholder="$t('time.endDate')"
  1212. ></el-date-picker>
  1213. </el-form-item>
  1214. </el-form>
  1215. <div slot="footer" class="dialog-footer">
  1216. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1217. </div>
  1218. </el-dialog>
  1219. <!--人员列表 -->
  1220. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1221. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1222. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1223. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1224. <el-table-column type="selection"></el-table-column>
  1225. <el-table-column prop="label" :label="$t('lable.name')" >
  1226. <template slot-scope="scope">
  1227. <span>
  1228. <!-- {{(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}} -->
  1229. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1230. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1231. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1232. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1233. </span>
  1234. <span v-else>
  1235. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1236. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1237. </span>
  1238. </span>
  1239. </template>
  1240. </el-table-column>
  1241. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1242. <template slot-scope="scope">
  1243. <div>
  1244. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1245. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1246. </div>
  1247. </template>
  1248. </el-table-column>
  1249. </el-table>
  1250. </el-tab-pane>
  1251. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1252. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1253. <el-table-column prop="label" :label="$t('lable.name')" >
  1254. <template slot-scope="scope">
  1255. <!-- <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> -->
  1256. <!-- <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> -->
  1257. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1258. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1259. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1260. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1261. </span>
  1262. <span v-else>
  1263. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1264. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1265. </span>
  1266. </template>
  1267. </el-table-column>
  1268. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1269. <template slot-scope="scope">
  1270. <div>
  1271. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1272. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1273. </div>
  1274. </template>
  1275. </el-table-column>
  1276. </el-table>
  1277. </el-tab-pane>
  1278. </el-tabs>
  1279. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1280. <el-table-column type="selection"></el-table-column>
  1281. <el-table-column prop="label" :label="$t('lable.name')" >
  1282. <template slot-scope="scope">
  1283. <div>
  1284. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1285. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1286. </div>
  1287. </template>
  1288. </el-table-column>
  1289. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1290. <template slot-scope="scope">
  1291. <div>
  1292. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1293. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1294. </div>
  1295. </template>
  1296. </el-table-column>
  1297. </el-table>
  1298. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1299. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1300. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1301. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1302. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1303. </div>
  1304. </el-dialog>
  1305. <!-- 日报审核修改 -->
  1306. <el-dialog
  1307. :title="$t('riBaoShenHeXiuGai')"
  1308. :visible.sync="reportLogCheckDialog"
  1309. width="30%"
  1310. :before-close="handleClose">
  1311. <el-form ref="form3" :model="exportReportLogParam" >
  1312. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1313. <el-date-picker
  1314. v-model="exportReportLogParam.dateRange" :editable="false"
  1315. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1316. :range-separator="$t('other.to')"
  1317. type="daterange"
  1318. :start-placeholder="$t('time.startDate')"
  1319. :end-placeholder="$t('time.endDate')"
  1320. ></el-date-picker>
  1321. </el-form-item>
  1322. </el-form>
  1323. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1324. <br>
  1325. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1326. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1327. <span slot="footer" class="dialog-footer">
  1328. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1329. </span>
  1330. </el-dialog>
  1331. <!-- 按部门选择人员 -->
  1332. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1333. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1334. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1335. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1336. </el-input>
  1337. <div class="tree" style="height:400px">
  1338. <el-scrollbar style="height:100%">
  1339. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1340. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1341. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1342. <span class="custom-tree-node" slot-scope="{ node }">
  1343. <span v-if="user.userNameNeedTranslate == '1'">
  1344. <span v-if="node.data.children">
  1345. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1346. </span>
  1347. <span v-else>
  1348. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1349. </span>
  1350. </span>
  1351. <span v-if="user.userNameNeedTranslate != '1'">
  1352. {{ node.label }}
  1353. </span>
  1354. <!-- {{ node.label }} -->
  1355. </span>
  1356. </el-tree>
  1357. </el-scrollbar>
  1358. </div>
  1359. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1360. <div slot="footer" class="dialog-footer">
  1361. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1362. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1363. </div>
  1364. </el-dialog>
  1365. <el-dialog
  1366. v-if="monthWorkTimeDialog"
  1367. :visible.sync="monthWorkTimeDialog"
  1368. :close-on-click-modal="false"
  1369. customClass="customWidth selectworktime"
  1370. width="92%"
  1371. top="60px"
  1372. >
  1373. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1374. <el-tabs v-model="activeName" @tab-click="handleClick">
  1375. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1376. <div class="selectworktime_export" style="margin-top:10px;">
  1377. <div class="selectworktime_export_l">
  1378. <el-date-picker
  1379. class="selecteworktime_datapick"
  1380. v-model="WorktimeDatepickValue"
  1381. value-format="yyyy-MM-dd"
  1382. type="daterange"
  1383. align="right"
  1384. unlink-panels
  1385. :range-separator="$t('other.to')"
  1386. :start-placeholder="$t('time.startDate')"
  1387. :end-placeholder="$t('time.endDate')"
  1388. :default-time="['12:00:00', '12:00:00']"
  1389. size="small"
  1390. popper-class="selecteorktime_datapick_popper"
  1391. @change="showMonthWorkTime()"
  1392. >
  1393. </el-date-picker>
  1394. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1395. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1396. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1397. <!-- 222 -->
  1398. </div>
  1399. <div>
  1400. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1401. <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>
  1402. <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">
  1403. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1404. </el-input>
  1405. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1406. </div>
  1407. <div style="float: left; height:32px; padding-top:10px;">
  1408. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1409. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1410. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1411. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1412. </div>
  1413. <div style="float: right; vertical-align: middle;height:32px">
  1414. <el-link
  1415. type="primary"
  1416. @click="exportMembWorkHours()"
  1417. >{{$t('export.exportData')}}</el-link
  1418. >
  1419. </div>
  1420. </div>
  1421. <el-table ref="hasworkTbl"
  1422. :data="monthWorkDataS"
  1423. v-el-table-infinite-scroll="listScroll"
  1424. border
  1425. :height="'70vh'"
  1426. highlight-current-row
  1427. style="width: 100%"
  1428. v-loading="tbload"
  1429. :lazy="true"
  1430. :cell-style="hasworkTblCellStyle"
  1431. >
  1432. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1433. <template slot-scope="scope">
  1434. {{ scope.$index + 1 }}
  1435. </template>
  1436. </el-table-column>
  1437. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1438. <template slot-scope="scope">
  1439. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1440. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1441. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1442. <!-- {{scope.row.name}} -->
  1443. </span>
  1444. </template>
  1445. </el-table-column>
  1446. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1447. <template slot-scope="scope">
  1448. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1449. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1450. </template>
  1451. </el-table-column>
  1452. <el-table-column
  1453. min-width="60"
  1454. v-for="(item, index) in pickDateArray"
  1455. :key="index"
  1456. :label="item"
  1457. align="center"
  1458. >
  1459. <template slot="header" slot-scope="scope">
  1460. <div>{{ scope.column.label.dateStr }}</div>
  1461. <div>{{ scope.column.label.weekStr }}</div>
  1462. </template>
  1463. <template slot-scope="scope">
  1464. <div
  1465. v-if="
  1466. scope.row.worktimeList.filter(
  1467. (w) =>
  1468. w.createDate==item.date
  1469. ).length > 0 &&
  1470. scope.row.worktimeList.filter(
  1471. (w) =>w.createDate==item.date
  1472. )[0].workingTime < reportTimeType.allday
  1473. "
  1474. >
  1475. {{
  1476. scope.row.worktimeList.filter(
  1477. (w) =>w.createDate==item.date
  1478. )[0].workingTime.toFixed(1)
  1479. }}
  1480. </div>
  1481. <div
  1482. v-if="
  1483. scope.row.worktimeList.filter(
  1484. (w) =>w.createDate==item.date
  1485. ).length > 0 &&
  1486. scope.row.worktimeList.filter(
  1487. (w) =>w.createDate==item.date
  1488. )[0].workingTime > reportTimeType.allday
  1489. "
  1490. >
  1491. {{
  1492. scope.row.worktimeList.filter(
  1493. (w) =>w.createDate==item.date
  1494. )[0].workingTime.toFixed(1)
  1495. }}
  1496. </div>
  1497. <div
  1498. v-if="
  1499. scope.row.worktimeList.filter(
  1500. (w) =>w.createDate==item.date
  1501. ).length > 0 &&
  1502. scope.row.worktimeList.filter(
  1503. (w) =>w.createDate==item.date
  1504. )[0].workingTime == reportTimeType.allday
  1505. "
  1506. >
  1507. {{
  1508. scope.row.worktimeList.filter(
  1509. (w) =>w.createDate==item.date
  1510. )[0].workingTime
  1511. }}
  1512. </div>
  1513. <div
  1514. v-if="
  1515. scope.row.worktimeList.filter(
  1516. (w) =>w.createDate==item.date
  1517. ).length == 0
  1518. "
  1519. >
  1520. 0
  1521. </div>
  1522. <div
  1523. v-if="
  1524. scope.row.worktimeList.filter(
  1525. (w) =>w.createDate==item.date
  1526. ).length > 0 &&
  1527. typeof scope.row.worktimeList.filter(
  1528. (w) =>w.createDate==item.date
  1529. )[0].workingTime == 'string'
  1530. "
  1531. >
  1532. {{
  1533. scope.row.worktimeList.filter(
  1534. (w) =>w.createDate==item.date
  1535. )[0].workingTime
  1536. }}
  1537. </div>
  1538. </template>
  1539. </el-table-column>
  1540. </el-table>
  1541. <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>
  1542. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1543. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1544. <label style="font-size: 16px">员工每日已填报工时数</label>
  1545. <el-link
  1546. type="primary"
  1547. style="float: right; margin-right: 60px"
  1548. @click="exportMembWorkHours()"
  1549. >导出已填报数据</el-link
  1550. > -->
  1551. <!-- <el-button >导出</el-button> -->
  1552. <!-- </div> -->
  1553. </el-tab-pane>
  1554. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1555. <div class="selectworktime_export" style="margin-top:10px">
  1556. <div class="selectworktime_export_l">
  1557. <el-date-picker
  1558. class="selecteworktime_datapick"
  1559. v-model="WorktimeDatepickValue"
  1560. value-format="yyyy-MM-dd"
  1561. type="daterange"
  1562. align="right"
  1563. unlink-panels
  1564. :range-separator="$t('other.to')"
  1565. :start-placeholder="$t('time.startDate')"
  1566. :end-placeholder="$t('time.endDate')"
  1567. :default-time="['12:00:00', '12:00:00']"
  1568. size="small"
  1569. popper-class="selecteorktime_datapick_popper"
  1570. @change="showMonthNotWorkTime()"
  1571. >
  1572. </el-date-picker>
  1573. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1574. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1575. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1576. </div>
  1577. <div>
  1578. <div style="margin-top:10px;">
  1579. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1580. <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>
  1581. <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">
  1582. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1583. </el-input>
  1584. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1585. <el-link
  1586. type="primary"
  1587. style="float: right; vertical-align: middle;height:32px"
  1588. @click="exportMembNotWorkHours()"
  1589. >{{$t('export.exportData')}}</el-link
  1590. >
  1591. </div>
  1592. </div>
  1593. </div>
  1594. <el-table
  1595. ref="hasworkTbl2"
  1596. :data="monthNotWorkDateS"
  1597. v-el-table-infinite-scroll="notListScroll"
  1598. border
  1599. :height="'70vh'"
  1600. highlight-current-row
  1601. style="width: 100%"
  1602. v-loading="tbload"
  1603. lazy
  1604. >
  1605. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1606. <template slot-scope="scope">
  1607. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1608. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1609. </template>
  1610. </el-table-column>
  1611. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1612. <template slot-scope="scope">
  1613. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1614. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1615. </template>
  1616. </el-table-column>
  1617. <el-table-column
  1618. min-width="200"
  1619. :label="$t('weekDay.date')"
  1620. align="center"
  1621. prop="createDate"
  1622. >
  1623. </el-table-column>
  1624. <el-table-column
  1625. min-width="200"
  1626. :label="$t('state.states')"
  1627. align="center"
  1628. prop="status"
  1629. />
  1630. <el-table-column
  1631. min-width="200"
  1632. :label="$t('other.attendanceData')"
  1633. prop="cardTime"
  1634. align="center"
  1635. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1636. </el-table>
  1637. <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>
  1638. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1639. </el-tab-pane>
  1640. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1641. <div class="selectworktime_export" style="margin-top:10px;">
  1642. <div class="selectworktime_export_l">
  1643. <el-date-picker
  1644. class="selecteworktime_datapick"
  1645. v-model="WorktimeDatepickValue"
  1646. value-format="yyyy-MM-dd"
  1647. type="daterange"
  1648. align="right"
  1649. unlink-panels
  1650. :range-separator="$t('other.to')"
  1651. :start-placeholder="$t('time.startDate')"
  1652. :end-placeholder="$t('time.endDate')"
  1653. :default-time="['12:00:00', '12:00:00']"
  1654. size="small"
  1655. popper-class="selecteorktime_datapick_popper"
  1656. @change="showMonthWorkTimeReminder()"
  1657. >
  1658. </el-date-picker>
  1659. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1660. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1661. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1662. </div>
  1663. <div>
  1664. <div style="margin-top:10px;">
  1665. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1666. <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>
  1667. <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">
  1668. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1669. </el-input>
  1670. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1671. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1672. </div>
  1673. </div>
  1674. <div style="float: right; vertical-align: middle;height:32px">
  1675. <el-link
  1676. type="primary"
  1677. @click="changeReminder()"
  1678. >{{ $t('bianGengTiXing') }}</el-link
  1679. >
  1680. <el-link
  1681. type="primary"
  1682. @click="exportMembWorkHoursReminder()"
  1683. >{{$t('export.exportData')}}</el-link
  1684. >
  1685. </div>
  1686. </div>
  1687. <el-table ref="hasworkTbl"
  1688. :data="monthWorkDataS"
  1689. v-el-table-infinite-scroll="listScroll"
  1690. border
  1691. :height="'70vh'"
  1692. highlight-current-row
  1693. style="width: 100%"
  1694. v-loading="tbload"
  1695. :lazy="true"
  1696. >
  1697. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1698. <template slot-scope="scope">
  1699. {{ scope.row.createDate}}
  1700. </template>
  1701. </el-table-column>
  1702. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1703. <template slot-scope="scope">
  1704. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1705. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1706. <!-- {{scope.row.name}} -->
  1707. </template>
  1708. </el-table-column>
  1709. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1710. <template slot-scope="scope">
  1711. {{scope.row.invokeValue}}
  1712. </template>
  1713. </el-table-column>
  1714. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1715. <template slot-scope="scope">
  1716. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1717. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1718. </template>
  1719. </el-table-column>
  1720. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1721. <template slot-scope="scope">
  1722. {{ scope.row.workingTime}}
  1723. </template>
  1724. </el-table-column>
  1725. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1726. <template slot-scope="scope">
  1727. {{ scope.row.cardTime}}
  1728. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1729. </template>
  1730. </el-table-column>
  1731. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1732. <template slot-scope="scope">
  1733. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1734. </template>
  1735. </el-table-column>
  1736. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1737. <template slot-scope="scope">
  1738. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1739. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1740. </template>
  1741. </el-table-column>
  1742. </el-table>
  1743. <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>
  1744. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1745. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1746. <label style="font-size: 16px">员工每日已填报工时数</label>
  1747. <el-link
  1748. type="primary"
  1749. style="float: right; margin-right: 60px"
  1750. @click="exportMembWorkHours()"
  1751. >导出已填报数据</el-link
  1752. > -->
  1753. <!-- <el-button >导出</el-button> -->
  1754. <!-- </div> -->
  1755. </el-tab-pane>
  1756. </el-tabs>
  1757. </el-dialog>
  1758. <!--驳回弹出框 -->
  1759. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1760. <div>
  1761. <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')" />
  1762. </div>
  1763. <div slot="footer" class="dialog-footer">
  1764. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1765. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1766. </div>
  1767. </el-dialog>
  1768. <!-- 通过弹出框 -->
  1769. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1770. <div>
  1771. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1772. </div>
  1773. <div slot="footer" class="dialog-footer">
  1774. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1775. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1776. </div>
  1777. </el-dialog>
  1778. <!--批量导入日报 -->
  1779. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1780. <p>1. {{$t('other.download')}}
  1781. <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>
  1782. </p>
  1783. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1784. <p style="display: flex;justify-content: center;">
  1785. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1786. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1787. </el-upload>
  1788. </p>
  1789. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1790. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1791. </div>
  1792. </el-dialog>
  1793. <!-- 工时导入记录弹窗 -->
  1794. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1795. <div style="height: 452px">
  1796. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1797. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1798. <el-table-column prop="userName" :label="$t('other.operator')">
  1799. <template slot-scope="scope">
  1800. <div>
  1801. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1802. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1803. </div>
  1804. </template>
  1805. </el-table-column>
  1806. <el-table-column prop="datel" :label="$t('other.document')">
  1807. <template slot-scope="scope">
  1808. <div>
  1809. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1810. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1811. </div>
  1812. </template>
  1813. </el-table-column>
  1814. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1815. <template slot-scope="scope">
  1816. <div>
  1817. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1818. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1819. </div>
  1820. </template>
  1821. </el-table-column>
  1822. </el-table>
  1823. <el-col :span="24" class="paginatis">
  1824. <el-pagination
  1825. @size-change="handleSizeChange"
  1826. @current-change="handleCurrentChange"
  1827. :page-sizes="[20 , 50 , 80 , 100]"
  1828. :page-size="20"
  1829. layout="total, sizes, prev, pager, next"
  1830. :total="toViewForm.total"
  1831. style="float:right;"
  1832. ></el-pagination>
  1833. </el-col>
  1834. </div>
  1835. </el-dialog>
  1836. <!--基于企业微信考勤数据的工时导入 -->
  1837. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1838. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1839. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1840. </el-step>
  1841. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1842. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1843. </el-steps>
  1844. <div v-if="active==0" style="padding:30px;height:360px;">
  1845. <div style="margin-top:50px;margin-left:280px;">
  1846. <el-date-picker
  1847. v-model="importWxParam.date" :editable="false"
  1848. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1849. :clearable="true"
  1850. :range-separator="$t('other.to')"
  1851. type="daterange"
  1852. :start-placeholder="$t('time.startDate')"
  1853. :end-placeholder="$t('time.endDate')"
  1854. @change="loadCheckInData"
  1855. ></el-date-picker>
  1856. </div>
  1857. </div>
  1858. <div v-if="active==1" style="padding:10px;">
  1859. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1860. style="width: 100%;margin-top:5px;" >
  1861. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1862. <template slot-scope="scope">
  1863. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1864. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1865. </template>
  1866. </el-table-column>
  1867. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1868. </el-table-column>
  1869. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1870. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1871. <template slot-scope="scope">
  1872. <div>
  1873. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1874. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1875. </div>
  1876. </template>
  1877. </el-table-column>
  1878. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1879. <template slot-scope="scope">
  1880. <div>
  1881. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1882. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1883. </div>
  1884. </template>
  1885. </el-table-column>
  1886. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1887. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1888. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1889. <template slot-scope="scope">
  1890. {{scope.row.workHours.toFixed(1)}}h
  1891. </template>
  1892. </el-table-column>
  1893. </el-table>
  1894. </div>
  1895. <div v-if="active==2" >
  1896. <p style="display: flex;justify-content: center;height:390px;">
  1897. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1898. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1899. </el-upload>
  1900. </p>
  1901. </div>
  1902. <div slot="title">
  1903. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1904. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1905. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1906. <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">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  1907. <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;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  1908. <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();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  1909. </div>
  1910. <span slot="footer">
  1911. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1912. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1913. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  1914. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1915. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1916. </span>
  1917. </el-dialog>
  1918. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1919. <p style="display: flex;justify-content: center;height:100px;">
  1920. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1921. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1922. </el-upload>
  1923. </p>
  1924. </el-dialog>
  1925. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1926. <div>
  1927. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1928. v-model="deleteReportParam.date" :editable="false"
  1929. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1930. :clearable="true"
  1931. :range-separator="$t('other.to')"
  1932. type="daterange"
  1933. :start-placeholder="$t('time.startDate')"
  1934. :end-placeholder="$t('time.endDate')"
  1935. ></el-date-picker>
  1936. </div>
  1937. <div style="margin-top:10px;">
  1938. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  1939. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1940. <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>
  1941. </div>
  1942. <div style="margin-top:10px;">
  1943. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  1944. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  1945. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1946. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1947. <span v-else>{{item.name}}</span>
  1948. </el-option>
  1949. </el-select>
  1950. </div>
  1951. <span slot="footer">
  1952. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  1953. </span>
  1954. </el-dialog>
  1955. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1956. <div>
  1957. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1958. v-model="deleteReportParam.date" :editable="false"
  1959. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1960. :clearable="true"
  1961. :range-separator="$t('other.to')"
  1962. type="daterange"
  1963. :start-placeholder="$t('time.startDate')"
  1964. :end-placeholder="$t('time.endDate')"
  1965. ></el-date-picker>
  1966. </div>
  1967. <div style="margin-top:15px;">
  1968. <span>{{ $t('other.selectdepartment') }}:</span>
  1969. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  1970. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1971. size="small" v-if="user.userNameNeedTranslate != 1"
  1972. ></el-cascader>
  1973. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1974. </div>
  1975. <span slot="footer">
  1976. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  1977. </span>
  1978. </el-dialog>
  1979. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1980. <div>
  1981. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  1982. v-model="modImportTime"
  1983. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1984. :clearable="true"
  1985. type="datetime"
  1986. ></el-date-picker>
  1987. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  1988. v-model="modImportUserId"
  1989. >
  1990. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1991. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  1992. <span v-else>{{item.name}}</span>
  1993. </el-option>
  1994. </el-select>
  1995. </div>
  1996. <span slot="footer">
  1997. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  1998. </span>
  1999. </el-dialog>
  2000. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2001. <div>
  2002. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2003. <el-date-picker
  2004. v-model="ratioYmonth" :editable="false"
  2005. format="yyyyMM" value-format="yyyyMM"
  2006. type="month"
  2007. ></el-date-picker>
  2008. </div>
  2009. <span slot="footer">
  2010. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2011. </span>
  2012. </el-dialog>
  2013. <!--工时批量代填 -->
  2014. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2015. <div>
  2016. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2017. v-model="importWxParam.date" :editable="false"
  2018. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2019. :clearable="true"
  2020. :range-separator="$t('other.to')"
  2021. type="daterange"
  2022. :start-placeholder="$t('time.startDate')"
  2023. :end-placeholder="$t('time.endDate')"
  2024. @change="loadCheckInData"
  2025. ></el-date-picker>
  2026. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2027. </div>
  2028. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2029. :key="timeStamp"
  2030. style="width: 100%;margin-top:5px;" ref="tab">
  2031. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2032. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2033. <template slot-scope="scope">
  2034. <div>
  2035. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2036. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2037. </div>
  2038. </template>
  2039. </el-table-column>
  2040. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2041. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2042. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2043. <template slot-scope="scope">
  2044. {{scope.row.workHours.toFixed(1)}}h
  2045. </template>
  2046. </el-table-column>
  2047. <!--项目名称列表 -->
  2048. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2049. <template slot-scope="scope">
  2050. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2051. </template>
  2052. </el-table-column>
  2053. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2054. <template slot-scope="scope">
  2055. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2056. </template>
  2057. </el-table-column>
  2058. </el-table>
  2059. </el-dialog>
  2060. <!--基于企业微信考勤数据的工时导入 -->
  2061. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2062. <div style="padding-bottom:10px;">
  2063. <p>{{importResultMsg}}</p>
  2064. </div>
  2065. <!-- <span slot="footer" class="dialog-footer">
  2066. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2067. </span> -->
  2068. </el-dialog>
  2069. <!-- 审核流程展示 -->
  2070. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  2071. <div style="padding:20px 40px 20px 0">
  2072. <el-timeline :reverse="false">
  2073. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2074. <!-- {{item.msg}} -->
  2075. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2076. <span v-if="user.userNameNeedTranslate == 1">
  2077. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2078. <span>{{item.msgCon.two}}</span>
  2079. </span>
  2080. </el-timeline-item>
  2081. </el-timeline>
  2082. </div>
  2083. </el-dialog>
  2084. <!-- 威派格定制 -->
  2085. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2086. </section>
  2087. </template>
  2088. <script>
  2089. // 左右滑动
  2090. import dragMixin from "@/common/js/tensile.js";
  2091. import util from "../../common/js/util";
  2092. // 自定义select组件
  2093. import selectCat from "@/components/select.vue"
  2094. // 引入自定义级联组件
  2095. import vueCascader from "@/components/cascader.vue"
  2096. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2097. // 重庆物奇定制组件
  2098. import WeeklyCustomization from "./weeklyCustomization.vue"
  2099. // 威派格定制转移工时
  2100. import TransferWorkingHours from "./transferWorkingHours.vue"
  2101. // 新的按周填报
  2102. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2103. import { mapMutations } from 'vuex'
  2104. let _that = this
  2105. export default {
  2106. mixins: [dragMixin],
  2107. components: {
  2108. selectCat,
  2109. vueCascader,
  2110. WeeklyCustomization,
  2111. vueMultipleDept,
  2112. TransferWorkingHours,
  2113. NewWeeklyCustomization
  2114. },
  2115. data() {
  2116. return {
  2117. refreshingTime: false,
  2118. substitudeStep: 1,
  2119. showHidden: false,
  2120. pageIndex: 0,
  2121. hasMore: true,
  2122. exportType: 0,
  2123. exportingData: false,
  2124. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2125. jobResponseList:[],
  2126. yisibeiCompId: 3092,
  2127. yuzhongCompId: 3385,
  2128. mingyiName : '成都明夷电子科技有限公司',
  2129. // mingyiName : '明夷',
  2130. modItemDataId: null,
  2131. modImportTime: null,
  2132. modImportUserId: null,
  2133. showModImportTimeDialog: false,
  2134. showBatchSimpleApproveReport: false,
  2135. startDeleting: false,
  2136. showBatchDeleteReport: false,
  2137. deleteReportParam: {date:null, userIds:[]},
  2138. isDenying: false,
  2139. targetWeekDate: null,//填写周报中的周日期
  2140. importCardTimeVisi: false,
  2141. startRatioExporting: false,
  2142. exportUserRatio: false,
  2143. ratioYmonth:null,
  2144. hasWrittenReport: false,
  2145. today:null,
  2146. syncTimeLoading: false,
  2147. seluserText: '',
  2148. translation: '1', // 1、文字, 2、部门, 3、人员
  2149. exportLoad: false,
  2150. getPickerOptions: {
  2151. disabledDate: (time) => {
  2152. var date = new Date();
  2153. var year = date.getFullYear();
  2154. var month = date.getMonth() + 1;
  2155. if (month >= 1 && month <= 9) {
  2156. month = "0" + month;
  2157. }
  2158. var currentdate = year.toString() + month.toString();
  2159. var timeyear = time.getFullYear();
  2160. var timemonth = time.getMonth() + 1;
  2161. if (timemonth >= 1 && timemonth <= 9) {
  2162. timemonth = "0" + timemonth;
  2163. }
  2164. var timedate = timeyear.toString() + timemonth.toString();
  2165. if(this.user.timeType.fillAhead == 0){
  2166. return currentdate < timedate;
  2167. }else{
  2168. return false
  2169. }
  2170. }
  2171. },
  2172. alalal: '8.0',
  2173. timeBasecostList:null,
  2174. tbload: false,
  2175. exportTimeDialog: false,
  2176. searchKeyword: '',
  2177. monthWorkDataS: [],
  2178. monthNotWorkDateS: [],
  2179. pickDateArray:[],
  2180. WorktimeDatepickValue: [],
  2181. activeName:"first",
  2182. isLeave: 0,
  2183. submitingReport: false,
  2184. importResultMsg:null,
  2185. showImportResult:false,
  2186. importingData: false,
  2187. isDraft: 0,
  2188. timeStamp: 0,
  2189. projectColumns:[],
  2190. checkinLoading:false,
  2191. importWxParam:{date:null,},
  2192. active:0,
  2193. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2194. importWxDialog:false,
  2195. importDialog:false,
  2196. denyForm:null,
  2197. denyReasonDialog:false,
  2198. monthWorkTimeDialog: false,
  2199. isSubstitude:false,
  2200. isFill:false,
  2201. unFillList:[],
  2202. fillList:[],
  2203. fillMembList:[],
  2204. fillMembList_leave: [],
  2205. membListVisible: false,
  2206. isBatch:0,//是否是批量填报
  2207. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2208. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2209. 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')],
  2210. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2211. fillStatusList: [],
  2212. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2213. exportReportLogParam:{dateRange:[]},
  2214. exportDialog:false,
  2215. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2216. subProjectList:[],
  2217. canEdit: true,
  2218. originCanEdit: true,
  2219. 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],
  2220. selectTime:null,
  2221. reportTimeType:{},
  2222. curDate:'',
  2223. isAllSelect: false,
  2224. approveDialogVisible:false,
  2225. deptId:null,
  2226. targetUid: null,
  2227. membCount:0,
  2228. selectState:"-1",
  2229. user: JSON.parse(sessionStorage.getItem("user")),
  2230. allUsersList: [],
  2231. showAddMore:false,
  2232. allDate: [],
  2233. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2234. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2235. choseDay: 0,
  2236. tableHeight: 0,
  2237. listLoading: false,
  2238. projectList: [], //项目列表
  2239. fillProjectList: [],
  2240. reportList: [], //日报列表
  2241. reportNames:[], //批量审批列表
  2242. selCon:[], //筛选条件
  2243. selProjectList:[], //筛选后项目列表
  2244. selConShow: true,
  2245. usersList: [], // 全部人员列表
  2246. usersListId: '', // 选中的人员id
  2247. dialogVisible: false, //项目弹窗
  2248. report: '',
  2249. workForm: {
  2250. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2251. domains: [{
  2252. id: null,
  2253. projectId: "",
  2254. workingTime: "",
  2255. timeType:0,
  2256. content: "",
  2257. state: 2,
  2258. multiWorktime:0,
  2259. worktimeList:[],
  2260. degreeId: null,
  2261. auditUserList: [],
  2262. }],
  2263. showRefresh: false,
  2264. },
  2265. workRules: {
  2266. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2267. },
  2268. chooseParticipVisible: false,
  2269. logining: false,
  2270. isDisable: false,
  2271. timeType:[],
  2272. deptMembData: [
  2273. ],
  2274. //部门人员树状结构
  2275. data: [
  2276. {
  2277. id: -1,
  2278. label: this.$t('lable.allStaff'),
  2279. membCount:0
  2280. },
  2281. {
  2282. id: 0,
  2283. label: this.$t('lable.unassigned'),
  2284. }
  2285. ],
  2286. allData:{},
  2287. batchShowData:{},
  2288. option: [],
  2289. deptOptionList: [],
  2290. depData: {
  2291. id: -1,
  2292. label: this.$t('lable.allStaff'),
  2293. },
  2294. defaultProps: {
  2295. children: 'children',
  2296. label: 'label'
  2297. },
  2298. isNew: false,
  2299. selected: false,
  2300. valuet: new Date(),
  2301. domObj: null,
  2302. participator:[],
  2303. chosenMembCount:0,
  2304. jsDay: 0,
  2305. jsTime: 0,
  2306. falsss: false,
  2307. weidu: [],
  2308. weiduList: [],
  2309. yonghuUser: [],
  2310. dateAr: [],
  2311. batchSubFillDialog: false,
  2312. isSubstiS: false,
  2313. fillWeekDialogVisi: false,
  2314. fillWeekDialogVisiCustom: false,
  2315. fillWeekDialogVisiCustomTwo: false,
  2316. zhoData: [],
  2317. weekDateRange: [],
  2318. btnZho: false,
  2319. weekDataLoading: false,
  2320. changdu: 6,
  2321. tianxieDialogVisible: false,
  2322. scopess: {},
  2323. zhoBao: {
  2324. time: '',
  2325. workingTime: '',
  2326. progress: '',
  2327. con: '',
  2328. subProjectId: '',
  2329. stage: '',
  2330. subProjectList: [],
  2331. stages: [],
  2332. },
  2333. zhoBaoIdx: '',
  2334. zhoBaoName: '',
  2335. zhis: {},
  2336. dealList: [],
  2337. toViewDialogVisible: false,
  2338. toViewList: [],
  2339. toViewloading: true,
  2340. toViewForm: {
  2341. pageIndex: '1',
  2342. pageSize: '20',
  2343. total: 0,
  2344. },
  2345. toViewloadings: false,
  2346. tabPositionss: 'top',
  2347. monthTotal: 0,
  2348. monthTotalPage: 0,
  2349. monthTotalLages: 20,
  2350. monthWorkData: [],
  2351. monthNotWorkDate: [],
  2352. monthWorkDataS1: [],
  2353. monthnotTotal: 0,
  2354. monthnotTotalPage: 0,
  2355. monthnotTotalLages: 20,
  2356. monthNotWorkDateS1: [],
  2357. deptMembDataText: '',
  2358. isFlag: false,
  2359. isMore: false,
  2360. stateKey: '0',
  2361. expandDate: [],
  2362. notifySelList:[],
  2363. departmentList: [],
  2364. trandepartmentList:[],
  2365. approvalProcessDialog: false,
  2366. approvalProcessData: [],
  2367. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2368. 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')],
  2369. isWeekend: false,
  2370. canCancelInDialog: false,
  2371. approveinData: {},
  2372. approveinDialog: false,
  2373. reportCanDelete: false,
  2374. weeklyFilledTimeDialog: false,
  2375. weeklyFilledTimeList: [],
  2376. weeklyFilledTimeLoading: false,
  2377. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2378. weeklyFilledTimeCanDelete: false,
  2379. weeklyFilledTimeDate: null,
  2380. leaveAllNum: 0,
  2381. dataLoading: false,
  2382. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2383. vacationTime: {},
  2384. integrationProjectList: [],
  2385. totalReportHours: 0, // 合计的工时
  2386. workTimeForMinYi:0,
  2387. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2388. weekIndex: 1,
  2389. weekParentData: {},
  2390. deptIdForNoReport:[],
  2391. deptIdForReminder:[],
  2392. nameAearch: '', // 企业微信姓名搜索
  2393. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2394. deptMembDataLoading: false,
  2395. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2396. {
  2397. id: 4811,
  2398. // id: 10,
  2399. name: '陕西柘中建设工程有限公司'
  2400. }
  2401. ],
  2402. pushWorkTimeLogDig:false,
  2403. pushWorkTimeLogData:[],
  2404. userReportDeptList: [],
  2405. isReminder:true,
  2406. reportLogCheckDialog:false,
  2407. deptIdForHasReport:[],
  2408. transferWorkingHoursVisable: false
  2409. };
  2410. },
  2411. watch: {
  2412. deptMembDataText(val) {
  2413. this.$refs.chooseMembTree.filter(val);
  2414. }
  2415. },
  2416. filters: {
  2417. // 过滤
  2418. amounts(value) {
  2419. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2420. return 0
  2421. }
  2422. var zhi = +value + 0
  2423. return zhi.toFixed(1)
  2424. },
  2425. // zhoData
  2426. zhoData(value, arr) {
  2427. var dateArray = value.split("-");
  2428. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2429. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2430. // console.log(arr[date.getDay()])
  2431. // return "周" + "日一二三四五六".charAt(date.getDay());
  2432. return arr[date.getDay()]
  2433. },
  2434. // 过滤数字
  2435. numbers(value) {
  2436. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2437. return 0
  2438. }
  2439. return value
  2440. },
  2441. },
  2442. computed: {},
  2443. mounted() {
  2444. var now = new Date();
  2445. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2446. this.today = t;
  2447. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2448. this.exportParam.dateRange = [startStr,t];
  2449. this.exportReportLogParam.dateRange = [startStr,t];
  2450. this.getAllDate(1);
  2451. this.getReportList();
  2452. this.getProjectList();
  2453. this.getFillProjectList();
  2454. this.getTimeType();
  2455. this.getDepartment();
  2456. this.scrollFunction()
  2457. this.userssHu();
  2458. this.getFirstAndLastDay()
  2459. if(this.user.timeType.reportAuditType == 3){
  2460. this.getAllUsersList()
  2461. }
  2462. if (this.user.company.packageProject == 1) {
  2463. this.getBasecostItemList();
  2464. }
  2465. if(this.user.timeType.userWithMultiDept == 1) {
  2466. this.getDeptMembData();
  2467. }
  2468. if(this.user.timeType.lockWorktime){
  2469. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2470. }
  2471. //设置了下限
  2472. if (this.user.timeType.minReportTime) {
  2473. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2474. }
  2475. const that = this
  2476. if(this.user.userNameNeedTranslate == 1) {
  2477. that.dataLoading = that.$store.state.dataLoading
  2478. this.upDataLoading()
  2479. setTimeout(()=>{
  2480. that.dataLoading = that.$store.state.dataLoading
  2481. }, 1000)
  2482. }
  2483. if (this.user.companyId == this.yuzhongCompId) {
  2484. this.getJobResponList();
  2485. }
  2486. },
  2487. methods: {
  2488. ...mapMutations(['upDataLoading']),
  2489. // 已填工时情况表设置背景色
  2490. hasworkTblCellStyle({ columnIndex, row, column }) {
  2491. if(columnIndex > 2) {
  2492. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2493. const worktimeList = row.worktimeList || []
  2494. const times = this.reportTimeType.allday
  2495. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2496. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2497. const missReport = filterData[0] && filterData[0].missReport;
  2498. const state = filterData[0] && filterData[0].state
  2499. if (missReport) {
  2500. return "backgroundColor: red"
  2501. } else {
  2502. if (state == 0 || state == -1) {
  2503. return "backgroundColor: orange"
  2504. } else if (state == 1) {
  2505. //审核通过
  2506. return "backgroundColor: #32CD32"
  2507. } else if (state == 2) {
  2508. return "backgroundColor: red"
  2509. } else {
  2510. return "backgroundColor: #E0E0E0"
  2511. }
  2512. }
  2513. }
  2514. },
  2515. //按选择的日期范围刷新考勤
  2516. refreshWXCardTimeByRange() {
  2517. this.refreshingTime = true;
  2518. this.http.post('/wxcorp/getUserCheckInDayData',{
  2519. companyId: this.user.companyId,
  2520. userId: this.user.id,
  2521. startDate: this.importWxParam.date[0],
  2522. endDate: this.importWxParam.date[1],
  2523. },res => {
  2524. this.refreshingTime = false;
  2525. if(res.code == 'ok'){
  2526. this.loadCheckInData();
  2527. }else {
  2528. this.$message({
  2529. message: res.msg,
  2530. type: 'error'
  2531. })
  2532. }
  2533. },err => {
  2534. this.syncTimeLoading = false;
  2535. this.$message({
  2536. message: err,
  2537. type: 'error'
  2538. })
  2539. })
  2540. },
  2541. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2542. isCustomization(userInfo, permissionArray) {
  2543. const { companyId } = userInfo
  2544. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2545. return isReportPictureRequired
  2546. },
  2547. showHiddenFunction() {
  2548. this.showHidden = true;
  2549. },
  2550. // 获取如何信息选的可填写部门
  2551. getDeptMembData() {
  2552. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2553. if (res.code == "ok") {
  2554. let lists = res.data.userReportDeptList || []
  2555. const optimizedList = lists.map(item => ({
  2556. ...item,
  2557. label: item.departmentName,
  2558. value: item.departmentId,
  2559. }));
  2560. this.$set(this, 'userReportDeptList', optimizedList || []);
  2561. } else {
  2562. this.$message({
  2563. message: res.msg,
  2564. type: "error"
  2565. });
  2566. }
  2567. },error => { });
  2568. },
  2569. //任务被选中
  2570. onTaskSelected(domainItem) {
  2571. //取服务
  2572. if (domainItem.taskId) {
  2573. var that = this;
  2574. var param = {taskId:domainItem.taskId};
  2575. if (this.isSubstitude) {
  2576. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2577. param.userId = this.workForm.userId[0];
  2578. }
  2579. }
  2580. this.http.post('/task/getMyTaskService',param, res => {
  2581. if (res.code == "ok") {
  2582. // domainItem.workContentList = res.data;
  2583. that.$set(domainItem, 'sapServiceId', null);
  2584. that.$set(domainItem, 'serviceList', res.data);
  2585. } else {
  2586. this.$message({
  2587. message: res.msg,
  2588. type: "error"
  2589. });
  2590. }
  2591. },error => {
  2592. this.$message({
  2593. message: error,
  2594. type: "error"
  2595. });
  2596. }
  2597. );
  2598. } else {
  2599. //清空服务
  2600. }
  2601. },
  2602. onBatchTimeChange() {
  2603. //反向计算每日工作时长
  2604. if (this.workForm.createDate) {
  2605. let sdate = new Date(this.workForm.createDate[0]);
  2606. let edate = new Date(this.workForm.createDate[1]);
  2607. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2608. console.log('days===', days)
  2609. if (days < 0) {
  2610. return;
  2611. }
  2612. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2613. //总时长发生改变,自动按比例计算
  2614. this.workForm.domains.forEach(d=>{
  2615. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2616. });
  2617. }
  2618. },
  2619. //更新工作内容列表
  2620. updateJobContent(domainItem) {
  2621. var that = this;
  2622. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2623. if (res.code == "ok") {
  2624. // domainItem.workContentList = res.data;
  2625. that.$set(domainItem, 'extraField3', null);
  2626. that.$set(domainItem, 'workContentList', res.data);
  2627. } else {
  2628. this.$message({
  2629. message: res.msg,
  2630. type: "error"
  2631. });
  2632. }
  2633. },error => {
  2634. this.$message({
  2635. message: error,
  2636. type: "error"
  2637. });
  2638. }
  2639. );
  2640. },
  2641. updateResponse(domainItem) {
  2642. var that = this;
  2643. var selectPid = domainItem.projectId;
  2644. domainItem.extraField2 = null;
  2645. domainItem.extraField3 = null;
  2646. if (selectPid && domainItem.extraField1) {
  2647. //是否非项目
  2648. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2649. console.log('==========','isPublic=='+isPublic);
  2650. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2651. console.log(filteredRespList);
  2652. domainItem.filteredRespList = filteredRespList;
  2653. }
  2654. },
  2655. getJobResponList() {
  2656. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2657. if (res.code == "ok") {
  2658. this.jobResponseList = res.data;
  2659. } else {
  2660. this.$message({
  2661. message: res.msg,
  2662. type: "error"
  2663. });
  2664. }
  2665. },error => {
  2666. this.$message({
  2667. message: error,
  2668. type: "error"
  2669. });
  2670. }
  2671. );
  2672. },
  2673. openModImportTime(row) {
  2674. this.showModImportTimeDialog = true;
  2675. this.modItemDataId = row.id;
  2676. },
  2677. delImportTime(row) {
  2678. let rowId = row.id;
  2679. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2680. confirmButtonText: this.$t('btn.determine'),
  2681. cancelButtonText: this.$t('btn.cancel'),
  2682. type: "warning"
  2683. })
  2684. .then(() => {
  2685. this.http.post('/report-import-log/delete',{
  2686. id: rowId
  2687. },res => {
  2688. if (res.code == "ok") {
  2689. this.$message({
  2690. message: this.$t('message.successfullyDeleted'),
  2691. type: "success"
  2692. });
  2693. this.getToView();
  2694. } else {
  2695. this.$message({
  2696. message: res.msg,
  2697. type: "error"
  2698. });
  2699. }
  2700. },error => {
  2701. this.$message({
  2702. message: error,
  2703. type: "error"
  2704. });
  2705. }
  2706. );
  2707. }).catch(() => {this.startDeleting = false});
  2708. },
  2709. confirmChangeModTime() {
  2710. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2711. this.$message({
  2712. message: this.$t('message.Pleaseselectatime'),
  2713. type: "error"
  2714. });
  2715. return;
  2716. }
  2717. this.http.post('/report-import-log/changeTime',{
  2718. modLogDateTime: this.modImportTime,
  2719. modImportUserId: this.modImportUserId,
  2720. id: this.modItemDataId
  2721. },res => {
  2722. if (res.code == "ok") {
  2723. this.$message({
  2724. message: this.$t('message.modifyTheSuccess'),
  2725. type: "success"
  2726. });
  2727. this.getToView();
  2728. this.showModImportTimeDialog = false;
  2729. } else {
  2730. this.$message({
  2731. message: res.msg,
  2732. type: "error"
  2733. });
  2734. }
  2735. },error => {
  2736. this.$message({
  2737. message: error,
  2738. type: "error"
  2739. });
  2740. }
  2741. );
  2742. },
  2743. confirmBatchApproveReport() {
  2744. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2745. this.$message({
  2746. message: this.$t('qingXuanZeRiQiFanWei'),
  2747. type: "error"
  2748. });
  2749. return;
  2750. }
  2751. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2752. confirmButtonText: this.$t('btn.determine'),
  2753. cancelButtonText: this.$t('btn.cancel'),
  2754. type: "warning"
  2755. })
  2756. .then(() => {
  2757. this.startDeleting = true;
  2758. let obj = {
  2759. startDate: this.deleteReportParam.date[0],
  2760. endDate: this.deleteReportParam.date[1]
  2761. }
  2762. if(this.deleteReportParam.departmentId) {
  2763. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2764. } else {
  2765. obj.departmentId = null
  2766. }
  2767. this.http.post('/report/batchApproveByDate',obj,res => {
  2768. if (res.code == "ok") {
  2769. this.$message({
  2770. message: this.$t('state.approved'),
  2771. type: "success"
  2772. });
  2773. this.getReportList();
  2774. this.getDepartment();
  2775. this.startDeleting = false;
  2776. } else {
  2777. this.$message({
  2778. message: res.msg,
  2779. type: "error"
  2780. });
  2781. }
  2782. },error => {
  2783. this.$message({
  2784. message: error,
  2785. type: "error"
  2786. });
  2787. }
  2788. );
  2789. }).catch(() => {this.startDeleting = false});
  2790. },
  2791. confirmBatchDelReport() {
  2792. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2793. this.$message({
  2794. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2795. type: "error"
  2796. });
  2797. return;
  2798. }
  2799. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2800. this.$message({
  2801. message: this.$t('qingXuanZeRiQiFanWei'),
  2802. type: "error"
  2803. });
  2804. return;
  2805. }
  2806. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2807. confirmButtonText: this.$t('btn.determine'),
  2808. cancelButtonText: this.$t('btn.cancel'),
  2809. type: "warning"
  2810. })
  2811. .then(() => {
  2812. this.startDeleting = true;
  2813. this.http.post('/report/batchDelete',{
  2814. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2815. startDate: this.deleteReportParam.date[0],
  2816. endDate: this.deleteReportParam.date[1],
  2817. deptId: this.deleteReportParam.deptId[0]
  2818. },res => {
  2819. if (res.code == "ok") {
  2820. this.$message({
  2821. message: this.$t('message.successfullyDeleted'),
  2822. type: "success"
  2823. });
  2824. this.getReportList();
  2825. this.getDepartment();
  2826. this.startDeleting = false;
  2827. } else {
  2828. this.$message({
  2829. message: res.msg,
  2830. type: "error"
  2831. });
  2832. }
  2833. },error => {
  2834. this.$message({
  2835. message: error,
  2836. type: "error"
  2837. });
  2838. }
  2839. );
  2840. }).catch(() => {this.startDeleting = false});
  2841. },
  2842. getRecentlyProject() {
  2843. this.http.post('/project/nearProject',{},res => {
  2844. if(res.code == 'ok'){
  2845. let topObj = {
  2846. label: this.$t('zuiJinXuanZeXiangMu'),
  2847. peojectList: res.data
  2848. }
  2849. let botomObj = {
  2850. label: this.$t('other.allProject'),
  2851. peojectList: this.fillProjectList
  2852. }
  2853. //最近项目如果在fillProjectList中不存在,需要移除
  2854. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2855. this.integrationProjectList = [topObj, botomObj]
  2856. }else {
  2857. this.$message({
  2858. message: res.msg,
  2859. type: 'error'
  2860. })
  2861. }
  2862. },err => {
  2863. this.$message({
  2864. message: err,
  2865. type: 'error'
  2866. })
  2867. })
  2868. },
  2869. handlePictureCardPreview(file, index) {
  2870. console.log(file, index)
  2871. let arr = []
  2872. let imgArr = this.workForm.domains[index].imgListUrl
  2873. for(var i in imgArr) {
  2874. arr.push(imgArr[i].url)
  2875. }
  2876. console.log(arr, '图片数据')
  2877. const $viewer = this.$viewerApi({
  2878. images: arr
  2879. });
  2880. },
  2881. // 图片上传
  2882. addImg(e, index) {
  2883. console.log(e, '数据')
  2884. let formData = new FormData()
  2885. formData.append('multipartFile', e.file)
  2886. this.http.uploadFile('/common/uploadFile', formData,
  2887. res => {
  2888. if (res.code == "ok") {
  2889. this.$message({
  2890. message: this.$t('uploadedsuccessfully'),
  2891. type: "success"
  2892. });
  2893. if(!this.workForm.domains[index].imgList) {
  2894. this.workForm.domains[index].imgList = []
  2895. this.workForm.domains[index].imgListUrl = []
  2896. }
  2897. this.workForm.domains[index].imgList.push(res.data)
  2898. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2899. } else {
  2900. this.$message({message: res.msg,type: "error"});
  2901. }
  2902. console.log(this.workForm.domains[index])
  2903. },
  2904. error => {this.$message({message: error,type: "error"});
  2905. });
  2906. },
  2907. // 删除图片
  2908. delImg(file,fileList, index) {
  2909. console.log(file, fileList)
  2910. let idx = 0
  2911. for(let i in fileList) {
  2912. if(fileList[i].uid == file.uid) {
  2913. idx = i
  2914. }
  2915. }
  2916. this.workForm.domains[index].imgList.splice(idx, 1)
  2917. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2918. console.log(this.workForm.domains[index])
  2919. },
  2920. test(){
  2921. console.log('test',this.workForm.domains);
  2922. },
  2923. getHour(s1, s2) {
  2924. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2925. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2926. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2927. var ms = s2.getTime() - s1.getTime();
  2928. if (ms < 0) return 0;
  2929. let ma = ms / 1000 / 60 / 60
  2930. return ma; //小时
  2931. },
  2932. refreshWXCardTime(workdate) {
  2933. if (!workdate) return;
  2934. this.syncTimeLoading = true;
  2935. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2936. date: workdate,
  2937. },res => {
  2938. this.syncTimeLoading = false;
  2939. if(res.code == 'ok'){
  2940. this.workForm.time = res.data.time;
  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. refreshAttendance(workdate) {
  2956. if (!workdate) return;
  2957. this.syncTimeLoading = true;
  2958. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2959. startDate: workdate[0],
  2960. endDate: workdate[1]
  2961. },res => {
  2962. this.syncTimeLoading = false;
  2963. if(res.code == 'ok'){
  2964. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2965. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2966. this.totalReportHours = this.workTimeForMinYi;
  2967. }else {
  2968. this.$message({
  2969. message: res.msg,
  2970. type: 'error'
  2971. })
  2972. }
  2973. },err => {
  2974. this.syncTimeLoading = false;
  2975. this.$message({
  2976. message: err,
  2977. type: 'error'
  2978. })
  2979. })
  2980. },
  2981. refreshBeiSengAttendance(workdate) {
  2982. if (!workdate) return;
  2983. this.syncTimeLoading = true;
  2984. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  2985. createDate: workdate
  2986. },res => {
  2987. this.syncTimeLoading = false;
  2988. if(res.code == 'ok'){
  2989. this.workForm.time = res.data;
  2990. }else {
  2991. this.$message({
  2992. message: res.msg,
  2993. type: 'error'
  2994. })
  2995. }
  2996. },err => {
  2997. this.syncTimeLoading = false;
  2998. this.$message({
  2999. message: err,
  3000. type: 'error'
  3001. })
  3002. })
  3003. },
  3004. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3005. this.weeklyFilledTimeDialog = true
  3006. this.weeklyFilledTimeLoading = true
  3007. this.weeklyFilledTimeDate = parameterDate
  3008. this.http.post('/report/getReportList',{
  3009. date: parameterDate,
  3010. userId: this.user.id
  3011. },res => {
  3012. this.weeklyFilledTimeLoading = false
  3013. if(res.code == 'ok'){
  3014. this.weeklyFilledTimeList = res.data[0].data
  3015. let candelete = true
  3016. for(let i in this.weeklyFilledTimeList){
  3017. if(this.weeklyFilledTimeList[i].state < 2){
  3018. candelete = false
  3019. }
  3020. }
  3021. this.weeklyFilledTimeCanDelete = candelete
  3022. }else {
  3023. this.$message({
  3024. message: res.msg,
  3025. type: 'error'
  3026. })
  3027. }
  3028. },err => {
  3029. this.weeklyFilledTimeLoading = false
  3030. this.$message({
  3031. message: err,
  3032. type: 'error'
  3033. })
  3034. })
  3035. },
  3036. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3037. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3038. confirmButtonText: this.$t('btn.determine'),
  3039. cancelButtonText: this.$t('btn.cancel'),
  3040. type: "warning"
  3041. })
  3042. .then(() => {
  3043. this.http.post('/report/delete',{
  3044. userId: this.user.id,
  3045. date: this.weeklyFilledTimeDate
  3046. },res => {
  3047. if (res.code == "ok") {
  3048. this.$message({
  3049. message: this.$t('message.successfullyDeleted'),
  3050. type: "success"
  3051. });
  3052. this.getWeeklyWorkTime()
  3053. this.getReportList();
  3054. this.getDepartment();
  3055. this.weeklyFilledTimeDialog = false;
  3056. } else {
  3057. this.$message({
  3058. message: res.msg,
  3059. type: "error"
  3060. });
  3061. }
  3062. },error => {
  3063. this.$message({
  3064. message: error,
  3065. type: "error"
  3066. });
  3067. }
  3068. );
  3069. }).catch(() => {});
  3070. },
  3071. getApprovalProcess(item){
  3072. // console.log('this.date',this.choseDate);
  3073. this.http.post('/report-log/get',{
  3074. creatorId: item.id,
  3075. createDate: sessionStorage.msg
  3076. },res => {
  3077. if(res.code == 'ok'){
  3078. this.approvalProcessDialog = true
  3079. if(this.user.userNameNeedTranslate == 1) {
  3080. for(var i in res.data) {
  3081. let obj = {
  3082. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3083. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3084. }
  3085. res.data[i].msgCon = obj
  3086. }
  3087. }
  3088. this.approvalProcessData = res.data
  3089. console.log(this.approvalProcessData, '数据卡看')
  3090. }else{
  3091. this.$message({
  3092. message: res.msg,
  3093. type: 'error'
  3094. })
  3095. }
  3096. },err => {
  3097. this.$message({
  3098. message: err,
  3099. type: 'error'
  3100. })
  3101. })
  3102. },
  3103. filterNode(value, data) {
  3104. if (!value) return true;
  3105. return data.label.indexOf(value) !== -1;
  3106. },
  3107. triggerCalculateOT(index) {
  3108. var str = this.workForm.domains[index].overtimeHours + ''
  3109. if(str.indexOf('.') != '-1') {
  3110. var s = str.split('.')[0]
  3111. var st = str.split('.')[1]
  3112. var sts = st.split('')
  3113. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3114. }
  3115. },
  3116. searchScreen(e){
  3117. if(e){
  3118. this.monthNotWorkDateS1 = []
  3119. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3120. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3121. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3122. }
  3123. }
  3124. if (this.monthNotWorkDateS1.length > 50) {
  3125. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3126. }else{
  3127. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3128. }
  3129. // if (this.monthNotWorkDateS1.length > 0) {
  3130. // setTimeout(() => {
  3131. // this.tableListenernot()
  3132. // }, 1000);
  3133. // }
  3134. }else{
  3135. this.monthWorkDataS1 = []
  3136. for (let i = 0; i < this.monthWorkData.length; i++) {
  3137. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3138. this.monthWorkDataS1.push(this.monthWorkData[i])
  3139. }
  3140. }
  3141. if (this.monthWorkDataS1.length > 50) {
  3142. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3143. }else{
  3144. this.monthWorkDataS = this.monthWorkDataS1
  3145. }
  3146. // if (this.monthWorkDataS1.length > 0) {
  3147. // setTimeout(() => {
  3148. // this.tableListener()
  3149. // }, 1000);
  3150. // }
  3151. }
  3152. },
  3153. addUpload(data) {
  3154. // var zhi = data.fileName.split('.')[0]
  3155. // var sss = zhi + '.xlsx'
  3156. // return
  3157. var filePath = '/upload/' + data.serverName;
  3158. const a = document.createElement('a'); // 创建a标签
  3159. a.setAttribute('download', data.fileName);// download属性
  3160. a.setAttribute('href', filePath);// href链接
  3161. a.click(); //自执行点击事件
  3162. a.remove();
  3163. },
  3164. restrictNumber(targetId) {
  3165. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3166. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3167. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3168. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3169. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3170. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3171. inpu.value = parseFloat(inpu.value);
  3172. }
  3173. },
  3174. //获取项目下的任务分组
  3175. getTaskGroups(domain, index) {
  3176. domain.groupId=null;
  3177. this.http.post('/task-group/listMyJoinGroup',{
  3178. projectId: domain.projectId,
  3179. isSubstitude: this.isSubstitude ? 1 : 0
  3180. },
  3181. res => {
  3182. if (res.code == "ok") {
  3183. this.workForm.domains[index].taskGroups = res.data;
  3184. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3185. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3186. // this.getGroupStages(domain, index);
  3187. // }
  3188. this.$forceUpdate();
  3189. }
  3190. },
  3191. error => {
  3192. this.$message({
  3193. message: error,
  3194. type: "error"
  3195. });
  3196. }
  3197. );
  3198. },
  3199. //下载填报工时占比报表
  3200. downloadProjectRatio() {
  3201. this.exportUserRatio = true;
  3202. // let now = new Date();
  3203. // let month = now.getMonth();//默认看上个月的
  3204. // let monthStr = month<10? ('0'+month): month;
  3205. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3206. const today = new Date();
  3207. const year = today.getFullYear();
  3208. const month = today.getMonth() + 1;
  3209. let lastMonthYear, lastMonth;
  3210. if (month === 1) {
  3211. lastMonthYear = year - 1;
  3212. lastMonth = 12;
  3213. } else {
  3214. lastMonthYear = year;
  3215. lastMonth = month - 1;
  3216. }
  3217. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3218. console.log('赋值 ==>', this.ratioYmonth)
  3219. },
  3220. confirmDownloadRatio() {
  3221. this.startRatioExporting = true;
  3222. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3223. ymonth: this.ratioYmonth
  3224. },
  3225. res => {
  3226. if (res.code == "ok") {
  3227. this.startRatioExporting = false;
  3228. var filePath = res.data;
  3229. const a = document.createElement('a'); // 创建a标签
  3230. var data = filePath.split("/");
  3231. a.setAttribute('download', data[data.length-1]);// download属性
  3232. a.setAttribute('href', filePath);// href链接
  3233. a.click(); //自执行点击事件
  3234. a.remove();
  3235. } else {
  3236. this.startRatioExporting = false;
  3237. this.$message({
  3238. message: res.msg,
  3239. type: "error"
  3240. });
  3241. }
  3242. },
  3243. error => {
  3244. this.checkinLoading = false;
  3245. this.$message({
  3246. message: error,
  3247. type: "error"
  3248. });
  3249. }
  3250. );
  3251. },
  3252. //下载带企业微信考勤数据的工时统计模板
  3253. downloadCheckInExcel() {
  3254. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  3255. startDate: this.importWxParam.date[0],
  3256. endDate: this.importWxParam.date[1],
  3257. },
  3258. res => {
  3259. if (res.code == "ok") {
  3260. var filePath = res.data;
  3261. const a = document.createElement('a'); // 创建a标签
  3262. var data = filePath.split("/");
  3263. a.setAttribute('download', data[data.length-1]);// download属性
  3264. a.setAttribute('href', filePath);// href链接
  3265. a.click(); //自执行点击事件
  3266. a.remove();
  3267. } else {
  3268. this.$message({
  3269. message: res.msg,
  3270. type: "error"
  3271. });
  3272. }
  3273. },
  3274. error => {
  3275. this.checkinLoading = false;
  3276. this.$message({
  3277. message: error,
  3278. type: "error"
  3279. });
  3280. }
  3281. );
  3282. },
  3283. pre() {
  3284. if (this.active == 0) return;
  3285. this.active--;
  3286. },
  3287. next() {
  3288. this.active++;
  3289. },
  3290. triggerTotalTime(index) {
  3291. var item = this.checkinList[index];
  3292. var total = 0.0;
  3293. for (var i=0;i<this.projectColumns.length; i++) {
  3294. var key = this.projectColumns[i];
  3295. if (item[key] != null && item[key] != '') {
  3296. total += parseFloat(item[key]);
  3297. }
  3298. }
  3299. item.totalFillTime = total;
  3300. },
  3301. //提交批量代填的数据
  3302. submitBatchSubFillData() {
  3303. var data = JSON.stringify(this.checkinList);
  3304. this.http.post('/user-corpwx-time/submitProjectTime',{
  3305. json: data,
  3306. projectColumns: JSON.stringify(this.projectColumns)
  3307. },
  3308. res => {
  3309. if (res.code == "ok") {
  3310. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3311. this.importWxDialog = false;
  3312. }
  3313. },
  3314. error => {
  3315. this.checkinLoading = false;
  3316. this.$message({
  3317. message: error,
  3318. type: "error"
  3319. });
  3320. }
  3321. );
  3322. },
  3323. loadCheckInData() {
  3324. if (this.importWxParam.date == null) {
  3325. this.checkinList = [];
  3326. return;
  3327. }
  3328. this.checkinLoading = true;
  3329. this.http.post('/user-corpwx-time/getMyData',{
  3330. startDate: this.importWxParam.date[0],
  3331. endDate: this.importWxParam.date[1],
  3332. },
  3333. res => {
  3334. if (res.code == "ok") {
  3335. this.checkinLoading = false;
  3336. this.checkinList = res.data.list;
  3337. this.projectColumns = res.data.projects;
  3338. // 自定义表格会导致表格错乱,需重新计算表格
  3339. this.$nextTick(()=>{
  3340. this.$refs.tab.doLayout()
  3341. })
  3342. }
  3343. },
  3344. error => {
  3345. this.checkinLoading = false;
  3346. this.$message({
  3347. message: error,
  3348. type: "error"
  3349. });
  3350. }
  3351. );
  3352. },
  3353. importCardTime(item) {
  3354. //首先判断文件类型
  3355. let str = item.file.name.split(".");
  3356. let format = str[str.length - 1];
  3357. if (format != "xls" && format != "xlsx") {
  3358. this.$message({
  3359. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3360. type: "error"
  3361. });
  3362. } else {
  3363. this.importingData = true;
  3364. let formData = new FormData();
  3365. formData.append("multipartFile", item.file);
  3366. formData.append("companyId", this.user.companyId);
  3367. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3368. res => {
  3369. this.$refs.uploadCardTime.clearFiles();
  3370. this.importingData = false;
  3371. if (res.code == "ok") {
  3372. //换成弹出框,以免有人等了半天回来啥也没看到
  3373. this.$message({
  3374. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3375. type: "success"
  3376. });
  3377. } else {
  3378. this.$message({
  3379. message: res.msg,
  3380. type: "error"
  3381. });
  3382. }
  3383. },
  3384. error => {
  3385. this.$refs.upload.clearFiles();
  3386. this.listLoading = false;
  3387. this.$message({
  3388. message: error,
  3389. type: "error"
  3390. });
  3391. });
  3392. }
  3393. },
  3394. batchImportWxData(item) {
  3395. //首先判断文件类型
  3396. let str = item.file.name.split(".");
  3397. let format = str[str.length - 1];
  3398. if (format != "xls" && format != "xlsx") {
  3399. this.$message({
  3400. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3401. type: "error"
  3402. });
  3403. } else {
  3404. this.importingData = true;
  3405. let formData = new FormData();
  3406. formData.append("file", item.file);
  3407. formData.append("companyId", this.user.companyId);
  3408. formData.append("withCheckIn", 1);
  3409. this.http.uploadFile('/report/importData', formData,
  3410. res => {
  3411. this.$refs.upload.clearFiles();
  3412. this.showImportResult = true;
  3413. this.importingData = false;
  3414. if (res.code == "ok") {
  3415. //换成弹出框,以免有人等了半天回来啥也没看到
  3416. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3417. this.getReportList();
  3418. this.importWxDialog = false;
  3419. } else {
  3420. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3421. }
  3422. },
  3423. error => {
  3424. this.$refs.upload.clearFiles();
  3425. this.listLoading = false;
  3426. this.$message({
  3427. message: error,
  3428. type: "error"
  3429. });
  3430. });
  3431. }
  3432. },
  3433. batchImportData(item) {
  3434. //首先判断文件类型
  3435. let str = item.file.name.split(".");
  3436. let format = str[str.length - 1];
  3437. if (format != "xls" && format != "xlsx") {
  3438. this.$message({
  3439. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3440. type: "error"
  3441. });
  3442. } else {
  3443. this.importingData = true;
  3444. let formData = new FormData();
  3445. formData.append("file", item.file);
  3446. formData.append("companyId", this.user.companyId);
  3447. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3448. this.http.uploadFile(url, formData,
  3449. res => {
  3450. this.$refs.upload.clearFiles();
  3451. this.importingData = false;
  3452. this.showImportResult = true;
  3453. if (res.code == "ok") {
  3454. //换成弹出框,以免有人等了半天回来啥也没看到
  3455. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3456. this.getReportList();
  3457. this.importWXDialog = false;
  3458. } else {
  3459. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3460. }
  3461. },
  3462. error => {
  3463. this.$refs.upload.clearFiles();
  3464. this.importingData = false;
  3465. this.$message({
  3466. message: error,
  3467. type: "error"
  3468. });
  3469. });
  3470. }
  3471. },
  3472. userssHu() {
  3473. this.http.post('/time-type/getCompanyTimeSetting',{
  3474. companyId: this.user.companyId
  3475. },
  3476. res => {
  3477. if (res.code == "ok") {
  3478. this.yonghuUser = res.data
  3479. }
  3480. },
  3481. error => {
  3482. this.$message({
  3483. message: error,
  3484. type: "error"
  3485. });
  3486. }
  3487. );
  3488. },
  3489. iptBlur(i) {
  3490. if(this.isBatch == 0) {
  3491. return
  3492. }
  3493. var reqParam = {
  3494. startDate: this.workForm.createDate[0],
  3495. endDate: this.workForm.createDate[1]
  3496. };
  3497. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3498. reqParam.userId = this.workForm.userId[0];
  3499. }
  3500. this.http.post('/report/getWorkDays',reqParam,
  3501. res => {
  3502. if (res.code == "ok") {
  3503. this.jsDay = res.data
  3504. this.chuji(i)
  3505. } else {
  3506. this.$message({
  3507. message: res.msg,
  3508. type: "error"
  3509. });
  3510. }
  3511. },
  3512. error => {
  3513. this.$message({
  3514. message: error,
  3515. type: "error"
  3516. });
  3517. }
  3518. );
  3519. //明夷硬编码获取
  3520. if (this.user.company.companyName == this.mingyiName) {
  3521. this.getWorkTimeForMinYi();
  3522. }
  3523. },
  3524. getWorkTimeForMinYi(){
  3525. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3526. startDate: this.workForm.createDate[0],
  3527. endDate: this.workForm.createDate[1]
  3528. },
  3529. res => {
  3530. if (res.code == "ok") {
  3531. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3532. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3533. this.totalReportHours = this.workTimeForMinYi;
  3534. } else {
  3535. this.$message({
  3536. message: res.msg,
  3537. type: "error"
  3538. });
  3539. this.workForm.createDate = [];
  3540. }
  3541. },
  3542. error => {
  3543. this.$message({
  3544. message: error,
  3545. type: "error"
  3546. });
  3547. }
  3548. );
  3549. },
  3550. chuji(i) {
  3551. if(i == 0) {
  3552. this.seleChn(1)
  3553. } else if(i == 1) {
  3554. this.seleChn(0)
  3555. } else if(i == 2) {
  3556. if(this.workForm.domains[0].multiWorktime > 0) {
  3557. this.iptChangs()
  3558. } else {
  3559. this.iptChang()
  3560. }
  3561. } else if(i == 3) {
  3562. this.seleChn(0)
  3563. }
  3564. },
  3565. seleChn(e,domain) {
  3566. if(e == 1) {
  3567. for(var i in this.workForm.domains) {
  3568. if(this.workForm.domains[i].timeType == 0) {
  3569. this.workForm.domains[i].workingTime = 8
  3570. } else {
  3571. this.workForm.domains[i].workingTime = 4
  3572. }
  3573. }
  3574. }
  3575. var quanbu = 0
  3576. var spl = this.workForm.domains
  3577. var zhi = ''
  3578. for(var i in spl) {
  3579. var sp = +spl[i].workingTime + 0
  3580. zhi = this.jsDay * sp
  3581. quanbu = +quanbu + zhi
  3582. }
  3583. this.jsTime = quanbu
  3584. this.totalReportHours = quanbu
  3585. let worktime = this.jsTime
  3586. // 自动计算加班时长
  3587. if(this.isBatch != 0){
  3588. worktime = this.jsTime / this.jsDay
  3589. }
  3590. if(this.user.timeType.fillOvertime && domain){
  3591. let isover = false
  3592. let alltime = 0
  3593. let allover = 0 //此处alltime同上面的worktime
  3594. for(let d in spl){
  3595. if(spl[d].isOvertime){
  3596. isover = true
  3597. allover += spl[d].overtimeHours*1
  3598. }
  3599. alltime += spl[d].workingTime*1
  3600. }
  3601. if(domain.overtimeHours){
  3602. allover = allover - domain.overtimeHours
  3603. }
  3604. if(worktime*1 > this.user.timeType.allday){
  3605. if(isover){
  3606. if(alltime > (allover + this.user.timeType.allday)){
  3607. this.$set(domain,'isOvertime',true)
  3608. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3609. }else{
  3610. this.$set(domain,'isOvertime',false)
  3611. this.$set(domain,'overtimeHours',null)
  3612. if(alltime < (allover + this.user.timeType.allday)){
  3613. let overtime = allover + this.user.timeType.allday - alltime
  3614. for(let pi in spl){
  3615. if(spl[pi].overtimeHours){
  3616. if((overtime - spl[pi].overtimeHours*1) > 0){
  3617. overtime = overtime - spl[pi].overtimeHours*1
  3618. this.$set(spl[pi],'isOvertime',false)
  3619. this.$set(spl[pi],'overtimeHours',null)
  3620. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3621. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3622. break
  3623. }else{
  3624. this.$set(spl[pi],'isOvertime',false)
  3625. this.$set(spl[pi],'overtimeHours',null)
  3626. break
  3627. }
  3628. }
  3629. }
  3630. }
  3631. }
  3632. }else{
  3633. this.$set(domain,'isOvertime',true)
  3634. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3635. }
  3636. }else{
  3637. for(let di in spl){
  3638. this.$set(spl[di],'isOvertime',false)
  3639. this.$set(spl[di],'overtimeHours',null)
  3640. }
  3641. }
  3642. }
  3643. },
  3644. iptChang() {
  3645. var sl = this.workForm.domains
  3646. let timeArr = []
  3647. for(var i in sl) {
  3648. if(sl[i].startTime && sl[i].endTime) {
  3649. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3650. }
  3651. }
  3652. this.getTimeHours(timeArr)
  3653. // for(let j in arrNum) {
  3654. // this.timeJsonStr += arrNum[j]
  3655. // if(flg) {
  3656. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3657. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3658. // }
  3659. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3660. // flg = true
  3661. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3662. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3663. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3664. // }
  3665. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3666. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3667. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3668. // }
  3669. // }
  3670. },
  3671. iptChangs() {
  3672. var sl = this.workForm.domains
  3673. let timeArr = []
  3674. for(var i in sl) {
  3675. for(var j in sl[i].worktimeList){
  3676. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3677. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3678. }
  3679. }
  3680. }
  3681. this.getTimeHours(timeArr)
  3682. },
  3683. // 调用接口或去数据
  3684. getTimeHours(arr) {
  3685. this.http.post('/report/getHoursByTimeRange',{
  3686. timeJsonStr: JSON.stringify(arr)
  3687. },res => {
  3688. if(res.code === 'ok') {
  3689. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3690. } else {
  3691. this.$message({
  3692. message: res.msg,
  3693. type: 'error'
  3694. })
  3695. }
  3696. },err => {
  3697. this.$message({
  3698. message: err,
  3699. type: 'error'
  3700. })
  3701. })
  3702. },
  3703. // 按周填报调用接口计算时间
  3704. async getWeekHoursByTimeRange(timeRange) {
  3705. const url = '/report/getHoursByTimeRange';
  3706. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3707. var that = this;
  3708. return new Promise((resolve, reject) => {
  3709. this.http.post(url, data, function(res) {
  3710. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3711. }, function(err) {
  3712. reject(err);
  3713. });
  3714. });
  3715. },
  3716. removeTimeItem(item, index) {
  3717. item.worktimeList.splice(index, 1);
  3718. this.iptChangs()
  3719. },
  3720. //添加工时
  3721. addNewWorktime(index, item) {
  3722. if(item.worktimeList == null ) {
  3723. item.worktimeList = []
  3724. }
  3725. item.worktimeList.push({});
  3726. },
  3727. //复制项目
  3728. copyProject(index) {
  3729. var leftProgress = 10;
  3730. if (this.reportTimeType.type == 3) {
  3731. //计算已经待分配工时比例
  3732. let array = this.workForm.domains;
  3733. let totalProgress = 0;
  3734. for (var i=0;i<array.length; i++) {
  3735. totalProgress += array[i].progress;
  3736. }
  3737. if (totalProgress < 100) {
  3738. leftProgress = 100 - totalProgress;
  3739. }
  3740. }
  3741. var newIndex = index+1;
  3742. var itemDomain = {
  3743. projectId: this.workForm.domains[index].projectId,
  3744. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3745. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3746. ),
  3747. content: "",
  3748. progress:leftProgress,
  3749. state:2,//2-表示待提交
  3750. };
  3751. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3752. if (this.reportTimeType.type == 0) {
  3753. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3754. var length = this.workForm.domains.length;
  3755. if (length == 2) {
  3756. this.showAddMore = false;
  3757. }
  3758. }
  3759. this.selectProject(itemDomain, newIndex);
  3760. },
  3761. pushWorkTime(reportId){
  3762. let url=''
  3763. if(this.user.timeType.syncSap == 1){
  3764. url='/report/pushProjectReportToSap'
  3765. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3766. var pushDate = this.date + day;
  3767. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3768. confirmButtonText: this.$t('btn.determine'),
  3769. cancelButtonText: this.$t('btn.cancel'),
  3770. type: 'info'
  3771. }).then(() => {
  3772. const loading = this.$loading({
  3773. lock: true,
  3774. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3775. spinner: 'el-icon-loading',
  3776. background: 'rgba(0, 0, 0, 0.7)'
  3777. });
  3778. this.http.post(url,{
  3779. pushDate: pushDate,
  3780. reportId: reportId
  3781. },res => {
  3782. loading.close();
  3783. if(res.code == 'ok'){
  3784. this.$message({
  3785. type: 'success',
  3786. message: res.data
  3787. });
  3788. }else{
  3789. this.$message({
  3790. type: 'error',
  3791. message: res.msg
  3792. })
  3793. }
  3794. },err => {
  3795. loading.close();
  3796. this.$message({
  3797. type: 'error',
  3798. message: err
  3799. })
  3800. })
  3801. }).catch(() => {
  3802. });
  3803. }else{
  3804. url='/report/pushReportDataToThird'
  3805. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3806. confirmButtonText: this.$t('btn.determine'),
  3807. cancelButtonText: this.$t('btn.cancel'),
  3808. type: 'info'
  3809. }).then(() => {
  3810. const loading = this.$loading({
  3811. lock: true,
  3812. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3813. spinner: 'el-icon-loading',
  3814. background: 'rgba(0, 0, 0, 0.7)'
  3815. });
  3816. this.http.post(url,{
  3817. yearMonth: this.date
  3818. },res => {
  3819. loading.close();
  3820. if(res.code == 'ok'){
  3821. this.$message({
  3822. type: 'success',
  3823. message: this.$t('tuiSongChengGong')
  3824. });
  3825. }else{
  3826. this.$message({
  3827. type: 'error',
  3828. message: res.msg
  3829. })
  3830. }
  3831. },err => {
  3832. loading.close();
  3833. this.$message({
  3834. type: 'error',
  3835. message: err
  3836. })
  3837. })
  3838. }).catch(() => {
  3839. });
  3840. }
  3841. },
  3842. showWorkTime(){
  3843. this.monthWorkTimeDialog = true;
  3844. this.searchKeyword = ''
  3845. this.WorktimeDatepickValue = this.istoMonth()
  3846. if(this.WorktimeDatepickValue.length == 0){
  3847. let newdate = new Date();
  3848. let nowdate = newdate.toLocaleDateString();
  3849. let getauto = this.getAutoWeekDate(nowdate)
  3850. let nowwd = [getauto[0],getauto[6]]
  3851. this.WorktimeDatepickValue = nowwd
  3852. }
  3853. this.showMonthWorkTime()
  3854. },
  3855. handleClick(t,e){
  3856. if (t.name == "second") {
  3857. this.showMonthNotWorkTime()
  3858. }else if(t.name == "first"){
  3859. this.showMonthWorkTime()
  3860. }else if(t.name == "third"){
  3861. this.showMonthWorkTimeReminder()
  3862. }
  3863. },
  3864. //导出员工每日填报工时数
  3865. exportMembWorkHours() {
  3866. this.http.post(
  3867. "/report/exportUserDailyWorkTime",
  3868. {
  3869. // month: this.date,
  3870. startDate: this.WorktimeDatepickValue[0],
  3871. endDate: this.WorktimeDatepickValue[1],
  3872. },
  3873. (res) => {
  3874. if (res.code == "ok") {
  3875. let url = res.data;
  3876. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3877. }
  3878. },
  3879. (error) => {
  3880. this.$message({
  3881. message: error,
  3882. type: "error",
  3883. });
  3884. }
  3885. );
  3886. },
  3887. exportMembWorkHoursReminder() {
  3888. this.http.post(
  3889. "/report/exportUserDailyWorkTimeReminder",
  3890. {
  3891. // month: this.date,
  3892. startDate: this.WorktimeDatepickValue[0],
  3893. endDate: this.WorktimeDatepickValue[1],
  3894. },
  3895. (res) => {
  3896. if (res.code == "ok") {
  3897. let url = res.data;
  3898. this.downloadByA('工时异常表.xlsx', url);
  3899. }
  3900. },
  3901. (error) => {
  3902. this.$message({
  3903. message: error,
  3904. type: "error",
  3905. });
  3906. }
  3907. );
  3908. },
  3909. exportMembNotWorkHours() {
  3910. this.http.post(
  3911. "/report/exportNoReportUserList",
  3912. {
  3913. // month: this.date,
  3914. startDate: this.WorktimeDatepickValue[0],
  3915. endDate: this.WorktimeDatepickValue[1],
  3916. },
  3917. (res) => {
  3918. if (res.code == "ok") {
  3919. let url = res.data;
  3920. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3921. }
  3922. },
  3923. (error) => {
  3924. this.$message({
  3925. message: error,
  3926. type: "error",
  3927. });
  3928. }
  3929. );
  3930. },
  3931. downloadByA(name, url) {
  3932. const a = document.createElement("a"); // 创建a标签
  3933. a.setAttribute("download", name); // download属性
  3934. a.setAttribute("href", url); // href链接
  3935. a.click(); // 自执行点击事件
  3936. a.remove();
  3937. },
  3938. // 是否本月判断
  3939. istoMonth(){
  3940. let todate = new Date()
  3941. let tomonth = todate.getMonth() + 1
  3942. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3943. if(this.date == adate){
  3944. return []
  3945. }else{
  3946. let sedate = new Date(this.date)
  3947. let semonth = sedate.getMonth() + 1
  3948. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3949. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3950. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3951. return [sedates1, sedates2]
  3952. }
  3953. },
  3954. showMonthWorkTime() {
  3955. this.monthTotalPage = 0,
  3956. this.tbload = true
  3957. let parameter={
  3958. startDate: this.WorktimeDatepickValue[0],
  3959. endDate: this.WorktimeDatepickValue[1],
  3960. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  3961. }
  3962. this.http.post(
  3963. "/report/getUserDailyWorkTime",
  3964. // "/report/getNoReportUserList",
  3965. parameter,
  3966. (res) => {
  3967. if (res.code == "ok") {
  3968. this.tbload = false;
  3969. this.pickDateArray = res.data.days.map(item => {
  3970. return {
  3971. ...item,
  3972. dateStr: item.label.split('/')[0],
  3973. weekStr: item.label.split('/')[1]
  3974. }
  3975. });
  3976. // console.log('dataarray',res.data.days);
  3977. this.monthWorkData = res.data.list;
  3978. // this.monthWorkDataS = this.monthWorkData
  3979. // this.monthWorkDataS1 = res.data.list
  3980. this.monthTotal = res.data.list.length
  3981. if (this.monthWorkData.length > 50) {
  3982. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3983. }else{
  3984. this.monthWorkDataS = this.monthWorkData
  3985. }
  3986. this.searchScreen(0)
  3987. // this.monthWorkDataS = infoList
  3988. // 判断
  3989. // if (this.monthWorkDataS1.length > 0) {
  3990. // setTimeout(() => {
  3991. // this.tableListener()
  3992. // }, 1000);
  3993. // }
  3994. this.$nextTick(function(){
  3995. this.$refs.hasworkTbl.doLayout();
  3996. });
  3997. // this.$forceUpdate()
  3998. }
  3999. },
  4000. (error) => {
  4001. this.tbload = false
  4002. this.$message({
  4003. message: error,
  4004. type: "error",
  4005. });
  4006. }
  4007. );
  4008. },
  4009. showMonthWorkTimeReminder() {
  4010. this.monthTotalPage = 0,
  4011. this.tbload = true
  4012. let parameter={}
  4013. parameter={
  4014. startDate: this.WorktimeDatepickValue[0],
  4015. endDate: this.WorktimeDatepickValue[1],
  4016. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4017. viewValue:this.isReminder?1:0
  4018. }
  4019. this.http.post(
  4020. "/report/getUserDailyWorkTimeReminder",
  4021. parameter,
  4022. (res) => {
  4023. if (res.code == "ok") {
  4024. this.tbload = false;
  4025. this.monthWorkData = res.data.list;
  4026. this.monthTotal = res.data.list.length
  4027. if (this.monthWorkData.length > 50) {
  4028. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4029. }else{
  4030. this.monthWorkDataS = this.monthWorkData
  4031. }
  4032. this.searchScreen(0)
  4033. this.$nextTick(function(){
  4034. this.$refs.hasworkTbl.doLayout();
  4035. });
  4036. }
  4037. },
  4038. (error) => {
  4039. this.tbload = false
  4040. this.$message({
  4041. message: error,
  4042. type: "error",
  4043. });
  4044. }
  4045. );
  4046. },
  4047. // tableListener(){
  4048. // let that = this;
  4049. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4050. // // 添加scroll监听事件
  4051. // dom.addEventListener("scroll", function () {
  4052. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4053. // if (scrollDistance < 2) {
  4054. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4055. // that.monthTotalPage++; //当前页数自增
  4056. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4057. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4058. // var infoList = arrList.splice(
  4059. // that.monthTotalPage * that.monthTotalLages,
  4060. // that.monthTotalLages
  4061. // );
  4062. // // 数据添加
  4063. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4064. // }
  4065. // }
  4066. // })
  4067. // },
  4068. showMonthNotWorkTime() {
  4069. this.monthTotalPage = 0,
  4070. this.tbload = true,
  4071. this.http.post(
  4072. "/report/getNoReportUserList",
  4073. {
  4074. startDate: this.WorktimeDatepickValue[0],
  4075. endDate: this.WorktimeDatepickValue[1],
  4076. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4077. },
  4078. (res) => {
  4079. if (res.code == "ok") {
  4080. this.tbload = false
  4081. this.monthNotWorkDate = res.data;
  4082. // this.monthNotWorkDateS1 = res.data
  4083. this.monthnotTotal = res.data.length
  4084. // 2222111
  4085. if (this.monthNotWorkDate.length > 50) {
  4086. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4087. } else {
  4088. this.monthNotWorkDateS = this.monthNotWorkDate
  4089. }
  4090. this.searchScreen(1)
  4091. // 判断
  4092. // if (this.monthnotworkDateS1.length > 0) {
  4093. // setTimeout(() => {
  4094. // this.tableListenernot()
  4095. // }, 1000);
  4096. // }
  4097. this.$nextTick(function(){
  4098. this.$refs.hasworkTbl2.doLayout();
  4099. });
  4100. }
  4101. },
  4102. (error) => {
  4103. this.tbload = false
  4104. this.$message({
  4105. message: error,
  4106. type: "error",
  4107. });
  4108. }
  4109. );
  4110. },
  4111. // tableListenernot(){
  4112. // let that = this;
  4113. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4114. // dom.addEventListener("scroll", function () {
  4115. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4116. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4117. // if (scrollDistance2 < 2) {
  4118. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4119. // that.monthnotTotalPage++; //当前页数自增
  4120. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4121. // var infoList = arrList.splice(
  4122. // that.monthnotTotalPage * that.monthnotTotalLages,
  4123. // that.monthnotTotalLages
  4124. // );
  4125. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4126. // }
  4127. // }
  4128. // })
  4129. // },
  4130. listScroll(){
  4131. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4132. this.isMore = true
  4133. setTimeout(()=>{
  4134. this.isMore = false
  4135. },1000)
  4136. }else {
  4137. this.isFlag = true
  4138. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4139. this.monthWorkDataS = datalist
  4140. setTimeout(()=>{
  4141. this.isFlag = false
  4142. },300)
  4143. }
  4144. },
  4145. notListScroll(){
  4146. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4147. this.isMore = true
  4148. setTimeout(()=>{
  4149. this.isMore = false
  4150. },1000)
  4151. }else {
  4152. this.isFlag = true
  4153. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4154. this.monthNotWorkDateS = datalist
  4155. // console.log('length',this.monthNotWorkDateS.length)
  4156. setTimeout(()=>{
  4157. this.isFlag = false
  4158. },300)
  4159. }
  4160. },
  4161. getFirstAndLastDay() {
  4162. // 将选定的月份转换为Date对象
  4163. var monthDate = new Date();
  4164. var year = monthDate.getFullYear();
  4165. var month = monthDate.getMonth();
  4166. // 计算起始日和结束日
  4167. var startDay = new Date(year, month, 1);
  4168. var endDay = new Date(year, month + 1, 0);
  4169. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4170. this.WorktimeDatepickValueForMonth=lastmd
  4171. },
  4172. formatDate(date) {
  4173. var year = date.getFullYear();
  4174. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4175. var day = ("0" + date.getDate()).slice(-2);
  4176. return year + "-" + month + "-" + day;
  4177. },
  4178. // 获取默认这zhou日期参数 222
  4179. getLastWeek(e){
  4180. let newdate = new Date()
  4181. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4182. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4183. if(e==1){
  4184. this.WorktimeDatepickValue = lastwd
  4185. this.showMonthWorkTime()
  4186. }else if(e==2){
  4187. this.WorktimeDatepickValue = lastwd
  4188. this.showMonthWorkTimeReminder()
  4189. }else{
  4190. this.WorktimeDatepickValue = lastwd
  4191. this.showMonthNotWorkTime()
  4192. }
  4193. },
  4194. getThisWeek(e){
  4195. let newdate = new Date();
  4196. let nowdate = newdate.toLocaleDateString();
  4197. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4198. if(e==1){
  4199. this.WorktimeDatepickValue = nowwd
  4200. this.showMonthWorkTime()
  4201. }else if(e==2){
  4202. this.WorktimeDatepickValue = nowwd
  4203. this.showMonthWorkTimeReminder()
  4204. }else{
  4205. this.WorktimeDatepickValue = nowwd
  4206. this.showMonthNotWorkTime()
  4207. }
  4208. },
  4209. getDoubleLastWeek(e){
  4210. let newdate = new Date()
  4211. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4212. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4213. if(e==1){
  4214. this.WorktimeDatepickValue = nextwd
  4215. this.showMonthWorkTime()
  4216. }else if(e==2){
  4217. this.WorktimeDatepickValue = nextwd
  4218. this.showMonthWorkTimeReminder()
  4219. }else{
  4220. this.WorktimeDatepickValue = nextwd
  4221. this.showMonthNotWorkTime()
  4222. }
  4223. },
  4224. alreadyAllDate(stime,etime){
  4225. let diffdate = new Array();
  4226. let i=0;
  4227. while(stime<=etime){
  4228. let dateArray = stime.split("-");
  4229. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4230. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4231. let stimewk = this.weekDay[date.getDay()]
  4232. 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')
  4233. 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])
  4234. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4235. let stime_ts = new Date(stime).getTime();
  4236. let next_date = stime_ts + (24*60*60*1000);
  4237. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4238. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4239. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4240. stime = next_dates_y+next_dates_m+next_dates_d;
  4241. i++;
  4242. }
  4243. return diffdate
  4244. },
  4245. getAutoWeekDate(e) {
  4246. let dateString = e;
  4247. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4248. if (dateString.match(dateStringReg)) {
  4249. let presentDate = new Date(dateString),
  4250. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4251. return Array.from(new Array(7), function (val, index) {
  4252. let formatDate = new Date(
  4253. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4254. );
  4255. return (
  4256. formatDate.getFullYear() +
  4257. "-" +
  4258. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4259. "-" +
  4260. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4261. );
  4262. });
  4263. } else {
  4264. throw new Error(
  4265. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4266. );
  4267. }
  4268. },
  4269. onProgressChange() {
  4270. this.$forceUpdate();
  4271. },
  4272. showChooseMembTree() {
  4273. this.chosenMembCount = this.participator.length;
  4274. this.chooseParticipVisible = true;
  4275. },
  4276. onTreeItemChange() {
  4277. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4278. var list = chosenList.filter(item=>item.isUser == 1);
  4279. this.chosenMembCount = list.length;
  4280. },
  4281. findUserInTree() {
  4282. if (this.filterName == '') {
  4283. this.deptMembData = this.allMembData;
  4284. } else {
  4285. var list = this.findRecursively(this.filterName, this.allMembData);
  4286. this.deptMembData = list;
  4287. }
  4288. },
  4289. findRecursively(username, list) {
  4290. var filterList = [];
  4291. for (var i=0;i<list.length; i++) {
  4292. if (list[i].isUser == 1) {
  4293. if (list[i].label.indexOf(username) >= 0) {
  4294. //匹配上了
  4295. filterList.push(list[i]);
  4296. }
  4297. } else if (list[i].children != null && list[i].children.length > 0) {
  4298. var subList = this.findRecursively(username, list[i].children);
  4299. if (subList.length > 0) {
  4300. subList.forEach(s=>filterList.push(s));
  4301. }
  4302. }
  4303. }
  4304. return filterList;
  4305. },
  4306. //确定选择参与人
  4307. chooseParticip() {
  4308. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4309. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4310. //针对专业版,只能选择一个人进行代填,防止任务有问题
  4311. if (this.user.company.packageProject == 1) {
  4312. if (this.chosenMembList.length > 1) {
  4313. this.$message({
  4314. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4315. type: "error",
  4316. });
  4317. return;
  4318. }
  4319. }
  4320. this.chooseParticipVisible = false;
  4321. this.workForm.userNames = '';
  4322. this.workForm.userId = [];
  4323. this.participator = [];
  4324. for (var i=0;i<this.chosenMembList.length; i++) {
  4325. this.workForm.userId.push(this.chosenMembList[i].id);
  4326. this.workForm.userNames += this.chosenMembList[i].label+',';
  4327. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4328. this.participator.push(item);
  4329. }
  4330. if (this.workForm.userNames.length > 0) {
  4331. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4332. }
  4333. if(this.user.userNameNeedTranslate == 1) {
  4334. if(this.workForm.userNames) {
  4335. this.workForm.userNames = this.workForm.userNames.split(',')
  4336. }
  4337. }
  4338. },
  4339. notifySel(sel){
  4340. // console.log(sel);
  4341. this.notifySelList = sel
  4342. },
  4343. //微信通知人员填写
  4344. Notify(code) {
  4345. if (this.notifySelList.length == 0) return;
  4346. var ids = '';
  4347. this.notifySelList.forEach(f=>{
  4348. ids += f.id+',';
  4349. })
  4350. this.http.post('/user/pushFillReport',{
  4351. ids: ids, date: this.curDate,
  4352. code: code
  4353. },
  4354. res => {
  4355. if (res.code == "ok") {
  4356. this.$message({
  4357. message: this.$t('message.sentSuccessfully'),
  4358. type: "success"
  4359. });
  4360. }
  4361. },
  4362. error => {
  4363. this.$message({
  4364. message: error,
  4365. type: "error"
  4366. });
  4367. }
  4368. );
  4369. },
  4370. //导出人员列表
  4371. exportMemb() {
  4372. if (this.fillMembList.length == 0) return;
  4373. var ids = '';
  4374. this.fillMembList.forEach(f=>{
  4375. ids += f.id+',';
  4376. })
  4377. this.http.post('/user/exportMembList',{
  4378. ids: ids,isFill: this.isFill, date: this.curDate
  4379. },
  4380. res => {
  4381. if (res.code == "ok") {
  4382. var aTag = document.createElement('a');
  4383. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4384. aTag.href = res.data;
  4385. aTag.click();
  4386. }
  4387. },
  4388. error => {
  4389. this.$message({
  4390. message: error,
  4391. type: "error"
  4392. });
  4393. }
  4394. );
  4395. },
  4396. showMembList(fill) {
  4397. this.membListVisible = true;
  4398. if (fill == 0) {
  4399. this.fillMembList = this.unFillList;
  4400. this.isFill = false;
  4401. let leaveList = []
  4402. let unleaveList = []
  4403. for(let i in this.fillMembList){
  4404. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4405. leaveList.push(this.fillMembList[i])
  4406. }else{
  4407. unleaveList.push(this.fillMembList[i])
  4408. }
  4409. }
  4410. this.fillMembList = unleaveList
  4411. this.fillMembList_leave = leaveList
  4412. } else if(fill == 1){
  4413. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4414. this.isFill = true;
  4415. }else{
  4416. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4417. this.isFill = true;
  4418. }
  4419. },
  4420. //获取自己填写的日报状态
  4421. getReportFillStatus() {
  4422. this.http.post('/report/getReportFillStatus',{
  4423. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4424. },
  4425. res => {
  4426. if (res.code == "ok") {
  4427. this.fillStatusList = res.data;
  4428. this.allDate.forEach(d=>{
  4429. var fillInfo = null;
  4430. d.state = null;
  4431. this.fillStatusList.forEach(s=>{
  4432. var d1 = s.createDate.split('-')[2];
  4433. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4434. if (d1.indexOf('0') == 0) {
  4435. d1 = d1.substring(1,d1.length);
  4436. }
  4437. if (d1 == d2) {
  4438. d.state = s.state;
  4439. d.missReport = s.missReport;//是否漏填
  4440. d.exceedCardTime = s.exceedCardTime
  4441. }
  4442. })
  4443. })
  4444. this.$forceUpdate();
  4445. }
  4446. },
  4447. error => {
  4448. this.$message({
  4449. message: error,
  4450. type: "error"
  4451. });
  4452. }
  4453. );
  4454. },
  4455. scrollFunction () {
  4456. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4457. if (this.domObj.attachEvent) { // IE
  4458. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4459. } else if (this.domObj.addEventListener) {
  4460. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4461. }
  4462. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4463. },
  4464. mouseScroll(event) { // google 浏览器下
  4465. let detail = event.wheelDelta || event.detail
  4466. let moveForwardStep = -1
  4467. let moveBackStep = 1
  4468. let step = 0
  4469. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4470. event.preventDefault() // 阻止浏览器默认事件
  4471. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4472. },
  4473. // //左右滚动
  4474. // wheel(e){
  4475. // var a = document.getElementById("dateScroll");
  4476. // var scroll_width = 80; //滚动一下的距离
  4477. // var e = e || window.event, v;
  4478. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4479. // if(v>3||-v>3) v=-v;
  4480. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4481. // e.preventDefault(); //阻止浏览器的默认滚动
  4482. // },
  4483. showExportDialog() {
  4484. this.exportType = 0
  4485. this.exportDialog = true;
  4486. },
  4487. showExportTimeDialog() {
  4488. this.exportTimeDialog = true;
  4489. },
  4490. changeAllTime() {
  4491. //总时长发生改变,自动按比例计算
  4492. this.workForm.domains.forEach(d=>{
  4493. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4494. });
  4495. //计算jsTime
  4496. if (this.workForm.createDate) {
  4497. let sdate = new Date(this.workForm.createDate[0]);
  4498. let edate = new Date(this.workForm.createDate[1]);
  4499. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4500. console.log('days===', days)
  4501. if (days < 0) {
  4502. days = 0;
  4503. }
  4504. this.jsTime = this.reportTimeType.allday * days;
  4505. }
  4506. },
  4507. // 是否加班的单机事件
  4508. check() {
  4509. this.selected = !this.selected
  4510. this.isNew = this.selected
  4511. },
  4512. updateSubProject() {
  4513. this.$forceUpdate();
  4514. },
  4515. selectDegreeId(domain, index) {
  4516. this.http.post('/report/defaultDegree',{
  4517. projectId: domain.projectId
  4518. },
  4519. res => {
  4520. if (res.code == "ok") {
  4521. if(res.data) {
  4522. this.workForm.domains[index].degreeId = res.data.id + ''
  4523. this.$forceUpdate();
  4524. }
  4525. }
  4526. },
  4527. error => {
  4528. this.$message({
  4529. message: error,
  4530. type: "error"
  4531. });
  4532. }
  4533. );
  4534. },
  4535. //项目选中了, 加载子项目
  4536. selectProject(domain, index) {
  4537. if(!domain.projectId){
  4538. return;
  4539. }
  4540. // 默认选中上次填写的自定义维度
  4541. if(this.yonghuUser.customDegreeActive == 1) {
  4542. this.selectDegreeId(domain, index)
  4543. }
  4544. // console.log('projectId===',domain.projectId);
  4545. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4546. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4547. this.http.post('/sub-project/list',{
  4548. projectId: domain.projectId,
  4549. isReport: true
  4550. },
  4551. res => {
  4552. //清空之前选中的子项目
  4553. // this.workForm.domains[index].subProjectId = 0;
  4554. if (res.code == "ok") {
  4555. this.workForm.domains[index].subProjectList = res.data;
  4556. this.workForm.domains[index].subProjectId = null;
  4557. this.$forceUpdate();
  4558. }
  4559. },
  4560. error => {
  4561. this.$message({
  4562. message: error,
  4563. type: "error"
  4564. });
  4565. }
  4566. );
  4567. //项目相关的近期任务
  4568. if (this.user.company.packageProject == 1) {
  4569. this.getRecentTaskList(domain, index);
  4570. //获取项目相关专业
  4571. if (this.user.company.packageEngineering == 1) {
  4572. this.getProjectProfessions(domain, index);
  4573. }
  4574. //获取项目下的任务分组
  4575. this.getTaskGroups(domain, index);
  4576. }
  4577. // 获取项目相关的维度
  4578. // domain.degreeId = null
  4579. this.$set(domain,'degreeId',null)
  4580. this.$set(domain,'multiDegrIdArray',null)
  4581. this.dimension(domain, index);
  4582. //获取项目审核人
  4583. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4584. this.getProjectAuditorList(domain, index);
  4585. } else {
  4586. //按分组的负责人来审核
  4587. domain.projectAuditorId = null;
  4588. domain.projectAuditorName = null;
  4589. domain.auditUserList = null;
  4590. }
  4591. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4592. if (this.reportTimeType.type == 3) {
  4593. //新增项目时,自动计算
  4594. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4595. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4596. }
  4597. //加载昱众的工作职责
  4598. if (this.user.companyId == this.yuzhongCompId) {
  4599. this.updateResponse(domain);
  4600. }
  4601. },
  4602. getRecentTaskList(domain, index) {
  4603. //刷新任务时,清空服务
  4604. this.$set(domain, 'sapServiceId', null);
  4605. this.$set(domain, 'taskId', null);
  4606. var param = {
  4607. projectId: domain.projectId,
  4608. isSubstitude:this.isSubstitude?1:0,
  4609. };
  4610. if (domain.groupId) {
  4611. param.groupId = domain.groupId;
  4612. }
  4613. if (domain.stage) {
  4614. param.stage = domain.stage;
  4615. }
  4616. //专业版代填,获取代填员工的任务
  4617. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4618. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4619. this.$message({
  4620. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4621. type: "error"
  4622. });
  4623. return;
  4624. } else {
  4625. param.userId = this.workForm.userId[0];
  4626. }
  4627. }
  4628. this.http.post('/task/getRecentTask',param,
  4629. res => {
  4630. if (res.code == "ok") {
  4631. this.workForm.domains[index].allTaskList = res.data;
  4632. this.workForm.domains[index].taskList = res.data;
  4633. this.$forceUpdate();
  4634. }
  4635. },
  4636. error => {
  4637. this.$message({
  4638. message: error,
  4639. type: "error"
  4640. });
  4641. }
  4642. );
  4643. },
  4644. //获取项目审核人
  4645. getProjectAuditorList(domainItem, index) {
  4646. if(domainItem.projectId == '') {
  4647. return
  4648. }
  4649. domainItem.projectAuditorId = null;
  4650. domainItem.projectAuditorName = null;
  4651. this.http.post('/project-auditor/getList',{
  4652. projectId: domainItem.projectId,
  4653. },
  4654. res => {
  4655. if (res.code == "ok") {
  4656. domainItem.auditUserList = res.data;
  4657. if (res.data.length==0) {
  4658. this.$message({
  4659. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4660. type: "error"
  4661. });
  4662. } else if (res.data.length==1) {
  4663. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4664. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4665. }
  4666. this.$forceUpdate();
  4667. }
  4668. },
  4669. error => {
  4670. this.$message({
  4671. message: error,
  4672. type: "error"
  4673. });
  4674. }
  4675. );
  4676. },
  4677. // 获取维度数据
  4678. dimension(domain, index) {
  4679. if(domain.projectId == '') {
  4680. return
  4681. }
  4682. this.http.post('/project/getDegreeList',{
  4683. projectId: domain.projectId,
  4684. },
  4685. res => {
  4686. if (res.code == "ok") {
  4687. // console.log("维度数据",res.data);
  4688. this.workForm.domains[index].wuduList = res.data
  4689. // this.workForm = this.workForm
  4690. this.$forceUpdate()
  4691. }
  4692. },
  4693. error => {
  4694. this.$message({
  4695. message: error,
  4696. type: "error"
  4697. });
  4698. }
  4699. );
  4700. },
  4701. //切换任务阶段
  4702. changeStages(domain, index) {
  4703. if (domain.stage == null || domain.stage == '') {
  4704. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4705. } else {
  4706. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4707. }
  4708. this.getRecentTaskList(domain, index);
  4709. this.$forceUpdate();
  4710. },
  4711. getGroupStages(domain, index, keepStage) {
  4712. // console.log(domain);
  4713. if(!domain.groupId){
  4714. domain.projectAuditorId = ''
  4715. domain.stages = []
  4716. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4717. domain.taskId = ''
  4718. domain.sapServiceId = ''
  4719. }
  4720. if(this.user.timeType.reportAuditType >= 1){
  4721. domain.auditUserList = []
  4722. }
  4723. this.$forceUpdate();
  4724. return
  4725. }
  4726. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4727. res => {
  4728. if (res.code == "ok") {
  4729. if (!keepStage) {
  4730. domain.stage = '';
  4731. }
  4732. domain.stages = res.data;
  4733. this.getRecentTaskList(domain, index);
  4734. this.$forceUpdate();
  4735. }
  4736. },
  4737. error => {
  4738. this.$message({
  4739. message: error,
  4740. type: "error"
  4741. });
  4742. });
  4743. //检查当前的项目是否需要获取分组的负责人
  4744. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4745. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4746. res => {
  4747. if (res.code == "ok") {
  4748. domain.getProjectAuditorList = res.data;
  4749. domain.auditUserList = res.data;
  4750. if (res.data.length==1) {
  4751. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4752. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4753. } else if (res.data.length==0) {
  4754. domain.projectAuditorId = null;
  4755. domain.projectAuditorName = null;
  4756. }
  4757. this.$forceUpdate();
  4758. }
  4759. },
  4760. error => {
  4761. this.$message({
  4762. message: error,
  4763. type: "error"
  4764. });
  4765. });
  4766. }
  4767. },
  4768. getProjectProfessions(domain, index) {
  4769. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4770. res => {
  4771. if (res.code == "ok") {
  4772. this.workForm.domains[index].professionProgress = res.data;
  4773. this.$forceUpdate();
  4774. }
  4775. },
  4776. error => {
  4777. this.$message({
  4778. message: error,
  4779. type: "error"
  4780. });
  4781. });
  4782. },
  4783. //删除自己的日报
  4784. deleteReport() {
  4785. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4786. confirmButtonText: this.$t('btn.determine'),
  4787. cancelButtonText: this.$t('btn.cancel'),
  4788. type: "warning"
  4789. })
  4790. .then(() => {
  4791. this.listLoading = true;
  4792. this.http.post('/report/delete',{
  4793. userId: this.user.id,
  4794. date: this.workForm.createDate
  4795. },
  4796. res => {
  4797. this.listLoading = false;
  4798. if (res.code == "ok") {
  4799. this.$message({
  4800. message: this.$t('message.successfullyDeleted'),
  4801. type: "success"
  4802. });
  4803. this.getReportList();
  4804. this.getDepartment();
  4805. this.dialogVisible = false;
  4806. } else {
  4807. this.$message({
  4808. message: res.msg,
  4809. type: "error"
  4810. });
  4811. }
  4812. },
  4813. error => {
  4814. this.listLoading = false;
  4815. this.$message({
  4816. message: error,
  4817. type: "error"
  4818. });
  4819. }
  4820. );
  4821. })
  4822. .catch(() => {});
  4823. },
  4824. // 管理员删除日报
  4825. guanli(item) {
  4826. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4827. let param = {date: this.date + day, userId: item.id};
  4828. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4829. confirmButtonText: this.$t('btn.determine'),
  4830. cancelButtonText: this.$t('btn.cancel'),
  4831. type: "warning"
  4832. })
  4833. .then(() => {
  4834. this.listLoading = true;
  4835. this.http.post('/report/delete',param,
  4836. res => {
  4837. this.listLoading = false;
  4838. if (res.code == "ok") {
  4839. this.$message({
  4840. message: this.$t('message.successfullyDeleted'),
  4841. type: "success"
  4842. });
  4843. this.getReportList();
  4844. this.getDepartment();
  4845. this.dialogVisible = false;
  4846. } else {
  4847. this.$message({
  4848. message: res.msg,
  4849. type: "error"
  4850. });
  4851. }
  4852. },
  4853. error => {
  4854. this.listLoading = false;
  4855. this.$message({
  4856. message: error,
  4857. type: "error"
  4858. });
  4859. }
  4860. );
  4861. })
  4862. .catch(() => {});
  4863. },
  4864. selectAll() {
  4865. if (this.isAllSelect) {
  4866. var keys = [];
  4867. this.reportNames.forEach(b=>{
  4868. keys.push(b.id);
  4869. })
  4870. this.$refs.approveTree.setCheckedKeys(keys);
  4871. } else {
  4872. this.$refs.approveTree.setCheckedKeys([]);
  4873. }
  4874. },
  4875. removeEmptyNode(list) {
  4876. for (var i=0;i<list.length;i++) {
  4877. var cnt = 0;
  4878. if (list[i].membCount == 0) {
  4879. list.splice(i, 1);
  4880. i--;
  4881. } else if (list[i].children != null) {
  4882. this.removeEmptyNode(list[i].children);
  4883. }
  4884. }
  4885. },
  4886. calculateMembCount(list) {
  4887. for (var i in list) {
  4888. var cnt = 0;
  4889. if (list[i].children != null) {
  4890. this.calculateMembCount(list[i].children);
  4891. for (var m in list[i].children) {
  4892. cnt += list[i].children[m].membCount;
  4893. }
  4894. }
  4895. if (list[i].isUser == 1) {
  4896. cnt++;
  4897. this.membCount++;
  4898. }
  4899. list[i].membCount = cnt;
  4900. }
  4901. },
  4902. stateChange() {
  4903. // console.log(this.allData,'alldate');
  4904. this.membCount = 0;
  4905. if (this.selectState == -1) {
  4906. //全部状态
  4907. this.data = this.allData;
  4908. } else {
  4909. //未填报
  4910. this.seluserText = ''
  4911. var newData = JSON.parse(JSON.stringify(this.allData));
  4912. this.filterState(this.selectState, newData);
  4913. this.data = newData;
  4914. }
  4915. this.calculateMembCount(this.data);
  4916. this.data[0].membCount = this.membCount;//总人数
  4917. },
  4918. //按状态过滤部门人员
  4919. filterState(state, list) {
  4920. for (var i =0;i<list.length; i++) {
  4921. var obj = list[i];
  4922. if (obj.isUser == 1) {
  4923. var match = false;
  4924. if (state == -2) {
  4925. if (obj.state == null) {
  4926. match = true;
  4927. }
  4928. } else {
  4929. if (obj.state == state) {
  4930. match = true;
  4931. }
  4932. }
  4933. if (!match) {
  4934. list.splice(i, 1);
  4935. i--;
  4936. } else {
  4937. }
  4938. } else {
  4939. if (obj.children != null) {
  4940. this.filterState(state, obj.children);
  4941. }
  4942. }
  4943. }
  4944. },
  4945. //a按名称过滤部门人员
  4946. async seluserforText(){
  4947. const { userNameNeedTranslate } = this.user
  4948. this.membCount = 0;
  4949. var newData = JSON.parse(JSON.stringify(this.allData));
  4950. let textList = [this.seluserText]
  4951. if(userNameNeedTranslate == 1) {
  4952. this.dataLoading = true
  4953. let res = await this.postData('/user/getEmployeeList', {
  4954. keyword: this.seluserText,
  4955. cursor: '',
  4956. departmentId: -1,
  4957. pageIndex: 1,
  4958. pageSize: 1000
  4959. })
  4960. textList = res.data.records.map(item => item.name)
  4961. this.dataLoading = false
  4962. }
  4963. // return
  4964. console.log(textList, '<=== textList')
  4965. this.seluserforTextin(this.seluserText, newData, textList)
  4966. console.log(newData, 'Data')
  4967. this.data = newData;
  4968. this.calculateMembCount(this.data);
  4969. this.data[0].membCount = this.membCount;//总人数
  4970. },
  4971. seluserforTextin(text, list, textList = []){
  4972. for (var i =0;i<list.length; i++) {
  4973. var obj = list[i];
  4974. if (obj.isUser == 1) {
  4975. var match = false;
  4976. // if (obj.label.indexOf(text) != -1) {
  4977. // match = true
  4978. // }
  4979. if(textList.some(item => item.includes(obj.label))) {
  4980. match = true
  4981. }
  4982. if (!match) {
  4983. list.splice(i, 1);
  4984. i--;
  4985. } else {
  4986. }
  4987. } else {
  4988. if (obj.children != null) {
  4989. this.seluserforTextin(text, obj.children, textList);
  4990. }
  4991. }
  4992. }
  4993. },
  4994. // 当节点发生变化时
  4995. nodeChangeExpand(data) {
  4996. // 保存当前展开的节点
  4997. let flag = false
  4998. this.nodeModelData.some(item => {
  4999. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5000. flag = true
  5001. return true
  5002. }
  5003. })
  5004. if (!flag) { // 不存在则存到数组里
  5005. this.nodeModelData.push(data.id)
  5006. }
  5007. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5008. },
  5009. nodeChangeCollapse(data) {
  5010. console.log(this.nodeModelData)
  5011. this.nodeModelData.some((item, i) => {
  5012. if (item === data.id) {
  5013. this.nodeModelData.length = i
  5014. }
  5015. })
  5016. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5017. },
  5018. // 部门列表点击
  5019. handleNodeClick(data) {
  5020. // this.dealList = data
  5021. this.theValues(data.id, this.allData)
  5022. // this.depData = data;
  5023. var list = [];
  5024. if (data.id == -1) {
  5025. this.deptId = null;
  5026. this.targetUid = null;
  5027. list = this.data;
  5028. } else if (data.isUser == 1) {
  5029. this.deptId = null;
  5030. this.targetUid = data.id;
  5031. } else {
  5032. this.deptId = data.id;
  5033. this.targetUid = null;
  5034. list.push(data);
  5035. }
  5036. this.getReportList();
  5037. if (list.length > 0) {
  5038. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5039. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5040. }
  5041. },
  5042. exportPushLog(){
  5043. this.http.post('/sap-sync-log/export',{},
  5044. res => {
  5045. if (res.code == "ok") {
  5046. var filePath = res.data;
  5047. var fName = '推送日志.xlsx'
  5048. const a = document.createElement('a'); // 创建a标签
  5049. a.setAttribute('download', fName);// download属性
  5050. a.setAttribute('href', filePath);// href链接
  5051. a.click(); //自执行点击事件
  5052. a.remove();
  5053. } else {
  5054. this.$message({
  5055. message: res.msg,
  5056. type: "error"
  5057. });
  5058. }
  5059. },
  5060. error => {
  5061. this.$message({
  5062. message: error,
  5063. type: "error"
  5064. });
  5065. });
  5066. },
  5067. theValues(id, item) {
  5068. for(var i in item) {
  5069. if(item[i].id == id) {
  5070. this.depData = item[i]
  5071. if(id == '-1') {
  5072. this.translation = '1'
  5073. } else {
  5074. if(item[i].children) {
  5075. this.translation = '2'
  5076. } else {
  5077. this.translation = '3'
  5078. }
  5079. }
  5080. return
  5081. } else {
  5082. if(item[i].children) {
  5083. this.theValues(id, item[i].children)
  5084. }
  5085. }
  5086. }
  5087. },
  5088. //获取可以选择的代填的人员列表
  5089. getSubstitudeUserDeptList() {
  5090. if (this.deptMembData.length == 0) {
  5091. this.http.post("/department/listMyMembs", {},
  5092. res => {
  5093. if (res.code == "ok") {
  5094. let noAllData = JSON.parse(JSON.stringify(res.data));
  5095. if (noAllData.length > 0) {
  5096. // if (noAllData[0].label == '全部人员') {
  5097. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5098. noAllData.splice(0,1);
  5099. }
  5100. }
  5101. this.setUserToDept(noAllData);
  5102. this.deptMembData = noAllData;
  5103. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5104. console.log(this.deptMembData, '代填人员数据')
  5105. } else {
  5106. this.$message({
  5107. message: res.msg,
  5108. type: "error"
  5109. });
  5110. }
  5111. },
  5112. error => {
  5113. this.$message({
  5114. message: error,
  5115. type: "error"
  5116. });
  5117. });
  5118. }
  5119. },
  5120. // 获取部门列表
  5121. getDepartmentForApprove() {
  5122. this.http.post( this.port.manage.depList, {},
  5123. res => {
  5124. if (res.code == "ok") {
  5125. var list1 = JSON.parse(JSON.stringify(res.data));
  5126. this.deptOptionList = this.changeArr(list1);
  5127. console.log(this.deptOptionList, '部门')
  5128. } else {
  5129. this.$message({
  5130. message: res.msg,
  5131. type: "error"
  5132. });
  5133. }
  5134. },
  5135. error => {
  5136. this.$message({
  5137. message: error,
  5138. type: "error"
  5139. });
  5140. });
  5141. },
  5142. // 获取部门列表
  5143. getDepartment() {
  5144. //如果没有权限,就不需要获取
  5145. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5146. return;
  5147. }
  5148. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5149. var param = {date:this.date + day};
  5150. this.http.post("/report/getMembList", param,
  5151. res => {
  5152. if (res.code == "ok") {
  5153. if(res.data.length == 0){
  5154. return
  5155. }
  5156. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5157. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5158. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5159. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5160. // if (this.user.role > 0) {
  5161. // }
  5162. list.splice(0,0,{
  5163. id: -1,
  5164. label: this.$t('lable.allStaff'),
  5165. })
  5166. this.membCount = 0;
  5167. //设置员工到部门下面
  5168. this.setUserToDept(list);
  5169. this.data = list;
  5170. // console.log('data',this.data);
  5171. this.expandDate = [this.data[1].id]
  5172. this.allData = list;
  5173. // if (noAllData.length > 0) {
  5174. // if (noAllData[0].label == '全部人员') {
  5175. // noAllData.splice(0,1);
  5176. // }
  5177. // }
  5178. // this.setUserToDept(noAllData);
  5179. // this.deptMembData = noAllData;
  5180. this.option = this.changeArr(list1);
  5181. list[0].membCount = this.membCount;
  5182. if (this.depData.id == -1) {
  5183. this.depData.membCount = this.membCount;
  5184. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5185. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5186. } else {
  5187. if (this.depData.isUser == null) {
  5188. var dep = this.findTargetDept(this.data, this.depData.id);
  5189. var membDeptList = [];
  5190. membDeptList.push(dep);
  5191. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5192. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5193. }
  5194. }
  5195. if (this.depData.isUser == null) {
  5196. if (this.isFill) {
  5197. this.fillMembList = this.fillList;
  5198. } else {
  5199. this.fillMembList = this.unFillList;
  5200. }
  5201. }
  5202. this.leaveAllNum = 0
  5203. for(let i in this.unFillList){
  5204. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5205. this.leaveAllNum += 1
  5206. }
  5207. }
  5208. this.stateChange()
  5209. } else {
  5210. this.$message({
  5211. message: res.msg,
  5212. type: "error"
  5213. });
  5214. }
  5215. },
  5216. error => {
  5217. this.$message({
  5218. message: error,
  5219. type: "error"
  5220. });
  5221. });
  5222. this.getReportFillStatus();
  5223. },
  5224. findTargetDept(list, deptId) {
  5225. var t = null;
  5226. for (var i=0;i<list.length; i++) {
  5227. if (list[i].isUser == null && list[i].id == deptId) {
  5228. t = list[i];
  5229. break;
  5230. }
  5231. }
  5232. if (t == null) {
  5233. for (var i=0;i<list.length; i++) {
  5234. if (list[i].children != null && list[i].children.length > 0) {
  5235. t = this.findTargetDept(list[i].children, deptId);
  5236. if (t != null) {
  5237. break;
  5238. }
  5239. }
  5240. }
  5241. }
  5242. return t;
  5243. },
  5244. getUserMembListFromDeptList(list, isFill) {
  5245. var membList = [];
  5246. for (var i in list) {
  5247. var deptName = list[i].label;
  5248. if (list[i].userList != null) {
  5249. list[i].userList.forEach(element => {
  5250. if (isFill == 0) {
  5251. //获取未填的
  5252. if (element.state == null) {
  5253. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5254. membList.push(obj);
  5255. }
  5256. } else {
  5257. if (element.state != null) {
  5258. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5259. membList.push(obj);
  5260. }
  5261. }
  5262. });
  5263. }
  5264. if (list[i].children != null) {
  5265. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5266. }
  5267. }
  5268. return membList;
  5269. },
  5270. setUserToDept(list) {
  5271. for (var i in list) {
  5272. var cnt = 0;
  5273. if (list[i].children != null) {
  5274. this.setUserToDept(list[i].children);
  5275. for (var m in list[i].children) {
  5276. cnt += list[i].children[m].membCount;
  5277. }
  5278. }
  5279. if (list[i].userList != null) {
  5280. if (list[i].children == null) {
  5281. list[i].children = [];
  5282. }
  5283. list[i].userList.forEach(element => {
  5284. var obj = {
  5285. id: element.id,
  5286. label:element.name,
  5287. state:element.state,
  5288. parentId:element.departmentId,
  5289. isUser:1,
  5290. workingTime: element.workingTime,
  5291. leaveDays: element.leaveDays,
  5292. leaveTimes: element.leaveTimes
  5293. };
  5294. list[i].children.push(obj);
  5295. this.membCount++;
  5296. cnt++;
  5297. });
  5298. }
  5299. list[i].membCount = cnt;
  5300. }
  5301. },
  5302. // 修改数组
  5303. changeArr(arr) {
  5304. for (var i = 0; i < arr.length; i++) {
  5305. if(arr[i].id != -1 && arr[i].id != 0) {
  5306. if (arr[i].children != null && arr[i].children.length>0) {
  5307. arr[i].children = this.changeArr(arr[i].children);
  5308. }
  5309. arr[i].id && (arr[i].value = arr[i].id);
  5310. delete arr[i].id;
  5311. }
  5312. }
  5313. for(var i in arr) {
  5314. if(arr[i].id == -1 || arr[i].id == 0) {
  5315. arr.splice(i,1)
  5316. }
  5317. }
  5318. return arr;
  5319. },
  5320. //时间段范围设置改动,监听
  5321. onTimeTypeChange(timeType) {
  5322. this.seleChn(1)
  5323. this.showAddMore = true;
  5324. for(var i in this.workForm.domains) {
  5325. if (this.workForm.domains[i].timeType == 0) {
  5326. this.showAddMore = false;
  5327. break;
  5328. }
  5329. }
  5330. if (this.showAddMore) {
  5331. //检测数量
  5332. if (this.workForm.domains.length == 2) {
  5333. this.showAddMore = false;
  5334. } else {
  5335. this.showAddMore = true;
  5336. }
  5337. }
  5338. },
  5339. getTimeType() {
  5340. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5341. res => {
  5342. if (res.code == "ok") {
  5343. var t = res.data;
  5344. this.reportTimeType = t;
  5345. if (this.reportTimeType.type > 0) {
  5346. this.showAddMore = true;
  5347. }
  5348. //转化时间格式
  5349. if (t.allday != null) {
  5350. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5351. }
  5352. if (t.am != null) {
  5353. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5354. }
  5355. if (t.pm != null) {
  5356. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5357. }
  5358. let arr = []
  5359. for(var i in res.data.excludeTimeList) {
  5360. let obj = {
  5361. s: res.data.excludeTimeList[i].startTime,
  5362. e: res.data.excludeTimeList[i].endTime,
  5363. }
  5364. arr.push(obj)
  5365. }
  5366. this.vacationTime = arr
  5367. } else {
  5368. this.$message({
  5369. message: res.msg,
  5370. type: "error"
  5371. });
  5372. }
  5373. },
  5374. error => {
  5375. this.listLoading = false;
  5376. this.$message({
  5377. message: error,
  5378. type: "error"
  5379. });
  5380. });
  5381. },
  5382. // 改变月份 -------
  5383. changeMonthOut() {
  5384. this.getAllDate();
  5385. this.getReportList();
  5386. this.getDepartment();
  5387. },
  5388. // 选择日期
  5389. choseDate(i, item) {
  5390. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5391. return
  5392. }
  5393. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5394. this.choseDay = i;
  5395. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5396. sessionStorage.msg = this.date + day,
  5397. this.getReportList();
  5398. this.getDepartment();
  5399. this.curDate = item.date;
  5400. },
  5401. canClick(i, item){
  5402. let nowDate = new Date()
  5403. let nowDateYear = nowDate.getFullYear()
  5404. let itemYear = parseInt(this.date.split('-')[0])
  5405. let nowDateMonth = nowDate.getMonth() + 1
  5406. let itemMonth = parseInt(this.date.split('-')[1])
  5407. let nowDateDay = nowDate.getDate()
  5408. let itemDay = parseInt(item.showDate.split('.')[1])
  5409. if(nowDateYear < itemYear){
  5410. return false
  5411. }else if(nowDateYear == itemYear){
  5412. if(nowDateMonth < itemMonth){
  5413. return false
  5414. }else if(nowDateMonth == itemMonth){
  5415. if(nowDateDay < itemDay){
  5416. return false
  5417. }
  5418. }
  5419. }
  5420. },
  5421. // 获取日期列表
  5422. getAllDate(e) {
  5423. var dayArry = [];
  5424. var day = this.getCountDays();
  5425. let curMonthDay = null;
  5426. for (var k = 1; k <= day; k++) {
  5427. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5428. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5429. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5430. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5431. if(sessionStorage.msg) {
  5432. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5433. this.choseDay = k - 1;
  5434. curMonthDay = str;
  5435. }
  5436. } else {
  5437. if (new Date().getDate() == k) {
  5438. this.choseDay = k - 1;
  5439. }
  5440. }
  5441. } else {
  5442. this.choseDay = 0;
  5443. }
  5444. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5445. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5446. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5447. }
  5448. this.allDate = dayArry;
  5449. //不能超过最大日期
  5450. if (this.choseDay > day-1) {
  5451. this.choseDay = day-1;
  5452. }
  5453. if(sessionStorage.from != 1){
  5454. let nowmonth = new Date().getMonth() + 1
  5455. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5456. let nowdate = new Date().getDate()
  5457. if(nowd == this.date){
  5458. if(e && sessionStorage.msg){
  5459. }else{
  5460. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5461. }
  5462. let nowday = new Date(sessionStorage.msg).getDate()
  5463. this.choseDay = nowday - 1
  5464. let monthdate = new Date(sessionStorage.msg)
  5465. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5466. }else{
  5467. if(e && sessionStorage.msg){
  5468. }else{
  5469. sessionStorage.msg = this.date + '-01'
  5470. }
  5471. let monthdate = new Date(sessionStorage.msg)
  5472. this.choseDay = monthdate.getDate() - 1
  5473. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5474. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5475. }
  5476. }else{
  5477. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5478. }
  5479. //从消息点击跳转过来的,直接加载指定日期
  5480. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5481. this.curDate = sessionStorage.msg;
  5482. sessionStorage.from = 0;
  5483. } else {
  5484. // if (curMonthDay != null) {
  5485. // // this.curDate = curMonthDay;
  5486. // let d = new Date(sessionStorage.msg)
  5487. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5488. // } else {
  5489. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5490. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5491. // }
  5492. }
  5493. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5494. // if(!sessionStorage.msg){
  5495. // let msgday = this.choseDay + 1
  5496. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5497. // }
  5498. this.getReportFillStatus();
  5499. },
  5500. getCountDays() {
  5501. var newstr = this.date.replace(/-/g, "/");
  5502. var curDate = new Date(newstr+'/01');
  5503. var curMonth = curDate.getMonth();
  5504. curDate.setMonth(curMonth + 1);
  5505. curDate.setDate(0);
  5506. return curDate.getDate();
  5507. },
  5508. reqMore() {
  5509. if (this.hasMore) {
  5510. this.pageIndex++;
  5511. this.requestHttpReports();
  5512. }
  5513. },
  5514. //加载日报数据
  5515. requestHttpReports() {
  5516. //请求数据
  5517. this.listLoading = true;
  5518. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5519. let param = {date: this.date + day};
  5520. if (this.deptId) {
  5521. param.deptId = this.deptId;
  5522. }
  5523. if (this.targetUid) {
  5524. param.userId = this.targetUid;
  5525. }
  5526. //传页码
  5527. if (this.hasMore) {
  5528. param.pageIndex = this.pageIndex;
  5529. }
  5530. this.http.post( this.port.report.list, param,
  5531. res => {
  5532. this.listLoading = false;
  5533. if (res.code == "ok") {
  5534. //扩增
  5535. if (res.data.data.length > 0) {
  5536. this.reportList = this.reportList.concat(res.data.data);
  5537. } else if (this.pageIndex > 1){
  5538. this.$message({
  5539. message: this.$t('meiYouGengDuoShuJuLe'),
  5540. type: "info"
  5541. });
  5542. }
  5543. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5544. if(document.querySelector("#day"+this.choseDay)){
  5545. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5546. }
  5547. } else {
  5548. this.$message({
  5549. message: res.msg,
  5550. type: "error"
  5551. });
  5552. }
  5553. },
  5554. error => {
  5555. this.listLoading = false;
  5556. this.$message({
  5557. message: error,
  5558. type: "error"
  5559. });
  5560. });
  5561. },
  5562. //获取日报列表
  5563. getReportList() {
  5564. //初始化,重置数据
  5565. this.pageIndex = 0;
  5566. this.hasMore = true;
  5567. this.reportList = [];
  5568. this.requestHttpReports();
  5569. },
  5570. //刷新日报状态,用于审核后更新
  5571. refreshReportData(reportId) {
  5572. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5573. res => {
  5574. if (res.code == "ok") {
  5575. for (var m=0;m<this.reportList.length; m++) {
  5576. var d = this.reportList[m].data;
  5577. var find = d.filter(r=>r.id == reportId);
  5578. if (find.length > 0) {
  5579. find[0].state = res.data.state;
  5580. if (find[0].state == 2) {//被驳回,要可以编辑
  5581. this.reportList[m].state = 2;
  5582. }
  5583. find[0].isDeptAudit = res.data.isDeptAudit;
  5584. find[0].departmentAuditState = res.data.departmentAuditState;
  5585. find[0].projectAuditorName = res.data.projectAuditorName;
  5586. find[0].projectAuditorId = res.data.projectAuditorId;
  5587. find[0].projectAuditState = res.data.projectAuditState;
  5588. find[0].rejectUserid = res.data.rejectUserid;
  5589. find[0].rejectUsername = res.data.rejectUsername;
  5590. find[0].rejectReason = res.data.rejectReason;
  5591. this.$forceUpdate();
  5592. break;
  5593. }
  5594. }
  5595. } else {
  5596. this.$message({
  5597. message: res.msg,
  5598. type: "error"
  5599. });
  5600. }
  5601. },
  5602. error => {
  5603. this.listLoading = false;
  5604. this.$message({
  5605. message: error,
  5606. type: "error"
  5607. });
  5608. });
  5609. },
  5610. //导出员工工时统计
  5611. exportUserTime() {
  5612. this.listLoading = true;
  5613. var param = {};
  5614. if (this.exportParam.dateRange != null) {
  5615. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5616. }
  5617. this.http.post('/department/exportDeptStatistic', param,
  5618. res => {
  5619. this.listLoading = false;
  5620. if (res.code == "ok") {
  5621. location.href = res.data;
  5622. this.exportTimeDialog = false;
  5623. } else {
  5624. this.$message({
  5625. message: res.msg,
  5626. type: "error"
  5627. });
  5628. }
  5629. },
  5630. error => {
  5631. this.listLoading = false;
  5632. this.$message({
  5633. message: error,
  5634. type: "error"
  5635. });
  5636. });
  5637. },
  5638. //导出日报
  5639. exportReport() {
  5640. this.exportingData = true;
  5641. var param = {};
  5642. if (this.exportParam.dateRange != null) {
  5643. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5644. }
  5645. if (this.exportParam.projectId != null) {
  5646. param.projectId = this.exportParam.projectId;
  5647. }
  5648. if (this.exportParam.departmentId != null) {
  5649. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5650. param.departmentIds = this.exportParam.departmentId.join(',')
  5651. }
  5652. param.stateKey = this.stateKey
  5653. // param.departmentId = this.user.departmentId
  5654. console.log(param, '《=== 导出传的参数');
  5655. console.log('开始调用exportReport接口');
  5656. this.http.post(this.port.report.export, param,
  5657. res => {
  5658. this.exportingData = false;
  5659. if (res.code == "ok") {
  5660. var filePath = res.data;
  5661. const a = document.createElement('a'); // 创建a标签
  5662. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5663. a.setAttribute('href', filePath);// href链接
  5664. a.click(); //自执行点击事件
  5665. a.remove();
  5666. this.exportDialog = false;
  5667. } else {
  5668. this.$message({
  5669. message: res.msg,
  5670. type: "error"
  5671. });
  5672. }
  5673. },
  5674. error => {
  5675. this.exportingData = false;
  5676. this.$message({
  5677. message: error,
  5678. type: "error"
  5679. });
  5680. });
  5681. },
  5682. //导出日报审核记录
  5683. exportReportLog() {
  5684. this.exportingData = true;
  5685. var param = {};
  5686. if (this.exportReportLogParam.dateRange != null) {
  5687. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5688. }
  5689. this.http.post('/report-log/exportReportLog', param,
  5690. res => {
  5691. this.exportingData = false;
  5692. if (res.code == "ok") {
  5693. var filePath = res.data;
  5694. const a = document.createElement('a'); // 创建a标签
  5695. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5696. a.setAttribute('href', filePath);// href链接
  5697. a.click(); //自执行点击事件
  5698. a.remove();
  5699. this.exportDialog = false;
  5700. } else {
  5701. this.$message({
  5702. message: res.msg,
  5703. type: "error"
  5704. });
  5705. }
  5706. },
  5707. error => {
  5708. this.exportingData = false;
  5709. this.$message({
  5710. message: error,
  5711. type: "error"
  5712. });
  5713. });
  5714. },
  5715. restUserCardTime(item){
  5716. let param={}
  5717. param.userId=item.userId
  5718. param.createDate=item.createDate
  5719. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5720. res => {
  5721. if (res.code == "ok") {
  5722. this.showMonthWorkTimeReminder()
  5723. } else {
  5724. this.$message({
  5725. message: res.msg,
  5726. type: "error"
  5727. });
  5728. }
  5729. },
  5730. error => {
  5731. this.$message({
  5732. message: error,
  5733. type: "error"
  5734. });
  5735. });
  5736. },
  5737. importReportLog(item){
  5738. //首先判断文件类型
  5739. let str = item.file.name.split(".");
  5740. let format = str[str.length - 1];
  5741. if (format != "xls" && format != "xlsx") {
  5742. this.$message({
  5743. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5744. type: "error"
  5745. });
  5746. } else {
  5747. const loading = this.$loading({
  5748. lock: true,
  5749. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5750. spinner: 'el-icon-loading',
  5751. background: 'rgba(0, 0, 0, 0.7)'
  5752. });
  5753. let formData = new FormData();
  5754. formData.append("multipartFile", item.file);
  5755. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5756. res => {
  5757. this.$refs.upload.clearFiles();
  5758. loading.close();
  5759. if (res.code == "ok") {
  5760. this.$message({
  5761. message: res.msg,
  5762. type: "success"
  5763. });
  5764. } else {
  5765. this.$message({
  5766. message: res.msg,
  5767. type: "error"
  5768. });
  5769. }
  5770. },
  5771. error => {
  5772. this.$refs.upload.clearFiles();
  5773. loading.close();
  5774. this.$message({
  5775. message: error,
  5776. type: "error"
  5777. });
  5778. });
  5779. }
  5780. },
  5781. //获取项目列表
  5782. getProjectList() {
  5783. this.listLoading = true;
  5784. this.http.post( this.port.project.list, {},
  5785. res => {
  5786. this.listLoading = false;
  5787. if (res.code == "ok") {
  5788. for(var i in res.data) {
  5789. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5790. res.data[i].projectCode = ''
  5791. }
  5792. }
  5793. this.projectList = res.data;
  5794. console.log("项目列表",this.projectList);
  5795. } else {
  5796. this.$message({
  5797. message: res.msg,
  5798. type: "error"
  5799. });
  5800. }
  5801. },
  5802. error => {
  5803. this.listLoading = false;
  5804. this.$message({
  5805. message: error,
  5806. type: "error"
  5807. });
  5808. });
  5809. },
  5810. // 获取填报日报的项目下拉列表
  5811. getFillProjectList() {
  5812. this.http.post( this.port.project.list, {
  5813. forReport: 1
  5814. },res => {
  5815. if (res.code == "ok") {
  5816. for(var i in res.data) {
  5817. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5818. res.data[i].projectCode = ''
  5819. }
  5820. }
  5821. this.fillProjectList = res.data;
  5822. this.getRecentlyProject()
  5823. } else {
  5824. this.$message({
  5825. message: res.msg,
  5826. type: "error"
  5827. });
  5828. }
  5829. },
  5830. error => {
  5831. this.$message({
  5832. message: error,
  5833. type: "error"
  5834. });
  5835. });
  5836. },
  5837. getBasecostItemList() {
  5838. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5839. companyId: this.user.companyId
  5840. },
  5841. res => {
  5842. if (res.code == "ok") {
  5843. this.timeBasecostList = res.data;
  5844. }
  5845. });
  5846. },
  5847. getAIReport(createDate) {
  5848. this.http.post('/report/getAIReport', {},
  5849. res => {
  5850. if (res.code == "ok") {
  5851. var quanbu = 0
  5852. this.jsDay = 1
  5853. var zhi = ''
  5854. var slp = res.data
  5855. for(var i in slp) {
  5856. var sp = +slp[i].workingTime + 0
  5857. zhi = this.jsDay * sp
  5858. quanbu = +quanbu + zhi
  5859. }
  5860. this.jsTime = quanbu
  5861. var aiReportData = res.data;
  5862. this.canCancelInDialog = false
  5863. if(aiReportData.length != 0) {
  5864. var arr = [];
  5865. for(var i in aiReportData) {
  5866. arr.push({
  5867. id: null,
  5868. projectId: aiReportData[i].projectId,
  5869. workingTime: aiReportData[i].workingTime,
  5870. content: '',
  5871. progress:100,
  5872. state: 2,
  5873. timeType: aiReportData[i].timeType,
  5874. subProjectList: aiReportData[i].subProjectList,
  5875. taskList: aiReportData[i].taskList,
  5876. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5877. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5878. taskId: aiReportData[i].taskId,
  5879. startTime: aiReportData[i].startTime,
  5880. endTime: aiReportData[i].endTime,
  5881. isOvertime: 0,
  5882. progress:aiReportData[i].progress,
  5883. professionProgress: aiReportData[i].professionProgressList,
  5884. stages:aiReportData[i].stages,
  5885. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5886. pics: null,
  5887. multiWorktime: aiReportData[i].multiWorktime || 0,
  5888. worktimeList: [{}],
  5889. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5890. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5891. wuduList: aiReportData[i].degreeList,
  5892. taskGroups:aiReportData[i].taskGroups,
  5893. customData: aiReportData[i].customData,//自定义的数值
  5894. auditUserList: aiReportData[i].auditUserList,
  5895. projectAuditorId: aiReportData[i].projectAuditorId,
  5896. projectAuditorName: aiReportData[i].projectAuditorName,
  5897. overtimeHours: aiReportData[i].overtimeHours,
  5898. customText: aiReportData[i].customText,
  5899. basecostId: aiReportData[i].basecostId,
  5900. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5901. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5902. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5903. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5904. canEdit: true
  5905. })
  5906. }
  5907. this.workForm.domains = arr;
  5908. } else {
  5909. }
  5910. this.canEdit = true;
  5911. this.originCanEdit = true;
  5912. this.seleChn()
  5913. } else {
  5914. this.$message({
  5915. message: res.msg,
  5916. type: "error"
  5917. });
  5918. }
  5919. },
  5920. error => {
  5921. this.$message({
  5922. message: error,
  5923. type: "error"
  5924. });
  5925. });
  5926. },
  5927. // 获取个人某天的日报 111111
  5928. getReport() {
  5929. this.http.post( this.port.report.getPort, {
  5930. date: this.workForm.createDate
  5931. },
  5932. res => {
  5933. if (res.code == "ok") {
  5934. var quanbu = 0
  5935. this.jsDay = 1
  5936. var zhi = ''
  5937. var slp = res.data.report
  5938. for(var i in slp) {
  5939. var sp = +slp[i].workingTime + 0
  5940. zhi = this.jsDay * sp
  5941. quanbu = +quanbu + zhi
  5942. }
  5943. this.jsTime = quanbu
  5944. var list = res.data;
  5945. this.report = list;
  5946. this.reportTimeType = this.report.timeType;
  5947. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5948. this.isWeekend = !this.report.isWorkDay;
  5949. this.canCancelInDialog = false;
  5950. this.hasWrittenReport = list.report.length != 0;
  5951. if(list.report.length != 0) {
  5952. var arr = [];
  5953. this.canEdit = false;
  5954. let candelete = true
  5955. for(var i in list.report) {
  5956. var flg = null
  5957. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5958. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5959. var filteredRespList = null
  5960. if (targetP.length > 0) {
  5961. var isPublic = targetP[0].isPublic;
  5962. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5963. }
  5964. let copyData = {
  5965. id: list.report[i].id,
  5966. projectId: list.report[i].projectId,
  5967. workingTime: list.report[i].workingTime,
  5968. content: list.report[i].content,
  5969. state: list.report[i].state,
  5970. timeType: list.report[i].timeType,
  5971. subProjectList: list.report[i].subProjectList,
  5972. taskList: list.report[i].taskList,
  5973. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5974. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5975. taskId: list.report[i].taskId,
  5976. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5977. startTime: list.report[i].startTime,
  5978. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5979. endTime: list.report[i].endTime,
  5980. isOvertime: flg,
  5981. progress:list.report[i].progress,
  5982. professionProgress: list.report[i].professionProgressList,
  5983. stages:list.report[i].stages,
  5984. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5985. pics: list.report[i].pics,
  5986. multiWorktime: list.report[i].multiWorktime,
  5987. worktimeList: list.report[i].worktimeList,
  5988. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5989. multiDegrIdArray: list.report[i].multiDegrIdList,
  5990. wuduList: list.report[i].degreeList,
  5991. taskGroups:list.report[i].taskGroups,
  5992. customData: list.report[i].customData,//自定义的数值
  5993. auditUserList: list.report[i].auditUserList,
  5994. overtimeHours: list.report[i].overtimeHours,
  5995. customText: list.report[i].customText,
  5996. basecostId: list.report[i].basecostId,
  5997. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5998. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5999. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6000. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6001. canEdit: list.report[i].state >= 2 ? true : false,
  6002. extraField1: list.report[i].extraField1,
  6003. extraField2: list.report[i].extraField2,
  6004. extraField3: list.report[i].extraField3,
  6005. workContentList: list.report[i].workContentList,
  6006. filteredRespList: filteredRespList,
  6007. serviceList: list.report[i].serviceList,
  6008. sapServiceId: list.report[i].sapServiceId,
  6009. reportTargetDeptId: list.report[i].deptId
  6010. }
  6011. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6012. //分组负责人审核的情况下,前端不需要显示,无需设置
  6013. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6014. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6015. }
  6016. arr.push(copyData);
  6017. if (list.report[i].state >= 2) {
  6018. this.canEdit = true;
  6019. }
  6020. if(list.report[i].state < 2){
  6021. candelete = false
  6022. }
  6023. if (list.report[i].state == 0){
  6024. this.canCancelInDialog = true
  6025. }
  6026. // 加判断
  6027. if(this.user.timeType.choseFromAlbum == 1) {
  6028. let arrList = []
  6029. for(var k in list.report[i].pics) {
  6030. let obj = {
  6031. name: k,
  6032. url: list.report[i].pics[k]
  6033. }
  6034. arrList.push(obj)
  6035. }
  6036. arr[i].imgListUrl = arrList
  6037. arr[i].imgList = list.report[i].pics
  6038. }
  6039. }
  6040. this.reportCanDelete = candelete
  6041. this.workForm = {
  6042. createDate: this.workForm.createDate,
  6043. domains: arr,
  6044. userNames:null,
  6045. userId:null,
  6046. time: list.time,
  6047. showRefresh: list.showRefresh
  6048. }
  6049. console.log('workForm', this.workForm)
  6050. } else {
  6051. this.workForm = {
  6052. createDate: this.workForm.createDate,
  6053. domains: [{
  6054. id: null,
  6055. projectId: "",
  6056. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6057. content: "",
  6058. progress:100,
  6059. state: 2,
  6060. timeType:0,
  6061. multiWorktime: this.reportTimeType.multiWorktime,
  6062. worktimeList:[{}],
  6063. canEdit: true,
  6064. auditorFirst: '',
  6065. auditorSec: '',
  6066. auditorThird: '',
  6067. ccUserid: ''
  6068. }],
  6069. userId:null,
  6070. userNames:null,
  6071. time: this.report.time,
  6072. showRefresh: list.showRefresh
  6073. }
  6074. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6075. this.$set(this.workForm.domains[0],'isOvertime',true)
  6076. if(this.reportTimeType.type != 2){
  6077. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6078. }
  6079. }
  6080. if(this.user.timeType.type == 1) {
  6081. var shuzhi = this.user.timeType.allday + ''
  6082. // console.log('执行一次', shuzhi.indexOf('.'))
  6083. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6084. }
  6085. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6086. //默认给第一个,必填字段
  6087. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6088. }
  6089. this.canEdit = true;
  6090. }
  6091. this.originCanEdit = this.canEdit;
  6092. this.seleChn()
  6093. } else {
  6094. this.$message({
  6095. message: res.msg,
  6096. type: "error"
  6097. });
  6098. }
  6099. },
  6100. error => {
  6101. this.$message({
  6102. message: error,
  6103. type: "error"
  6104. });
  6105. });
  6106. },
  6107. guanbi() {
  6108. this.falsss = false,
  6109. this.workTimeForMinYi=0
  6110. },
  6111. // 打开日报填写
  6112. fillInReport(i, isBatch) {
  6113. this.isWeekend = false
  6114. this.reportCanDelete = false
  6115. // console.log(this.user.timeType.type, '选择时长')
  6116. if(i != 1) {
  6117. this.falsss = false
  6118. } else {
  6119. this.falsss = true
  6120. }
  6121. if (this.isSubstitude) {
  6122. this.getSubstitudeUserDeptList();
  6123. }
  6124. if(i == -1 || this.isSubstitude) {
  6125. this.isDisable = false;
  6126. } else {
  6127. this.isDisable = true;
  6128. }
  6129. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6130. this.isBatch = isBatch;
  6131. if (this.isBatch == 0 && !this.isSubstitude) {
  6132. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6133. let weekday = new Date(this.workForm.createDate).getDay()
  6134. if(this.user.companyId == 817){
  6135. if(weekday == 0){
  6136. this.isWeekend = true
  6137. }
  6138. }else{
  6139. if(weekday == 0 || weekday == 6){
  6140. this.isWeekend = true
  6141. }
  6142. }
  6143. this.getReport(i);
  6144. } else {
  6145. // console.log('执行到了这里')
  6146. this.jsTime = 0
  6147. this.jsDay = 0
  6148. this.workForm = {
  6149. createDate: null,//批量填报没有日期
  6150. domains: [{
  6151. id: null,
  6152. projectId: "",
  6153. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6154. content: "",
  6155. progress:100,
  6156. state: 2,
  6157. timeType:0,
  6158. multiWorktime: this.reportTimeType.multiWorktime,
  6159. worktimeList:[{}],
  6160. canEdit: true,
  6161. }],
  6162. }
  6163. if(this.user.timeType.type == 1) {
  6164. var shuzhi = this.user.timeType.allday + ''
  6165. // console.log('执行二次')
  6166. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6167. }
  6168. // console.log(this.workForm)
  6169. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6170. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6171. }
  6172. this.canEdit = true;
  6173. }
  6174. this.dialogVisible = true;
  6175. },
  6176. //按周填报的弹窗口中编辑单项目相关数据
  6177. setWeekFormReportItem(reportId, i, names, row,sss) {
  6178. console.log(sss)
  6179. this.http.post('/report/getReportById', {
  6180. reportId: reportId
  6181. },
  6182. res => {
  6183. if (res.code == "ok") {
  6184. var data = res.data.report;
  6185. sss.subProjectId = data.subProjectId
  6186. sss.subProjectList = data.subProjectList;
  6187. sss.stage = data.stage
  6188. sss.subProjectList = data.subProjectList
  6189. sss.stages = data.stages
  6190. sss.taskGroups = data.taskGroups;
  6191. sss.auditUserList = data.auditUserList;
  6192. sss.degreeId = data.degreeId;
  6193. sss.customData = data.customData;
  6194. sss.wuduList = data.degreeList;
  6195. this.zhoBaoIdx = i
  6196. this.zhoBaoName = names
  6197. this.zhoBao = sss
  6198. this.zhis = row
  6199. if (sss.groupId) {
  6200. //最后一个参数表示是否保留stage的值,不要重置为空
  6201. this.getGroupStages(this.zhoBao, 0, true)
  6202. }
  6203. this.$forceUpdate();
  6204. }
  6205. });
  6206. },
  6207. // 按周填报里内容的填写
  6208. showWeekItemEdit(item, i, projectId,names, row) {
  6209. if (item.state == 0) {
  6210. this.$message({
  6211. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6212. type: "error"
  6213. });
  6214. return;
  6215. }
  6216. if (item.state == 1) {
  6217. this.$message({
  6218. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6219. type: "error"
  6220. });
  6221. return;
  6222. }
  6223. if(this.user.timeType.notAllowedNoAttendance == 1){
  6224. if(this.zhoData[i].corpTime){
  6225. if(this.zhoData[i].corpTime.workHours == 0){
  6226. this.$message({
  6227. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6228. type: 'error'
  6229. })
  6230. return
  6231. }
  6232. }else{
  6233. this.$message({
  6234. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6235. type: 'error'
  6236. })
  6237. return
  6238. }
  6239. }
  6240. var obj = {}
  6241. obj.projectId = projectId
  6242. this.tianxieDialogVisible = true
  6243. this.scopess = item
  6244. var sss = {}
  6245. if (item.id != null) {
  6246. sss.id = item.id;
  6247. sss.state = item.state;
  6248. } else {
  6249. sss.id = -1;
  6250. sss.state = 3;
  6251. }
  6252. sss.projectId = projectId;
  6253. sss.progress = item.progress
  6254. sss.time = item.time
  6255. sss.content = item.content;
  6256. console.log('333', sss.content)
  6257. if (sss.time == '' && this.reportTimeType.type == 2) {
  6258. //取已填时间范围中最大的一个作为开始时间
  6259. var startTime = '09:00';
  6260. var fillStartTime = '00:00';
  6261. for (var t in this.selProjectList) {
  6262. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6263. if (fillItem.time) {
  6264. if (fillItem.time[1] > fillStartTime) {
  6265. fillStartTime = fillItem.time[1];
  6266. }
  6267. }
  6268. }
  6269. if (fillStartTime == '00:00') {
  6270. fillStartTime = '09:00';
  6271. }
  6272. var fillEndMax = '18:00';
  6273. if (fillStartTime >= '18:00') {
  6274. fillEndMax = '23:59';
  6275. }
  6276. sss.time = [fillStartTime, fillEndMax];
  6277. }
  6278. sss.groupId = item.groupId
  6279. sss.stage = item.stage;
  6280. sss.workingTime = item.workingTime
  6281. sss.projectAuditorId = item.projectAuditorId;
  6282. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6283. //默认选中第一个
  6284. sss.basecostId = this.timeBasecostList[0].id;
  6285. }
  6286. var hasEdited = this.zhoData[i][names].hasEdited;
  6287. if (hasEdited) {
  6288. sss = { ...item }
  6289. //编辑过了
  6290. sss.subProjectId = item.subProjectId
  6291. sss.stage = item.stage
  6292. sss.subProjectList = item.subProjectList
  6293. sss.stages = item.stages
  6294. sss.taskGroups = item.taskGroups;
  6295. console.log(sss.taskGroups, '33333');
  6296. sss.auditUserList = obj.auditUserList;
  6297. sss.degreeId = item.degreeId;
  6298. sss.customData = item.customData;
  6299. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6300. //只有一个审核人,自动设置上去
  6301. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6302. }
  6303. sss.wuduList = item.wuduList;
  6304. this.zhoBaoIdx = i
  6305. this.zhoBaoName = names
  6306. this.zhoBao = sss
  6307. this.zhis = row
  6308. if (sss.groupId) {
  6309. //最后一个参数表示是否保留stage的值,不要重置为空
  6310. this.getGroupStages(this.zhoBao, 0, true)
  6311. }
  6312. this.$forceUpdate();
  6313. this.getWeeklyTaskList(sss)
  6314. console.log('最后的周报 ===>', this.zhoBao)
  6315. } else {
  6316. //第一次打开,获取数据
  6317. if (sss.id == -1) {
  6318. //新填报的
  6319. this.selectProject(obj, 0);
  6320. var that = this
  6321. setTimeout(() =>{
  6322. sss.subProjectId = that.workForm.domains[0].subProjectId
  6323. sss.subProjectList = item.subProjectList;
  6324. sss.stage = that.workForm.domains[0].stage
  6325. sss.subProjectList = that.workForm.domains[0].subProjectList
  6326. sss.stages = that.workForm.domains[0].stages
  6327. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6328. sss.auditUserList = obj.auditUserList;
  6329. sss.degreeId = item.degreeId;
  6330. sss.customData = item.customData;
  6331. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6332. //只有一个审核人,自动设置上去
  6333. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6334. }
  6335. sss.wuduList = row[0].wuduList
  6336. that.zhoBaoIdx = i
  6337. that.zhoBaoName = names
  6338. that.zhoBao = sss
  6339. that.zhis = row
  6340. if (sss.groupId) {
  6341. //最后一个参数表示是否保留stage的值,不要重置为空
  6342. this.getGroupStages(that.zhoBao, 0, false)
  6343. }
  6344. that.$forceUpdate();
  6345. this.getWeeklyTaskList(sss)
  6346. },600);
  6347. } else {
  6348. //编辑填报过的;数据库已经存在的
  6349. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6350. }
  6351. }
  6352. },
  6353. // 按周填报里内容的填写点击确定
  6354. setWeekProItemData() {
  6355. //专业版模式下,任务分组和阶段必填
  6356. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6357. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6358. this.$message({
  6359. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6360. type: "error"
  6361. });
  6362. return;
  6363. }
  6364. }
  6365. // 检查任务分组
  6366. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6367. this.$message({
  6368. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6369. type: "error"
  6370. });
  6371. return
  6372. }
  6373. //检查子项目是否必填
  6374. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6375. this.$message({
  6376. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6377. type: "error"
  6378. });
  6379. return;
  6380. }
  6381. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6382. this.$message({
  6383. message: this.$t('message.Pleaseselectareviewer'),
  6384. type: "error"
  6385. });
  6386. return
  6387. }
  6388. if(this.user.timeType.reportAuditType == 3){
  6389. let auditTips = ''
  6390. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6391. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6392. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6393. if(auditTips){
  6394. auditTips = auditTips.substring(0,auditTips.length - 1)
  6395. this.$message({
  6396. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6397. type: 'error'
  6398. })
  6399. return
  6400. }
  6401. }
  6402. let errtips = ''
  6403. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6404. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6405. errtips += this.user.timeType.customDegreeName + '、'
  6406. }
  6407. }
  6408. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6409. errtips += this.user.timeType.customDataName + '、'
  6410. }
  6411. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6412. errtips += this.user.timeType.customTextName + '、'
  6413. }
  6414. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6415. errtips += this.$t('other.workMatters') +'、'
  6416. }
  6417. if(errtips){
  6418. errtips = errtips.substring(0,errtips.length - 1)
  6419. this.$message({
  6420. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6421. type: 'error'
  6422. })
  6423. return
  6424. }
  6425. this.tianxieDialogVisible = false
  6426. var zhong = this.zhoData
  6427. this.zhoBao.hasEdited = true;
  6428. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6429. this.zhoData = zhong
  6430. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6431. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6432. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6433. },
  6434. // 获取本周
  6435. getCurrentWeek() {
  6436. //今天
  6437. this.targetWeekDate = new Date();
  6438. this.initWeekFormData();
  6439. // this.jiazai()
  6440. },
  6441. // 获取上周
  6442. handleGetPrevWeek() {
  6443. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6444. this.initWeekFormData();
  6445. // this.jiazai()
  6446. },
  6447. // 获取下周
  6448. handleGetNextvWeek() {
  6449. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6450. this.initWeekFormData()
  6451. },
  6452. // 加载动画
  6453. jiazai() {
  6454. this.weekDataLoading = true
  6455. var that = this
  6456. setTimeout(() =>{
  6457. that.weekDataLoading = false
  6458. },1000);
  6459. },
  6460. // 转时间格式
  6461. dealdate(date) {
  6462. const dt = new Date(date)
  6463. const y = dt.getFullYear()
  6464. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6465. const d = (dt.getDate() + '').padStart(2, '0')
  6466. return `${y}-${m}-${d}`
  6467. },
  6468. // 按周填报
  6469. fillInReportss() {
  6470. window.addEventListener('scroll', this.handleScroll, true)
  6471. // this.jiazai()
  6472. this.fillWeekDialogVisi = true;
  6473. if (this.isSubstitude) {
  6474. this.substitudeStep = 1;
  6475. this.getSubstitudeUserDeptList();
  6476. } else {
  6477. this.getCurrentWeek();
  6478. }
  6479. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6480. //重新获取工时预警类型的预算项
  6481. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6482. companyId: this.user.companyId
  6483. },
  6484. res => {
  6485. if (res.code == "ok") {
  6486. this.timeBasecostList = res.data;
  6487. }
  6488. });
  6489. }
  6490. },
  6491. fillInReportCustom() {
  6492. this.weekIndex++
  6493. this.weekParentData = {
  6494. isSubstitude: this.isSubstitude
  6495. }
  6496. this.fillWeekDialogVisiCustom = true
  6497. },
  6498. // 按周填报的项目筛选
  6499. selListFun(){
  6500. this.selProjectList = []
  6501. if(this.selCon.length){
  6502. for (let i = 0; i < this.selCon.length; i++) {
  6503. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6504. }
  6505. this.selConShow = false ;
  6506. for (let i in this.zhoData) {
  6507. var obj = this.zhoData[i];
  6508. for(var j in this.selProjectList) {
  6509. var xinzhi = this.selProjectList[j].projectName
  6510. obj[xinzhi] = {}
  6511. obj[xinzhi].time = ''
  6512. obj[xinzhi].content = ''
  6513. obj[xinzhi].progress = 0
  6514. obj[xinzhi].workingTime = 0
  6515. }
  6516. }
  6517. this.initWeekFormData();
  6518. }else{
  6519. this.$message({
  6520. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6521. type:'error'
  6522. })
  6523. }
  6524. },
  6525. setWeekCardTimeData(list) {
  6526. for(let i in list){
  6527. let datei = '';
  6528. if (this.user.timeType.showDdCardtime == 1) {
  6529. datei = list[i].workDate;
  6530. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6531. datei = list[i].createDate;
  6532. } else if (this.user.timeType.syncFanwei == 1) {
  6533. datei = list[i].workDate;
  6534. }
  6535. for(let m in this.zhoData) {
  6536. if(datei == this.zhoData[m].zhoDataTime){
  6537. let item = {
  6538. startTime: list[i].startTime,
  6539. endTime: list[i].endTime,
  6540. workHours: list[i].workHours
  6541. }
  6542. this.$set(this.zhoData[m],'corpTime',item)
  6543. }
  6544. }
  6545. }
  6546. },
  6547. getWeeklyCardTime(){ //按周填报获取考勤信息
  6548. let dateStr = []
  6549. for(let i in this.zhoData){
  6550. dateStr.push(this.zhoData[i].zhoDataTime)
  6551. }
  6552. this.http.post('/report/getWeeklyCardTime',{
  6553. dateStr: JSON.stringify(dateStr)
  6554. },res => {
  6555. if(res.code == 'ok'){
  6556. for(let i in res.data){
  6557. let datei = '';
  6558. if (this.user.timeType.showDdCardtime == 1) {
  6559. datei = res.data[i].workDate.split('-');
  6560. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6561. datei = res.data[i].createDate.split('-');
  6562. }
  6563. for(let m in this.zhoData){
  6564. let datem = new Date(this.zhoData[m].zhoDataTime)
  6565. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6566. let item = {
  6567. startTime: res.data[i].startTime,
  6568. endTime: res.data[i].endTime,
  6569. workHours: res.data[i].workHours
  6570. }
  6571. this.$set(this.zhoData[m],'corpTime',item)
  6572. }
  6573. }
  6574. }
  6575. }else{
  6576. this.$message({
  6577. message: res.msg,
  6578. type: 'error'
  6579. })
  6580. }
  6581. },err => {
  6582. this.$message({
  6583. message: err,
  6584. type: 'error'
  6585. })
  6586. })
  6587. },
  6588. selListqx(){
  6589. this.fillWeekDialogVisi = false
  6590. this.selProjectList = []
  6591. this.selCon = []
  6592. },
  6593. handleScroll() {
  6594. this.changdu = this.projectList.length + 1
  6595. },
  6596. // 自动选择时间点的事件
  6597. // async zhoTimes(item, i) {
  6598. // var iss = i
  6599. // if(item.time == null) {
  6600. // return
  6601. // } else {
  6602. // const zhi = this.zhoData[iss];
  6603. // let he = 0;
  6604. // const timeArr = Object.values(zhi)
  6605. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6606. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6607. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6608. // console.log(data, 'data');
  6609. // zhi.he = `${he}h`;
  6610. // }
  6611. // },
  6612. async zhoTimes(item, index) {
  6613. const zho = this.zhoData[index];
  6614. if (!item.time) {
  6615. return;
  6616. }
  6617. const timeArr = Object.values(zho)
  6618. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6619. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6620. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6621. zho.he = `${totalHours[0]}h`;
  6622. },
  6623. // 判断两个时间段是否重叠
  6624. timeOverlap(idx, dateAr) {
  6625. let zhi = 0
  6626. for (let k in dateAr) {
  6627. if (idx !== k) {
  6628. 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))) {
  6629. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6630. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6631. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6632. }
  6633. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6634. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6635. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6636. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6637. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6638. } else {
  6639. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6640. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6641. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6642. }
  6643. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6644. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6645. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6646. }
  6647. }
  6648. }
  6649. }
  6650. }
  6651. return zhi
  6652. },
  6653. // 计算时间
  6654. getHourMinutes(str, end) {
  6655. var he = 0
  6656. var date2 = '2021/12/12 ' + end +':00'
  6657. var date1 = '2021/12/12 ' + str +':00'
  6658. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6659. var leave1=date3%(24*3600*1000)
  6660. var hours=Math.floor(leave1/(3600*1000))
  6661. var leave2=leave1%(3600*1000)
  6662. var minutes=Math.floor(leave2/(60*1000))
  6663. var shi = hours+'.'+ minutes
  6664. return he += +shi
  6665. },
  6666. // 自动选择事件长度的事件
  6667. zhoXuan(item, i) {
  6668. var iss = i
  6669. if(item.time == null) {
  6670. return
  6671. } else {
  6672. var zhi = this.zhoData[iss]
  6673. var he = 0
  6674. for(var i in zhi) {
  6675. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6676. he += +zhi[i].workingTime
  6677. }
  6678. }
  6679. zhi.he = he + 'h'
  6680. }
  6681. },
  6682. getPushWorkLogData(){
  6683. this.http.post('/sap-sync-log/list', {},
  6684. res => {
  6685. if (res.code == "ok") {
  6686. this.pushWorkTimeLogData = res.data;
  6687. } else {
  6688. this.$message({
  6689. message: res.msg,
  6690. type: "error"
  6691. });
  6692. }
  6693. },
  6694. error => {
  6695. this.$message({
  6696. message: error,
  6697. type: "error"
  6698. });
  6699. });
  6700. },
  6701. // 获取全部人员
  6702. getUsers() {
  6703. this.http.post('/user/getSimpleActiveUserList', {},
  6704. res => {
  6705. if (res.code == "ok") {
  6706. this.usersList = res.data;
  6707. } else {
  6708. this.$message({
  6709. message: res.msg,
  6710. type: "error"
  6711. });
  6712. }
  6713. },
  6714. error => {
  6715. this.$message({
  6716. message: error,
  6717. type: "error"
  6718. });
  6719. });
  6720. },
  6721. // 按时间比例
  6722. addBli(item, i) {
  6723. var iss = i
  6724. if(item.time == null) {
  6725. return
  6726. } else {
  6727. var zhi = this.zhoData[iss]
  6728. var he = 0
  6729. for(var i in zhi) {
  6730. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6731. he += +zhi[i].workingTime
  6732. }
  6733. }
  6734. zhi.he = he.toFixed(1) + 'h'
  6735. }
  6736. },
  6737. //按周填报选择的项目发生变化,需要设置列
  6738. onSelProjectChange() {
  6739. for (let i = 0; i < this.selCon.length; i++) {
  6740. var exists = false;
  6741. for (let j = 0; j < this.selProjectList.length; j++) {
  6742. if (this.selProjectList[j].id == this.selCon[i]) {
  6743. exists = true;
  6744. break;
  6745. }
  6746. }
  6747. if (!exists) {
  6748. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6749. this.selProjectList.push(newProject);
  6750. //添加新项目
  6751. for (var w in this.zhoData) {
  6752. var dayItem = this.zhoData[w];
  6753. var pName = newProject.projectName;
  6754. dayItem[pName] = {};
  6755. dayItem[pName].time = ''
  6756. dayItem[pName].content = ''
  6757. dayItem[pName].progress = 0
  6758. dayItem[pName].workingTime = 0
  6759. }
  6760. }
  6761. }
  6762. //去掉
  6763. for (let j = 0; j < this.selProjectList.length; j++) {
  6764. var exists = false;
  6765. for (let i = 0; i < this.selCon.length; i++) {
  6766. if (this.selProjectList[j].id == this.selCon[i]) {
  6767. exists = true;
  6768. break;
  6769. }
  6770. }
  6771. if (!exists) {
  6772. this.selProjectList.splice(j, 1);
  6773. j--;
  6774. }
  6775. }
  6776. this.loadFilledWeekReportItem();
  6777. //刷新表格
  6778. // this.$refs.weekTable.doLayout();
  6779. },
  6780. //根据选中的项目来刷新填写表格
  6781. loadFilledWeekReportItem() {
  6782. for (var w in this.zhoData) {
  6783. var dayItem = this.zhoData[w];
  6784. for (var i = 0; i < this.selProjectList.length; i++) {
  6785. var curColumnProject = this.selProjectList[i];
  6786. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6787. for (var t in dayItem.reportList) {
  6788. //有日报的项目,不能取消选择
  6789. for (var p in this.fillProjectList) {
  6790. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6791. }
  6792. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6793. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6794. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6795. if (this.reportTimeType.type == 2) {
  6796. //时间段模式
  6797. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6798. }
  6799. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6800. break;
  6801. }
  6802. }
  6803. // dayItem[curColumnProject.projectName] = matchReportItem;
  6804. }
  6805. }
  6806. this.$nextTick(()=>{
  6807. this.$refs.weekTable.doLayout();
  6808. });
  6809. },
  6810. initWeekFormData() {
  6811. this.weekDataLoading = true;
  6812. for (var p in this.fillProjectList) {
  6813. this.fillProjectList[p].canCancel = 1;
  6814. }
  6815. var param = {
  6816. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6817. };
  6818. if (this.isSubstitude) {
  6819. //传代填人的userId
  6820. param.targetUserId = this.workForm.userId[0];
  6821. }
  6822. this.http.post('/report/getWeeklyReportData',param,res => {
  6823. this.weekDataLoading = false;
  6824. if(res.code == 'ok'){
  6825. let projectList = res.data.projectList;
  6826. if (projectList.length > 0) {
  6827. //有选择过项目进行填报,直接选中
  6828. this.selProjectList = projectList;
  6829. this.selCon = [];
  6830. for (let i = 0; i < projectList.length; i++) {
  6831. this.selCon.push(projectList[i].id);
  6832. }
  6833. }
  6834. //设置日期
  6835. this.weekDateRange = res.data.dateList;
  6836. this.zhoData = [];
  6837. var arrst = []
  6838. for(var i in this.weekDateRange) {
  6839. var obj = {}
  6840. obj.zhoDataTime = this.weekDateRange[i].date
  6841. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6842. obj.he = this.weekDateRange[i].filledTime;
  6843. obj.canFill = this.weekDateRange[i].canFill;
  6844. // obj.filledTime = this.weekDateRange[i].filledTime;
  6845. obj.reportList = this.weekDateRange[i].reportList;
  6846. //初始化,防止渲染报错
  6847. for (var j = 0; j < this.selProjectList.length; j++) {
  6848. var pName = this.selProjectList[j].projectName
  6849. obj[pName] = {}
  6850. obj[pName].time = ''
  6851. obj[pName].content = ''
  6852. obj[pName].progress = 0
  6853. obj[pName].workingTime = 0
  6854. }
  6855. arrst.push(obj)
  6856. }
  6857. this.zhoData = arrst
  6858. this.setWeekCardTimeData(res.data.cardTimeList);
  6859. this.loadFilledWeekReportItem();
  6860. }else{
  6861. this.$message({
  6862. message: res.msg,
  6863. type: 'error'
  6864. })
  6865. }
  6866. },err => {
  6867. this.$message({
  6868. message: err,
  6869. type: 'error'
  6870. })
  6871. })
  6872. },
  6873. zhoZhi(res, i) {
  6874. var zhi = 0
  6875. for(var i in res) {
  6876. if(i != 'zhoDataTime' && i != 'he') {
  6877. zhi += +res[i]
  6878. }
  6879. }
  6880. res.he = zhi
  6881. },
  6882. zhoBtn(i) {
  6883. // this.zhoData.split(i, 1)
  6884. var arr = this.zhoData
  6885. arr.splice(i, 1)
  6886. },
  6887. zhoAddlast(){
  6888. this.selConShow = true
  6889. },
  6890. closeAddWeeklyReport(){
  6891. this.fillWeekDialogVisi = false
  6892. this.selConShow = true
  6893. this.selProjectList = []
  6894. this.selCon = []
  6895. },
  6896. checkDateWorkTime() {
  6897. //针对苏州景昱,单独的检查逻辑
  6898. if (this.user.companyId == 5978) {
  6899. //调接口,先检查工时是否存在异常
  6900. var zhi = this.zhoData;
  6901. var array = [];
  6902. for(let n in zhi){
  6903. if(zhi[n].he){
  6904. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  6905. array.push(workData)
  6906. }
  6907. }
  6908. this.submitingReport = true;
  6909. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  6910. res => {
  6911. this.submitingReport = false;
  6912. if (res.code == "ok") {
  6913. this.submitWeekReport(0)
  6914. } else {
  6915. this.$confirm(res.msg, this.$t('other.prompts'), {
  6916. confirmButtonText: this.$t('huLveBingTiJiao'),
  6917. cancelButtonText: this.$t('btn.cancel'),
  6918. type: 'error'
  6919. }).then(() => {
  6920. this.submitWeekReport(0)
  6921. }).catch(() => {
  6922. });
  6923. }
  6924. },
  6925. error => {
  6926. this.$message({
  6927. message: error,
  6928. type: "error"
  6929. });
  6930. });
  6931. }
  6932. },
  6933. // 提交按周填报
  6934. submitWeekReport(isDraft) {
  6935. var zhi = this.zhoData
  6936. var ll = 0
  6937. if(this.reportTimeType.type == 2) {
  6938. for(var i in zhi) {
  6939. this.dateAr = []
  6940. var alp = []
  6941. var zhis = zhi[i]
  6942. console.log(zhis)
  6943. for(var j in zhis) {
  6944. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6945. let objs = {}
  6946. objs.s = zhis[j].time[0]
  6947. objs.e = zhis[j].time[1]
  6948. objs.p = j
  6949. alp.push(objs)
  6950. }
  6951. }
  6952. console.log(alp)
  6953. this.dateAr = alp
  6954. if (this.reportTimeType.timeCanOverlap == 0) {
  6955. let str = this.$t('message.Filledtimeperiodsoverlap')
  6956. if(this.dateAr.length > 0) {
  6957. const trus = this.fns();
  6958. const overlapDataTime = this.getOverlapData(alp);
  6959. if (overlapDataTime.length > 0) {
  6960. const arrList = overlapDataTime.map((item) => item.p);
  6961. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6962. }
  6963. ll += 1
  6964. if(!trus) {
  6965. this.$message({
  6966. message: str,
  6967. type: 'error'
  6968. })
  6969. return false
  6970. }
  6971. }
  6972. } else {
  6973. if(this.dateAr.length > 0) {
  6974. ll +=1 ;
  6975. }
  6976. }
  6977. }
  6978. if(ll == 0) {
  6979. this.$message({
  6980. message: this.$t('message.Pleasefillinthetime'),
  6981. type: 'error'
  6982. })
  6983. return false
  6984. }
  6985. } else if(this.reportTimeType.type == 1){
  6986. for(var i in zhi) {
  6987. var zhis = zhi[i]
  6988. for(var j in zhis) {
  6989. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6990. ll += 1
  6991. }
  6992. }
  6993. }
  6994. if(ll == 0) {
  6995. this.$message({
  6996. message: this.$t('message.Pleaseselectatime'),
  6997. type: 'error'
  6998. })
  6999. return false
  7000. }
  7001. let overcorp = ''
  7002. for(let n in zhi){
  7003. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7004. overcorp += zhi[n].zhoDataTime + ','
  7005. }
  7006. }
  7007. if(this.user.companyId != 5978 && overcorp != ''){
  7008. overcorp = overcorp.substring(0,overcorp.length - 1)
  7009. this.$message({
  7010. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7011. type: 'error'
  7012. })
  7013. return
  7014. }
  7015. }
  7016. var submits = []
  7017. let formData = new FormData();
  7018. formData.append("draft", isDraft);
  7019. if(this.reportTimeType.multiWorktime == 1){
  7020. for (var i in this.zhoData) {
  7021. var zhoD = this.zhoData[i]
  7022. var flgs = false
  7023. for(var j in zhoD) {
  7024. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7025. flgs = true
  7026. // formData.append("degreeId", "-1");
  7027. formData.append("id", '-1');
  7028. if (this.isSubstitude) {
  7029. formData.append('targetUids',this.workForm.userId[0]);
  7030. }
  7031. for(var s in this.projectList) {
  7032. if(j == this.projectList[s].projectName) {
  7033. formData.append("projectId", this.projectList[s].id);
  7034. }
  7035. }
  7036. if(this.user.timeType.reportAuditType == 3){
  7037. let audItem = {}
  7038. if(this.user.timeType.auditLevel > 0){
  7039. audItem.auditorFirst = zhoD[j].auditorFirst
  7040. }
  7041. if(this.user.timeType.auditLevel > 1){
  7042. audItem.auditorSec = zhoD[j].auditorSec
  7043. }
  7044. if(this.user.timeType.auditLevel > 2){
  7045. audItem.auditorThird = zhoD[j].auditorThird
  7046. }
  7047. if(zhoD[j].ccUserid){
  7048. audItem.ccUserid = zhoD[j].ccUserid
  7049. }
  7050. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7051. }
  7052. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7053. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7054. formData.append("reportTimeType", this.reportTimeType.type);
  7055. formData.append("endTime", '');
  7056. formData.append("startTime", '');
  7057. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7058. var lix = []
  7059. var objjs = {}
  7060. objjs.startTime = zhoD[j].time[0]
  7061. objjs.endTime = zhoD[j].time[1]
  7062. if (zhoD[j].content == null || zhoD[j].content == '') {
  7063. zhoD[j].content == '-'
  7064. }
  7065. objjs.content = zhoD[j].content
  7066. lix.push(objjs)
  7067. var zhiZhi = JSON.stringify(lix)
  7068. zhiZhi = zhiZhi.replace(/,/g,"@");
  7069. formData.append("content", zhiZhi)
  7070. formData.append("isOvertime", 0)
  7071. formData.append("professionProgress", "[]")
  7072. if (zhoD[j].groupId) {
  7073. formData.append("groupId",zhoD[j].groupId)
  7074. } else {
  7075. //解决后台groupId数组越界的问题
  7076. formData.append("groupId",0)
  7077. }
  7078. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7079. formData.append("createDate",zhoD.zhoDataTime)
  7080. if (zhoD[j].projectAuditorId) {
  7081. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7082. }
  7083. if(zhoD[j].basecostId) {
  7084. formData.append("basecostId", zhoD[j].basecostId);
  7085. } else {
  7086. formData.append("basecostId", 0);
  7087. }
  7088. if(this.user.timeType.customDegreeActive){
  7089. if (this.user.timeType.customDegreeMultiple) {
  7090. if (zhoD[j].multiDegrIdArray) {
  7091. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7092. } else {
  7093. formData.append('multiDegrId','[]')
  7094. }
  7095. } else {
  7096. if (zhoD[j].degreeId) {
  7097. formData.append('degreeId',zhoD[j].degreeId)
  7098. } else {
  7099. formData.append('degreeId','-1')
  7100. }
  7101. }
  7102. }else{
  7103. formData.append("degreeId", "-1");
  7104. }
  7105. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7106. formData.append('customData',zhoD[j].customData)
  7107. }else if(this.user.timeType.customDataActive){
  7108. formData.append('customData',0)
  7109. }
  7110. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7111. formData.append('customText',zhoD[j].customText)
  7112. }else if(this.user.timeType.customTextActive){
  7113. formData.append('customText','-')
  7114. }
  7115. }
  7116. }
  7117. }
  7118. } else {
  7119. for (var i in this.zhoData) {
  7120. var zhoD = this.zhoData[i]
  7121. var flgs = false
  7122. if(this.reportTimeType.type == 2) {
  7123. for(var k in this.selProjectList) {
  7124. var pItem = this.selProjectList[k];
  7125. var pName = pItem.projectName;
  7126. var j = pName;
  7127. console.log('j==周报中的项目='+j);
  7128. if(zhoD[j].time && zhoD[j].time != 'null') {
  7129. flgs = true
  7130. // formData.append("degreeId", "-1");
  7131. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7132. if (this.isSubstitude) {
  7133. formData.append('targetUids',this.workForm.userId[0]);
  7134. }
  7135. for(var s in this.projectList) {
  7136. if(j == this.projectList[s].projectName) {
  7137. formData.append("projectId", this.projectList[s].id);
  7138. }
  7139. }
  7140. if(this.user.timeType.reportAuditType == 3){
  7141. let audItem = {}
  7142. if(this.user.timeType.auditLevel > 0){
  7143. audItem.auditorFirst = zhoD[j].auditorFirst
  7144. }
  7145. if(this.user.timeType.auditLevel > 1){
  7146. audItem.auditorSec = zhoD[j].auditorSec
  7147. }
  7148. if(this.user.timeType.auditLevel > 2){
  7149. audItem.auditorThird = zhoD[j].auditorThird
  7150. }
  7151. if(zhoD[j].ccUserid){
  7152. audItem.ccUserid = zhoD[j].ccUserid
  7153. }
  7154. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7155. }
  7156. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7157. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7158. formData.append("reportTimeType", this.reportTimeType.type);
  7159. formData.append("endTime", zhoD[j].time[1]);
  7160. formData.append("startTime", zhoD[j].time[0]);
  7161. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7162. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7163. formData.append("isOvertime", 0)
  7164. formData.append("professionProgress", "[]")
  7165. if (zhoD[j].groupId) {
  7166. formData.append("groupId",zhoD[j].groupId)
  7167. } else {
  7168. //解决后台groupId数组越界的问题
  7169. formData.append("groupId",0)
  7170. }
  7171. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7172. formData.append("createDate",zhoD.zhoDataTime)
  7173. if (zhoD[j].projectAuditorId) {
  7174. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7175. }
  7176. if(zhoD[j].basecostId) {
  7177. formData.append("basecostId", zhoD[j].basecostId);
  7178. } else {
  7179. formData.append("basecostId", 0);
  7180. }
  7181. if(this.user.timeType.customDegreeActive){
  7182. if (this.user.timeType.customDegreeMultiple) {
  7183. if (zhoD[j].multiDegrIdArray) {
  7184. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7185. } else {
  7186. formData.append("multiDegrId", "[]");
  7187. }
  7188. } else {
  7189. if (zhoD[j].degreeId) {
  7190. formData.append('degreeId',zhoD[j].degreeId)
  7191. } else {
  7192. formData.append("degreeId", "-1");
  7193. }
  7194. }
  7195. }else{
  7196. formData.append("degreeId", "-1");
  7197. }
  7198. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7199. formData.append('customData',zhoD[j].customData)
  7200. }else if(this.user.timeType.customDataActive){
  7201. formData.append('customData',0)
  7202. }
  7203. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7204. formData.append('customText',zhoD[j].customText)
  7205. }else if(this.user.timeType.customTextActive){
  7206. formData.append('customText','-')
  7207. }
  7208. }
  7209. }
  7210. } else {
  7211. for(var k in this.selProjectList) {
  7212. var pItem = this.selProjectList[k];
  7213. var pName = pItem.projectName;
  7214. var j = pName;
  7215. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7216. flgs = true
  7217. // formData.append("degreeId", "-1");
  7218. console.log('进入了workFpppp==='+j);
  7219. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7220. if (this.isSubstitude) {
  7221. formData.append('targetUids',this.workForm.userId[0]);
  7222. }
  7223. for(var s in this.projectList) {
  7224. if(j == this.projectList[s].projectName) {
  7225. formData.append("projectId", this.projectList[s].id);
  7226. }
  7227. }
  7228. if(this.user.timeType.reportAuditType == 3){
  7229. let audItem = {}
  7230. if(this.user.timeType.auditLevel > 0){
  7231. audItem.auditorFirst = zhoD[j].auditorFirst
  7232. }
  7233. if(this.user.timeType.auditLevel > 1){
  7234. audItem.auditorSec = zhoD[j].auditorSec
  7235. }
  7236. if(this.user.timeType.auditLevel > 2){
  7237. audItem.auditorThird = zhoD[j].auditorThird
  7238. }
  7239. if(zhoD[j].ccUserid){
  7240. audItem.ccUserid = zhoD[j].ccUserid
  7241. }
  7242. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7243. }
  7244. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7245. // formData.append("subProjectId", zhoD[j].subProjectId);
  7246. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7247. formData.append("reportTimeType", this.reportTimeType.type);
  7248. if(this.reportTimeType.type == 1) {
  7249. formData.append("workingTime", zhoD[j].workingTime);
  7250. } else if(this.reportTimeType.type == 2) {
  7251. formData.append("endTime", zhoD[j].time[1]);
  7252. formData.append("startTime", zhoD[j].time[0]);
  7253. } else if(this.reportTimeType.type == 3) {
  7254. formData.append("progress", zhoD[j].progress);
  7255. formData.append("workingTime", zhoD[j].workingTime);
  7256. }
  7257. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7258. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7259. formData.append("isOvertime", 0)
  7260. formData.append("professionProgress", "[]")
  7261. if (zhoD[j].groupId) {
  7262. formData.append("groupId",zhoD[j].groupId)
  7263. } else {
  7264. //解决后台groupId数组越界的问题
  7265. formData.append("groupId",0)
  7266. }
  7267. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7268. formData.append("createDate",zhoD.zhoDataTime)
  7269. if (zhoD[j].projectAuditorId) {
  7270. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7271. }
  7272. if(zhoD[j].basecostId) {
  7273. formData.append("basecostId", zhoD[j].basecostId);
  7274. } else {
  7275. formData.append("basecostId", 0);
  7276. }
  7277. if(this.user.timeType.customDegreeActive){
  7278. if (this.user.timeType.customDegreeMultiple) {
  7279. if (zhoD[j].multiDegrIdArray) {
  7280. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7281. } else {
  7282. formData.append("multiDegrId", "[]");
  7283. }
  7284. } else {
  7285. if (zhoD[j].degreeId) {
  7286. formData.append('degreeId',zhoD[j].degreeId)
  7287. } else {
  7288. formData.append("degreeId", "-1");
  7289. }
  7290. }
  7291. }else{
  7292. formData.append("degreeId", "-1");
  7293. }
  7294. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7295. formData.append('customData',zhoD[j].customData)
  7296. }else if(this.user.timeType.customDataActive){
  7297. formData.append('customData',0)
  7298. }
  7299. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7300. formData.append('customText',zhoD[j].customText)
  7301. }else if(this.user.timeType.customTextActive){
  7302. formData.append('customText','-')
  7303. }
  7304. }
  7305. }
  7306. }
  7307. }
  7308. }
  7309. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7310. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7311. if(!next) {
  7312. this.$message({
  7313. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7314. type: 'error'
  7315. })
  7316. return
  7317. }
  7318. // 自定义维度
  7319. this.submitingReport = true;
  7320. this.http.uploadFile( this.port.report.editPort, formData,
  7321. res => {
  7322. // this.listLoading = false;
  7323. this.submitingReport = false;
  7324. if (res.code == "ok") {
  7325. this.$message({
  7326. message: this.$t('message.fillinsuccessfully'),
  7327. type: "success"
  7328. });
  7329. this.fillWeekDialogVisi = false
  7330. this.selConShow = true
  7331. this.zhoData = []
  7332. this.weekDateRange = ''
  7333. this.getReportList();
  7334. this.getDepartment();
  7335. // 关闭弹窗 并 清空
  7336. this.selProjectList = []
  7337. this.selCon = []
  7338. this.getRecentlyProject()
  7339. } else {
  7340. this.$message({
  7341. message: res.msg,
  7342. type: "error"
  7343. });
  7344. }
  7345. },
  7346. error => {
  7347. this.submitingReport = false;
  7348. this.$message({
  7349. message: error,
  7350. type: "error"
  7351. });
  7352. });
  7353. },
  7354. handleGroupAuditorData(data) {
  7355. const { reportAuditType } = this.user.timeType
  7356. if(reportAuditType != 1 && reportAuditType != 2) {
  7357. return {next: true}
  7358. }
  7359. let arrList = [];
  7360. Object.entries(data).forEach(([key, obj]) => {
  7361. Object.entries(obj).forEach(([projectName, projectData]) => {
  7362. if (projectData.workingTime && !projectData.groupId) {
  7363. arrList.push({
  7364. projectName,
  7365. date: obj.zhoDataTime,
  7366. dateText: obj.zhoDataTimeTxt
  7367. });
  7368. }
  7369. });
  7370. });
  7371. if(arrList.length > 0) {
  7372. return {
  7373. next: false,
  7374. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7375. }
  7376. } else {
  7377. return {
  7378. next: true,
  7379. error: [],
  7380. }
  7381. }
  7382. },
  7383. ChangeHourMinutestr (str) {
  7384. if (str !== "0" && str !== "" && str !== null) {
  7385. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7386. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7387. } else {
  7388. return "";
  7389. }
  7390. },
  7391. // 得到两个日期中间的日期
  7392. getdiffdate(stime,etime){
  7393. //初始化日期列表,数组
  7394. var diffdate = new Array();
  7395. var i=0;
  7396. //开始日期小于等于结束日期,并循环
  7397. while(stime<=etime){
  7398. diffdate[i] = stime;
  7399. //获取开始日期时间戳
  7400. var stime_ts = new Date(stime).getTime();
  7401. //增加一天时间戳后的日期
  7402. var next_date = stime_ts + (24*60*60*1000);
  7403. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7404. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7405. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7406. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7407. stime = next_dates_y+next_dates_m+next_dates_d;
  7408. //增加数组key
  7409. i++;
  7410. }
  7411. return diffdate;
  7412. },
  7413. // 添加模块
  7414. addDomain(i) {
  7415. var leftProgress = 10;
  7416. if (this.reportTimeType.type == 3) {
  7417. //计算已经待分配工时比例
  7418. let array = this.workForm.domains;
  7419. let totalProgress = 0;
  7420. for (var i=0;i<array.length; i++) {
  7421. totalProgress += array[i].progress;
  7422. }
  7423. if (totalProgress < 100) {
  7424. leftProgress = 100 - totalProgress;
  7425. }
  7426. }
  7427. var addItem = {
  7428. projectId: "",
  7429. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7430. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7431. ),
  7432. content: "",
  7433. progress:leftProgress,
  7434. state:2,//2-表示待提交
  7435. multiWorktime: this.reportTimeType.multiWorktime,
  7436. worktimeList:[{}],
  7437. canEdit: true,
  7438. auditorFirst: '',
  7439. auditorSec: '',
  7440. auditorThird: '',
  7441. ccUserid: ''
  7442. // degreeId: '',
  7443. };
  7444. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7445. this.$set(addItem,'isOvertime',true)
  7446. if(this.reportTimeType.type == 3){
  7447. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7448. }
  7449. }
  7450. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7451. //默认给第一个,必填字段
  7452. addItem.basecostId = this.timeBasecostList[0].id;
  7453. }
  7454. this.workForm.domains.push(addItem);
  7455. document.getElementById('workFormsItemBottom').scrollIntoView()
  7456. this.canEdit = true
  7457. if (this.reportTimeType.type == 0) {
  7458. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7459. var length = this.workForm.domains.length;
  7460. if (length == 2) {
  7461. this.showAddMore = false;
  7462. }
  7463. }
  7464. this.chuji()
  7465. this.seleChn()
  7466. },
  7467. // 移除模块
  7468. delDomain(i) {
  7469. this.workForm.domains.splice(i,1)
  7470. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7471. if (!this.originCanEdit) {
  7472. let iscan = false
  7473. for(let i in this.workForm.domains){
  7474. if(this.workForm.domains[i].canEdit){
  7475. iscan = true
  7476. }
  7477. }
  7478. this.canEdit = iscan
  7479. }
  7480. //检测当前剩下的一个,时间类型是否是全天
  7481. if (this.reportTimeType.type == 0) {
  7482. if (this.workForm.domains[0].timeType == 0) {
  7483. this.showAddMore = false;
  7484. } else {
  7485. this.showAddMore = true;
  7486. }
  7487. }
  7488. if(this.user.timeType.multiWorktime == 1) {
  7489. this.iptChangs()
  7490. } else {
  7491. this.seleChn(0)
  7492. }
  7493. },
  7494. // 改变月份
  7495. changeMonth() {
  7496. this.isWeekend = false
  7497. let date = new Date()
  7498. let nowmon = date.getMonth() + 1
  7499. let nowday = date.getDate()
  7500. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7501. if (this.isBatch == 0) {
  7502. if(this.user.timeType.fillAhead == 0){
  7503. let date_a = new Date(this.workForm.createDate)
  7504. if(date_a.getTime() > date.getTime()){
  7505. this.workForm.createDate = nowdate
  7506. }
  7507. }
  7508. //只有按天填报才能获取当天的日报
  7509. if(!this.isSubstitude){
  7510. let weekday = new Date(this.workForm.createDate).getDay()
  7511. if(this.user.companyId == 817){
  7512. if(weekday == 0){
  7513. this.isWeekend = true
  7514. }
  7515. }else{
  7516. if(weekday == 0 || weekday == 6){
  7517. this.isWeekend = true
  7518. }
  7519. }
  7520. this.getReport()
  7521. }
  7522. }else {
  7523. if(this.user.timeType.fillAhead == 0){
  7524. let date_a = new Date(this.workForm.createDate[1])
  7525. if(date_a.getTime() > date.getTime()){
  7526. this.workForm.createDate[1] = nowdate
  7527. let sdate = new Date(this.workForm.createDate[0])
  7528. let edate = new Date(this.workForm.createDate[1])
  7529. if(sdate > edate){
  7530. this.workForm.createDate[0] = this.workForm.createDate[1]
  7531. }
  7532. }
  7533. }
  7534. }
  7535. },
  7536. // 判断时间段
  7537. fns() {
  7538. for (let k in this.dateAr) {
  7539. if (!this.judege(k)) {
  7540. return false
  7541. }
  7542. }
  7543. return true
  7544. },
  7545. judege(idx){
  7546. for (let k in this.dateAr) {
  7547. if (idx !== k) {
  7548. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7549. return false
  7550. }
  7551. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7552. return false
  7553. }
  7554. }
  7555. }
  7556. return true
  7557. },
  7558. getOverlapData(data) {
  7559. let overlapData = [];
  7560. for (let i = 0; i < data.length; i++) {
  7561. for (let j = i + 1; j < data.length; j++) {
  7562. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7563. overlapData.push(data[i], data[j]);
  7564. }
  7565. }
  7566. }
  7567. return overlapData;
  7568. },
  7569. // 保存日报111111
  7570. submitReport(isDraft) {
  7571. this.isDraft = isDraft;
  7572. this.$refs.workForm.validate(valid => {
  7573. if (valid) {
  7574. if (!isDraft) {
  7575. //针对苏州景昱,单独的检查逻辑
  7576. if (this.user.companyId == 5978) {
  7577. //调接口,先检查工时是否存在异常
  7578. var totalTime = 0;
  7579. for (var t=0;t<this.workForm.domains.length; t++) {
  7580. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7581. }
  7582. var array = [];
  7583. if (this.isBatch) {
  7584. var startDate = new Date(this.workForm.createDate[0]);
  7585. var endDate = new Date(this.workForm.createDate[1]);
  7586. if (startDate > endDate) {
  7587. this.$message({
  7588. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7589. type: "error"
  7590. });
  7591. return
  7592. } else {
  7593. while(true){
  7594. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7595. array.push(workData);
  7596. startDate.setDate(startDate.getDate() + 1);
  7597. if (startDate > endDate) {
  7598. break;
  7599. }
  7600. }
  7601. }
  7602. } else {
  7603. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7604. array.push(workData)
  7605. }
  7606. this.submitingReport = true;
  7607. var passUserId = this.user.id;
  7608. if (this.isSubstitude) {
  7609. passUserId = this.targetUids;
  7610. }
  7611. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7612. res => {
  7613. this.submitingReport = false;
  7614. if (res.code == "ok") {
  7615. this.submitReportSon()
  7616. } else {
  7617. this.$confirm(res.msg, this.$t('other.prompts'), {
  7618. confirmButtonText: this.$t('huLveBingTiJiao'),
  7619. cancelButtonText: this.$t('btn.cancel'),
  7620. type: 'error'
  7621. }).then(() => {
  7622. this.submitReportSon()
  7623. }).catch(() => {
  7624. });
  7625. }
  7626. },
  7627. error => {
  7628. this.$message({
  7629. message: error,
  7630. type: "error"
  7631. });
  7632. });
  7633. } else {
  7634. if(this.totalReportHours < this.user.timeType.allday){
  7635. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7636. confirmButtonText: this.$t('btn.determine'),
  7637. cancelButtonText: this.$t('btn.cancel'),
  7638. type: 'warning'
  7639. }).then(() => {
  7640. this.submitReportSon()
  7641. }).catch(() => {
  7642. });
  7643. }else{
  7644. this.submitReportSon()
  7645. }
  7646. }
  7647. } else {
  7648. //暂存,不需要检查工时是否超过考勤
  7649. this.submitReportSon()
  7650. }
  7651. }
  7652. });
  7653. },
  7654. submitReportSon() {
  7655. this.dateAr = []
  7656. //检查重叠
  7657. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7658. let alp = []
  7659. if(this.user.timeType.multiWorktime != 1) {
  7660. for(var p in this.workForm.domains) {
  7661. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7662. let objs = {}
  7663. objs.s = this.workForm.domains[p].startTime
  7664. objs.e = this.workForm.domains[p].endTime
  7665. alp.push(objs)
  7666. }
  7667. }
  7668. this.dateAr = alp
  7669. if(this.dateAr.length > 0) {
  7670. let trus = this.fns()
  7671. if(!trus) {
  7672. this.$message({
  7673. message: this.$t('message.Filledtimeperiodsoverlap'),
  7674. type: "error"
  7675. });
  7676. return
  7677. }
  7678. }
  7679. } else {
  7680. for(var p in this.workForm.domains) {
  7681. var slll = this.workForm.domains[p]
  7682. for(var o in slll.worktimeList) {
  7683. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7684. let objs = {}
  7685. objs.s = slll.worktimeList[o].startTime
  7686. objs.e = slll.worktimeList[o].endTime
  7687. alp.push(objs)
  7688. }
  7689. }
  7690. }
  7691. this.dateAr = alp
  7692. if(this.dateAr.length > 0) {
  7693. let trus = this.fns()
  7694. if(!trus) {
  7695. this.$message({
  7696. message: this.$t('message.Filledtimeperiodsoverlap'),
  7697. type: "error"
  7698. });
  7699. return
  7700. }
  7701. }
  7702. }
  7703. }
  7704. //检查子项目
  7705. if (this.user.timeType.subProMustFill == 1) {
  7706. for(var p in this.workForm.domains) {
  7707. var oneProItem = this.workForm.domains[p]
  7708. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7709. //没有选择子项目
  7710. this.$message({
  7711. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7712. type: "error"
  7713. });
  7714. return
  7715. }
  7716. }
  7717. }
  7718. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7719. if (this.user.companyId == this.yuzhongCompId) {
  7720. for(var p in this.workForm.domains) {
  7721. var oneProItem = this.workForm.domains[p]
  7722. if (!oneProItem.extraField1) {
  7723. this.$message({
  7724. message: this.$t('jiaoSeBiTianQingJianCha'),
  7725. type: "error"
  7726. });
  7727. return
  7728. }
  7729. if (!oneProItem.extraField2) {
  7730. this.$message({
  7731. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7732. type: "error"
  7733. });
  7734. return
  7735. }
  7736. if (!oneProItem.extraField3) {
  7737. this.$message({
  7738. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7739. type: "error"
  7740. });
  7741. return
  7742. }
  7743. }
  7744. }
  7745. // return
  7746. //代填的情况,检查人员是否已经选择
  7747. if (this.isSubstitude) {
  7748. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7749. this.$message({
  7750. message: this.$t('message.pleaseselectthepersontofillin'),
  7751. type: "error"
  7752. });
  7753. return;
  7754. }
  7755. }
  7756. //检查时间,全天和上下午不能同时存在
  7757. if (this.reportTimeType.type == 0) {
  7758. var alldayNum = 0;
  7759. var amNum = 0;
  7760. var pmNum = 0;
  7761. for(var i in this.workForm.domains) {
  7762. if (this.workForm.domains[i].timeType == 0) {
  7763. alldayNum ++;
  7764. } else if (this.workForm.domains[i].timeType == 1) {
  7765. amNum++;
  7766. } else if (this.workForm.domains[i].timeType == 2) {
  7767. pmNum++;
  7768. }
  7769. }
  7770. if (alldayNum > 1) {
  7771. this.$message({
  7772. // message: "工作时间-全天,只能选择一次",
  7773. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7774. type: "error"
  7775. });
  7776. return;
  7777. }
  7778. if (amNum > 1) {
  7779. this.$message({
  7780. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7781. type: "error"
  7782. });
  7783. return;
  7784. }
  7785. if (pmNum > 1) {
  7786. this.$message({
  7787. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7788. type: "error"
  7789. });
  7790. return;
  7791. }
  7792. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7793. this.$message({
  7794. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7795. type: "error"
  7796. });
  7797. return;
  7798. }
  7799. } else if (this.reportTimeType.type == 3) {
  7800. //总百分比不能超过100%
  7801. let total = 0;
  7802. this.workForm.domains.forEach(w=>{total += w.progress});
  7803. if (total > 100) {
  7804. this.$message({
  7805. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7806. type: "error"
  7807. });
  7808. return;
  7809. } else if (total < 100) {
  7810. this.$message({
  7811. message: this.$t('message.cannotbesubmitted'),
  7812. type: "error"
  7813. });
  7814. return;
  7815. }
  7816. }
  7817. this.listLoading = true;
  7818. let formData = new FormData();
  7819. formData.append("draft", this.isDraft);
  7820. var totalTime = 0;
  7821. for (var t=0;t<this.workForm.domains.length; t++) {
  7822. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7823. }
  7824. //批量填报不校验考勤时长,交给后台校验
  7825. if (!this.isBatch) {
  7826. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7827. if (this.workForm.time){
  7828. if (this.workForm.time.workHours == 0){
  7829. this.$message({
  7830. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7831. type: 'error'
  7832. })
  7833. return
  7834. }
  7835. }else{
  7836. this.$message({
  7837. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7838. type: 'error'
  7839. })
  7840. return
  7841. }
  7842. }
  7843. }
  7844. //针对凡己和景昱,此处不校验考勤时长
  7845. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.reportTimeType.type == 1 && this.workForm.time) {
  7846. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7847. this.$message({
  7848. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7849. type: "error"
  7850. });
  7851. return;
  7852. }
  7853. }
  7854. for(var i in this.workForm.domains) {
  7855. // 检查任务/里程碑是否为必填
  7856. let taskRequired = this.user.timeType.taskRequired
  7857. if(taskRequired == 1) {
  7858. if(!this.workForm.domains[i].taskId) {
  7859. this.$message({
  7860. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  7861. type: "error"
  7862. });
  7863. return
  7864. }
  7865. }
  7866. if(this.user.timeType.reportAuditType == 3){
  7867. let audItem = {}
  7868. let auditRule = ''
  7869. if(this.workForm.domains[i].id){
  7870. audItem.reportId = this.workForm.domains[i].id
  7871. }
  7872. if(this.user.timeType.auditLevel > 0){
  7873. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7874. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7875. }
  7876. if(this.user.timeType.auditLevel > 1){
  7877. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7878. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7879. }
  7880. if(this.user.timeType.auditLevel > 2){
  7881. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7882. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7883. }
  7884. if(this.workForm.domains[i].ccUserid){
  7885. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7886. }
  7887. if(auditRule){
  7888. auditRule = auditRule.substring(0,auditRule.length - 1)
  7889. this.$message({
  7890. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7891. type: 'error'
  7892. })
  7893. return
  7894. }
  7895. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7896. }
  7897. if (this.user.timeType.customDegreeActive) {
  7898. if (this.user.timeType.customDegreeMultiple) {
  7899. //多选
  7900. if (this.workForm.domains[i].multiDegrIdArray) {
  7901. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7902. degreeArray = degreeArray.replace(/,/g,"@");
  7903. formData.append("multiDegrId", degreeArray);
  7904. } else {
  7905. formData.append("multiDegrId", '[]');
  7906. }
  7907. } else {
  7908. //单选
  7909. if (this.workForm.domains[i].degreeId) {
  7910. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7911. } else {
  7912. formData.append("degreeId", -1);
  7913. }
  7914. }
  7915. } else {
  7916. formData.append("degreeId", -1);
  7917. }
  7918. if(this.workForm.domains[i].customData) {
  7919. // var sss = this.workForm.domains[i].degreeId.toString()
  7920. formData.append("customData", this.workForm.domains[i].customData);
  7921. } else {
  7922. formData.append("customData", 0);
  7923. }
  7924. if(this.workForm.domains[i].customText) {
  7925. formData.append("customText", this.workForm.domains[i].customText);
  7926. } else {
  7927. formData.append("customText", '-');
  7928. }
  7929. if (this.workForm.domains[i].id) {
  7930. formData.append("id", this.workForm.domains[i].id);
  7931. } else {
  7932. formData.append("id", -1);
  7933. }
  7934. formData.append("projectId", this.workForm.domains[i].projectId);
  7935. if (this.workForm.domains[i].subProjectId) {
  7936. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7937. } else {
  7938. formData.append("subProjectId", 0);
  7939. }
  7940. if (this.workForm.domains[i].groupId) {
  7941. formData.append("groupId", this.workForm.domains[i].groupId);
  7942. } else {
  7943. formData.append("groupId", 0);
  7944. }
  7945. if (this.workForm.domains[i].taskId) {
  7946. formData.append("taskId", this.workForm.domains[i].taskId);
  7947. } else {
  7948. formData.append("taskId", 0);
  7949. }
  7950. if (this.workForm.domains[i].taskFinish == true) {
  7951. formData.append("taskFinish", 1);
  7952. } else {
  7953. formData.append("taskFinish", 0);
  7954. }
  7955. formData.append("reportTimeType", this.reportTimeType.type);
  7956. if (this.reportTimeType.type == 0) {
  7957. formData.append("timeType", this.workForm.domains[i].timeType);
  7958. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7959. formData.append("workingTime", workingTime);
  7960. } else if (this.reportTimeType.type == 1){
  7961. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7962. } else if (this.reportTimeType.type == 2) {
  7963. formData.append("endTime", this.workForm.domains[i].endTime);
  7964. formData.append("startTime", this.workForm.domains[i].startTime);
  7965. } else if (this.reportTimeType.type == 3) {
  7966. //按比例分配
  7967. formData.append("progress", this.workForm.domains[i].progress);
  7968. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7969. }
  7970. if(this.user.timeType.choseFromAlbum == 1 ) {
  7971. console.log(this.workForm.domains[i].imgList)
  7972. if(this.workForm.domains[i].imgList) {
  7973. let imgListFor = this.workForm.domains[i].imgList
  7974. for(var b in imgListFor) {
  7975. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7976. }
  7977. console.log(imgListFor)
  7978. let m = JSON.stringify(imgListFor);
  7979. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7980. formData.append("picStr", m);
  7981. } else {
  7982. formData.append("picStr", '[]');
  7983. }
  7984. }
  7985. //处理多个时间事项
  7986. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7987. if (this.reportTimeType.multiWorktime == 1) {
  7988. //检查时间是否有重叠
  7989. var workList = this.workForm.domains[i].worktimeList;
  7990. for (var j=0;j<workList.length; j++) {
  7991. var curItem = workList[j];
  7992. //检查开始时间是否大于结束时间
  7993. if (curItem.startTime >= curItem.endTime) {
  7994. this.$message({
  7995. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7996. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7997. type: "error"
  7998. });
  7999. return;
  8000. }
  8001. //时间不可重叠
  8002. if (this.reportTimeType.timeCanOverlap == 0) {
  8003. for (var p = j+1;p<workList.length; p++) {
  8004. var jItem = workList[p];
  8005. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8006. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8007. this.$message({
  8008. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8009. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8010. type: "error"
  8011. });
  8012. return;
  8013. }
  8014. }
  8015. }
  8016. }
  8017. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8018. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8019. formData.append("content", m);
  8020. } else {
  8021. if (this.workForm.domains[i].content) {
  8022. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8023. m = m.replace(/,/g,",");
  8024. console.log(m, '需要传值的数据')
  8025. // formData.append("content", this.workForm.domains[i].content);
  8026. formData.append("content", m);
  8027. } else {
  8028. formData.append("content", '-');
  8029. }
  8030. }
  8031. if (this.isBatch == 0) {
  8032. formData.append("createDate", this.workForm.createDate);
  8033. } else {
  8034. //批量填报,时间范围
  8035. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8036. }
  8037. if(this.workForm.domains[i].isOvertime) {
  8038. formData.append("isOvertime", 1);
  8039. } else {
  8040. formData.append("isOvertime", 0);
  8041. }
  8042. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8043. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8044. } else {
  8045. formData.append("overtimeHours", 0);
  8046. }
  8047. if(this.workForm.domains[i].basecostId) {
  8048. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8049. } else {
  8050. formData.append("basecostId", 0);
  8051. }
  8052. if (this.workForm.userId != null) {
  8053. var targetUids = '';
  8054. this.workForm.userId.forEach(u=>{
  8055. targetUids += u + '@';
  8056. });
  8057. if (targetUids.length > 0) {
  8058. targetUids = targetUids.substring(0, targetUids.length -1);
  8059. formData.append("targetUids", targetUids);
  8060. }
  8061. }
  8062. //项目专业进度
  8063. if (this.workForm.domains[i].professionProgress) {
  8064. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8065. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8066. formData.append("professionProgress", m);
  8067. } else {
  8068. formData.append("professionProgress", "[]");
  8069. }
  8070. if (this.workForm.domains[i].stage) {
  8071. formData.append("stage", this.workForm.domains[i].stage);
  8072. } else {
  8073. formData.append("stage", "-");
  8074. }
  8075. if (this.workForm.domains[i].projectAuditorId) {
  8076. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8077. } else {
  8078. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8079. this.$message({
  8080. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8081. type: "error"
  8082. });
  8083. return;
  8084. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8085. //分组负责人先审核, 确定是选择了任务分组
  8086. if (this.workForm.domains[i].taskGroups.length == 0) {
  8087. this.$message({
  8088. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8089. type: "error"
  8090. });
  8091. return;
  8092. } else if (!this.workForm.domains[i].groupId) {
  8093. // console.log(this.workForm.domains[i]);
  8094. this.$message({
  8095. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8096. type: "error"
  8097. });
  8098. return;
  8099. }
  8100. }
  8101. }
  8102. if (this.user.companyId == this.yuzhongCompId) {
  8103. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8104. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8105. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8106. }
  8107. //依斯贝的服务Id
  8108. if (this.user.companyId == this.yisibeiCompId) {
  8109. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8110. }
  8111. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8112. this.$message({
  8113. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8114. type: "error"
  8115. });
  8116. return
  8117. }
  8118. if(this.user.timeType.userWithMultiDept == 1) {
  8119. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8120. }
  8121. }
  8122. this.submitingReport = true;
  8123. this.http.uploadFile( this.port.report.editPort, formData,
  8124. res => {
  8125. this.listLoading = false;
  8126. this.submitingReport = false;
  8127. if (res.code == "ok") {
  8128. if(res.msg!=null){
  8129. this.$message({
  8130. dangerouslyUseHTMLString: true,
  8131. message: res.msg,
  8132. type: "warning",
  8133. showClose: true,
  8134. duration: 0
  8135. });
  8136. }else{
  8137. this.$message({
  8138. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8139. type: "success"
  8140. });
  8141. }
  8142. this.dialogVisible = false;
  8143. this.jsDay = 0
  8144. this.jsTime = 0
  8145. this.getReportList();
  8146. this.getDepartment();
  8147. this.getRecentlyProject()
  8148. } else {
  8149. this.$message({
  8150. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8151. type: "error"
  8152. });
  8153. }
  8154. },
  8155. error => {
  8156. this.listLoading = false;
  8157. this.submitingReport = false;
  8158. this.$message({
  8159. message: error,
  8160. type: "error"
  8161. });
  8162. });
  8163. },
  8164. // 判断是展示那个工时导入
  8165. imports() {
  8166. if(this.user.timeType.syncCorpwxTime == 0) {
  8167. this.importDialog = true
  8168. } else {
  8169. this.importWxDialog = true
  8170. }
  8171. },
  8172. // 跳转
  8173. junpToDeskTop(id) {
  8174. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8175. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8176. },
  8177. // 通过日报
  8178. approve(id, item) {
  8179. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8180. this.approveinData = {
  8181. id: id,
  8182. date: this.date +day,
  8183. reportIds: item.id
  8184. }
  8185. if(this.user.timeType.needEvaluate == 1){
  8186. this.$set(this.approveinData,'evaluate','')
  8187. this.approveinDialog = true
  8188. }else{
  8189. this.logining = true;
  8190. this.approveinfun()
  8191. }
  8192. },
  8193. approveinfun(){
  8194. this.http.post( this.port.report.approve, this.approveinData,
  8195. res => {
  8196. this.logining = false;
  8197. if (res.code == "ok") {
  8198. this.approveinDialog = false
  8199. this.$message({
  8200. message: this.$t('message.Reviewsucceeded'),
  8201. type: "success"
  8202. });
  8203. this.refreshReportData(this.approveinData.reportIds);
  8204. this.getDepartment();
  8205. } else {
  8206. this.$message({
  8207. message: res.msg,
  8208. type: "error"
  8209. });
  8210. }
  8211. },
  8212. error => {
  8213. this.logining = false;
  8214. this.$message({
  8215. message: error,
  8216. type: "error"
  8217. });
  8218. });
  8219. },
  8220. //撤回日报
  8221. cancel(item,e) {
  8222. // console.log('can can need',item);
  8223. this.logining = true;
  8224. var ids = '';
  8225. var data = e ? item : item.data;
  8226. data.forEach(element => {
  8227. if(element.id){
  8228. ids +=(element.id+',');
  8229. }
  8230. });
  8231. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8232. res => {
  8233. this.logining = false;
  8234. if (res.code == "ok") {
  8235. this.$message({
  8236. message:this.$t('message.Withdrawalsucceeded'),
  8237. type: "success"
  8238. });
  8239. this.getReportList();
  8240. if(e){this.getReport()}
  8241. this.getDepartment();
  8242. } else {
  8243. this.$message({
  8244. message: res.msg,
  8245. type: "error"
  8246. });
  8247. }
  8248. },
  8249. error => {
  8250. this.logining = false;
  8251. this.$message({
  8252. message: error,
  8253. type: "error"
  8254. });
  8255. });
  8256. },
  8257. showDenyDialog(id,i, item) {
  8258. this.denyReasonDialog = true;
  8259. this.isDenying = false;
  8260. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8261. var ids = item.id;
  8262. // var data = item.data;
  8263. // data.forEach(element => {
  8264. // ids +=(element.id+',');
  8265. // });
  8266. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8267. },
  8268. // 未通过日报
  8269. deny() {
  8270. this.logining = true;
  8271. this.isDenying = true;
  8272. this.http.post( this.port.report.deny, this.denyForm,
  8273. res => {
  8274. this.logining = false;
  8275. this.isDenying = false;
  8276. if (res.code == "ok") {
  8277. this.$message({
  8278. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8279. type: "success"
  8280. });
  8281. this.refreshReportData(this.denyForm.reportIds);
  8282. this.getDepartment();
  8283. this.denyReasonDialog = false;
  8284. } else {
  8285. this.$message({
  8286. message: res.msg,
  8287. type: "error"
  8288. });
  8289. }
  8290. },
  8291. error => {
  8292. this.logining = false;
  8293. this.$message({
  8294. message: error,
  8295. type: "error"
  8296. });
  8297. });
  8298. },
  8299. // 查看工时记录弹窗
  8300. toView() {
  8301. this.toViewDialogVisible = true
  8302. this.toViewloading = true
  8303. this.getToView()
  8304. },
  8305. getToView() {
  8306. this.http.post( '/report-import-log/getList', this.toViewForm,
  8307. res => {
  8308. this.toViewloading = false;
  8309. if (res.code == "ok") {
  8310. // console.log(res.data, '数据数据')
  8311. this.toViewList = res.data.records
  8312. this.toViewForm.total = res.data.total
  8313. } else {
  8314. this.toViewloading = false;
  8315. this.$message({
  8316. message: res.msg,
  8317. type: "error"
  8318. });
  8319. }
  8320. })
  8321. },
  8322. // 触发 selectCat 组件更改他的值
  8323. selectCatCli(obj) {
  8324. // console.log(obj, '看看')
  8325. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8326. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8327. },
  8328. vueCasader(obj) {
  8329. console.log(obj, '看看值', this.departmentList)
  8330. if(obj.distinction == 1 && obj.item) {
  8331. let arr = []
  8332. arr.push(obj.item.value)
  8333. this.exportParam.departmentId = arr
  8334. }
  8335. if(obj.distinction == '10' && obj) {
  8336. const { id, other } = obj
  8337. this.workForm.domains[other].reportTargetDeptId = id
  8338. }
  8339. if(obj.distinction == '14' && obj) {
  8340. let arr = []
  8341. arr.push(obj.id)
  8342. this.deptIdForHasReport = arr
  8343. this.showMonthWorkTime()
  8344. }
  8345. if(obj.distinction == '15' && obj) {
  8346. let arr = []
  8347. arr.push(obj.id)
  8348. this.deptIdForNoReport = arr
  8349. this.showMonthNotWorkTime()
  8350. }
  8351. if(obj.distinction == '16' && obj) {
  8352. let arr = []
  8353. arr.push(obj.id)
  8354. this.deptIdForReminder = arr
  8355. this.showMonthWorkTimeReminder()
  8356. }
  8357. },
  8358. //分页
  8359. handleCurrentChange(val) {
  8360. this.toViewForm.pageIndex = val;
  8361. this.getToView();
  8362. },
  8363. handleSizeChange(val) {
  8364. this.toViewForm.pageSize = val;
  8365. this.getToView();
  8366. },
  8367. getAllUsersList(){
  8368. this.http.post('/user/getSimpleActiveUserList',{
  8369. },res => {
  8370. if(res.code == 'ok'){
  8371. this.allUsersList = res.data
  8372. }else{
  8373. this.$message({
  8374. message: res.msg,
  8375. type: 'error'
  8376. })
  8377. }
  8378. },err => {
  8379. this.$message({
  8380. message: err,
  8381. type: 'error'
  8382. })
  8383. })
  8384. },
  8385. //景昱变更提醒
  8386. changeReminder(item){
  8387. console.log("============",item)
  8388. let parameter={
  8389. startDate: this.WorktimeDatepickValue[0],
  8390. endDate: this.WorktimeDatepickValue[1],
  8391. }
  8392. if(item){
  8393. parameter.createDate=item.createDate,
  8394. parameter.userId=item.userId
  8395. }
  8396. this.http.post('/report/changeReminder',parameter,res => {
  8397. if(res.code == 'ok'){
  8398. this.$message({
  8399. message: res.msg,
  8400. type: 'success'
  8401. })
  8402. }else{
  8403. this.$message({
  8404. message: res.msg,
  8405. type: 'error'
  8406. })
  8407. }
  8408. },err => {
  8409. this.$message({
  8410. message: err,
  8411. type: 'error'
  8412. })
  8413. })
  8414. },
  8415. //景昱取消异常
  8416. cancelReminder(item){
  8417. let parameter={}
  8418. if(item){
  8419. parameter.createDate=item.createDate,
  8420. parameter.userId=item.userId
  8421. }
  8422. this.http.post('/report/cancelReminder',parameter,res => {
  8423. if(res.code == 'ok'){
  8424. this.$message({
  8425. message: res.msg,
  8426. type: 'success'
  8427. })
  8428. }else{
  8429. this.$message({
  8430. message: res.msg,
  8431. type: 'error'
  8432. })
  8433. }
  8434. },err => {
  8435. this.$message({
  8436. message: err,
  8437. type: 'error'
  8438. })
  8439. })
  8440. this.showMonthWorkTimeReminder()
  8441. },
  8442. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8443. fillWeekCustomClne() {
  8444. this.fillWeekDialogVisiCustom = false
  8445. },
  8446. fillWeekCustomClneTwo() {
  8447. this.fillWeekDialogVisiCustomTwo = false
  8448. },
  8449. fillWeekCustomSubmit() {
  8450. this.getReportList();
  8451. this.getDepartment();
  8452. this.getRecentlyProject()
  8453. },
  8454. // 待填日报姓名搜索
  8455. nameAearchSeek(flg) {
  8456. if(!this.nameAearch) {
  8457. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8458. return
  8459. }
  8460. if(flg) {
  8461. this.enterpriseWechatgetUser()
  8462. }
  8463. },
  8464. handleThreeData(userList) {
  8465. console.log(userList, '人员数据')
  8466. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8467. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8468. },
  8469. // 过滤树节点
  8470. filterTreeNodes(treeData, filterKeywords) {
  8471. return treeData.filter((node) => {
  8472. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8473. if (node.children && node.children.length > 0) {
  8474. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8475. }
  8476. return true;
  8477. }
  8478. if (node.children && node.children.length > 0) {
  8479. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8480. return node.children.length > 0;
  8481. }
  8482. return false;
  8483. });
  8484. },
  8485. // 企业微信获取人员
  8486. enterpriseWechatgetUser() {
  8487. this.deptMembDataLoading = true
  8488. this.http.post('/user/getEmployeeList',{
  8489. departmentId: -1,
  8490. pageIndex: 1,
  8491. pageSize: 100,
  8492. keyword: this.nameAearch,
  8493. status: '',
  8494. roleId: '',
  8495. cursor: '',
  8496. onlyDirect: '',
  8497. matchingType: ''
  8498. },res => {
  8499. if(res.code == 'ok'){
  8500. this.deptMembDataLoading = false
  8501. const userListName = res.data.records.map(item => item.name)
  8502. this.handleThreeData(userListName)
  8503. setTimeout(() => {
  8504. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8505. }, 200)
  8506. }else{
  8507. this.deptMembDataLoading = false
  8508. this.$message({
  8509. message: res.msg,
  8510. type: 'error'
  8511. })
  8512. }
  8513. },err => {
  8514. this.deptMembDataLoading = false
  8515. this.$message({
  8516. message: err,
  8517. type: 'error'
  8518. })
  8519. })
  8520. },
  8521. changeTreeNodeStatus(node) {
  8522. console.log(node)
  8523. let allZt = true
  8524. node.expanded = allZt
  8525. for (let i = 0; i < node.childNodes.length; i++) {
  8526. node.childNodes[i].expanded = allZt
  8527. if (node.childNodes[i].childNodes.length > 0) {
  8528. this.changeTreeNodeStatus(node.childNodes[i])
  8529. }
  8530. }
  8531. },
  8532. // 按周填报获取相关任务
  8533. async getWeeklyTaskList(item) {
  8534. console.log(item, '<=== 数据')
  8535. const { projectId, groupId, stage, taskId } = item
  8536. console.log(projectId, groupId, stage)
  8537. let parms = { projectId, isSubstitude: 0 }
  8538. groupId ? parms.groupId = groupId : ''
  8539. stage ? parms.stage = stage : ''
  8540. const { data } = await this.postData('/task/getRecentTask', parms)
  8541. this.zhoBao.taskId = taskId
  8542. this.$set(this.zhoBao, 'taskList', data)
  8543. console.log(this.zhoBao)
  8544. },
  8545. // 封装 post 请求
  8546. postData(url, params) {
  8547. return new Promise((resolve, reject) => {
  8548. this.http.post(url, { ...params },
  8549. res => {
  8550. resolve(res)
  8551. },
  8552. error => {
  8553. this.$message({
  8554. message: error,
  8555. type: "error"
  8556. });
  8557. reject(error)
  8558. })
  8559. })
  8560. },
  8561. // 自定义事件
  8562. selectCal(obj) {
  8563. console.log(obj, '传数据来源')
  8564. if(obj.distinction == '1') {
  8565. this.zhoBao.projectAuditorId = obj.id
  8566. } else if(obj.distinction == '2') {
  8567. this.zhoBao.auditorFirst = obj.id
  8568. } else if(obj.distinction == '3') {
  8569. this.zhoBao.auditorSec = obj.id
  8570. } else if(obj.distinction == '4') {
  8571. this.zhoBao.auditorThird = obj.id
  8572. } else if(obj.distinction == '5') {
  8573. this.zhoBao.ccUserid = obj.id
  8574. } else if(obj.distinction == '12') {
  8575. this.usersListId = obj.id
  8576. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8577. this.searchKeyword = obj.name
  8578. } else {
  8579. this.searchKeyword = ''
  8580. }
  8581. this.searchScreen(0)
  8582. } else if(obj.distinction == '13') {
  8583. this.usersListId = obj.id
  8584. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8585. this.searchKeyword = obj.name
  8586. } else {
  8587. this.searchKeyword = ''
  8588. }
  8589. this.searchScreen(1)
  8590. }
  8591. }
  8592. },
  8593. created() {
  8594. this.getUsers()
  8595. let height = window.innerHeight;
  8596. this.tableHeight = height - 178;
  8597. const that = this;
  8598. window.onresize = function temp() {
  8599. that.tableHeight = window.innerHeight - 178;
  8600. };
  8601. this.toViewForm.companyId = this.user.companyId
  8602. this.initDrag([{
  8603. type: "LR",
  8604. domClass: {
  8605. // 中间分割线的名字
  8606. resize: "line-line",
  8607. // 左侧盒子的名字
  8608. left: "box-left",
  8609. // 右侧盒子的名字
  8610. right: "box-right",
  8611. // 父级的名字
  8612. box: "box-father",
  8613. },
  8614. otherInfo: {
  8615. // 限制左边栏最低宽度
  8616. leftWidth: 120,
  8617. },
  8618. },
  8619. {
  8620. type: "LR",
  8621. domClass: {
  8622. // 中间分割线的名字
  8623. resize: "line-second",
  8624. // 左侧盒子的名字
  8625. left: "left-laowang",
  8626. // 右侧盒子的名字
  8627. right: "box-second-father",
  8628. // 父级的名字
  8629. box: "grand",
  8630. },
  8631. otherInfo: {
  8632. // 限制左边栏最低宽度
  8633. leftWidth: 120,
  8634. },
  8635. },
  8636. ]);
  8637. }
  8638. };
  8639. </script>
  8640. <style lang="scss" scoped>
  8641. .fillWeekDialogVisiCustom {
  8642. width: 100%;
  8643. height: 70vh;
  8644. }
  8645. .fillWeekCustom {
  8646. .el-dialog__body {
  8647. padding: 20px 20px !important;
  8648. }
  8649. }
  8650. .photos {
  8651. position: relative;
  8652. display: flex;
  8653. flex-wrap: wrap;
  8654. }
  8655. .photos_img {
  8656. width: 120px;
  8657. height: 120px;
  8658. margin-right: 20px;
  8659. margin-bottom: 20px;
  8660. cursor: pointer;
  8661. img {
  8662. width: 100%;
  8663. height: 100%;
  8664. }
  8665. }
  8666. .paginatis {
  8667. padding: 10px 10px;
  8668. background: #f2f2f2;
  8669. }
  8670. .waiting {
  8671. color:orange;
  8672. }
  8673. .filledReportStyle {
  8674. color:#32CD32;
  8675. }
  8676. .RejectStyle {
  8677. color:red;
  8678. }
  8679. .waitSubmitStyle{
  8680. color: #409eff;
  8681. }
  8682. .chooseDate {
  8683. .waiting {
  8684. color: #20a0ff;
  8685. }
  8686. .filledReportStyle {
  8687. color:#20a0ff;
  8688. }
  8689. .RejectStyle {
  8690. color: #20a0ff;
  8691. }
  8692. .waitSubmitStyle{
  8693. color: #20a0ff;
  8694. }
  8695. }
  8696. .allDaily {
  8697. width:100%;
  8698. }
  8699. .report_title {
  8700. padding:10px 0;
  8701. color:#666;
  8702. }
  8703. .clearfix {
  8704. overflow-x: auto;
  8705. white-space: nowrap;
  8706. padding: 15px 0 10px 0;
  8707. // overflow-y: hidden;
  8708. .date_item {
  8709. padding: 0 3px;
  8710. cursor: pointer;
  8711. position: relative;
  8712. }
  8713. .chooseDate {
  8714. position: absolute;
  8715. bottom: -3px;
  8716. width: 37px;
  8717. height: 2px;
  8718. left: 14px;
  8719. background: #20a0ff;
  8720. }
  8721. }
  8722. .one_daily {
  8723. i {
  8724. color: #9ed0ff;
  8725. margin-right: 5px;
  8726. }
  8727. .one_daily_body {
  8728. padding: 10px 0px;
  8729. p {
  8730. margin: 0;
  8731. line-height: 30px;
  8732. }
  8733. }
  8734. ul {
  8735. padding: 0;
  8736. }
  8737. }
  8738. .checkbtn {
  8739. float: right;
  8740. margin-top: -10px;
  8741. }
  8742. .selConStyle{
  8743. margin-top:9rem;
  8744. margin-bottom:11rem;
  8745. .selConStyle_title{
  8746. height: 3rem;
  8747. text-align: center;
  8748. font-size: 17px;
  8749. }
  8750. .el-select{
  8751. margin: 0 15%;
  8752. width: 70%;
  8753. }
  8754. }
  8755. </style>
  8756. <style lang="scss">
  8757. /*去除upload组件过渡效果*/
  8758. .photos .el-upload-list__item {
  8759. transition: none !important;
  8760. }
  8761. .daily {
  8762. .el-card__body {
  8763. height: 80%;
  8764. overflow-y: auto;
  8765. }
  8766. .el-card__header {
  8767. padding: 0 20px;
  8768. }
  8769. }
  8770. .membListClass{
  8771. .el-dialog__body{
  8772. padding-top: 10px;
  8773. }
  8774. }
  8775. // .editReportDialog .el-dialog__footer{
  8776. // position: sticky;
  8777. // bottom: 0;
  8778. // background: #fff;
  8779. // height: 70px;
  8780. // z-index: 1010;
  8781. // }
  8782. .editReportDialog{
  8783. min-width: 800px;
  8784. }
  8785. .touruxiangmu{
  8786. max-width: 1000px;
  8787. }
  8788. </style>
  8789. <style scoped>
  8790. /* 项目标签的样式 */
  8791. .el-tag + .el-tag {
  8792. margin-left: 10px;
  8793. }
  8794. .button-new-tag {
  8795. margin-left: 10px;
  8796. height: 32px;
  8797. line-height: 30px;
  8798. padding-top: 0;
  8799. padding-bottom: 0;
  8800. }
  8801. .input-new-tag {
  8802. width: 90px;
  8803. margin-left: 10px;
  8804. vertical-align: bottom;
  8805. }
  8806. .selectworktime .el-table__fixed-body-wrapper{
  8807. top: 48px !important;
  8808. }
  8809. .selectworktime_export .selectworktime_export_l{
  8810. width: 650px;
  8811. float: left;
  8812. height: 42px;
  8813. }
  8814. .approvalProcessBox{
  8815. margin-left: 30px;
  8816. font-size: 14px;
  8817. line-height: 16px;
  8818. cursor: pointer;
  8819. }
  8820. .approvalProcessBox i {
  8821. margin-right: 0;
  8822. height: 16px;
  8823. width: 16px;
  8824. display: inline-block;
  8825. transform: scale(1.2);
  8826. position: relative;
  8827. top: 0.5px;
  8828. color: #409eff;
  8829. }
  8830. .approvalProcessBox .approvalProcessClick{
  8831. cursor: pointer;
  8832. color: #409eff;
  8833. font-size: 14px;
  8834. }
  8835. .approvalProcessBox:hover .approvalProcessClick{
  8836. color: #3485fb;
  8837. }
  8838. </style>
  8839. <style lang="scss" scoped>
  8840. .bionicClass {
  8841. -webkit-appearance: none;
  8842. background-color: #FFF;
  8843. background-image: none;
  8844. border-radius: 4px;
  8845. border: 1px solid #DCDFE6;
  8846. box-sizing: border-box;
  8847. color: #606266;
  8848. display: inline-block;
  8849. height: 40px;
  8850. line-height: 40px;
  8851. outline: 0;
  8852. padding: 0 15px;
  8853. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8854. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  8855. width: 350px;
  8856. cursor: pointer;
  8857. .bionicClassText {
  8858. color: #C0C4CC;
  8859. }
  8860. }
  8861. // 加班样式
  8862. .overtime {
  8863. display: inline-block;
  8864. margin-left: 20px;
  8865. input {
  8866. display: inline-block;
  8867. margin-top: 5px;
  8868. }
  8869. }
  8870. .plus {
  8871. display: inline-block;
  8872. }
  8873. // .tages {
  8874. // float: right;
  8875. // }
  8876. .overtime {
  8877. display: inline-block;
  8878. margin-left: 30px;
  8879. }
  8880. .bloks {
  8881. display: inline-block;
  8882. width: 380px;
  8883. }
  8884. .zhiss {
  8885. display: flex;
  8886. justify-content: space-around;
  8887. align-items: center;
  8888. }
  8889. .zhoFel {
  8890. display: flex;
  8891. justify-content: space-between;
  8892. align-items: center;
  8893. }
  8894. // 左右滑动样式
  8895. .line {
  8896. width: 30px;
  8897. /* height: 500px; */
  8898. background: #f2f2f2;
  8899. cursor: w-resize;
  8900. }
  8901. .box-father {
  8902. border: 8px solid #000;
  8903. }
  8904. .line-second {
  8905. width: 10px;
  8906. /* background: red; */
  8907. }
  8908. .flex {
  8909. display: flex;
  8910. width: 100%;
  8911. }
  8912. .box-left {
  8913. flex: 0 0 400px;
  8914. /* height: 600px; */
  8915. /* background: blue; */
  8916. }
  8917. .box-right {
  8918. /* height: 600px; */
  8919. /* background: green; */
  8920. flex: 1;
  8921. }
  8922. .box-postion {
  8923. width: 200px;
  8924. /* height: 400px; */
  8925. background: #ccc;
  8926. }
  8927. .custom-tree-node {
  8928. flex: 1;
  8929. display: flex;
  8930. align-items: center;
  8931. justify-content: space-between;
  8932. font-size: 14px;
  8933. padding-right: 8px;
  8934. }
  8935. .daitianrbao {
  8936. width: 100%;
  8937. box-sizing: border-box;
  8938. height: 40px;
  8939. border-radius: 4px;
  8940. border: 1px solid #DCDFE6;
  8941. overflow: hidden;
  8942. text-overflow: ellipsis;
  8943. display: flex;
  8944. // align-items: center;
  8945. }
  8946. .daitianrbao .spnn {
  8947. display: inline-block;
  8948. box-sizing: border-box;
  8949. padding: 0 15px;
  8950. overflow: hidden;
  8951. text-overflow: ellipsis;
  8952. }
  8953. .daitianrbao .hover {
  8954. color: #DCDFE6 !important;
  8955. }
  8956. </style>