daily.vue 447 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  31. </div> -->
  32. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  33. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" style="width:100%;margin-bottom:10px" clearable>
  34. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  35. </el-input>
  36. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  37. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  38. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  39. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  40. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  41. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  42. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  43. </el-select>
  44. </div>
  45. <div>
  46. <!-- <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChange" @node-expand="nodeChange" node-key="id" :default-expanded-keys="expandDate" v-loading="dataLoading"> -->
  47. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  48. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  49. <!-- <span>{{ node.label }}</span> -->
  50. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  51. <span v-if="user.userNameNeedTranslate == '1'">
  52. <span v-if="node.data.children">
  53. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  54. </span>
  55. <span v-else>
  56. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  57. </span>
  58. </span>
  59. <span v-if="user.userNameNeedTranslate != '1'">
  60. {{ node.label }}
  61. </span>
  62. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  63. </span>
  64. <div style="position: absolute;right: 15px;">
  65. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  66. <!-- 未填报 -->
  67. {{$t('state.DidNotFillIn')}}
  68. </span>
  69. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  70. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  71. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  72. </span>
  73. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  74. <!-- 待审核 -->
  75. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  76. </span>
  77. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  78. <!-- 已通过 -->
  79. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  80. </span>
  81. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  82. <!-- 未通过 -->
  83. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  84. </span>
  85. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  86. <!-- 待提交 -->
  87. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  88. </span>
  89. </div>
  90. </span>
  91. </el-tree>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  96. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  97. -
  98. -
  99. -
  100. </div>
  101. </div>
  102. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  103. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  104. <div class="allDaily" style="float:left;flex-grow:1">
  105. <!--系统管理员和部门负责人 -->
  106. <div class="report_title" style="display:flex;justify-content: space-between;">
  107. <span>
  108. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  109. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  110. <!-- {{depData != null ?depData.label:""}} -->
  111. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  112. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  113. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  114. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  115. <span v-if="targetUid == null">
  116. <!-- - 已提交 -->
  117. -{{$t('state.hasBeenSubmitted')}}
  118. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  119. <!-- 待提交 -->
  120. {{$t('state.waitingsubmit')}}
  121. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  122. <!-- 漏填 -->
  123. <!-- {{$t('state.missFillReport')}} -->
  124. 未填
  125. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  126. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  127. </span>
  128. </span>
  129. </span>
  130. <span style="float:right;">
  131. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  132. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  133. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link>
  134. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报</el-link> -->
  135. <el-link type="primary" v-if="permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  136. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  137. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  138. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  139. <!--部门负责人给个导出工时的功能 -->
  140. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  141. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">推送工时</el-link>
  142. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">工时推送日志</el-link>
  143. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  144. </span>
  145. </div>
  146. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  147. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  148. <i class="fa fa-circle"></i>
  149. <!-- {{item1.name}} -->
  150. <span v-if="user.userNameNeedTranslate == '1'">
  151. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  152. </span>
  153. <span v-if="user.userNameNeedTranslate != '1'">
  154. {{item1.name}}
  155. </span>
  156. <span style="margin-left:30px;">
  157. <span style="margin-right:20px;">
  158. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  159. <!-- 工作总时长: -->
  160. {{$t('other.totalWorkingHours')}}
  161. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  162. <span >{{item1.reportTime | amounts}}</span>h
  163. </span>
  164. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  165. <i class="iconfont firerock-iconliucheng1"></i>
  166. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  167. <!-- 审批流程 -->
  168. {{$t('other.approvalProcess')}}
  169. </span>
  170. </span>
  171. </span>
  172. <div class="checkbtn" style="padding-right:20px;">
  173. <!--编辑和删除日报-->
  174. <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>
  175. <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>
  176. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  177. </div>
  178. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  179. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  180. </div>
  181. <div class="one_daily_body">
  182. <el-timeline>
  183. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  184. <el-card shadow="never">
  185. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  186. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  187. <span v-if="user.company.packageEngineering == 0">
  188. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  189. <span v-if="item2.isDeptAudit==0">
  190. <span v-if="item2.projectAuditState==0">
  191. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  192. <span v-if="item2.projectAuditorName != null">(
  193. <!-- {{item2.projectAuditorName}} -->
  194. <span v-if="user.userNameNeedTranslate == '1'">
  195. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  196. </span>
  197. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  198. )</span>
  199. <!-- 审核 --> {{$t('other.audit')}}
  200. </span>
  201. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  202. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  203. <span v-if="item2.projectAuditorName != null">(
  204. <!-- {{item2.projectAuditorName}} -->
  205. <span v-if="user.userNameNeedTranslate == '1'">
  206. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  207. </span>
  208. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  209. )</span>
  210. <!-- 审核通过 --> {{$t('state.approved')}}
  211. </span>
  212. </span>
  213. <span v-else-if="item2.isDeptAudit==1">
  214. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  215. ({{$t('other.await')}}
  216. <span v-if="user.userNameNeedTranslate == '1'">
  217. <ww-open-data type='departmentName' :openid='user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName'></ww-open-data>
  218. </span>
  219. <span v-if="user.userNameNeedTranslate != '1'">{{user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName}}</span>
  220. {{$t('other.audit')}})
  221. </span>
  222. ]</span>
  223. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  224. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  225. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  226. </span>
  227. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  228. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  229. </span>
  230. <!-- <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> -->
  231. <span v-if="user.company.packageEngineering == 1">
  232. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  233. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  234. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  235. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  236. (
  237. <span v-if="user.userNameNeedTranslate != 1">
  238. {{item2.projectAuditorName}}
  239. </span>
  240. <span v-if="user.userNameNeedTranslate == 1">
  241. <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
  242. </span>
  243. )
  244. </span>{{$t('other.audit')}} ]</span>
  245. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  246. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  247. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  248. </span>
  249. <!--每个项目上单独审核 -->
  250. <span style="float:right;">
  251. <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>
  252. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  253. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  254. <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"
  255. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  256. <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"
  257. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  258. <!--自己可以撤回待审核状态的报告 -->
  259. <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>
  260. </span>
  261. </p>
  262. <p v-if="user.companyId == yuzhongCompId">
  263. <span>角色:{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  264. <span style="margin-left:10px;">工作职责:{{ item2.extraField2? item2.extraField2Name:''}}</span>
  265. <span style="margin-left:10px;">工作内容:{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  266. <!--任务分组和阶段 -->
  267. <p v-if="item2.groupId != 0">
  268. {{$t('other.taskGroup')}}:{{item2.groupName}}
  269. <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>
  270. </p>
  271. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  272. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  273. <!-- 自定义日报文本 -->
  274. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  275. <p v-if="user.company.packageEngineering == 1">
  276. {{$t('other.professionalProgress')}}:
  277. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  278. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  279. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  280. </el-tooltip>
  281. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  282. <i class="iconfont firerock-iconshenhetongguo"></i>
  283. </el-tooltip>
  284. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  285. <i class="iconfont firerock-iconshenhebohui"></i>
  286. </el-tooltip>
  287. </span>
  288. </p>
  289. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  290. <span style="margin-left:10px;" v-if="user.companyId==3092">-- 服务:{{ item2.sapServiceName }}</span>
  291. </p>
  292. <div v-if="item2.multiWorktime==0">
  293. <p style="display: inline-block;">{{$t('time.duration')}}:
  294. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  295. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  296. {{item2.time.toFixed(1)}}h
  297. <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>
  298. </p>
  299. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  300. </div>
  301. <div v-if="item2.multiWorktime==1" >
  302. <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>
  303. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  304. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  305. <p style="display: inline-block;">{{$t('time.duration')}}:
  306. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  307. {{timeItem.time.toFixed(1)}}h
  308. </p>
  309. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  310. </div>
  311. </div>
  312. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  313. <!--照片的显示 -->
  314. <p v-if="item2.pics != null && item2.pics.length > 0">
  315. <el-image v-for="(pic, index) in item2.pics" :key="index"
  316. style="width: 100px; height: 100px; margin-right:10px;"
  317. :src="pic"
  318. :preview-src-list="item2.pics">
  319. </el-image>
  320. </p>
  321. </el-card>
  322. </el-timeline-item>
  323. </el-timeline>
  324. </div>
  325. </div>
  326. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">加载更多日报</el-link></div>
  327. <!-- 简陋的无报告提示 -->
  328. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. </el-card>
  335. </div>
  336. <!-- 工时推送日志弹窗 -->
  337. <el-dialog title="工时推送日志" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  338. <template>
  339. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">导出</el-button>
  340. </template>
  341. <template>
  342. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  343. <el-table-column prop="syncTime" label="推送时间" width="150"></el-table-column>
  344. <el-table-column prop="remark" label="推送名称" width="180"></el-table-column>
  345. <el-table-column prop="operator" label="操作人员" width="150"></el-table-column>
  346. <el-table-column prop="syncType" label="推送方式" width="150"></el-table-column>
  347. <el-table-column prop="result" label="推送结果" width="250">
  348. <template slot-scope="scope">
  349. <span style="color:green;" v-if="scope.row.result.includes('成功')">{{scope.row.result}}</span>
  350. <span style="color:red;" v-if="scope.row.result.includes('失败')">{{scope.row.result}}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column prop="resultRemark" label="备注" width="400"></el-table-column>
  354. </el-table>
  355. </template>
  356. <span slot="footer" class="dialog-footer">
  357. <el-button type="primary" @click="pushWorkTimeLogDig = false">关 闭</el-button>
  358. </span>
  359. </el-dialog>
  360. <!-- 填写日报的dialog -->
  361. <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">
  362. <div style="height: 65vh;overflow: auto;">
  363. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  364. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  365. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  366. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  367. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  368. <span class="spnn" v-if="workForm.userNames">
  369. <span v-for="(item, index) in workForm.userNames" :key="index">
  370. <span><ww-open-data type='userName' :openid='item'></ww-open-data></span>
  371. <span v-if="index < workForm.userNames.length - 1">,</span>
  372. </span>
  373. </span>
  374. <span class="spnn hover" v-else>
  375. {{$t('defaultText.pleaseSelectAsubstitute')}}
  376. </span>
  377. </div>
  378. </el-form-item>
  379. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  380. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  381. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  382. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  383. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  384. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  385. <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>
  386. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  387. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  388. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  389. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  390. <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>
  391. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  392. <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
  393. </span>
  394. <!--批量填报和批量代填不显示考勤记录-->
  395. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  396. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  397. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">{{',考勤时长'}}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  398. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  399. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  400. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  401. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  402. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  403. @click="refreshAttendance(workForm.createDate)"></el-button>
  404. <!-- AI智能填报 -->
  405. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
  406. </el-form-item>
  407. <!-- 000000 -->
  408. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  409. <div v-if="reportTimeType.multiWorktime==0">
  410. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  411. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  412. <el-select v-model="domain.timeType" style="width:200px;"
  413. v-if="reportTimeType.type == 0"
  414. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  415. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  416. @change="onTimeTypeChange(domain.timeType)">
  417. <el-option
  418. v-for="item in timeType"
  419. :key="item.value"
  420. :label="item.label"
  421. :value="item.value">
  422. </el-option>
  423. </el-select>
  424. <!-- 数字时长选择 -->
  425. <el-select v-model="domain.workingTime" style="width:200px;"
  426. v-if="reportTimeType.type == 1"
  427. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  428. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  429. @change="seleChn(0,domain)">
  430. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  431. </el-select>
  432. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  433. <span v-if="reportTimeType.type == 2">
  434. <!--时间范围选择 -->
  435. <el-time-picker
  436. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  437. v-model="domain.startTime"
  438. :placeholder="$t('time.startTime')"
  439. style="width:120px;"
  440. format="HH:mm"
  441. value-format="HH:mm"
  442. :picker-options="{
  443. start: '08:00',
  444. end: '23:30'
  445. }"
  446. @change="iptChang()">
  447. </el-time-picker> - <el-time-picker
  448. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  449. v-model="domain.endTime"
  450. :placeholder="$t('time.endTime')"
  451. style="width:120px;"
  452. format="HH:mm"
  453. value-format="HH:mm"
  454. :picker-options="{
  455. start: '08:00',
  456. end: '23:30',
  457. minTime: domain.startTime
  458. }"
  459. @change="iptChang()">
  460. </el-time-picker>
  461. </span>
  462. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  463. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  464. <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>
  465. </div>
  466. </el-form-item>
  467. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  468. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  469. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  470. @change="selectProject(domain, index)"
  471. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  472. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  473. <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">
  474. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  475. <span style="float: right;">{{ item.projectName }}</span>
  476. </el-option>
  477. </el-option-group>
  478. </el-select>
  479. <!--昱众不显示子项目-->
  480. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  481. <span style="margin-left:45px;">
  482. {{$t('lable.subproject')}}</span>
  483. <!--子项目 -->
  484. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  485. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  486. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  487. </el-select>
  488. </template>
  489. <template v-if="user.companyId == yuzhongCompId">
  490. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">角色选择</span>
  491. <!--角色选择 -->
  492. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  493. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  494. <el-option
  495. v-for="item in roleList"
  496. :key="item.value"
  497. :label="item.label"
  498. :value="item.value">
  499. </el-option>
  500. </el-select>
  501. </template>
  502. <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%;"
  503. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  504. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  505. </el-link>
  506. <!-- <el-link type="primary" v-if="canEdit"
  507. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  508. </el-form-item>
  509. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  510. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  511. </el-form-item>
  512. <!--如果设置了工时成本预警的预算成本项-->
  513. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  514. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  515. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  516. </el-select>
  517. </el-form-item>
  518. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  519. <template slot="label">
  520. <span style="color:#FF0000;" v-if="user.timeType.reportAuditType == 1 ||user.timeType.reportAuditType == 2">*</span>
  521. <span >{{$t('lable.taskGrouping')}}</span>
  522. </template>
  523. <!-- 任务分组 -->
  524. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  525. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  526. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  527. </el-select>
  528. <template v-if="user.companyId == yuzhongCompId">
  529. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>工作职责</span>
  530. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" placeHolder="请选择"
  531. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  532. <el-option
  533. v-for="item in domain.filteredRespList"
  534. :key="item.id"
  535. :label="item.jobRespon"
  536. :value="item.id">
  537. </el-option>
  538. </el-select>
  539. </template>
  540. <template v-else><!-- 项目的阶段 -->
  541. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;">{{$t('other.inputStage')}}</span>
  542. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  543. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  544. @change="changeStages(domain, index)"
  545. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  546. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  547. </el-select>
  548. </template>
  549. </el-form-item>
  550. <div v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList">
  551. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  552. <template slot="label">
  553. <span style="color:#FF0000;">*</span>
  554. <span >{{user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')}}</span>
  555. </template>
  556. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  557. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  558. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  559. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  560. </el-option>
  561. </el-select>
  562. <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>
  563. </el-form-item>
  564. </div>
  565. <el-form-item v-if="user.companyId == yuzhongCompId">
  566. <template slot="label">
  567. <span style="color:#FF0000;">*</span>
  568. <span >工作内容</span>
  569. </template>
  570. <el-select v-model="domain.extraField3" style="width:200px;" placeHolder="请选择" @change="$forceUpdate()"
  571. :disabled="(workForm.domains[index].state>=2?false:true)" >
  572. <el-option
  573. v-for="item in domain.workContentList"
  574. :key="item.id"
  575. :label="item.workContext"
  576. :value="item.id">
  577. </el-option>
  578. </el-select>
  579. </el-form-item>
  580. <!-- 111111 -->
  581. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  582. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  583. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  584. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  585. <span v-else>{{item.name}}</span>
  586. </el-option>
  587. </el-select>
  588. <template v-if="user.timeType.auditLevel > 1">
  589. <i class="el-icon-right"></i>
  590. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  591. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  592. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  593. <span v-else>{{item.name}}</span>
  594. </el-option>
  595. </el-select>
  596. </template>
  597. <template v-if="user.timeType.auditLevel > 2">
  598. <i class="el-icon-right"></i>
  599. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  600. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  601. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  602. <span v-else>{{item.name}}</span>
  603. </el-option>
  604. </el-select>
  605. </template>
  606. </el-form-item>
  607. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  608. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  609. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  610. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  611. <span v-else>{{item.name}}</span>
  612. </el-option>
  613. </el-select>
  614. </el-form-item>
  615. <!-- 相关维度/自定义维度 -->
  616. <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'">
  617. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  618. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <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'">
  623. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  624. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  625. </el-option>
  626. </el-select>
  627. </el-form-item>
  628. <!-- 相关数值 -->
  629. <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">
  630. <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>
  631. </el-form-item>
  632. <!-- 自定义文本 -->
  633. <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">
  634. <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>
  635. </el-form-item>
  636. <!--按比例填报-->
  637. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  638. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  639. <div style="width:400px;">
  640. <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>
  641. <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>
  642. </div>
  643. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  644. <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>
  645. </div>
  646. </el-form-item>
  647. <!--工程专业版本模式下, 各个专业的进度填报 -->
  648. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  649. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  650. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  651. <el-input size="mini" style="width:60px;" v-model="item.progress"
  652. @keyup.native="onProgressChange"
  653. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  654. </span>
  655. </el-form-item>
  656. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  657. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  658. <template slot="label" v-if="user.timeType.taskRequired == 1">
  659. <span style="color:#FF0000;">*</span>
  660. <span >任务</span>
  661. </template>
  662. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  663. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  664. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  665. </el-select>
  666. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  667. </el-form-item>
  668. <!--针对依斯贝的SAP服务-->
  669. <el-form-item v-if="user.companyId==3092" label="服务" :prop="'domains.' + index + '.sapServiceId'"
  670. :rules=" { required: true, message: '请选择服务', trigger: 'blur' }">
  671. <el-select v-model="domain.sapServiceId" placeholder="请选择服务" style="width:75%;margin-right:7%" filterable="true"
  672. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  673. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  674. </el-select>
  675. </el-form-item>
  676. <!--工作事项-->
  677. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  678. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  679. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  680. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  681. </el-form-item>
  682. <!-- 拍照上传 -->
  683. <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  684. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: '请选择图片', trigger: 'blur' } : null">
  685. <div class="photos">
  686. <div>
  687. <el-upload
  688. list-type="picture-card"
  689. :http-request="(file) => {return addImg(file, index)}"
  690. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  691. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  692. :file-list="domain.imgListUrl" :limit="9"
  693. :disabled="workForm.domains[index].state>=2?false:true">
  694. <i class="el-icon-plus"></i>
  695. </el-upload>
  696. </div>
  697. </div>
  698. </el-form-item>
  699. </div>
  700. <!--多个工作事项填报的情况 -->
  701. <div v-if="reportTimeType.multiWorktime==1">
  702. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  703. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  704. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  705. @change="selectProject(domain, index)"
  706. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  707. <!-- <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">
  708. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  709. <span style="float: right;">{{ item.projectName }}</span>
  710. </el-option> -->
  711. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  712. <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">
  713. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  714. <span style="float: right;">{{ item.projectName }}</span>
  715. </el-option>
  716. </el-option-group>
  717. </el-select>
  718. <template v-if="user.timeType.mainProjectState != 1">
  719. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  720. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  721. <!--子项目 -->
  722. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  723. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  724. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  725. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  726. </el-select>
  727. </template>
  728. <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;"
  729. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  730. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  731. </el-link>
  732. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  733. <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>
  734. </div>
  735. <!-- <el-link type="primary" v-if="canEdit"
  736. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  737. </el-form-item>
  738. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  739. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  740. </el-form-item>
  741. <!--如果设置了工时成本预警的预算成本项-->
  742. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  743. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  744. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  745. </el-select>
  746. </el-form-item>
  747. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  748. <!-- 任务分组 -->
  749. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  750. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  751. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  752. </el-select>
  753. <!-- 项目的阶段 -->
  754. <span v-if="domain.stages != null && domain.stages.length> 0"
  755. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  756. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  757. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  758. @change="changeStages(domain, index)"
  759. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  760. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  761. </el-select>
  762. </el-form-item>
  763. <el-form-item :label="$t('other.projectAuditor')" >
  764. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  765. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  766. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  767. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  768. </el-option>
  769. </el-select>
  770. <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>
  771. </el-form-item>
  772. <!--工程专业版本模式下, 各个专业的进度填报 -->
  773. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  774. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  775. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  776. <el-input size="mini" style="width:60px;" v-model="item.progress"
  777. @keyup.native="onProgressChange"
  778. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  779. </span>
  780. </el-form-item>
  781. <!-- 相关维度 -->
  782. <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'">
  783. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  784. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  785. </el-option>
  786. </el-select>
  787. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  788. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  789. </el-option>
  790. </el-select>
  791. </el-form-item>
  792. <!-- 相关数值 -->
  793. <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">
  794. <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>
  795. </el-form-item>
  796. <!-- 自定义文本 -->
  797. <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">
  798. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  799. </el-form-item>
  800. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  801. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  802. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  803. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  804. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  805. </el-select>
  806. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  807. </el-form-item>
  808. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  809. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  810. <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>
  811. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  812. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  813. <span v-if="reportTimeType.type == 2">
  814. <!-- <span> -->
  815. <!--时间范围选择 -->
  816. <el-time-picker
  817. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  818. v-model="timeItem.startTime"
  819. :placeholder="$t('time.startTime')"
  820. style="width:120px;"
  821. format="HH:mm"
  822. value-format="HH:mm"
  823. :picker-options="{
  824. start: '00:00',
  825. end: '23:59',
  826. }"
  827. @change="iptChangs()">
  828. </el-time-picker> - <el-time-picker
  829. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  830. v-model="timeItem.endTime"
  831. :placeholder="$t('time.endTime')"
  832. style="width:120px;"
  833. format="HH:mm"
  834. value-format="HH:mm"
  835. :picker-options="{
  836. start: '00:00',
  837. end: '23:59',
  838. minTime: timeItem.startTime
  839. }"
  840. @change="iptChangs()">
  841. </el-time-picker>
  842. </span>
  843. </el-form-item>
  844. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  845. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  846. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  847. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  848. ></el-input>
  849. </el-form-item>
  850. </div>
  851. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  852. </div>
  853. <!--照片的显示 -->
  854. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  855. <el-image v-for="(pic, index) in domain.pics" :key="index"
  856. style="width: 100px; height: 100px; margin-right:10px;"
  857. :src="pic"
  858. :preview-src-list="domain.pics">
  859. </el-image>
  860. </p>
  861. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  862. </div>
  863. <span id="workFormsItemBottom"></span>
  864. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  865. </el-form>
  866. </div>
  867. <span slot="footer" class="dialog-footer">
  868. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  869. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">合计工时:{{totalReportHours}}小时</span>
  870. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  871. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  872. <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>
  873. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  874. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  875. </span>
  876. </el-dialog>
  877. <!-- 按周填报 -->
  878. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  879. <!-- 按周填报-已填工时-点击 -->
  880. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  881. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  882. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  883. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  884. <el-table-column prop="state" :label="$t('state.states')">
  885. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  886. </el-table-column>
  887. <!-- <el-table-column label="操作">
  888. <template slot-scope="scope">
  889. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  890. </template>
  891. </el-table-column> -->
  892. </el-table>
  893. <span slot="footer" class="dialog-footer">
  894. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  895. </span>
  896. </el-dialog>
  897. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px">
  898. <el-form-item style="height:30px;margin-top:-72px;">
  899. <!-- <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> -->
  900. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  901. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  902. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  903. <!-- <el-button @click="newDates()" size="small">{{$t('time.addedDate')}}</el-button> -->
  904. <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>
  905. <el-option
  906. v-for="item in fillProjectList"
  907. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  908. :key="item.id"
  909. :label="item.projectName + '\u3000' + item.projectCode"
  910. :value="item.id">
  911. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  912. <span style="float: right">{{ item.projectName }}</span>
  913. </el-option>
  914. </el-select>
  915. <span style="float:right;margin-right:10px;">选择项目</span>
  916. </el-form-item>
  917. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  918. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  919. <template slot-scope="scope">
  920. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  921. </template>
  922. </el-table-column>
  923. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  924. <template slot-scope="scope">
  925. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  926. <p v-else></p>
  927. </template>
  928. </el-table-column> -->
  929. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  930. <template slot-scope="scope">
  931. <div v-if="scope.row.canFill == 1">
  932. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  933. <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>
  934. <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>
  935. <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>
  936. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  937. </div>
  938. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  939. <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>
  940. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  941. </div>
  942. </div>
  943. <div v-else >
  944. <span style="color:#999999;">不可超前填报</span>
  945. </div>
  946. </template>
  947. </el-table-column>
  948. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  949. <template slot-scope="scope">
  950. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}</span>
  951. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  952. </template>
  953. </el-table-column>
  954. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  955. <template slot-scope="scope">
  956. <div class="zhiss">
  957. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  958. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  959. </div>
  960. </template>
  961. </el-table-column>
  962. </el-table>
  963. </el-form>
  964. <span slot="footer" class="dialog-footer" >
  965. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  966. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  967. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  968. <el-button type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  969. </span>
  970. </el-dialog>
  971. <!-- 重庆物奇私人定制的按周填报 -->
  972. <el-dialog :title="'按周填报'" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  973. <div class="fillWeekDialogVisiCustom">
  974. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  975. </div>
  976. </el-dialog>
  977. <!-- 选择时间 -->
  978. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  979. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  980. <span slot="footer" class="dialog-footer">
  981. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  982. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  983. </span>
  984. </el-dialog>
  985. <!-- 按周填报弹窗 -->
  986. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  987. <div>
  988. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  989. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  990. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  991. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  992. </el-select>
  993. </div>
  994. <!--如果设置了工时成本预警的预算成本项-->
  995. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  996. <p>{{$t('lable.budgetSource')}}</p>
  997. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  998. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  999. </el-select>
  1000. </div>
  1001. <!-- 任务分组 -->
  1002. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1003. <p>{{$t('lable.taskGrouping')}}</p>
  1004. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1005. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1006. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1007. </el-select>
  1008. </div>
  1009. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  1010. <p>{{$t('other.inputStage')}}</p>
  1011. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1012. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1013. </el-select>
  1014. </div>
  1015. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1016. <p>{{$t('other.reviewer')}}</p>
  1017. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1018. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1019. </el-select>
  1020. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1021. </div>
  1022. <template v-if="user.timeType.reportAuditType == 3">
  1023. <div class="zhoFel">
  1024. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1025. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1026. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1027. </el-select>
  1028. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1029. </div>
  1030. <div class="zhoFel">
  1031. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1032. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1033. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1034. </el-select>
  1035. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1036. </div>
  1037. <div class="zhoFel">
  1038. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1039. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1040. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1041. </el-select>
  1042. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1043. </div>
  1044. <div class="zhoFel">
  1045. <p>{{ $t('chao-song-ren') }}</p>
  1046. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1047. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1048. </el-select>
  1049. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1050. </div>
  1051. </template>
  1052. <!-- 自定义维度 -->
  1053. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1054. <p>{{user.timeType.customDegreeName}}</p>
  1055. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1056. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1057. </el-select>
  1058. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1059. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1060. </el-select>
  1061. </div>
  1062. <!-- 自定义数值 -->
  1063. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1064. <p>{{user.timeType.customDataName}}</p>
  1065. <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>
  1066. </div>
  1067. <!-- 自定义文本 -->
  1068. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1069. <p>{{user.timeType.customTextName}}</p>
  1070. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1071. </div>
  1072. <!-- 选择任务 -->
  1073. <div class="zhoFel" v-if="user.company.packageProject==1 && user.company.nonProjectSimple==0">
  1074. <p>任务 / 里程碑</p>
  1075. <el-select v-model="zhoBao.taskId" :placeholder="'请选择'" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1076. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1080. <p>{{$t('other.timeSelection')}}</p>
  1081. <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>
  1082. </div>
  1083. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1084. <p>{{$t('other.chooseDuration')}}</p>
  1085. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1086. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1087. </el-select>
  1088. </div>
  1089. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1090. <p>{{$t('lable.percentageOfTime')}}</p>
  1091. <div style="width:400px;display: flex;align-items: center;">
  1092. <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>
  1093. <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>
  1094. </div>
  1095. </div>
  1096. <div class="zhoFel">
  1097. <p>{{$t('other.workMatters')}}</p>
  1098. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1099. </div>
  1100. </div>
  1101. <span slot="footer" class="dialog-footer">
  1102. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1103. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1104. </span>
  1105. </el-dialog>
  1106. <!--导出报表条件选择 -->
  1107. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1108. <el-form ref="form3" :model="exportParam" >
  1109. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1110. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1111. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1112. </el-select>
  1113. </el-form-item>
  1114. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1115. <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>
  1116. <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>
  1117. </el-form-item>
  1118. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1119. <el-date-picker
  1120. v-model="exportParam.dateRange" :editable="false"
  1121. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1122. :range-separator="$t('other.to')"
  1123. type="daterange"
  1124. :start-placeholder="$t('time.startDate')"
  1125. :end-placeholder="$t('time.endDate')"
  1126. ></el-date-picker>
  1127. </el-form-item>
  1128. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1129. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1130. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1131. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1132. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1133. </el-select>
  1134. </el-form-item>
  1135. <el-form-item prop="exportType" :label="'导出方式'" v-if="user.companyId == '936'">
  1136. <div class="exportReportRadio">
  1137. <el-radio v-model="exportType" :label="0">完整导出</el-radio>
  1138. <el-radio v-model="exportType" :label="1">精简导出</el-radio>
  1139. <el-tooltip effect="dark" :content="'精简日报不含工作事项和审批信息,数据量更小导出更快。'" placement="top-start">
  1140. <i class="el-icon-question"></i>
  1141. </el-tooltip>
  1142. </div>
  1143. </el-form-item>
  1144. </el-form>
  1145. <div slot="footer" class="dialog-footer">
  1146. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1147. </div>
  1148. </el-dialog>
  1149. <!--导出报表条件选择 -->
  1150. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1151. <el-form ref="form3" :model="exportParam" >
  1152. <el-form-item prop="range" :label="$t('time.dateRange')">
  1153. <el-date-picker
  1154. v-model="exportParam.dateRange" :editable="false"
  1155. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1156. :clearable="true"
  1157. :range-separator="$t('other.to')"
  1158. type="daterange"
  1159. :start-placeholder="$t('time.startDate')"
  1160. :end-placeholder="$t('time.endDate')"
  1161. ></el-date-picker>
  1162. </el-form-item>
  1163. </el-form>
  1164. <div slot="footer" class="dialog-footer">
  1165. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1166. </div>
  1167. </el-dialog>
  1168. <!--人员列表 -->
  1169. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1170. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1171. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1172. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1173. <el-table-column type="selection"></el-table-column>
  1174. <el-table-column prop="label" :label="$t('lable.name')" >
  1175. <template slot-scope="scope">
  1176. <span>
  1177. <!-- {{(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}} -->
  1178. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1179. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1180. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1181. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1182. </span>
  1183. <span v-else>
  1184. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1185. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1186. </span>
  1187. </span>
  1188. </template>
  1189. </el-table-column>
  1190. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1191. <template slot-scope="scope">
  1192. <div>
  1193. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1194. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1195. </div>
  1196. </template>
  1197. </el-table-column>
  1198. </el-table>
  1199. </el-tab-pane>
  1200. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1201. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1202. <el-table-column prop="label" :label="$t('lable.name')" >
  1203. <template slot-scope="scope">
  1204. <!-- <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> -->
  1205. <!-- <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> -->
  1206. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1207. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1208. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1209. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1210. </span>
  1211. <span v-else>
  1212. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1213. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1214. </span>
  1215. </template>
  1216. </el-table-column>
  1217. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1218. <template slot-scope="scope">
  1219. <div>
  1220. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1221. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1222. </div>
  1223. </template>
  1224. </el-table-column>
  1225. </el-table>
  1226. </el-tab-pane>
  1227. </el-tabs>
  1228. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1229. <el-table-column type="selection"></el-table-column>
  1230. <el-table-column prop="label" :label="$t('lable.name')" >
  1231. <template slot-scope="scope">
  1232. <div>
  1233. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.label'></ww-open-data></span>
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. </div>
  1236. </template>
  1237. </el-table-column>
  1238. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1239. <template slot-scope="scope">
  1240. <div>
  1241. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='scope.row.deptName'></ww-open-data></span>
  1242. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1243. </div>
  1244. </template>
  1245. </el-table-column>
  1246. </el-table>
  1247. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1248. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1249. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1250. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1251. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1252. </div>
  1253. </el-dialog>
  1254. <!-- 按部门选择人员 -->
  1255. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1256. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1257. <el-input v-if="user.userNameNeedTranslate == 1" placeholder="请输入姓名搜索" v-model.trim="nameAearch" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1258. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1259. </el-input>
  1260. <div class="tree" style="height:400px">
  1261. <el-scrollbar style="height:100%">
  1262. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1263. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1264. highlight-current :filter-node-method="filterNode">
  1265. <span class="custom-tree-node" slot-scope="{ node }">
  1266. <span v-if="user.userNameNeedTranslate == '1'">
  1267. <span v-if="node.data.children">
  1268. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  1269. </span>
  1270. <span v-else>
  1271. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  1272. </span>
  1273. </span>
  1274. <span v-if="user.userNameNeedTranslate != '1'">
  1275. {{ node.label }}
  1276. </span>
  1277. <!-- {{ node.label }} -->
  1278. </span>
  1279. </el-tree>
  1280. </el-scrollbar>
  1281. </div>
  1282. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1283. <div slot="footer" class="dialog-footer">
  1284. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1285. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1286. </div>
  1287. </el-dialog>
  1288. <el-dialog
  1289. v-if="monthWorkTimeDialog"
  1290. :visible.sync="monthWorkTimeDialog"
  1291. :close-on-click-modal="false"
  1292. customClass="customWidth selectworktime"
  1293. width="1200px"
  1294. title=""
  1295. >
  1296. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1297. <el-tabs v-model="activeName" @tab-click="handleClick">
  1298. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1299. <div class="selectworktime_export" style="margin-top:10px;">
  1300. <div class="selectworktime_export_l">
  1301. <el-date-picker
  1302. class="selecteworktime_datapick"
  1303. v-model="WorktimeDatepickValue"
  1304. value-format="yyyy-MM-dd"
  1305. type="daterange"
  1306. align="right"
  1307. unlink-panels
  1308. :range-separator="$t('other.to')"
  1309. :start-placeholder="$t('time.startDate')"
  1310. :end-placeholder="$t('time.endDate')"
  1311. :default-time="['12:00:00', '12:00:00']"
  1312. size="small"
  1313. popper-class="selecteorktime_datapick_popper"
  1314. @change="showMonthWorkTime()"
  1315. >
  1316. </el-date-picker>
  1317. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1318. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1319. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1320. <!-- 222 -->
  1321. </div>
  1322. <div>
  1323. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1324. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1325. </el-input>
  1326. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1327. </div>
  1328. <el-link
  1329. type="primary"
  1330. style="float: right; vertical-align: middle;height:32px"
  1331. @click="exportMembWorkHours()"
  1332. >{{$t('export.exportData')}}</el-link
  1333. >
  1334. </div>
  1335. <el-table ref="hasworkTbl"
  1336. :data="monthWorkDataS"
  1337. v-el-table-infinite-scroll="listScroll"
  1338. border
  1339. :height="500"
  1340. highlight-current-row
  1341. style="width: 100%"
  1342. v-loading="tbload"
  1343. :lazy="true"
  1344. >
  1345. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1346. <template slot-scope="scope">
  1347. {{ scope.$index + 1 }}
  1348. </template>
  1349. </el-table-column>
  1350. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1351. <template slot-scope="scope">
  1352. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1353. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1354. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1355. <!-- {{scope.row.name}} -->
  1356. </span>
  1357. </template>
  1358. </el-table-column>
  1359. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1360. <template slot-scope="scope">
  1361. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1362. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1363. </template>
  1364. </el-table-column>
  1365. <el-table-column
  1366. min-width="105"
  1367. v-for="(item, index) in pickDateArray"
  1368. :key="index"
  1369. :label="item.label"
  1370. align="center"
  1371. >
  1372. <template slot-scope="scope">
  1373. <div
  1374. style="color: red"
  1375. v-if="
  1376. scope.row.worktimeList.filter(
  1377. (w) =>
  1378. w.createDate==item.date
  1379. ).length > 0 &&
  1380. scope.row.worktimeList.filter(
  1381. (w) =>w.createDate==item.date
  1382. )[0].workingTime < reportTimeType.allday
  1383. "
  1384. >
  1385. {{
  1386. scope.row.worktimeList.filter(
  1387. (w) =>w.createDate==item.date
  1388. )[0].workingTime.toFixed(1)
  1389. }}
  1390. </div>
  1391. <div
  1392. style="color: #20a0ff"
  1393. v-if="
  1394. scope.row.worktimeList.filter(
  1395. (w) =>w.createDate==item.date
  1396. ).length > 0 &&
  1397. scope.row.worktimeList.filter(
  1398. (w) =>w.createDate==item.date
  1399. )[0].workingTime > reportTimeType.allday
  1400. "
  1401. >
  1402. {{
  1403. scope.row.worktimeList.filter(
  1404. (w) =>w.createDate==item.date
  1405. )[0].workingTime.toFixed(1)
  1406. }}
  1407. </div>
  1408. <div
  1409. v-if="
  1410. scope.row.worktimeList.filter(
  1411. (w) =>w.createDate==item.date
  1412. ).length > 0 &&
  1413. scope.row.worktimeList.filter(
  1414. (w) =>w.createDate==item.date
  1415. )[0].workingTime == reportTimeType.allday
  1416. "
  1417. >
  1418. {{
  1419. scope.row.worktimeList.filter(
  1420. (w) =>w.createDate==item.date
  1421. )[0].workingTime
  1422. }}
  1423. </div>
  1424. <div
  1425. v-if="
  1426. scope.row.worktimeList.filter(
  1427. (w) =>w.createDate==item.date
  1428. ).length == 0
  1429. "
  1430. >
  1431. 0
  1432. </div>
  1433. <div
  1434. v-if="
  1435. scope.row.worktimeList.filter(
  1436. (w) =>w.createDate==item.date
  1437. ).length > 0 &&
  1438. typeof scope.row.worktimeList.filter(
  1439. (w) =>w.createDate==item.date
  1440. )[0].workingTime == 'string'
  1441. "
  1442. >
  1443. {{
  1444. scope.row.worktimeList.filter(
  1445. (w) =>w.createDate==item.date
  1446. )[0].workingTime
  1447. }}
  1448. </div>
  1449. </template>
  1450. </el-table-column>
  1451. </el-table>
  1452. <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>
  1453. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1454. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1455. <label style="font-size: 16px">员工每日已填报工时数</label>
  1456. <el-link
  1457. type="primary"
  1458. style="float: right; margin-right: 60px"
  1459. @click="exportMembWorkHours()"
  1460. >导出已填报数据</el-link
  1461. > -->
  1462. <!-- <el-button >导出</el-button> -->
  1463. <!-- </div> -->
  1464. </el-tab-pane>
  1465. <el-tab-pane label="未提交人员列表" name="second" >
  1466. <div class="selectworktime_export" style="margin-top:10px">
  1467. <div class="selectworktime_export_l">
  1468. <el-date-picker
  1469. class="selecteworktime_datapick"
  1470. v-model="WorktimeDatepickValue"
  1471. value-format="yyyy-MM-dd"
  1472. type="daterange"
  1473. align="right"
  1474. unlink-panels
  1475. :range-separator="$t('other.to')"
  1476. :start-placeholder="$t('time.startDate')"
  1477. :end-placeholder="$t('time.endDate')"
  1478. :default-time="['12:00:00', '12:00:00']"
  1479. size="small"
  1480. popper-class="selecteorktime_datapick_popper"
  1481. @change="showMonthNotWorkTime()"
  1482. >
  1483. </el-date-picker>
  1484. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1485. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1486. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1487. </div>
  1488. <div>
  1489. <div style="margin-top:10px;">
  1490. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1491. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')" @change="showMonthNotWorkTime()"></vueCascader>
  1492. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1493. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1494. </el-input>
  1495. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1496. <el-link
  1497. type="primary"
  1498. style="float: right; vertical-align: middle;height:32px"
  1499. @click="exportMembNotWorkHours()"
  1500. >{{$t('export.exportData')}}</el-link
  1501. >
  1502. </div>
  1503. </div>
  1504. </div>
  1505. <el-table
  1506. ref="hasworkTbl2"
  1507. :data="monthNotWorkDateS"
  1508. v-el-table-infinite-scroll="notListScroll"
  1509. border
  1510. :height="500"
  1511. highlight-current-row
  1512. style="width: 100%"
  1513. v-loading="tbload"
  1514. lazy
  1515. >
  1516. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1517. <template slot-scope="scope">
  1518. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1519. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1520. </template>
  1521. </el-table-column>
  1522. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1523. <template slot-scope="scope">
  1524. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1525. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1526. </template>
  1527. </el-table-column>
  1528. <el-table-column
  1529. min-width="200"
  1530. :label="$t('weekDay.date')"
  1531. align="center"
  1532. prop="createDate"
  1533. >
  1534. </el-table-column>
  1535. <el-table-column
  1536. min-width="200"
  1537. :label="$t('state.states')"
  1538. align="center"
  1539. prop="status"
  1540. />
  1541. <el-table-column
  1542. min-width="200"
  1543. :label="$t('other.attendanceData')"
  1544. prop="cardTime"
  1545. align="center"
  1546. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1547. </el-table>
  1548. <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>
  1549. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1550. </el-tab-pane>
  1551. </el-tabs>
  1552. </el-dialog>
  1553. <!--驳回弹出框 -->
  1554. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1555. <div>
  1556. <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')" />
  1557. </div>
  1558. <div slot="footer" class="dialog-footer">
  1559. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1560. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1561. </div>
  1562. </el-dialog>
  1563. <!-- 通过弹出框 -->
  1564. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1565. <div>
  1566. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1567. </div>
  1568. <div slot="footer" class="dialog-footer">
  1569. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1570. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1571. </div>
  1572. </el-dialog>
  1573. <!--批量导入日报 -->
  1574. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1575. <p>1. {{$t('other.download')}}
  1576. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1577. </p>
  1578. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1579. <p style="display: flex;justify-content: center;">
  1580. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1581. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1582. </el-upload>
  1583. </p>
  1584. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1585. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1586. </div>
  1587. </el-dialog>
  1588. <!-- 工时导入记录弹窗 -->
  1589. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1590. <div style="height: 452px">
  1591. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1592. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1593. <el-table-column prop="userName" :label="$t('other.operator')">
  1594. <template slot-scope="scope">
  1595. <div>
  1596. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.userName'></ww-open-data></span>
  1597. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1598. </div>
  1599. </template>
  1600. </el-table-column>
  1601. <el-table-column prop="datel" :label="$t('other.document')">
  1602. <template slot-scope="scope">
  1603. <div>
  1604. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1605. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1606. </div>
  1607. </template>
  1608. </el-table-column>
  1609. <el-table-column label="操作" v-if="user.companyId == 469 && user.roleName=='超级管理员'">
  1610. <template slot-scope="scope">
  1611. <div>
  1612. <el-button type="default" size="small" @click="openModImportTime(scope.row)">修改导入记录</el-button>
  1613. <el-button type="primary" size="small" @click="delImportTime(scope.row)">删除记录</el-button>
  1614. </div>
  1615. </template>
  1616. </el-table-column>
  1617. </el-table>
  1618. <el-col :span="24" class="paginatis">
  1619. <el-pagination
  1620. @size-change="handleSizeChange"
  1621. @current-change="handleCurrentChange"
  1622. :page-sizes="[20 , 50 , 80 , 100]"
  1623. :page-size="20"
  1624. layout="total, sizes, prev, pager, next"
  1625. :total="toViewForm.total"
  1626. style="float:right;"
  1627. ></el-pagination>
  1628. </el-col>
  1629. </div>
  1630. </el-dialog>
  1631. <!--基于企业微信考勤数据的工时导入 -->
  1632. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1633. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1634. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1635. </el-step>
  1636. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1637. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1638. </el-steps>
  1639. <div v-if="active==0" style="padding:30px;height:360px;">
  1640. <div style="margin-top:50px;margin-left:280px;">
  1641. <el-date-picker
  1642. v-model="importWxParam.date" :editable="false"
  1643. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1644. :clearable="true"
  1645. :range-separator="$t('other.to')"
  1646. type="daterange"
  1647. :start-placeholder="$t('time.startDate')"
  1648. :end-placeholder="$t('time.endDate')"
  1649. @change="loadCheckInData"
  1650. ></el-date-picker>
  1651. </div>
  1652. </div>
  1653. <div v-if="active==1" style="padding:10px;">
  1654. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1655. style="width: 100%;margin-top:5px;" >
  1656. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1657. <template slot-scope="scope">
  1658. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1659. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1660. </template>
  1661. </el-table-column>
  1662. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1663. </el-table-column>
  1664. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1665. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1666. <template slot-scope="scope">
  1667. <div>
  1668. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1669. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1670. </div>
  1671. </template>
  1672. </el-table-column>
  1673. <el-table-column prop="departmentName" label="部门" >
  1674. <template slot-scope="scope">
  1675. <div>
  1676. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1677. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1678. </div>
  1679. </template>
  1680. </el-table-column>
  1681. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1682. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1683. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1684. <template slot-scope="scope">
  1685. {{scope.row.workHours.toFixed(1)}}h
  1686. </template>
  1687. </el-table-column>
  1688. </el-table>
  1689. </div>
  1690. <div v-if="active==2" >
  1691. <p style="display: flex;justify-content: center;height:390px;">
  1692. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1693. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1694. </el-upload>
  1695. </p>
  1696. </div>
  1697. <div slot="title">
  1698. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1699. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1700. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">下载填报工时占比表</el-link>
  1701. <el-link v-if="active==0 && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">导入考勤时长</el-link>
  1702. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">批量删除日报</el-link>
  1703. <el-link v-if="active==0 && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">批量审核日报</el-link>
  1704. </div>
  1705. <span slot="footer">
  1706. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1707. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1708. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1709. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1710. </span>
  1711. </el-dialog>
  1712. <el-dialog title="导入考勤时长" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1713. <p style="display: flex;justify-content: center;height:100px;">
  1714. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1715. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1716. </el-upload>
  1717. </p>
  1718. </el-dialog>
  1719. <el-dialog title="批量删除日报" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1720. <div>
  1721. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1722. v-model="deleteReportParam.date" :editable="false"
  1723. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1724. :clearable="true"
  1725. :range-separator="$t('other.to')"
  1726. type="daterange"
  1727. :start-placeholder="$t('time.startDate')"
  1728. :end-placeholder="$t('time.endDate')"
  1729. ></el-date-picker>
  1730. </div>
  1731. <div style="margin-top:10px;">
  1732. <span>请选择部门:</span>
  1733. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" placeholder="请选择部门" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  1734. <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>
  1735. </div>
  1736. <div style="margin-top:10px;">
  1737. <span>请选择员工:</span>
  1738. <el-select v-model="deleteReportParam.userIds" placeholder="请选择" style="width:500px;" filterable multiple>
  1739. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1740. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1741. <span v-else>{{item.name}}</span>
  1742. </el-option>
  1743. </el-select>
  1744. </div>
  1745. <span slot="footer">
  1746. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >开始删除</el-button>
  1747. </span>
  1748. </el-dialog>
  1749. <el-dialog title="批量审核日报" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  1750. <div>
  1751. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1752. v-model="deleteReportParam.date" :editable="false"
  1753. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1754. :clearable="true"
  1755. :range-separator="$t('other.to')"
  1756. type="daterange"
  1757. :start-placeholder="$t('time.startDate')"
  1758. :end-placeholder="$t('time.endDate')"
  1759. ></el-date-picker>
  1760. </div>
  1761. <div style="margin-top:15px;">
  1762. <span>选择部门:</span>
  1763. <el-cascader v-model="deleteReportParam.departmentId" placeholder="全部部门" style="width: 350px;margin-left:25px;"
  1764. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  1765. size="small" v-if="user.userNameNeedTranslate != 1"
  1766. ></el-cascader>
  1767. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  1768. </div>
  1769. <span slot="footer">
  1770. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >审批通过</el-button>
  1771. </span>
  1772. </el-dialog>
  1773. <el-dialog title="修改导入记录" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  1774. <div>
  1775. <span>选择时间:</span><el-date-picker
  1776. v-model="modImportTime"
  1777. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  1778. :clearable="true"
  1779. type="datetime"
  1780. ></el-date-picker>
  1781. <span>选择导入人员:</span><el-select
  1782. v-model="modImportUserId"
  1783. >
  1784. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  1785. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
  1786. <span v-else>{{item.name}}</span>
  1787. </el-option>
  1788. </el-select>
  1789. </div>
  1790. <span slot="footer">
  1791. <el-button @click="confirmChangeModTime" >确认</el-button>
  1792. </span>
  1793. </el-dialog>
  1794. <el-dialog title="导出员工填报工时占比" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  1795. <div>
  1796. <span>请选择年月:</span>
  1797. <el-date-picker
  1798. v-model="ratioYmonth" :editable="false"
  1799. format="yyyyMM" value-format="yyyyMM"
  1800. type="month"
  1801. ></el-date-picker>
  1802. </div>
  1803. <span slot="footer">
  1804. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">导出</el-button>
  1805. </span>
  1806. </el-dialog>
  1807. <!--工时批量代填 -->
  1808. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1809. <div>
  1810. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1811. v-model="importWxParam.date" :editable="false"
  1812. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1813. :clearable="true"
  1814. :range-separator="$t('other.to')"
  1815. type="daterange"
  1816. :start-placeholder="$t('time.startDate')"
  1817. :end-placeholder="$t('time.endDate')"
  1818. @change="loadCheckInData"
  1819. ></el-date-picker>
  1820. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1821. </div>
  1822. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1823. :key="timeStamp"
  1824. style="width: 100%;margin-top:5px;" ref="tab">
  1825. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1826. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  1827. <template slot-scope="scope">
  1828. <div>
  1829. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.username'></ww-open-data></span>
  1830. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1831. </div>
  1832. </template>
  1833. </el-table-column>
  1834. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1835. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1836. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1837. <template slot-scope="scope">
  1838. {{scope.row.workHours.toFixed(1)}}h
  1839. </template>
  1840. </el-table-column>
  1841. <!--项目名称列表 -->
  1842. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1843. <template slot-scope="scope">
  1844. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1845. </template>
  1846. </el-table-column>
  1847. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1848. <template slot-scope="scope">
  1849. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1850. </template>
  1851. </el-table-column>
  1852. </el-table>
  1853. </el-dialog>
  1854. <!--基于企业微信考勤数据的工时导入 -->
  1855. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1856. <div style="padding-bottom:10px;">
  1857. <p>{{importResultMsg}}</p>
  1858. </div>
  1859. <!-- <span slot="footer" class="dialog-footer">
  1860. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  1861. </span> -->
  1862. </el-dialog>
  1863. <!-- 审核流程展示 -->
  1864. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1865. <div style="padding:20px 40px 20px 0">
  1866. <el-timeline :reverse="false">
  1867. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  1868. <!-- {{item.msg}} -->
  1869. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  1870. <span v-if="user.userNameNeedTranslate == 1">
  1871. <span><ww-open-data type='userName' :openid='item.msgCon.one'></ww-open-data></span>
  1872. <span>{{item.msgCon.two}}</span>
  1873. </span>
  1874. </el-timeline-item>
  1875. </el-timeline>
  1876. </div>
  1877. </el-dialog>
  1878. </section>
  1879. </template>
  1880. <script>
  1881. // 左右滑动
  1882. import dragMixin from "@/common/js/tensile.js";
  1883. import util from "../../common/js/util";
  1884. // 自定义select组件
  1885. import selectCat from "@/components/select.vue"
  1886. // 引入自定义级联组件
  1887. import vueCascader from "@/components/cascader.vue"
  1888. // 重庆物奇定制组件
  1889. import WeeklyCustomization from "./weeklyCustomization.vue"
  1890. import { mapMutations } from 'vuex'
  1891. let _that = this
  1892. export default {
  1893. mixins: [dragMixin],
  1894. components: {
  1895. selectCat,
  1896. vueCascader,
  1897. WeeklyCustomization
  1898. },
  1899. data() {
  1900. return {
  1901. pageIndex: 0,
  1902. hasMore: true,
  1903. exportType: 0,
  1904. exportingData: false,
  1905. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  1906. jobResponseList:[],
  1907. yisibeiCompId: 3092,
  1908. yuzhongCompId: 3385,
  1909. mingyiName : '成都明夷电子科技有限公司',
  1910. // mingyiName : '明夷',
  1911. modItemDataId: null,
  1912. modImportTime: null,
  1913. modImportUserId: null,
  1914. showModImportTimeDialog: false,
  1915. showBatchSimpleApproveReport: false,
  1916. startDeleting: false,
  1917. showBatchDeleteReport: false,
  1918. deleteReportParam: {date:null, userIds:[]},
  1919. isDenying: false,
  1920. targetWeekDate: null,//填写周报中的周日期
  1921. importCardTimeVisi: false,
  1922. startRatioExporting: false,
  1923. exportUserRatio: false,
  1924. ratioYmonth:null,
  1925. hasWrittenReport: false,
  1926. today:null,
  1927. syncTimeLoading: false,
  1928. seluserText: '',
  1929. translation: '1', // 1、文字, 2、部门, 3、人员
  1930. exportLoad: false,
  1931. getPickerOptions: {
  1932. disabledDate: (time) => {
  1933. var date = new Date();
  1934. var year = date.getFullYear();
  1935. var month = date.getMonth() + 1;
  1936. if (month >= 1 && month <= 9) {
  1937. month = "0" + month;
  1938. }
  1939. var currentdate = year.toString() + month.toString();
  1940. var timeyear = time.getFullYear();
  1941. var timemonth = time.getMonth() + 1;
  1942. if (timemonth >= 1 && timemonth <= 9) {
  1943. timemonth = "0" + timemonth;
  1944. }
  1945. var timedate = timeyear.toString() + timemonth.toString();
  1946. if(this.user.timeType.fillAhead == 0){
  1947. return currentdate < timedate;
  1948. }else{
  1949. return false
  1950. }
  1951. }
  1952. },
  1953. alalal: '8.0',
  1954. timeBasecostList:null,
  1955. tbload: false,
  1956. exportTimeDialog: false,
  1957. searchKeyword: '',
  1958. monthWorkDataS: [],
  1959. monthNotWorkDateS: [],
  1960. pickDateArray:[],
  1961. WorktimeDatepickValue: [],
  1962. activeName:"first",
  1963. isLeave: 0,
  1964. submitingReport: false,
  1965. importResultMsg:null,
  1966. showImportResult:false,
  1967. importingData: false,
  1968. isDraft: 0,
  1969. timeStamp: 0,
  1970. projectColumns:[],
  1971. checkinLoading:false,
  1972. importWxParam:{date:null,},
  1973. active:0,
  1974. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1975. importWxDialog:false,
  1976. importDialog:false,
  1977. denyForm:null,
  1978. denyReasonDialog:false,
  1979. monthWorkTimeDialog: false,
  1980. isSubstitude:false,
  1981. isFill:false,
  1982. unFillList:[],
  1983. fillList:[],
  1984. fillMembList:[],
  1985. fillMembList_leave: [],
  1986. membListVisible: false,
  1987. isBatch:0,//是否是批量填报
  1988. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1989. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1990. 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')],
  1991. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1992. fillStatusList: [],
  1993. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1994. exportDialog:false,
  1995. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1996. subProjectList:[],
  1997. canEdit: true,
  1998. originCanEdit: true,
  1999. 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],
  2000. selectTime:null,
  2001. reportTimeType:{},
  2002. curDate:'',
  2003. isAllSelect: false,
  2004. approveDialogVisible:false,
  2005. deptId:null,
  2006. targetUid: null,
  2007. membCount:0,
  2008. selectState:"-1",
  2009. user: JSON.parse(sessionStorage.getItem("user")),
  2010. allUsersList: [],
  2011. showAddMore:false,
  2012. allDate: [],
  2013. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2014. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2015. choseDay: 0,
  2016. tableHeight: 0,
  2017. listLoading: false,
  2018. projectList: [], //项目列表
  2019. fillProjectList: [],
  2020. reportList: [], //日报列表
  2021. reportNames:[], //批量审批列表
  2022. selCon:[], //筛选条件
  2023. selProjectList:[], //筛选后项目列表
  2024. selConShow: true,
  2025. usersList: [], // 全部人员列表
  2026. usersListId: '', // 选中的人员id
  2027. dialogVisible: false, //项目弹窗
  2028. report: '',
  2029. workForm: {
  2030. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2031. domains: [{
  2032. id: null,
  2033. projectId: "",
  2034. workingTime: "",
  2035. timeType:0,
  2036. content: "",
  2037. state: 2,
  2038. multiWorktime:0,
  2039. worktimeList:[],
  2040. degreeId: null,
  2041. auditUserList: [],
  2042. }],
  2043. },
  2044. workRules: {
  2045. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2046. },
  2047. chooseParticipVisible: false,
  2048. logining: false,
  2049. isDisable: false,
  2050. timeType:[],
  2051. deptMembData: [
  2052. ],
  2053. //部门人员树状结构
  2054. data: [
  2055. {
  2056. id: -1,
  2057. label: this.$t('lable.allStaff'),
  2058. membCount:0
  2059. },
  2060. {
  2061. id: 0,
  2062. label: this.$t('lable.unassigned'),
  2063. }
  2064. ],
  2065. allData:{},
  2066. batchShowData:{},
  2067. option: [],
  2068. deptOptionList: [],
  2069. depData: {
  2070. id: -1,
  2071. label: this.$t('lable.allStaff'),
  2072. },
  2073. defaultProps: {
  2074. children: 'children',
  2075. label: 'label'
  2076. },
  2077. isNew: false,
  2078. selected: false,
  2079. valuet: new Date(),
  2080. domObj: null,
  2081. participator:[],
  2082. chosenMembCount:0,
  2083. jsDay: 0,
  2084. jsTime: 0,
  2085. falsss: false,
  2086. weidu: [],
  2087. weiduList: [],
  2088. yonghuUser: [],
  2089. dateAr: [],
  2090. batchSubFillDialog: false,
  2091. isSubstiS: false,
  2092. fillWeekDialogVisi: false,
  2093. fillWeekDialogVisiCustom: false,
  2094. zhoData: [],
  2095. weekDateRange: [],
  2096. btnZho: false,
  2097. weekDataLoading: false,
  2098. changdu: 6,
  2099. tianxieDialogVisible: false,
  2100. scopess: {},
  2101. zhoBao: {
  2102. time: '',
  2103. workingTime: '',
  2104. progress: '',
  2105. con: '',
  2106. subProjectId: '',
  2107. stage: '',
  2108. subProjectList: [],
  2109. stages: [],
  2110. },
  2111. zhoBaoIdx: '',
  2112. zhoBaoName: '',
  2113. zhis: {},
  2114. dealList: [],
  2115. toViewDialogVisible: false,
  2116. toViewList: [],
  2117. toViewloading: true,
  2118. toViewForm: {
  2119. pageIndex: '1',
  2120. pageSize: '20',
  2121. total: 0,
  2122. },
  2123. toViewloadings: false,
  2124. tabPositionss: 'top',
  2125. monthTotal: 0,
  2126. monthTotalPage: 0,
  2127. monthTotalLages: 20,
  2128. monthWorkData: [],
  2129. monthNotWorkDate: [],
  2130. monthWorkDataS1: [],
  2131. monthnotTotal: 0,
  2132. monthnotTotalPage: 0,
  2133. monthnotTotalLages: 20,
  2134. monthNotWorkDateS1: [],
  2135. deptMembDataText: '',
  2136. isFlag: false,
  2137. isMore: false,
  2138. stateKey: '0',
  2139. expandDate: [],
  2140. notifySelList:[],
  2141. departmentList: [],
  2142. approvalProcessDialog: false,
  2143. approvalProcessData: [],
  2144. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2145. 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')],
  2146. isWeekend: false,
  2147. canCancelInDialog: false,
  2148. approveinData: {},
  2149. approveinDialog: false,
  2150. reportCanDelete: false,
  2151. weeklyFilledTimeDialog: false,
  2152. weeklyFilledTimeList: [],
  2153. weeklyFilledTimeLoading: false,
  2154. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2155. weeklyFilledTimeCanDelete: false,
  2156. weeklyFilledTimeDate: null,
  2157. leaveAllNum: 0,
  2158. dataLoading: false,
  2159. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2160. vacationTime: {},
  2161. integrationProjectList: [],
  2162. totalReportHours: 0, // 合计的工时
  2163. workTimeForMinYi:0,
  2164. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2165. weekIndex: 1,
  2166. weekParentData: {},
  2167. deptIdForNoReport:[],
  2168. nameAearch: '', // 企业微信姓名搜索
  2169. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2170. deptMembDataLoading: false,
  2171. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2172. {
  2173. id: 4811,
  2174. // id: 10,
  2175. name: '陕西柘中建设工程有限公司'
  2176. }
  2177. ],
  2178. pushWorkTimeLogDig:false,
  2179. pushWorkTimeLogData:[],
  2180. };
  2181. },
  2182. watch: {
  2183. deptMembDataText(val) {
  2184. this.$refs.chooseMembTree.filter(val);
  2185. }
  2186. },
  2187. filters: {
  2188. // 过滤
  2189. amounts(value) {
  2190. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2191. return 0
  2192. }
  2193. var zhi = +value + 0
  2194. return zhi.toFixed(1)
  2195. },
  2196. // zhoData
  2197. zhoData(value, arr) {
  2198. var dateArray = value.split("-");
  2199. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2200. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2201. // console.log(arr[date.getDay()])
  2202. // return "周" + "日一二三四五六".charAt(date.getDay());
  2203. return arr[date.getDay()]
  2204. },
  2205. // 过滤数字
  2206. numbers(value) {
  2207. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2208. return 0
  2209. }
  2210. return value
  2211. },
  2212. },
  2213. computed: {},
  2214. mounted() {
  2215. var now = new Date();
  2216. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2217. this.today = t;
  2218. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2219. this.exportParam.dateRange = [startStr,t];
  2220. this.getAllDate(1);
  2221. this.getReportList();
  2222. this.getProjectList();
  2223. this.getFillProjectList();
  2224. this.getTimeType();
  2225. this.getDepartment();
  2226. this.scrollFunction()
  2227. this.userssHu();
  2228. if(this.user.timeType.reportAuditType == 3){
  2229. this.getAllUsersList()
  2230. }
  2231. if (this.user.company.packageProject == 1) {
  2232. this.getBasecostItemList();
  2233. }
  2234. if(this.user.timeType.lockWorktime){
  2235. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2236. }
  2237. //设置了下限
  2238. if (this.user.timeType.minReportTime) {
  2239. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2240. }
  2241. const that = this
  2242. if(this.user.userNameNeedTranslate == 1) {
  2243. that.dataLoading = that.$store.state.dataLoading
  2244. this.upDataLoading()
  2245. setTimeout(()=>{
  2246. that.dataLoading = that.$store.state.dataLoading
  2247. }, 1000)
  2248. }
  2249. if (this.user.companyId == this.yuzhongCompId) {
  2250. this.getJobResponList();
  2251. }
  2252. },
  2253. methods: {
  2254. ...mapMutations(['upDataLoading']),
  2255. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2256. isCustomization(userInfo, permissionArray) {
  2257. const { companyId } = userInfo
  2258. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2259. return isReportPictureRequired
  2260. },
  2261. //任务被选中
  2262. onTaskSelected(domainItem) {
  2263. //取服务
  2264. if (domainItem.taskId) {
  2265. var that = this;
  2266. var param = {taskId:domainItem.taskId};
  2267. if (this.isSubstitude) {
  2268. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2269. param.userId = this.workForm.userId[0];
  2270. }
  2271. }
  2272. this.http.post('/task/getMyTaskService',param, res => {
  2273. if (res.code == "ok") {
  2274. // domainItem.workContentList = res.data;
  2275. that.$set(domainItem, 'sapServiceId', null);
  2276. that.$set(domainItem, 'serviceList', res.data);
  2277. } else {
  2278. this.$message({
  2279. message: res.msg,
  2280. type: "error"
  2281. });
  2282. }
  2283. },error => {
  2284. this.$message({
  2285. message: error,
  2286. type: "error"
  2287. });
  2288. }
  2289. );
  2290. } else {
  2291. //清空服务
  2292. }
  2293. },
  2294. onBatchTimeChange() {
  2295. //反向计算每日工作时长
  2296. if (this.workForm.createDate) {
  2297. let sdate = new Date(this.workForm.createDate[0]);
  2298. let edate = new Date(this.workForm.createDate[1]);
  2299. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2300. console.log('days===', days)
  2301. if (days < 0) {
  2302. return;
  2303. }
  2304. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2305. //总时长发生改变,自动按比例计算
  2306. this.workForm.domains.forEach(d=>{
  2307. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2308. });
  2309. }
  2310. },
  2311. //更新工作内容列表
  2312. updateJobContent(domainItem) {
  2313. var that = this;
  2314. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2315. if (res.code == "ok") {
  2316. // domainItem.workContentList = res.data;
  2317. that.$set(domainItem, 'extraField3', null);
  2318. that.$set(domainItem, 'workContentList', res.data);
  2319. } else {
  2320. this.$message({
  2321. message: res.msg,
  2322. type: "error"
  2323. });
  2324. }
  2325. },error => {
  2326. this.$message({
  2327. message: error,
  2328. type: "error"
  2329. });
  2330. }
  2331. );
  2332. },
  2333. updateResponse(domainItem) {
  2334. var that = this;
  2335. var selectPid = domainItem.projectId;
  2336. domainItem.extraField2 = null;
  2337. domainItem.extraField3 = null;
  2338. if (selectPid && domainItem.extraField1) {
  2339. //是否非项目
  2340. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2341. console.log('==========','isPublic=='+isPublic);
  2342. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2343. console.log(filteredRespList);
  2344. domainItem.filteredRespList = filteredRespList;
  2345. }
  2346. },
  2347. getJobResponList() {
  2348. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2349. if (res.code == "ok") {
  2350. this.jobResponseList = res.data;
  2351. } else {
  2352. this.$message({
  2353. message: res.msg,
  2354. type: "error"
  2355. });
  2356. }
  2357. },error => {
  2358. this.$message({
  2359. message: error,
  2360. type: "error"
  2361. });
  2362. }
  2363. );
  2364. },
  2365. openModImportTime(row) {
  2366. this.showModImportTimeDialog = true;
  2367. this.modItemDataId = row.id;
  2368. },
  2369. delImportTime(row) {
  2370. let rowId = row.id;
  2371. this.$confirm('您确定要删除该条记录吗?',this.$t('other.prompts'), {
  2372. confirmButtonText: this.$t('btn.determine'),
  2373. cancelButtonText: this.$t('btn.cancel'),
  2374. type: "warning"
  2375. })
  2376. .then(() => {
  2377. this.http.post('/report-import-log/delete',{
  2378. id: rowId
  2379. },res => {
  2380. if (res.code == "ok") {
  2381. this.$message({
  2382. message: '删除成功',
  2383. type: "success"
  2384. });
  2385. this.getToView();
  2386. } else {
  2387. this.$message({
  2388. message: res.msg,
  2389. type: "error"
  2390. });
  2391. }
  2392. },error => {
  2393. this.$message({
  2394. message: error,
  2395. type: "error"
  2396. });
  2397. }
  2398. );
  2399. }).catch(() => {this.startDeleting = false});
  2400. },
  2401. confirmChangeModTime() {
  2402. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2403. this.$message({
  2404. message: '请选择时间',
  2405. type: "error"
  2406. });
  2407. return;
  2408. }
  2409. this.http.post('/report-import-log/changeTime',{
  2410. modLogDateTime: this.modImportTime,
  2411. modImportUserId: this.modImportUserId,
  2412. id: this.modItemDataId
  2413. },res => {
  2414. if (res.code == "ok") {
  2415. this.$message({
  2416. message: '修改成功',
  2417. type: "success"
  2418. });
  2419. this.getToView();
  2420. this.showModImportTimeDialog = false;
  2421. } else {
  2422. this.$message({
  2423. message: res.msg,
  2424. type: "error"
  2425. });
  2426. }
  2427. },error => {
  2428. this.$message({
  2429. message: error,
  2430. type: "error"
  2431. });
  2432. }
  2433. );
  2434. },
  2435. confirmBatchApproveReport() {
  2436. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2437. this.$message({
  2438. message: '请选择日期范围',
  2439. type: "error"
  2440. });
  2441. return;
  2442. }
  2443. this.$confirm('您确定要审核通过该时间段内全部的日报吗?',this.$t('other.prompts'), {
  2444. confirmButtonText: this.$t('btn.determine'),
  2445. cancelButtonText: this.$t('btn.cancel'),
  2446. type: "warning"
  2447. })
  2448. .then(() => {
  2449. this.startDeleting = true;
  2450. let obj = {
  2451. startDate: this.deleteReportParam.date[0],
  2452. endDate: this.deleteReportParam.date[1]
  2453. }
  2454. if(this.deleteReportParam.departmentId) {
  2455. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2456. } else {
  2457. obj.departmentId = null
  2458. }
  2459. this.http.post('/report/batchApproveByDate',obj,res => {
  2460. if (res.code == "ok") {
  2461. this.$message({
  2462. message: '审核通过',
  2463. type: "success"
  2464. });
  2465. this.getReportList();
  2466. this.getDepartment();
  2467. this.startDeleting = false;
  2468. } else {
  2469. this.$message({
  2470. message: res.msg,
  2471. type: "error"
  2472. });
  2473. }
  2474. },error => {
  2475. this.$message({
  2476. message: error,
  2477. type: "error"
  2478. });
  2479. }
  2480. );
  2481. }).catch(() => {this.startDeleting = false});
  2482. },
  2483. confirmBatchDelReport() {
  2484. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2485. this.$message({
  2486. message: '请选择部门或人员',
  2487. type: "error"
  2488. });
  2489. return;
  2490. }
  2491. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2492. this.$message({
  2493. message: '请选择日期范围',
  2494. type: "error"
  2495. });
  2496. return;
  2497. }
  2498. this.$confirm('您确定要删除该时间段内的日报吗,删除后将不可恢复',this.$t('other.prompts'), {
  2499. confirmButtonText: this.$t('btn.determine'),
  2500. cancelButtonText: this.$t('btn.cancel'),
  2501. type: "warning"
  2502. })
  2503. .then(() => {
  2504. this.startDeleting = true;
  2505. this.http.post('/report/batchDelete',{
  2506. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2507. startDate: this.deleteReportParam.date[0],
  2508. endDate: this.deleteReportParam.date[1],
  2509. deptId: this.deleteReportParam.deptId[0]
  2510. },res => {
  2511. if (res.code == "ok") {
  2512. this.$message({
  2513. message: this.$t('message.successfullyDeleted'),
  2514. type: "success"
  2515. });
  2516. this.getReportList();
  2517. this.getDepartment();
  2518. this.startDeleting = false;
  2519. } else {
  2520. this.$message({
  2521. message: res.msg,
  2522. type: "error"
  2523. });
  2524. }
  2525. },error => {
  2526. this.$message({
  2527. message: error,
  2528. type: "error"
  2529. });
  2530. }
  2531. );
  2532. }).catch(() => {this.startDeleting = false});
  2533. },
  2534. getRecentlyProject() {
  2535. this.http.post('/project/nearProject',{},res => {
  2536. if(res.code == 'ok'){
  2537. let topObj = {
  2538. label: '最近选择项目',
  2539. peojectList: res.data
  2540. }
  2541. let botomObj = {
  2542. label: '全部项目',
  2543. peojectList: this.fillProjectList
  2544. }
  2545. //最近项目如果在fillProjectList中不存在,需要移除
  2546. topObj.peojectList = topObj.peojectList.filter(top=>this.fillProjectList.find(fp=>fp.id==top.id) != null);
  2547. this.integrationProjectList = [topObj, botomObj]
  2548. }else {
  2549. this.$message({
  2550. message: res.msg,
  2551. type: 'error'
  2552. })
  2553. }
  2554. },err => {
  2555. this.$message({
  2556. message: err,
  2557. type: 'error'
  2558. })
  2559. })
  2560. },
  2561. handlePictureCardPreview(file, index) {
  2562. console.log(file, index)
  2563. let arr = []
  2564. let imgArr = this.workForm.domains[index].imgListUrl
  2565. for(var i in imgArr) {
  2566. arr.push(imgArr[i].url)
  2567. }
  2568. console.log(arr, '图片数据')
  2569. const $viewer = this.$viewerApi({
  2570. images: arr
  2571. });
  2572. },
  2573. // 图片上传
  2574. addImg(e, index) {
  2575. console.log(e, '数据')
  2576. let formData = new FormData()
  2577. formData.append('multipartFile', e.file)
  2578. this.http.uploadFile('/common/uploadFile', formData,
  2579. res => {
  2580. if (res.code == "ok") {
  2581. this.$message({
  2582. message: this.$t('uploadedsuccessfully'),
  2583. type: "success"
  2584. });
  2585. if(!this.workForm.domains[index].imgList) {
  2586. this.workForm.domains[index].imgList = []
  2587. this.workForm.domains[index].imgListUrl = []
  2588. }
  2589. this.workForm.domains[index].imgList.push(res.data)
  2590. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2591. } else {
  2592. this.$message({message: res.msg,type: "error"});
  2593. }
  2594. console.log(this.workForm.domains[index])
  2595. },
  2596. error => {this.$message({message: error,type: "error"});
  2597. });
  2598. },
  2599. // 删除图片
  2600. delImg(file,fileList, index) {
  2601. console.log(file, fileList)
  2602. let idx = 0
  2603. for(let i in fileList) {
  2604. if(fileList[i].uid == file.uid) {
  2605. idx = i
  2606. }
  2607. }
  2608. this.workForm.domains[index].imgList.splice(idx, 1)
  2609. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  2610. console.log(this.workForm.domains[index])
  2611. },
  2612. test(){
  2613. console.log('test',this.workForm.domains);
  2614. },
  2615. getHour(s1, s2) {
  2616. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  2617. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  2618. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  2619. var ms = s2.getTime() - s1.getTime();
  2620. if (ms < 0) return 0;
  2621. let ma = ms / 1000 / 60 / 60
  2622. return ma; //小时
  2623. },
  2624. refreshWXCardTime(workdate) {
  2625. if (!workdate) return;
  2626. this.syncTimeLoading = true;
  2627. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  2628. date: workdate,
  2629. },res => {
  2630. this.syncTimeLoading = false;
  2631. if(res.code == 'ok'){
  2632. this.workForm.time = res.data.time;
  2633. }else {
  2634. this.$message({
  2635. message: res.msg,
  2636. type: 'error'
  2637. })
  2638. }
  2639. },err => {
  2640. this.syncTimeLoading = false;
  2641. this.$message({
  2642. message: err,
  2643. type: 'error'
  2644. })
  2645. })
  2646. },
  2647. refreshAttendance(workdate) {
  2648. if (!workdate) return;
  2649. this.syncTimeLoading = true;
  2650. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  2651. startDate: workdate[0],
  2652. endDate: workdate[1]
  2653. },res => {
  2654. this.syncTimeLoading = false;
  2655. if(res.code == 'ok'){
  2656. this.workTimeForMinYi = parseFloat(res.data.workHours);
  2657. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  2658. this.totalReportHours = this.workTimeForMinYi;
  2659. }else {
  2660. this.$message({
  2661. message: res.msg,
  2662. type: 'error'
  2663. })
  2664. }
  2665. },err => {
  2666. this.syncTimeLoading = false;
  2667. this.$message({
  2668. message: err,
  2669. type: 'error'
  2670. })
  2671. })
  2672. },
  2673. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  2674. this.weeklyFilledTimeDialog = true
  2675. this.weeklyFilledTimeLoading = true
  2676. this.weeklyFilledTimeDate = parameterDate
  2677. this.http.post('/report/getReportList',{
  2678. date: parameterDate,
  2679. userId: this.user.id
  2680. },res => {
  2681. this.weeklyFilledTimeLoading = false
  2682. if(res.code == 'ok'){
  2683. this.weeklyFilledTimeList = res.data[0].data
  2684. let candelete = true
  2685. for(let i in this.weeklyFilledTimeList){
  2686. if(this.weeklyFilledTimeList[i].state < 2){
  2687. candelete = false
  2688. }
  2689. }
  2690. this.weeklyFilledTimeCanDelete = candelete
  2691. }else {
  2692. this.$message({
  2693. message: res.msg,
  2694. type: 'error'
  2695. })
  2696. }
  2697. },err => {
  2698. this.weeklyFilledTimeLoading = false
  2699. this.$message({
  2700. message: err,
  2701. type: 'error'
  2702. })
  2703. })
  2704. },
  2705. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  2706. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  2707. confirmButtonText: this.$t('btn.determine'),
  2708. cancelButtonText: this.$t('btn.cancel'),
  2709. type: "warning"
  2710. })
  2711. .then(() => {
  2712. this.http.post('/report/delete',{
  2713. userId: this.user.id,
  2714. date: this.weeklyFilledTimeDate
  2715. },res => {
  2716. if (res.code == "ok") {
  2717. this.$message({
  2718. message: this.$t('message.successfullyDeleted'),
  2719. type: "success"
  2720. });
  2721. this.getWeeklyWorkTime()
  2722. this.getReportList();
  2723. this.getDepartment();
  2724. this.weeklyFilledTimeDialog = false;
  2725. } else {
  2726. this.$message({
  2727. message: res.msg,
  2728. type: "error"
  2729. });
  2730. }
  2731. },error => {
  2732. this.$message({
  2733. message: error,
  2734. type: "error"
  2735. });
  2736. }
  2737. );
  2738. }).catch(() => {});
  2739. },
  2740. getApprovalProcess(item){
  2741. // console.log('this.date',this.choseDate);
  2742. this.http.post('/report-log/get',{
  2743. creatorId: item.id,
  2744. createDate: sessionStorage.msg
  2745. },res => {
  2746. if(res.code == 'ok'){
  2747. this.approvalProcessDialog = true
  2748. if(this.user.userNameNeedTranslate == 1) {
  2749. for(var i in res.data) {
  2750. let obj = {
  2751. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  2752. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  2753. }
  2754. res.data[i].msgCon = obj
  2755. }
  2756. }
  2757. this.approvalProcessData = res.data
  2758. console.log(this.approvalProcessData, '数据卡看')
  2759. }else{
  2760. this.$message({
  2761. message: res.msg,
  2762. type: 'error'
  2763. })
  2764. }
  2765. },err => {
  2766. this.$message({
  2767. message: err,
  2768. type: 'error'
  2769. })
  2770. })
  2771. },
  2772. filterNode(value, data) {
  2773. if (!value) return true;
  2774. return data.label.indexOf(value) !== -1;
  2775. },
  2776. triggerCalculateOT(index) {
  2777. var str = this.workForm.domains[index].overtimeHours + ''
  2778. if(str.indexOf('.') != '-1') {
  2779. var s = str.split('.')[0]
  2780. var st = str.split('.')[1]
  2781. var sts = st.split('')
  2782. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  2783. }
  2784. },
  2785. searchScreen(e){
  2786. if(e){
  2787. this.monthNotWorkDateS1 = []
  2788. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  2789. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  2790. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  2791. }
  2792. }
  2793. if (this.monthNotWorkDateS1.length > 50) {
  2794. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  2795. }else{
  2796. this.monthNotWorkDateS = this.monthNotWorkDateS1
  2797. }
  2798. // if (this.monthNotWorkDateS1.length > 0) {
  2799. // setTimeout(() => {
  2800. // this.tableListenernot()
  2801. // }, 1000);
  2802. // }
  2803. }else{
  2804. this.monthWorkDataS1 = []
  2805. for (let i = 0; i < this.monthWorkData.length; i++) {
  2806. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  2807. this.monthWorkDataS1.push(this.monthWorkData[i])
  2808. }
  2809. }
  2810. if (this.monthWorkDataS1.length > 50) {
  2811. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  2812. }else{
  2813. this.monthWorkDataS = this.monthWorkDataS1
  2814. }
  2815. // if (this.monthWorkDataS1.length > 0) {
  2816. // setTimeout(() => {
  2817. // this.tableListener()
  2818. // }, 1000);
  2819. // }
  2820. }
  2821. },
  2822. addUpload(data) {
  2823. // var zhi = data.fileName.split('.')[0]
  2824. // var sss = zhi + '.xlsx'
  2825. // return
  2826. var filePath = '/upload/' + data.serverName;
  2827. const a = document.createElement('a'); // 创建a标签
  2828. a.setAttribute('download', data.fileName);// download属性
  2829. a.setAttribute('href', filePath);// href链接
  2830. a.click(); //自执行点击事件
  2831. a.remove();
  2832. },
  2833. restrictNumber(targetId) {
  2834. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  2835. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  2836. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  2837. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  2838. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  2839. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  2840. inpu.value = parseFloat(inpu.value);
  2841. }
  2842. },
  2843. //获取项目下的任务分组
  2844. getTaskGroups(domain, index) {
  2845. domain.groupId=null;
  2846. this.http.post('/task-group/listMyJoinGroup',{
  2847. projectId: domain.projectId,
  2848. isSubstitude: this.isSubstitude ? 1 : 0
  2849. },
  2850. res => {
  2851. if (res.code == "ok") {
  2852. this.workForm.domains[index].taskGroups = res.data;
  2853. // if (this.workForm.domains[index].taskGroups.length > 0) {
  2854. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  2855. // this.getGroupStages(domain, index);
  2856. // }
  2857. this.$forceUpdate();
  2858. }
  2859. },
  2860. error => {
  2861. this.$message({
  2862. message: error,
  2863. type: "error"
  2864. });
  2865. }
  2866. );
  2867. },
  2868. //下载填报工时占比报表
  2869. downloadProjectRatio() {
  2870. this.exportUserRatio = true;
  2871. // let now = new Date();
  2872. // let month = now.getMonth();//默认看上个月的
  2873. // let monthStr = month<10? ('0'+month): month;
  2874. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  2875. const today = new Date();
  2876. const year = today.getFullYear();
  2877. const month = today.getMonth() + 1;
  2878. let lastMonthYear, lastMonth;
  2879. if (month === 1) {
  2880. lastMonthYear = year - 1;
  2881. lastMonth = 12;
  2882. } else {
  2883. lastMonthYear = year;
  2884. lastMonth = month - 1;
  2885. }
  2886. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  2887. console.log('赋值 ==>', this.ratioYmonth)
  2888. },
  2889. confirmDownloadRatio() {
  2890. this.startRatioExporting = true;
  2891. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  2892. ymonth: this.ratioYmonth
  2893. },
  2894. res => {
  2895. if (res.code == "ok") {
  2896. this.startRatioExporting = false;
  2897. var filePath = res.data;
  2898. const a = document.createElement('a'); // 创建a标签
  2899. var data = filePath.split("/");
  2900. a.setAttribute('download', data[data.length-1]);// download属性
  2901. a.setAttribute('href', filePath);// href链接
  2902. a.click(); //自执行点击事件
  2903. a.remove();
  2904. } else {
  2905. this.startRatioExporting = false;
  2906. this.$message({
  2907. message: res.msg,
  2908. type: "error"
  2909. });
  2910. }
  2911. },
  2912. error => {
  2913. this.checkinLoading = false;
  2914. this.$message({
  2915. message: error,
  2916. type: "error"
  2917. });
  2918. }
  2919. );
  2920. },
  2921. //下载带企业微信考勤数据的工时统计模板
  2922. downloadCheckInExcel() {
  2923. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  2924. startDate: this.importWxParam.date[0],
  2925. endDate: this.importWxParam.date[1],
  2926. },
  2927. res => {
  2928. if (res.code == "ok") {
  2929. var filePath = res.data;
  2930. const a = document.createElement('a'); // 创建a标签
  2931. var data = filePath.split("/");
  2932. a.setAttribute('download', data[data.length-1]);// download属性
  2933. a.setAttribute('href', filePath);// href链接
  2934. a.click(); //自执行点击事件
  2935. a.remove();
  2936. } else {
  2937. this.$message({
  2938. message: res.msg,
  2939. type: "error"
  2940. });
  2941. }
  2942. },
  2943. error => {
  2944. this.checkinLoading = false;
  2945. this.$message({
  2946. message: error,
  2947. type: "error"
  2948. });
  2949. }
  2950. );
  2951. },
  2952. pre() {
  2953. if (this.active == 0) return;
  2954. this.active--;
  2955. },
  2956. next() {
  2957. this.active++;
  2958. },
  2959. triggerTotalTime(index) {
  2960. var item = this.checkinList[index];
  2961. var total = 0.0;
  2962. for (var i=0;i<this.projectColumns.length; i++) {
  2963. var key = this.projectColumns[i];
  2964. if (item[key] != null && item[key] != '') {
  2965. total += parseFloat(item[key]);
  2966. }
  2967. }
  2968. item.totalFillTime = total;
  2969. },
  2970. //提交批量代填的数据
  2971. submitBatchSubFillData() {
  2972. var data = JSON.stringify(this.checkinList);
  2973. this.http.post('/user-corpwx-time/submitProjectTime',{
  2974. json: data,
  2975. projectColumns: JSON.stringify(this.projectColumns)
  2976. },
  2977. res => {
  2978. if (res.code == "ok") {
  2979. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  2980. this.importWxDialog = false;
  2981. }
  2982. },
  2983. error => {
  2984. this.checkinLoading = false;
  2985. this.$message({
  2986. message: error,
  2987. type: "error"
  2988. });
  2989. }
  2990. );
  2991. },
  2992. loadCheckInData() {
  2993. if (this.importWxParam.date == null) {
  2994. this.checkinList = [];
  2995. return;
  2996. }
  2997. this.checkinLoading = true;
  2998. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  2999. startDate: this.importWxParam.date[0],
  3000. endDate: this.importWxParam.date[1],
  3001. },
  3002. res => {
  3003. if (res.code == "ok") {
  3004. this.checkinLoading = false;
  3005. this.checkinList = res.data.list;
  3006. this.projectColumns = res.data.projects;
  3007. // 自定义表格会导致表格错乱,需重新计算表格
  3008. this.$nextTick(()=>{
  3009. this.$refs.tab.doLayout()
  3010. })
  3011. }
  3012. },
  3013. error => {
  3014. this.checkinLoading = false;
  3015. this.$message({
  3016. message: error,
  3017. type: "error"
  3018. });
  3019. }
  3020. );
  3021. },
  3022. importCardTime(item) {
  3023. //首先判断文件类型
  3024. let str = item.file.name.split(".");
  3025. let format = str[str.length - 1];
  3026. if (format != "xls" && format != "xlsx") {
  3027. this.$message({
  3028. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3029. type: "error"
  3030. });
  3031. } else {
  3032. this.importingData = true;
  3033. let formData = new FormData();
  3034. formData.append("multipartFile", item.file);
  3035. formData.append("companyId", this.user.companyId);
  3036. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3037. res => {
  3038. this.$refs.uploadCardTime.clearFiles();
  3039. this.importingData = false;
  3040. if (res.code == "ok") {
  3041. //换成弹出框,以免有人等了半天回来啥也没看到
  3042. this.$message({
  3043. message: '导入考勤时长成功',
  3044. type: "success"
  3045. });
  3046. } else {
  3047. this.$message({
  3048. message: res.msg,
  3049. type: "error"
  3050. });
  3051. }
  3052. },
  3053. error => {
  3054. this.$refs.upload.clearFiles();
  3055. this.listLoading = false;
  3056. this.$message({
  3057. message: error,
  3058. type: "error"
  3059. });
  3060. });
  3061. }
  3062. },
  3063. batchImportWxData(item) {
  3064. //首先判断文件类型
  3065. let str = item.file.name.split(".");
  3066. let format = str[str.length - 1];
  3067. if (format != "xls" && format != "xlsx") {
  3068. this.$message({
  3069. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3070. type: "error"
  3071. });
  3072. } else {
  3073. this.importingData = true;
  3074. let formData = new FormData();
  3075. formData.append("file", item.file);
  3076. formData.append("companyId", this.user.companyId);
  3077. formData.append("withCheckIn", 1);
  3078. this.http.uploadFile('/report/importData', formData,
  3079. res => {
  3080. this.$refs.upload.clearFiles();
  3081. this.showImportResult = true;
  3082. this.importingData = false;
  3083. if (res.code == "ok") {
  3084. //换成弹出框,以免有人等了半天回来啥也没看到
  3085. this.importResultMsg = '成功导入' +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3086. this.getReportList();
  3087. this.importWxDialog = false;
  3088. } else {
  3089. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3090. }
  3091. },
  3092. error => {
  3093. this.$refs.upload.clearFiles();
  3094. this.listLoading = false;
  3095. this.$message({
  3096. message: error,
  3097. type: "error"
  3098. });
  3099. });
  3100. }
  3101. },
  3102. batchImportData(item) {
  3103. //首先判断文件类型
  3104. let str = item.file.name.split(".");
  3105. let format = str[str.length - 1];
  3106. if (format != "xls" && format != "xlsx") {
  3107. this.$message({
  3108. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3109. type: "error"
  3110. });
  3111. } else {
  3112. this.importingData = true;
  3113. let formData = new FormData();
  3114. formData.append("file", item.file);
  3115. formData.append("companyId", this.user.companyId);
  3116. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936)?'/report/importNewData':'/report/importData'
  3117. this.http.uploadFile(url, formData,
  3118. res => {
  3119. this.$refs.upload.clearFiles();
  3120. this.importingData = false;
  3121. this.showImportResult = true;
  3122. if (res.code == "ok") {
  3123. //换成弹出框,以免有人等了半天回来啥也没看到
  3124. this.importResultMsg = "成功导入"+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3125. this.getReportList();
  3126. this.importWXDialog = false;
  3127. } else {
  3128. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3129. }
  3130. },
  3131. error => {
  3132. this.$refs.upload.clearFiles();
  3133. this.importingData = false;
  3134. this.$message({
  3135. message: error,
  3136. type: "error"
  3137. });
  3138. });
  3139. }
  3140. },
  3141. userssHu() {
  3142. this.http.post('/time-type/getCompanyTimeSetting',{
  3143. companyId: this.user.companyId
  3144. },
  3145. res => {
  3146. if (res.code == "ok") {
  3147. this.yonghuUser = res.data
  3148. }
  3149. },
  3150. error => {
  3151. this.$message({
  3152. message: error,
  3153. type: "error"
  3154. });
  3155. }
  3156. );
  3157. },
  3158. iptBlur(i) {
  3159. if(this.isBatch == 0) {
  3160. return
  3161. }
  3162. var reqParam = {
  3163. startDate: this.workForm.createDate[0],
  3164. endDate: this.workForm.createDate[1]
  3165. };
  3166. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3167. reqParam.userId = this.workForm.userId[0];
  3168. }
  3169. this.http.post('/report/getWorkDays',reqParam,
  3170. res => {
  3171. if (res.code == "ok") {
  3172. this.jsDay = res.data
  3173. this.chuji(i)
  3174. } else {
  3175. this.$message({
  3176. message: res.msg,
  3177. type: "error"
  3178. });
  3179. }
  3180. },
  3181. error => {
  3182. this.$message({
  3183. message: error,
  3184. type: "error"
  3185. });
  3186. }
  3187. );
  3188. //明夷硬编码获取
  3189. if (this.user.company.companyName == this.mingyiName) {
  3190. this.getWorkTimeForMinYi();
  3191. }
  3192. },
  3193. getWorkTimeForMinYi(){
  3194. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3195. startDate: this.workForm.createDate[0],
  3196. endDate: this.workForm.createDate[1]
  3197. },
  3198. res => {
  3199. if (res.code == "ok") {
  3200. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3201. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3202. this.totalReportHours = this.workTimeForMinYi;
  3203. } else {
  3204. this.$message({
  3205. message: res.msg,
  3206. type: "error"
  3207. });
  3208. this.workForm.createDate = [];
  3209. }
  3210. },
  3211. error => {
  3212. this.$message({
  3213. message: error,
  3214. type: "error"
  3215. });
  3216. }
  3217. );
  3218. },
  3219. chuji(i) {
  3220. if(i == 0) {
  3221. this.seleChn(1)
  3222. } else if(i == 1) {
  3223. this.seleChn(0)
  3224. } else if(i == 2) {
  3225. if(this.workForm.domains[0].multiWorktime > 0) {
  3226. this.iptChangs()
  3227. } else {
  3228. this.iptChang()
  3229. }
  3230. } else if(i == 3) {
  3231. this.seleChn(0)
  3232. }
  3233. },
  3234. seleChn(e,domain) {
  3235. if(e == 1) {
  3236. for(var i in this.workForm.domains) {
  3237. if(this.workForm.domains[i].timeType == 0) {
  3238. this.workForm.domains[i].workingTime = 8
  3239. } else {
  3240. this.workForm.domains[i].workingTime = 4
  3241. }
  3242. }
  3243. }
  3244. var quanbu = 0
  3245. var spl = this.workForm.domains
  3246. var zhi = ''
  3247. for(var i in spl) {
  3248. var sp = +spl[i].workingTime + 0
  3249. zhi = this.jsDay * sp
  3250. quanbu = +quanbu + zhi
  3251. }
  3252. this.jsTime = quanbu
  3253. this.totalReportHours = quanbu
  3254. let worktime = this.jsTime
  3255. // 自动计算加班时长
  3256. if(this.isBatch != 0){
  3257. worktime = this.jsTime / this.jsDay
  3258. }
  3259. if(this.user.timeType.fillOvertime && domain){
  3260. let isover = false
  3261. let alltime = 0
  3262. let allover = 0 //此处alltime同上面的worktime
  3263. for(let d in spl){
  3264. if(spl[d].isOvertime){
  3265. isover = true
  3266. allover += spl[d].overtimeHours*1
  3267. }
  3268. alltime += spl[d].workingTime*1
  3269. }
  3270. if(domain.overtimeHours){
  3271. allover = allover - domain.overtimeHours
  3272. }
  3273. if(worktime*1 > this.user.timeType.allday){
  3274. if(isover){
  3275. if(alltime > (allover + this.user.timeType.allday)){
  3276. this.$set(domain,'isOvertime',true)
  3277. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3278. }else{
  3279. this.$set(domain,'isOvertime',false)
  3280. this.$set(domain,'overtimeHours',null)
  3281. if(alltime < (allover + this.user.timeType.allday)){
  3282. let overtime = allover + this.user.timeType.allday - alltime
  3283. for(let pi in spl){
  3284. if(spl[pi].overtimeHours){
  3285. if((overtime - spl[pi].overtimeHours*1) > 0){
  3286. overtime = overtime - spl[pi].overtimeHours*1
  3287. this.$set(spl[pi],'isOvertime',false)
  3288. this.$set(spl[pi],'overtimeHours',null)
  3289. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3290. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3291. break
  3292. }else{
  3293. this.$set(spl[pi],'isOvertime',false)
  3294. this.$set(spl[pi],'overtimeHours',null)
  3295. break
  3296. }
  3297. }
  3298. }
  3299. }
  3300. }
  3301. }else{
  3302. this.$set(domain,'isOvertime',true)
  3303. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3304. }
  3305. }else{
  3306. for(let di in spl){
  3307. this.$set(spl[di],'isOvertime',false)
  3308. this.$set(spl[di],'overtimeHours',null)
  3309. }
  3310. }
  3311. }
  3312. },
  3313. iptChang() {
  3314. var sl = this.workForm.domains
  3315. let timeArr = []
  3316. for(var i in sl) {
  3317. if(sl[i].startTime && sl[i].endTime) {
  3318. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3319. }
  3320. }
  3321. this.getTimeHours(timeArr)
  3322. // for(let j in arrNum) {
  3323. // this.timeJsonStr += arrNum[j]
  3324. // if(flg) {
  3325. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3326. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3327. // }
  3328. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3329. // flg = true
  3330. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3331. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3332. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3333. // }
  3334. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3335. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3336. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3337. // }
  3338. // }
  3339. },
  3340. iptChangs() {
  3341. var sl = this.workForm.domains
  3342. let timeArr = []
  3343. for(var i in sl) {
  3344. for(var j in sl[i].worktimeList){
  3345. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3346. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3347. }
  3348. }
  3349. }
  3350. this.getTimeHours(timeArr)
  3351. },
  3352. // 调用接口或去数据
  3353. getTimeHours(arr) {
  3354. this.http.post('/report/getHoursByTimeRange',{
  3355. timeJsonStr: JSON.stringify(arr)
  3356. },res => {
  3357. if(res.code === 'ok') {
  3358. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3359. } else {
  3360. this.$message({
  3361. message: res.msg,
  3362. type: 'error'
  3363. })
  3364. }
  3365. },err => {
  3366. this.$message({
  3367. message: err,
  3368. type: 'error'
  3369. })
  3370. })
  3371. },
  3372. // 按周填报调用接口计算时间
  3373. async getWeekHoursByTimeRange(timeRange) {
  3374. const url = '/report/getHoursByTimeRange';
  3375. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3376. var that = this;
  3377. return new Promise((resolve, reject) => {
  3378. this.http.post(url, data, function(res) {
  3379. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3380. }, function(err) {
  3381. reject(err);
  3382. });
  3383. });
  3384. },
  3385. removeTimeItem(item, index) {
  3386. item.worktimeList.splice(index, 1);
  3387. this.iptChangs()
  3388. },
  3389. //添加工时
  3390. addNewWorktime(index, item) {
  3391. if(item.worktimeList == null ) {
  3392. item.worktimeList = []
  3393. }
  3394. item.worktimeList.push({});
  3395. },
  3396. //复制项目
  3397. copyProject(index) {
  3398. var leftProgress = 10;
  3399. if (this.reportTimeType.type == 3) {
  3400. //计算已经待分配工时比例
  3401. let array = this.workForm.domains;
  3402. let totalProgress = 0;
  3403. for (var i=0;i<array.length; i++) {
  3404. totalProgress += array[i].progress;
  3405. }
  3406. if (totalProgress < 100) {
  3407. leftProgress = 100 - totalProgress;
  3408. }
  3409. }
  3410. var newIndex = index+1;
  3411. var itemDomain = {
  3412. projectId: this.workForm.domains[index].projectId,
  3413. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3414. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3415. ),
  3416. content: "",
  3417. progress:leftProgress,
  3418. state:2,//2-表示待提交
  3419. };
  3420. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3421. if (this.reportTimeType.type == 0) {
  3422. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3423. var length = this.workForm.domains.length;
  3424. if (length == 2) {
  3425. this.showAddMore = false;
  3426. }
  3427. }
  3428. this.selectProject(itemDomain, newIndex);
  3429. },
  3430. pushWorkTime(reportId){
  3431. let url=''
  3432. if(this.user.timeType.syncSap == 1){
  3433. url='/report/pushProjectReportToSap'
  3434. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3435. var pushDate = this.date + day;
  3436. this.$confirm(reportId?'确认推送当前工时?':('确认推送'+pushDate+'的工时?'), '提示', {
  3437. confirmButtonText: '确定',
  3438. cancelButtonText: '取消',
  3439. type: 'info'
  3440. }).then(() => {
  3441. const loading = this.$loading({
  3442. lock: true,
  3443. text: '正在推送中,请耐心等待。',
  3444. spinner: 'el-icon-loading',
  3445. background: 'rgba(0, 0, 0, 0.7)'
  3446. });
  3447. this.http.post(url,{
  3448. pushDate: pushDate,
  3449. reportId: reportId
  3450. },res => {
  3451. loading.close();
  3452. if(res.code == 'ok'){
  3453. this.$message({
  3454. type: 'success',
  3455. message: res.data
  3456. });
  3457. }else{
  3458. this.$message({
  3459. type: 'error',
  3460. message: res.msg
  3461. })
  3462. }
  3463. },err => {
  3464. loading.close();
  3465. this.$message({
  3466. type: 'error',
  3467. message: err
  3468. })
  3469. })
  3470. }).catch(() => {
  3471. });
  3472. }else{
  3473. url='/report/pushReportDataToThird'
  3474. this.$confirm('确认推送'+this.date+'月的工时?', '提示', {
  3475. confirmButtonText: '确定',
  3476. cancelButtonText: '取消',
  3477. type: 'info'
  3478. }).then(() => {
  3479. const loading = this.$loading({
  3480. lock: true,
  3481. text: '正在推送中,请耐心等待。',
  3482. spinner: 'el-icon-loading',
  3483. background: 'rgba(0, 0, 0, 0.7)'
  3484. });
  3485. this.http.post(url,{
  3486. yearMonth: this.date
  3487. },res => {
  3488. loading.close();
  3489. if(res.code == 'ok'){
  3490. this.$message({
  3491. type: 'success',
  3492. message: '推送成功!'
  3493. });
  3494. }else{
  3495. this.$message({
  3496. type: 'error',
  3497. message: res.msg
  3498. })
  3499. }
  3500. },err => {
  3501. loading.close();
  3502. this.$message({
  3503. type: 'error',
  3504. message: err
  3505. })
  3506. })
  3507. }).catch(() => {
  3508. });
  3509. }
  3510. },
  3511. showWorkTime(){
  3512. this.monthWorkTimeDialog = true;
  3513. this.searchKeyword = ''
  3514. this.WorktimeDatepickValue = this.istoMonth()
  3515. if(this.WorktimeDatepickValue.length == 0){
  3516. let newdate = new Date();
  3517. let nowdate = newdate.toLocaleDateString();
  3518. let getauto = this.getAutoWeekDate(nowdate)
  3519. let nowwd = [getauto[0],getauto[6]]
  3520. this.WorktimeDatepickValue = nowwd
  3521. }
  3522. this.showMonthWorkTime()
  3523. },
  3524. handleClick(t,e){
  3525. if (t.name == "first") {
  3526. this.showMonthWorkTime()
  3527. }else{
  3528. this.showMonthNotWorkTime()
  3529. }
  3530. },
  3531. //导出员工每日填报工时数
  3532. exportMembWorkHours() {
  3533. this.http.post(
  3534. "/report/exportUserDailyWorkTime",
  3535. {
  3536. // month: this.date,
  3537. startDate: this.WorktimeDatepickValue[0],
  3538. endDate: this.WorktimeDatepickValue[1],
  3539. },
  3540. (res) => {
  3541. if (res.code == "ok") {
  3542. let url = res.data;
  3543. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3544. }
  3545. },
  3546. (error) => {
  3547. this.$message({
  3548. message: error,
  3549. type: "error",
  3550. });
  3551. }
  3552. );
  3553. },
  3554. exportMembNotWorkHours() {
  3555. this.http.post(
  3556. "/report/exportNoReportUserList",
  3557. {
  3558. // month: this.date,
  3559. startDate: this.WorktimeDatepickValue[0],
  3560. endDate: this.WorktimeDatepickValue[1],
  3561. },
  3562. (res) => {
  3563. if (res.code == "ok") {
  3564. let url = res.data;
  3565. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  3566. }
  3567. },
  3568. (error) => {
  3569. this.$message({
  3570. message: error,
  3571. type: "error",
  3572. });
  3573. }
  3574. );
  3575. },
  3576. downloadByA(name, url) {
  3577. const a = document.createElement("a"); // 创建a标签
  3578. a.setAttribute("download", name); // download属性
  3579. a.setAttribute("href", url); // href链接
  3580. a.click(); // 自执行点击事件
  3581. a.remove();
  3582. },
  3583. // 是否本月判断
  3584. istoMonth(){
  3585. let todate = new Date()
  3586. let tomonth = todate.getMonth() + 1
  3587. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  3588. if(this.date == adate){
  3589. return []
  3590. }else{
  3591. let sedate = new Date(this.date)
  3592. let semonth = sedate.getMonth() + 1
  3593. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  3594. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  3595. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  3596. return [sedates1, sedates2]
  3597. }
  3598. },
  3599. showMonthWorkTime() {
  3600. this.monthTotalPage = 0,
  3601. this.tbload = true
  3602. this.http.post(
  3603. "/report/getUserDailyWorkTime",
  3604. // "/report/getNoReportUserList",
  3605. {
  3606. // month: this.date,
  3607. startDate: this.WorktimeDatepickValue[0],
  3608. endDate: this.WorktimeDatepickValue[1],
  3609. },
  3610. (res) => {
  3611. if (res.code == "ok") {
  3612. this.tbload = false;
  3613. this.pickDateArray = res.data.days;
  3614. // console.log('dataarray',res.data.days);
  3615. this.monthWorkData = res.data.list;
  3616. // this.monthWorkDataS = this.monthWorkData
  3617. // this.monthWorkDataS1 = res.data.list
  3618. this.monthTotal = res.data.list.length
  3619. if (this.monthWorkData.length > 50) {
  3620. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  3621. }else{
  3622. this.monthWorkDataS = this.monthWorkData
  3623. }
  3624. this.searchScreen(0)
  3625. // this.monthWorkDataS = infoList
  3626. // 判断
  3627. // if (this.monthWorkDataS1.length > 0) {
  3628. // setTimeout(() => {
  3629. // this.tableListener()
  3630. // }, 1000);
  3631. // }
  3632. this.$nextTick(function(){
  3633. this.$refs.hasworkTbl.doLayout();
  3634. });
  3635. // this.$forceUpdate()
  3636. }
  3637. },
  3638. (error) => {
  3639. this.tbload = false
  3640. this.$message({
  3641. message: error,
  3642. type: "error",
  3643. });
  3644. }
  3645. );
  3646. },
  3647. // tableListener(){
  3648. // let that = this;
  3649. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  3650. // // 添加scroll监听事件
  3651. // dom.addEventListener("scroll", function () {
  3652. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3653. // if (scrollDistance < 2) {
  3654. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  3655. // that.monthTotalPage++; //当前页数自增
  3656. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  3657. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  3658. // var infoList = arrList.splice(
  3659. // that.monthTotalPage * that.monthTotalLages,
  3660. // that.monthTotalLages
  3661. // );
  3662. // // 数据添加
  3663. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  3664. // }
  3665. // }
  3666. // })
  3667. // },
  3668. showMonthNotWorkTime() {
  3669. this.monthTotalPage = 0,
  3670. this.tbload = true,
  3671. this.http.post(
  3672. "/report/getNoReportUserList",
  3673. {
  3674. startDate: this.WorktimeDatepickValue[0],
  3675. endDate: this.WorktimeDatepickValue[1],
  3676. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  3677. },
  3678. (res) => {
  3679. if (res.code == "ok") {
  3680. this.tbload = false
  3681. this.monthNotWorkDate = res.data;
  3682. // this.monthNotWorkDateS1 = res.data
  3683. this.monthnotTotal = res.data.length
  3684. // 2222111
  3685. if (this.monthNotWorkDate.length > 50) {
  3686. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  3687. } else {
  3688. this.monthNotWorkDateS = this.monthNotWorkDate
  3689. }
  3690. this.searchScreen(1)
  3691. // 判断
  3692. // if (this.monthnotworkDateS1.length > 0) {
  3693. // setTimeout(() => {
  3694. // this.tableListenernot()
  3695. // }, 1000);
  3696. // }
  3697. this.$nextTick(function(){
  3698. this.$refs.hasworkTbl2.doLayout();
  3699. });
  3700. }
  3701. },
  3702. (error) => {
  3703. this.tbload = false
  3704. this.$message({
  3705. message: error,
  3706. type: "error",
  3707. });
  3708. }
  3709. );
  3710. },
  3711. // tableListenernot(){
  3712. // let that = this;
  3713. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  3714. // dom.addEventListener("scroll", function () {
  3715. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  3716. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  3717. // if (scrollDistance2 < 2) {
  3718. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  3719. // that.monthnotTotalPage++; //当前页数自增
  3720. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  3721. // var infoList = arrList.splice(
  3722. // that.monthnotTotalPage * that.monthnotTotalLages,
  3723. // that.monthnotTotalLages
  3724. // );
  3725. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  3726. // }
  3727. // }
  3728. // })
  3729. // },
  3730. listScroll(){
  3731. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  3732. this.isMore = true
  3733. setTimeout(()=>{
  3734. this.isMore = false
  3735. },1000)
  3736. }else {
  3737. this.isFlag = true
  3738. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  3739. this.monthWorkDataS = datalist
  3740. setTimeout(()=>{
  3741. this.isFlag = false
  3742. },300)
  3743. }
  3744. },
  3745. notListScroll(){
  3746. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  3747. this.isMore = true
  3748. setTimeout(()=>{
  3749. this.isMore = false
  3750. },1000)
  3751. }else {
  3752. this.isFlag = true
  3753. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  3754. this.monthNotWorkDateS = datalist
  3755. // console.log('length',this.monthNotWorkDateS.length)
  3756. setTimeout(()=>{
  3757. this.isFlag = false
  3758. },300)
  3759. }
  3760. },
  3761. // 获取默认这zhou日期参数 222
  3762. getLastWeek(e){
  3763. let newdate = new Date()
  3764. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  3765. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  3766. if(e){
  3767. this.WorktimeDatepickValue = lastwd
  3768. this.showMonthWorkTime()
  3769. }else{
  3770. this.WorktimeDatepickValue = lastwd
  3771. this.showMonthNotWorkTime()
  3772. }
  3773. },
  3774. getThisWeek(e){
  3775. let newdate = new Date();
  3776. let nowdate = newdate.toLocaleDateString();
  3777. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  3778. if(e){
  3779. this.WorktimeDatepickValue = nowwd
  3780. this.showMonthWorkTime()
  3781. }else{
  3782. this.WorktimeDatepickValue = nowwd
  3783. this.showMonthNotWorkTime()
  3784. }
  3785. },
  3786. getDoubleLastWeek(e){
  3787. let newdate = new Date()
  3788. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  3789. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  3790. if(e){
  3791. this.WorktimeDatepickValue = nextwd
  3792. this.showMonthWorkTime()
  3793. }else{
  3794. this.WorktimeDatepickValue = nextwd
  3795. this.showMonthNotWorkTime()
  3796. }
  3797. },
  3798. alreadyAllDate(stime,etime){
  3799. let diffdate = new Array();
  3800. let i=0;
  3801. while(stime<=etime){
  3802. let dateArray = stime.split("-");
  3803. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  3804. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  3805. let stimewk = this.weekDay[date.getDay()]
  3806. 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')
  3807. 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])
  3808. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  3809. let stime_ts = new Date(stime).getTime();
  3810. let next_date = stime_ts + (24*60*60*1000);
  3811. let next_dates_y = new Date(next_date).getFullYear()+'-';
  3812. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  3813. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  3814. stime = next_dates_y+next_dates_m+next_dates_d;
  3815. i++;
  3816. }
  3817. return diffdate
  3818. },
  3819. getAutoWeekDate(e) {
  3820. let dateString = e;
  3821. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  3822. if (dateString.match(dateStringReg)) {
  3823. let presentDate = new Date(dateString),
  3824. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  3825. return Array.from(new Array(7), function (val, index) {
  3826. let formatDate = new Date(
  3827. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  3828. );
  3829. return (
  3830. formatDate.getFullYear() +
  3831. "-" +
  3832. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  3833. "-" +
  3834. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  3835. );
  3836. });
  3837. } else {
  3838. throw new Error(
  3839. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  3840. );
  3841. }
  3842. },
  3843. onProgressChange() {
  3844. this.$forceUpdate();
  3845. },
  3846. showChooseMembTree() {
  3847. this.chosenMembCount = this.participator.length;
  3848. this.chooseParticipVisible = true;
  3849. },
  3850. onTreeItemChange() {
  3851. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3852. var list = chosenList.filter(item=>item.isUser == 1);
  3853. this.chosenMembCount = list.length;
  3854. },
  3855. findUserInTree() {
  3856. if (this.filterName == '') {
  3857. this.deptMembData = this.allMembData;
  3858. } else {
  3859. var list = this.findRecursively(this.filterName, this.allMembData);
  3860. this.deptMembData = list;
  3861. }
  3862. },
  3863. findRecursively(username, list) {
  3864. var filterList = [];
  3865. for (var i=0;i<list.length; i++) {
  3866. if (list[i].isUser == 1) {
  3867. if (list[i].label.indexOf(username) >= 0) {
  3868. //匹配上了
  3869. filterList.push(list[i]);
  3870. }
  3871. } else if (list[i].children != null && list[i].children.length > 0) {
  3872. var subList = this.findRecursively(username, list[i].children);
  3873. if (subList.length > 0) {
  3874. subList.forEach(s=>filterList.push(s));
  3875. }
  3876. }
  3877. }
  3878. return filterList;
  3879. },
  3880. //确定选择参与人
  3881. chooseParticip() {
  3882. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  3883. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  3884. //针对专业版,只能选择一个人进行代填,防止任务有问题
  3885. if (this.user.company.packageProject == 1) {
  3886. if (this.chosenMembList.length > 1) {
  3887. this.$message({
  3888. message: '每次仅支持代填一个人',
  3889. type: "error",
  3890. });
  3891. return;
  3892. }
  3893. }
  3894. this.chooseParticipVisible = false;
  3895. this.workForm.userNames = '';
  3896. this.workForm.userId = [];
  3897. this.participator = [];
  3898. for (var i=0;i<this.chosenMembList.length; i++) {
  3899. this.workForm.userId.push(this.chosenMembList[i].id);
  3900. this.workForm.userNames += this.chosenMembList[i].label+',';
  3901. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  3902. this.participator.push(item);
  3903. }
  3904. if (this.workForm.userNames.length > 0) {
  3905. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  3906. }
  3907. if(this.user.userNameNeedTranslate == 1) {
  3908. if(this.workForm.userNames) {
  3909. this.workForm.userNames = this.workForm.userNames.split(',')
  3910. }
  3911. }
  3912. },
  3913. notifySel(sel){
  3914. // console.log(sel);
  3915. this.notifySelList = sel
  3916. },
  3917. //微信通知人员填写
  3918. Notify(code) {
  3919. if (this.notifySelList.length == 0) return;
  3920. var ids = '';
  3921. this.notifySelList.forEach(f=>{
  3922. ids += f.id+',';
  3923. })
  3924. this.http.post('/user/pushFillReport',{
  3925. ids: ids, date: this.curDate,
  3926. code: code
  3927. },
  3928. res => {
  3929. if (res.code == "ok") {
  3930. this.$message({
  3931. message: this.$t('message.sentSuccessfully'),
  3932. type: "success"
  3933. });
  3934. }
  3935. },
  3936. error => {
  3937. this.$message({
  3938. message: error,
  3939. type: "error"
  3940. });
  3941. }
  3942. );
  3943. },
  3944. //导出人员列表
  3945. exportMemb() {
  3946. if (this.fillMembList.length == 0) return;
  3947. var ids = '';
  3948. this.fillMembList.forEach(f=>{
  3949. ids += f.id+',';
  3950. })
  3951. this.http.post('/user/exportMembList',{
  3952. ids: ids,isFill: this.isFill, date: this.curDate
  3953. },
  3954. res => {
  3955. if (res.code == "ok") {
  3956. var aTag = document.createElement('a');
  3957. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  3958. aTag.href = res.data;
  3959. aTag.click();
  3960. }
  3961. },
  3962. error => {
  3963. this.$message({
  3964. message: error,
  3965. type: "error"
  3966. });
  3967. }
  3968. );
  3969. },
  3970. showMembList(fill) {
  3971. this.membListVisible = true;
  3972. if (fill == 0) {
  3973. this.fillMembList = this.unFillList;
  3974. this.isFill = false;
  3975. let leaveList = []
  3976. let unleaveList = []
  3977. for(let i in this.fillMembList){
  3978. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  3979. leaveList.push(this.fillMembList[i])
  3980. }else{
  3981. unleaveList.push(this.fillMembList[i])
  3982. }
  3983. }
  3984. this.fillMembList = unleaveList
  3985. this.fillMembList_leave = leaveList
  3986. } else if(fill == 1){
  3987. this.fillMembList = this.fillList.filter(item => item.state != 3);
  3988. this.isFill = true;
  3989. }else{
  3990. this.fillMembList = this.fillList.filter(item => item.state == 3);
  3991. this.isFill = true;
  3992. }
  3993. },
  3994. //获取自己填写的日报状态
  3995. getReportFillStatus() {
  3996. this.http.post('/report/getReportFillStatus',{
  3997. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  3998. },
  3999. res => {
  4000. if (res.code == "ok") {
  4001. this.fillStatusList = res.data;
  4002. this.allDate.forEach(d=>{
  4003. var fillInfo = null;
  4004. d.state = null;
  4005. this.fillStatusList.forEach(s=>{
  4006. // console.log(d)
  4007. var d1 = s.createDate.split('-')[2];
  4008. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4009. // console.log(d2, '我被执行了')
  4010. if (d1.indexOf('0') == 0) {
  4011. d1 = d1.substring(1,d1.length);
  4012. }
  4013. if (d1 == d2) {
  4014. d.state = s.state;
  4015. }
  4016. })
  4017. })
  4018. this.$forceUpdate();
  4019. }
  4020. },
  4021. error => {
  4022. this.$message({
  4023. message: error,
  4024. type: "error"
  4025. });
  4026. }
  4027. );
  4028. },
  4029. scrollFunction () {
  4030. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4031. if (this.domObj.attachEvent) { // IE
  4032. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4033. } else if (this.domObj.addEventListener) {
  4034. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4035. }
  4036. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4037. },
  4038. mouseScroll(event) { // google 浏览器下
  4039. let detail = event.wheelDelta || event.detail
  4040. let moveForwardStep = -1
  4041. let moveBackStep = 1
  4042. let step = 0
  4043. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4044. event.preventDefault() // 阻止浏览器默认事件
  4045. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4046. },
  4047. // //左右滚动
  4048. // wheel(e){
  4049. // var a = document.getElementById("dateScroll");
  4050. // var scroll_width = 80; //滚动一下的距离
  4051. // var e = e || window.event, v;
  4052. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4053. // if(v>3||-v>3) v=-v;
  4054. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4055. // e.preventDefault(); //阻止浏览器的默认滚动
  4056. // },
  4057. showExportDialog() {
  4058. this.exportType = 0
  4059. this.exportDialog = true;
  4060. },
  4061. showExportTimeDialog() {
  4062. this.exportTimeDialog = true;
  4063. },
  4064. changeAllTime() {
  4065. //总时长发生改变,自动按比例计算
  4066. this.workForm.domains.forEach(d=>{
  4067. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4068. });
  4069. //计算jsTime
  4070. if (this.workForm.createDate) {
  4071. let sdate = new Date(this.workForm.createDate[0]);
  4072. let edate = new Date(this.workForm.createDate[1]);
  4073. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4074. console.log('days===', days)
  4075. if (days < 0) {
  4076. days = 0;
  4077. }
  4078. this.jsTime = this.reportTimeType.allday * days;
  4079. }
  4080. },
  4081. // 是否加班的单机事件
  4082. check() {
  4083. this.selected = !this.selected
  4084. this.isNew = this.selected
  4085. },
  4086. updateSubProject() {
  4087. this.$forceUpdate();
  4088. },
  4089. selectDegreeId(domain, index) {
  4090. this.http.post('/report/defaultDegree',{
  4091. projectId: domain.projectId
  4092. },
  4093. res => {
  4094. if (res.code == "ok") {
  4095. if(res.data) {
  4096. this.workForm.domains[index].degreeId = res.data.id + ''
  4097. this.$forceUpdate();
  4098. }
  4099. }
  4100. },
  4101. error => {
  4102. this.$message({
  4103. message: error,
  4104. type: "error"
  4105. });
  4106. }
  4107. );
  4108. },
  4109. //项目选中了, 加载子项目
  4110. selectProject(domain, index) {
  4111. if(!domain.projectId){
  4112. return;
  4113. }
  4114. // 默认选中上次填写的自定义维度
  4115. if(this.yonghuUser.customDegreeActive == 1) {
  4116. this.selectDegreeId(domain, index)
  4117. }
  4118. // console.log('projectId===',domain.projectId);
  4119. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4120. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4121. this.http.post('/sub-project/list',{
  4122. projectId: domain.projectId,
  4123. isReport: true
  4124. },
  4125. res => {
  4126. //清空之前选中的子项目
  4127. // this.workForm.domains[index].subProjectId = 0;
  4128. if (res.code == "ok") {
  4129. this.workForm.domains[index].subProjectList = res.data;
  4130. this.workForm.domains[index].subProjectId = null;
  4131. this.$forceUpdate();
  4132. }
  4133. },
  4134. error => {
  4135. this.$message({
  4136. message: error,
  4137. type: "error"
  4138. });
  4139. }
  4140. );
  4141. //项目相关的近期任务
  4142. if (this.user.company.packageProject == 1) {
  4143. this.getRecentTaskList(domain, index);
  4144. //获取项目相关专业
  4145. if (this.user.company.packageEngineering == 1) {
  4146. this.getProjectProfessions(domain, index);
  4147. }
  4148. //获取项目下的任务分组
  4149. this.getTaskGroups(domain, index);
  4150. }
  4151. // 获取项目相关的维度
  4152. // domain.degreeId = null
  4153. this.$set(domain,'degreeId',null)
  4154. this.$set(domain,'multiDegrIdArray',null)
  4155. this.dimension(domain, index);
  4156. //获取项目审核人
  4157. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4158. this.getProjectAuditorList(domain, index);
  4159. } else {
  4160. //按分组的负责人来审核
  4161. domain.projectAuditorId = null;
  4162. domain.projectAuditorName = null;
  4163. domain.auditUserList = null;
  4164. }
  4165. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4166. if (this.reportTimeType.type == 3) {
  4167. //新增项目时,自动计算
  4168. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4169. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4170. }
  4171. //加载昱众的工作职责
  4172. if (this.user.companyId == this.yuzhongCompId) {
  4173. this.updateResponse(domain);
  4174. }
  4175. },
  4176. getRecentTaskList(domain, index) {
  4177. //刷新任务时,清空服务
  4178. this.$set(domain, 'sapServiceId', null);
  4179. this.$set(domain, 'taskId', null);
  4180. var param = {
  4181. projectId: domain.projectId,
  4182. isSubstitude:this.isSubstitude?1:0,
  4183. };
  4184. if (domain.groupId) {
  4185. param.groupId = domain.groupId;
  4186. }
  4187. if (domain.stage) {
  4188. param.stage = domain.stage;
  4189. }
  4190. //专业版代填,获取代填员工的任务
  4191. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4192. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4193. this.$message({
  4194. message: '请选择代填的员工',
  4195. type: "error"
  4196. });
  4197. return;
  4198. } else {
  4199. param.userId = this.workForm.userId[0];
  4200. }
  4201. }
  4202. this.http.post('/task/getRecentTask',param,
  4203. res => {
  4204. if (res.code == "ok") {
  4205. this.workForm.domains[index].allTaskList = res.data;
  4206. this.workForm.domains[index].taskList = res.data;
  4207. this.$forceUpdate();
  4208. }
  4209. },
  4210. error => {
  4211. this.$message({
  4212. message: error,
  4213. type: "error"
  4214. });
  4215. }
  4216. );
  4217. },
  4218. //获取项目审核人
  4219. getProjectAuditorList(domainItem, index) {
  4220. if(domainItem.projectId == '') {
  4221. return
  4222. }
  4223. domainItem.projectAuditorId = null;
  4224. domainItem.projectAuditorName = null;
  4225. this.http.post('/project-auditor/getList',{
  4226. projectId: domainItem.projectId,
  4227. },
  4228. res => {
  4229. if (res.code == "ok") {
  4230. domainItem.auditUserList = res.data;
  4231. if (res.data.length==0) {
  4232. this.$message({
  4233. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4234. type: "error"
  4235. });
  4236. } else if (res.data.length==1) {
  4237. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4238. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4239. }
  4240. this.$forceUpdate();
  4241. }
  4242. },
  4243. error => {
  4244. this.$message({
  4245. message: error,
  4246. type: "error"
  4247. });
  4248. }
  4249. );
  4250. },
  4251. // 获取维度数据
  4252. dimension(domain, index) {
  4253. if(domain.projectId == '') {
  4254. return
  4255. }
  4256. this.http.post('/project/getDegreeList',{
  4257. projectId: domain.projectId,
  4258. },
  4259. res => {
  4260. if (res.code == "ok") {
  4261. // console.log("维度数据",res.data);
  4262. this.workForm.domains[index].wuduList = res.data
  4263. // this.workForm = this.workForm
  4264. this.$forceUpdate()
  4265. }
  4266. },
  4267. error => {
  4268. this.$message({
  4269. message: error,
  4270. type: "error"
  4271. });
  4272. }
  4273. );
  4274. },
  4275. //切换任务阶段
  4276. changeStages(domain, index) {
  4277. if (domain.stage == null || domain.stage == '') {
  4278. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4279. } else {
  4280. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4281. }
  4282. this.getRecentTaskList(domain, index);
  4283. this.$forceUpdate();
  4284. },
  4285. getGroupStages(domain, index, keepStage) {
  4286. // console.log(domain);
  4287. if(!domain.groupId){
  4288. domain.projectAuditorId = ''
  4289. domain.stages = []
  4290. if(this.user.timeType.reportAuditType >= 1){
  4291. domain.auditUserList = []
  4292. }
  4293. this.$forceUpdate();
  4294. return
  4295. }
  4296. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4297. res => {
  4298. if (res.code == "ok") {
  4299. if (!keepStage) {
  4300. domain.stage = '';
  4301. }
  4302. domain.stages = res.data;
  4303. this.getRecentTaskList(domain, index);
  4304. this.$forceUpdate();
  4305. }
  4306. },
  4307. error => {
  4308. this.$message({
  4309. message: error,
  4310. type: "error"
  4311. });
  4312. });
  4313. //检查当前的项目是否需要获取分组的负责人
  4314. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 ) {
  4315. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4316. res => {
  4317. if (res.code == "ok") {
  4318. domain.getProjectAuditorList = res.data;
  4319. domain.auditUserList = res.data;
  4320. if (res.data.length==1) {
  4321. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4322. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4323. } else if (res.data.length==0) {
  4324. domain.projectAuditorId = null;
  4325. domain.projectAuditorName = null;
  4326. }
  4327. this.$forceUpdate();
  4328. }
  4329. },
  4330. error => {
  4331. this.$message({
  4332. message: error,
  4333. type: "error"
  4334. });
  4335. });
  4336. }
  4337. },
  4338. getProjectProfessions(domain, index) {
  4339. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4340. res => {
  4341. if (res.code == "ok") {
  4342. this.workForm.domains[index].professionProgress = res.data;
  4343. this.$forceUpdate();
  4344. }
  4345. },
  4346. error => {
  4347. this.$message({
  4348. message: error,
  4349. type: "error"
  4350. });
  4351. });
  4352. },
  4353. //删除自己的日报
  4354. deleteReport() {
  4355. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4356. confirmButtonText: this.$t('btn.determine'),
  4357. cancelButtonText: this.$t('btn.cancel'),
  4358. type: "warning"
  4359. })
  4360. .then(() => {
  4361. this.listLoading = true;
  4362. this.http.post('/report/delete',{
  4363. userId: this.user.id,
  4364. date: this.workForm.createDate
  4365. },
  4366. res => {
  4367. this.listLoading = false;
  4368. if (res.code == "ok") {
  4369. this.$message({
  4370. message: this.$t('message.successfullyDeleted'),
  4371. type: "success"
  4372. });
  4373. this.getReportList();
  4374. this.getDepartment();
  4375. this.dialogVisible = false;
  4376. } else {
  4377. this.$message({
  4378. message: res.msg,
  4379. type: "error"
  4380. });
  4381. }
  4382. },
  4383. error => {
  4384. this.listLoading = false;
  4385. this.$message({
  4386. message: error,
  4387. type: "error"
  4388. });
  4389. }
  4390. );
  4391. })
  4392. .catch(() => {});
  4393. },
  4394. // 管理员删除日报
  4395. guanli(item) {
  4396. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4397. let param = {date: this.date + day, userId: item.id};
  4398. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4399. confirmButtonText: this.$t('btn.determine'),
  4400. cancelButtonText: this.$t('btn.cancel'),
  4401. type: "warning"
  4402. })
  4403. .then(() => {
  4404. this.listLoading = true;
  4405. this.http.post('/report/delete',param,
  4406. res => {
  4407. this.listLoading = false;
  4408. if (res.code == "ok") {
  4409. this.$message({
  4410. message: this.$t('message.successfullyDeleted'),
  4411. type: "success"
  4412. });
  4413. this.getReportList();
  4414. this.getDepartment();
  4415. this.dialogVisible = false;
  4416. } else {
  4417. this.$message({
  4418. message: res.msg,
  4419. type: "error"
  4420. });
  4421. }
  4422. },
  4423. error => {
  4424. this.listLoading = false;
  4425. this.$message({
  4426. message: error,
  4427. type: "error"
  4428. });
  4429. }
  4430. );
  4431. })
  4432. .catch(() => {});
  4433. },
  4434. selectAll() {
  4435. if (this.isAllSelect) {
  4436. var keys = [];
  4437. this.reportNames.forEach(b=>{
  4438. keys.push(b.id);
  4439. })
  4440. this.$refs.approveTree.setCheckedKeys(keys);
  4441. } else {
  4442. this.$refs.approveTree.setCheckedKeys([]);
  4443. }
  4444. },
  4445. removeEmptyNode(list) {
  4446. for (var i=0;i<list.length;i++) {
  4447. var cnt = 0;
  4448. if (list[i].membCount == 0) {
  4449. list.splice(i, 1);
  4450. i--;
  4451. } else if (list[i].children != null) {
  4452. this.removeEmptyNode(list[i].children);
  4453. }
  4454. }
  4455. },
  4456. calculateMembCount(list) {
  4457. for (var i in list) {
  4458. var cnt = 0;
  4459. if (list[i].children != null) {
  4460. this.calculateMembCount(list[i].children);
  4461. for (var m in list[i].children) {
  4462. cnt += list[i].children[m].membCount;
  4463. }
  4464. }
  4465. if (list[i].isUser == 1) {
  4466. cnt++;
  4467. this.membCount++;
  4468. }
  4469. list[i].membCount = cnt;
  4470. }
  4471. },
  4472. stateChange() {
  4473. // console.log(this.allData,'alldate');
  4474. this.membCount = 0;
  4475. if (this.selectState == -1) {
  4476. //全部状态
  4477. this.data = this.allData;
  4478. } else {
  4479. //未填报
  4480. this.seluserText = ''
  4481. var newData = JSON.parse(JSON.stringify(this.allData));
  4482. this.filterState(this.selectState, newData);
  4483. this.data = newData;
  4484. }
  4485. this.calculateMembCount(this.data);
  4486. this.data[0].membCount = this.membCount;//总人数
  4487. },
  4488. //按状态过滤部门人员
  4489. filterState(state, list) {
  4490. for (var i =0;i<list.length; i++) {
  4491. var obj = list[i];
  4492. if (obj.isUser == 1) {
  4493. var match = false;
  4494. if (state == -2) {
  4495. if (obj.state == null) {
  4496. match = true;
  4497. }
  4498. } else {
  4499. if (obj.state == state) {
  4500. match = true;
  4501. }
  4502. }
  4503. if (!match) {
  4504. list.splice(i, 1);
  4505. i--;
  4506. } else {
  4507. }
  4508. } else {
  4509. if (obj.children != null) {
  4510. this.filterState(state, obj.children);
  4511. }
  4512. }
  4513. }
  4514. },
  4515. //a按名称过滤部门人员
  4516. async seluserforText(){
  4517. const { userNameNeedTranslate } = this.user
  4518. this.membCount = 0;
  4519. var newData = JSON.parse(JSON.stringify(this.allData));
  4520. let textList = [this.seluserText]
  4521. if(userNameNeedTranslate == 1) {
  4522. this.dataLoading = true
  4523. let res = await this.postData('/user/getEmployeeList', {
  4524. keyword: this.seluserText,
  4525. cursor: '',
  4526. departmentId: -1,
  4527. pageIndex: 1,
  4528. pageSize: 1000
  4529. })
  4530. textList = res.data.records.map(item => item.name)
  4531. this.dataLoading = false
  4532. }
  4533. // return
  4534. console.log(textList, '<=== textList')
  4535. this.seluserforTextin(this.seluserText, newData, textList)
  4536. console.log(newData, 'Data')
  4537. this.data = newData;
  4538. this.calculateMembCount(this.data);
  4539. this.data[0].membCount = this.membCount;//总人数
  4540. },
  4541. seluserforTextin(text, list, textList = []){
  4542. for (var i =0;i<list.length; i++) {
  4543. var obj = list[i];
  4544. if (obj.isUser == 1) {
  4545. var match = false;
  4546. // if (obj.label.indexOf(text) != -1) {
  4547. // match = true
  4548. // }
  4549. if(textList.some(item => item.includes(obj.label))) {
  4550. match = true
  4551. }
  4552. if (!match) {
  4553. list.splice(i, 1);
  4554. i--;
  4555. } else {
  4556. }
  4557. } else {
  4558. if (obj.children != null) {
  4559. this.seluserforTextin(text, obj.children, textList);
  4560. }
  4561. }
  4562. }
  4563. },
  4564. // 当节点发生变化时
  4565. nodeChangeExpand(data) {
  4566. // 保存当前展开的节点
  4567. let flag = false
  4568. this.nodeModelData.some(item => {
  4569. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  4570. flag = true
  4571. return true
  4572. }
  4573. })
  4574. if (!flag) { // 不存在则存到数组里
  4575. this.nodeModelData.push(data.id)
  4576. }
  4577. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4578. },
  4579. nodeChangeCollapse(data) {
  4580. console.log(this.nodeModelData)
  4581. this.nodeModelData.some((item, i) => {
  4582. if (item === data.id) {
  4583. this.nodeModelData.length = i
  4584. }
  4585. })
  4586. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  4587. },
  4588. // 部门列表点击
  4589. handleNodeClick(data) {
  4590. // this.dealList = data
  4591. this.theValues(data.id, this.allData)
  4592. // this.depData = data;
  4593. var list = [];
  4594. if (data.id == -1) {
  4595. this.deptId = null;
  4596. this.targetUid = null;
  4597. list = this.data;
  4598. } else if (data.isUser == 1) {
  4599. this.deptId = null;
  4600. this.targetUid = data.id;
  4601. } else {
  4602. this.deptId = data.id;
  4603. this.targetUid = null;
  4604. list.push(data);
  4605. }
  4606. this.getReportList();
  4607. if (list.length > 0) {
  4608. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  4609. this.fillList = this.getUserMembListFromDeptList(list, 1)
  4610. }
  4611. },
  4612. exportPushLog(){
  4613. this.http.post('/sap-sync-log/export',{},
  4614. res => {
  4615. if (res.code == "ok") {
  4616. var filePath = res.data;
  4617. var fName = '推送日志.xlsx'
  4618. const a = document.createElement('a'); // 创建a标签
  4619. a.setAttribute('download', fName);// download属性
  4620. a.setAttribute('href', filePath);// href链接
  4621. a.click(); //自执行点击事件
  4622. a.remove();
  4623. } else {
  4624. this.$message({
  4625. message: res.msg,
  4626. type: "error"
  4627. });
  4628. }
  4629. },
  4630. error => {
  4631. this.$message({
  4632. message: error,
  4633. type: "error"
  4634. });
  4635. });
  4636. },
  4637. theValues(id, item) {
  4638. for(var i in item) {
  4639. if(item[i].id == id) {
  4640. this.depData = item[i]
  4641. if(id == '-1') {
  4642. this.translation = '1'
  4643. } else {
  4644. if(item[i].children) {
  4645. this.translation = '2'
  4646. } else {
  4647. this.translation = '3'
  4648. }
  4649. }
  4650. return
  4651. } else {
  4652. if(item[i].children) {
  4653. this.theValues(id, item[i].children)
  4654. }
  4655. }
  4656. }
  4657. },
  4658. //获取可以选择的代填的人员列表
  4659. getSubstitudeUserDeptList() {
  4660. if (this.deptMembData.length == 0) {
  4661. this.http.post("/department/listMyMembs", {},
  4662. res => {
  4663. if (res.code == "ok") {
  4664. let noAllData = JSON.parse(JSON.stringify(res.data));
  4665. if (noAllData.length > 0) {
  4666. // if (noAllData[0].label == '全部人员') {
  4667. if (noAllData[0].label == this.$t('lable.allStaff')) {
  4668. noAllData.splice(0,1);
  4669. }
  4670. }
  4671. this.setUserToDept(noAllData);
  4672. this.deptMembData = noAllData;
  4673. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  4674. console.log(this.deptMembData, '代填人员数据')
  4675. } else {
  4676. this.$message({
  4677. message: res.msg,
  4678. type: "error"
  4679. });
  4680. }
  4681. },
  4682. error => {
  4683. this.$message({
  4684. message: error,
  4685. type: "error"
  4686. });
  4687. });
  4688. }
  4689. },
  4690. // 获取部门列表
  4691. getDepartmentForApprove() {
  4692. this.http.post( this.port.manage.depList, {},
  4693. res => {
  4694. if (res.code == "ok") {
  4695. var list1 = JSON.parse(JSON.stringify(res.data));
  4696. this.deptOptionList = this.changeArr(list1);
  4697. console.log(this.deptOptionList, '部门')
  4698. } else {
  4699. this.$message({
  4700. message: res.msg,
  4701. type: "error"
  4702. });
  4703. }
  4704. },
  4705. error => {
  4706. this.$message({
  4707. message: error,
  4708. type: "error"
  4709. });
  4710. });
  4711. },
  4712. // 获取部门列表
  4713. getDepartment() {
  4714. //如果没有权限,就不需要获取
  4715. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  4716. return;
  4717. }
  4718. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4719. var param = {date:this.date + day};
  4720. this.http.post("/report/getMembList", param,
  4721. res => {
  4722. if (res.code == "ok") {
  4723. if(res.data.length == 0){
  4724. return
  4725. }
  4726. this.departmentList = JSON.parse(JSON.stringify(res.data))
  4727. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  4728. // let noAllData = JSON.parse(JSON.stringify(res.data));
  4729. // if (this.user.role > 0) {
  4730. // }
  4731. list.splice(0,0,{
  4732. id: -1,
  4733. label: this.$t('lable.allStaff'),
  4734. })
  4735. this.membCount = 0;
  4736. //设置员工到部门下面
  4737. this.setUserToDept(list);
  4738. this.data = list;
  4739. // console.log('data',this.data);
  4740. this.expandDate = [this.data[1].id]
  4741. this.allData = list;
  4742. // if (noAllData.length > 0) {
  4743. // if (noAllData[0].label == '全部人员') {
  4744. // noAllData.splice(0,1);
  4745. // }
  4746. // }
  4747. // this.setUserToDept(noAllData);
  4748. // this.deptMembData = noAllData;
  4749. this.option = this.changeArr(list1);
  4750. list[0].membCount = this.membCount;
  4751. if (this.depData.id == -1) {
  4752. this.depData.membCount = this.membCount;
  4753. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  4754. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  4755. } else {
  4756. if (this.depData.isUser == null) {
  4757. var dep = this.findTargetDept(this.data, this.depData.id);
  4758. var membDeptList = [];
  4759. membDeptList.push(dep);
  4760. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  4761. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  4762. }
  4763. }
  4764. if (this.depData.isUser == null) {
  4765. if (this.isFill) {
  4766. this.fillMembList = this.fillList;
  4767. } else {
  4768. this.fillMembList = this.unFillList;
  4769. }
  4770. }
  4771. this.leaveAllNum = 0
  4772. for(let i in this.unFillList){
  4773. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  4774. this.leaveAllNum += 1
  4775. }
  4776. }
  4777. this.stateChange()
  4778. } else {
  4779. this.$message({
  4780. message: res.msg,
  4781. type: "error"
  4782. });
  4783. }
  4784. },
  4785. error => {
  4786. this.$message({
  4787. message: error,
  4788. type: "error"
  4789. });
  4790. });
  4791. this.getReportFillStatus();
  4792. },
  4793. findTargetDept(list, deptId) {
  4794. var t = null;
  4795. for (var i=0;i<list.length; i++) {
  4796. if (list[i].isUser == null && list[i].id == deptId) {
  4797. t = list[i];
  4798. break;
  4799. }
  4800. }
  4801. if (t == null) {
  4802. for (var i=0;i<list.length; i++) {
  4803. if (list[i].children != null && list[i].children.length > 0) {
  4804. t = this.findTargetDept(list[i].children, deptId);
  4805. if (t != null) {
  4806. break;
  4807. }
  4808. }
  4809. }
  4810. }
  4811. return t;
  4812. },
  4813. getUserMembListFromDeptList(list, isFill) {
  4814. var membList = [];
  4815. for (var i in list) {
  4816. var deptName = list[i].label;
  4817. if (list[i].userList != null) {
  4818. list[i].userList.forEach(element => {
  4819. if (isFill == 0) {
  4820. //获取未填的
  4821. if (element.state == null) {
  4822. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  4823. membList.push(obj);
  4824. }
  4825. } else {
  4826. if (element.state != null) {
  4827. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  4828. membList.push(obj);
  4829. }
  4830. }
  4831. });
  4832. }
  4833. if (list[i].children != null) {
  4834. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  4835. }
  4836. }
  4837. return membList;
  4838. },
  4839. setUserToDept(list) {
  4840. for (var i in list) {
  4841. var cnt = 0;
  4842. if (list[i].children != null) {
  4843. this.setUserToDept(list[i].children);
  4844. for (var m in list[i].children) {
  4845. cnt += list[i].children[m].membCount;
  4846. }
  4847. }
  4848. if (list[i].userList != null) {
  4849. if (list[i].children == null) {
  4850. list[i].children = [];
  4851. }
  4852. list[i].userList.forEach(element => {
  4853. var obj = {
  4854. id: element.id,
  4855. label:element.name,
  4856. state:element.state,
  4857. parentId:element.departmentId,
  4858. isUser:1,
  4859. workingTime: element.workingTime,
  4860. leaveDays: element.leaveDays,
  4861. leaveTimes: element.leaveTimes
  4862. };
  4863. list[i].children.push(obj);
  4864. this.membCount++;
  4865. cnt++;
  4866. });
  4867. }
  4868. list[i].membCount = cnt;
  4869. }
  4870. },
  4871. // 修改数组
  4872. changeArr(arr) {
  4873. for (var i = 0; i < arr.length; i++) {
  4874. if(arr[i].id != -1 && arr[i].id != 0) {
  4875. if (arr[i].children != null && arr[i].children.length>0) {
  4876. arr[i].children = this.changeArr(arr[i].children);
  4877. }
  4878. arr[i].id && (arr[i].value = arr[i].id);
  4879. delete arr[i].id;
  4880. }
  4881. }
  4882. for(var i in arr) {
  4883. if(arr[i].id == -1 || arr[i].id == 0) {
  4884. arr.splice(i,1)
  4885. }
  4886. }
  4887. return arr;
  4888. },
  4889. //时间段范围设置改动,监听
  4890. onTimeTypeChange(timeType) {
  4891. this.seleChn(1)
  4892. this.showAddMore = true;
  4893. for(var i in this.workForm.domains) {
  4894. if (this.workForm.domains[i].timeType == 0) {
  4895. this.showAddMore = false;
  4896. break;
  4897. }
  4898. }
  4899. if (this.showAddMore) {
  4900. //检测数量
  4901. if (this.workForm.domains.length == 2) {
  4902. this.showAddMore = false;
  4903. } else {
  4904. this.showAddMore = true;
  4905. }
  4906. }
  4907. },
  4908. getTimeType() {
  4909. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  4910. res => {
  4911. if (res.code == "ok") {
  4912. var t = res.data;
  4913. this.reportTimeType = t;
  4914. if (this.reportTimeType.type > 0) {
  4915. this.showAddMore = true;
  4916. }
  4917. //转化时间格式
  4918. if (t.allday != null) {
  4919. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  4920. }
  4921. if (t.am != null) {
  4922. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  4923. }
  4924. if (t.pm != null) {
  4925. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  4926. }
  4927. let arr = []
  4928. for(var i in res.data.excludeTimeList) {
  4929. let obj = {
  4930. s: res.data.excludeTimeList[i].startTime,
  4931. e: res.data.excludeTimeList[i].endTime,
  4932. }
  4933. arr.push(obj)
  4934. }
  4935. this.vacationTime = arr
  4936. } else {
  4937. this.$message({
  4938. message: res.msg,
  4939. type: "error"
  4940. });
  4941. }
  4942. },
  4943. error => {
  4944. this.listLoading = false;
  4945. this.$message({
  4946. message: error,
  4947. type: "error"
  4948. });
  4949. });
  4950. },
  4951. // 改变月份 -------
  4952. changeMonthOut() {
  4953. this.getAllDate();
  4954. this.getReportList();
  4955. this.getDepartment();
  4956. },
  4957. // 选择日期
  4958. choseDate(i, item) {
  4959. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  4960. return
  4961. }
  4962. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  4963. this.choseDay = i;
  4964. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4965. sessionStorage.msg = this.date + day,
  4966. this.getReportList();
  4967. this.getDepartment();
  4968. this.curDate = item.date;
  4969. },
  4970. canClick(i, item){
  4971. let nowDate = new Date()
  4972. let nowDateYear = nowDate.getFullYear()
  4973. let itemYear = parseInt(this.date.split('-')[0])
  4974. let nowDateMonth = nowDate.getMonth() + 1
  4975. let itemMonth = parseInt(this.date.split('-')[1])
  4976. let nowDateDay = nowDate.getDate()
  4977. let itemDay = parseInt(item.showDate.split('.')[1])
  4978. if(nowDateYear < itemYear){
  4979. return false
  4980. }else if(nowDateYear == itemYear){
  4981. if(nowDateMonth < itemMonth){
  4982. return false
  4983. }else if(nowDateMonth == itemMonth){
  4984. if(nowDateDay < itemDay){
  4985. return false
  4986. }
  4987. }
  4988. }
  4989. },
  4990. // 获取日期列表
  4991. getAllDate(e) {
  4992. var dayArry = [];
  4993. var day = this.getCountDays();
  4994. let curMonthDay = null;
  4995. for (var k = 1; k <= day; k++) {
  4996. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  4997. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  4998. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  4999. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5000. if(sessionStorage.msg) {
  5001. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5002. this.choseDay = k - 1;
  5003. curMonthDay = str;
  5004. }
  5005. } else {
  5006. if (new Date().getDate() == k) {
  5007. this.choseDay = k - 1;
  5008. }
  5009. }
  5010. } else {
  5011. this.choseDay = 0;
  5012. }
  5013. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5014. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5015. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5016. }
  5017. this.allDate = dayArry;
  5018. //不能超过最大日期
  5019. if (this.choseDay > day-1) {
  5020. this.choseDay = day-1;
  5021. }
  5022. if(sessionStorage.from != 1){
  5023. let nowmonth = new Date().getMonth() + 1
  5024. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5025. let nowdate = new Date().getDate()
  5026. if(nowd == this.date){
  5027. if(e && sessionStorage.msg){
  5028. }else{
  5029. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5030. }
  5031. let nowday = new Date(sessionStorage.msg).getDate()
  5032. this.choseDay = nowday - 1
  5033. let monthdate = new Date(sessionStorage.msg)
  5034. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5035. }else{
  5036. if(e && sessionStorage.msg){
  5037. }else{
  5038. sessionStorage.msg = this.date + '-01'
  5039. }
  5040. let monthdate = new Date(sessionStorage.msg)
  5041. this.choseDay = monthdate.getDate() - 1
  5042. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5043. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5044. }
  5045. }else{
  5046. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5047. }
  5048. //从消息点击跳转过来的,直接加载指定日期
  5049. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5050. this.curDate = sessionStorage.msg;
  5051. sessionStorage.from = 0;
  5052. } else {
  5053. // if (curMonthDay != null) {
  5054. // // this.curDate = curMonthDay;
  5055. // let d = new Date(sessionStorage.msg)
  5056. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5057. // } else {
  5058. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5059. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5060. // }
  5061. }
  5062. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5063. // if(!sessionStorage.msg){
  5064. // let msgday = this.choseDay + 1
  5065. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5066. // }
  5067. this.getReportFillStatus();
  5068. },
  5069. getCountDays() {
  5070. var newstr = this.date.replace(/-/g, "/");
  5071. var curDate = new Date(newstr+'/01');
  5072. var curMonth = curDate.getMonth();
  5073. curDate.setMonth(curMonth + 1);
  5074. curDate.setDate(0);
  5075. return curDate.getDate();
  5076. },
  5077. reqMore() {
  5078. if (this.hasMore) {
  5079. this.pageIndex++;
  5080. this.requestHttpReports();
  5081. }
  5082. },
  5083. //加载日报数据
  5084. requestHttpReports() {
  5085. //请求数据
  5086. this.listLoading = true;
  5087. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5088. let param = {date: this.date + day};
  5089. if (this.deptId) {
  5090. param.deptId = this.deptId;
  5091. }
  5092. if (this.targetUid) {
  5093. param.userId = this.targetUid;
  5094. }
  5095. //传页码
  5096. if (this.hasMore) {
  5097. param.pageIndex = this.pageIndex;
  5098. }
  5099. this.http.post( this.port.report.list, param,
  5100. res => {
  5101. this.listLoading = false;
  5102. if (res.code == "ok") {
  5103. //扩增
  5104. this.reportList = this.reportList.concat(res.data.data);
  5105. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5106. if(document.querySelector("#day"+this.choseDay)){
  5107. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5108. }
  5109. } else {
  5110. this.$message({
  5111. message: res.msg,
  5112. type: "error"
  5113. });
  5114. }
  5115. },
  5116. error => {
  5117. this.listLoading = false;
  5118. this.$message({
  5119. message: error,
  5120. type: "error"
  5121. });
  5122. });
  5123. },
  5124. //获取日报列表
  5125. getReportList() {
  5126. //初始化,重置数据
  5127. this.pageIndex = 0;
  5128. this.hasMore = true;
  5129. this.reportList = [];
  5130. this.requestHttpReports();
  5131. },
  5132. //刷新日报状态,用于审核后更新
  5133. refreshReportData(reportId) {
  5134. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5135. res => {
  5136. if (res.code == "ok") {
  5137. for (var m=0;m<this.reportList.length; m++) {
  5138. var d = this.reportList[m].data;
  5139. var find = d.filter(r=>r.id == reportId);
  5140. if (find.length > 0) {
  5141. find[0].state = res.data.state;
  5142. if (find[0].state == 2) {//被驳回,要可以编辑
  5143. this.reportList[m].state = 2;
  5144. }
  5145. find[0].isDeptAudit = res.data.isDeptAudit;
  5146. find[0].departmentAuditState = res.data.departmentAuditState;
  5147. find[0].projectAuditorName = res.data.projectAuditorName;
  5148. find[0].projectAuditorId = res.data.projectAuditorId;
  5149. find[0].projectAuditState = res.data.projectAuditState;
  5150. find[0].rejectUserid = res.data.rejectUserid;
  5151. find[0].rejectUsername = res.data.rejectUsername;
  5152. find[0].rejectReason = res.data.rejectReason;
  5153. this.$forceUpdate();
  5154. break;
  5155. }
  5156. }
  5157. } else {
  5158. this.$message({
  5159. message: res.msg,
  5160. type: "error"
  5161. });
  5162. }
  5163. },
  5164. error => {
  5165. this.listLoading = false;
  5166. this.$message({
  5167. message: error,
  5168. type: "error"
  5169. });
  5170. });
  5171. },
  5172. //导出员工工时统计
  5173. exportUserTime() {
  5174. this.listLoading = true;
  5175. var param = {};
  5176. if (this.exportParam.dateRange != null) {
  5177. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5178. }
  5179. this.http.post('/department/exportDeptStatistic', param,
  5180. res => {
  5181. this.listLoading = false;
  5182. if (res.code == "ok") {
  5183. location.href = res.data;
  5184. this.exportTimeDialog = false;
  5185. } else {
  5186. this.$message({
  5187. message: res.msg,
  5188. type: "error"
  5189. });
  5190. }
  5191. },
  5192. error => {
  5193. this.listLoading = false;
  5194. this.$message({
  5195. message: error,
  5196. type: "error"
  5197. });
  5198. });
  5199. },
  5200. //导出日报
  5201. exportReport() {
  5202. this.exportingData = true;
  5203. var param = {};
  5204. if (this.exportParam.dateRange != null) {
  5205. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5206. }
  5207. if (this.exportParam.projectId != null) {
  5208. param.projectId = this.exportParam.projectId;
  5209. }
  5210. if (this.exportParam.departmentId != null) {
  5211. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5212. }
  5213. param.stateKey = this.stateKey
  5214. // param.departmentId = this.user.departmentId
  5215. console.log(param, '《=== 导出传的参数')
  5216. this.http.post( this.port.report.export, param,
  5217. res => {
  5218. this.exportingData = false;
  5219. if (res.code == "ok") {
  5220. location.href = res.data;
  5221. this.exportDialog = false;
  5222. } else {
  5223. this.$message({
  5224. message: res.msg,
  5225. type: "error"
  5226. });
  5227. }
  5228. },
  5229. error => {
  5230. this.exportingData = false;
  5231. this.$message({
  5232. message: error,
  5233. type: "error"
  5234. });
  5235. });
  5236. },
  5237. //获取项目列表
  5238. getProjectList() {
  5239. this.listLoading = true;
  5240. this.http.post( this.port.project.list, {},
  5241. res => {
  5242. this.listLoading = false;
  5243. if (res.code == "ok") {
  5244. for(var i in res.data) {
  5245. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5246. res.data[i].projectCode = ''
  5247. }
  5248. }
  5249. this.projectList = res.data;
  5250. console.log("项目列表",this.projectList);
  5251. } else {
  5252. this.$message({
  5253. message: res.msg,
  5254. type: "error"
  5255. });
  5256. }
  5257. },
  5258. error => {
  5259. this.listLoading = false;
  5260. this.$message({
  5261. message: error,
  5262. type: "error"
  5263. });
  5264. });
  5265. },
  5266. // 获取填报日报的项目下拉列表
  5267. getFillProjectList() {
  5268. this.http.post( this.port.project.list, {
  5269. forReport: 1
  5270. },res => {
  5271. if (res.code == "ok") {
  5272. for(var i in res.data) {
  5273. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5274. res.data[i].projectCode = ''
  5275. }
  5276. }
  5277. this.fillProjectList = res.data;
  5278. this.getRecentlyProject()
  5279. } else {
  5280. this.$message({
  5281. message: res.msg,
  5282. type: "error"
  5283. });
  5284. }
  5285. },
  5286. error => {
  5287. this.$message({
  5288. message: error,
  5289. type: "error"
  5290. });
  5291. });
  5292. },
  5293. getBasecostItemList() {
  5294. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5295. companyId: this.user.companyId
  5296. },
  5297. res => {
  5298. if (res.code == "ok") {
  5299. this.timeBasecostList = res.data;
  5300. }
  5301. });
  5302. },
  5303. getAIReport(createDate) {
  5304. this.http.post('/report/getAIReport', {},
  5305. res => {
  5306. if (res.code == "ok") {
  5307. var quanbu = 0
  5308. this.jsDay = 1
  5309. var zhi = ''
  5310. var slp = res.data
  5311. for(var i in slp) {
  5312. var sp = +slp[i].workingTime + 0
  5313. zhi = this.jsDay * sp
  5314. quanbu = +quanbu + zhi
  5315. }
  5316. this.jsTime = quanbu
  5317. var aiReportData = res.data;
  5318. this.canCancelInDialog = false
  5319. if(aiReportData.length != 0) {
  5320. var arr = [];
  5321. for(var i in aiReportData) {
  5322. arr.push({
  5323. id: null,
  5324. projectId: aiReportData[i].projectId,
  5325. workingTime: aiReportData[i].workingTime,
  5326. content: '',
  5327. progress:100,
  5328. state: 2,
  5329. timeType: aiReportData[i].timeType,
  5330. subProjectList: aiReportData[i].subProjectList,
  5331. taskList: aiReportData[i].taskList,
  5332. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  5333. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  5334. taskId: aiReportData[i].taskId,
  5335. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5336. startTime: aiReportData[i].startTime,
  5337. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5338. endTime: aiReportData[i].endTime,
  5339. isOvertime: 0,
  5340. progress:aiReportData[i].progress,
  5341. professionProgress: aiReportData[i].professionProgressList,
  5342. stages:aiReportData[i].stages,
  5343. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  5344. pics: null,
  5345. multiWorktime: aiReportData[i].multiWorktime,
  5346. worktimeList: [{}],
  5347. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  5348. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  5349. wuduList: aiReportData[i].degreeList,
  5350. taskGroups:aiReportData[i].taskGroups,
  5351. customData: aiReportData[i].customData,//自定义的数值
  5352. auditUserList: aiReportData[i].auditUserList,
  5353. projectAuditorId: aiReportData[i].projectAuditorId,
  5354. projectAuditorName: aiReportData[i].projectAuditorName,
  5355. overtimeHours: aiReportData[i].overtimeHours,
  5356. customText: aiReportData[i].customText,
  5357. basecostId: aiReportData[i].basecostId,
  5358. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  5359. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  5360. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  5361. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  5362. canEdit: true
  5363. })
  5364. }
  5365. this.workForm.domains = arr;
  5366. } else {
  5367. }
  5368. this.canEdit = true;
  5369. this.originCanEdit = true;
  5370. this.seleChn()
  5371. } else {
  5372. this.$message({
  5373. message: res.msg,
  5374. type: "error"
  5375. });
  5376. }
  5377. },
  5378. error => {
  5379. this.$message({
  5380. message: error,
  5381. type: "error"
  5382. });
  5383. });
  5384. },
  5385. // 获取个人某天的日报 111111
  5386. getReport() {
  5387. this.http.post( this.port.report.getPort, {
  5388. date: this.workForm.createDate
  5389. },
  5390. res => {
  5391. if (res.code == "ok") {
  5392. var quanbu = 0
  5393. this.jsDay = 1
  5394. var zhi = ''
  5395. var slp = res.data.report
  5396. for(var i in slp) {
  5397. var sp = +slp[i].workingTime + 0
  5398. zhi = this.jsDay * sp
  5399. quanbu = +quanbu + zhi
  5400. }
  5401. this.jsTime = quanbu
  5402. var list = res.data;
  5403. this.report = list;
  5404. this.reportTimeType = this.report.timeType;
  5405. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  5406. this.isWeekend = !this.report.isWorkDay;
  5407. this.canCancelInDialog = false;
  5408. this.hasWrittenReport = list.report.length != 0;
  5409. if(list.report.length != 0) {
  5410. var arr = [];
  5411. this.canEdit = false;
  5412. let candelete = true
  5413. for(var i in list.report) {
  5414. var flg = null
  5415. list.report[i].isOvertime == 1 ? flg = true : flg = false
  5416. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  5417. var filteredRespList = null
  5418. if (targetP.length > 0) {
  5419. var isPublic = targetP[0].isPublic;
  5420. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  5421. }
  5422. arr.push({
  5423. id: list.report[i].id,
  5424. projectId: list.report[i].projectId,
  5425. workingTime: list.report[i].workingTime,
  5426. content: list.report[i].content,
  5427. state: list.report[i].state,
  5428. timeType: list.report[i].timeType,
  5429. subProjectList: list.report[i].subProjectList,
  5430. taskList: list.report[i].taskList,
  5431. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  5432. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  5433. taskId: list.report[i].taskId,
  5434. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  5435. startTime: list.report[i].startTime,
  5436. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  5437. endTime: list.report[i].endTime,
  5438. isOvertime: flg,
  5439. progress:list.report[i].progress,
  5440. professionProgress: list.report[i].professionProgressList,
  5441. stages:list.report[i].stages,
  5442. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  5443. pics: list.report[i].pics,
  5444. multiWorktime: list.report[i].multiWorktime,
  5445. worktimeList: list.report[i].worktimeList,
  5446. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  5447. multiDegrIdArray: list.report[i].multiDegrIdList,
  5448. wuduList: list.report[i].degreeList,
  5449. taskGroups:list.report[i].taskGroups,
  5450. customData: list.report[i].customData,//自定义的数值
  5451. auditUserList: list.report[i].auditUserList,
  5452. projectAuditorId: list.report[i].projectAuditorId,
  5453. projectAuditorName: list.report[i].projectAuditorName,
  5454. overtimeHours: list.report[i].overtimeHours,
  5455. customText: list.report[i].customText,
  5456. basecostId: list.report[i].basecostId,
  5457. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  5458. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  5459. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  5460. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  5461. canEdit: list.report[i].state >= 2 ? true : false,
  5462. extraField1: list.report[i].extraField1,
  5463. extraField2: list.report[i].extraField2,
  5464. extraField3: list.report[i].extraField3,
  5465. workContentList: list.report[i].workContentList,
  5466. filteredRespList: filteredRespList,
  5467. serviceList: list.report[i].serviceList,
  5468. sapServiceId: list.report[i].sapServiceId,
  5469. })
  5470. if (list.report[i].state >= 2) {
  5471. this.canEdit = true;
  5472. }
  5473. if(list.report[i].state < 2){
  5474. candelete = false
  5475. }
  5476. if (list.report[i].state == 0){
  5477. this.canCancelInDialog = true
  5478. }
  5479. // 加判断
  5480. if(this.user.timeType.choseFromAlbum == 1) {
  5481. let arrList = []
  5482. for(var k in list.report[i].pics) {
  5483. let obj = {
  5484. name: k,
  5485. url: list.report[i].pics[k]
  5486. }
  5487. arrList.push(obj)
  5488. }
  5489. arr[i].imgListUrl = arrList
  5490. arr[i].imgList = list.report[i].pics
  5491. }
  5492. }
  5493. this.reportCanDelete = candelete
  5494. this.workForm = {
  5495. createDate: this.workForm.createDate,
  5496. domains: arr,
  5497. userNames:null,
  5498. userId:null,
  5499. time: list.time
  5500. }
  5501. console.log('workForm', this.workForm)
  5502. } else {
  5503. this.workForm = {
  5504. createDate: this.workForm.createDate,
  5505. domains: [{
  5506. id: null,
  5507. projectId: "",
  5508. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5509. content: "",
  5510. progress:100,
  5511. state: 2,
  5512. timeType:0,
  5513. multiWorktime: this.reportTimeType.multiWorktime,
  5514. worktimeList:[{}],
  5515. canEdit: true,
  5516. auditorFirst: '',
  5517. auditorSec: '',
  5518. auditorThird: '',
  5519. ccUserid: ''
  5520. }],
  5521. userId:null,
  5522. userNames:null,
  5523. time: this.report.time
  5524. }
  5525. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5526. this.$set(this.workForm.domains[0],'isOvertime',true)
  5527. if(this.reportTimeType.type != 2){
  5528. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  5529. }
  5530. }
  5531. if(this.user.timeType.type == 1) {
  5532. var shuzhi = this.user.timeType.allday + ''
  5533. // console.log('执行一次', shuzhi.indexOf('.'))
  5534. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5535. }
  5536. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5537. //默认给第一个,必填字段
  5538. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5539. }
  5540. this.canEdit = true;
  5541. }
  5542. this.originCanEdit = this.canEdit;
  5543. this.seleChn()
  5544. } else {
  5545. this.$message({
  5546. message: res.msg,
  5547. type: "error"
  5548. });
  5549. }
  5550. },
  5551. error => {
  5552. this.$message({
  5553. message: error,
  5554. type: "error"
  5555. });
  5556. });
  5557. },
  5558. guanbi() {
  5559. this.falsss = false,
  5560. this.workTimeForMinYi=0
  5561. },
  5562. // 打开日报填写
  5563. fillInReport(i, isBatch) {
  5564. this.isWeekend = false
  5565. this.reportCanDelete = false
  5566. // console.log(this.user.timeType.type, '选择时长')
  5567. if(i != 1) {
  5568. this.falsss = false
  5569. } else {
  5570. this.falsss = true
  5571. }
  5572. if (this.isSubstitude) {
  5573. this.getSubstitudeUserDeptList();
  5574. }
  5575. if(i == -1 || this.isSubstitude) {
  5576. this.isDisable = false;
  5577. } else {
  5578. this.isDisable = true;
  5579. }
  5580. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5581. this.isBatch = isBatch;
  5582. if (this.isBatch == 0 && !this.isSubstitude) {
  5583. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  5584. let weekday = new Date(this.workForm.createDate).getDay()
  5585. if(this.user.companyId == 817){
  5586. if(weekday == 0){
  5587. this.isWeekend = true
  5588. }
  5589. }else{
  5590. if(weekday == 0 || weekday == 6){
  5591. this.isWeekend = true
  5592. }
  5593. }
  5594. this.getReport(i);
  5595. } else {
  5596. // console.log('执行到了这里')
  5597. this.jsTime = 0
  5598. this.jsDay = 0
  5599. this.workForm = {
  5600. createDate: null,//批量填报没有日期
  5601. domains: [{
  5602. id: null,
  5603. projectId: "",
  5604. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  5605. content: "",
  5606. progress:100,
  5607. state: 2,
  5608. timeType:0,
  5609. multiWorktime: this.reportTimeType.multiWorktime,
  5610. worktimeList:[{}],
  5611. canEdit: true,
  5612. }],
  5613. }
  5614. if(this.user.timeType.type == 1) {
  5615. var shuzhi = this.user.timeType.allday + ''
  5616. // console.log('执行二次')
  5617. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  5618. }
  5619. // console.log(this.workForm)
  5620. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  5621. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  5622. }
  5623. this.canEdit = true;
  5624. }
  5625. this.dialogVisible = true;
  5626. },
  5627. //按周填报的弹窗口中编辑单项目相关数据
  5628. setWeekFormReportItem(reportId, i, names, row,sss) {
  5629. console.log(sss)
  5630. this.http.post('/report/getReportById', {
  5631. reportId: reportId
  5632. },
  5633. res => {
  5634. if (res.code == "ok") {
  5635. var data = res.data.report;
  5636. sss.subProjectId = data.subProjectId
  5637. sss.subProjectList = data.subProjectList;
  5638. sss.stage = data.stage
  5639. sss.subProjectList = data.subProjectList
  5640. sss.stages = data.stages
  5641. sss.taskGroups = data.taskGroups;
  5642. sss.auditUserList = data.auditUserList;
  5643. sss.degreeId = data.degreeId;
  5644. sss.customData = data.customData;
  5645. sss.wuduList = data.degreeList;
  5646. this.zhoBaoIdx = i
  5647. this.zhoBaoName = names
  5648. this.zhoBao = sss
  5649. this.zhis = row
  5650. if (sss.groupId) {
  5651. //最后一个参数表示是否保留stage的值,不要重置为空
  5652. this.getGroupStages(this.zhoBao, 0, true)
  5653. }
  5654. this.$forceUpdate();
  5655. }
  5656. });
  5657. },
  5658. // 按周填报里内容的填写
  5659. tianxies(item, i, names, row) {
  5660. if (item.state == 0) {
  5661. this.$message({
  5662. message: '待审核状态不可修改,请返回到查看日报中先撤回',
  5663. type: "error"
  5664. });
  5665. return;
  5666. }
  5667. if (item.state == 1) {
  5668. this.$message({
  5669. message: '已通过状态不可修改',
  5670. type: "error"
  5671. });
  5672. return;
  5673. }
  5674. if(this.user.timeType.notAllowedNoAttendance == 1){
  5675. if(this.zhoData[i].corpTime){
  5676. if(this.zhoData[i].corpTime.workHours == 0){
  5677. this.$message({
  5678. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5679. type: 'error'
  5680. })
  5681. return
  5682. }
  5683. }else{
  5684. this.$message({
  5685. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  5686. type: 'error'
  5687. })
  5688. return
  5689. }
  5690. }
  5691. var idd = ''
  5692. var obj = {}
  5693. for(var l in this.projectList) {
  5694. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  5695. }
  5696. obj.projectId = idd
  5697. this.tianxieDialogVisible = true
  5698. this.scopess = item
  5699. console.log(item, '《==== 当前的对象')
  5700. var sss = {}
  5701. if (item.id != null) {
  5702. sss.id = item.id;
  5703. sss.state = item.state;
  5704. } else {
  5705. sss.id = -1;
  5706. sss.state = 3;
  5707. }
  5708. sss.projectId = idd;
  5709. sss.progress = item.progress
  5710. sss.time = item.time
  5711. sss.content = item.content;
  5712. console.log('333', sss.content)
  5713. if (sss.time == '' && this.reportTimeType.type == 2) {
  5714. //取已填时间范围中最大的一个作为开始时间
  5715. var startTime = '09:00';
  5716. var fillStartTime = '00:00';
  5717. for (var t in this.selProjectList) {
  5718. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  5719. if (fillItem.time) {
  5720. if (fillItem.time[1] > fillStartTime) {
  5721. fillStartTime = fillItem.time[1];
  5722. }
  5723. }
  5724. }
  5725. if (fillStartTime == '00:00') {
  5726. fillStartTime = '09:00';
  5727. }
  5728. var fillEndMax = '18:00';
  5729. if (fillStartTime >= '18:00') {
  5730. fillEndMax = '23:59';
  5731. }
  5732. sss.time = [fillStartTime, fillEndMax];
  5733. }
  5734. sss.groupId = item.groupId
  5735. sss.stage = item.stage;
  5736. sss.workingTime = item.workingTime
  5737. sss.projectAuditorId = item.projectAuditorId;
  5738. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5739. //默认选中第一个
  5740. sss.basecostId = this.timeBasecostList[0].id;
  5741. }
  5742. var hasEdited = this.zhoData[i][names].hasEdited;
  5743. if (hasEdited) {
  5744. sss = { ...item }
  5745. //编辑过了
  5746. sss.subProjectId = item.subProjectId
  5747. sss.stage = item.stage
  5748. sss.subProjectList = item.subProjectList
  5749. sss.stages = item.stages
  5750. sss.taskGroups = item.taskGroups;
  5751. console.log(sss.taskGroups, '33333');
  5752. sss.auditUserList = obj.auditUserList;
  5753. sss.degreeId = item.degreeId;
  5754. sss.customData = item.customData;
  5755. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5756. //只有一个审核人,自动设置上去
  5757. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5758. }
  5759. sss.wuduList = item.wuduList;
  5760. this.zhoBaoIdx = i
  5761. this.zhoBaoName = names
  5762. this.zhoBao = sss
  5763. this.zhis = row
  5764. if (sss.groupId) {
  5765. //最后一个参数表示是否保留stage的值,不要重置为空
  5766. this.getGroupStages(this.zhoBao, 0, true)
  5767. }
  5768. this.$forceUpdate();
  5769. this.getWeeklyTaskList(sss)
  5770. console.log('最后的周报 ===>', this.zhoBao)
  5771. } else {
  5772. //第一次打开,获取数据
  5773. if (sss.id == -1) {
  5774. //新填报的
  5775. this.selectProject(obj, 0);
  5776. var that = this
  5777. setTimeout(() =>{
  5778. sss.subProjectId = that.workForm.domains[0].subProjectId
  5779. sss.subProjectList = item.subProjectList;
  5780. sss.stage = that.workForm.domains[0].stage
  5781. sss.subProjectList = that.workForm.domains[0].subProjectList
  5782. sss.stages = that.workForm.domains[0].stages
  5783. sss.taskGroups = that.workForm.domains[0].taskGroups;
  5784. sss.auditUserList = obj.auditUserList;
  5785. sss.degreeId = item.degreeId;
  5786. sss.customData = item.customData;
  5787. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  5788. //只有一个审核人,自动设置上去
  5789. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  5790. }
  5791. sss.wuduList = row[0].wuduList
  5792. that.zhoBaoIdx = i
  5793. that.zhoBaoName = names
  5794. that.zhoBao = sss
  5795. that.zhis = row
  5796. if (sss.groupId) {
  5797. //最后一个参数表示是否保留stage的值,不要重置为空
  5798. this.getGroupStages(that.zhoBao, 0, false)
  5799. }
  5800. that.$forceUpdate();
  5801. this.getWeeklyTaskList(sss)
  5802. },600);
  5803. } else {
  5804. //编辑填报过的;数据库已经存在的
  5805. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  5806. }
  5807. }
  5808. },
  5809. // 按周填报里内容的填写点击确定
  5810. setWeekProItemData() {
  5811. //专业版模式下,任务分组和阶段必填
  5812. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  5813. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  5814. this.$message({
  5815. message: '任务分组和阶段必填,请检查',
  5816. type: "error"
  5817. });
  5818. return;
  5819. }
  5820. }
  5821. //检查子项目是否必填
  5822. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  5823. this.$message({
  5824. message: '子项目必填,请检查',
  5825. type: "error"
  5826. });
  5827. return;
  5828. }
  5829. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  5830. this.$message({
  5831. message: this.$t('message.Pleaseselectareviewer'),
  5832. type: "error"
  5833. });
  5834. return
  5835. }
  5836. if(this.user.timeType.reportAuditType == 3){
  5837. let auditTips = ''
  5838. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  5839. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  5840. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  5841. if(auditTips){
  5842. auditTips = auditTips.substring(0,auditTips.length - 1)
  5843. this.$message({
  5844. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  5845. type: 'error'
  5846. })
  5847. return
  5848. }
  5849. }
  5850. let errtips = ''
  5851. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  5852. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  5853. errtips += this.user.timeType.customDegreeName + '、'
  5854. }
  5855. }
  5856. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  5857. errtips += this.user.timeType.customDataName + '、'
  5858. }
  5859. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  5860. errtips += this.user.timeType.customTextName + '、'
  5861. }
  5862. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  5863. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  5864. }
  5865. if(errtips){
  5866. errtips = errtips.substring(0,errtips.length - 1)
  5867. this.$message({
  5868. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  5869. type: 'error'
  5870. })
  5871. return
  5872. }
  5873. this.tianxieDialogVisible = false
  5874. var zhong = this.zhoData
  5875. this.zhoBao.hasEdited = true;
  5876. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  5877. this.zhoData = zhong
  5878. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  5879. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  5880. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  5881. },
  5882. // 获取本周
  5883. getCurrentWeek() {
  5884. //今天
  5885. this.targetWeekDate = new Date();
  5886. this.initWeekFormData();
  5887. // this.jiazai()
  5888. },
  5889. // 获取上周
  5890. handleGetPrevWeek() {
  5891. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  5892. this.initWeekFormData();
  5893. // this.jiazai()
  5894. },
  5895. // 获取下周
  5896. handleGetNextvWeek() {
  5897. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  5898. this.initWeekFormData()
  5899. },
  5900. // 加载动画
  5901. jiazai() {
  5902. this.weekDataLoading = true
  5903. var that = this
  5904. setTimeout(() =>{
  5905. that.weekDataLoading = false
  5906. },1000);
  5907. },
  5908. // 转时间格式
  5909. dealdate(date) {
  5910. const dt = new Date(date)
  5911. const y = dt.getFullYear()
  5912. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  5913. const d = (dt.getDate() + '').padStart(2, '0')
  5914. return `${y}-${m}-${d}`
  5915. },
  5916. // 按周填报
  5917. fillInReportss() {
  5918. window.addEventListener('scroll', this.handleScroll, true)
  5919. // this.jiazai()
  5920. this.fillWeekDialogVisi = true
  5921. this.getCurrentWeek();
  5922. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  5923. //重新获取工时预警类型的预算项
  5924. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5925. companyId: this.user.companyId
  5926. },
  5927. res => {
  5928. if (res.code == "ok") {
  5929. this.timeBasecostList = res.data;
  5930. }
  5931. });
  5932. }
  5933. },
  5934. fillInReportCustom() {
  5935. this.weekIndex++
  5936. this.weekParentData = {
  5937. isSubstitude: this.isSubstitude
  5938. }
  5939. this.fillWeekDialogVisiCustom = true
  5940. },
  5941. // 按周填报的项目筛选
  5942. selListFun(){
  5943. this.selProjectList = []
  5944. if(this.selCon.length){
  5945. for (let i = 0; i < this.selCon.length; i++) {
  5946. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  5947. }
  5948. this.selConShow = false ;
  5949. for (let i in this.zhoData) {
  5950. var obj = this.zhoData[i];
  5951. for(var j in this.selProjectList) {
  5952. var xinzhi = this.selProjectList[j].projectName
  5953. obj[xinzhi] = {}
  5954. obj[xinzhi].time = ''
  5955. obj[xinzhi].content = ''
  5956. obj[xinzhi].progress = 0
  5957. obj[xinzhi].workingTime = 0
  5958. }
  5959. }
  5960. this.initWeekFormData();
  5961. }else{
  5962. this.$message({
  5963. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  5964. type:'error'
  5965. })
  5966. }
  5967. },
  5968. setWeekCardTimeData(list) {
  5969. for(let i in list){
  5970. let datei = '';
  5971. if (this.user.timeType.showDdCardtime == 1) {
  5972. datei = list[i].workDate;
  5973. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  5974. datei = list[i].createDate;
  5975. } else if (this.user.timeType.syncFanwei == 1) {
  5976. datei = list[i].workDate;
  5977. }
  5978. for(let m in this.zhoData) {
  5979. if(datei == this.zhoData[m].zhoDataTime){
  5980. let item = {
  5981. startTime: list[i].startTime,
  5982. endTime: list[i].endTime,
  5983. workHours: list[i].workHours
  5984. }
  5985. this.$set(this.zhoData[m],'corpTime',item)
  5986. }
  5987. }
  5988. }
  5989. },
  5990. getWeeklyCardTime(){ //按周填报获取考勤信息
  5991. let dateStr = []
  5992. for(let i in this.zhoData){
  5993. dateStr.push(this.zhoData[i].zhoDataTime)
  5994. }
  5995. this.http.post('/report/getWeeklyCardTime',{
  5996. dateStr: JSON.stringify(dateStr)
  5997. },res => {
  5998. if(res.code == 'ok'){
  5999. for(let i in res.data){
  6000. let datei = '';
  6001. if (this.user.timeType.showDdCardtime == 1) {
  6002. datei = res.data[i].workDate.split('-');
  6003. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6004. datei = res.data[i].createDate.split('-');
  6005. }
  6006. for(let m in this.zhoData){
  6007. let datem = new Date(this.zhoData[m].zhoDataTime)
  6008. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6009. let item = {
  6010. startTime: res.data[i].startTime,
  6011. endTime: res.data[i].endTime,
  6012. workHours: res.data[i].workHours
  6013. }
  6014. this.$set(this.zhoData[m],'corpTime',item)
  6015. }
  6016. }
  6017. }
  6018. }else{
  6019. this.$message({
  6020. message: res.msg,
  6021. type: 'error'
  6022. })
  6023. }
  6024. },err => {
  6025. this.$message({
  6026. message: err,
  6027. type: 'error'
  6028. })
  6029. })
  6030. },
  6031. selListqx(){
  6032. this.fillWeekDialogVisi = false
  6033. this.selProjectList = []
  6034. this.selCon = []
  6035. },
  6036. handleScroll() {
  6037. this.changdu = this.projectList.length + 1
  6038. },
  6039. // 自动选择时间点的事件
  6040. // async zhoTimes(item, i) {
  6041. // var iss = i
  6042. // if(item.time == null) {
  6043. // return
  6044. // } else {
  6045. // const zhi = this.zhoData[iss];
  6046. // let he = 0;
  6047. // const timeArr = Object.values(zhi)
  6048. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6049. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6050. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6051. // console.log(data, 'data');
  6052. // zhi.he = `${he}h`;
  6053. // }
  6054. // },
  6055. async zhoTimes(item, index) {
  6056. const zho = this.zhoData[index];
  6057. if (!item.time) {
  6058. return;
  6059. }
  6060. const timeArr = Object.values(zho)
  6061. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6062. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6063. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6064. zho.he = `${totalHours[0]}h`;
  6065. },
  6066. // 判断两个时间段是否重叠
  6067. timeOverlap(idx, dateAr) {
  6068. let zhi = 0
  6069. for (let k in dateAr) {
  6070. if (idx !== k) {
  6071. 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))) {
  6072. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6073. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6074. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6075. }
  6076. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6077. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6078. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6079. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6080. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6081. } else {
  6082. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6083. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6084. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6085. }
  6086. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6087. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6088. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6089. }
  6090. }
  6091. }
  6092. }
  6093. }
  6094. return zhi
  6095. },
  6096. // 计算时间
  6097. getHourMinutes(str, end) {
  6098. var he = 0
  6099. var date2 = '2021/12/12 ' + end +':00'
  6100. var date1 = '2021/12/12 ' + str +':00'
  6101. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6102. var leave1=date3%(24*3600*1000)
  6103. var hours=Math.floor(leave1/(3600*1000))
  6104. var leave2=leave1%(3600*1000)
  6105. var minutes=Math.floor(leave2/(60*1000))
  6106. var shi = hours+'.'+ minutes
  6107. return he += +shi
  6108. },
  6109. // 自动选择事件长度的事件
  6110. zhoXuan(item, i) {
  6111. var iss = i
  6112. if(item.time == null) {
  6113. return
  6114. } else {
  6115. var zhi = this.zhoData[iss]
  6116. var he = 0
  6117. for(var i in zhi) {
  6118. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6119. he += +zhi[i].workingTime
  6120. }
  6121. }
  6122. zhi.he = he + 'h'
  6123. }
  6124. },
  6125. getPushWorkLogData(){
  6126. this.http.post('/sap-sync-log/list', {},
  6127. res => {
  6128. if (res.code == "ok") {
  6129. this.pushWorkTimeLogData = res.data;
  6130. } else {
  6131. this.$message({
  6132. message: res.msg,
  6133. type: "error"
  6134. });
  6135. }
  6136. },
  6137. error => {
  6138. this.$message({
  6139. message: error,
  6140. type: "error"
  6141. });
  6142. });
  6143. },
  6144. // 获取全部人员
  6145. getUsers() {
  6146. this.http.post('/user/getSimpleActiveUserList', {},
  6147. res => {
  6148. if (res.code == "ok") {
  6149. this.usersList = res.data;
  6150. } else {
  6151. this.$message({
  6152. message: res.msg,
  6153. type: "error"
  6154. });
  6155. }
  6156. },
  6157. error => {
  6158. this.$message({
  6159. message: error,
  6160. type: "error"
  6161. });
  6162. });
  6163. },
  6164. // 按时间比例
  6165. addBli(item, i) {
  6166. var iss = i
  6167. if(item.time == null) {
  6168. return
  6169. } else {
  6170. var zhi = this.zhoData[iss]
  6171. var he = 0
  6172. for(var i in zhi) {
  6173. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6174. he += +zhi[i].workingTime
  6175. }
  6176. }
  6177. zhi.he = he.toFixed(1) + 'h'
  6178. }
  6179. },
  6180. //按周填报选择的项目发生变化,需要设置列
  6181. onSelProjectChange() {
  6182. for (let i = 0; i < this.selCon.length; i++) {
  6183. var exists = false;
  6184. for (let j = 0; j < this.selProjectList.length; j++) {
  6185. if (this.selProjectList[j].id == this.selCon[i]) {
  6186. exists = true;
  6187. break;
  6188. }
  6189. }
  6190. if (!exists) {
  6191. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6192. this.selProjectList.push(newProject);
  6193. //添加新项目
  6194. for (var w in this.zhoData) {
  6195. var dayItem = this.zhoData[w];
  6196. var pName = newProject.projectName;
  6197. dayItem[pName] = {};
  6198. dayItem[pName].time = ''
  6199. dayItem[pName].content = ''
  6200. dayItem[pName].progress = 0
  6201. dayItem[pName].workingTime = 0
  6202. }
  6203. }
  6204. }
  6205. //去掉
  6206. for (let j = 0; j < this.selProjectList.length; j++) {
  6207. var exists = false;
  6208. for (let i = 0; i < this.selCon.length; i++) {
  6209. if (this.selProjectList[j].id == this.selCon[i]) {
  6210. exists = true;
  6211. break;
  6212. }
  6213. }
  6214. if (!exists) {
  6215. this.selProjectList.splice(j, 1);
  6216. j--;
  6217. }
  6218. }
  6219. this.loadFilledWeekReportItem();
  6220. //刷新表格
  6221. // this.$refs.weekTable.doLayout();
  6222. },
  6223. //根据选中的项目来刷新填写表格
  6224. loadFilledWeekReportItem() {
  6225. for (var w in this.zhoData) {
  6226. var dayItem = this.zhoData[w];
  6227. for (var i = 0; i < this.selProjectList.length; i++) {
  6228. var curColumnProject = this.selProjectList[i];
  6229. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6230. for (var t in dayItem.reportList) {
  6231. //有日报的项目,不能取消选择
  6232. for (var p in this.fillProjectList) {
  6233. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6234. }
  6235. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6236. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6237. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6238. if (this.reportTimeType.type == 2) {
  6239. //时间段模式
  6240. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6241. }
  6242. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6243. break;
  6244. }
  6245. }
  6246. // dayItem[curColumnProject.projectName] = matchReportItem;
  6247. }
  6248. }
  6249. this.$nextTick(()=>{
  6250. this.$refs.weekTable.doLayout();
  6251. });
  6252. },
  6253. initWeekFormData() {
  6254. this.weekDataLoading = true;
  6255. for (var p in this.fillProjectList) {
  6256. this.fillProjectList[p].canCancel = 1;
  6257. }
  6258. this.http.post('/report/getWeeklyReportData',{
  6259. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6260. },res => {
  6261. this.weekDataLoading = false;
  6262. if(res.code == 'ok'){
  6263. let projectList = res.data.projectList;
  6264. if (projectList.length > 0) {
  6265. //有选择过项目进行填报,直接选中
  6266. this.selProjectList = projectList;
  6267. this.selCon = [];
  6268. for (let i = 0; i < projectList.length; i++) {
  6269. this.selCon.push(projectList[i].id);
  6270. }
  6271. }
  6272. //设置日期
  6273. this.weekDateRange = res.data.dateList;
  6274. this.zhoData = [];
  6275. var arrst = []
  6276. for(var i in this.weekDateRange) {
  6277. var obj = {}
  6278. obj.zhoDataTime = this.weekDateRange[i].date
  6279. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  6280. obj.he = this.weekDateRange[i].filledTime;
  6281. obj.canFill = this.weekDateRange[i].canFill;
  6282. // obj.filledTime = this.weekDateRange[i].filledTime;
  6283. obj.reportList = this.weekDateRange[i].reportList;
  6284. //初始化,防止渲染报错
  6285. for (var j = 0; j < this.selProjectList.length; j++) {
  6286. var pName = this.selProjectList[j].projectName
  6287. obj[pName] = {}
  6288. obj[pName].time = ''
  6289. obj[pName].content = ''
  6290. obj[pName].progress = 0
  6291. obj[pName].workingTime = 0
  6292. }
  6293. arrst.push(obj)
  6294. }
  6295. this.zhoData = arrst
  6296. this.setWeekCardTimeData(res.data.cardTimeList);
  6297. this.loadFilledWeekReportItem();
  6298. }else{
  6299. this.$message({
  6300. message: res.msg,
  6301. type: 'error'
  6302. })
  6303. }
  6304. },err => {
  6305. this.$message({
  6306. message: err,
  6307. type: 'error'
  6308. })
  6309. })
  6310. },
  6311. zhoZhi(res, i) {
  6312. var zhi = 0
  6313. for(var i in res) {
  6314. if(i != 'zhoDataTime' && i != 'he') {
  6315. zhi += +res[i]
  6316. }
  6317. }
  6318. res.he = zhi
  6319. },
  6320. zhoBtn(i) {
  6321. // this.zhoData.split(i, 1)
  6322. var arr = this.zhoData
  6323. arr.splice(i, 1)
  6324. },
  6325. zhoAddlast(){
  6326. this.selConShow = true
  6327. },
  6328. closeAddWeeklyReport(){
  6329. this.fillWeekDialogVisi = false
  6330. this.selConShow = true
  6331. this.selProjectList = []
  6332. this.selCon = []
  6333. },
  6334. // 提交按周填报
  6335. submitWeekReport(isDraft) {
  6336. var zhi = this.zhoData
  6337. var ll = 0
  6338. if(this.reportTimeType.type == 2) {
  6339. for(var i in zhi) {
  6340. this.dateAr = []
  6341. var alp = []
  6342. var zhis = zhi[i]
  6343. console.log(zhis)
  6344. for(var j in zhis) {
  6345. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  6346. let objs = {}
  6347. objs.s = zhis[j].time[0]
  6348. objs.e = zhis[j].time[1]
  6349. objs.p = j
  6350. alp.push(objs)
  6351. }
  6352. }
  6353. console.log(alp)
  6354. this.dateAr = alp
  6355. if (this.reportTimeType.timeCanOverlap == 0) {
  6356. let str = this.$t('message.Filledtimeperiodsoverlap')
  6357. if(this.dateAr.length > 0) {
  6358. const trus = this.fns();
  6359. const overlapDataTime = this.getOverlapData(alp);
  6360. if (overlapDataTime.length > 0) {
  6361. const arrList = overlapDataTime.map((item) => item.p);
  6362. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  6363. }
  6364. ll += 1
  6365. if(!trus) {
  6366. this.$message({
  6367. message: str,
  6368. type: 'error'
  6369. })
  6370. return false
  6371. }
  6372. }
  6373. } else {
  6374. if(this.dateAr.length > 0) {
  6375. ll +=1 ;
  6376. }
  6377. }
  6378. }
  6379. if(ll == 0) {
  6380. this.$message({
  6381. message: this.$t('message.Pleasefillinthetime'),
  6382. type: 'error'
  6383. })
  6384. return false
  6385. }
  6386. } else if(this.reportTimeType.type == 1){
  6387. for(var i in zhi) {
  6388. var zhis = zhi[i]
  6389. for(var j in zhis) {
  6390. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  6391. ll += 1
  6392. }
  6393. }
  6394. }
  6395. if(ll == 0) {
  6396. this.$message({
  6397. message: this.$t('message.Pleaseselectatime'),
  6398. type: 'error'
  6399. })
  6400. return false
  6401. }
  6402. let overcorp = ''
  6403. for(let n in zhi){
  6404. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  6405. overcorp += zhi[n].zhoDataTime + ','
  6406. }
  6407. }
  6408. if(overcorp != ''){
  6409. overcorp = overcorp.substring(0,overcorp.length - 1)
  6410. this.$message({
  6411. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  6412. type: 'error'
  6413. })
  6414. return
  6415. }
  6416. }
  6417. var submits = []
  6418. let formData = new FormData();
  6419. formData.append("draft", isDraft);
  6420. if(this.reportTimeType.multiWorktime == 1){
  6421. for (var i in this.zhoData) {
  6422. var zhoD = this.zhoData[i]
  6423. var flgs = false
  6424. for(var j in zhoD) {
  6425. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  6426. flgs = true
  6427. // formData.append("degreeId", "-1");
  6428. formData.append("id", '-1');
  6429. for(var s in this.projectList) {
  6430. if(j == this.projectList[s].projectName) {
  6431. formData.append("projectId", this.projectList[s].id);
  6432. }
  6433. }
  6434. if(this.user.timeType.reportAuditType == 3){
  6435. let audItem = {}
  6436. if(this.user.timeType.auditLevel > 0){
  6437. audItem.auditorFirst = zhoD[j].auditorFirst
  6438. }
  6439. if(this.user.timeType.auditLevel > 1){
  6440. audItem.auditorSec = zhoD[j].auditorSec
  6441. }
  6442. if(this.user.timeType.auditLevel > 2){
  6443. audItem.auditorThird = zhoD[j].auditorThird
  6444. }
  6445. if(zhoD[j].ccUserid){
  6446. audItem.ccUserid = zhoD[j].ccUserid
  6447. }
  6448. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6449. }
  6450. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6451. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6452. formData.append("reportTimeType", this.reportTimeType.type);
  6453. formData.append("endTime", '');
  6454. formData.append("startTime", '');
  6455. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6456. var lix = []
  6457. var objjs = {}
  6458. objjs.startTime = zhoD[j].time[0]
  6459. objjs.endTime = zhoD[j].time[1]
  6460. if (zhoD[j].content == null || zhoD[j].content == '') {
  6461. zhoD[j].content == '-'
  6462. }
  6463. objjs.content = zhoD[j].content
  6464. lix.push(objjs)
  6465. var zhiZhi = JSON.stringify(lix)
  6466. zhiZhi = zhiZhi.replace(/,/g,"@");
  6467. formData.append("content", zhiZhi)
  6468. formData.append("isOvertime", 0)
  6469. formData.append("professionProgress", "[]")
  6470. if (zhoD[j].groupId) {
  6471. formData.append("groupId",zhoD[j].groupId)
  6472. } else {
  6473. //解决后台groupId数组越界的问题
  6474. formData.append("groupId",0)
  6475. }
  6476. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6477. formData.append("createDate",zhoD.zhoDataTime)
  6478. if (zhoD[j].projectAuditorId) {
  6479. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6480. }
  6481. if(zhoD[j].basecostId) {
  6482. formData.append("basecostId", zhoD[j].basecostId);
  6483. } else {
  6484. formData.append("basecostId", 0);
  6485. }
  6486. if(this.user.timeType.customDegreeActive){
  6487. if (this.user.timeType.customDegreeMultiple) {
  6488. if (zhoD[j].multiDegrIdArray) {
  6489. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  6490. } else {
  6491. formData.append('multiDegrId','[]')
  6492. }
  6493. } else {
  6494. if (zhoD[j].degreeId) {
  6495. formData.append('degreeId',zhoD[j].degreeId)
  6496. } else {
  6497. formData.append('degreeId','-1')
  6498. }
  6499. }
  6500. }else{
  6501. formData.append("degreeId", "-1");
  6502. }
  6503. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6504. formData.append('customData',zhoD[j].customData)
  6505. }else if(this.user.timeType.customDataActive){
  6506. formData.append('customData',0)
  6507. }
  6508. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6509. formData.append('customText',zhoD[j].customText)
  6510. }else if(this.user.timeType.customTextActive){
  6511. formData.append('customText','-')
  6512. }
  6513. }
  6514. }
  6515. }
  6516. } else {
  6517. for (var i in this.zhoData) {
  6518. var zhoD = this.zhoData[i]
  6519. var flgs = false
  6520. if(this.reportTimeType.type == 2) {
  6521. for(var k in this.selProjectList) {
  6522. var pItem = this.selProjectList[k];
  6523. var pName = pItem.projectName;
  6524. var j = pName;
  6525. console.log('j==周报中的项目='+j);
  6526. if(zhoD[j].time && zhoD[j].time != 'null') {
  6527. flgs = true
  6528. // formData.append("degreeId", "-1");
  6529. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6530. for(var s in this.projectList) {
  6531. if(j == this.projectList[s].projectName) {
  6532. formData.append("projectId", this.projectList[s].id);
  6533. }
  6534. }
  6535. if(this.user.timeType.reportAuditType == 3){
  6536. let audItem = {}
  6537. if(this.user.timeType.auditLevel > 0){
  6538. audItem.auditorFirst = zhoD[j].auditorFirst
  6539. }
  6540. if(this.user.timeType.auditLevel > 1){
  6541. audItem.auditorSec = zhoD[j].auditorSec
  6542. }
  6543. if(this.user.timeType.auditLevel > 2){
  6544. audItem.auditorThird = zhoD[j].auditorThird
  6545. }
  6546. if(zhoD[j].ccUserid){
  6547. audItem.ccUserid = zhoD[j].ccUserid
  6548. }
  6549. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6550. }
  6551. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  6552. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6553. formData.append("reportTimeType", this.reportTimeType.type);
  6554. formData.append("endTime", zhoD[j].time[1]);
  6555. formData.append("startTime", zhoD[j].time[0]);
  6556. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6557. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6558. formData.append("isOvertime", 0)
  6559. formData.append("professionProgress", "[]")
  6560. if (zhoD[j].groupId) {
  6561. formData.append("groupId",zhoD[j].groupId)
  6562. } else {
  6563. //解决后台groupId数组越界的问题
  6564. formData.append("groupId",0)
  6565. }
  6566. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6567. formData.append("createDate",zhoD.zhoDataTime)
  6568. if (zhoD[j].projectAuditorId) {
  6569. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6570. }
  6571. if(zhoD[j].basecostId) {
  6572. formData.append("basecostId", zhoD[j].basecostId);
  6573. } else {
  6574. formData.append("basecostId", 0);
  6575. }
  6576. if(this.user.timeType.customDegreeActive){
  6577. if (this.user.timeType.customDegreeMultiple) {
  6578. if (zhoD[j].multiDegrIdArray) {
  6579. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6580. } else {
  6581. formData.append("multiDegrId", "[]");
  6582. }
  6583. } else {
  6584. if (zhoD[j].degreeId) {
  6585. formData.append('degreeId',zhoD[j].degreeId)
  6586. } else {
  6587. formData.append("degreeId", "-1");
  6588. }
  6589. }
  6590. }else{
  6591. formData.append("degreeId", "-1");
  6592. }
  6593. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6594. formData.append('customData',zhoD[j].customData)
  6595. }else if(this.user.timeType.customDataActive){
  6596. formData.append('customData',0)
  6597. }
  6598. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6599. formData.append('customText',zhoD[j].customText)
  6600. }else if(this.user.timeType.customTextActive){
  6601. formData.append('customText','-')
  6602. }
  6603. }
  6604. }
  6605. } else {
  6606. for(var k in this.selProjectList) {
  6607. var pItem = this.selProjectList[k];
  6608. var pName = pItem.projectName;
  6609. var j = pName;
  6610. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  6611. flgs = true
  6612. // formData.append("degreeId", "-1");
  6613. console.log('进入了workFpppp==='+j);
  6614. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  6615. for(var s in this.projectList) {
  6616. if(j == this.projectList[s].projectName) {
  6617. formData.append("projectId", this.projectList[s].id);
  6618. }
  6619. }
  6620. if(this.user.timeType.reportAuditType == 3){
  6621. let audItem = {}
  6622. if(this.user.timeType.auditLevel > 0){
  6623. audItem.auditorFirst = zhoD[j].auditorFirst
  6624. }
  6625. if(this.user.timeType.auditLevel > 1){
  6626. audItem.auditorSec = zhoD[j].auditorSec
  6627. }
  6628. if(this.user.timeType.auditLevel > 2){
  6629. audItem.auditorThird = zhoD[j].auditorThird
  6630. }
  6631. if(zhoD[j].ccUserid){
  6632. audItem.ccUserid = zhoD[j].ccUserid
  6633. }
  6634. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  6635. }
  6636. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  6637. // formData.append("subProjectId", zhoD[j].subProjectId);
  6638. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  6639. formData.append("reportTimeType", this.reportTimeType.type);
  6640. if(this.reportTimeType.type == 1) {
  6641. formData.append("workingTime", zhoD[j].workingTime);
  6642. } else if(this.reportTimeType.type == 2) {
  6643. formData.append("endTime", zhoD[j].time[1]);
  6644. formData.append("startTime", zhoD[j].time[0]);
  6645. } else if(this.reportTimeType.type == 3) {
  6646. formData.append("progress", zhoD[j].progress);
  6647. formData.append("workingTime", zhoD[j].workingTime);
  6648. }
  6649. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  6650. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  6651. formData.append("isOvertime", 0)
  6652. formData.append("professionProgress", "[]")
  6653. if (zhoD[j].groupId) {
  6654. formData.append("groupId",zhoD[j].groupId)
  6655. } else {
  6656. //解决后台groupId数组越界的问题
  6657. formData.append("groupId",0)
  6658. }
  6659. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  6660. formData.append("createDate",zhoD.zhoDataTime)
  6661. if (zhoD[j].projectAuditorId) {
  6662. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  6663. }
  6664. if(zhoD[j].basecostId) {
  6665. formData.append("basecostId", zhoD[j].basecostId);
  6666. } else {
  6667. formData.append("basecostId", 0);
  6668. }
  6669. if(this.user.timeType.customDegreeActive){
  6670. if (this.user.timeType.customDegreeMultiple) {
  6671. if (zhoD[j].multiDegrIdArray) {
  6672. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  6673. } else {
  6674. formData.append("multiDegrId", "[]");
  6675. }
  6676. } else {
  6677. if (zhoD[j].degreeId) {
  6678. formData.append('degreeId',zhoD[j].degreeId)
  6679. } else {
  6680. formData.append("degreeId", "-1");
  6681. }
  6682. }
  6683. }else{
  6684. formData.append("degreeId", "-1");
  6685. }
  6686. if(this.user.timeType.customDataActive && zhoD[j].customData){
  6687. formData.append('customData',zhoD[j].customData)
  6688. }else if(this.user.timeType.customDataActive){
  6689. formData.append('customData',0)
  6690. }
  6691. if(this.user.timeType.customTextActive && zhoD[j].customText){
  6692. formData.append('customText',zhoD[j].customText)
  6693. }else if(this.user.timeType.customTextActive){
  6694. formData.append('customText','-')
  6695. }
  6696. }
  6697. }
  6698. }
  6699. }
  6700. }
  6701. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  6702. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  6703. if(!next) {
  6704. this.$message({
  6705. message: `【${error.join('、')}】请填写任务分组`,
  6706. type: 'error'
  6707. })
  6708. return
  6709. }
  6710. // 自定义维度
  6711. this.submitingReport = true;
  6712. this.http.uploadFile( this.port.report.editPort, formData,
  6713. res => {
  6714. // this.listLoading = false;
  6715. this.submitingReport = false;
  6716. if (res.code == "ok") {
  6717. this.$message({
  6718. message: this.$t('message.fillinsuccessfully'),
  6719. type: "success"
  6720. });
  6721. this.fillWeekDialogVisi = false
  6722. this.selConShow = true
  6723. this.zhoData = []
  6724. this.weekDateRange = ''
  6725. this.getReportList();
  6726. this.getDepartment();
  6727. // 关闭弹窗 并 清空
  6728. this.selProjectList = []
  6729. this.selCon = []
  6730. this.getRecentlyProject()
  6731. } else {
  6732. this.$message({
  6733. message: res.msg,
  6734. type: "error"
  6735. });
  6736. }
  6737. },
  6738. error => {
  6739. this.submitingReport = false;
  6740. this.$message({
  6741. message: error,
  6742. type: "error"
  6743. });
  6744. });
  6745. },
  6746. handleGroupAuditorData(data) {
  6747. const { reportAuditType } = this.user.timeType
  6748. if(reportAuditType != 1 && reportAuditType != 2) {
  6749. return {next: true}
  6750. }
  6751. let arrList = [];
  6752. Object.entries(data).forEach(([key, obj]) => {
  6753. Object.entries(obj).forEach(([projectName, projectData]) => {
  6754. if (projectData.workingTime && !projectData.groupId) {
  6755. arrList.push({
  6756. projectName,
  6757. date: obj.zhoDataTime,
  6758. dateText: obj.zhoDataTimeTxt
  6759. });
  6760. }
  6761. });
  6762. });
  6763. if(arrList.length > 0) {
  6764. return {
  6765. next: false,
  6766. error: arrList.map(item => `【${item.date} ${item.dateText} 中的 (${item.projectName})项目】`),
  6767. }
  6768. } else {
  6769. return {
  6770. next: true,
  6771. error: [],
  6772. }
  6773. }
  6774. },
  6775. ChangeHourMinutestr (str) {
  6776. if (str !== "0" && str !== "" && str !== null) {
  6777. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  6778. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  6779. } else {
  6780. return "";
  6781. }
  6782. },
  6783. // 得到两个日期中间的日期
  6784. getdiffdate(stime,etime){
  6785. //初始化日期列表,数组
  6786. var diffdate = new Array();
  6787. var i=0;
  6788. //开始日期小于等于结束日期,并循环
  6789. while(stime<=etime){
  6790. diffdate[i] = stime;
  6791. //获取开始日期时间戳
  6792. var stime_ts = new Date(stime).getTime();
  6793. //增加一天时间戳后的日期
  6794. var next_date = stime_ts + (24*60*60*1000);
  6795. //拼接年月日,这里的月份会返回(0-11),所以要+1
  6796. var next_dates_y = new Date(next_date).getFullYear()+'-';
  6797. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  6798. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  6799. stime = next_dates_y+next_dates_m+next_dates_d;
  6800. //增加数组key
  6801. i++;
  6802. }
  6803. return diffdate;
  6804. },
  6805. // 添加模块
  6806. addDomain(i) {
  6807. var leftProgress = 10;
  6808. if (this.reportTimeType.type == 3) {
  6809. //计算已经待分配工时比例
  6810. let array = this.workForm.domains;
  6811. let totalProgress = 0;
  6812. for (var i=0;i<array.length; i++) {
  6813. totalProgress += array[i].progress;
  6814. }
  6815. if (totalProgress < 100) {
  6816. leftProgress = 100 - totalProgress;
  6817. }
  6818. }
  6819. var addItem = {
  6820. projectId: "",
  6821. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  6822. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  6823. ),
  6824. content: "",
  6825. progress:leftProgress,
  6826. state:2,//2-表示待提交
  6827. multiWorktime: this.reportTimeType.multiWorktime,
  6828. worktimeList:[{}],
  6829. canEdit: true,
  6830. auditorFirst: '',
  6831. auditorSec: '',
  6832. auditorThird: '',
  6833. ccUserid: ''
  6834. // degreeId: '',
  6835. };
  6836. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6837. this.$set(addItem,'isOvertime',true)
  6838. if(this.reportTimeType.type == 3){
  6839. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  6840. }
  6841. }
  6842. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6843. //默认给第一个,必填字段
  6844. addItem.basecostId = this.timeBasecostList[0].id;
  6845. }
  6846. this.workForm.domains.push(addItem);
  6847. document.getElementById('workFormsItemBottom').scrollIntoView()
  6848. this.canEdit = true
  6849. if (this.reportTimeType.type == 0) {
  6850. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  6851. var length = this.workForm.domains.length;
  6852. if (length == 2) {
  6853. this.showAddMore = false;
  6854. }
  6855. }
  6856. this.chuji()
  6857. this.seleChn()
  6858. },
  6859. // 移除模块
  6860. delDomain(i) {
  6861. this.workForm.domains.splice(i,1)
  6862. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  6863. if (!this.originCanEdit) {
  6864. let iscan = false
  6865. for(let i in this.workForm.domains){
  6866. if(this.workForm.domains[i].canEdit){
  6867. iscan = true
  6868. }
  6869. }
  6870. this.canEdit = iscan
  6871. }
  6872. //检测当前剩下的一个,时间类型是否是全天
  6873. if (this.reportTimeType.type == 0) {
  6874. if (this.workForm.domains[0].timeType == 0) {
  6875. this.showAddMore = false;
  6876. } else {
  6877. this.showAddMore = true;
  6878. }
  6879. }
  6880. if(this.user.timeType.multiWorktime == 1) {
  6881. this.iptChangs()
  6882. } else {
  6883. this.seleChn(0)
  6884. }
  6885. },
  6886. // 改变月份
  6887. changeMonth() {
  6888. this.isWeekend = false
  6889. let date = new Date()
  6890. let nowmon = date.getMonth() + 1
  6891. let nowday = date.getDate()
  6892. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  6893. if (this.isBatch == 0) {
  6894. if(this.user.timeType.fillAhead == 0){
  6895. let date_a = new Date(this.workForm.createDate)
  6896. if(date_a.getTime() > date.getTime()){
  6897. this.workForm.createDate = nowdate
  6898. }
  6899. }
  6900. //只有按天填报才能获取当天的日报
  6901. if(!this.isSubstitude){
  6902. let weekday = new Date(this.workForm.createDate).getDay()
  6903. if(this.user.companyId == 817){
  6904. if(weekday == 0){
  6905. this.isWeekend = true
  6906. }
  6907. }else{
  6908. if(weekday == 0 || weekday == 6){
  6909. this.isWeekend = true
  6910. }
  6911. }
  6912. this.getReport()
  6913. }
  6914. }else {
  6915. if(this.user.timeType.fillAhead == 0){
  6916. let date_a = new Date(this.workForm.createDate[1])
  6917. if(date_a.getTime() > date.getTime()){
  6918. this.workForm.createDate[1] = nowdate
  6919. let sdate = new Date(this.workForm.createDate[0])
  6920. let edate = new Date(this.workForm.createDate[1])
  6921. if(sdate > edate){
  6922. this.workForm.createDate[0] = this.workForm.createDate[1]
  6923. }
  6924. }
  6925. }
  6926. }
  6927. },
  6928. // 判断时间段
  6929. fns() {
  6930. for (let k in this.dateAr) {
  6931. if (!this.judege(k)) {
  6932. return false
  6933. }
  6934. }
  6935. return true
  6936. },
  6937. judege(idx){
  6938. for (let k in this.dateAr) {
  6939. if (idx !== k) {
  6940. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  6941. return false
  6942. }
  6943. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  6944. return false
  6945. }
  6946. }
  6947. }
  6948. return true
  6949. },
  6950. getOverlapData(data) {
  6951. let overlapData = [];
  6952. for (let i = 0; i < data.length; i++) {
  6953. for (let j = i + 1; j < data.length; j++) {
  6954. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  6955. overlapData.push(data[i], data[j]);
  6956. }
  6957. }
  6958. }
  6959. return overlapData;
  6960. },
  6961. // 保存日报111111
  6962. submitReport(isDraft) {
  6963. this.isDraft = isDraft;
  6964. this.$refs.workForm.validate(valid => {
  6965. if (valid) {
  6966. if(this.totalReportHours < this.user.timeType.allday){
  6967. this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
  6968. confirmButtonText: '确定',
  6969. cancelButtonText: '取消',
  6970. type: 'warning'
  6971. }).then(() => {
  6972. this.submitReportSon()
  6973. }).catch(() => {
  6974. });
  6975. }else{
  6976. this.submitReportSon()
  6977. }
  6978. }
  6979. });
  6980. },
  6981. submitReportSon() {
  6982. this.dateAr = []
  6983. //检查重叠
  6984. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  6985. let alp = []
  6986. if(this.user.timeType.multiWorktime != 1) {
  6987. for(var p in this.workForm.domains) {
  6988. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  6989. let objs = {}
  6990. objs.s = this.workForm.domains[p].startTime
  6991. objs.e = this.workForm.domains[p].endTime
  6992. alp.push(objs)
  6993. }
  6994. }
  6995. this.dateAr = alp
  6996. if(this.dateAr.length > 0) {
  6997. let trus = this.fns()
  6998. if(!trus) {
  6999. this.$message({
  7000. message: this.$t('message.Filledtimeperiodsoverlap'),
  7001. type: "error"
  7002. });
  7003. return
  7004. }
  7005. }
  7006. } else {
  7007. for(var p in this.workForm.domains) {
  7008. var slll = this.workForm.domains[p]
  7009. for(var o in slll.worktimeList) {
  7010. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7011. let objs = {}
  7012. objs.s = slll.worktimeList[o].startTime
  7013. objs.e = slll.worktimeList[o].endTime
  7014. alp.push(objs)
  7015. }
  7016. }
  7017. }
  7018. this.dateAr = alp
  7019. if(this.dateAr.length > 0) {
  7020. let trus = this.fns()
  7021. if(!trus) {
  7022. this.$message({
  7023. message: this.$t('message.Filledtimeperiodsoverlap'),
  7024. type: "error"
  7025. });
  7026. return
  7027. }
  7028. }
  7029. }
  7030. }
  7031. //检查子项目
  7032. if (this.user.timeType.subProMustFill == 1) {
  7033. for(var p in this.workForm.domains) {
  7034. var oneProItem = this.workForm.domains[p]
  7035. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7036. //没有选择子项目
  7037. this.$message({
  7038. message: '子项目必填,请检查',
  7039. type: "error"
  7040. });
  7041. return
  7042. }
  7043. }
  7044. }
  7045. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7046. if (this.user.companyId == this.yuzhongCompId) {
  7047. for(var p in this.workForm.domains) {
  7048. var oneProItem = this.workForm.domains[p]
  7049. if (!oneProItem.extraField1) {
  7050. this.$message({
  7051. message: '角色必填,请检查',
  7052. type: "error"
  7053. });
  7054. return
  7055. }
  7056. if (!oneProItem.extraField2) {
  7057. this.$message({
  7058. message: '工作职责必填,请检查',
  7059. type: "error"
  7060. });
  7061. return
  7062. }
  7063. if (!oneProItem.extraField3) {
  7064. this.$message({
  7065. message: '工作内容必填,请检查',
  7066. type: "error"
  7067. });
  7068. return
  7069. }
  7070. }
  7071. }
  7072. // return
  7073. //代填的情况,检查人员是否已经选择
  7074. if (this.isSubstitude) {
  7075. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7076. this.$message({
  7077. message: this.$t('message.pleaseselectthepersontofillin'),
  7078. type: "error"
  7079. });
  7080. return;
  7081. }
  7082. }
  7083. //检查时间,全天和上下午不能同时存在
  7084. if (this.reportTimeType.type == 0) {
  7085. var alldayNum = 0;
  7086. var amNum = 0;
  7087. var pmNum = 0;
  7088. for(var i in this.workForm.domains) {
  7089. if (this.workForm.domains[i].timeType == 0) {
  7090. alldayNum ++;
  7091. } else if (this.workForm.domains[i].timeType == 1) {
  7092. amNum++;
  7093. } else if (this.workForm.domains[i].timeType == 2) {
  7094. pmNum++;
  7095. }
  7096. }
  7097. if (alldayNum > 1) {
  7098. this.$message({
  7099. // message: "工作时间-全天,只能选择一次",
  7100. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7101. type: "error"
  7102. });
  7103. return;
  7104. }
  7105. if (amNum > 1) {
  7106. this.$message({
  7107. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7108. type: "error"
  7109. });
  7110. return;
  7111. }
  7112. if (pmNum > 1) {
  7113. this.$message({
  7114. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7115. type: "error"
  7116. });
  7117. return;
  7118. }
  7119. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7120. this.$message({
  7121. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7122. type: "error"
  7123. });
  7124. return;
  7125. }
  7126. } else if (this.reportTimeType.type == 3) {
  7127. //总百分比不能超过100%
  7128. let total = 0;
  7129. this.workForm.domains.forEach(w=>{total += w.progress});
  7130. if (total > 100) {
  7131. this.$message({
  7132. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7133. type: "error"
  7134. });
  7135. return;
  7136. } else if (total < 100) {
  7137. this.$message({
  7138. message: this.$t('message.cannotbesubmitted'),
  7139. type: "error"
  7140. });
  7141. return;
  7142. }
  7143. }
  7144. this.listLoading = true;
  7145. let formData = new FormData();
  7146. formData.append("draft", this.isDraft);
  7147. var totalTime = 0;
  7148. for (var t=0;t<this.workForm.domains.length; t++) {
  7149. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7150. }
  7151. //批量填报不校验考勤时长,交给后台校验
  7152. if (!this.isBatch) {
  7153. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7154. if (this.workForm.time){
  7155. if (this.workForm.time.workHours == 0){
  7156. this.$message({
  7157. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7158. type: 'error'
  7159. })
  7160. return
  7161. }
  7162. }else{
  7163. this.$message({
  7164. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7165. type: 'error'
  7166. })
  7167. return
  7168. }
  7169. }
  7170. }
  7171. if (this.reportTimeType.type == 1 && this.workForm.time) {
  7172. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  7173. this.$message({
  7174. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  7175. type: "error"
  7176. });
  7177. return;
  7178. }
  7179. }
  7180. for(var i in this.workForm.domains) {
  7181. // 检查任务/里程碑是否为必填
  7182. let taskRequired = this.user.timeType.taskRequired
  7183. if(taskRequired == 1) {
  7184. if(!this.workForm.domains[i].taskId) {
  7185. this.$message({
  7186. message: `【${this.workForm.domains[i].projectName}】请选择 任务/里程碑`,
  7187. type: "error"
  7188. });
  7189. return
  7190. }
  7191. }
  7192. if(this.user.timeType.reportAuditType == 3){
  7193. let audItem = {}
  7194. let auditRule = ''
  7195. if(this.workForm.domains[i].id){
  7196. audItem.reportId = this.workForm.domains[i].id
  7197. }
  7198. if(this.user.timeType.auditLevel > 0){
  7199. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  7200. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  7201. }
  7202. if(this.user.timeType.auditLevel > 1){
  7203. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  7204. audItem.auditorSec = this.workForm.domains[i].auditorSec
  7205. }
  7206. if(this.user.timeType.auditLevel > 2){
  7207. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  7208. audItem.auditorThird = this.workForm.domains[i].auditorThird
  7209. }
  7210. if(this.workForm.domains[i].ccUserid){
  7211. audItem.ccUserid = this.workForm.domains[i].ccUserid
  7212. }
  7213. if(auditRule){
  7214. auditRule = auditRule.substring(0,auditRule.length - 1)
  7215. this.$message({
  7216. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  7217. type: 'error'
  7218. })
  7219. return
  7220. }
  7221. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7222. }
  7223. if (this.user.timeType.customDegreeActive) {
  7224. if (this.user.timeType.customDegreeMultiple) {
  7225. //多选
  7226. if (this.workForm.domains[i].multiDegrIdArray) {
  7227. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  7228. degreeArray = degreeArray.replace(/,/g,"@");
  7229. formData.append("multiDegrId", degreeArray);
  7230. } else {
  7231. formData.append("multiDegrId", '[]');
  7232. }
  7233. } else {
  7234. //单选
  7235. if (this.workForm.domains[i].degreeId) {
  7236. formData.append("degreeId", this.workForm.domains[i].degreeId);
  7237. } else {
  7238. formData.append("degreeId", -1);
  7239. }
  7240. }
  7241. } else {
  7242. formData.append("degreeId", -1);
  7243. }
  7244. if(this.workForm.domains[i].customData) {
  7245. // var sss = this.workForm.domains[i].degreeId.toString()
  7246. formData.append("customData", this.workForm.domains[i].customData);
  7247. } else {
  7248. formData.append("customData", 0);
  7249. }
  7250. if(this.workForm.domains[i].customText) {
  7251. formData.append("customText", this.workForm.domains[i].customText);
  7252. } else {
  7253. formData.append("customText", '-');
  7254. }
  7255. if (this.workForm.domains[i].id) {
  7256. formData.append("id", this.workForm.domains[i].id);
  7257. } else {
  7258. formData.append("id", -1);
  7259. }
  7260. formData.append("projectId", this.workForm.domains[i].projectId);
  7261. if (this.workForm.domains[i].subProjectId) {
  7262. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  7263. } else {
  7264. formData.append("subProjectId", 0);
  7265. }
  7266. if (this.workForm.domains[i].groupId) {
  7267. formData.append("groupId", this.workForm.domains[i].groupId);
  7268. } else {
  7269. formData.append("groupId", 0);
  7270. }
  7271. if (this.workForm.domains[i].taskId) {
  7272. formData.append("taskId", this.workForm.domains[i].taskId);
  7273. } else {
  7274. formData.append("taskId", 0);
  7275. }
  7276. if (this.workForm.domains[i].taskFinish == true) {
  7277. formData.append("taskFinish", 1);
  7278. } else {
  7279. formData.append("taskFinish", 0);
  7280. }
  7281. formData.append("reportTimeType", this.reportTimeType.type);
  7282. if (this.reportTimeType.type == 0) {
  7283. formData.append("timeType", this.workForm.domains[i].timeType);
  7284. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  7285. formData.append("workingTime", workingTime);
  7286. } else if (this.reportTimeType.type == 1){
  7287. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7288. } else if (this.reportTimeType.type == 2) {
  7289. formData.append("endTime", this.workForm.domains[i].endTime);
  7290. formData.append("startTime", this.workForm.domains[i].startTime);
  7291. } else if (this.reportTimeType.type == 3) {
  7292. //按比例分配
  7293. formData.append("progress", this.workForm.domains[i].progress);
  7294. formData.append("workingTime", this.workForm.domains[i].workingTime);
  7295. }
  7296. if(this.user.timeType.choseFromAlbum == 1 ) {
  7297. console.log(this.workForm.domains[i].imgList)
  7298. if(this.workForm.domains[i].imgList) {
  7299. let imgListFor = this.workForm.domains[i].imgList
  7300. for(var b in imgListFor) {
  7301. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  7302. }
  7303. console.log(imgListFor)
  7304. let m = JSON.stringify(imgListFor);
  7305. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7306. formData.append("picStr", m);
  7307. } else {
  7308. formData.append("picStr", '[]');
  7309. }
  7310. }
  7311. //处理多个时间事项
  7312. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  7313. if (this.reportTimeType.multiWorktime == 1) {
  7314. //检查时间是否有重叠
  7315. var workList = this.workForm.domains[i].worktimeList;
  7316. for (var j=0;j<workList.length; j++) {
  7317. var curItem = workList[j];
  7318. //检查开始时间是否大于结束时间
  7319. if (curItem.startTime >= curItem.endTime) {
  7320. this.$message({
  7321. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  7322. this.$t('message.Endtimemustbegreaterthanstarttime'),
  7323. type: "error"
  7324. });
  7325. return;
  7326. }
  7327. //时间不可重叠
  7328. if (this.reportTimeType.timeCanOverlap == 0) {
  7329. for (var p = j+1;p<workList.length; p++) {
  7330. var jItem = workList[p];
  7331. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  7332. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  7333. this.$message({
  7334. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  7335. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  7336. type: "error"
  7337. });
  7338. return;
  7339. }
  7340. }
  7341. }
  7342. }
  7343. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  7344. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7345. formData.append("content", m);
  7346. } else {
  7347. if (this.workForm.domains[i].content) {
  7348. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  7349. m = m.replace(/,/g,",");
  7350. console.log(m, '需要传值的数据')
  7351. // formData.append("content", this.workForm.domains[i].content);
  7352. formData.append("content", m);
  7353. } else {
  7354. formData.append("content", '-');
  7355. }
  7356. }
  7357. if (this.isBatch == 0) {
  7358. formData.append("createDate", this.workForm.createDate);
  7359. } else {
  7360. //批量填报,时间范围
  7361. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  7362. }
  7363. if(this.workForm.domains[i].isOvertime) {
  7364. formData.append("isOvertime", 1);
  7365. } else {
  7366. formData.append("isOvertime", 0);
  7367. }
  7368. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  7369. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  7370. } else {
  7371. formData.append("overtimeHours", 0);
  7372. }
  7373. if(this.workForm.domains[i].basecostId) {
  7374. formData.append("basecostId", this.workForm.domains[i].basecostId);
  7375. } else {
  7376. formData.append("basecostId", 0);
  7377. }
  7378. if (this.workForm.userId != null) {
  7379. var targetUids = '';
  7380. this.workForm.userId.forEach(u=>{
  7381. targetUids += u + '@';
  7382. });
  7383. if (targetUids.length > 0) {
  7384. targetUids = targetUids.substring(0, targetUids.length -1);
  7385. formData.append("targetUids", targetUids);
  7386. }
  7387. }
  7388. //项目专业进度
  7389. if (this.workForm.domains[i].professionProgress) {
  7390. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  7391. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  7392. formData.append("professionProgress", m);
  7393. } else {
  7394. formData.append("professionProgress", "[]");
  7395. }
  7396. if (this.workForm.domains[i].stage) {
  7397. formData.append("stage", this.workForm.domains[i].stage);
  7398. } else {
  7399. formData.append("stage", "-");
  7400. }
  7401. // console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  7402. if (this.workForm.domains[i].projectAuditorId) {
  7403. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  7404. } else {
  7405. // console.log('执行到了这里')
  7406. // console.log(this.user.timeType.reportAuditType)
  7407. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  7408. this.$message({
  7409. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  7410. type: "error"
  7411. });
  7412. return;
  7413. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2){
  7414. //分组负责人先审核, 确定是选择了任务分组
  7415. if (this.workForm.domains[i].taskGroups.length == 0) {
  7416. this.$message({
  7417. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  7418. type: "error"
  7419. });
  7420. } else if (!this.workForm.domains[i].groupId) {
  7421. // console.log(this.workForm.domains[i]);
  7422. this.$message({
  7423. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  7424. type: "error"
  7425. });
  7426. } else {
  7427. this.$message({
  7428. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  7429. type: "error"
  7430. });
  7431. }
  7432. return;
  7433. }
  7434. }
  7435. if (this.user.companyId == this.yuzhongCompId) {
  7436. formData.append('extraField1', this.workForm.domains[i].extraField1);
  7437. formData.append('extraField2', this.workForm.domains[i].extraField2);
  7438. formData.append('extraField3', this.workForm.domains[i].extraField3);
  7439. }
  7440. //依斯贝的服务Id
  7441. if (this.user.companyId == this.yisibeiCompId) {
  7442. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  7443. }
  7444. }
  7445. this.submitingReport = true;
  7446. this.http.uploadFile( this.port.report.editPort, formData,
  7447. res => {
  7448. this.listLoading = false;
  7449. this.submitingReport = false;
  7450. if (res.code == "ok") {
  7451. if(res.msg!=null){
  7452. this.$message({
  7453. dangerouslyUseHTMLString: true,
  7454. message: res.msg,
  7455. type: "warning",
  7456. showClose: true,
  7457. duration: 0
  7458. });
  7459. }else{
  7460. this.$message({
  7461. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  7462. type: "success"
  7463. });
  7464. }
  7465. this.dialogVisible = false;
  7466. this.jsDay = 0
  7467. this.jsTime = 0
  7468. this.getReportList();
  7469. this.getDepartment();
  7470. this.getRecentlyProject()
  7471. } else {
  7472. this.$message({
  7473. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  7474. type: "error"
  7475. });
  7476. }
  7477. },
  7478. error => {
  7479. this.listLoading = false;
  7480. this.submitingReport = false;
  7481. this.$message({
  7482. message: error,
  7483. type: "error"
  7484. });
  7485. });
  7486. },
  7487. // 判断是展示那个工时导入
  7488. imports() {
  7489. if(this.user.timeType.syncCorpwxTime == 0) {
  7490. this.importDialog = true
  7491. } else {
  7492. this.importWxDialog = true
  7493. }
  7494. },
  7495. // 跳转
  7496. junpToDeskTop(id) {
  7497. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7498. this.$router.push("/desktop/" + id + "/" + this.date +day);
  7499. },
  7500. // 通过日报
  7501. approve(id, item) {
  7502. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7503. this.approveinData = {
  7504. id: id,
  7505. date: this.date +day,
  7506. reportIds: item.id
  7507. }
  7508. if(this.user.timeType.needEvaluate == 1){
  7509. this.$set(this.approveinData,'evaluate','')
  7510. this.approveinDialog = true
  7511. }else{
  7512. this.logining = true;
  7513. this.approveinfun()
  7514. }
  7515. },
  7516. approveinfun(){
  7517. this.http.post( this.port.report.approve, this.approveinData,
  7518. res => {
  7519. this.logining = false;
  7520. if (res.code == "ok") {
  7521. this.approveinDialog = false
  7522. this.$message({
  7523. message: this.$t('message.Reviewsucceeded'),
  7524. type: "success"
  7525. });
  7526. this.refreshReportData(this.approveinData.reportIds);
  7527. this.getDepartment();
  7528. } else {
  7529. this.$message({
  7530. message: res.msg,
  7531. type: "error"
  7532. });
  7533. }
  7534. },
  7535. error => {
  7536. this.logining = false;
  7537. this.$message({
  7538. message: error,
  7539. type: "error"
  7540. });
  7541. });
  7542. },
  7543. //撤回日报
  7544. cancel(item,e) {
  7545. // console.log('can can need',item);
  7546. this.logining = true;
  7547. var ids = '';
  7548. var data = e ? item : item.data;
  7549. data.forEach(element => {
  7550. if(element.id){
  7551. ids +=(element.id+',');
  7552. }
  7553. });
  7554. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  7555. res => {
  7556. this.logining = false;
  7557. if (res.code == "ok") {
  7558. this.$message({
  7559. message:this.$t('message.Withdrawalsucceeded'),
  7560. type: "success"
  7561. });
  7562. this.getReportList();
  7563. if(e){this.getReport()}
  7564. this.getDepartment();
  7565. } else {
  7566. this.$message({
  7567. message: res.msg,
  7568. type: "error"
  7569. });
  7570. }
  7571. },
  7572. error => {
  7573. this.logining = false;
  7574. this.$message({
  7575. message: error,
  7576. type: "error"
  7577. });
  7578. });
  7579. },
  7580. showDenyDialog(id,i, item) {
  7581. this.denyReasonDialog = true;
  7582. this.isDenying = false;
  7583. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  7584. var ids = item.id;
  7585. // var data = item.data;
  7586. // data.forEach(element => {
  7587. // ids +=(element.id+',');
  7588. // });
  7589. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  7590. },
  7591. // 未通过日报
  7592. deny() {
  7593. this.logining = true;
  7594. this.isDenying = true;
  7595. this.http.post( this.port.report.deny, this.denyForm,
  7596. res => {
  7597. this.logining = false;
  7598. this.isDenying = false;
  7599. if (res.code == "ok") {
  7600. this.$message({
  7601. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  7602. type: "success"
  7603. });
  7604. this.refreshReportData(this.denyForm.reportIds);
  7605. this.getDepartment();
  7606. this.denyReasonDialog = false;
  7607. } else {
  7608. this.$message({
  7609. message: res.msg,
  7610. type: "error"
  7611. });
  7612. }
  7613. },
  7614. error => {
  7615. this.logining = false;
  7616. this.$message({
  7617. message: error,
  7618. type: "error"
  7619. });
  7620. });
  7621. },
  7622. // 查看工时记录弹窗
  7623. toView() {
  7624. this.toViewDialogVisible = true
  7625. this.toViewloading = true
  7626. this.getToView()
  7627. },
  7628. getToView() {
  7629. this.http.post( '/report-import-log/getList', this.toViewForm,
  7630. res => {
  7631. this.toViewloading = false;
  7632. if (res.code == "ok") {
  7633. // console.log(res.data, '数据数据')
  7634. this.toViewList = res.data.records
  7635. this.toViewForm.total = res.data.total
  7636. } else {
  7637. this.toViewloading = false;
  7638. this.$message({
  7639. message: res.msg,
  7640. type: "error"
  7641. });
  7642. }
  7643. })
  7644. },
  7645. // 触发 selectCat 组件更改他的值
  7646. selectCatCli(obj) {
  7647. // console.log(obj, '看看')
  7648. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  7649. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  7650. },
  7651. vueCasader(obj) {
  7652. console.log(obj, '看看值')
  7653. if(obj.distinction == 1 && obj.item) {
  7654. let arr = []
  7655. arr.push(obj.item.value)
  7656. this.exportParam.departmentId = arr
  7657. }
  7658. },
  7659. //分页
  7660. handleCurrentChange(val) {
  7661. this.toViewForm.pageIndex = val;
  7662. this.getToView();
  7663. },
  7664. handleSizeChange(val) {
  7665. this.toViewForm.pageSize = val;
  7666. this.getToView();
  7667. },
  7668. getAllUsersList(){
  7669. this.http.post('/user/getSimpleActiveUserList',{
  7670. },res => {
  7671. if(res.code == 'ok'){
  7672. this.allUsersList = res.data
  7673. }else{
  7674. this.$message({
  7675. message: res.msg,
  7676. type: 'error'
  7677. })
  7678. }
  7679. },err => {
  7680. this.$message({
  7681. message: err,
  7682. type: 'error'
  7683. })
  7684. })
  7685. },
  7686. // 重庆物奇私人定制的按周填报弹窗关闭事件
  7687. fillWeekCustomClne() {
  7688. this.fillWeekDialogVisiCustom = false
  7689. },
  7690. fillWeekCustomSubmit() {
  7691. this.getReportList();
  7692. this.getDepartment();
  7693. this.getRecentlyProject()
  7694. },
  7695. // 待填日报姓名搜索
  7696. nameAearchSeek(flg) {
  7697. if(!this.nameAearch) {
  7698. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7699. return
  7700. }
  7701. if(flg) {
  7702. this.enterpriseWechatgetUser()
  7703. }
  7704. },
  7705. handleThreeData(userList) {
  7706. console.log(userList, '人员数据')
  7707. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  7708. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  7709. },
  7710. // 过滤树节点
  7711. filterTreeNodes(treeData, filterKeywords) {
  7712. return treeData.filter((node) => {
  7713. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  7714. if (node.children && node.children.length > 0) {
  7715. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7716. }
  7717. return true;
  7718. }
  7719. if (node.children && node.children.length > 0) {
  7720. node.children = this.filterTreeNodes(node.children, filterKeywords);
  7721. return node.children.length > 0;
  7722. }
  7723. return false;
  7724. });
  7725. },
  7726. // 企业微信获取人员
  7727. enterpriseWechatgetUser() {
  7728. this.deptMembDataLoading = true
  7729. this.http.post('/user/getEmployeeList',{
  7730. departmentId: -1,
  7731. pageIndex: 1,
  7732. pageSize: 100,
  7733. keyword: this.nameAearch,
  7734. status: '',
  7735. roleId: '',
  7736. cursor: '',
  7737. onlyDirect: '',
  7738. matchingType: ''
  7739. },res => {
  7740. if(res.code == 'ok'){
  7741. this.deptMembDataLoading = false
  7742. const userListName = res.data.records.map(item => item.name)
  7743. this.handleThreeData(userListName)
  7744. }else{
  7745. this.deptMembDataLoading = false
  7746. this.$message({
  7747. message: res.msg,
  7748. type: 'error'
  7749. })
  7750. }
  7751. },err => {
  7752. this.deptMembDataLoading = false
  7753. this.$message({
  7754. message: err,
  7755. type: 'error'
  7756. })
  7757. })
  7758. },
  7759. // 按周填报获取相关任务
  7760. async getWeeklyTaskList(item) {
  7761. console.log(item, '<=== 数据')
  7762. const { projectId, groupId, stage, taskId } = item
  7763. console.log(projectId, groupId, stage)
  7764. let parms = { projectId, isSubstitude: 0 }
  7765. groupId ? parms.groupId = groupId : ''
  7766. stage ? parms.stage = stage : ''
  7767. const { data } = await this.postData('/task/getRecentTask', parms)
  7768. this.zhoBao.taskId = taskId
  7769. this.$set(this.zhoBao, 'taskList', data)
  7770. console.log(this.zhoBao)
  7771. },
  7772. // 封装 post 请求
  7773. postData(url, params) {
  7774. return new Promise((resolve, reject) => {
  7775. this.http.post(url, { ...params },
  7776. res => {
  7777. resolve(res)
  7778. },
  7779. error => {
  7780. this.$message({
  7781. message: error,
  7782. type: "error"
  7783. });
  7784. reject(error)
  7785. })
  7786. })
  7787. },
  7788. // 自定义事件
  7789. selectCal(obj) {
  7790. console.log(obj, '传数据来源')
  7791. if(obj.distinction == '1') {
  7792. this.zhoBao.projectAuditorId = obj.id
  7793. } else if(obj.distinction == '2') {
  7794. this.zhoBao.auditorFirst = obj.id
  7795. } else if(obj.distinction == '3') {
  7796. this.zhoBao.auditorSec = obj.id
  7797. } else if(obj.distinction == '4') {
  7798. this.zhoBao.auditorThird = obj.id
  7799. } else if(obj.distinction == '5') {
  7800. this.zhoBao.ccUserid = obj.id
  7801. } else if(obj.distinction == '12') {
  7802. this.usersListId = obj.id
  7803. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7804. this.searchKeyword = obj.name
  7805. } else {
  7806. this.searchKeyword = ''
  7807. }
  7808. this.searchScreen(0)
  7809. } else if(obj.distinction == '13') {
  7810. this.usersListId = obj.id
  7811. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  7812. this.searchKeyword = obj.name
  7813. } else {
  7814. this.searchKeyword = ''
  7815. }
  7816. this.searchScreen(1)
  7817. }
  7818. }
  7819. },
  7820. created() {
  7821. this.getUsers()
  7822. let height = window.innerHeight;
  7823. this.tableHeight = height - 178;
  7824. const that = this;
  7825. window.onresize = function temp() {
  7826. that.tableHeight = window.innerHeight - 178;
  7827. };
  7828. this.toViewForm.companyId = this.user.companyId
  7829. this.initDrag([{
  7830. type: "LR",
  7831. domClass: {
  7832. // 中间分割线的名字
  7833. resize: "line-line",
  7834. // 左侧盒子的名字
  7835. left: "box-left",
  7836. // 右侧盒子的名字
  7837. right: "box-right",
  7838. // 父级的名字
  7839. box: "box-father",
  7840. },
  7841. otherInfo: {
  7842. // 限制左边栏最低宽度
  7843. leftWidth: 120,
  7844. },
  7845. },
  7846. {
  7847. type: "LR",
  7848. domClass: {
  7849. // 中间分割线的名字
  7850. resize: "line-second",
  7851. // 左侧盒子的名字
  7852. left: "left-laowang",
  7853. // 右侧盒子的名字
  7854. right: "box-second-father",
  7855. // 父级的名字
  7856. box: "grand",
  7857. },
  7858. otherInfo: {
  7859. // 限制左边栏最低宽度
  7860. leftWidth: 120,
  7861. },
  7862. },
  7863. ]);
  7864. }
  7865. };
  7866. </script>
  7867. <style lang="scss" scoped>
  7868. .fillWeekDialogVisiCustom {
  7869. width: 100%;
  7870. height: 70vh;
  7871. }
  7872. .fillWeekCustom {
  7873. .el-dialog__body {
  7874. padding: 20px 20px !important;
  7875. }
  7876. }
  7877. .photos {
  7878. position: relative;
  7879. display: flex;
  7880. flex-wrap: wrap;
  7881. }
  7882. .photos_img {
  7883. width: 120px;
  7884. height: 120px;
  7885. margin-right: 20px;
  7886. margin-bottom: 20px;
  7887. cursor: pointer;
  7888. img {
  7889. width: 100%;
  7890. height: 100%;
  7891. }
  7892. }
  7893. .paginatis {
  7894. padding: 10px 10px;
  7895. background: #f2f2f2;
  7896. }
  7897. .waiting {
  7898. color:orange;
  7899. }
  7900. .filledReportStyle {
  7901. color:#32CD32;
  7902. }
  7903. .RejectStyle {
  7904. color:red;
  7905. }
  7906. .waitSubmitStyle{
  7907. color: #409eff;
  7908. }
  7909. .chooseDate {
  7910. .waiting {
  7911. color: #20a0ff;
  7912. }
  7913. .filledReportStyle {
  7914. color:#20a0ff;
  7915. }
  7916. .RejectStyle {
  7917. color: #20a0ff;
  7918. }
  7919. .waitSubmitStyle{
  7920. color: #20a0ff;
  7921. }
  7922. }
  7923. .allDaily {
  7924. width:100%;
  7925. }
  7926. .report_title {
  7927. padding:10px 0;
  7928. color:#666;
  7929. }
  7930. .clearfix {
  7931. overflow-x: auto;
  7932. white-space: nowrap;
  7933. padding: 15px 0 10px 0;
  7934. // overflow-y: hidden;
  7935. .date_item {
  7936. padding: 0 3px;
  7937. cursor: pointer;
  7938. position: relative;
  7939. }
  7940. .chooseDate {
  7941. position: absolute;
  7942. bottom: -3px;
  7943. width: 37px;
  7944. height: 2px;
  7945. left: 14px;
  7946. background: #20a0ff;
  7947. }
  7948. }
  7949. .one_daily {
  7950. i {
  7951. color: #9ed0ff;
  7952. margin-right: 5px;
  7953. }
  7954. .one_daily_body {
  7955. padding: 10px 0px;
  7956. p {
  7957. margin: 0;
  7958. line-height: 30px;
  7959. }
  7960. }
  7961. ul {
  7962. padding: 0;
  7963. }
  7964. }
  7965. .checkbtn {
  7966. float: right;
  7967. margin-top: -10px;
  7968. }
  7969. .selConStyle{
  7970. margin-top:9rem;
  7971. margin-bottom:11rem;
  7972. .selConStyle_title{
  7973. height: 3rem;
  7974. text-align: center;
  7975. font-size: 17px;
  7976. }
  7977. .el-select{
  7978. margin: 0 15%;
  7979. width: 70%;
  7980. }
  7981. }
  7982. </style>
  7983. <style lang="scss">
  7984. /*去除upload组件过渡效果*/
  7985. .photos .el-upload-list__item {
  7986. transition: none !important;
  7987. }
  7988. .daily {
  7989. .el-card__body {
  7990. height: 80%;
  7991. overflow-y: auto;
  7992. }
  7993. .el-card__header {
  7994. padding: 0 20px;
  7995. }
  7996. }
  7997. .membListClass{
  7998. .el-dialog__body{
  7999. padding-top: 10px;
  8000. }
  8001. }
  8002. // .editReportDialog .el-dialog__footer{
  8003. // position: sticky;
  8004. // bottom: 0;
  8005. // background: #fff;
  8006. // height: 70px;
  8007. // z-index: 1010;
  8008. // }
  8009. .editReportDialog{
  8010. min-width: 800px;
  8011. }
  8012. .touruxiangmu{
  8013. max-width: 1000px;
  8014. }
  8015. </style>
  8016. <style scoped>
  8017. /* 项目标签的样式 */
  8018. .el-tag + .el-tag {
  8019. margin-left: 10px;
  8020. }
  8021. .button-new-tag {
  8022. margin-left: 10px;
  8023. height: 32px;
  8024. line-height: 30px;
  8025. padding-top: 0;
  8026. padding-bottom: 0;
  8027. }
  8028. .input-new-tag {
  8029. width: 90px;
  8030. margin-left: 10px;
  8031. vertical-align: bottom;
  8032. }
  8033. .selectworktime .el-table__fixed-body-wrapper{
  8034. top: 48px !important;
  8035. }
  8036. .selectworktime_export .selectworktime_export_l{
  8037. width: 650px;
  8038. float: left;
  8039. height: 42px;
  8040. }
  8041. .approvalProcessBox{
  8042. margin-left: 30px;
  8043. font-size: 14px;
  8044. line-height: 16px;
  8045. cursor: pointer;
  8046. }
  8047. .approvalProcessBox i {
  8048. margin-right: 0;
  8049. height: 16px;
  8050. width: 16px;
  8051. display: inline-block;
  8052. transform: scale(1.2);
  8053. position: relative;
  8054. top: 0.5px;
  8055. color: #409eff;
  8056. }
  8057. .approvalProcessBox .approvalProcessClick{
  8058. cursor: pointer;
  8059. color: #409eff;
  8060. font-size: 14px;
  8061. }
  8062. .approvalProcessBox:hover .approvalProcessClick{
  8063. color: #3485fb;
  8064. }
  8065. </style>
  8066. <style lang="scss" scoped>
  8067. // 加班样式
  8068. .overtime {
  8069. display: inline-block;
  8070. margin-left: 20px;
  8071. input {
  8072. display: inline-block;
  8073. margin-top: 5px;
  8074. }
  8075. }
  8076. .plus {
  8077. display: inline-block;
  8078. }
  8079. // .tages {
  8080. // float: right;
  8081. // }
  8082. .overtime {
  8083. display: inline-block;
  8084. margin-left: 30px;
  8085. }
  8086. .bloks {
  8087. display: inline-block;
  8088. width: 380px;
  8089. }
  8090. .zhiss {
  8091. display: flex;
  8092. justify-content: space-around;
  8093. align-items: center;
  8094. }
  8095. .zhoFel {
  8096. display: flex;
  8097. justify-content: space-between;
  8098. align-items: center;
  8099. }
  8100. // 左右滑动样式
  8101. .line {
  8102. width: 30px;
  8103. /* height: 500px; */
  8104. background: #f2f2f2;
  8105. cursor: w-resize;
  8106. }
  8107. .box-father {
  8108. border: 8px solid #000;
  8109. }
  8110. .line-second {
  8111. width: 10px;
  8112. /* background: red; */
  8113. }
  8114. .flex {
  8115. display: flex;
  8116. width: 100%;
  8117. }
  8118. .box-left {
  8119. flex: 0 0 400px;
  8120. /* height: 600px; */
  8121. /* background: blue; */
  8122. }
  8123. .box-right {
  8124. /* height: 600px; */
  8125. /* background: green; */
  8126. flex: 1;
  8127. }
  8128. .box-postion {
  8129. width: 200px;
  8130. /* height: 400px; */
  8131. background: #ccc;
  8132. }
  8133. .custom-tree-node {
  8134. flex: 1;
  8135. display: flex;
  8136. align-items: center;
  8137. justify-content: space-between;
  8138. font-size: 14px;
  8139. padding-right: 8px;
  8140. }
  8141. .daitianrbao {
  8142. width: 100%;
  8143. box-sizing: border-box;
  8144. height: 40px;
  8145. border-radius: 4px;
  8146. border: 1px solid #DCDFE6;
  8147. overflow: hidden;
  8148. text-overflow: ellipsis;
  8149. display: flex;
  8150. // align-items: center;
  8151. }
  8152. .daitianrbao .spnn {
  8153. display: inline-block;
  8154. box-sizing: border-box;
  8155. padding: 0 15px;
  8156. overflow: hidden;
  8157. text-overflow: ellipsis;
  8158. }
  8159. .daitianrbao .hover {
  8160. color: #DCDFE6 !important;
  8161. }
  8162. </style>