daily.vue 445 KB

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