daily.vue 498 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436
  1. <template>
  2. <section >
  3. <!--列表-->
  4. <div>
  5. <el-card class="box-card daily" shadow="never">
  6. <div style="position: relative;margin-top: -20px;margin-bottom: 20px">
  7. <div class="jjk" style="display:inline-block;position:absolute;top:15px;background:#fff;left:0px;z-index: 10;margin-top: -10px;padding-top: 10px;height: 42px;">
  8. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  9. style="width:190px;"
  10. @change="changeMonthOut" :clearable="false" type="month" :placeholder="$t('Selectmonth')" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;">
  18. <span v-if="item.missReport" class="RejectStyle">{{item.showDate}}</span>
  19. <span v-else :class="statusStyle[item.state]">{{item.showDate}}</span>
  20. <br>
  21. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  22. <span class="chooseDate" v-if="index == choseDay"></span>
  23. <!--针对景昱-->
  24. <el-tooltip v-if="user.companyId == 5978 && item.exceedCardTime == 1" effect="dark" content="填报时长异常" placement="top-start">
  25. <i class="el-icon-warning" style="color:red;"></i>
  26. </el-tooltip>
  27. <el-tooltip v-if="item.missReport" effect="dark" content="漏填" placement="top-start">
  28. <i class="el-icon-warning" style="color:red;"></i>
  29. </el-tooltip>
  30. </div>
  31. </div>
  32. </span>
  33. </div>
  34. </div>
  35. <div style="display:flex;">
  36. <div class="grand flex">
  37. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  38. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  39. <!-- <div style="width: 100%;box-sizing: border-box;padding-right: 10px;margin-bottom:10px">
  40. </div> -->
  41. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  42. <el-input :placeholder="$t('defaultText.PleaseEnterYourName')" size="small" v-model="seluserText" @keyup.enter.native="seluserforText()" style="width:100%;margin-bottom:10px" clearable>
  43. <el-button slot="append" icon="el-icon-search" @click="seluserforText()"></el-button>
  44. </el-input>
  45. <el-select v-model="selectState" size="small" @change="stateChange" style="width:100%">
  46. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  47. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  48. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  49. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  50. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  51. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  52. </el-select>
  53. </div>
  54. <div>
  55. <el-tree :data="data" @node-click="handleNodeClick" @node-collapse="nodeChangeCollapse" @node-expand="nodeChangeExpand" ref="treeDataRef" :default-expanded-keys="nodeModelData" node-key="id" v-loading="dataLoading">
  56. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  57. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  58. <TranslationOpenData :configurationItems="{ openType: node.data.children ? 'departmentName' : 'userName', openId: node.label, renderIndex: 0 }"/>
  59. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  60. </span>
  61. <div style="position: absolute;right: 15px;">
  62. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  63. <!-- 未填报 -->
  64. {{$t('state.DidNotFillIn')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == null && (data.leaveDays || data.leaveTimes)" :style="(data.leaveDays < 1 || data.leaveTimes < user.timeType.allday) ? 'color:red;font-size:13px' : 'color:#32cd32;font-size:13px'">
  67. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  68. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays.toFixed(1) + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  71. <!-- 待审核 -->
  72. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  75. <!-- 已通过 -->
  76. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  79. <!-- 未通过 -->
  80. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  83. <!-- 待提交 -->
  84. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  85. </span>
  86. </div>
  87. </span>
  88. </el-tree>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="line line-second" style="display:flex;justify-content: center;align-items: center;position: relative;left: -9px;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  93. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  94. -
  95. -
  96. -
  97. </div>
  98. </div>
  99. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  100. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  101. <div class="allDaily" style="float:left;flex-grow:1">
  102. <!--系统管理员和部门负责人 -->
  103. <div class="report_title" style="display:flex;justify-content: space-between;">
  104. <span>
  105. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  106. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  107. <!-- {{depData != null ?depData.label:""}} -->
  108. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  109. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'">
  110. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: depData.label, renderIndex: 0 }" />
  111. </span>
  112. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'">
  113. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: depData.label, renderIndex: 0 }" />
  114. </span>
  115. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  116. <span v-if="targetUid == null">
  117. <!-- - 已提交 -->
  118. -{{$t('state.hasBeenSubmitted')}}
  119. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state != 3).length}}</span></el-link>{{$t('other.people')}},
  120. <!-- 待提交 -->
  121. {{$t('state.waitingsubmit')}}
  122. <el-link :underline="false" @click="showMembList(2)"><span style="margin-left:5px;margin-right:5px;color:green;">{{fillList.filter(item => item.state == 3).length}}</span></el-link>{{$t('other.people')}},
  123. <!-- 漏填 -->
  124. <!-- {{$t('state.missFillReport')}} -->
  125. {{ $t('other.unfilled') }}
  126. <el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(unFillList.length - leaveAllNum) | numbers}}</span>{{$t('other.people')}}
  127. <span v-if="leaveAllNum">{{','+ $t('other.takeDayOff') + leaveAllNum + $t('other.people')}}</span></el-link>
  128. </span>
  129. </span>
  130. </span>
  131. <span style="float:right;">
  132. <el-link type="primary" v-if="user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  133. <el-link v-if="reportTimeType.type != 0 && user.companyId != yuzhongCompId && user.companyId != 469 && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 3092 && user.timeType.enableNewWeeklyfill != 2" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  134. <el-link v-if="user.timeType.enableNewWeeklyfill == 1" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">{{ $t('textLink.fillInAWeek') }}</el-link>
  135. <!-- <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportCustom()">按周填报123</el-link> -->
  136. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;weekIndex++,fillWeekDialogVisiCustomTwo=true" v-if="user.timeType.enableNewWeeklyfill==2">按周填报</el-link>
  137. <el-link type="primary" v-if="user.companyId != 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReportss();">{{$t('textLink.helpToFillIn')}}</el-link>
  140. <el-link type="primary" v-if="permissions.reportBatch && user.timeType.enableNewWeeklyfill != 1 && user.companyId != 469" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  141. <el-link type="primary" v-if="user.companyId != yuzhongCompId && (permissions.importReport || user.manageDeptId != 0)" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  142. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  143. <!--部门负责人给个导出工时的功能 -->
  144. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  145. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime">{{ $t('tuiSongGongShi') }}</el-link>
  146. <el-link type="primary" v-if="user.timeType.pushReportData == 1 && user.companyId==3092 && permissions.reportPush" :underline="false" @click="pushWorkTimeLogDig=true,getPushWorkLogData()">{{ $t('gongShiTuiSongRiZhi') }}</el-link>
  147. <el-link type="primary" v-if="user.roleName == $t('role.superAdministrator') && user.companyId==839" :underline="false" @click="reportLogCheckDialog=true">{{ $t('riBaoShenHeXiuGai') }}</el-link>
  148. <el-link type="primary" v-if="(user.roleName == $t('role.superAdministrator') || user.roleName == $t('role.systemAdministrator')) && user.companyId==936" :underline="false" @click="transferWorkingHoursVisable=true">{{ $t('zhuanYIGongShi') }}</el-link>
  149. <!-- <el-button v-if="user.timeType.pushReportData == 1 && permissions.reportPush" style="margin-left:10px;" icon="iconfont firerock-icontuisong" size="mini" @click="pushWorkTime"></el-button> -->
  150. </span>
  151. </div>
  152. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  153. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  154. <i class="fa fa-circle"></i>
  155. <!-- {{item1.name}} -->
  156. <span v-if="user.userNameNeedTranslate == '1'">
  157. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item1.name, renderIndex: 0 }" />
  158. </span>
  159. <span v-if="user.userNameNeedTranslate != '1'">
  160. {{item1.name}}
  161. </span>
  162. <span style="margin-left:30px;">
  163. <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
  164. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  165. <!-- 工作总时长: -->
  166. {{$t('other.totalWorkingHours')}}:
  167. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  168. <span >{{item1.reportTime | amounts}}</span>h
  169. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'margin-left:10px;color:#ff0000;':'margin-left:10px;'">考勤时长:{{item1.cardTime | amounts}}h</span>
  170. </span>
  171. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  172. <i class="iconfont firerock-iconliucheng1"></i>
  173. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  174. <!-- 审批流程 -->
  175. {{$t('other.approvalProcess')}}
  176. </span>
  177. </span>
  178. </span>
  179. <div class="checkbtn" style="padding-right:20px;">
  180. <!--编辑和删除日报-->
  181. <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>
  182. <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>
  183. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  184. </div>
  185. <div v-if="user.timeType.enableNewWeeklyfill == 1 && item1.summary != null" style="margin-left:20px;">
  186. <p v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  187. </div>
  188. <div class="one_daily_body">
  189. <el-timeline>
  190. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  191. <el-card shadow="never">
  192. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  193. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  194. <span v-if="user.company.packageEngineering == 0">
  195. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  196. <span v-if="user.timeType.reportAuditType == 7" >
  197. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  198. <span v-if="item2.deptAuditorName">、</span>
  199. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  200. </span>
  201. <span v-else>
  202. <span v-if="item2.isDeptAudit==0">
  203. <span v-if="item2.projectAuditState==0">
  204. <!-- 待项目审核人 --> {{user.companyId == 469?"待部门主管":$t('other.waitForTheProjectReviewer')}}
  205. <span v-if="item2.projectAuditorName != null">(
  206. <!-- {{item2.projectAuditorName}} -->
  207. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  208. )</span>
  209. <!-- 审核 --> {{$t('other.audit')}}
  210. </span>
  211. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  212. <!-- 项目审核人 --> {{user.companyId == 469?"部门主管":$t('other.projectAuditor')}}
  213. <span v-if="item2.projectAuditorName != null">(
  214. <!-- {{item2.projectAuditorName}} -->
  215. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  216. )</span>
  217. <!-- 审核通过 --> {{$t('state.approved')}}
  218. </span>
  219. </span>
  220. <span v-else-if="item2.isDeptAudit==1">
  221. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  222. ({{$t('other.await')}}
  223. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  224. {{$t('other.audit')}})
  225. </span>
  226. </span>
  227. ]</span>
  228. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  229. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  230. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  231. </span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  233. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  234. </span>
  235. <!-- <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> -->
  236. <span v-if="user.company.packageEngineering == 1">
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  240. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  241. (
  242. <!-- <span v-if="user.userNameNeedTranslate != 1">
  243. {{item2.projectAuditorName}}
  244. </span>
  245. <span v-if="user.userNameNeedTranslate == 1">
  246. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  247. </span> -->
  248. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  249. )
  250. </span>{{$t('other.audit')}} ]</span>
  251. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  253. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  254. </span>
  255. <!--每个项目上单独审核 -->
  256. <span style="float:right;">
  257. <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>
  258. <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"
  259. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  260. <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"
  261. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  262. <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"
  263. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  264. <!--自己可以撤回待审核状态的报告 -->
  265. <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>
  266. </span>
  267. </p>
  268. <p v-if="user.companyId == yuzhongCompId">
  269. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  271. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  272. <!--任务分组和阶段 -->
  273. <p v-if="item2.groupId != 0">
  274. {{$t('other.taskGroup')}}:{{item2.groupName}}
  275. <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>
  276. </p>
  277. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  278. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  279. <!-- 自定义日报文本 -->
  280. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  281. <p v-if="user.company.packageEngineering == 1">
  282. {{$t('other.professionalProgress')}}:
  283. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  284. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  285. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  286. </el-tooltip>
  287. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  288. <i class="iconfont firerock-iconshenhetongguo"></i>
  289. </el-tooltip>
  290. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  291. <i class="iconfont firerock-iconshenhebohui"></i>
  292. </el-tooltip>
  293. </span>
  294. </p>
  295. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  296. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  297. </p>
  298. <div v-if="item2.multiWorktime==0">
  299. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  300. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  301. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  302. {{item2.time.toFixed(1)}}h
  303. <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>
  304. </p>
  305. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  306. <span style="margin-right:10px;">{{item2.progress}}%</span>
  307. </p>
  308. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  309. </div>
  310. <div v-if="item2.multiWorktime==1" >
  311. <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>
  312. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  313. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  314. <p style="display: inline-block;">{{$t('time.duration')}}:
  315. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  316. {{timeItem.time.toFixed(1)}}h
  317. </p>
  318. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  319. </div>
  320. </div>
  321. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  322. <!--照片的显示 -->
  323. <p v-if="item2.pics != null && item2.pics.length > 0">
  324. <el-image v-for="(pic, index) in item2.pics" :key="index"
  325. style="width: 100px; height: 100px; margin-right:10px;"
  326. :src="pic"
  327. :preview-src-list="item2.pics">
  328. </el-image>
  329. </p>
  330. </el-card>
  331. </el-timeline-item>
  332. </el-timeline>
  333. </div>
  334. </div>
  335. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false style="color:#20a0ff;">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  336. <!-- 简陋的无报告提示 -->
  337. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. </div>
  343. </el-card>
  344. </div>
  345. <!-- 工时推送日志弹窗 -->
  346. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  347. <template>
  348. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  349. </template>
  350. <template>
  351. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  352. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  353. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  354. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  355. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  356. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  357. <template slot-scope="scope">
  358. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  359. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  360. </template>
  361. </el-table-column>
  362. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  363. </el-table>
  364. </template>
  365. <span slot="footer" class="dialog-footer">
  366. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  367. </span>
  368. </el-dialog>
  369. <!-- 填写日报的dialog -->
  370. <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">
  371. <div style="height: 65vh;overflow: auto;">
  372. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  373. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  374. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  375. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  376. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1">
  377. <span class="spnn" v-if="workForm.userNames">
  378. <span v-for="(item, index) in workForm.userNames" :key="index">
  379. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  380. <span v-if="index < workForm.userNames.length - 1">,</span>
  381. </span>
  382. </span>
  383. <span class="spnn hover" v-else>
  384. {{$t('defaultText.pleaseSelectAsubstitute')}}
  385. </span>
  386. </div>
  387. </el-form-item>
  388. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  389. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  390. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  391. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  392. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  393. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  394. <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>
  395. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  396. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  397. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  398. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  399. <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>
  400. <!-- AI智能填报 -->
  401. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  402. </el-form-item>
  403. <!--考勤时长显示-->
  404. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh || user.companyId == 5978">
  405. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
  406. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  407. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  408. </span>
  409. <!--批量填报和批量代填不显示考勤记录-->
  410. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  411. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  412. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  413. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  414. v-if="!isBatch && user.timeType.syncCorpwxTime==1" icon="el-icon-refresh"
  415. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  416. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  417. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  418. @click="refreshAttendance(workForm.createDate)"></el-button>
  419. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  420. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  421. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  422. <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  423. </el-form-item>
  424. <!-- 000000 -->
  425. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  426. <div v-if="reportTimeType.multiWorktime==0">
  427. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  428. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  429. <el-select v-model="domain.timeType" style="width:200px;"
  430. v-if="reportTimeType.type == 0"
  431. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  432. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  433. @change="onTimeTypeChange(domain.timeType)">
  434. <el-option
  435. v-for="item in timeType"
  436. :key="item.value"
  437. :label="item.label"
  438. :value="item.value">
  439. </el-option>
  440. </el-select>
  441. <!-- 数字时长选择 -->
  442. <el-select v-model="domain.workingTime" style="width:200px;"
  443. v-if="reportTimeType.type == 1"
  444. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  445. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  446. @change="seleChn(0,domain)">
  447. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  448. </el-select>
  449. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  450. <span v-if="reportTimeType.type == 2">
  451. <!--时间范围选择 -->
  452. <el-time-picker
  453. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  454. v-model="domain.startTime"
  455. :placeholder="$t('time.startTime')"
  456. style="width:120px;"
  457. format="HH:mm"
  458. value-format="HH:mm"
  459. :picker-options="{
  460. start: '08:00',
  461. end: '23:30'
  462. }"
  463. @change="iptChang()">
  464. </el-time-picker> - <el-time-picker
  465. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  466. v-model="domain.endTime"
  467. :placeholder="$t('time.endTime')"
  468. style="width:120px;"
  469. format="HH:mm"
  470. value-format="HH:mm"
  471. :picker-options="{
  472. start: '08:00',
  473. end: '23:30',
  474. minTime: domain.startTime
  475. }"
  476. @change="iptChang()">
  477. </el-time-picker>
  478. </span>
  479. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  480. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  481. <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>
  482. </div>
  483. </el-form-item>
  484. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  485. :prop="'domains.' + index + '.reportTargetDeptId'"
  486. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  487. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  488. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  489. <span style="float: left">
  490. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  491. </span>
  492. </el-option>
  493. </el-select>
  494. <vueCascader :size="'medium'" :widthStr="'200'" :clearable="true" :other="index" :subjectId="[domain.reportTargetDeptId]" :subject="userReportDeptList" :radios="false" :distinction="'10'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  495. </el-form-item>
  496. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  497. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  498. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  499. @change="selectProject(domain, index)"
  500. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  501. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  502. <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">
  503. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  504. <span style="float: right;">{{ item.projectName }}</span>
  505. </el-option>
  506. </el-option-group>
  507. </el-select>
  508. <!--昱众不显示子项目-->
  509. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  510. <span style="margin-left:45px;">
  511. {{$t('lable.subproject')}}</span>
  512. <!--子项目 -->
  513. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  514. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  515. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  516. </el-select>
  517. </template>
  518. <template v-if="user.companyId == yuzhongCompId">
  519. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  520. <!--角色选择 -->
  521. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  522. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  523. <el-option
  524. v-for="item in roleList"
  525. :key="item.value"
  526. :label="item.label"
  527. :value="item.value">
  528. </el-option>
  529. </el-select>
  530. </template>
  531. <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%;"
  532. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  533. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  534. </el-link>
  535. <!-- <el-link type="primary" v-if="canEdit"
  536. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  537. </el-form-item>
  538. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  539. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  540. </el-form-item>
  541. <!--如果设置了工时成本预警的预算成本项-->
  542. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  543. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  544. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  545. </el-select>
  546. </el-form-item>
  547. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  548. <template slot="label">
  549. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  550. <span >{{$t('lable.taskGrouping')}}</span>
  551. </template>
  552. <!-- 任务分组 -->
  553. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  554. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  555. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  556. </el-select>
  557. <template v-if="user.companyId == yuzhongCompId">
  558. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  559. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  560. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  561. <el-option
  562. v-for="item in domain.filteredRespList"
  563. :key="item.id"
  564. :label="item.jobRespon"
  565. :value="item.id">
  566. </el-option>
  567. </el-select>
  568. </template>
  569. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  570. <span v-if="domain.stages != null && domain.stages.length> 0" style="margin-left:45px;"><span v-if="user.companyId == 3092" style="color:red;margin-right: 4px">*</span>{{$t('other.inputStage')}}</span>
  571. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  572. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  573. @change="changeStages(domain, index)"
  574. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  575. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  576. </el-select>
  577. </template>
  578. </el-form-item>
  579. <div v-if="user.timeType.reportAuditType != 1 && user.timeType.reportAuditType != 2 && user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && user.timeType.reportAuditType != 9 && user.timeType.reportAuditType != 10 && domain.auditUserList">
  580. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  581. <template slot="label">
  582. <span style="color:#FF0000;">*</span>
  583. <span >{{$t('other.projectAuditor')}}</span>
  584. </template>
  585. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  586. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  587. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  588. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  589. </el-option>
  590. </el-select>
  591. <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>
  592. </el-form-item>
  593. </div>
  594. <el-form-item v-if="user.companyId == yuzhongCompId">
  595. <template slot="label">
  596. <span style="color:#FF0000;">*</span>
  597. <span >{{ $t('gongZuoNeiRong') }}</span>
  598. </template>
  599. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  600. :disabled="(workForm.domains[index].state>=2?false:true)" >
  601. <el-option
  602. v-for="item in domain.workContentList"
  603. :key="item.id"
  604. :label="item.workContext"
  605. :value="item.id">
  606. </el-option>
  607. </el-select>
  608. </el-form-item>
  609. <!-- 111111 -->
  610. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  611. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  612. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  613. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  614. <span v-else>{{item.name}}</span>
  615. </el-option>
  616. </el-select>
  617. <template v-if="user.timeType.auditLevel > 1">
  618. <i class="el-icon-right"></i>
  619. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  620. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  621. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  622. <span v-else>{{item.name}}</span>
  623. </el-option>
  624. </el-select>
  625. </template>
  626. <template v-if="user.timeType.auditLevel > 2">
  627. <i class="el-icon-right"></i>
  628. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  629. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  630. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  631. <span v-else>{{item.name}}</span>
  632. </el-option>
  633. </el-select>
  634. </template>
  635. </el-form-item>
  636. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  637. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  638. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  639. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  640. <span v-else>{{item.name}}</span>
  641. </el-option>
  642. </el-select>
  643. </el-form-item>
  644. <!-- 相关维度/自定义维度 -->
  645. <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'">
  646. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  647. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  648. </el-option>
  649. </el-select>
  650. </el-form-item>
  651. <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'">
  652. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  653. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  654. </el-option>
  655. </el-select>
  656. </el-form-item>
  657. <!-- 相关数值 -->
  658. <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">
  659. <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>
  660. </el-form-item>
  661. <!-- 自定义文本 -->
  662. <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">
  663. <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>
  664. </el-form-item>
  665. <!--按比例填报-->
  666. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  667. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  668. <div style="width:400px;">
  669. <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>
  670. <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>
  671. </div>
  672. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  673. <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>
  674. </div>
  675. </el-form-item>
  676. <!--工程专业版本模式下, 各个专业的进度填报 -->
  677. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  678. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  679. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  680. <el-input size="mini" style="width:60px;" v-model="item.progress"
  681. @keyup.native="onProgressChange"
  682. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  683. </span>
  684. </el-form-item>
  685. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  686. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1&& !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic!=1))" >
  687. <template slot="label" v-if="user.timeType.taskRequired == 1">
  688. <span style="color:#FF0000;">*</span>
  689. <span >{{ $t('other.task') }}</span>
  690. </template>
  691. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  692. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  693. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  694. </el-select>
  695. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  696. </el-form-item>
  697. <!--针对依斯贝的SAP服务-->
  698. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  699. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  700. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  701. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  702. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  703. </el-select>
  704. </el-form-item>
  705. <!--工作事项-->
  706. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  707. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  708. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  709. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  710. </el-form-item>
  711. <!-- 拍照上传 -->
  712. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  713. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  714. <div class="photos">
  715. <div>
  716. <el-upload
  717. list-type="picture-card"
  718. :http-request="(file) => {return addImg(file, index)}"
  719. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  720. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  721. :file-list="domain.imgListUrl" :limit="9"
  722. :disabled="workForm.domains[index].state>=2?false:true">
  723. <i class="el-icon-plus"></i>
  724. </el-upload>
  725. </div>
  726. </div>
  727. </el-form-item>
  728. </div>
  729. <!--多个工作事项填报的情况 -->
  730. <div v-if="reportTimeType.multiWorktime==1">
  731. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  732. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  733. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  734. @change="selectProject(domain, index)"
  735. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  736. <!-- <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">
  737. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  738. <span style="float: right;">{{ item.projectName }}</span>
  739. </el-option> -->
  740. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  741. <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">
  742. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  743. <span style="float: right;">{{ item.projectName }}</span>
  744. </el-option>
  745. </el-option-group>
  746. </el-select>
  747. <template v-if="user.timeType.mainProjectState != 1">
  748. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  749. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  750. <!--子项目 -->
  751. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  752. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  753. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  754. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  755. </el-select>
  756. </template>
  757. <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;"
  758. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  759. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  760. </el-link>
  761. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  762. <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>
  763. </div>
  764. <!-- <el-link type="primary" v-if="canEdit"
  765. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  766. </el-form-item>
  767. <el-form-item :label="$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&fillProjectList.filter(p=>p.id == domain.projectId).length>0&&fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  768. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  769. </el-form-item>
  770. <!--如果设置了工时成本预警的预算成本项-->
  771. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  772. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  773. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  774. </el-select>
  775. </el-form-item>
  776. <el-form-item v-if="user.company.packageProject == 1">
  777. <template slot="label">
  778. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  779. <span >{{$t('lable.taskGrouping')}}</span>
  780. </template>
  781. <!-- 任务分组 -->
  782. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  783. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  784. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  785. </el-select>
  786. <!-- 项目的阶段 -->
  787. <span v-if="domain.stages != null && domain.stages.length> 0"
  788. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  789. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  790. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  791. @change="changeStages(domain, index)"
  792. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  793. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  794. </el-select>
  795. </el-form-item>
  796. <el-form-item :label="$t('other.projectAuditor')" >
  797. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  798. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  799. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  800. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  801. </el-option>
  802. </el-select>
  803. <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>
  804. </el-form-item>
  805. <!--工程专业版本模式下, 各个专业的进度填报 -->
  806. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  807. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  808. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  809. <el-input size="mini" style="width:60px;" v-model="item.progress"
  810. @keyup.native="onProgressChange"
  811. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  812. </span>
  813. </el-form-item>
  814. <!-- 相关维度 -->
  815. <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'">
  816. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  817. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  818. </el-option>
  819. </el-select>
  820. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  821. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  822. </el-option>
  823. </el-select>
  824. </el-form-item>
  825. <!-- 相关数值 -->
  826. <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">
  827. <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>
  828. </el-form-item>
  829. <!-- 自定义文本 -->
  830. <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">
  831. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  832. </el-form-item>
  833. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  834. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  835. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  836. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  837. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  838. </el-select>
  839. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  840. </el-form-item>
  841. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  842. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  843. <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>
  844. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  845. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  846. <span v-if="reportTimeType.type == 2">
  847. <!-- <span> -->
  848. <!--时间范围选择 -->
  849. <el-time-picker
  850. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  851. v-model="timeItem.startTime"
  852. :placeholder="$t('time.startTime')"
  853. style="width:120px;"
  854. format="HH:mm"
  855. value-format="HH:mm"
  856. :picker-options="{
  857. start: '00:00',
  858. end: '23:59',
  859. }"
  860. @change="iptChangs()">
  861. </el-time-picker> - <el-time-picker
  862. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  863. v-model="timeItem.endTime"
  864. :placeholder="$t('time.endTime')"
  865. style="width:120px;"
  866. format="HH:mm"
  867. value-format="HH:mm"
  868. :picker-options="{
  869. start: '00:00',
  870. end: '23:59',
  871. minTime: timeItem.startTime
  872. }"
  873. @change="iptChangs()">
  874. </el-time-picker>
  875. </span>
  876. </el-form-item>
  877. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  878. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  879. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  880. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  881. ></el-input>
  882. </el-form-item>
  883. </div>
  884. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  885. </div>
  886. <!--照片的显示 -->
  887. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  888. <el-image v-for="(pic, index) in domain.pics" :key="index"
  889. style="width: 100px; height: 100px; margin-right:10px;"
  890. :src="pic"
  891. :preview-src-list="domain.pics">
  892. </el-image>
  893. </p>
  894. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  895. </div>
  896. <span id="workFormsItemBottom"></span>
  897. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  898. </el-form>
  899. </div>
  900. <span slot="footer" class="dialog-footer">
  901. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  902. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  903. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  904. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  905. <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>
  906. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  907. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  908. </span>
  909. </el-dialog>
  910. <!-- 按周填报 -->
  911. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1200px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()">
  912. <!-- 按周填报-已填工时-点击 -->
  913. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  914. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  915. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  916. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  917. <el-table-column prop="state" :label="$t('state.states')">
  918. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  919. </el-table-column>
  920. </el-table>
  921. <span slot="footer" class="dialog-footer">
  922. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  923. </span>
  924. </el-dialog>
  925. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  926. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  927. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  928. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  929. <span class="spnn" v-if="workForm.userNames">
  930. <span v-for="(item, index) in workForm.userNames" :key="index">
  931. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  932. <span v-if="index < workForm.userNames.length - 1">,</span>
  933. </span>
  934. </span>
  935. <span class="spnn hover" v-else>
  936. {{$t('defaultText.pleaseSelectAsubstitute')}}
  937. </span>
  938. </div>
  939. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  940. </div>
  941. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  942. <el-form-item style="height:30px;margin-top:-72px;">
  943. <!-- <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> -->
  944. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  945. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  946. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  947. <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>
  948. <el-option
  949. v-for="item in fillProjectList"
  950. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  951. :key="item.id"
  952. :label="item.projectName + '\u3000' + item.projectCode"
  953. :value="item.id">
  954. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  955. <span style="float: right">{{ item.projectName }}</span>
  956. </el-option>
  957. </el-select>
  958. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  959. </el-form-item>
  960. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  961. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  962. <template slot-scope="scope">
  963. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  964. </template>
  965. </el-table-column>
  966. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  967. <template slot-scope="scope">
  968. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  969. <p v-else></p>
  970. </template>
  971. </el-table-column> -->
  972. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  973. <template slot-scope="scope">
  974. <div v-if="scope.row.canFill == 1">
  975. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  976. <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>
  977. <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>
  978. <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>
  979. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  980. </div>
  981. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  982. <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>
  983. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  984. </div>
  985. </div>
  986. <div v-else >
  987. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  988. </div>
  989. </template>
  990. </el-table-column>
  991. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  992. <template slot-scope="scope">
  993. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  994. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  995. </span>
  996. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  997. </template>
  998. </el-table-column>
  999. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1000. <template slot-scope="scope">
  1001. <div class="zhiss">
  1002. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1003. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1004. </div>
  1005. </template>
  1006. </el-table-column>
  1007. </el-table>
  1008. </el-form>
  1009. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1010. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1011. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1012. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1013. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1014. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1015. <!--针对景昱,先检查工时是否存在异常-->
  1016. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1017. </span>
  1018. </el-dialog>
  1019. <!-- 重庆物奇私人定制的按周填报 -->
  1020. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1021. <div class="fillWeekDialogVisiCustom">
  1022. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1023. </div>
  1024. </el-dialog>
  1025. <!-- enableNewWeeklyfill==2 -->
  1026. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1027. <div class="fillWeekDialogVisiCustom">
  1028. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1029. </div>
  1030. </el-dialog>
  1031. <!-- 选择时间 -->
  1032. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1033. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1034. <span slot="footer" class="dialog-footer">
  1035. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1036. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1037. </span>
  1038. </el-dialog>
  1039. <!-- 按周填报弹窗 -->
  1040. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1041. <div>
  1042. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1043. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1044. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1045. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1046. </el-select>
  1047. </div>
  1048. <!--如果设置了工时成本预警的预算成本项-->
  1049. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1050. <p>{{$t('lable.budgetSource')}}</p>
  1051. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1052. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1053. </el-select>
  1054. </div>
  1055. <!-- 任务分组 -->
  1056. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1057. <p>{{$t('lable.taskGrouping')}}</p>
  1058. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1059. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1060. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1061. </el-select>
  1062. </div>
  1063. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1064. <p>{{$t('other.inputStage')}}</p>
  1065. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1066. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1067. </el-select>
  1068. </div>
  1069. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1070. <p>{{$t('other.reviewer')}}</p>
  1071. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1072. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1073. </el-select>
  1074. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1075. </div>
  1076. <template v-if="user.timeType.reportAuditType == 3">
  1077. <div class="zhoFel">
  1078. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1079. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1080. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1081. </el-select>
  1082. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1083. </div>
  1084. <div class="zhoFel">
  1085. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1086. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1087. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1088. </el-select>
  1089. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1090. </div>
  1091. <div class="zhoFel">
  1092. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1093. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1094. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1095. </el-select>
  1096. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1097. </div>
  1098. <div class="zhoFel">
  1099. <p>{{ $t('chao-song-ren') }}</p>
  1100. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1101. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1102. </el-select>
  1103. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1104. </div>
  1105. </template>
  1106. <!-- 自定义维度 -->
  1107. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1108. <p>{{user.timeType.customDegreeName}}</p>
  1109. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1110. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1111. </el-select>
  1112. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1113. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1114. </el-select>
  1115. </div>
  1116. <!-- 自定义数值 -->
  1117. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1118. <p>{{user.timeType.customDataName}}</p>
  1119. <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>
  1120. </div>
  1121. <!-- 自定义文本 -->
  1122. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1123. <p>{{user.timeType.customTextName}}</p>
  1124. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1125. </div>
  1126. <!-- 选择任务 -->
  1127. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1128. <p>{{ $t('renWuLiChengBei') }}</p>
  1129. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1130. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1131. </el-select>
  1132. </div>
  1133. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1134. <p>{{$t('other.timeSelection')}}</p>
  1135. <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>
  1136. </div>
  1137. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1138. <p>{{$t('other.chooseDuration')}}</p>
  1139. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1140. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1141. </el-select>
  1142. </div>
  1143. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1144. <p>{{$t('lable.percentageOfTime')}}</p>
  1145. <div style="width:400px;display: flex;align-items: center;">
  1146. <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>
  1147. <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>
  1148. </div>
  1149. </div>
  1150. <div class="zhoFel">
  1151. <p>{{$t('other.workMatters')}}</p>
  1152. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1153. </div>
  1154. </div>
  1155. <span slot="footer" class="dialog-footer">
  1156. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1157. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1158. </span>
  1159. </el-dialog>
  1160. <!--导出报表条件选择 -->
  1161. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1162. <el-form ref="form3" :model="exportParam" >
  1163. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1164. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1165. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1166. </el-select>
  1167. </el-form-item>
  1168. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1169. <!-- <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>
  1170. <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> -->
  1171. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'0'"></vueMultipleDept>
  1172. </el-form-item>
  1173. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1174. <el-date-picker
  1175. v-model="exportParam.dateRange" :editable="false"
  1176. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1177. :range-separator="$t('other.to')"
  1178. type="daterange"
  1179. :start-placeholder="$t('time.startDate')"
  1180. :end-placeholder="$t('time.endDate')"
  1181. ></el-date-picker>
  1182. </el-form-item>
  1183. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1184. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1185. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1186. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1187. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1188. </el-select>
  1189. </el-form-item>
  1190. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1191. <div class="exportReportRadio">
  1192. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1193. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1194. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1195. <i class="el-icon-question"></i>
  1196. </el-tooltip>
  1197. </div>
  1198. </el-form-item>
  1199. </el-form>
  1200. <div slot="footer" class="dialog-footer">
  1201. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1202. </div>
  1203. </el-dialog>
  1204. <!--导出报表条件选择 -->
  1205. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1206. <el-form ref="form3" :model="exportParam" >
  1207. <el-form-item prop="range" :label="$t('time.dateRange')">
  1208. <el-date-picker
  1209. v-model="exportParam.dateRange" :editable="false"
  1210. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1211. :clearable="true"
  1212. :range-separator="$t('other.to')"
  1213. type="daterange"
  1214. :start-placeholder="$t('time.startDate')"
  1215. :end-placeholder="$t('time.endDate')"
  1216. ></el-date-picker>
  1217. </el-form-item>
  1218. </el-form>
  1219. <div slot="footer" class="dialog-footer">
  1220. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1221. </div>
  1222. </el-dialog>
  1223. <!--人员列表 -->
  1224. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1225. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1226. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1227. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  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. <span>
  1232. <!-- {{(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}} -->
  1233. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1234. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1235. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1236. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1237. </span>
  1238. <span v-else>
  1239. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1240. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1241. </span>
  1242. </span>
  1243. </template>
  1244. </el-table-column>
  1245. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1246. <template slot-scope="scope">
  1247. <div>
  1248. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1249. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1250. </div>
  1251. </template>
  1252. </el-table-column>
  1253. </el-table>
  1254. </el-tab-pane>
  1255. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1256. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1257. <el-table-column prop="label" :label="$t('lable.name')" >
  1258. <template slot-scope="scope">
  1259. <!-- <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> -->
  1260. <!-- <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> -->
  1261. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1262. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1263. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1264. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1265. </span>
  1266. <span v-else>
  1267. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1268. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1269. </span>
  1270. </template>
  1271. </el-table-column>
  1272. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1273. <template slot-scope="scope">
  1274. <div>
  1275. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1276. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1277. </div>
  1278. </template>
  1279. </el-table-column>
  1280. </el-table>
  1281. </el-tab-pane>
  1282. </el-tabs>
  1283. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1284. <el-table-column type="selection"></el-table-column>
  1285. <el-table-column prop="label" :label="$t('lable.name')" >
  1286. <template slot-scope="scope">
  1287. <div>
  1288. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1289. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1290. </div>
  1291. </template>
  1292. </el-table-column>
  1293. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1294. <template slot-scope="scope">
  1295. <div>
  1296. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1297. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1298. </div>
  1299. </template>
  1300. </el-table-column>
  1301. </el-table>
  1302. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1303. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1304. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1305. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1306. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1307. </div>
  1308. </el-dialog>
  1309. <!-- 日报审核修改 -->
  1310. <el-dialog
  1311. :title="$t('riBaoShenHeXiuGai')"
  1312. :visible.sync="reportLogCheckDialog"
  1313. width="30%"
  1314. :before-close="handleClose">
  1315. <el-form ref="form3" :model="exportReportLogParam" >
  1316. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1317. <el-date-picker
  1318. v-model="exportReportLogParam.dateRange" :editable="false"
  1319. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1320. :range-separator="$t('other.to')"
  1321. type="daterange"
  1322. :start-placeholder="$t('time.startDate')"
  1323. :end-placeholder="$t('time.endDate')"
  1324. ></el-date-picker>
  1325. </el-form-item>
  1326. </el-form>
  1327. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1328. <br>
  1329. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1330. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1331. <span slot="footer" class="dialog-footer">
  1332. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1333. </span>
  1334. </el-dialog>
  1335. <!-- 按部门选择人员 -->
  1336. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1337. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1338. <el-input v-if="user.userNameNeedTranslate == 1" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" v-model.trim="nameAearch" @keyup.enter.native="nameAearchSeek(true)" class="input-with-select" clearable @input="nameAearchSeek(false)">
  1339. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1340. </el-input>
  1341. <div class="tree" style="height:400px">
  1342. <el-scrollbar style="height:100%">
  1343. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1344. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1345. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1346. <span class="custom-tree-node" slot-scope="{ node }">
  1347. <span v-if="user.userNameNeedTranslate == '1'">
  1348. <span v-if="node.data.children">
  1349. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1350. </span>
  1351. <span v-else>
  1352. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1353. </span>
  1354. </span>
  1355. <span v-if="user.userNameNeedTranslate != '1'">
  1356. {{ node.label }}
  1357. </span>
  1358. <!-- {{ node.label }} -->
  1359. </span>
  1360. </el-tree>
  1361. </el-scrollbar>
  1362. </div>
  1363. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1364. <div slot="footer" class="dialog-footer">
  1365. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1366. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1367. </div>
  1368. </el-dialog>
  1369. <el-dialog
  1370. v-if="monthWorkTimeDialog"
  1371. :visible.sync="monthWorkTimeDialog"
  1372. :close-on-click-modal="false"
  1373. customClass="customWidth selectworktime"
  1374. width="92%"
  1375. top="60px"
  1376. >
  1377. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1378. <el-tabs v-model="activeName" @tab-click="handleClick">
  1379. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1380. <div class="selectworktime_export" style="margin-top:10px;">
  1381. <div class="selectworktime_export_l">
  1382. <el-date-picker
  1383. class="selecteworktime_datapick"
  1384. v-model="WorktimeDatepickValue"
  1385. value-format="yyyy-MM-dd"
  1386. type="daterange"
  1387. align="right"
  1388. unlink-panels
  1389. :range-separator="$t('other.to')"
  1390. :start-placeholder="$t('time.startDate')"
  1391. :end-placeholder="$t('time.endDate')"
  1392. :default-time="['12:00:00', '12:00:00']"
  1393. size="small"
  1394. popper-class="selecteorktime_datapick_popper"
  1395. @change="showMonthWorkTime()"
  1396. >
  1397. </el-date-picker>
  1398. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1399. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1400. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1401. <!-- 222 -->
  1402. </div>
  1403. <div>
  1404. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForHasReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTime()"></el-cascader>
  1405. <vueCascader :subjectId="deptIdForHasReport" :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'14'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1406. <el-input style="float:left;width:22%" v-if="user.userNameNeedTranslate != '1'" v-model="searchKeyword" @keyup.enter.native="searchScreen(0)" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1407. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1408. </el-input>
  1409. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1410. </div>
  1411. <div style="float: left; height:32px; padding-top:10px;">
  1412. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1413. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1414. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1415. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1416. </div>
  1417. <div style="float: right; vertical-align: middle;height:32px">
  1418. <el-link
  1419. type="primary"
  1420. @click="exportMembWorkHours()"
  1421. >{{$t('export.exportData')}}</el-link
  1422. >
  1423. </div>
  1424. </div>
  1425. <el-table ref="hasworkTbl"
  1426. :data="monthWorkDataS"
  1427. v-el-table-infinite-scroll="listScroll"
  1428. border
  1429. :height="'70vh'"
  1430. highlight-current-row
  1431. style="width: 100%"
  1432. v-loading="tbload"
  1433. :lazy="true"
  1434. :cell-style="hasworkTblCellStyle"
  1435. >
  1436. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1437. <template slot-scope="scope">
  1438. {{ scope.$index + 1 }}
  1439. </template>
  1440. </el-table-column>
  1441. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1442. <template slot-scope="scope">
  1443. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1444. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1445. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1446. <!-- {{scope.row.name}} -->
  1447. </span>
  1448. </template>
  1449. </el-table-column>
  1450. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1451. <template slot-scope="scope">
  1452. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1453. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1454. </template>
  1455. </el-table-column>
  1456. <el-table-column
  1457. min-width="60"
  1458. v-for="(item, index) in pickDateArray"
  1459. :key="index"
  1460. :label="item"
  1461. align="center"
  1462. >
  1463. <template slot="header" slot-scope="scope">
  1464. <div>{{ scope.column.label.dateStr }}</div>
  1465. <div>{{ scope.column.label.weekStr }}</div>
  1466. </template>
  1467. <template slot-scope="scope">
  1468. <div
  1469. v-if="
  1470. scope.row.worktimeList.filter(
  1471. (w) =>
  1472. w.createDate==item.date
  1473. ).length > 0 &&
  1474. scope.row.worktimeList.filter(
  1475. (w) =>w.createDate==item.date
  1476. )[0].workingTime < reportTimeType.allday
  1477. "
  1478. >
  1479. {{
  1480. scope.row.worktimeList.filter(
  1481. (w) =>w.createDate==item.date
  1482. )[0].workingTime.toFixed(1)
  1483. }}
  1484. </div>
  1485. <div
  1486. v-if="
  1487. scope.row.worktimeList.filter(
  1488. (w) =>w.createDate==item.date
  1489. ).length > 0 &&
  1490. scope.row.worktimeList.filter(
  1491. (w) =>w.createDate==item.date
  1492. )[0].workingTime > reportTimeType.allday
  1493. "
  1494. >
  1495. {{
  1496. scope.row.worktimeList.filter(
  1497. (w) =>w.createDate==item.date
  1498. )[0].workingTime.toFixed(1)
  1499. }}
  1500. </div>
  1501. <div
  1502. v-if="
  1503. scope.row.worktimeList.filter(
  1504. (w) =>w.createDate==item.date
  1505. ).length > 0 &&
  1506. scope.row.worktimeList.filter(
  1507. (w) =>w.createDate==item.date
  1508. )[0].workingTime == reportTimeType.allday
  1509. "
  1510. >
  1511. {{
  1512. scope.row.worktimeList.filter(
  1513. (w) =>w.createDate==item.date
  1514. )[0].workingTime
  1515. }}
  1516. </div>
  1517. <div
  1518. v-if="
  1519. scope.row.worktimeList.filter(
  1520. (w) =>w.createDate==item.date
  1521. ).length == 0
  1522. "
  1523. >
  1524. 0
  1525. </div>
  1526. <div
  1527. v-if="
  1528. scope.row.worktimeList.filter(
  1529. (w) =>w.createDate==item.date
  1530. ).length > 0 &&
  1531. typeof scope.row.worktimeList.filter(
  1532. (w) =>w.createDate==item.date
  1533. )[0].workingTime == 'string'
  1534. "
  1535. >
  1536. {{
  1537. scope.row.worktimeList.filter(
  1538. (w) =>w.createDate==item.date
  1539. )[0].workingTime
  1540. }}
  1541. </div>
  1542. </template>
  1543. </el-table-column>
  1544. </el-table>
  1545. <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>
  1546. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1547. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1548. <label style="font-size: 16px">员工每日已填报工时数</label>
  1549. <el-link
  1550. type="primary"
  1551. style="float: right; margin-right: 60px"
  1552. @click="exportMembWorkHours()"
  1553. >导出已填报数据</el-link
  1554. > -->
  1555. <!-- <el-button >导出</el-button> -->
  1556. <!-- </div> -->
  1557. </el-tab-pane>
  1558. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1559. <div class="selectworktime_export" style="margin-top:10px">
  1560. <div class="selectworktime_export_l">
  1561. <el-date-picker
  1562. class="selecteworktime_datapick"
  1563. v-model="WorktimeDatepickValue"
  1564. value-format="yyyy-MM-dd"
  1565. type="daterange"
  1566. align="right"
  1567. unlink-panels
  1568. :range-separator="$t('other.to')"
  1569. :start-placeholder="$t('time.startDate')"
  1570. :end-placeholder="$t('time.endDate')"
  1571. :default-time="['12:00:00', '12:00:00']"
  1572. size="small"
  1573. popper-class="selecteorktime_datapick_popper"
  1574. @change="showMonthNotWorkTime()"
  1575. >
  1576. </el-date-picker>
  1577. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1578. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1579. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1580. </div>
  1581. <div>
  1582. <div style="margin-top:10px;">
  1583. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForNoReport" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthNotWorkTime()"></el-cascader>
  1584. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'15'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1585. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(1)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1586. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1587. </el-input>
  1588. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1589. <el-link
  1590. type="primary"
  1591. style="float: right; vertical-align: middle;height:32px"
  1592. @click="exportMembNotWorkHours()"
  1593. >{{$t('export.exportData')}}</el-link
  1594. >
  1595. </div>
  1596. </div>
  1597. </div>
  1598. <el-table
  1599. ref="hasworkTbl2"
  1600. :data="monthNotWorkDateS"
  1601. v-el-table-infinite-scroll="notListScroll"
  1602. border
  1603. :height="'70vh'"
  1604. highlight-current-row
  1605. style="width: 100%"
  1606. v-loading="tbload"
  1607. lazy
  1608. >
  1609. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1610. <template slot-scope="scope">
  1611. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1612. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1613. </template>
  1614. </el-table-column>
  1615. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1616. <template slot-scope="scope">
  1617. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1618. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1619. </template>
  1620. </el-table-column>
  1621. <el-table-column
  1622. min-width="200"
  1623. :label="$t('weekDay.date')"
  1624. align="center"
  1625. prop="createDate"
  1626. >
  1627. </el-table-column>
  1628. <el-table-column
  1629. min-width="200"
  1630. :label="$t('state.states')"
  1631. align="center"
  1632. prop="status"
  1633. />
  1634. <el-table-column
  1635. min-width="200"
  1636. :label="$t('other.attendanceData')"
  1637. prop="cardTime"
  1638. align="center"
  1639. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1640. </el-table>
  1641. <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>
  1642. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1643. </el-tab-pane>
  1644. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="user.timeType.syncCorpwxTime==1">
  1645. <div class="selectworktime_export" style="margin-top:10px">
  1646. <div class="selectworktime_export_l">
  1647. <el-date-picker
  1648. class="selecteworktime_datapick"
  1649. v-model="notfullSelectDateMonth"
  1650. value-format="yyyy-MM"
  1651. type="month"
  1652. align="right"
  1653. unlink-panels
  1654. size="small"
  1655. popper-class="selecteorktime_datapick_popper"
  1656. @change="showReportTimeLessThanCardTimeList()"
  1657. >
  1658. </el-date-picker>
  1659. </div>
  1660. <div>
  1661. <div style="margin-top:10px;">
  1662. <!-- <el-link
  1663. type="primary"
  1664. style="float: right; vertical-align: middle;height:32px"
  1665. @click="exportMembNotWorkHours()"
  1666. >{{$t('export.exportData')}}</el-link> -->
  1667. </div>
  1668. </div>
  1669. </div>
  1670. <el-table
  1671. ref="hasworkTbl4"
  1672. :data="notFullData"
  1673. border
  1674. :height="'70vh'"
  1675. highlight-current-row
  1676. style="width: 100%"
  1677. v-loading="tbload"
  1678. lazy
  1679. >
  1680. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1681. <template slot-scope="scope">
  1682. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1683. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1684. </template>
  1685. </el-table-column>
  1686. <el-table-column
  1687. min-width="200"
  1688. :label="$t('weekDay.date')"
  1689. align="center"
  1690. prop="createDate"
  1691. >
  1692. </el-table-column>
  1693. <el-table-column
  1694. min-width="200"
  1695. :label="$t('fillReportTime')"
  1696. align="center"
  1697. prop="reportTime"
  1698. />
  1699. <el-table-column
  1700. min-width="200"
  1701. :label="$t('workAttendance')"
  1702. prop="workHours"
  1703. align="center"></el-table-column>
  1704. </el-table>
  1705. </el-tab-pane>
  1706. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1707. <div class="selectworktime_export" style="margin-top:10px;">
  1708. <div class="selectworktime_export_l">
  1709. <el-date-picker
  1710. class="selecteworktime_datapick"
  1711. v-model="WorktimeDatepickValue"
  1712. value-format="yyyy-MM-dd"
  1713. type="daterange"
  1714. align="right"
  1715. unlink-panels
  1716. :range-separator="$t('other.to')"
  1717. :start-placeholder="$t('time.startDate')"
  1718. :end-placeholder="$t('time.endDate')"
  1719. :default-time="['12:00:00', '12:00:00']"
  1720. size="small"
  1721. popper-class="selecteorktime_datapick_popper"
  1722. @change="showMonthWorkTimeReminder()"
  1723. >
  1724. </el-date-picker>
  1725. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1726. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1727. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1728. </div>
  1729. <div>
  1730. <div style="margin-top:10px;">
  1731. <el-cascader v-if="user.userNameNeedTranslate != 1" :size="'small'" v-model="deptIdForReminder" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 200px;" @change="showMonthWorkTimeReminder()"></el-cascader>
  1732. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'16'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1733. <el-input style="float:left;width:18%" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(0)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1734. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1735. </el-input>
  1736. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1737. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1738. </div>
  1739. </div>
  1740. <div style="float: right; vertical-align: middle;height:32px">
  1741. <el-link
  1742. type="primary"
  1743. @click="changeReminder()"
  1744. >{{ $t('bianGengTiXing') }}</el-link
  1745. >
  1746. <el-link
  1747. type="primary"
  1748. @click="exportMembWorkHoursReminder()"
  1749. >{{$t('export.exportData')}}</el-link
  1750. >
  1751. </div>
  1752. </div>
  1753. <el-table ref="hasworkTbl"
  1754. :data="monthWorkDataS"
  1755. v-el-table-infinite-scroll="listScroll"
  1756. border
  1757. :height="'70vh'"
  1758. highlight-current-row
  1759. style="width: 100%"
  1760. v-loading="tbload"
  1761. :lazy="true"
  1762. >
  1763. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1764. <template slot-scope="scope">
  1765. {{ scope.row.createDate}}
  1766. </template>
  1767. </el-table-column>
  1768. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1769. <template slot-scope="scope">
  1770. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1771. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1772. <!-- {{scope.row.name}} -->
  1773. </template>
  1774. </el-table-column>
  1775. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1776. <template slot-scope="scope">
  1777. {{scope.row.invokeValue}}
  1778. </template>
  1779. </el-table-column>
  1780. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1781. <template slot-scope="scope">
  1782. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1783. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1784. </template>
  1785. </el-table-column>
  1786. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1787. <template slot-scope="scope">
  1788. {{ scope.row.workingTime}}
  1789. </template>
  1790. </el-table-column>
  1791. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1792. <template slot-scope="scope">
  1793. {{ scope.row.cardTime}}
  1794. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1795. </template>
  1796. </el-table-column>
  1797. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1798. <template slot-scope="scope">
  1799. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1800. </template>
  1801. </el-table-column>
  1802. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1803. <template slot-scope="scope">
  1804. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1805. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1806. </template>
  1807. </el-table-column>
  1808. </el-table>
  1809. <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>
  1810. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1811. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1812. <label style="font-size: 16px">员工每日已填报工时数</label>
  1813. <el-link
  1814. type="primary"
  1815. style="float: right; margin-right: 60px"
  1816. @click="exportMembWorkHours()"
  1817. >导出已填报数据</el-link
  1818. > -->
  1819. <!-- <el-button >导出</el-button> -->
  1820. <!-- </div> -->
  1821. </el-tab-pane>
  1822. </el-tabs>
  1823. </el-dialog>
  1824. <!--驳回弹出框 -->
  1825. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1826. <div>
  1827. <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')" />
  1828. </div>
  1829. <div slot="footer" class="dialog-footer">
  1830. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1831. <el-button type="primary" :loading="isDenying" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1832. </div>
  1833. </el-dialog>
  1834. <!-- 通过弹出框 -->
  1835. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1836. <div>
  1837. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1838. </div>
  1839. <div slot="footer" class="dialog-footer">
  1840. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1841. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1842. </div>
  1843. </el-dialog>
  1844. <!--批量导入日报 -->
  1845. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1846. <p>1. {{$t('other.download')}}
  1847. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="(user.timeType.enableNewWeeklyfill==1||user.companyId == 936 || user.companyId == 839 || user.timeType.importReportAuditNormal == 1)?('./upload/员工工时导入模板_新版.xlsx'):('./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx')" :download="((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate'))+'.xlsx'">{{((user.timeType.enableNewWeeklyfill == 1||user.companyId == 936)?'员工工时导入模板_新版':$t('template.EmployeeTimeImportTemplate')) + '.xlsx'}}</el-link>
  1848. </p>
  1849. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1850. <p style="display: flex;justify-content: center;">
  1851. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1852. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1853. </el-upload>
  1854. </p>
  1855. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1856. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1857. </div>
  1858. </el-dialog>
  1859. <!-- 工时导入记录弹窗 -->
  1860. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1861. <div style="height: 452px">
  1862. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1863. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1864. <el-table-column prop="userName" :label="$t('other.operator')">
  1865. <template slot-scope="scope">
  1866. <div>
  1867. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1868. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1869. </div>
  1870. </template>
  1871. </el-table-column>
  1872. <el-table-column prop="datel" :label="$t('other.document')">
  1873. <template slot-scope="scope">
  1874. <div>
  1875. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1876. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1877. </div>
  1878. </template>
  1879. </el-table-column>
  1880. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1881. <template slot-scope="scope">
  1882. <div>
  1883. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1884. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1885. </div>
  1886. </template>
  1887. </el-table-column>
  1888. </el-table>
  1889. <el-col :span="24" class="paginatis">
  1890. <el-pagination
  1891. @size-change="handleSizeChange"
  1892. @current-change="handleCurrentChange"
  1893. :page-sizes="[20 , 50 , 80 , 100]"
  1894. :page-size="20"
  1895. layout="total, sizes, prev, pager, next"
  1896. :total="toViewForm.total"
  1897. style="float:right;"
  1898. ></el-pagination>
  1899. </el-col>
  1900. </div>
  1901. </el-dialog>
  1902. <!--基于企业微信考勤数据的工时导入 -->
  1903. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1904. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1905. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1906. </el-step>
  1907. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1908. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1909. </el-steps>
  1910. <div v-if="active==0" style="padding:30px;height:360px;">
  1911. <div style="margin-top:50px;margin-left:280px;">
  1912. <el-date-picker
  1913. v-model="importWxParam.date" :editable="false"
  1914. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1915. :clearable="true"
  1916. :range-separator="$t('other.to')"
  1917. type="daterange"
  1918. :start-placeholder="$t('time.startDate')"
  1919. :end-placeholder="$t('time.endDate')"
  1920. @change="loadCheckInData"
  1921. ></el-date-picker>
  1922. </div>
  1923. </div>
  1924. <div v-if="active==1" style="padding:10px;">
  1925. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1926. style="width: 100%;margin-top:5px;" >
  1927. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1928. <template slot-scope="scope">
  1929. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1930. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1931. </template>
  1932. </el-table-column>
  1933. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1934. </el-table-column>
  1935. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1936. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1937. <template slot-scope="scope">
  1938. <div>
  1939. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1940. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1941. </div>
  1942. </template>
  1943. </el-table-column>
  1944. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1945. <template slot-scope="scope">
  1946. <div>
  1947. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1948. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1949. </div>
  1950. </template>
  1951. </el-table-column>
  1952. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1953. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1954. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1955. <template slot-scope="scope">
  1956. {{scope.row.workHours.toFixed(1)}}h
  1957. </template>
  1958. </el-table-column>
  1959. </el-table>
  1960. </div>
  1961. <div v-if="active==2" >
  1962. <p style="display: flex;justify-content: center;height:390px;">
  1963. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1964. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1965. </el-upload>
  1966. </p>
  1967. </div>
  1968. <div slot="title">
  1969. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  1970. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1971. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  1972. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  1973. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchDeleteReport = true; startDeleting = false;">{{ $t('piLiangShanChuRiBao') }}</el-link>
  1974. <el-link v-if="active==0 && showHidden && user.companyId == 469 && user.roleName == '超级管理员'" style="float:right;margin-right:50px;" type="primary" @click="showBatchSimpleApproveReport = true; startDeleting = false;getDepartmentForApprove();">{{ $t('piLiangShenHeRiBao') }}</el-link>
  1975. </div>
  1976. <span slot="footer">
  1977. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1978. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1979. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  1980. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1981. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1982. </span>
  1983. </el-dialog>
  1984. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  1985. <p style="display: flex;justify-content: center;height:100px;">
  1986. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  1987. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1988. </el-upload>
  1989. </p>
  1990. </el-dialog>
  1991. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  1992. <div>
  1993. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1994. v-model="deleteReportParam.date" :editable="false"
  1995. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1996. :clearable="true"
  1997. :range-separator="$t('other.to')"
  1998. type="daterange"
  1999. :start-placeholder="$t('time.startDate')"
  2000. :end-placeholder="$t('time.endDate')"
  2001. ></el-date-picker>
  2002. </div>
  2003. <div style="margin-top:10px;">
  2004. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2005. <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="deleteReportParam.deptId" :placeholder="$t('qing-xuan-ze-bu-men')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  2006. <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>
  2007. </div>
  2008. <div style="margin-top:10px;">
  2009. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2010. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2011. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2012. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2013. <span v-else>{{item.name}}</span>
  2014. </el-option>
  2015. </el-select>
  2016. </div>
  2017. <span slot="footer">
  2018. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2019. </span>
  2020. </el-dialog>
  2021. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2022. <div>
  2023. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2024. v-model="deleteReportParam.date" :editable="false"
  2025. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2026. :clearable="true"
  2027. :range-separator="$t('other.to')"
  2028. type="daterange"
  2029. :start-placeholder="$t('time.startDate')"
  2030. :end-placeholder="$t('time.endDate')"
  2031. ></el-date-picker>
  2032. </div>
  2033. <div style="margin-top:15px;">
  2034. <span>{{ $t('other.selectdepartment') }}:</span>
  2035. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2036. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2037. size="small" v-if="user.userNameNeedTranslate != 1"
  2038. ></el-cascader>
  2039. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2040. </div>
  2041. <span slot="footer">
  2042. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2043. </span>
  2044. </el-dialog>
  2045. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2046. <div>
  2047. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2048. v-model="modImportTime"
  2049. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2050. :clearable="true"
  2051. type="datetime"
  2052. ></el-date-picker>
  2053. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2054. v-model="modImportUserId"
  2055. >
  2056. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2057. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2058. <span v-else>{{item.name}}</span>
  2059. </el-option>
  2060. </el-select>
  2061. </div>
  2062. <span slot="footer">
  2063. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2064. </span>
  2065. </el-dialog>
  2066. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2067. <div>
  2068. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2069. <el-date-picker
  2070. v-model="ratioYmonth" :editable="false"
  2071. format="yyyyMM" value-format="yyyyMM"
  2072. type="month"
  2073. ></el-date-picker>
  2074. </div>
  2075. <span slot="footer">
  2076. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2077. </span>
  2078. </el-dialog>
  2079. <!--工时批量代填 -->
  2080. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2081. <div>
  2082. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2083. v-model="importWxParam.date" :editable="false"
  2084. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2085. :clearable="true"
  2086. :range-separator="$t('other.to')"
  2087. type="daterange"
  2088. :start-placeholder="$t('time.startDate')"
  2089. :end-placeholder="$t('time.endDate')"
  2090. @change="loadCheckInData"
  2091. ></el-date-picker>
  2092. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2093. </div>
  2094. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2095. :key="timeStamp"
  2096. style="width: 100%;margin-top:5px;" ref="tab">
  2097. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2098. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2099. <template slot-scope="scope">
  2100. <div>
  2101. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2102. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2103. </div>
  2104. </template>
  2105. </el-table-column>
  2106. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2107. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2108. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2109. <template slot-scope="scope">
  2110. {{scope.row.workHours.toFixed(1)}}h
  2111. </template>
  2112. </el-table-column>
  2113. <!--项目名称列表 -->
  2114. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2115. <template slot-scope="scope">
  2116. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2117. </template>
  2118. </el-table-column>
  2119. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2120. <template slot-scope="scope">
  2121. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2122. </template>
  2123. </el-table-column>
  2124. </el-table>
  2125. </el-dialog>
  2126. <!--基于企业微信考勤数据的工时导入 -->
  2127. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2128. <div style="padding-bottom:10px;">
  2129. <p>{{importResultMsg}}</p>
  2130. </div>
  2131. <!-- <span slot="footer" class="dialog-footer">
  2132. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2133. </span> -->
  2134. </el-dialog>
  2135. <!-- 审核流程展示 -->
  2136. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2137. <div style="padding:20px 40px 20px 0">
  2138. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2139. <el-step title="待提交"></el-step>
  2140. <el-step title="员工提交"></el-step>
  2141. <el-step title="审核通过"></el-step>
  2142. </el-steps>
  2143. <el-divider v-if="user.companyId == 7544"></el-divider>
  2144. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2145. <el-timeline :reverse="false" style="margin-top:10px;">
  2146. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2147. <!-- {{item.msg}} -->
  2148. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2149. <span v-if="user.userNameNeedTranslate == 1">
  2150. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2151. <span>{{item.msgCon.two}}</span>
  2152. </span>
  2153. </el-timeline-item>
  2154. </el-timeline>
  2155. </div>
  2156. </el-dialog>
  2157. <!-- 威派格定制 -->
  2158. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2159. </section>
  2160. </template>
  2161. <script>
  2162. // 左右滑动
  2163. import dragMixin from "@/common/js/tensile.js";
  2164. import util from "../../common/js/util";
  2165. // 自定义select组件
  2166. import selectCat from "@/components/select.vue"
  2167. // 引入自定义级联组件
  2168. import vueCascader from "@/components/cascader.vue"
  2169. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2170. // 重庆物奇定制组件
  2171. import WeeklyCustomization from "./weeklyCustomization.vue"
  2172. // 威派格定制转移工时
  2173. import TransferWorkingHours from "./transferWorkingHours.vue"
  2174. // 新的按周填报
  2175. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2176. import { mapMutations } from 'vuex'
  2177. let _that = this
  2178. export default {
  2179. mixins: [dragMixin],
  2180. components: {
  2181. selectCat,
  2182. vueCascader,
  2183. WeeklyCustomization,
  2184. vueMultipleDept,
  2185. TransferWorkingHours,
  2186. NewWeeklyCustomization
  2187. },
  2188. data() {
  2189. return {
  2190. subFillProjectList:[],
  2191. curAuditNode: 1,
  2192. refreshingTime: false,
  2193. substitudeStep: 1,
  2194. showHidden: false,
  2195. pageIndex: 0,
  2196. hasMore: true,
  2197. exportType: 0,
  2198. exportingData: false,
  2199. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2200. jobResponseList:[],
  2201. yisibeiCompId: 3092,
  2202. yuzhongCompId: 3385,
  2203. mingyiName : '成都明夷电子科技有限公司',
  2204. // mingyiName : '明夷',
  2205. modItemDataId: null,
  2206. modImportTime: null,
  2207. modImportUserId: null,
  2208. showModImportTimeDialog: false,
  2209. showBatchSimpleApproveReport: false,
  2210. startDeleting: false,
  2211. showBatchDeleteReport: false,
  2212. deleteReportParam: {date:null, userIds:[]},
  2213. isDenying: false,
  2214. targetWeekDate: null,//填写周报中的周日期
  2215. importCardTimeVisi: false,
  2216. startRatioExporting: false,
  2217. exportUserRatio: false,
  2218. ratioYmonth:null,
  2219. hasWrittenReport: false,
  2220. today:null,
  2221. syncTimeLoading: false,
  2222. seluserText: '',
  2223. translation: '1', // 1、文字, 2、部门, 3、人员
  2224. exportLoad: false,
  2225. getPickerOptions: {
  2226. disabledDate: (time) => {
  2227. var date = new Date();
  2228. var year = date.getFullYear();
  2229. var month = date.getMonth() + 1;
  2230. if (month >= 1 && month <= 9) {
  2231. month = "0" + month;
  2232. }
  2233. var currentdate = year.toString() + month.toString();
  2234. var timeyear = time.getFullYear();
  2235. var timemonth = time.getMonth() + 1;
  2236. if (timemonth >= 1 && timemonth <= 9) {
  2237. timemonth = "0" + timemonth;
  2238. }
  2239. var timedate = timeyear.toString() + timemonth.toString();
  2240. if(this.user.timeType.fillAhead == 0){
  2241. return currentdate < timedate;
  2242. }else{
  2243. return false
  2244. }
  2245. }
  2246. },
  2247. alalal: '8.0',
  2248. timeBasecostList:null,
  2249. tbload: false,
  2250. exportTimeDialog: false,
  2251. searchKeyword: '',
  2252. monthWorkDataS: [],
  2253. monthNotWorkDateS: [],
  2254. pickDateArray:[],
  2255. WorktimeDatepickValue: [],
  2256. activeName:"first",
  2257. isLeave: 0,
  2258. submitingReport: false,
  2259. importResultMsg:null,
  2260. showImportResult:false,
  2261. importingData: false,
  2262. isDraft: 0,
  2263. timeStamp: 0,
  2264. projectColumns:[],
  2265. checkinLoading:false,
  2266. importWxParam:{date:null,},
  2267. active:0,
  2268. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2269. importWxDialog:false,
  2270. importDialog:false,
  2271. denyForm:null,
  2272. denyReasonDialog:false,
  2273. monthWorkTimeDialog: false,
  2274. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2275. isSubstitude:false,
  2276. isFill:false,
  2277. unFillList:[],
  2278. fillList:[],
  2279. fillMembList:[],
  2280. fillMembList_leave: [],
  2281. membListVisible: false,
  2282. isBatch:0,//是否是批量填报
  2283. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2284. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2285. 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')],
  2286. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2287. fillStatusList: [],
  2288. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2289. exportReportLogParam:{dateRange:[]},
  2290. exportDialog:false,
  2291. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2292. subProjectList:[],
  2293. canEdit: true,
  2294. originCanEdit: true,
  2295. 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],
  2296. selectTime:null,
  2297. reportTimeType:{},
  2298. curDate:'',
  2299. isAllSelect: false,
  2300. approveDialogVisible:false,
  2301. deptId:null,
  2302. targetUid: null,
  2303. membCount:0,
  2304. selectState:"-1",
  2305. user: JSON.parse(sessionStorage.getItem("user")),
  2306. allUsersList: [],
  2307. showAddMore:false,
  2308. allDate: [],
  2309. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2310. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2311. choseDay: 0,
  2312. tableHeight: 0,
  2313. listLoading: false,
  2314. projectList: [], //项目列表
  2315. fillProjectList: [],
  2316. reportList: [], //日报列表
  2317. reportNames:[], //批量审批列表
  2318. selCon:[], //筛选条件
  2319. selProjectList:[], //筛选后项目列表
  2320. selConShow: true,
  2321. usersList: [], // 全部人员列表
  2322. usersListId: '', // 选中的人员id
  2323. dialogVisible: false, //项目弹窗
  2324. report: '',
  2325. workForm: {
  2326. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2327. domains: [{
  2328. id: null,
  2329. projectId: "",
  2330. workingTime: "",
  2331. timeType:0,
  2332. content: "",
  2333. state: 2,
  2334. multiWorktime:0,
  2335. worktimeList:[],
  2336. degreeId: null,
  2337. auditUserList: [],
  2338. }],
  2339. showRefresh: false,
  2340. },
  2341. workRules: {
  2342. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2343. },
  2344. chooseParticipVisible: false,
  2345. logining: false,
  2346. isDisable: false,
  2347. timeType:[],
  2348. deptMembData: [
  2349. ],
  2350. //部门人员树状结构
  2351. data: [
  2352. {
  2353. id: -1,
  2354. label: this.$t('lable.allStaff'),
  2355. membCount:0
  2356. },
  2357. {
  2358. id: 0,
  2359. label: this.$t('lable.unassigned'),
  2360. }
  2361. ],
  2362. allData:{},
  2363. batchShowData:{},
  2364. option: [],
  2365. deptOptionList: [],
  2366. depData: {
  2367. id: -1,
  2368. label: this.$t('lable.allStaff'),
  2369. },
  2370. defaultProps: {
  2371. children: 'children',
  2372. label: 'label'
  2373. },
  2374. isNew: false,
  2375. selected: false,
  2376. valuet: new Date(),
  2377. domObj: null,
  2378. participator:[],
  2379. chosenMembCount:0,
  2380. jsDay: 0,
  2381. jsTime: 0,
  2382. falsss: false,
  2383. weidu: [],
  2384. weiduList: [],
  2385. yonghuUser: [],
  2386. dateAr: [],
  2387. batchSubFillDialog: false,
  2388. isSubstiS: false,
  2389. fillWeekDialogVisi: false,
  2390. fillWeekDialogVisiCustom: false,
  2391. fillWeekDialogVisiCustomTwo: false,
  2392. zhoData: [],
  2393. weekDateRange: [],
  2394. btnZho: false,
  2395. weekDataLoading: false,
  2396. changdu: 6,
  2397. tianxieDialogVisible: false,
  2398. scopess: {},
  2399. zhoBao: {
  2400. time: '',
  2401. workingTime: '',
  2402. progress: '',
  2403. con: '',
  2404. subProjectId: '',
  2405. stage: '',
  2406. subProjectList: [],
  2407. stages: [],
  2408. },
  2409. zhoBaoIdx: '',
  2410. zhoBaoName: '',
  2411. zhis: {},
  2412. dealList: [],
  2413. toViewDialogVisible: false,
  2414. toViewList: [],
  2415. toViewloading: true,
  2416. toViewForm: {
  2417. pageIndex: '1',
  2418. pageSize: '20',
  2419. total: 0,
  2420. },
  2421. toViewloadings: false,
  2422. tabPositionss: 'top',
  2423. monthTotal: 0,
  2424. monthTotalPage: 0,
  2425. monthTotalLages: 20,
  2426. monthWorkData: [],
  2427. monthNotWorkDate: [],
  2428. monthWorkDataS1: [],
  2429. monthnotTotal: 0,
  2430. monthnotTotalPage: 0,
  2431. monthnotTotalLages: 20,
  2432. monthNotWorkDateS1: [],
  2433. deptMembDataText: '',
  2434. isFlag: false,
  2435. isMore: false,
  2436. stateKey: '0',
  2437. expandDate: [],
  2438. notifySelList:[],
  2439. departmentList: [],
  2440. trandepartmentList:[],
  2441. approvalProcessDialog: false,
  2442. approvalProcessData: [],
  2443. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2444. 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')],
  2445. isWeekend: false,
  2446. canCancelInDialog: false,
  2447. approveinData: {},
  2448. approveinDialog: false,
  2449. reportCanDelete: false,
  2450. weeklyFilledTimeDialog: false,
  2451. weeklyFilledTimeList: [],
  2452. weeklyFilledTimeLoading: false,
  2453. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2454. weeklyFilledTimeCanDelete: false,
  2455. weeklyFilledTimeDate: null,
  2456. leaveAllNum: 0,
  2457. dataLoading: false,
  2458. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2459. vacationTime: {},
  2460. integrationProjectList: [],
  2461. totalReportHours: 0, // 合计的工时
  2462. workTimeForMinYi:0,
  2463. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2464. weekIndex: 1,
  2465. weekParentData: {},
  2466. deptIdForNoReport:[],
  2467. deptIdForReminder:[],
  2468. nameAearch: '', // 企业微信姓名搜索
  2469. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2470. deptMembDataLoading: false,
  2471. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2472. {
  2473. id: 4811,
  2474. // id: 10,
  2475. name: '陕西柘中建设工程有限公司'
  2476. }
  2477. ],
  2478. pushWorkTimeLogDig:false,
  2479. pushWorkTimeLogData:[],
  2480. userReportDeptList: [],
  2481. isReminder:true,
  2482. reportLogCheckDialog:false,
  2483. deptIdForHasReport:[],
  2484. transferWorkingHoursVisable: false
  2485. };
  2486. },
  2487. watch: {
  2488. deptMembDataText(val) {
  2489. this.$refs.chooseMembTree.filter(val);
  2490. }
  2491. },
  2492. filters: {
  2493. // 过滤
  2494. amounts(value) {
  2495. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2496. return 0
  2497. }
  2498. var zhi = +value + 0
  2499. return zhi.toFixed(1)
  2500. },
  2501. // zhoData
  2502. zhoData(value, arr) {
  2503. var dateArray = value.split("-");
  2504. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2505. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2506. // console.log(arr[date.getDay()])
  2507. // return "周" + "日一二三四五六".charAt(date.getDay());
  2508. return arr[date.getDay()]
  2509. },
  2510. // 过滤数字
  2511. numbers(value) {
  2512. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2513. return 0
  2514. }
  2515. return value
  2516. },
  2517. },
  2518. computed: {},
  2519. mounted() {
  2520. var now = new Date();
  2521. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2522. this.today = t;
  2523. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2524. this.exportParam.dateRange = [startStr,t];
  2525. this.exportReportLogParam.dateRange = [startStr,t];
  2526. this.getAllDate(1);
  2527. this.getReportList();
  2528. this.getProjectList();
  2529. this.getFillProjectList();
  2530. this.getTimeType();
  2531. this.getDepartment();
  2532. this.scrollFunction()
  2533. this.userssHu();
  2534. this.getFirstAndLastDay()
  2535. if(this.user.timeType.reportAuditType == 3){
  2536. this.getAllUsersList()
  2537. }
  2538. if (this.user.company.packageProject == 1) {
  2539. this.getBasecostItemList();
  2540. }
  2541. if(this.user.timeType.userWithMultiDept == 1) {
  2542. this.getDeptMembData();
  2543. }
  2544. if(this.user.timeType.lockWorktime){
  2545. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2546. }
  2547. //设置了下限
  2548. if (this.user.timeType.minReportTime) {
  2549. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2550. }
  2551. const that = this
  2552. if(this.user.userNameNeedTranslate == 1) {
  2553. that.dataLoading = that.$store.state.dataLoading
  2554. this.upDataLoading()
  2555. setTimeout(()=>{
  2556. that.dataLoading = that.$store.state.dataLoading
  2557. }, 1000)
  2558. }
  2559. if (this.user.companyId == this.yuzhongCompId) {
  2560. this.getJobResponList();
  2561. }
  2562. },
  2563. methods: {
  2564. ...mapMutations(['upDataLoading']),
  2565. // 已填工时情况表设置背景色
  2566. hasworkTblCellStyle({ columnIndex, row, column }) {
  2567. if(columnIndex > 2) {
  2568. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2569. const worktimeList = row.worktimeList || []
  2570. const times = this.reportTimeType.allday
  2571. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2572. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2573. const missReport = filterData[0] && filterData[0].missReport;
  2574. const state = filterData[0] && filterData[0].state
  2575. if (missReport) {
  2576. return "backgroundColor: red"
  2577. } else {
  2578. if (state == 0 || state == -1) {
  2579. return "backgroundColor: orange"
  2580. } else if (state == 1) {
  2581. //审核通过
  2582. return "backgroundColor: #32CD32"
  2583. } else if (state == 2) {
  2584. return "backgroundColor: red"
  2585. } else {
  2586. return "backgroundColor: #E0E0E0"
  2587. }
  2588. }
  2589. }
  2590. },
  2591. showReportTimeLessThanCardTimeList() {
  2592. this.monthTotalPage = 0,
  2593. this.tbload = true,
  2594. this.http.post(
  2595. "/report/getReportTimeLessThanCardTimeList",
  2596. {
  2597. date: this.notfullSelectDateMonth
  2598. },
  2599. (res) => {
  2600. if (res.code == "ok") {
  2601. this.tbload = false
  2602. this.notFullData = res.data;
  2603. }
  2604. },
  2605. (error) => {
  2606. this.tbload = false
  2607. this.$message({
  2608. message: error,
  2609. type: "error",
  2610. });
  2611. }
  2612. );
  2613. },
  2614. //按选择的日期范围刷新考勤
  2615. refreshWXCardTimeByRange() {
  2616. this.refreshingTime = true;
  2617. this.http.post('/wxcorp/getUserCheckInDayData',{
  2618. companyId: this.user.companyId,
  2619. userId: this.user.id,
  2620. startDate: this.importWxParam.date[0],
  2621. endDate: this.importWxParam.date[1],
  2622. },res => {
  2623. this.refreshingTime = false;
  2624. if(res.code == 'ok'){
  2625. this.loadCheckInData();
  2626. }else {
  2627. this.$message({
  2628. message: res.msg,
  2629. type: 'error'
  2630. })
  2631. }
  2632. },err => {
  2633. this.syncTimeLoading = false;
  2634. this.$message({
  2635. message: err,
  2636. type: 'error'
  2637. })
  2638. })
  2639. },
  2640. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2641. isCustomization(userInfo, permissionArray) {
  2642. const { companyId } = userInfo
  2643. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2644. return isReportPictureRequired
  2645. },
  2646. showHiddenFunction() {
  2647. this.showHidden = true;
  2648. },
  2649. // 获取如何信息选的可填写部门
  2650. getDeptMembData() {
  2651. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2652. if (res.code == "ok") {
  2653. let lists = res.data.userReportDeptList || []
  2654. const optimizedList = lists.map(item => ({
  2655. ...item,
  2656. label: item.departmentName,
  2657. value: item.departmentId,
  2658. }));
  2659. this.$set(this, 'userReportDeptList', optimizedList || []);
  2660. } else {
  2661. this.$message({
  2662. message: res.msg,
  2663. type: "error"
  2664. });
  2665. }
  2666. },error => { });
  2667. },
  2668. //任务被选中
  2669. onTaskSelected(domainItem) {
  2670. //取服务
  2671. if (domainItem.taskId) {
  2672. var that = this;
  2673. var param = {taskId:domainItem.taskId};
  2674. if (this.isSubstitude) {
  2675. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2676. param.userId = this.workForm.userId[0];
  2677. }
  2678. }
  2679. this.http.post('/task/getMyTaskService',param, res => {
  2680. if (res.code == "ok") {
  2681. // domainItem.workContentList = res.data;
  2682. that.$set(domainItem, 'sapServiceId', null);
  2683. that.$set(domainItem, 'serviceList', res.data);
  2684. } else {
  2685. this.$message({
  2686. message: res.msg,
  2687. type: "error"
  2688. });
  2689. }
  2690. },error => {
  2691. this.$message({
  2692. message: error,
  2693. type: "error"
  2694. });
  2695. }
  2696. );
  2697. } else {
  2698. //清空服务
  2699. }
  2700. },
  2701. onBatchTimeChange() {
  2702. //反向计算每日工作时长
  2703. if (this.workForm.createDate) {
  2704. let sdate = new Date(this.workForm.createDate[0]);
  2705. let edate = new Date(this.workForm.createDate[1]);
  2706. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2707. console.log('days===', days)
  2708. if (days < 0) {
  2709. return;
  2710. }
  2711. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2712. //总时长发生改变,自动按比例计算
  2713. this.workForm.domains.forEach(d=>{
  2714. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2715. });
  2716. }
  2717. },
  2718. //更新工作内容列表
  2719. updateJobContent(domainItem) {
  2720. var that = this;
  2721. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2722. if (res.code == "ok") {
  2723. // domainItem.workContentList = res.data;
  2724. that.$set(domainItem, 'extraField3', null);
  2725. that.$set(domainItem, 'workContentList', res.data);
  2726. } else {
  2727. this.$message({
  2728. message: res.msg,
  2729. type: "error"
  2730. });
  2731. }
  2732. },error => {
  2733. this.$message({
  2734. message: error,
  2735. type: "error"
  2736. });
  2737. }
  2738. );
  2739. },
  2740. updateResponse(domainItem) {
  2741. var that = this;
  2742. var selectPid = domainItem.projectId;
  2743. domainItem.extraField2 = null;
  2744. domainItem.extraField3 = null;
  2745. if (selectPid && domainItem.extraField1) {
  2746. //是否非项目
  2747. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2748. console.log('==========','isPublic=='+isPublic);
  2749. var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
  2750. console.log(filteredRespList);
  2751. domainItem.filteredRespList = filteredRespList;
  2752. }
  2753. },
  2754. getJobResponList() {
  2755. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2756. if (res.code == "ok") {
  2757. this.jobResponseList = res.data;
  2758. } else {
  2759. this.$message({
  2760. message: res.msg,
  2761. type: "error"
  2762. });
  2763. }
  2764. },error => {
  2765. this.$message({
  2766. message: error,
  2767. type: "error"
  2768. });
  2769. }
  2770. );
  2771. },
  2772. openModImportTime(row) {
  2773. this.showModImportTimeDialog = true;
  2774. this.modItemDataId = row.id;
  2775. },
  2776. delImportTime(row) {
  2777. let rowId = row.id;
  2778. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2779. confirmButtonText: this.$t('btn.determine'),
  2780. cancelButtonText: this.$t('btn.cancel'),
  2781. type: "warning"
  2782. })
  2783. .then(() => {
  2784. this.http.post('/report-import-log/delete',{
  2785. id: rowId
  2786. },res => {
  2787. if (res.code == "ok") {
  2788. this.$message({
  2789. message: this.$t('message.successfullyDeleted'),
  2790. type: "success"
  2791. });
  2792. this.getToView();
  2793. } else {
  2794. this.$message({
  2795. message: res.msg,
  2796. type: "error"
  2797. });
  2798. }
  2799. },error => {
  2800. this.$message({
  2801. message: error,
  2802. type: "error"
  2803. });
  2804. }
  2805. );
  2806. }).catch(() => {this.startDeleting = false});
  2807. },
  2808. confirmChangeModTime() {
  2809. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2810. this.$message({
  2811. message: this.$t('message.Pleaseselectatime'),
  2812. type: "error"
  2813. });
  2814. return;
  2815. }
  2816. this.http.post('/report-import-log/changeTime',{
  2817. modLogDateTime: this.modImportTime,
  2818. modImportUserId: this.modImportUserId,
  2819. id: this.modItemDataId
  2820. },res => {
  2821. if (res.code == "ok") {
  2822. this.$message({
  2823. message: this.$t('message.modifyTheSuccess'),
  2824. type: "success"
  2825. });
  2826. this.getToView();
  2827. this.showModImportTimeDialog = false;
  2828. } else {
  2829. this.$message({
  2830. message: res.msg,
  2831. type: "error"
  2832. });
  2833. }
  2834. },error => {
  2835. this.$message({
  2836. message: error,
  2837. type: "error"
  2838. });
  2839. }
  2840. );
  2841. },
  2842. confirmBatchApproveReport() {
  2843. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2844. this.$message({
  2845. message: this.$t('qingXuanZeRiQiFanWei'),
  2846. type: "error"
  2847. });
  2848. return;
  2849. }
  2850. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2851. confirmButtonText: this.$t('btn.determine'),
  2852. cancelButtonText: this.$t('btn.cancel'),
  2853. type: "warning"
  2854. })
  2855. .then(() => {
  2856. this.startDeleting = true;
  2857. let obj = {
  2858. startDate: this.deleteReportParam.date[0],
  2859. endDate: this.deleteReportParam.date[1]
  2860. }
  2861. if(this.deleteReportParam.departmentId) {
  2862. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2863. } else {
  2864. obj.departmentId = null
  2865. }
  2866. this.http.post('/report/batchApproveByDate',obj,res => {
  2867. if (res.code == "ok") {
  2868. this.$message({
  2869. message: this.$t('state.approved'),
  2870. type: "success"
  2871. });
  2872. this.getReportList();
  2873. this.getDepartment();
  2874. this.startDeleting = false;
  2875. } else {
  2876. this.$message({
  2877. message: res.msg,
  2878. type: "error"
  2879. });
  2880. }
  2881. },error => {
  2882. this.$message({
  2883. message: error,
  2884. type: "error"
  2885. });
  2886. }
  2887. );
  2888. }).catch(() => {this.startDeleting = false});
  2889. },
  2890. confirmBatchDelReport() {
  2891. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2892. this.$message({
  2893. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2894. type: "error"
  2895. });
  2896. return;
  2897. }
  2898. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2899. this.$message({
  2900. message: this.$t('qingXuanZeRiQiFanWei'),
  2901. type: "error"
  2902. });
  2903. return;
  2904. }
  2905. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2906. confirmButtonText: this.$t('btn.determine'),
  2907. cancelButtonText: this.$t('btn.cancel'),
  2908. type: "warning"
  2909. })
  2910. .then(() => {
  2911. this.startDeleting = true;
  2912. this.http.post('/report/batchDelete',{
  2913. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2914. startDate: this.deleteReportParam.date[0],
  2915. endDate: this.deleteReportParam.date[1],
  2916. deptId: this.deleteReportParam.deptId[0]
  2917. },res => {
  2918. if (res.code == "ok") {
  2919. this.$message({
  2920. message: this.$t('message.successfullyDeleted'),
  2921. type: "success"
  2922. });
  2923. this.getReportList();
  2924. this.getDepartment();
  2925. this.startDeleting = false;
  2926. } else {
  2927. this.$message({
  2928. message: res.msg,
  2929. type: "error"
  2930. });
  2931. }
  2932. },error => {
  2933. this.$message({
  2934. message: error,
  2935. type: "error"
  2936. });
  2937. }
  2938. );
  2939. }).catch(() => {this.startDeleting = false});
  2940. },
  2941. getRecentlyProject(userId) {
  2942. this.http.post('/project/nearProject',{userId: userId},res => {
  2943. if(res.code == 'ok'){
  2944. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  2945. let topObj = {
  2946. label: this.$t('zuiJinXuanZeXiangMu'),
  2947. peojectList: res.data
  2948. }
  2949. let botomObj = {
  2950. label: this.$t('other.allProject'),
  2951. peojectList: bottomList
  2952. }
  2953. //最近项目如果在fillProjectList中不存在,需要移除
  2954. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  2955. this.integrationProjectList = [topObj, botomObj]
  2956. }else {
  2957. this.$message({
  2958. message: res.msg,
  2959. type: 'error'
  2960. })
  2961. }
  2962. },err => {
  2963. this.$message({
  2964. message: err,
  2965. type: 'error'
  2966. })
  2967. })
  2968. },
  2969. handlePictureCardPreview(file, index) {
  2970. console.log(file, index)
  2971. let arr = []
  2972. let imgArr = this.workForm.domains[index].imgListUrl
  2973. for(var i in imgArr) {
  2974. arr.push(imgArr[i].url)
  2975. }
  2976. console.log(arr, '图片数据')
  2977. const $viewer = this.$viewerApi({
  2978. images: arr
  2979. });
  2980. },
  2981. // 图片上传
  2982. addImg(e, index) {
  2983. console.log(e, '数据')
  2984. let formData = new FormData()
  2985. formData.append('multipartFile', e.file)
  2986. this.http.uploadFile('/common/uploadFile', formData,
  2987. res => {
  2988. if (res.code == "ok") {
  2989. this.$message({
  2990. message: this.$t('uploadedsuccessfully'),
  2991. type: "success"
  2992. });
  2993. if(!this.workForm.domains[index].imgList) {
  2994. this.workForm.domains[index].imgList = []
  2995. this.workForm.domains[index].imgListUrl = []
  2996. }
  2997. this.workForm.domains[index].imgList.push(res.data)
  2998. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  2999. } else {
  3000. this.$message({message: res.msg,type: "error"});
  3001. }
  3002. console.log(this.workForm.domains[index])
  3003. },
  3004. error => {this.$message({message: error,type: "error"});
  3005. });
  3006. },
  3007. // 删除图片
  3008. delImg(file,fileList, index) {
  3009. console.log(file, fileList)
  3010. let idx = 0
  3011. for(let i in fileList) {
  3012. if(fileList[i].uid == file.uid) {
  3013. idx = i
  3014. }
  3015. }
  3016. this.workForm.domains[index].imgList.splice(idx, 1)
  3017. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3018. console.log(this.workForm.domains[index])
  3019. },
  3020. test(){
  3021. console.log('test',this.workForm.domains);
  3022. },
  3023. getHour(s1, s2) {
  3024. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3025. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3026. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3027. var ms = s2.getTime() - s1.getTime();
  3028. if (ms < 0) return 0;
  3029. let ma = ms / 1000 / 60 / 60
  3030. return ma; //小时
  3031. },
  3032. refreshWXCardTime(workdate) {
  3033. if (!workdate) return;
  3034. this.syncTimeLoading = true;
  3035. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3036. date: workdate,
  3037. },res => {
  3038. this.syncTimeLoading = false;
  3039. if(res.code == 'ok'){
  3040. this.workForm.time = res.data.time;
  3041. }else {
  3042. this.$message({
  3043. message: res.msg,
  3044. type: 'error'
  3045. })
  3046. }
  3047. },err => {
  3048. this.syncTimeLoading = false;
  3049. this.$message({
  3050. message: err,
  3051. type: 'error'
  3052. })
  3053. })
  3054. },
  3055. refreshAttendance(workdate) {
  3056. if (!workdate) return;
  3057. this.syncTimeLoading = true;
  3058. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3059. startDate: workdate[0],
  3060. endDate: workdate[1]
  3061. },res => {
  3062. this.syncTimeLoading = false;
  3063. if(res.code == 'ok'){
  3064. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3065. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3066. this.totalReportHours = this.workTimeForMinYi;
  3067. }else {
  3068. this.$message({
  3069. message: res.msg,
  3070. type: 'error'
  3071. })
  3072. }
  3073. },err => {
  3074. this.syncTimeLoading = false;
  3075. this.$message({
  3076. message: err,
  3077. type: 'error'
  3078. })
  3079. })
  3080. },
  3081. refreshBeiSengAttendance(workdate) {
  3082. if (!workdate) return;
  3083. this.syncTimeLoading = true;
  3084. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3085. createDate: workdate
  3086. },res => {
  3087. this.syncTimeLoading = false;
  3088. if(res.code == 'ok'){
  3089. this.workForm.time = res.data;
  3090. }else {
  3091. this.$message({
  3092. message: res.msg,
  3093. type: 'error'
  3094. })
  3095. }
  3096. },err => {
  3097. this.syncTimeLoading = false;
  3098. this.$message({
  3099. message: err,
  3100. type: 'error'
  3101. })
  3102. })
  3103. },
  3104. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3105. this.weeklyFilledTimeDialog = true
  3106. this.weeklyFilledTimeLoading = true
  3107. this.weeklyFilledTimeDate = parameterDate
  3108. this.http.post('/report/getReportList',{
  3109. date: parameterDate,
  3110. userId: this.user.id
  3111. },res => {
  3112. this.weeklyFilledTimeLoading = false
  3113. if(res.code == 'ok'){
  3114. this.weeklyFilledTimeList = res.data[0].data
  3115. let candelete = true
  3116. for(let i in this.weeklyFilledTimeList){
  3117. if(this.weeklyFilledTimeList[i].state < 2){
  3118. candelete = false
  3119. }
  3120. }
  3121. this.weeklyFilledTimeCanDelete = candelete
  3122. }else {
  3123. this.$message({
  3124. message: res.msg,
  3125. type: 'error'
  3126. })
  3127. }
  3128. },err => {
  3129. this.weeklyFilledTimeLoading = false
  3130. this.$message({
  3131. message: err,
  3132. type: 'error'
  3133. })
  3134. })
  3135. },
  3136. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3137. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3138. confirmButtonText: this.$t('btn.determine'),
  3139. cancelButtonText: this.$t('btn.cancel'),
  3140. type: "warning"
  3141. })
  3142. .then(() => {
  3143. this.http.post('/report/delete',{
  3144. userId: this.user.id,
  3145. date: this.weeklyFilledTimeDate
  3146. },res => {
  3147. if (res.code == "ok") {
  3148. this.$message({
  3149. message: this.$t('message.successfullyDeleted'),
  3150. type: "success"
  3151. });
  3152. this.getWeeklyWorkTime()
  3153. this.getReportList();
  3154. this.getDepartment();
  3155. this.weeklyFilledTimeDialog = false;
  3156. } else {
  3157. this.$message({
  3158. message: res.msg,
  3159. type: "error"
  3160. });
  3161. }
  3162. },error => {
  3163. this.$message({
  3164. message: error,
  3165. type: "error"
  3166. });
  3167. }
  3168. );
  3169. }).catch(() => {});
  3170. },
  3171. getApprovalProcess(item){
  3172. // console.log('this.date',this.choseDate);
  3173. this.http.post('/report-log/get',{
  3174. creatorId: item.id,
  3175. createDate: sessionStorage.msg
  3176. },res => {
  3177. if(res.code == 'ok'){
  3178. this.approvalProcessDialog = true
  3179. if(this.user.userNameNeedTranslate == 1) {
  3180. for(var i in res.data) {
  3181. let obj = {
  3182. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3183. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3184. }
  3185. res.data[i].msgCon = obj
  3186. }
  3187. }
  3188. this.approvalProcessData = res.data
  3189. console.log(this.approvalProcessData, '数据卡看')
  3190. }else{
  3191. this.$message({
  3192. message: res.msg,
  3193. type: 'error'
  3194. })
  3195. }
  3196. },err => {
  3197. this.$message({
  3198. message: err,
  3199. type: 'error'
  3200. })
  3201. })
  3202. //获取审批节点状态
  3203. if (this.user.companyId == 7544) {
  3204. this.http.post('/report/getCurAuditNode',{
  3205. userId: item.id,
  3206. date: sessionStorage.msg
  3207. },res => {
  3208. if(res.code == 'ok'){
  3209. this.curAuditNode = res.data
  3210. }else{
  3211. }
  3212. },err => {
  3213. this.$message({
  3214. message: err,
  3215. type: 'error'
  3216. })
  3217. })
  3218. }
  3219. },
  3220. filterNode(value, data) {
  3221. if (!value) return true;
  3222. return data.label.indexOf(value) !== -1;
  3223. },
  3224. triggerCalculateOT(index) {
  3225. var str = this.workForm.domains[index].overtimeHours + ''
  3226. if(str.indexOf('.') != '-1') {
  3227. var s = str.split('.')[0]
  3228. var st = str.split('.')[1]
  3229. var sts = st.split('')
  3230. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3231. }
  3232. },
  3233. searchScreen(e){
  3234. if(e){
  3235. this.monthNotWorkDateS1 = []
  3236. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3237. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3238. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3239. }
  3240. }
  3241. if (this.monthNotWorkDateS1.length > 50) {
  3242. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3243. }else{
  3244. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3245. }
  3246. // if (this.monthNotWorkDateS1.length > 0) {
  3247. // setTimeout(() => {
  3248. // this.tableListenernot()
  3249. // }, 1000);
  3250. // }
  3251. }else{
  3252. this.monthWorkDataS1 = []
  3253. for (let i = 0; i < this.monthWorkData.length; i++) {
  3254. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3255. this.monthWorkDataS1.push(this.monthWorkData[i])
  3256. }
  3257. }
  3258. if (this.monthWorkDataS1.length > 50) {
  3259. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3260. }else{
  3261. this.monthWorkDataS = this.monthWorkDataS1
  3262. }
  3263. // if (this.monthWorkDataS1.length > 0) {
  3264. // setTimeout(() => {
  3265. // this.tableListener()
  3266. // }, 1000);
  3267. // }
  3268. }
  3269. },
  3270. addUpload(data) {
  3271. // var zhi = data.fileName.split('.')[0]
  3272. // var sss = zhi + '.xlsx'
  3273. // return
  3274. var filePath = '/upload/' + data.serverName;
  3275. const a = document.createElement('a'); // 创建a标签
  3276. a.setAttribute('download', data.fileName);// download属性
  3277. a.setAttribute('href', filePath);// href链接
  3278. a.click(); //自执行点击事件
  3279. a.remove();
  3280. },
  3281. restrictNumber(targetId) {
  3282. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3283. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3284. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3285. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3286. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3287. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3288. inpu.value = parseFloat(inpu.value);
  3289. }
  3290. },
  3291. //获取项目下的任务分组
  3292. getTaskGroups(domain, index) {
  3293. domain.groupId=null;
  3294. this.http.post('/task-group/listMyJoinGroup',{
  3295. projectId: domain.projectId,
  3296. isSubstitude: this.isSubstitude ? 1 : 0
  3297. },
  3298. res => {
  3299. if (res.code == "ok") {
  3300. this.workForm.domains[index].taskGroups = res.data;
  3301. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3302. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3303. // this.getGroupStages(domain, index);
  3304. // }
  3305. this.$forceUpdate();
  3306. }
  3307. },
  3308. error => {
  3309. this.$message({
  3310. message: error,
  3311. type: "error"
  3312. });
  3313. }
  3314. );
  3315. },
  3316. //下载填报工时占比报表
  3317. downloadProjectRatio() {
  3318. this.exportUserRatio = true;
  3319. // let now = new Date();
  3320. // let month = now.getMonth();//默认看上个月的
  3321. // let monthStr = month<10? ('0'+month): month;
  3322. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3323. const today = new Date();
  3324. const year = today.getFullYear();
  3325. const month = today.getMonth() + 1;
  3326. let lastMonthYear, lastMonth;
  3327. if (month === 1) {
  3328. lastMonthYear = year - 1;
  3329. lastMonth = 12;
  3330. } else {
  3331. lastMonthYear = year;
  3332. lastMonth = month - 1;
  3333. }
  3334. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3335. console.log('赋值 ==>', this.ratioYmonth)
  3336. },
  3337. confirmDownloadRatio() {
  3338. this.startRatioExporting = true;
  3339. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3340. ymonth: this.ratioYmonth
  3341. },
  3342. res => {
  3343. if (res.code == "ok") {
  3344. this.startRatioExporting = false;
  3345. var filePath = res.data;
  3346. const a = document.createElement('a'); // 创建a标签
  3347. var data = filePath.split("/");
  3348. a.setAttribute('download', data[data.length-1]);// download属性
  3349. a.setAttribute('href', filePath);// href链接
  3350. a.click(); //自执行点击事件
  3351. a.remove();
  3352. } else {
  3353. this.startRatioExporting = false;
  3354. this.$message({
  3355. message: res.msg,
  3356. type: "error"
  3357. });
  3358. }
  3359. },
  3360. error => {
  3361. this.checkinLoading = false;
  3362. this.$message({
  3363. message: error,
  3364. type: "error"
  3365. });
  3366. }
  3367. );
  3368. },
  3369. //下载带企业微信考勤数据的工时统计模板
  3370. downloadCheckInExcel() {
  3371. var param = {
  3372. startDate: this.importWxParam.date[0],
  3373. endDate: this.importWxParam.date[1],
  3374. };
  3375. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3376. param.onlySelfData = false;
  3377. }
  3378. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3379. res => {
  3380. if (res.code == "ok") {
  3381. var filePath = res.data;
  3382. const a = document.createElement('a'); // 创建a标签
  3383. var data = filePath.split("/");
  3384. a.setAttribute('download', data[data.length-1]);// download属性
  3385. a.setAttribute('href', filePath);// href链接
  3386. a.click(); //自执行点击事件
  3387. a.remove();
  3388. } else {
  3389. this.$message({
  3390. message: res.msg,
  3391. type: "error"
  3392. });
  3393. }
  3394. },
  3395. error => {
  3396. this.checkinLoading = false;
  3397. this.$message({
  3398. message: error,
  3399. type: "error"
  3400. });
  3401. }
  3402. );
  3403. },
  3404. pre() {
  3405. if (this.active == 0) return;
  3406. this.active--;
  3407. },
  3408. next() {
  3409. this.active++;
  3410. },
  3411. triggerTotalTime(index) {
  3412. var item = this.checkinList[index];
  3413. var total = 0.0;
  3414. for (var i=0;i<this.projectColumns.length; i++) {
  3415. var key = this.projectColumns[i];
  3416. if (item[key] != null && item[key] != '') {
  3417. total += parseFloat(item[key]);
  3418. }
  3419. }
  3420. item.totalFillTime = total;
  3421. },
  3422. //提交批量代填的数据
  3423. submitBatchSubFillData() {
  3424. var data = JSON.stringify(this.checkinList);
  3425. this.http.post('/user-corpwx-time/submitProjectTime',{
  3426. json: data,
  3427. projectColumns: JSON.stringify(this.projectColumns)
  3428. },
  3429. res => {
  3430. if (res.code == "ok") {
  3431. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3432. this.importWxDialog = false;
  3433. }
  3434. },
  3435. error => {
  3436. this.checkinLoading = false;
  3437. this.$message({
  3438. message: error,
  3439. type: "error"
  3440. });
  3441. }
  3442. );
  3443. },
  3444. loadCheckInData() {
  3445. if (this.importWxParam.date == null) {
  3446. this.checkinList = [];
  3447. return;
  3448. }
  3449. this.checkinLoading = true;
  3450. this.http.post('/user-corpwx-time/getMyData',{
  3451. startDate: this.importWxParam.date[0],
  3452. endDate: this.importWxParam.date[1],
  3453. },
  3454. res => {
  3455. if (res.code == "ok") {
  3456. this.checkinLoading = false;
  3457. this.checkinList = res.data.list;
  3458. this.projectColumns = res.data.projects;
  3459. // 自定义表格会导致表格错乱,需重新计算表格
  3460. this.$nextTick(()=>{
  3461. this.$refs.tab.doLayout()
  3462. })
  3463. }
  3464. },
  3465. error => {
  3466. this.checkinLoading = false;
  3467. this.$message({
  3468. message: error,
  3469. type: "error"
  3470. });
  3471. }
  3472. );
  3473. },
  3474. importCardTime(item) {
  3475. //首先判断文件类型
  3476. let str = item.file.name.split(".");
  3477. let format = str[str.length - 1];
  3478. if (format != "xls" && format != "xlsx") {
  3479. this.$message({
  3480. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3481. type: "error"
  3482. });
  3483. } else {
  3484. this.importingData = true;
  3485. let formData = new FormData();
  3486. formData.append("multipartFile", item.file);
  3487. formData.append("companyId", this.user.companyId);
  3488. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3489. res => {
  3490. this.$refs.uploadCardTime.clearFiles();
  3491. this.importingData = false;
  3492. if (res.code == "ok") {
  3493. //换成弹出框,以免有人等了半天回来啥也没看到
  3494. this.$message({
  3495. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3496. type: "success"
  3497. });
  3498. } else {
  3499. this.$message({
  3500. message: res.msg,
  3501. type: "error"
  3502. });
  3503. }
  3504. },
  3505. error => {
  3506. this.$refs.upload.clearFiles();
  3507. this.listLoading = false;
  3508. this.$message({
  3509. message: error,
  3510. type: "error"
  3511. });
  3512. });
  3513. }
  3514. },
  3515. batchImportWxData(item) {
  3516. //首先判断文件类型
  3517. let str = item.file.name.split(".");
  3518. let format = str[str.length - 1];
  3519. if (format != "xls" && format != "xlsx") {
  3520. this.$message({
  3521. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3522. type: "error"
  3523. });
  3524. } else {
  3525. this.importingData = true;
  3526. let formData = new FormData();
  3527. formData.append("file", item.file);
  3528. formData.append("companyId", this.user.companyId);
  3529. formData.append("withCheckIn", 1);
  3530. this.http.uploadFile('/report/importData', formData,
  3531. res => {
  3532. this.$refs.upload.clearFiles();
  3533. this.showImportResult = true;
  3534. this.importingData = false;
  3535. if (res.code == "ok") {
  3536. //换成弹出框,以免有人等了半天回来啥也没看到
  3537. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3538. this.getReportList();
  3539. this.importWxDialog = false;
  3540. } else {
  3541. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3542. }
  3543. },
  3544. error => {
  3545. this.$refs.upload.clearFiles();
  3546. this.listLoading = false;
  3547. this.$message({
  3548. message: error,
  3549. type: "error"
  3550. });
  3551. });
  3552. }
  3553. },
  3554. batchImportData(item) {
  3555. //首先判断文件类型
  3556. let str = item.file.name.split(".");
  3557. let format = str[str.length - 1];
  3558. if (format != "xls" && format != "xlsx") {
  3559. this.$message({
  3560. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3561. type: "error"
  3562. });
  3563. } else {
  3564. this.importingData = true;
  3565. let formData = new FormData();
  3566. formData.append("file", item.file);
  3567. formData.append("companyId", this.user.companyId);
  3568. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3569. this.http.uploadFile(url, formData,
  3570. res => {
  3571. this.$refs.upload.clearFiles();
  3572. this.importingData = false;
  3573. this.showImportResult = true;
  3574. if (res.code == "ok") {
  3575. //换成弹出框,以免有人等了半天回来啥也没看到
  3576. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3577. this.getReportList();
  3578. this.importWXDialog = false;
  3579. } else {
  3580. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3581. }
  3582. },
  3583. error => {
  3584. this.$refs.upload.clearFiles();
  3585. this.importingData = false;
  3586. this.$message({
  3587. message: error,
  3588. type: "error"
  3589. });
  3590. });
  3591. }
  3592. },
  3593. userssHu() {
  3594. this.http.post('/time-type/getCompanyTimeSetting',{
  3595. companyId: this.user.companyId
  3596. },
  3597. res => {
  3598. if (res.code == "ok") {
  3599. this.yonghuUser = res.data
  3600. }
  3601. },
  3602. error => {
  3603. this.$message({
  3604. message: error,
  3605. type: "error"
  3606. });
  3607. }
  3608. );
  3609. },
  3610. iptBlur(i) {
  3611. if(this.isBatch == 0) {
  3612. return
  3613. }
  3614. var reqParam = {
  3615. startDate: this.workForm.createDate[0],
  3616. endDate: this.workForm.createDate[1]
  3617. };
  3618. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3619. reqParam.userId = this.workForm.userId[0];
  3620. }
  3621. this.http.post('/report/getWorkDays',reqParam,
  3622. res => {
  3623. if (res.code == "ok") {
  3624. this.jsDay = res.data
  3625. this.chuji(i)
  3626. } else {
  3627. this.$message({
  3628. message: res.msg,
  3629. type: "error"
  3630. });
  3631. }
  3632. },
  3633. error => {
  3634. this.$message({
  3635. message: error,
  3636. type: "error"
  3637. });
  3638. }
  3639. );
  3640. //明夷硬编码获取
  3641. if (this.user.company.companyName == this.mingyiName) {
  3642. this.getWorkTimeForMinYi();
  3643. }
  3644. },
  3645. getWorkTimeForMinYi(){
  3646. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3647. startDate: this.workForm.createDate[0],
  3648. endDate: this.workForm.createDate[1]
  3649. },
  3650. res => {
  3651. if (res.code == "ok") {
  3652. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3653. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3654. this.totalReportHours = this.workTimeForMinYi;
  3655. } else {
  3656. this.$message({
  3657. message: res.msg,
  3658. type: "error"
  3659. });
  3660. this.workForm.createDate = [];
  3661. }
  3662. },
  3663. error => {
  3664. this.$message({
  3665. message: error,
  3666. type: "error"
  3667. });
  3668. }
  3669. );
  3670. },
  3671. chuji(i) {
  3672. if(i == 0) {
  3673. this.seleChn(1)
  3674. } else if(i == 1) {
  3675. this.seleChn(0)
  3676. } else if(i == 2) {
  3677. if(this.workForm.domains[0].multiWorktime > 0) {
  3678. this.iptChangs()
  3679. } else {
  3680. this.iptChang()
  3681. }
  3682. } else if(i == 3) {
  3683. this.seleChn(0)
  3684. }
  3685. },
  3686. seleChn(e,domain) {
  3687. if(e == 1) {
  3688. for(var i in this.workForm.domains) {
  3689. if(this.workForm.domains[i].timeType == 0) {
  3690. this.workForm.domains[i].workingTime = 8
  3691. } else {
  3692. this.workForm.domains[i].workingTime = 4
  3693. }
  3694. }
  3695. }
  3696. var quanbu = 0
  3697. var spl = this.workForm.domains
  3698. var zhi = ''
  3699. for(var i in spl) {
  3700. var sp = +spl[i].workingTime + 0
  3701. zhi = this.jsDay * sp
  3702. quanbu = +quanbu + zhi
  3703. }
  3704. this.jsTime = quanbu
  3705. this.totalReportHours = quanbu
  3706. let worktime = this.jsTime
  3707. // 自动计算加班时长
  3708. if(this.isBatch != 0){
  3709. worktime = this.jsTime / this.jsDay
  3710. }
  3711. if(this.user.timeType.fillOvertime && domain){
  3712. let isover = false
  3713. let alltime = 0
  3714. let allover = 0 //此处alltime同上面的worktime
  3715. for(let d in spl){
  3716. if(spl[d].isOvertime){
  3717. isover = true
  3718. allover += spl[d].overtimeHours*1
  3719. }
  3720. alltime += spl[d].workingTime*1
  3721. }
  3722. if(domain.overtimeHours){
  3723. allover = allover - domain.overtimeHours
  3724. }
  3725. if(worktime*1 > this.user.timeType.allday){
  3726. if(isover){
  3727. if(alltime > (allover + this.user.timeType.allday)){
  3728. this.$set(domain,'isOvertime',true)
  3729. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3730. }else{
  3731. this.$set(domain,'isOvertime',false)
  3732. this.$set(domain,'overtimeHours',null)
  3733. if(alltime < (allover + this.user.timeType.allday)){
  3734. let overtime = allover + this.user.timeType.allday - alltime
  3735. for(let pi in spl){
  3736. if(spl[pi].overtimeHours){
  3737. if((overtime - spl[pi].overtimeHours*1) > 0){
  3738. overtime = overtime - spl[pi].overtimeHours*1
  3739. this.$set(spl[pi],'isOvertime',false)
  3740. this.$set(spl[pi],'overtimeHours',null)
  3741. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3742. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3743. break
  3744. }else{
  3745. this.$set(spl[pi],'isOvertime',false)
  3746. this.$set(spl[pi],'overtimeHours',null)
  3747. break
  3748. }
  3749. }
  3750. }
  3751. }
  3752. }
  3753. }else{
  3754. this.$set(domain,'isOvertime',true)
  3755. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3756. }
  3757. }else{
  3758. for(let di in spl){
  3759. this.$set(spl[di],'isOvertime',false)
  3760. this.$set(spl[di],'overtimeHours',null)
  3761. }
  3762. }
  3763. }
  3764. },
  3765. iptChang() {
  3766. var sl = this.workForm.domains
  3767. let timeArr = []
  3768. for(var i in sl) {
  3769. if(sl[i].startTime && sl[i].endTime) {
  3770. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3771. }
  3772. }
  3773. this.getTimeHours(timeArr)
  3774. // for(let j in arrNum) {
  3775. // this.timeJsonStr += arrNum[j]
  3776. // if(flg) {
  3777. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3778. // this.$set(this.workForm.domains[j],'overtimeHours', this.timeJsonStr / this.jsDay)
  3779. // }
  3780. // if(this.timeJsonStr > (this.user.timeType.allday * this.jsDay) && !flg) {
  3781. // flg = true
  3782. // this.$set(this.workForm.domains[j],'isOvertime', true)
  3783. // this.$set(this.workForm.domains[j],'overtimeHours', (this.timeJsonStr - (this.user.timeType.allday * this.jsDay)) / this.jsDay)
  3784. // // this.$set(this.workForm.domains[j],'overtimeHours', zhizhang / this.jsDay)
  3785. // }
  3786. // if(this.timeJsonStr < (this.user.timeType.allday * this.jsDay) && !flg) {
  3787. // this.$set(this.workForm.domains[j],'isOvertime', false)
  3788. // this.$set(this.workForm.domains[j],'overtimeHours', '')
  3789. // }
  3790. // }
  3791. },
  3792. iptChangs() {
  3793. var sl = this.workForm.domains
  3794. let timeArr = []
  3795. for(var i in sl) {
  3796. for(var j in sl[i].worktimeList){
  3797. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3798. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3799. }
  3800. }
  3801. }
  3802. this.getTimeHours(timeArr)
  3803. },
  3804. // 调用接口或去数据
  3805. getTimeHours(arr) {
  3806. this.http.post('/report/getHoursByTimeRange',{
  3807. timeJsonStr: JSON.stringify(arr)
  3808. },res => {
  3809. if(res.code === 'ok') {
  3810. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3811. } else {
  3812. this.$message({
  3813. message: res.msg,
  3814. type: 'error'
  3815. })
  3816. }
  3817. },err => {
  3818. this.$message({
  3819. message: err,
  3820. type: 'error'
  3821. })
  3822. })
  3823. },
  3824. // 按周填报调用接口计算时间
  3825. async getWeekHoursByTimeRange(timeRange) {
  3826. const url = '/report/getHoursByTimeRange';
  3827. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3828. var that = this;
  3829. return new Promise((resolve, reject) => {
  3830. this.http.post(url, data, function(res) {
  3831. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3832. }, function(err) {
  3833. reject(err);
  3834. });
  3835. });
  3836. },
  3837. removeTimeItem(item, index) {
  3838. item.worktimeList.splice(index, 1);
  3839. this.iptChangs()
  3840. },
  3841. //添加工时
  3842. addNewWorktime(index, item) {
  3843. if(item.worktimeList == null ) {
  3844. item.worktimeList = []
  3845. }
  3846. item.worktimeList.push({});
  3847. },
  3848. //复制项目
  3849. copyProject(index) {
  3850. var leftProgress = 10;
  3851. if (this.reportTimeType.type == 3) {
  3852. //计算已经待分配工时比例
  3853. let array = this.workForm.domains;
  3854. let totalProgress = 0;
  3855. for (var i=0;i<array.length; i++) {
  3856. totalProgress += array[i].progress;
  3857. }
  3858. if (totalProgress < 100) {
  3859. leftProgress = 100 - totalProgress;
  3860. }
  3861. }
  3862. var newIndex = index+1;
  3863. var itemDomain = {
  3864. projectId: this.workForm.domains[index].projectId,
  3865. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3866. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3867. ),
  3868. content: "",
  3869. progress:leftProgress,
  3870. state:2,//2-表示待提交
  3871. };
  3872. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3873. if (this.reportTimeType.type == 0) {
  3874. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3875. var length = this.workForm.domains.length;
  3876. if (length == 2) {
  3877. this.showAddMore = false;
  3878. }
  3879. }
  3880. this.selectProject(itemDomain, newIndex);
  3881. },
  3882. pushWorkTime(reportId){
  3883. let url=''
  3884. if(this.user.timeType.syncSap == 1){
  3885. url='/report/pushProjectReportToSap'
  3886. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3887. var pushDate = this.date + day;
  3888. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3889. confirmButtonText: this.$t('btn.determine'),
  3890. cancelButtonText: this.$t('btn.cancel'),
  3891. type: 'info'
  3892. }).then(() => {
  3893. const loading = this.$loading({
  3894. lock: true,
  3895. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3896. spinner: 'el-icon-loading',
  3897. background: 'rgba(0, 0, 0, 0.7)'
  3898. });
  3899. this.http.post(url,{
  3900. pushDate: pushDate,
  3901. reportId: reportId
  3902. },res => {
  3903. loading.close();
  3904. if(res.code == 'ok'){
  3905. this.$message({
  3906. type: 'success',
  3907. message: res.data
  3908. });
  3909. }else{
  3910. this.$message({
  3911. type: 'error',
  3912. message: res.msg
  3913. })
  3914. }
  3915. },err => {
  3916. loading.close();
  3917. this.$message({
  3918. type: 'error',
  3919. message: err
  3920. })
  3921. })
  3922. }).catch(() => {
  3923. });
  3924. }else{
  3925. url='/report/pushReportDataToThird'
  3926. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  3927. confirmButtonText: this.$t('btn.determine'),
  3928. cancelButtonText: this.$t('btn.cancel'),
  3929. type: 'info'
  3930. }).then(() => {
  3931. const loading = this.$loading({
  3932. lock: true,
  3933. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3934. spinner: 'el-icon-loading',
  3935. background: 'rgba(0, 0, 0, 0.7)'
  3936. });
  3937. this.http.post(url,{
  3938. yearMonth: this.date
  3939. },res => {
  3940. loading.close();
  3941. if(res.code == 'ok'){
  3942. this.$message({
  3943. type: 'success',
  3944. message: this.$t('tuiSongChengGong')
  3945. });
  3946. }else{
  3947. this.$message({
  3948. type: 'error',
  3949. message: res.msg
  3950. })
  3951. }
  3952. },err => {
  3953. loading.close();
  3954. this.$message({
  3955. type: 'error',
  3956. message: err
  3957. })
  3958. })
  3959. }).catch(() => {
  3960. });
  3961. }
  3962. },
  3963. showWorkTime(){
  3964. this.monthWorkTimeDialog = true;
  3965. this.searchKeyword = ''
  3966. this.WorktimeDatepickValue = this.istoMonth()
  3967. if(this.WorktimeDatepickValue.length == 0){
  3968. let newdate = new Date();
  3969. let nowdate = newdate.toLocaleDateString();
  3970. let getauto = this.getAutoWeekDate(nowdate)
  3971. let nowwd = [getauto[0],getauto[6]]
  3972. this.WorktimeDatepickValue = nowwd
  3973. }
  3974. this.showMonthWorkTime()
  3975. },
  3976. handleClick(t,e){
  3977. if (t.name == "second") {
  3978. this.showMonthNotWorkTime()
  3979. }else if(t.name == "first"){
  3980. this.showMonthWorkTime()
  3981. }else if(t.name == "third"){
  3982. this.showMonthWorkTimeReminder()
  3983. } else if (t.name == "fourth") {
  3984. this.showReportTimeLessThanCardTimeList();
  3985. }
  3986. },
  3987. //导出员工每日填报工时数
  3988. exportMembWorkHours() {
  3989. this.http.post(
  3990. "/report/exportUserDailyWorkTime",
  3991. {
  3992. // month: this.date,
  3993. startDate: this.WorktimeDatepickValue[0],
  3994. endDate: this.WorktimeDatepickValue[1],
  3995. },
  3996. (res) => {
  3997. if (res.code == "ok") {
  3998. let url = res.data;
  3999. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4000. }
  4001. },
  4002. (error) => {
  4003. this.$message({
  4004. message: error,
  4005. type: "error",
  4006. });
  4007. }
  4008. );
  4009. },
  4010. exportMembWorkHoursReminder() {
  4011. this.http.post(
  4012. "/report/exportUserDailyWorkTimeReminder",
  4013. {
  4014. // month: this.date,
  4015. startDate: this.WorktimeDatepickValue[0],
  4016. endDate: this.WorktimeDatepickValue[1],
  4017. },
  4018. (res) => {
  4019. if (res.code == "ok") {
  4020. let url = res.data;
  4021. this.downloadByA('工时异常表.xlsx', url);
  4022. }
  4023. },
  4024. (error) => {
  4025. this.$message({
  4026. message: error,
  4027. type: "error",
  4028. });
  4029. }
  4030. );
  4031. },
  4032. exportMembNotWorkHours() {
  4033. this.http.post(
  4034. "/report/exportNoReportUserList",
  4035. {
  4036. // month: this.date,
  4037. startDate: this.WorktimeDatepickValue[0],
  4038. endDate: this.WorktimeDatepickValue[1],
  4039. },
  4040. (res) => {
  4041. if (res.code == "ok") {
  4042. let url = res.data;
  4043. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4044. }
  4045. },
  4046. (error) => {
  4047. this.$message({
  4048. message: error,
  4049. type: "error",
  4050. });
  4051. }
  4052. );
  4053. },
  4054. downloadByA(name, url) {
  4055. const a = document.createElement("a"); // 创建a标签
  4056. a.setAttribute("download", name); // download属性
  4057. a.setAttribute("href", url); // href链接
  4058. a.click(); // 自执行点击事件
  4059. a.remove();
  4060. },
  4061. // 是否本月判断
  4062. istoMonth(){
  4063. let todate = new Date()
  4064. let tomonth = todate.getMonth() + 1
  4065. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4066. if(this.date == adate){
  4067. return []
  4068. }else{
  4069. let sedate = new Date(this.date)
  4070. let semonth = sedate.getMonth() + 1
  4071. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4072. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4073. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4074. return [sedates1, sedates2]
  4075. }
  4076. },
  4077. showMonthWorkTime() {
  4078. this.monthTotalPage = 0,
  4079. this.tbload = true
  4080. let parameter={
  4081. startDate: this.WorktimeDatepickValue[0],
  4082. endDate: this.WorktimeDatepickValue[1],
  4083. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4084. }
  4085. this.http.post(
  4086. "/report/getUserDailyWorkTime",
  4087. // "/report/getNoReportUserList",
  4088. parameter,
  4089. (res) => {
  4090. if (res.code == "ok") {
  4091. this.tbload = false;
  4092. this.pickDateArray = res.data.days.map(item => {
  4093. return {
  4094. ...item,
  4095. dateStr: item.label.split('/')[0],
  4096. weekStr: item.label.split('/')[1]
  4097. }
  4098. });
  4099. // console.log('dataarray',res.data.days);
  4100. this.monthWorkData = res.data.list;
  4101. // this.monthWorkDataS = this.monthWorkData
  4102. // this.monthWorkDataS1 = res.data.list
  4103. this.monthTotal = res.data.list.length
  4104. if (this.monthWorkData.length > 50) {
  4105. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4106. }else{
  4107. this.monthWorkDataS = this.monthWorkData
  4108. }
  4109. this.searchScreen(0)
  4110. // this.monthWorkDataS = infoList
  4111. // 判断
  4112. // if (this.monthWorkDataS1.length > 0) {
  4113. // setTimeout(() => {
  4114. // this.tableListener()
  4115. // }, 1000);
  4116. // }
  4117. this.$nextTick(function(){
  4118. this.$refs.hasworkTbl.doLayout();
  4119. });
  4120. // this.$forceUpdate()
  4121. }
  4122. },
  4123. (error) => {
  4124. this.tbload = false
  4125. this.$message({
  4126. message: error,
  4127. type: "error",
  4128. });
  4129. }
  4130. );
  4131. },
  4132. showMonthWorkTimeReminder() {
  4133. this.monthTotalPage = 0,
  4134. this.tbload = true
  4135. let parameter={}
  4136. parameter={
  4137. startDate: this.WorktimeDatepickValue[0],
  4138. endDate: this.WorktimeDatepickValue[1],
  4139. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4140. viewValue:this.isReminder?1:0
  4141. }
  4142. this.http.post(
  4143. "/report/getUserDailyWorkTimeReminder",
  4144. parameter,
  4145. (res) => {
  4146. if (res.code == "ok") {
  4147. this.tbload = false;
  4148. this.monthWorkData = res.data.list;
  4149. this.monthTotal = res.data.list.length
  4150. if (this.monthWorkData.length > 50) {
  4151. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4152. }else{
  4153. this.monthWorkDataS = this.monthWorkData
  4154. }
  4155. this.searchScreen(0)
  4156. this.$nextTick(function(){
  4157. this.$refs.hasworkTbl.doLayout();
  4158. });
  4159. }
  4160. },
  4161. (error) => {
  4162. this.tbload = false
  4163. this.$message({
  4164. message: error,
  4165. type: "error",
  4166. });
  4167. }
  4168. );
  4169. },
  4170. // tableListener(){
  4171. // let that = this;
  4172. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  4173. // // 添加scroll监听事件
  4174. // dom.addEventListener("scroll", function () {
  4175. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4176. // if (scrollDistance < 2) {
  4177. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  4178. // that.monthTotalPage++; //当前页数自增
  4179. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  4180. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  4181. // var infoList = arrList.splice(
  4182. // that.monthTotalPage * that.monthTotalLages,
  4183. // that.monthTotalLages
  4184. // );
  4185. // // 数据添加
  4186. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  4187. // }
  4188. // }
  4189. // })
  4190. // },
  4191. showMonthNotWorkTime() {
  4192. this.monthTotalPage = 0,
  4193. this.tbload = true,
  4194. this.http.post(
  4195. "/report/getNoReportUserList",
  4196. {
  4197. startDate: this.WorktimeDatepickValue[0],
  4198. endDate: this.WorktimeDatepickValue[1],
  4199. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
  4200. },
  4201. (res) => {
  4202. if (res.code == "ok") {
  4203. this.tbload = false
  4204. this.monthNotWorkDate = res.data;
  4205. // this.monthNotWorkDateS1 = res.data
  4206. this.monthnotTotal = res.data.length
  4207. // 2222111
  4208. if (this.monthNotWorkDate.length > 50) {
  4209. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4210. } else {
  4211. this.monthNotWorkDateS = this.monthNotWorkDate
  4212. }
  4213. this.searchScreen(1)
  4214. // 判断
  4215. // if (this.monthnotworkDateS1.length > 0) {
  4216. // setTimeout(() => {
  4217. // this.tableListenernot()
  4218. // }, 1000);
  4219. // }
  4220. this.$nextTick(function(){
  4221. this.$refs.hasworkTbl2.doLayout();
  4222. });
  4223. }
  4224. },
  4225. (error) => {
  4226. this.tbload = false
  4227. this.$message({
  4228. message: error,
  4229. type: "error",
  4230. });
  4231. }
  4232. );
  4233. },
  4234. // tableListenernot(){
  4235. // let that = this;
  4236. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  4237. // dom.addEventListener("scroll", function () {
  4238. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  4239. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  4240. // if (scrollDistance2 < 2) {
  4241. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  4242. // that.monthnotTotalPage++; //当前页数自增
  4243. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  4244. // var infoList = arrList.splice(
  4245. // that.monthnotTotalPage * that.monthnotTotalLages,
  4246. // that.monthnotTotalLages
  4247. // );
  4248. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  4249. // }
  4250. // }
  4251. // })
  4252. // },
  4253. listScroll(){
  4254. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4255. this.isMore = true
  4256. setTimeout(()=>{
  4257. this.isMore = false
  4258. },1000)
  4259. }else {
  4260. this.isFlag = true
  4261. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4262. this.monthWorkDataS = datalist
  4263. setTimeout(()=>{
  4264. this.isFlag = false
  4265. },300)
  4266. }
  4267. },
  4268. notListScroll(){
  4269. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4270. this.isMore = true
  4271. setTimeout(()=>{
  4272. this.isMore = false
  4273. },1000)
  4274. }else {
  4275. this.isFlag = true
  4276. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4277. this.monthNotWorkDateS = datalist
  4278. // console.log('length',this.monthNotWorkDateS.length)
  4279. setTimeout(()=>{
  4280. this.isFlag = false
  4281. },300)
  4282. }
  4283. },
  4284. getFirstAndLastDay() {
  4285. // 将选定的月份转换为Date对象
  4286. var monthDate = new Date();
  4287. var year = monthDate.getFullYear();
  4288. var month = monthDate.getMonth();
  4289. // 计算起始日和结束日
  4290. var startDay = new Date(year, month, 1);
  4291. var endDay = new Date(year, month + 1, 0);
  4292. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4293. this.WorktimeDatepickValueForMonth=lastmd
  4294. },
  4295. formatDate(date) {
  4296. var year = date.getFullYear();
  4297. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4298. var day = ("0" + date.getDate()).slice(-2);
  4299. return year + "-" + month + "-" + day;
  4300. },
  4301. // 获取默认这zhou日期参数 222
  4302. getLastWeek(e){
  4303. let newdate = new Date()
  4304. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4305. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4306. if(e==1){
  4307. this.WorktimeDatepickValue = lastwd
  4308. this.showMonthWorkTime()
  4309. }else if(e==2){
  4310. this.WorktimeDatepickValue = lastwd
  4311. this.showMonthWorkTimeReminder()
  4312. }else{
  4313. this.WorktimeDatepickValue = lastwd
  4314. this.showMonthNotWorkTime()
  4315. }
  4316. },
  4317. getThisWeek(e){
  4318. let newdate = new Date();
  4319. let nowdate = newdate.toLocaleDateString();
  4320. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4321. if(e==1){
  4322. this.WorktimeDatepickValue = nowwd
  4323. this.showMonthWorkTime()
  4324. }else if(e==2){
  4325. this.WorktimeDatepickValue = nowwd
  4326. this.showMonthWorkTimeReminder()
  4327. }else{
  4328. this.WorktimeDatepickValue = nowwd
  4329. this.showMonthNotWorkTime()
  4330. }
  4331. },
  4332. getDoubleLastWeek(e){
  4333. let newdate = new Date()
  4334. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4335. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4336. if(e==1){
  4337. this.WorktimeDatepickValue = nextwd
  4338. this.showMonthWorkTime()
  4339. }else if(e==2){
  4340. this.WorktimeDatepickValue = nextwd
  4341. this.showMonthWorkTimeReminder()
  4342. }else{
  4343. this.WorktimeDatepickValue = nextwd
  4344. this.showMonthNotWorkTime()
  4345. }
  4346. },
  4347. alreadyAllDate(stime,etime){
  4348. let diffdate = new Array();
  4349. let i=0;
  4350. while(stime<=etime){
  4351. let dateArray = stime.split("-");
  4352. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4353. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4354. let stimewk = this.weekDay[date.getDay()]
  4355. 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')
  4356. 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])
  4357. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4358. let stime_ts = new Date(stime).getTime();
  4359. let next_date = stime_ts + (24*60*60*1000);
  4360. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4361. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4362. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4363. stime = next_dates_y+next_dates_m+next_dates_d;
  4364. i++;
  4365. }
  4366. return diffdate
  4367. },
  4368. getAutoWeekDate(e) {
  4369. let dateString = e;
  4370. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4371. if (dateString.match(dateStringReg)) {
  4372. let presentDate = new Date(dateString),
  4373. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4374. return Array.from(new Array(7), function (val, index) {
  4375. let formatDate = new Date(
  4376. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4377. );
  4378. return (
  4379. formatDate.getFullYear() +
  4380. "-" +
  4381. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4382. "-" +
  4383. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4384. );
  4385. });
  4386. } else {
  4387. throw new Error(
  4388. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4389. );
  4390. }
  4391. },
  4392. onProgressChange() {
  4393. this.$forceUpdate();
  4394. },
  4395. showChooseMembTree() {
  4396. this.chosenMembCount = this.participator.length;
  4397. this.chooseParticipVisible = true;
  4398. },
  4399. onTreeItemChange() {
  4400. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4401. var list = chosenList.filter(item=>item.isUser == 1);
  4402. this.chosenMembCount = list.length;
  4403. },
  4404. findUserInTree() {
  4405. if (this.filterName == '') {
  4406. this.deptMembData = this.allMembData;
  4407. } else {
  4408. var list = this.findRecursively(this.filterName, this.allMembData);
  4409. this.deptMembData = list;
  4410. }
  4411. },
  4412. findRecursively(username, list) {
  4413. var filterList = [];
  4414. for (var i=0;i<list.length; i++) {
  4415. if (list[i].isUser == 1) {
  4416. if (list[i].label.indexOf(username) >= 0) {
  4417. //匹配上了
  4418. filterList.push(list[i]);
  4419. }
  4420. } else if (list[i].children != null && list[i].children.length > 0) {
  4421. var subList = this.findRecursively(username, list[i].children);
  4422. if (subList.length > 0) {
  4423. subList.forEach(s=>filterList.push(s));
  4424. }
  4425. }
  4426. }
  4427. return filterList;
  4428. },
  4429. //确定选择参与人
  4430. chooseParticip() {
  4431. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4432. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4433. //只能选择一个人进行代填,防止任务有问题
  4434. if (this.chosenMembList.length > 1) {
  4435. this.$message({
  4436. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4437. type: "error",
  4438. });
  4439. return;
  4440. }
  4441. this.chooseParticipVisible = false;
  4442. this.workForm.userNames = '';
  4443. this.workForm.userId = [];
  4444. this.participator = [];
  4445. for (var i=0;i<this.chosenMembList.length; i++) {
  4446. this.workForm.userId.push(this.chosenMembList[i].id);
  4447. this.workForm.userNames += this.chosenMembList[i].label+',';
  4448. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4449. this.participator.push(item);
  4450. }
  4451. if (this.workForm.userNames.length > 0) {
  4452. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4453. }
  4454. if(this.user.userNameNeedTranslate == 1) {
  4455. if(this.workForm.userNames) {
  4456. this.workForm.userNames = this.workForm.userNames.split(',')
  4457. }
  4458. }
  4459. //加载该人员的可填报项目
  4460. if (this.workForm.userId.length > 0) {
  4461. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4462. }
  4463. },
  4464. notifySel(sel){
  4465. // console.log(sel);
  4466. this.notifySelList = sel
  4467. },
  4468. //微信通知人员填写
  4469. Notify(code) {
  4470. if (this.notifySelList.length == 0) return;
  4471. var ids = '';
  4472. this.notifySelList.forEach(f=>{
  4473. ids += f.id+',';
  4474. })
  4475. this.http.post('/user/pushFillReport',{
  4476. ids: ids, date: this.curDate,
  4477. code: code
  4478. },
  4479. res => {
  4480. if (res.code == "ok") {
  4481. this.$message({
  4482. message: this.$t('message.sentSuccessfully'),
  4483. type: "success"
  4484. });
  4485. }
  4486. },
  4487. error => {
  4488. this.$message({
  4489. message: error,
  4490. type: "error"
  4491. });
  4492. }
  4493. );
  4494. },
  4495. //导出人员列表
  4496. exportMemb() {
  4497. if (this.fillMembList.length == 0) return;
  4498. var ids = '';
  4499. this.fillMembList.forEach(f=>{
  4500. ids += f.id+',';
  4501. })
  4502. this.http.post('/user/exportMembList',{
  4503. ids: ids,isFill: this.isFill, date: this.curDate
  4504. },
  4505. res => {
  4506. if (res.code == "ok") {
  4507. var aTag = document.createElement('a');
  4508. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4509. aTag.href = res.data;
  4510. aTag.click();
  4511. }
  4512. },
  4513. error => {
  4514. this.$message({
  4515. message: error,
  4516. type: "error"
  4517. });
  4518. }
  4519. );
  4520. },
  4521. showMembList(fill) {
  4522. this.membListVisible = true;
  4523. if (fill == 0) {
  4524. this.fillMembList = this.unFillList;
  4525. this.isFill = false;
  4526. let leaveList = []
  4527. let unleaveList = []
  4528. for(let i in this.fillMembList){
  4529. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4530. leaveList.push(this.fillMembList[i])
  4531. }else{
  4532. unleaveList.push(this.fillMembList[i])
  4533. }
  4534. }
  4535. this.fillMembList = unleaveList
  4536. this.fillMembList_leave = leaveList
  4537. } else if(fill == 1){
  4538. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4539. this.isFill = true;
  4540. }else{
  4541. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4542. this.isFill = true;
  4543. }
  4544. },
  4545. //获取自己填写的日报状态
  4546. getReportFillStatus() {
  4547. this.http.post('/report/getReportFillStatus',{
  4548. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4549. },
  4550. res => {
  4551. if (res.code == "ok") {
  4552. this.fillStatusList = res.data;
  4553. this.allDate.forEach(d=>{
  4554. var fillInfo = null;
  4555. d.state = null;
  4556. this.fillStatusList.forEach(s=>{
  4557. var d1 = s.createDate.split('-')[2];
  4558. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4559. if (d1.indexOf('0') == 0) {
  4560. d1 = d1.substring(1,d1.length);
  4561. }
  4562. if (d1 == d2) {
  4563. d.state = s.state;
  4564. d.missReport = s.missReport;//是否漏填
  4565. d.exceedCardTime = s.exceedCardTime
  4566. }
  4567. })
  4568. })
  4569. this.$forceUpdate();
  4570. }
  4571. },
  4572. error => {
  4573. this.$message({
  4574. message: error,
  4575. type: "error"
  4576. });
  4577. }
  4578. );
  4579. },
  4580. scrollFunction () {
  4581. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4582. if (this.domObj.attachEvent) { // IE
  4583. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4584. } else if (this.domObj.addEventListener) {
  4585. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4586. }
  4587. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4588. },
  4589. mouseScroll(event) { // google 浏览器下
  4590. let detail = event.wheelDelta || event.detail
  4591. let moveForwardStep = -1
  4592. let moveBackStep = 1
  4593. let step = 0
  4594. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4595. event.preventDefault() // 阻止浏览器默认事件
  4596. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4597. },
  4598. // //左右滚动
  4599. // wheel(e){
  4600. // var a = document.getElementById("dateScroll");
  4601. // var scroll_width = 80; //滚动一下的距离
  4602. // var e = e || window.event, v;
  4603. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4604. // if(v>3||-v>3) v=-v;
  4605. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4606. // e.preventDefault(); //阻止浏览器的默认滚动
  4607. // },
  4608. showExportDialog() {
  4609. this.exportType = 0
  4610. this.exportDialog = true;
  4611. },
  4612. showExportTimeDialog() {
  4613. this.exportTimeDialog = true;
  4614. },
  4615. changeAllTime() {
  4616. //总时长发生改变,自动按比例计算
  4617. this.workForm.domains.forEach(d=>{
  4618. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4619. });
  4620. //计算jsTime
  4621. if (this.workForm.createDate) {
  4622. let sdate = new Date(this.workForm.createDate[0]);
  4623. let edate = new Date(this.workForm.createDate[1]);
  4624. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4625. console.log('days===', days)
  4626. if (days < 0) {
  4627. days = 0;
  4628. }
  4629. this.jsTime = this.reportTimeType.allday * days;
  4630. }
  4631. },
  4632. // 是否加班的单机事件
  4633. check() {
  4634. this.selected = !this.selected
  4635. this.isNew = this.selected
  4636. },
  4637. updateSubProject() {
  4638. this.$forceUpdate();
  4639. },
  4640. selectDegreeId(domain, index) {
  4641. this.http.post('/report/defaultDegree',{
  4642. projectId: domain.projectId
  4643. },
  4644. res => {
  4645. if (res.code == "ok") {
  4646. if(res.data) {
  4647. this.workForm.domains[index].degreeId = res.data.id + ''
  4648. this.$forceUpdate();
  4649. }
  4650. }
  4651. },
  4652. error => {
  4653. this.$message({
  4654. message: error,
  4655. type: "error"
  4656. });
  4657. }
  4658. );
  4659. },
  4660. //项目选中了, 加载子项目
  4661. selectProject(domain, index) {
  4662. if(!domain.projectId){
  4663. return;
  4664. }
  4665. // 默认选中上次填写的自定义维度
  4666. if(this.yonghuUser.customDegreeActive == 1) {
  4667. this.selectDegreeId(domain, index)
  4668. }
  4669. // console.log('projectId===',domain.projectId);
  4670. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4671. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4672. this.http.post('/sub-project/list',{
  4673. projectId: domain.projectId,
  4674. isReport: true
  4675. },
  4676. res => {
  4677. //清空之前选中的子项目
  4678. // this.workForm.domains[index].subProjectId = 0;
  4679. if (res.code == "ok") {
  4680. this.workForm.domains[index].subProjectList = res.data;
  4681. this.workForm.domains[index].subProjectId = null;
  4682. this.$forceUpdate();
  4683. }
  4684. },
  4685. error => {
  4686. this.$message({
  4687. message: error,
  4688. type: "error"
  4689. });
  4690. }
  4691. );
  4692. //项目相关的近期任务
  4693. if (this.user.company.packageProject == 1) {
  4694. this.getRecentTaskList(domain, index);
  4695. //获取项目相关专业
  4696. if (this.user.company.packageEngineering == 1) {
  4697. this.getProjectProfessions(domain, index);
  4698. }
  4699. //获取项目下的任务分组
  4700. this.getTaskGroups(domain, index);
  4701. }
  4702. // 获取项目相关的维度
  4703. // domain.degreeId = null
  4704. this.$set(domain,'degreeId',null)
  4705. this.$set(domain,'multiDegrIdArray',null)
  4706. this.dimension(domain, index);
  4707. //获取项目审核人
  4708. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4709. this.getProjectAuditorList(domain, index);
  4710. } else {
  4711. //按分组的负责人来审核
  4712. domain.projectAuditorId = null;
  4713. domain.projectAuditorName = null;
  4714. domain.auditUserList = null;
  4715. }
  4716. console.log('this.reportTimeType.type==='+this.reportTimeType.type);
  4717. if (this.reportTimeType.type == 3) {
  4718. //新增项目时,自动计算
  4719. console.log('===time====='+this.reportTimeType.allday * domain.progress/100);
  4720. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4721. }
  4722. //加载昱众的工作职责
  4723. if (this.user.companyId == this.yuzhongCompId) {
  4724. this.updateResponse(domain);
  4725. }
  4726. },
  4727. getRecentTaskList(domain, index) {
  4728. //刷新任务时,清空服务
  4729. this.$set(domain, 'sapServiceId', null);
  4730. this.$set(domain, 'taskId', null);
  4731. var param = {
  4732. projectId: domain.projectId,
  4733. isSubstitude:this.isSubstitude?1:0,
  4734. };
  4735. if (domain.groupId) {
  4736. param.groupId = domain.groupId;
  4737. }
  4738. if (domain.stage) {
  4739. param.stage = domain.stage;
  4740. }
  4741. //专业版代填,获取代填员工的任务
  4742. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4743. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4744. this.$message({
  4745. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4746. type: "error"
  4747. });
  4748. return;
  4749. } else {
  4750. param.userId = this.workForm.userId[0];
  4751. }
  4752. }
  4753. this.http.post('/task/getRecentTask',param,
  4754. res => {
  4755. if (res.code == "ok") {
  4756. this.workForm.domains[index].allTaskList = res.data;
  4757. this.workForm.domains[index].taskList = res.data;
  4758. this.$forceUpdate();
  4759. }
  4760. },
  4761. error => {
  4762. this.$message({
  4763. message: error,
  4764. type: "error"
  4765. });
  4766. }
  4767. );
  4768. },
  4769. //获取项目审核人
  4770. getProjectAuditorList(domainItem, index) {
  4771. if(domainItem.projectId == '') {
  4772. return
  4773. }
  4774. domainItem.projectAuditorId = null;
  4775. domainItem.projectAuditorName = null;
  4776. this.http.post('/project-auditor/getList',{
  4777. projectId: domainItem.projectId,
  4778. },
  4779. res => {
  4780. if (res.code == "ok") {
  4781. domainItem.auditUserList = res.data;
  4782. if (res.data.length==0) {
  4783. this.$message({
  4784. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4785. type: "error"
  4786. });
  4787. } else if (res.data.length==1) {
  4788. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4789. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4790. }
  4791. this.$forceUpdate();
  4792. }
  4793. },
  4794. error => {
  4795. this.$message({
  4796. message: error,
  4797. type: "error"
  4798. });
  4799. }
  4800. );
  4801. },
  4802. // 获取维度数据
  4803. dimension(domain, index) {
  4804. if(domain.projectId == '') {
  4805. return
  4806. }
  4807. this.http.post('/project/getDegreeList',{
  4808. projectId: domain.projectId,
  4809. },
  4810. res => {
  4811. if (res.code == "ok") {
  4812. // console.log("维度数据",res.data);
  4813. this.workForm.domains[index].wuduList = res.data
  4814. // this.workForm = this.workForm
  4815. this.$forceUpdate()
  4816. }
  4817. },
  4818. error => {
  4819. this.$message({
  4820. message: error,
  4821. type: "error"
  4822. });
  4823. }
  4824. );
  4825. },
  4826. //切换任务阶段
  4827. changeStages(domain, index) {
  4828. if (domain.stage == null || domain.stage == '') {
  4829. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4830. } else {
  4831. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4832. }
  4833. this.getRecentTaskList(domain, index);
  4834. this.$forceUpdate();
  4835. },
  4836. getGroupStages(domain, index, keepStage) {
  4837. // console.log(domain);
  4838. if(!domain.groupId){
  4839. domain.projectAuditorId = ''
  4840. domain.stages = []
  4841. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4842. domain.taskId = ''
  4843. domain.sapServiceId = ''
  4844. }
  4845. if(this.user.timeType.reportAuditType >= 1){
  4846. domain.auditUserList = []
  4847. }
  4848. this.$forceUpdate();
  4849. return
  4850. }
  4851. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4852. res => {
  4853. if (res.code == "ok") {
  4854. if (!keepStage) {
  4855. domain.stage = '';
  4856. }
  4857. domain.stages = res.data;
  4858. this.getRecentTaskList(domain, index);
  4859. this.$forceUpdate();
  4860. }
  4861. },
  4862. error => {
  4863. this.$message({
  4864. message: error,
  4865. type: "error"
  4866. });
  4867. });
  4868. //检查当前的项目是否需要获取分组的负责人
  4869. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4870. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4871. res => {
  4872. if (res.code == "ok") {
  4873. domain.getProjectAuditorList = res.data;
  4874. domain.auditUserList = res.data;
  4875. if (res.data.length==1) {
  4876. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4877. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4878. } else if (res.data.length==0) {
  4879. domain.projectAuditorId = null;
  4880. domain.projectAuditorName = null;
  4881. }
  4882. this.$forceUpdate();
  4883. }
  4884. },
  4885. error => {
  4886. this.$message({
  4887. message: error,
  4888. type: "error"
  4889. });
  4890. });
  4891. }
  4892. },
  4893. getProjectProfessions(domain, index) {
  4894. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  4895. res => {
  4896. if (res.code == "ok") {
  4897. this.workForm.domains[index].professionProgress = res.data;
  4898. this.$forceUpdate();
  4899. }
  4900. },
  4901. error => {
  4902. this.$message({
  4903. message: error,
  4904. type: "error"
  4905. });
  4906. });
  4907. },
  4908. //删除自己的日报
  4909. deleteReport() {
  4910. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4911. confirmButtonText: this.$t('btn.determine'),
  4912. cancelButtonText: this.$t('btn.cancel'),
  4913. type: "warning"
  4914. })
  4915. .then(() => {
  4916. this.listLoading = true;
  4917. this.http.post('/report/delete',{
  4918. userId: this.user.id,
  4919. date: this.workForm.createDate
  4920. },
  4921. res => {
  4922. this.listLoading = false;
  4923. if (res.code == "ok") {
  4924. this.$message({
  4925. message: this.$t('message.successfullyDeleted'),
  4926. type: "success"
  4927. });
  4928. this.getReportList();
  4929. this.getDepartment();
  4930. this.dialogVisible = false;
  4931. } else {
  4932. this.$message({
  4933. message: res.msg,
  4934. type: "error"
  4935. });
  4936. }
  4937. },
  4938. error => {
  4939. this.listLoading = false;
  4940. this.$message({
  4941. message: error,
  4942. type: "error"
  4943. });
  4944. }
  4945. );
  4946. })
  4947. .catch(() => {});
  4948. },
  4949. // 管理员删除日报
  4950. guanli(item) {
  4951. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4952. let param = {date: this.date + day, userId: item.id};
  4953. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  4954. confirmButtonText: this.$t('btn.determine'),
  4955. cancelButtonText: this.$t('btn.cancel'),
  4956. type: "warning"
  4957. })
  4958. .then(() => {
  4959. this.listLoading = true;
  4960. this.http.post('/report/delete',param,
  4961. res => {
  4962. this.listLoading = false;
  4963. if (res.code == "ok") {
  4964. this.$message({
  4965. message: this.$t('message.successfullyDeleted'),
  4966. type: "success"
  4967. });
  4968. this.getReportList();
  4969. this.getDepartment();
  4970. this.dialogVisible = false;
  4971. } else {
  4972. this.$message({
  4973. message: res.msg,
  4974. type: "error"
  4975. });
  4976. }
  4977. },
  4978. error => {
  4979. this.listLoading = false;
  4980. this.$message({
  4981. message: error,
  4982. type: "error"
  4983. });
  4984. }
  4985. );
  4986. })
  4987. .catch(() => {});
  4988. },
  4989. selectAll() {
  4990. if (this.isAllSelect) {
  4991. var keys = [];
  4992. this.reportNames.forEach(b=>{
  4993. keys.push(b.id);
  4994. })
  4995. this.$refs.approveTree.setCheckedKeys(keys);
  4996. } else {
  4997. this.$refs.approveTree.setCheckedKeys([]);
  4998. }
  4999. },
  5000. removeEmptyNode(list) {
  5001. for (var i=0;i<list.length;i++) {
  5002. var cnt = 0;
  5003. if (list[i].membCount == 0) {
  5004. list.splice(i, 1);
  5005. i--;
  5006. } else if (list[i].children != null) {
  5007. this.removeEmptyNode(list[i].children);
  5008. }
  5009. }
  5010. },
  5011. calculateMembCount(list) {
  5012. for (var i in list) {
  5013. var cnt = 0;
  5014. if (list[i].children != null) {
  5015. this.calculateMembCount(list[i].children);
  5016. for (var m in list[i].children) {
  5017. cnt += list[i].children[m].membCount;
  5018. }
  5019. }
  5020. if (list[i].isUser == 1) {
  5021. cnt++;
  5022. this.membCount++;
  5023. }
  5024. list[i].membCount = cnt;
  5025. }
  5026. },
  5027. stateChange() {
  5028. // console.log(this.allData,'alldate');
  5029. this.membCount = 0;
  5030. if (this.selectState == -1) {
  5031. //全部状态
  5032. this.data = this.allData;
  5033. } else {
  5034. //未填报
  5035. this.seluserText = ''
  5036. var newData = JSON.parse(JSON.stringify(this.allData));
  5037. this.filterState(this.selectState, newData);
  5038. this.data = newData;
  5039. }
  5040. this.calculateMembCount(this.data);
  5041. this.data[0].membCount = this.membCount;//总人数
  5042. },
  5043. //按状态过滤部门人员
  5044. filterState(state, list) {
  5045. for (var i =0;i<list.length; i++) {
  5046. var obj = list[i];
  5047. if (obj.isUser == 1) {
  5048. var match = false;
  5049. if (state == -2) {
  5050. if (obj.state == null) {
  5051. match = true;
  5052. }
  5053. } else {
  5054. if (obj.state == state) {
  5055. match = true;
  5056. }
  5057. }
  5058. if (!match) {
  5059. list.splice(i, 1);
  5060. i--;
  5061. } else {
  5062. }
  5063. } else {
  5064. if (obj.children != null) {
  5065. this.filterState(state, obj.children);
  5066. }
  5067. }
  5068. }
  5069. },
  5070. //a按名称过滤部门人员
  5071. async seluserforText(){
  5072. const { userNameNeedTranslate } = this.user
  5073. this.membCount = 0;
  5074. var newData = JSON.parse(JSON.stringify(this.allData));
  5075. let textList = [this.seluserText]
  5076. if(userNameNeedTranslate == 1) {
  5077. this.dataLoading = true
  5078. let res = await this.postData('/user/getEmployeeList', {
  5079. keyword: this.seluserText,
  5080. cursor: '',
  5081. departmentId: -1,
  5082. pageIndex: 1,
  5083. pageSize: 1000
  5084. })
  5085. textList = res.data.records.map(item => item.name)
  5086. this.dataLoading = false
  5087. }
  5088. // return
  5089. console.log(textList, '<=== textList')
  5090. this.seluserforTextin(this.seluserText, newData, textList)
  5091. console.log(newData, 'Data')
  5092. this.data = newData;
  5093. this.calculateMembCount(this.data);
  5094. this.data[0].membCount = this.membCount;//总人数
  5095. },
  5096. seluserforTextin(text, list, textList = []){
  5097. for (var i =0;i<list.length; i++) {
  5098. var obj = list[i];
  5099. if (obj.isUser == 1) {
  5100. var match = false;
  5101. // if (obj.label.indexOf(text) != -1) {
  5102. // match = true
  5103. // }
  5104. if(textList.some(item => item.includes(obj.label))) {
  5105. match = true
  5106. }
  5107. if (!match) {
  5108. list.splice(i, 1);
  5109. i--;
  5110. } else {
  5111. }
  5112. } else {
  5113. if (obj.children != null) {
  5114. this.seluserforTextin(text, obj.children, textList);
  5115. }
  5116. }
  5117. }
  5118. },
  5119. // 当节点发生变化时
  5120. nodeChangeExpand(data) {
  5121. // 保存当前展开的节点
  5122. let flag = false
  5123. this.nodeModelData.some(item => {
  5124. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5125. flag = true
  5126. return true
  5127. }
  5128. })
  5129. if (!flag) { // 不存在则存到数组里
  5130. this.nodeModelData.push(data.id)
  5131. }
  5132. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5133. },
  5134. nodeChangeCollapse(data) {
  5135. console.log(this.nodeModelData)
  5136. this.nodeModelData.some((item, i) => {
  5137. if (item === data.id) {
  5138. this.nodeModelData.length = i
  5139. }
  5140. })
  5141. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5142. },
  5143. // 部门列表点击
  5144. handleNodeClick(data) {
  5145. // this.dealList = data
  5146. this.theValues(data.id, this.allData)
  5147. // this.depData = data;
  5148. var list = [];
  5149. if (data.id == -1) {
  5150. this.deptId = null;
  5151. this.targetUid = null;
  5152. list = this.data;
  5153. } else if (data.isUser == 1) {
  5154. this.deptId = null;
  5155. this.targetUid = data.id;
  5156. } else {
  5157. this.deptId = data.id;
  5158. this.targetUid = null;
  5159. list.push(data);
  5160. }
  5161. this.getReportList();
  5162. if (list.length > 0) {
  5163. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5164. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5165. }
  5166. },
  5167. exportPushLog(){
  5168. this.http.post('/sap-sync-log/export',{},
  5169. res => {
  5170. if (res.code == "ok") {
  5171. var filePath = res.data;
  5172. var fName = '推送日志.xlsx'
  5173. const a = document.createElement('a'); // 创建a标签
  5174. a.setAttribute('download', fName);// download属性
  5175. a.setAttribute('href', filePath);// href链接
  5176. a.click(); //自执行点击事件
  5177. a.remove();
  5178. } else {
  5179. this.$message({
  5180. message: res.msg,
  5181. type: "error"
  5182. });
  5183. }
  5184. },
  5185. error => {
  5186. this.$message({
  5187. message: error,
  5188. type: "error"
  5189. });
  5190. });
  5191. },
  5192. theValues(id, item) {
  5193. for(var i in item) {
  5194. if(item[i].id == id) {
  5195. this.depData = item[i]
  5196. if(id == '-1') {
  5197. this.translation = '1'
  5198. } else {
  5199. if(item[i].children) {
  5200. this.translation = '2'
  5201. } else {
  5202. this.translation = '3'
  5203. }
  5204. }
  5205. return
  5206. } else {
  5207. if(item[i].children) {
  5208. this.theValues(id, item[i].children)
  5209. }
  5210. }
  5211. }
  5212. },
  5213. //获取可以选择的代填的人员列表
  5214. getSubstitudeUserDeptList() {
  5215. if (this.deptMembData.length == 0) {
  5216. this.http.post("/department/listMyMembs", {},
  5217. res => {
  5218. if (res.code == "ok") {
  5219. let noAllData = JSON.parse(JSON.stringify(res.data));
  5220. if (noAllData.length > 0) {
  5221. // if (noAllData[0].label == '全部人员') {
  5222. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5223. noAllData.splice(0,1);
  5224. }
  5225. }
  5226. this.setUserToDept(noAllData);
  5227. this.deptMembData = noAllData;
  5228. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5229. console.log(this.deptMembData, '代填人员数据')
  5230. } else {
  5231. this.$message({
  5232. message: res.msg,
  5233. type: "error"
  5234. });
  5235. }
  5236. },
  5237. error => {
  5238. this.$message({
  5239. message: error,
  5240. type: "error"
  5241. });
  5242. });
  5243. }
  5244. },
  5245. // 获取部门列表
  5246. getDepartmentForApprove() {
  5247. this.http.post( this.port.manage.depList, {},
  5248. res => {
  5249. if (res.code == "ok") {
  5250. var list1 = JSON.parse(JSON.stringify(res.data));
  5251. this.deptOptionList = this.changeArr(list1);
  5252. console.log(this.deptOptionList, '部门')
  5253. } else {
  5254. this.$message({
  5255. message: res.msg,
  5256. type: "error"
  5257. });
  5258. }
  5259. },
  5260. error => {
  5261. this.$message({
  5262. message: error,
  5263. type: "error"
  5264. });
  5265. });
  5266. },
  5267. // 获取部门列表
  5268. getDepartment() {
  5269. //如果没有权限,就不需要获取
  5270. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5271. return;
  5272. }
  5273. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5274. var param = {date:this.date + day};
  5275. this.http.post("/report/getMembList", param,
  5276. res => {
  5277. if (res.code == "ok") {
  5278. if(res.data.length == 0){
  5279. return
  5280. }
  5281. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5282. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5283. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5284. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5285. // if (this.user.role > 0) {
  5286. // }
  5287. list.splice(0,0,{
  5288. id: -1,
  5289. label: this.$t('lable.allStaff'),
  5290. })
  5291. this.membCount = 0;
  5292. //设置员工到部门下面
  5293. this.setUserToDept(list);
  5294. this.data = list;
  5295. // console.log('data',this.data);
  5296. this.expandDate = [this.data[1].id]
  5297. this.allData = list;
  5298. // if (noAllData.length > 0) {
  5299. // if (noAllData[0].label == '全部人员') {
  5300. // noAllData.splice(0,1);
  5301. // }
  5302. // }
  5303. // this.setUserToDept(noAllData);
  5304. // this.deptMembData = noAllData;
  5305. this.option = this.changeArr(list1);
  5306. list[0].membCount = this.membCount;
  5307. if (this.depData.id == -1) {
  5308. this.depData.membCount = this.membCount;
  5309. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5310. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5311. } else {
  5312. if (this.depData.isUser == null) {
  5313. var dep = this.findTargetDept(this.data, this.depData.id);
  5314. var membDeptList = [];
  5315. membDeptList.push(dep);
  5316. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5317. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5318. }
  5319. }
  5320. if (this.depData.isUser == null) {
  5321. if (this.isFill) {
  5322. this.fillMembList = this.fillList;
  5323. } else {
  5324. this.fillMembList = this.unFillList;
  5325. }
  5326. }
  5327. this.leaveAllNum = 0
  5328. for(let i in this.unFillList){
  5329. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5330. this.leaveAllNum += 1
  5331. }
  5332. }
  5333. this.stateChange()
  5334. } else {
  5335. this.$message({
  5336. message: res.msg,
  5337. type: "error"
  5338. });
  5339. }
  5340. },
  5341. error => {
  5342. this.$message({
  5343. message: error,
  5344. type: "error"
  5345. });
  5346. });
  5347. this.getReportFillStatus();
  5348. },
  5349. findTargetDept(list, deptId) {
  5350. var t = null;
  5351. for (var i=0;i<list.length; i++) {
  5352. if (list[i].isUser == null && list[i].id == deptId) {
  5353. t = list[i];
  5354. break;
  5355. }
  5356. }
  5357. if (t == null) {
  5358. for (var i=0;i<list.length; i++) {
  5359. if (list[i].children != null && list[i].children.length > 0) {
  5360. t = this.findTargetDept(list[i].children, deptId);
  5361. if (t != null) {
  5362. break;
  5363. }
  5364. }
  5365. }
  5366. }
  5367. return t;
  5368. },
  5369. getUserMembListFromDeptList(list, isFill) {
  5370. var membList = [];
  5371. for (var i in list) {
  5372. var deptName = list[i].label;
  5373. if (list[i].userList != null) {
  5374. list[i].userList.forEach(element => {
  5375. if (isFill == 0) {
  5376. //获取未填的
  5377. if (element.state == null) {
  5378. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5379. membList.push(obj);
  5380. }
  5381. } else {
  5382. if (element.state != null) {
  5383. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5384. membList.push(obj);
  5385. }
  5386. }
  5387. });
  5388. }
  5389. if (list[i].children != null) {
  5390. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5391. }
  5392. }
  5393. return membList;
  5394. },
  5395. setUserToDept(list) {
  5396. for (var i in list) {
  5397. var cnt = 0;
  5398. if (list[i].children != null) {
  5399. this.setUserToDept(list[i].children);
  5400. for (var m in list[i].children) {
  5401. cnt += list[i].children[m].membCount;
  5402. }
  5403. }
  5404. if (list[i].userList != null) {
  5405. if (list[i].children == null) {
  5406. list[i].children = [];
  5407. }
  5408. list[i].userList.forEach(element => {
  5409. var obj = {
  5410. id: element.id,
  5411. label:element.name,
  5412. state:element.state,
  5413. parentId:element.departmentId,
  5414. isUser:1,
  5415. workingTime: element.workingTime,
  5416. leaveDays: element.leaveDays,
  5417. leaveTimes: element.leaveTimes
  5418. };
  5419. list[i].children.push(obj);
  5420. this.membCount++;
  5421. cnt++;
  5422. });
  5423. }
  5424. list[i].membCount = cnt;
  5425. }
  5426. },
  5427. // 修改数组
  5428. changeArr(arr) {
  5429. for (var i = 0; i < arr.length; i++) {
  5430. if(arr[i].id != -1 && arr[i].id != 0) {
  5431. if (arr[i].children != null && arr[i].children.length>0) {
  5432. arr[i].children = this.changeArr(arr[i].children);
  5433. }
  5434. arr[i].id && (arr[i].value = arr[i].id);
  5435. delete arr[i].id;
  5436. }
  5437. }
  5438. for(var i in arr) {
  5439. if(arr[i].id == -1 || arr[i].id == 0) {
  5440. arr.splice(i,1)
  5441. }
  5442. }
  5443. return arr;
  5444. },
  5445. //时间段范围设置改动,监听
  5446. onTimeTypeChange(timeType) {
  5447. this.seleChn(1)
  5448. this.showAddMore = true;
  5449. for(var i in this.workForm.domains) {
  5450. if (this.workForm.domains[i].timeType == 0) {
  5451. this.showAddMore = false;
  5452. break;
  5453. }
  5454. }
  5455. if (this.showAddMore) {
  5456. //检测数量
  5457. if (this.workForm.domains.length == 2) {
  5458. this.showAddMore = false;
  5459. } else {
  5460. this.showAddMore = true;
  5461. }
  5462. }
  5463. },
  5464. getTimeType() {
  5465. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5466. res => {
  5467. if (res.code == "ok") {
  5468. var t = res.data;
  5469. this.reportTimeType = t;
  5470. if (this.reportTimeType.type > 0) {
  5471. this.showAddMore = true;
  5472. }
  5473. //转化时间格式
  5474. if (t.allday != null) {
  5475. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5476. }
  5477. if (t.am != null) {
  5478. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5479. }
  5480. if (t.pm != null) {
  5481. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5482. }
  5483. let arr = []
  5484. for(var i in res.data.excludeTimeList) {
  5485. let obj = {
  5486. s: res.data.excludeTimeList[i].startTime,
  5487. e: res.data.excludeTimeList[i].endTime,
  5488. }
  5489. arr.push(obj)
  5490. }
  5491. this.vacationTime = arr
  5492. } else {
  5493. this.$message({
  5494. message: res.msg,
  5495. type: "error"
  5496. });
  5497. }
  5498. },
  5499. error => {
  5500. this.listLoading = false;
  5501. this.$message({
  5502. message: error,
  5503. type: "error"
  5504. });
  5505. });
  5506. },
  5507. // 改变月份 -------
  5508. changeMonthOut() {
  5509. this.getAllDate();
  5510. this.getReportList();
  5511. this.getDepartment();
  5512. },
  5513. // 选择日期
  5514. choseDate(i, item) {
  5515. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5516. return
  5517. }
  5518. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5519. this.choseDay = i;
  5520. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5521. sessionStorage.msg = this.date + day,
  5522. this.getReportList();
  5523. this.getDepartment();
  5524. this.curDate = item.date;
  5525. },
  5526. canClick(i, item){
  5527. let nowDate = new Date()
  5528. let nowDateYear = nowDate.getFullYear()
  5529. let itemYear = parseInt(this.date.split('-')[0])
  5530. let nowDateMonth = nowDate.getMonth() + 1
  5531. let itemMonth = parseInt(this.date.split('-')[1])
  5532. let nowDateDay = nowDate.getDate()
  5533. let itemDay = parseInt(item.showDate.split('.')[1])
  5534. if(nowDateYear < itemYear){
  5535. return false
  5536. }else if(nowDateYear == itemYear){
  5537. if(nowDateMonth < itemMonth){
  5538. return false
  5539. }else if(nowDateMonth == itemMonth){
  5540. if(nowDateDay < itemDay){
  5541. return false
  5542. }
  5543. }
  5544. }
  5545. },
  5546. // 获取日期列表
  5547. getAllDate(e) {
  5548. var dayArry = [];
  5549. var day = this.getCountDays();
  5550. let curMonthDay = null;
  5551. for (var k = 1; k <= day; k++) {
  5552. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5553. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5554. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5555. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5556. if(sessionStorage.msg) {
  5557. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5558. this.choseDay = k - 1;
  5559. curMonthDay = str;
  5560. }
  5561. } else {
  5562. if (new Date().getDate() == k) {
  5563. this.choseDay = k - 1;
  5564. }
  5565. }
  5566. } else {
  5567. this.choseDay = 0;
  5568. }
  5569. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5570. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5571. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5572. }
  5573. this.allDate = dayArry;
  5574. //不能超过最大日期
  5575. if (this.choseDay > day-1) {
  5576. this.choseDay = day-1;
  5577. }
  5578. if(sessionStorage.from != 1){
  5579. let nowmonth = new Date().getMonth() + 1
  5580. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5581. let nowdate = new Date().getDate()
  5582. if(nowd == this.date){
  5583. if(e && sessionStorage.msg){
  5584. }else{
  5585. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5586. }
  5587. let nowday = new Date(sessionStorage.msg).getDate()
  5588. this.choseDay = nowday - 1
  5589. let monthdate = new Date(sessionStorage.msg)
  5590. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5591. }else{
  5592. if(e && sessionStorage.msg){
  5593. }else{
  5594. sessionStorage.msg = this.date + '-01'
  5595. }
  5596. let monthdate = new Date(sessionStorage.msg)
  5597. this.choseDay = monthdate.getDate() - 1
  5598. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5599. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5600. }
  5601. }else{
  5602. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5603. }
  5604. //从消息点击跳转过来的,直接加载指定日期
  5605. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5606. this.curDate = sessionStorage.msg;
  5607. sessionStorage.from = 0;
  5608. } else {
  5609. // if (curMonthDay != null) {
  5610. // // this.curDate = curMonthDay;
  5611. // let d = new Date(sessionStorage.msg)
  5612. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5613. // } else {
  5614. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5615. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5616. // }
  5617. }
  5618. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5619. // if(!sessionStorage.msg){
  5620. // let msgday = this.choseDay + 1
  5621. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5622. // }
  5623. this.getReportFillStatus();
  5624. },
  5625. getCountDays() {
  5626. var newstr = this.date.replace(/-/g, "/");
  5627. var curDate = new Date(newstr+'/01');
  5628. var curMonth = curDate.getMonth();
  5629. curDate.setMonth(curMonth + 1);
  5630. curDate.setDate(0);
  5631. return curDate.getDate();
  5632. },
  5633. reqMore() {
  5634. if (this.hasMore) {
  5635. this.pageIndex++;
  5636. this.requestHttpReports();
  5637. }
  5638. },
  5639. //加载日报数据
  5640. requestHttpReports() {
  5641. //请求数据
  5642. this.listLoading = true;
  5643. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5644. let param = {date: this.date + day};
  5645. if (this.deptId) {
  5646. param.deptId = this.deptId;
  5647. }
  5648. if (this.targetUid) {
  5649. param.userId = this.targetUid;
  5650. }
  5651. //传页码
  5652. if (this.hasMore) {
  5653. param.pageIndex = this.pageIndex;
  5654. }
  5655. this.http.post( this.port.report.list, param,
  5656. res => {
  5657. this.listLoading = false;
  5658. if (res.code == "ok") {
  5659. //扩增
  5660. if (res.data.data.length > 0) {
  5661. this.reportList = this.reportList.concat(res.data.data);
  5662. } else if (this.pageIndex > 1){
  5663. this.$message({
  5664. message: this.$t('meiYouGengDuoShuJuLe'),
  5665. type: "info"
  5666. });
  5667. }
  5668. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5669. if(document.querySelector("#day"+this.choseDay)){
  5670. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5671. }
  5672. } else {
  5673. this.$message({
  5674. message: res.msg,
  5675. type: "error"
  5676. });
  5677. }
  5678. },
  5679. error => {
  5680. this.listLoading = false;
  5681. this.$message({
  5682. message: error,
  5683. type: "error"
  5684. });
  5685. });
  5686. },
  5687. //获取日报列表
  5688. getReportList() {
  5689. //初始化,重置数据
  5690. this.pageIndex = 0;
  5691. this.hasMore = true;
  5692. this.reportList = [];
  5693. this.requestHttpReports();
  5694. },
  5695. //刷新日报状态,用于审核后更新
  5696. refreshReportData(reportId) {
  5697. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5698. res => {
  5699. if (res.code == "ok") {
  5700. for (var m=0;m<this.reportList.length; m++) {
  5701. var d = this.reportList[m].data;
  5702. var find = d.filter(r=>r.id == reportId);
  5703. if (find.length > 0) {
  5704. find[0].state = res.data.state;
  5705. if (find[0].state == 2) {//被驳回,要可以编辑
  5706. this.reportList[m].state = 2;
  5707. }
  5708. find[0].isDeptAudit = res.data.isDeptAudit;
  5709. find[0].departmentAuditState = res.data.departmentAuditState;
  5710. find[0].projectAuditorName = res.data.projectAuditorName;
  5711. find[0].projectAuditorId = res.data.projectAuditorId;
  5712. find[0].projectAuditState = res.data.projectAuditState;
  5713. find[0].rejectUserid = res.data.rejectUserid;
  5714. find[0].rejectUsername = res.data.rejectUsername;
  5715. find[0].rejectReason = res.data.rejectReason;
  5716. this.$forceUpdate();
  5717. break;
  5718. }
  5719. }
  5720. } else {
  5721. this.$message({
  5722. message: res.msg,
  5723. type: "error"
  5724. });
  5725. }
  5726. },
  5727. error => {
  5728. this.listLoading = false;
  5729. this.$message({
  5730. message: error,
  5731. type: "error"
  5732. });
  5733. });
  5734. },
  5735. //导出员工工时统计
  5736. exportUserTime() {
  5737. this.listLoading = true;
  5738. var param = {};
  5739. if (this.exportParam.dateRange != null) {
  5740. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5741. }
  5742. this.http.post('/department/exportDeptStatistic', param,
  5743. res => {
  5744. this.listLoading = false;
  5745. if (res.code == "ok") {
  5746. location.href = res.data;
  5747. this.exportTimeDialog = false;
  5748. } else {
  5749. this.$message({
  5750. message: res.msg,
  5751. type: "error"
  5752. });
  5753. }
  5754. },
  5755. error => {
  5756. this.listLoading = false;
  5757. this.$message({
  5758. message: error,
  5759. type: "error"
  5760. });
  5761. });
  5762. },
  5763. //导出日报
  5764. exportReport() {
  5765. this.exportingData = true;
  5766. var param = {};
  5767. if (this.exportParam.dateRange != null) {
  5768. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5769. }
  5770. if (this.exportParam.projectId != null) {
  5771. param.projectId = this.exportParam.projectId;
  5772. }
  5773. if (this.exportParam.departmentId != null) {
  5774. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5775. param.departmentIds = this.exportParam.departmentId.join(',')
  5776. }
  5777. param.stateKey = this.stateKey
  5778. // param.departmentId = this.user.departmentId
  5779. console.log(param, '《=== 导出传的参数');
  5780. console.log('开始调用exportReport接口');
  5781. this.http.post(this.port.report.export, param,
  5782. res => {
  5783. this.exportingData = false;
  5784. if (res.code == "ok") {
  5785. var filePath = res.data;
  5786. const a = document.createElement('a'); // 创建a标签
  5787. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5788. a.setAttribute('href', filePath);// href链接
  5789. a.click(); //自执行点击事件
  5790. a.remove();
  5791. this.exportDialog = false;
  5792. } else {
  5793. this.$message({
  5794. message: res.msg,
  5795. type: "error"
  5796. });
  5797. }
  5798. },
  5799. error => {
  5800. this.exportingData = false;
  5801. this.$message({
  5802. message: error,
  5803. type: "error"
  5804. });
  5805. });
  5806. },
  5807. //导出日报审核记录
  5808. exportReportLog() {
  5809. this.exportingData = true;
  5810. var param = {};
  5811. if (this.exportReportLogParam.dateRange != null) {
  5812. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5813. }
  5814. this.http.post('/report-log/exportReportLog', param,
  5815. res => {
  5816. this.exportingData = false;
  5817. if (res.code == "ok") {
  5818. var filePath = res.data;
  5819. const a = document.createElement('a'); // 创建a标签
  5820. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5821. a.setAttribute('href', filePath);// href链接
  5822. a.click(); //自执行点击事件
  5823. a.remove();
  5824. this.exportDialog = false;
  5825. } else {
  5826. this.$message({
  5827. message: res.msg,
  5828. type: "error"
  5829. });
  5830. }
  5831. },
  5832. error => {
  5833. this.exportingData = false;
  5834. this.$message({
  5835. message: error,
  5836. type: "error"
  5837. });
  5838. });
  5839. },
  5840. restUserCardTime(item){
  5841. let param={}
  5842. param.userId=item.userId
  5843. param.createDate=item.createDate
  5844. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5845. res => {
  5846. if (res.code == "ok") {
  5847. this.showMonthWorkTimeReminder()
  5848. } else {
  5849. this.$message({
  5850. message: res.msg,
  5851. type: "error"
  5852. });
  5853. }
  5854. },
  5855. error => {
  5856. this.$message({
  5857. message: error,
  5858. type: "error"
  5859. });
  5860. });
  5861. },
  5862. importReportLog(item){
  5863. //首先判断文件类型
  5864. let str = item.file.name.split(".");
  5865. let format = str[str.length - 1];
  5866. if (format != "xls" && format != "xlsx") {
  5867. this.$message({
  5868. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5869. type: "error"
  5870. });
  5871. } else {
  5872. const loading = this.$loading({
  5873. lock: true,
  5874. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5875. spinner: 'el-icon-loading',
  5876. background: 'rgba(0, 0, 0, 0.7)'
  5877. });
  5878. let formData = new FormData();
  5879. formData.append("multipartFile", item.file);
  5880. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5881. res => {
  5882. this.$refs.upload.clearFiles();
  5883. loading.close();
  5884. if (res.code == "ok") {
  5885. this.$message({
  5886. message: res.msg,
  5887. type: "success"
  5888. });
  5889. } else {
  5890. this.$message({
  5891. message: res.msg,
  5892. type: "error"
  5893. });
  5894. }
  5895. },
  5896. error => {
  5897. this.$refs.upload.clearFiles();
  5898. loading.close();
  5899. this.$message({
  5900. message: error,
  5901. type: "error"
  5902. });
  5903. });
  5904. }
  5905. },
  5906. //获取项目列表
  5907. getProjectList() {
  5908. this.listLoading = true;
  5909. this.http.post( this.port.project.list, {},
  5910. res => {
  5911. this.listLoading = false;
  5912. if (res.code == "ok") {
  5913. for(var i in res.data) {
  5914. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5915. res.data[i].projectCode = ''
  5916. }
  5917. }
  5918. this.projectList = res.data;
  5919. console.log("项目列表",this.projectList);
  5920. } else {
  5921. this.$message({
  5922. message: res.msg,
  5923. type: "error"
  5924. });
  5925. }
  5926. },
  5927. error => {
  5928. this.listLoading = false;
  5929. this.$message({
  5930. message: error,
  5931. type: "error"
  5932. });
  5933. });
  5934. },
  5935. getSubUsersFillProjectList(userId) {
  5936. this.http.post( this.port.project.list, {
  5937. forReport: 1,
  5938. userId: userId
  5939. },res => {
  5940. if (res.code == "ok") {
  5941. for(var i in res.data) {
  5942. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5943. res.data[i].projectCode = ''
  5944. }
  5945. }
  5946. this.subFillProjectList = res.data;
  5947. this.getRecentlyProject(userId)
  5948. } else {
  5949. this.$message({
  5950. message: res.msg,
  5951. type: "error"
  5952. });
  5953. }
  5954. },
  5955. error => {
  5956. this.$message({
  5957. message: error,
  5958. type: "error"
  5959. });
  5960. });
  5961. },
  5962. // 获取填报日报的项目下拉列表
  5963. getFillProjectList() {
  5964. this.http.post( this.port.project.list, {
  5965. forReport: 1
  5966. },res => {
  5967. if (res.code == "ok") {
  5968. for(var i in res.data) {
  5969. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  5970. res.data[i].projectCode = ''
  5971. }
  5972. }
  5973. this.fillProjectList = res.data;
  5974. this.getRecentlyProject()
  5975. } else {
  5976. this.$message({
  5977. message: res.msg,
  5978. type: "error"
  5979. });
  5980. }
  5981. },
  5982. error => {
  5983. this.$message({
  5984. message: error,
  5985. type: "error"
  5986. });
  5987. });
  5988. },
  5989. //自己填写日报时,刷新到自己的可填报日报列表
  5990. refreshToMyReportProjectList() {
  5991. this.getRecentlyProject();
  5992. },
  5993. getBasecostItemList() {
  5994. this.http.post('/project-basecost-setting/getReportBasecostList', {
  5995. companyId: this.user.companyId
  5996. },
  5997. res => {
  5998. if (res.code == "ok") {
  5999. this.timeBasecostList = res.data;
  6000. }
  6001. });
  6002. },
  6003. getAIReport(createDate) {
  6004. this.http.post('/report/getAIReport', {},
  6005. res => {
  6006. if (res.code == "ok") {
  6007. var quanbu = 0
  6008. this.jsDay = 1
  6009. var zhi = ''
  6010. var slp = res.data
  6011. for(var i in slp) {
  6012. var sp = +slp[i].workingTime + 0
  6013. zhi = this.jsDay * sp
  6014. quanbu = +quanbu + zhi
  6015. }
  6016. this.jsTime = quanbu
  6017. var aiReportData = res.data;
  6018. this.canCancelInDialog = false
  6019. if(aiReportData.length != 0) {
  6020. var arr = [];
  6021. for(var i in aiReportData) {
  6022. arr.push({
  6023. id: null,
  6024. projectId: aiReportData[i].projectId,
  6025. workingTime: aiReportData[i].workingTime,
  6026. content: '',
  6027. progress:100,
  6028. state: 2,
  6029. timeType: aiReportData[i].timeType,
  6030. subProjectList: aiReportData[i].subProjectList,
  6031. taskList: aiReportData[i].taskList,
  6032. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6033. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6034. taskId: aiReportData[i].taskId,
  6035. startTime: aiReportData[i].startTime,
  6036. endTime: aiReportData[i].endTime,
  6037. isOvertime: 0,
  6038. progress:aiReportData[i].progress,
  6039. professionProgress: aiReportData[i].professionProgressList,
  6040. stages:aiReportData[i].stages,
  6041. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6042. pics: null,
  6043. multiWorktime: aiReportData[i].multiWorktime || 0,
  6044. worktimeList: [{}],
  6045. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6046. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6047. wuduList: aiReportData[i].degreeList,
  6048. taskGroups:aiReportData[i].taskGroups,
  6049. customData: aiReportData[i].customData,//自定义的数值
  6050. auditUserList: aiReportData[i].auditUserList,
  6051. projectAuditorId: aiReportData[i].projectAuditorId,
  6052. projectAuditorName: aiReportData[i].projectAuditorName,
  6053. overtimeHours: aiReportData[i].overtimeHours,
  6054. customText: aiReportData[i].customText,
  6055. basecostId: aiReportData[i].basecostId,
  6056. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6057. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6058. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6059. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6060. canEdit: true
  6061. })
  6062. }
  6063. this.workForm.domains = arr;
  6064. } else {
  6065. }
  6066. this.canEdit = true;
  6067. this.originCanEdit = true;
  6068. this.seleChn()
  6069. } else {
  6070. this.$message({
  6071. message: res.msg,
  6072. type: "error"
  6073. });
  6074. }
  6075. },
  6076. error => {
  6077. this.$message({
  6078. message: error,
  6079. type: "error"
  6080. });
  6081. });
  6082. },
  6083. // 获取个人某天的日报 111111
  6084. getReport() {
  6085. this.http.post( this.port.report.getPort, {
  6086. date: this.workForm.createDate
  6087. },
  6088. res => {
  6089. if (res.code == "ok") {
  6090. var quanbu = 0
  6091. this.jsDay = 1
  6092. var zhi = ''
  6093. var slp = res.data.report
  6094. for(var i in slp) {
  6095. var sp = +slp[i].workingTime + 0
  6096. zhi = this.jsDay * sp
  6097. quanbu = +quanbu + zhi
  6098. }
  6099. this.jsTime = quanbu
  6100. var list = res.data;
  6101. this.report = list;
  6102. this.reportTimeType = this.report.timeType;
  6103. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6104. this.isWeekend = !this.report.isWorkDay;
  6105. this.canCancelInDialog = false;
  6106. this.hasWrittenReport = list.report.length != 0;
  6107. if(list.report.length != 0) {
  6108. var arr = [];
  6109. this.canEdit = false;
  6110. let candelete = true
  6111. for(var i in list.report) {
  6112. var flg = null
  6113. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6114. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6115. var filteredRespList = null
  6116. if (targetP.length > 0) {
  6117. var isPublic = targetP[0].isPublic;
  6118. filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?this.$t('fei-xiang-mu-gong-shi'):this.$t('xiangMuGongShi')) && j.role == this.roleList.filter(r=>r.value == list.report[i].extraField1)[0].label);
  6119. }
  6120. let copyData = {
  6121. id: list.report[i].id,
  6122. projectId: list.report[i].projectId,
  6123. workingTime: list.report[i].workingTime,
  6124. content: list.report[i].content,
  6125. state: list.report[i].state,
  6126. timeType: list.report[i].timeType,
  6127. subProjectList: list.report[i].subProjectList,
  6128. taskList: list.report[i].taskList,
  6129. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6130. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6131. taskId: list.report[i].taskId,
  6132. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6133. startTime: list.report[i].startTime,
  6134. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6135. endTime: list.report[i].endTime,
  6136. isOvertime: flg,
  6137. progress:list.report[i].progress,
  6138. professionProgress: list.report[i].professionProgressList,
  6139. stages:list.report[i].stages,
  6140. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6141. pics: list.report[i].pics,
  6142. multiWorktime: list.report[i].multiWorktime,
  6143. worktimeList: list.report[i].worktimeList,
  6144. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6145. multiDegrIdArray: list.report[i].multiDegrIdList,
  6146. wuduList: list.report[i].degreeList,
  6147. taskGroups:list.report[i].taskGroups,
  6148. customData: list.report[i].customData,//自定义的数值
  6149. auditUserList: list.report[i].auditUserList,
  6150. overtimeHours: list.report[i].overtimeHours,
  6151. customText: list.report[i].customText,
  6152. basecostId: list.report[i].basecostId,
  6153. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6154. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6155. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6156. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6157. canEdit: list.report[i].state >= 2 ? true : false,
  6158. extraField1: list.report[i].extraField1,
  6159. extraField2: list.report[i].extraField2,
  6160. extraField3: list.report[i].extraField3,
  6161. workContentList: list.report[i].workContentList,
  6162. filteredRespList: filteredRespList,
  6163. serviceList: list.report[i].serviceList,
  6164. sapServiceId: list.report[i].sapServiceId,
  6165. reportTargetDeptId: list.report[i].deptId
  6166. }
  6167. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6168. //分组负责人审核的情况下,前端不需要显示,无需设置
  6169. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6170. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6171. }
  6172. arr.push(copyData);
  6173. if (list.report[i].state >= 2) {
  6174. this.canEdit = true;
  6175. }
  6176. if(list.report[i].state < 2){
  6177. candelete = false
  6178. }
  6179. if (list.report[i].state == 0){
  6180. this.canCancelInDialog = true
  6181. }
  6182. // 加判断
  6183. if(this.user.timeType.choseFromAlbum == 1) {
  6184. let arrList = []
  6185. for(var k in list.report[i].pics) {
  6186. let obj = {
  6187. name: k,
  6188. url: list.report[i].pics[k]
  6189. }
  6190. arrList.push(obj)
  6191. }
  6192. arr[i].imgListUrl = arrList
  6193. arr[i].imgList = list.report[i].pics
  6194. }
  6195. }
  6196. this.reportCanDelete = candelete
  6197. this.workForm = {
  6198. createDate: this.workForm.createDate,
  6199. domains: arr,
  6200. userNames:null,
  6201. userId:null,
  6202. time: list.time,
  6203. showRefresh: list.showRefresh
  6204. }
  6205. console.log('workForm', this.workForm)
  6206. } else {
  6207. this.workForm = {
  6208. createDate: this.workForm.createDate,
  6209. domains: [{
  6210. id: null,
  6211. projectId: "",
  6212. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6213. content: "",
  6214. progress:100,
  6215. state: 2,
  6216. timeType:0,
  6217. multiWorktime: this.reportTimeType.multiWorktime,
  6218. worktimeList:[{}],
  6219. canEdit: true,
  6220. auditorFirst: '',
  6221. auditorSec: '',
  6222. auditorThird: '',
  6223. ccUserid: ''
  6224. }],
  6225. userId:null,
  6226. userNames:null,
  6227. time: this.report.time,
  6228. showRefresh: list.showRefresh
  6229. }
  6230. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6231. this.$set(this.workForm.domains[0],'isOvertime',true)
  6232. if(this.reportTimeType.type != 2){
  6233. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6234. }
  6235. }
  6236. if(this.user.timeType.type == 1) {
  6237. var shuzhi = this.user.timeType.allday + ''
  6238. // console.log('执行一次', shuzhi.indexOf('.'))
  6239. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6240. }
  6241. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6242. //默认给第一个,必填字段
  6243. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6244. }
  6245. this.canEdit = true;
  6246. }
  6247. this.originCanEdit = this.canEdit;
  6248. this.seleChn()
  6249. } else {
  6250. this.$message({
  6251. message: res.msg,
  6252. type: "error"
  6253. });
  6254. }
  6255. },
  6256. error => {
  6257. this.$message({
  6258. message: error,
  6259. type: "error"
  6260. });
  6261. });
  6262. },
  6263. guanbi() {
  6264. this.falsss = false,
  6265. this.workTimeForMinYi=0
  6266. },
  6267. // 打开日报填写
  6268. fillInReport(i, isBatch) {
  6269. this.isWeekend = false
  6270. this.reportCanDelete = false
  6271. // console.log(this.user.timeType.type, '选择时长')
  6272. if(i != 1) {
  6273. this.falsss = false
  6274. } else {
  6275. this.falsss = true
  6276. }
  6277. if (this.isSubstitude) {
  6278. this.getSubstitudeUserDeptList();
  6279. } else {
  6280. this.refreshToMyReportProjectList();
  6281. }
  6282. if(i == -1 || this.isSubstitude) {
  6283. this.isDisable = false;
  6284. } else {
  6285. this.isDisable = true;
  6286. }
  6287. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6288. this.isBatch = isBatch;
  6289. if (this.isBatch == 0 && !this.isSubstitude) {
  6290. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6291. let weekday = new Date(this.workForm.createDate).getDay()
  6292. if(this.user.companyId == 817){
  6293. if(weekday == 0){
  6294. this.isWeekend = true
  6295. }
  6296. }else{
  6297. if(weekday == 0 || weekday == 6){
  6298. this.isWeekend = true
  6299. }
  6300. }
  6301. this.getReport(i);
  6302. } else {
  6303. // console.log('执行到了这里')
  6304. this.jsTime = 0
  6305. this.jsDay = 0
  6306. this.workForm = {
  6307. createDate: null,//批量填报没有日期
  6308. domains: [{
  6309. id: null,
  6310. projectId: "",
  6311. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6312. content: "",
  6313. progress:100,
  6314. state: 2,
  6315. timeType:0,
  6316. multiWorktime: this.reportTimeType.multiWorktime,
  6317. worktimeList:[{}],
  6318. canEdit: true,
  6319. }],
  6320. }
  6321. if(this.user.timeType.type == 1) {
  6322. var shuzhi = this.user.timeType.allday + ''
  6323. // console.log('执行二次')
  6324. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6325. }
  6326. // console.log(this.workForm)
  6327. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6328. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6329. }
  6330. this.canEdit = true;
  6331. }
  6332. this.dialogVisible = true;
  6333. },
  6334. //按周填报的弹窗口中编辑单项目相关数据
  6335. setWeekFormReportItem(reportId, i, names, row,sss) {
  6336. console.log(sss)
  6337. this.http.post('/report/getReportById', {
  6338. reportId: reportId
  6339. },
  6340. res => {
  6341. if (res.code == "ok") {
  6342. var data = res.data.report;
  6343. sss.subProjectId = data.subProjectId
  6344. sss.subProjectList = data.subProjectList;
  6345. sss.stage = data.stage
  6346. sss.subProjectList = data.subProjectList
  6347. sss.stages = data.stages
  6348. sss.taskGroups = data.taskGroups;
  6349. sss.auditUserList = data.auditUserList;
  6350. sss.degreeId = data.degreeId;
  6351. sss.customData = data.customData;
  6352. sss.wuduList = data.degreeList;
  6353. this.zhoBaoIdx = i
  6354. this.zhoBaoName = names
  6355. this.zhoBao = sss
  6356. this.zhis = row
  6357. if (sss.groupId) {
  6358. //最后一个参数表示是否保留stage的值,不要重置为空
  6359. this.getGroupStages(this.zhoBao, 0, true)
  6360. }
  6361. this.$forceUpdate();
  6362. }
  6363. });
  6364. },
  6365. // 按周填报里内容的填写
  6366. showWeekItemEdit(item, i, projectId,names, row) {
  6367. if (item.state == 0) {
  6368. this.$message({
  6369. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6370. type: "error"
  6371. });
  6372. return;
  6373. }
  6374. if (item.state == 1) {
  6375. this.$message({
  6376. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6377. type: "error"
  6378. });
  6379. return;
  6380. }
  6381. if(this.user.timeType.notAllowedNoAttendance == 1){
  6382. if(this.zhoData[i].corpTime){
  6383. if(this.zhoData[i].corpTime.workHours == 0){
  6384. this.$message({
  6385. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6386. type: 'error'
  6387. })
  6388. return
  6389. }
  6390. }else{
  6391. this.$message({
  6392. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6393. type: 'error'
  6394. })
  6395. return
  6396. }
  6397. }
  6398. var obj = {}
  6399. obj.projectId = projectId
  6400. this.tianxieDialogVisible = true
  6401. this.scopess = item
  6402. var sss = {}
  6403. if (item.id != null) {
  6404. sss.id = item.id;
  6405. sss.state = item.state;
  6406. } else {
  6407. sss.id = -1;
  6408. sss.state = 3;
  6409. }
  6410. sss.projectId = projectId;
  6411. sss.progress = item.progress
  6412. sss.time = item.time
  6413. sss.content = item.content;
  6414. console.log('333', sss.content)
  6415. if (sss.time == '' && this.reportTimeType.type == 2) {
  6416. //取已填时间范围中最大的一个作为开始时间
  6417. var startTime = '09:00';
  6418. var fillStartTime = '00:00';
  6419. for (var t in this.selProjectList) {
  6420. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6421. if (fillItem.time) {
  6422. if (fillItem.time[1] > fillStartTime) {
  6423. fillStartTime = fillItem.time[1];
  6424. }
  6425. }
  6426. }
  6427. if (fillStartTime == '00:00') {
  6428. fillStartTime = '09:00';
  6429. }
  6430. var fillEndMax = '18:00';
  6431. if (fillStartTime >= '18:00') {
  6432. fillEndMax = '23:59';
  6433. }
  6434. sss.time = [fillStartTime, fillEndMax];
  6435. }
  6436. sss.groupId = item.groupId
  6437. sss.stage = item.stage;
  6438. sss.workingTime = item.workingTime
  6439. sss.projectAuditorId = item.projectAuditorId;
  6440. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6441. //默认选中第一个
  6442. sss.basecostId = this.timeBasecostList[0].id;
  6443. }
  6444. var hasEdited = this.zhoData[i][names].hasEdited;
  6445. if (hasEdited) {
  6446. sss = { ...item }
  6447. //编辑过了
  6448. sss.subProjectId = item.subProjectId
  6449. sss.stage = item.stage
  6450. sss.subProjectList = item.subProjectList
  6451. sss.stages = item.stages
  6452. sss.taskGroups = item.taskGroups;
  6453. console.log(sss.taskGroups, '33333');
  6454. sss.auditUserList = obj.auditUserList;
  6455. sss.degreeId = item.degreeId;
  6456. sss.customData = item.customData;
  6457. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6458. //只有一个审核人,自动设置上去
  6459. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6460. }
  6461. sss.wuduList = item.wuduList;
  6462. this.zhoBaoIdx = i
  6463. this.zhoBaoName = names
  6464. this.zhoBao = sss
  6465. this.zhis = row
  6466. if (sss.groupId) {
  6467. //最后一个参数表示是否保留stage的值,不要重置为空
  6468. this.getGroupStages(this.zhoBao, 0, true)
  6469. }
  6470. this.$forceUpdate();
  6471. this.getWeeklyTaskList(sss)
  6472. console.log('最后的周报 ===>', this.zhoBao)
  6473. } else {
  6474. //第一次打开,获取数据
  6475. if (sss.id == -1) {
  6476. //新填报的
  6477. this.selectProject(obj, 0);
  6478. var that = this
  6479. setTimeout(() =>{
  6480. sss.subProjectId = that.workForm.domains[0].subProjectId
  6481. sss.subProjectList = item.subProjectList;
  6482. sss.stage = that.workForm.domains[0].stage
  6483. sss.subProjectList = that.workForm.domains[0].subProjectList
  6484. sss.stages = that.workForm.domains[0].stages
  6485. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6486. sss.auditUserList = obj.auditUserList;
  6487. sss.degreeId = item.degreeId;
  6488. sss.customData = item.customData;
  6489. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6490. //只有一个审核人,自动设置上去
  6491. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6492. }
  6493. sss.wuduList = row[0].wuduList
  6494. that.zhoBaoIdx = i
  6495. that.zhoBaoName = names
  6496. that.zhoBao = sss
  6497. that.zhis = row
  6498. if (sss.groupId) {
  6499. //最后一个参数表示是否保留stage的值,不要重置为空
  6500. this.getGroupStages(that.zhoBao, 0, false)
  6501. }
  6502. that.$forceUpdate();
  6503. this.getWeeklyTaskList(sss)
  6504. },600);
  6505. } else {
  6506. //编辑填报过的;数据库已经存在的
  6507. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6508. }
  6509. }
  6510. },
  6511. // 按周填报里内容的填写点击确定
  6512. setWeekProItemData() {
  6513. //专业版模式下,任务分组和阶段必填
  6514. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6515. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6516. this.$message({
  6517. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6518. type: "error"
  6519. });
  6520. return;
  6521. }
  6522. }
  6523. // 检查任务分组
  6524. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6525. this.$message({
  6526. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6527. type: "error"
  6528. });
  6529. return
  6530. }
  6531. //检查子项目是否必填
  6532. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6533. this.$message({
  6534. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6535. type: "error"
  6536. });
  6537. return;
  6538. }
  6539. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6540. this.$message({
  6541. message: this.$t('message.Pleaseselectareviewer'),
  6542. type: "error"
  6543. });
  6544. return
  6545. }
  6546. if(this.user.timeType.reportAuditType == 3){
  6547. let auditTips = ''
  6548. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6549. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6550. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6551. if(auditTips){
  6552. auditTips = auditTips.substring(0,auditTips.length - 1)
  6553. this.$message({
  6554. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6555. type: 'error'
  6556. })
  6557. return
  6558. }
  6559. }
  6560. let errtips = ''
  6561. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6562. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6563. errtips += this.user.timeType.customDegreeName + '、'
  6564. }
  6565. }
  6566. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6567. errtips += this.user.timeType.customDataName + '、'
  6568. }
  6569. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6570. errtips += this.user.timeType.customTextName + '、'
  6571. }
  6572. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6573. errtips += this.$t('other.workMatters') +'、'
  6574. }
  6575. if(errtips){
  6576. errtips = errtips.substring(0,errtips.length - 1)
  6577. this.$message({
  6578. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6579. type: 'error'
  6580. })
  6581. return
  6582. }
  6583. this.tianxieDialogVisible = false
  6584. var zhong = this.zhoData
  6585. this.zhoBao.hasEdited = true;
  6586. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6587. this.zhoData = zhong
  6588. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6589. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6590. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6591. },
  6592. // 获取本周
  6593. getCurrentWeek() {
  6594. //今天
  6595. this.targetWeekDate = new Date();
  6596. this.initWeekFormData();
  6597. // this.jiazai()
  6598. },
  6599. // 获取上周
  6600. handleGetPrevWeek() {
  6601. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6602. this.initWeekFormData();
  6603. // this.jiazai()
  6604. },
  6605. // 获取下周
  6606. handleGetNextvWeek() {
  6607. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6608. this.initWeekFormData()
  6609. },
  6610. // 加载动画
  6611. jiazai() {
  6612. this.weekDataLoading = true
  6613. var that = this
  6614. setTimeout(() =>{
  6615. that.weekDataLoading = false
  6616. },1000);
  6617. },
  6618. // 转时间格式
  6619. dealdate(date) {
  6620. const dt = new Date(date)
  6621. const y = dt.getFullYear()
  6622. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6623. const d = (dt.getDate() + '').padStart(2, '0')
  6624. return `${y}-${m}-${d}`
  6625. },
  6626. // 按周填报
  6627. fillInReportss() {
  6628. window.addEventListener('scroll', this.handleScroll, true)
  6629. // this.jiazai()
  6630. this.fillWeekDialogVisi = true;
  6631. if (this.isSubstitude) {
  6632. this.substitudeStep = 1;
  6633. this.getSubstitudeUserDeptList();
  6634. } else {
  6635. this.getCurrentWeek();
  6636. }
  6637. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6638. //重新获取工时预警类型的预算项
  6639. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6640. companyId: this.user.companyId
  6641. },
  6642. res => {
  6643. if (res.code == "ok") {
  6644. this.timeBasecostList = res.data;
  6645. }
  6646. });
  6647. }
  6648. },
  6649. fillInReportCustom() {
  6650. this.weekIndex++
  6651. this.weekParentData = {
  6652. isSubstitude: this.isSubstitude
  6653. }
  6654. this.fillWeekDialogVisiCustom = true
  6655. },
  6656. // 按周填报的项目筛选
  6657. selListFun(){
  6658. this.selProjectList = []
  6659. if(this.selCon.length){
  6660. for (let i = 0; i < this.selCon.length; i++) {
  6661. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6662. }
  6663. this.selConShow = false ;
  6664. for (let i in this.zhoData) {
  6665. var obj = this.zhoData[i];
  6666. for(var j in this.selProjectList) {
  6667. var xinzhi = this.selProjectList[j].projectName
  6668. obj[xinzhi] = {}
  6669. obj[xinzhi].time = ''
  6670. obj[xinzhi].content = ''
  6671. obj[xinzhi].progress = 0
  6672. obj[xinzhi].workingTime = 0
  6673. }
  6674. }
  6675. this.initWeekFormData();
  6676. }else{
  6677. this.$message({
  6678. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6679. type:'error'
  6680. })
  6681. }
  6682. },
  6683. setWeekCardTimeData(list) {
  6684. for(let i in list){
  6685. let datei = '';
  6686. if (this.user.timeType.showDdCardtime == 1) {
  6687. datei = list[i].workDate;
  6688. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6689. datei = list[i].createDate;
  6690. } else if (this.user.timeType.syncFanwei == 1) {
  6691. datei = list[i].workDate;
  6692. }
  6693. for(let m in this.zhoData) {
  6694. if(datei == this.zhoData[m].zhoDataTime){
  6695. let item = {
  6696. startTime: list[i].startTime,
  6697. endTime: list[i].endTime,
  6698. workHours: list[i].workHours,
  6699. otTime: list[i].otTime
  6700. }
  6701. this.$set(this.zhoData[m],'corpTime',item)
  6702. }
  6703. }
  6704. }
  6705. },
  6706. getWeeklyCardTime(){ //按周填报获取考勤信息
  6707. let dateStr = []
  6708. for(let i in this.zhoData){
  6709. dateStr.push(this.zhoData[i].zhoDataTime)
  6710. }
  6711. this.http.post('/report/getWeeklyCardTime',{
  6712. dateStr: JSON.stringify(dateStr)
  6713. },res => {
  6714. if(res.code == 'ok'){
  6715. for(let i in res.data){
  6716. let datei = '';
  6717. if (this.user.timeType.showDdCardtime == 1) {
  6718. datei = res.data[i].workDate.split('-');
  6719. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6720. datei = res.data[i].createDate.split('-');
  6721. }
  6722. for(let m in this.zhoData){
  6723. let datem = new Date(this.zhoData[m].zhoDataTime)
  6724. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6725. let item = {
  6726. startTime: res.data[i].startTime,
  6727. endTime: res.data[i].endTime,
  6728. workHours: res.data[i].workHours
  6729. }
  6730. this.$set(this.zhoData[m],'corpTime',item)
  6731. }
  6732. }
  6733. }
  6734. }else{
  6735. this.$message({
  6736. message: res.msg,
  6737. type: 'error'
  6738. })
  6739. }
  6740. },err => {
  6741. this.$message({
  6742. message: err,
  6743. type: 'error'
  6744. })
  6745. })
  6746. },
  6747. selListqx(){
  6748. this.fillWeekDialogVisi = false
  6749. this.selProjectList = []
  6750. this.selCon = []
  6751. },
  6752. handleScroll() {
  6753. this.changdu = this.projectList.length + 1
  6754. },
  6755. // 自动选择时间点的事件
  6756. // async zhoTimes(item, i) {
  6757. // var iss = i
  6758. // if(item.time == null) {
  6759. // return
  6760. // } else {
  6761. // const zhi = this.zhoData[iss];
  6762. // let he = 0;
  6763. // const timeArr = Object.values(zhi)
  6764. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6765. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6766. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6767. // console.log(data, 'data');
  6768. // zhi.he = `${he}h`;
  6769. // }
  6770. // },
  6771. async zhoTimes(item, index) {
  6772. const zho = this.zhoData[index];
  6773. if (!item.time) {
  6774. return;
  6775. }
  6776. const timeArr = Object.values(zho)
  6777. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6778. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6779. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6780. zho.he = `${totalHours[0]}h`;
  6781. },
  6782. // 判断两个时间段是否重叠
  6783. timeOverlap(idx, dateAr) {
  6784. let zhi = 0
  6785. for (let k in dateAr) {
  6786. if (idx !== k) {
  6787. 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))) {
  6788. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6789. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6790. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6791. }
  6792. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6793. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6794. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6795. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6796. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6797. } else {
  6798. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6799. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6800. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6801. }
  6802. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6803. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6804. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6805. }
  6806. }
  6807. }
  6808. }
  6809. }
  6810. return zhi
  6811. },
  6812. // 计算时间
  6813. getHourMinutes(str, end) {
  6814. var he = 0
  6815. var date2 = '2021/12/12 ' + end +':00'
  6816. var date1 = '2021/12/12 ' + str +':00'
  6817. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  6818. var leave1=date3%(24*3600*1000)
  6819. var hours=Math.floor(leave1/(3600*1000))
  6820. var leave2=leave1%(3600*1000)
  6821. var minutes=Math.floor(leave2/(60*1000))
  6822. var shi = hours+'.'+ minutes
  6823. return he += +shi
  6824. },
  6825. // 自动选择事件长度的事件
  6826. zhoXuan(item, i) {
  6827. var iss = i
  6828. if(item.time == null) {
  6829. return
  6830. } else {
  6831. var zhi = this.zhoData[iss]
  6832. var he = 0
  6833. for(var i in zhi) {
  6834. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6835. he += +zhi[i].workingTime
  6836. }
  6837. }
  6838. zhi.he = he + 'h'
  6839. }
  6840. },
  6841. getPushWorkLogData(){
  6842. this.http.post('/sap-sync-log/list', {},
  6843. res => {
  6844. if (res.code == "ok") {
  6845. this.pushWorkTimeLogData = res.data;
  6846. } else {
  6847. this.$message({
  6848. message: res.msg,
  6849. type: "error"
  6850. });
  6851. }
  6852. },
  6853. error => {
  6854. this.$message({
  6855. message: error,
  6856. type: "error"
  6857. });
  6858. });
  6859. },
  6860. // 获取全部人员
  6861. getUsers() {
  6862. this.http.post('/user/getSimpleActiveUserList', {},
  6863. res => {
  6864. if (res.code == "ok") {
  6865. this.usersList = res.data;
  6866. } else {
  6867. this.$message({
  6868. message: res.msg,
  6869. type: "error"
  6870. });
  6871. }
  6872. },
  6873. error => {
  6874. this.$message({
  6875. message: error,
  6876. type: "error"
  6877. });
  6878. });
  6879. },
  6880. // 按时间比例
  6881. addBli(item, i) {
  6882. var iss = i
  6883. if(item.time == null) {
  6884. return
  6885. } else {
  6886. var zhi = this.zhoData[iss]
  6887. var he = 0
  6888. for(var i in zhi) {
  6889. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  6890. he += +zhi[i].workingTime
  6891. }
  6892. }
  6893. zhi.he = he.toFixed(1) + 'h'
  6894. }
  6895. },
  6896. //按周填报选择的项目发生变化,需要设置列
  6897. onSelProjectChange() {
  6898. for (let i = 0; i < this.selCon.length; i++) {
  6899. var exists = false;
  6900. for (let j = 0; j < this.selProjectList.length; j++) {
  6901. if (this.selProjectList[j].id == this.selCon[i]) {
  6902. exists = true;
  6903. break;
  6904. }
  6905. }
  6906. if (!exists) {
  6907. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  6908. this.selProjectList.push(newProject);
  6909. //添加新项目
  6910. for (var w in this.zhoData) {
  6911. var dayItem = this.zhoData[w];
  6912. var pName = newProject.projectName;
  6913. dayItem[pName] = {};
  6914. dayItem[pName].time = ''
  6915. dayItem[pName].content = ''
  6916. dayItem[pName].progress = 0
  6917. dayItem[pName].workingTime = 0
  6918. }
  6919. }
  6920. }
  6921. //去掉
  6922. for (let j = 0; j < this.selProjectList.length; j++) {
  6923. var exists = false;
  6924. for (let i = 0; i < this.selCon.length; i++) {
  6925. if (this.selProjectList[j].id == this.selCon[i]) {
  6926. exists = true;
  6927. break;
  6928. }
  6929. }
  6930. if (!exists) {
  6931. this.selProjectList.splice(j, 1);
  6932. j--;
  6933. }
  6934. }
  6935. this.loadFilledWeekReportItem();
  6936. //刷新表格
  6937. // this.$refs.weekTable.doLayout();
  6938. },
  6939. //根据选中的项目来刷新填写表格
  6940. loadFilledWeekReportItem() {
  6941. for (var w in this.zhoData) {
  6942. var dayItem = this.zhoData[w];
  6943. for (var i = 0; i < this.selProjectList.length; i++) {
  6944. var curColumnProject = this.selProjectList[i];
  6945. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  6946. for (var t in dayItem.reportList) {
  6947. //有日报的项目,不能取消选择
  6948. for (var p in this.fillProjectList) {
  6949. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  6950. }
  6951. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  6952. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  6953. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  6954. if (this.reportTimeType.type == 2) {
  6955. //时间段模式
  6956. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  6957. }
  6958. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  6959. break;
  6960. }
  6961. }
  6962. // dayItem[curColumnProject.projectName] = matchReportItem;
  6963. }
  6964. }
  6965. this.$nextTick(()=>{
  6966. this.$refs.weekTable.doLayout();
  6967. });
  6968. },
  6969. initWeekFormData() {
  6970. this.weekDataLoading = true;
  6971. for (var p in this.fillProjectList) {
  6972. this.fillProjectList[p].canCancel = 1;
  6973. }
  6974. var param = {
  6975. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  6976. };
  6977. if (this.isSubstitude) {
  6978. //传代填人的userId
  6979. param.targetUserId = this.workForm.userId[0];
  6980. }
  6981. this.http.post('/report/getWeeklyReportData',param,res => {
  6982. this.weekDataLoading = false;
  6983. if(res.code == 'ok'){
  6984. let projectList = res.data.projectList;
  6985. if (projectList.length > 0) {
  6986. //有选择过项目进行填报,直接选中
  6987. this.selProjectList = projectList;
  6988. this.selCon = [];
  6989. for (let i = 0; i < projectList.length; i++) {
  6990. this.selCon.push(projectList[i].id);
  6991. }
  6992. }
  6993. //设置日期
  6994. this.weekDateRange = res.data.dateList;
  6995. this.zhoData = [];
  6996. var arrst = []
  6997. for(var i in this.weekDateRange) {
  6998. var obj = {}
  6999. obj.zhoDataTime = this.weekDateRange[i].date
  7000. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7001. obj.he = this.weekDateRange[i].filledTime;
  7002. obj.canFill = this.weekDateRange[i].canFill;
  7003. // obj.filledTime = this.weekDateRange[i].filledTime;
  7004. obj.reportList = this.weekDateRange[i].reportList;
  7005. //初始化,防止渲染报错
  7006. for (var j = 0; j < this.selProjectList.length; j++) {
  7007. var pName = this.selProjectList[j].projectName
  7008. obj[pName] = {}
  7009. obj[pName].time = ''
  7010. obj[pName].content = ''
  7011. obj[pName].progress = 0
  7012. obj[pName].workingTime = 0
  7013. }
  7014. arrst.push(obj)
  7015. }
  7016. this.zhoData = arrst
  7017. this.setWeekCardTimeData(res.data.cardTimeList);
  7018. this.loadFilledWeekReportItem();
  7019. }else{
  7020. this.$message({
  7021. message: res.msg,
  7022. type: 'error'
  7023. })
  7024. }
  7025. },err => {
  7026. this.$message({
  7027. message: err,
  7028. type: 'error'
  7029. })
  7030. })
  7031. },
  7032. zhoZhi(res, i) {
  7033. var zhi = 0
  7034. for(var i in res) {
  7035. if(i != 'zhoDataTime' && i != 'he') {
  7036. zhi += +res[i]
  7037. }
  7038. }
  7039. res.he = zhi
  7040. },
  7041. zhoBtn(i) {
  7042. // this.zhoData.split(i, 1)
  7043. var arr = this.zhoData
  7044. arr.splice(i, 1)
  7045. },
  7046. zhoAddlast(){
  7047. this.selConShow = true
  7048. },
  7049. closeAddWeeklyReport(){
  7050. this.fillWeekDialogVisi = false
  7051. this.selConShow = true
  7052. this.selProjectList = []
  7053. this.selCon = []
  7054. },
  7055. checkDateWorkTime() {
  7056. //针对苏州景昱,单独的检查逻辑
  7057. if (this.user.companyId == 5978) {
  7058. //调接口,先检查工时是否存在异常
  7059. var zhi = this.zhoData;
  7060. var array = [];
  7061. for(let n in zhi){
  7062. if(zhi[n].he){
  7063. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7064. array.push(workData)
  7065. }
  7066. }
  7067. this.submitingReport = true;
  7068. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7069. res => {
  7070. this.submitingReport = false;
  7071. if (res.code == "ok") {
  7072. this.submitWeekReport(0)
  7073. } else {
  7074. this.$confirm(res.msg, this.$t('other.prompts'), {
  7075. confirmButtonText: this.$t('huLveBingTiJiao'),
  7076. cancelButtonText: this.$t('btn.cancel'),
  7077. type: 'error'
  7078. }).then(() => {
  7079. this.submitWeekReport(0)
  7080. }).catch(() => {
  7081. });
  7082. }
  7083. },
  7084. error => {
  7085. this.$message({
  7086. message: error,
  7087. type: "error"
  7088. });
  7089. });
  7090. }
  7091. },
  7092. // 提交按周填报
  7093. submitWeekReport(isDraft) {
  7094. var zhi = this.zhoData
  7095. var ll = 0
  7096. if(this.reportTimeType.type == 2) {
  7097. for(var i in zhi) {
  7098. this.dateAr = []
  7099. var alp = []
  7100. var zhis = zhi[i]
  7101. console.log(zhis)
  7102. for(var j in zhis) {
  7103. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7104. let objs = {}
  7105. objs.s = zhis[j].time[0]
  7106. objs.e = zhis[j].time[1]
  7107. objs.p = j
  7108. alp.push(objs)
  7109. }
  7110. }
  7111. console.log(alp)
  7112. this.dateAr = alp
  7113. if (this.reportTimeType.timeCanOverlap == 0) {
  7114. let str = this.$t('message.Filledtimeperiodsoverlap')
  7115. if(this.dateAr.length > 0) {
  7116. const trus = this.fns();
  7117. const overlapDataTime = this.getOverlapData(alp);
  7118. if (overlapDataTime.length > 0) {
  7119. const arrList = overlapDataTime.map((item) => item.p);
  7120. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7121. }
  7122. ll += 1
  7123. if(!trus) {
  7124. this.$message({
  7125. message: str,
  7126. type: 'error'
  7127. })
  7128. return false
  7129. }
  7130. }
  7131. } else {
  7132. if(this.dateAr.length > 0) {
  7133. ll +=1 ;
  7134. }
  7135. }
  7136. }
  7137. if(ll == 0) {
  7138. this.$message({
  7139. message: this.$t('message.Pleasefillinthetime'),
  7140. type: 'error'
  7141. })
  7142. return false
  7143. }
  7144. } else if(this.reportTimeType.type == 1){
  7145. for(var i in zhi) {
  7146. var zhis = zhi[i]
  7147. for(var j in zhis) {
  7148. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7149. ll += 1
  7150. }
  7151. }
  7152. }
  7153. if(ll == 0) {
  7154. this.$message({
  7155. message: this.$t('message.Pleaseselectatime'),
  7156. type: 'error'
  7157. })
  7158. return false
  7159. }
  7160. let overcorp = ''
  7161. for(let n in zhi){
  7162. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7163. overcorp += zhi[n].zhoDataTime + ','
  7164. }
  7165. }
  7166. if(this.user.companyId != 5978 && overcorp != ''){
  7167. overcorp = overcorp.substring(0,overcorp.length - 1)
  7168. this.$message({
  7169. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7170. type: 'error'
  7171. })
  7172. return
  7173. }
  7174. }
  7175. var submits = []
  7176. let formData = new FormData();
  7177. formData.append("draft", isDraft);
  7178. if(this.reportTimeType.multiWorktime == 1){
  7179. for (var i in this.zhoData) {
  7180. var zhoD = this.zhoData[i]
  7181. var flgs = false
  7182. for(var j in zhoD) {
  7183. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7184. flgs = true
  7185. // formData.append("degreeId", "-1");
  7186. formData.append("id", '-1');
  7187. if (this.isSubstitude) {
  7188. formData.append('targetUids',this.workForm.userId[0]);
  7189. }
  7190. for(var s in this.projectList) {
  7191. if(j == this.projectList[s].projectName) {
  7192. formData.append("projectId", this.projectList[s].id);
  7193. }
  7194. }
  7195. if(this.user.timeType.reportAuditType == 3){
  7196. let audItem = {}
  7197. if(this.user.timeType.auditLevel > 0){
  7198. audItem.auditorFirst = zhoD[j].auditorFirst
  7199. }
  7200. if(this.user.timeType.auditLevel > 1){
  7201. audItem.auditorSec = zhoD[j].auditorSec
  7202. }
  7203. if(this.user.timeType.auditLevel > 2){
  7204. audItem.auditorThird = zhoD[j].auditorThird
  7205. }
  7206. if(zhoD[j].ccUserid){
  7207. audItem.ccUserid = zhoD[j].ccUserid
  7208. }
  7209. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7210. }
  7211. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7212. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7213. formData.append("reportTimeType", this.reportTimeType.type);
  7214. formData.append("endTime", '');
  7215. formData.append("startTime", '');
  7216. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7217. var lix = []
  7218. var objjs = {}
  7219. objjs.startTime = zhoD[j].time[0]
  7220. objjs.endTime = zhoD[j].time[1]
  7221. if (zhoD[j].content == null || zhoD[j].content == '') {
  7222. zhoD[j].content == '-'
  7223. }
  7224. objjs.content = zhoD[j].content
  7225. lix.push(objjs)
  7226. var zhiZhi = JSON.stringify(lix)
  7227. zhiZhi = zhiZhi.replace(/,/g,"@");
  7228. formData.append("content", zhiZhi)
  7229. formData.append("isOvertime", 0)
  7230. formData.append("professionProgress", "[]")
  7231. if (zhoD[j].groupId) {
  7232. formData.append("groupId",zhoD[j].groupId)
  7233. } else {
  7234. //解决后台groupId数组越界的问题
  7235. formData.append("groupId",0)
  7236. }
  7237. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7238. formData.append("createDate",zhoD.zhoDataTime)
  7239. if (zhoD[j].projectAuditorId) {
  7240. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7241. }
  7242. if(zhoD[j].basecostId) {
  7243. formData.append("basecostId", zhoD[j].basecostId);
  7244. } else {
  7245. formData.append("basecostId", 0);
  7246. }
  7247. if(this.user.timeType.customDegreeActive){
  7248. if (this.user.timeType.customDegreeMultiple) {
  7249. if (zhoD[j].multiDegrIdArray) {
  7250. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7251. } else {
  7252. formData.append('multiDegrId','[]')
  7253. }
  7254. } else {
  7255. if (zhoD[j].degreeId) {
  7256. formData.append('degreeId',zhoD[j].degreeId)
  7257. } else {
  7258. formData.append('degreeId','-1')
  7259. }
  7260. }
  7261. }else{
  7262. formData.append("degreeId", "-1");
  7263. }
  7264. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7265. formData.append('customData',zhoD[j].customData)
  7266. }else if(this.user.timeType.customDataActive){
  7267. formData.append('customData',0)
  7268. }
  7269. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7270. formData.append('customText',zhoD[j].customText)
  7271. }else if(this.user.timeType.customTextActive){
  7272. formData.append('customText','-')
  7273. }
  7274. }
  7275. }
  7276. }
  7277. } else {
  7278. for (var i in this.zhoData) {
  7279. var zhoD = this.zhoData[i]
  7280. var flgs = false
  7281. if(this.reportTimeType.type == 2) {
  7282. for(var k in this.selProjectList) {
  7283. var pItem = this.selProjectList[k];
  7284. var pName = pItem.projectName;
  7285. var j = pName;
  7286. console.log('j==周报中的项目='+j);
  7287. if(zhoD[j].time && zhoD[j].time != 'null') {
  7288. flgs = true
  7289. // formData.append("degreeId", "-1");
  7290. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7291. if (this.isSubstitude) {
  7292. formData.append('targetUids',this.workForm.userId[0]);
  7293. }
  7294. for(var s in this.projectList) {
  7295. if(j == this.projectList[s].projectName) {
  7296. formData.append("projectId", this.projectList[s].id);
  7297. }
  7298. }
  7299. if(this.user.timeType.reportAuditType == 3){
  7300. let audItem = {}
  7301. if(this.user.timeType.auditLevel > 0){
  7302. audItem.auditorFirst = zhoD[j].auditorFirst
  7303. }
  7304. if(this.user.timeType.auditLevel > 1){
  7305. audItem.auditorSec = zhoD[j].auditorSec
  7306. }
  7307. if(this.user.timeType.auditLevel > 2){
  7308. audItem.auditorThird = zhoD[j].auditorThird
  7309. }
  7310. if(zhoD[j].ccUserid){
  7311. audItem.ccUserid = zhoD[j].ccUserid
  7312. }
  7313. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7314. }
  7315. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7316. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7317. formData.append("reportTimeType", this.reportTimeType.type);
  7318. formData.append("endTime", zhoD[j].time[1]);
  7319. formData.append("startTime", zhoD[j].time[0]);
  7320. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7321. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7322. formData.append("isOvertime", 0)
  7323. formData.append("professionProgress", "[]")
  7324. if (zhoD[j].groupId) {
  7325. formData.append("groupId",zhoD[j].groupId)
  7326. } else {
  7327. //解决后台groupId数组越界的问题
  7328. formData.append("groupId",0)
  7329. }
  7330. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7331. formData.append("createDate",zhoD.zhoDataTime)
  7332. if (zhoD[j].projectAuditorId) {
  7333. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7334. }
  7335. if(zhoD[j].basecostId) {
  7336. formData.append("basecostId", zhoD[j].basecostId);
  7337. } else {
  7338. formData.append("basecostId", 0);
  7339. }
  7340. if(this.user.timeType.customDegreeActive){
  7341. if (this.user.timeType.customDegreeMultiple) {
  7342. if (zhoD[j].multiDegrIdArray) {
  7343. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7344. } else {
  7345. formData.append("multiDegrId", "[]");
  7346. }
  7347. } else {
  7348. if (zhoD[j].degreeId) {
  7349. formData.append('degreeId',zhoD[j].degreeId)
  7350. } else {
  7351. formData.append("degreeId", "-1");
  7352. }
  7353. }
  7354. }else{
  7355. formData.append("degreeId", "-1");
  7356. }
  7357. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7358. formData.append('customData',zhoD[j].customData)
  7359. }else if(this.user.timeType.customDataActive){
  7360. formData.append('customData',0)
  7361. }
  7362. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7363. formData.append('customText',zhoD[j].customText)
  7364. }else if(this.user.timeType.customTextActive){
  7365. formData.append('customText','-')
  7366. }
  7367. }
  7368. }
  7369. } else {
  7370. for(var k in this.selProjectList) {
  7371. var pItem = this.selProjectList[k];
  7372. var pName = pItem.projectName;
  7373. var j = pName;
  7374. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7375. flgs = true
  7376. // formData.append("degreeId", "-1");
  7377. console.log('进入了workFpppp==='+j);
  7378. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7379. if (this.isSubstitude) {
  7380. formData.append('targetUids',this.workForm.userId[0]);
  7381. }
  7382. for(var s in this.projectList) {
  7383. if(j == this.projectList[s].projectName) {
  7384. formData.append("projectId", this.projectList[s].id);
  7385. }
  7386. }
  7387. if(this.user.timeType.reportAuditType == 3){
  7388. let audItem = {}
  7389. if(this.user.timeType.auditLevel > 0){
  7390. audItem.auditorFirst = zhoD[j].auditorFirst
  7391. }
  7392. if(this.user.timeType.auditLevel > 1){
  7393. audItem.auditorSec = zhoD[j].auditorSec
  7394. }
  7395. if(this.user.timeType.auditLevel > 2){
  7396. audItem.auditorThird = zhoD[j].auditorThird
  7397. }
  7398. if(zhoD[j].ccUserid){
  7399. audItem.ccUserid = zhoD[j].ccUserid
  7400. }
  7401. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7402. }
  7403. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7404. // formData.append("subProjectId", zhoD[j].subProjectId);
  7405. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7406. formData.append("reportTimeType", this.reportTimeType.type);
  7407. if(this.reportTimeType.type == 1) {
  7408. formData.append("workingTime", zhoD[j].workingTime);
  7409. } else if(this.reportTimeType.type == 2) {
  7410. formData.append("endTime", zhoD[j].time[1]);
  7411. formData.append("startTime", zhoD[j].time[0]);
  7412. } else if(this.reportTimeType.type == 3) {
  7413. formData.append("progress", zhoD[j].progress);
  7414. formData.append("workingTime", zhoD[j].workingTime);
  7415. }
  7416. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7417. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7418. formData.append("isOvertime", 0)
  7419. formData.append("professionProgress", "[]")
  7420. if (zhoD[j].groupId) {
  7421. formData.append("groupId",zhoD[j].groupId)
  7422. } else {
  7423. //解决后台groupId数组越界的问题
  7424. formData.append("groupId",0)
  7425. }
  7426. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7427. formData.append("createDate",zhoD.zhoDataTime)
  7428. if (zhoD[j].projectAuditorId) {
  7429. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7430. }
  7431. if(zhoD[j].basecostId) {
  7432. formData.append("basecostId", zhoD[j].basecostId);
  7433. } else {
  7434. formData.append("basecostId", 0);
  7435. }
  7436. if(this.user.timeType.customDegreeActive){
  7437. if (this.user.timeType.customDegreeMultiple) {
  7438. if (zhoD[j].multiDegrIdArray) {
  7439. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7440. } else {
  7441. formData.append("multiDegrId", "[]");
  7442. }
  7443. } else {
  7444. if (zhoD[j].degreeId) {
  7445. formData.append('degreeId',zhoD[j].degreeId)
  7446. } else {
  7447. formData.append("degreeId", "-1");
  7448. }
  7449. }
  7450. }else{
  7451. formData.append("degreeId", "-1");
  7452. }
  7453. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7454. formData.append('customData',zhoD[j].customData)
  7455. }else if(this.user.timeType.customDataActive){
  7456. formData.append('customData',0)
  7457. }
  7458. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7459. formData.append('customText',zhoD[j].customText)
  7460. }else if(this.user.timeType.customTextActive){
  7461. formData.append('customText','-')
  7462. }
  7463. }
  7464. }
  7465. }
  7466. }
  7467. }
  7468. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7469. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7470. if(!next) {
  7471. this.$message({
  7472. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7473. type: 'error'
  7474. })
  7475. return
  7476. }
  7477. // 自定义维度
  7478. this.submitingReport = true;
  7479. this.http.uploadFile( this.port.report.editPort, formData,
  7480. res => {
  7481. // this.listLoading = false;
  7482. this.submitingReport = false;
  7483. if (res.code == "ok") {
  7484. this.$message({
  7485. message: this.$t('message.fillinsuccessfully'),
  7486. type: "success"
  7487. });
  7488. this.fillWeekDialogVisi = false
  7489. this.selConShow = true
  7490. this.zhoData = []
  7491. this.weekDateRange = ''
  7492. this.getReportList();
  7493. this.getDepartment();
  7494. // 关闭弹窗 并 清空
  7495. this.selProjectList = []
  7496. this.selCon = []
  7497. this.getRecentlyProject()
  7498. } else {
  7499. this.$message({
  7500. message: res.msg,
  7501. type: "error"
  7502. });
  7503. }
  7504. },
  7505. error => {
  7506. this.submitingReport = false;
  7507. this.$message({
  7508. message: error,
  7509. type: "error"
  7510. });
  7511. });
  7512. },
  7513. handleGroupAuditorData(data) {
  7514. const { reportAuditType } = this.user.timeType
  7515. if(reportAuditType != 1 && reportAuditType != 2) {
  7516. return {next: true}
  7517. }
  7518. let arrList = [];
  7519. Object.entries(data).forEach(([key, obj]) => {
  7520. Object.entries(obj).forEach(([projectName, projectData]) => {
  7521. if (projectData.workingTime && !projectData.groupId) {
  7522. arrList.push({
  7523. projectName,
  7524. date: obj.zhoDataTime,
  7525. dateText: obj.zhoDataTimeTxt
  7526. });
  7527. }
  7528. });
  7529. });
  7530. if(arrList.length > 0) {
  7531. return {
  7532. next: false,
  7533. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7534. }
  7535. } else {
  7536. return {
  7537. next: true,
  7538. error: [],
  7539. }
  7540. }
  7541. },
  7542. ChangeHourMinutestr (str) {
  7543. if (str !== "0" && str !== "" && str !== null) {
  7544. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7545. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7546. } else {
  7547. return "";
  7548. }
  7549. },
  7550. // 得到两个日期中间的日期
  7551. getdiffdate(stime,etime){
  7552. //初始化日期列表,数组
  7553. var diffdate = new Array();
  7554. var i=0;
  7555. //开始日期小于等于结束日期,并循环
  7556. while(stime<=etime){
  7557. diffdate[i] = stime;
  7558. //获取开始日期时间戳
  7559. var stime_ts = new Date(stime).getTime();
  7560. //增加一天时间戳后的日期
  7561. var next_date = stime_ts + (24*60*60*1000);
  7562. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7563. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7564. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7565. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7566. stime = next_dates_y+next_dates_m+next_dates_d;
  7567. //增加数组key
  7568. i++;
  7569. }
  7570. return diffdate;
  7571. },
  7572. // 添加模块
  7573. addDomain(i) {
  7574. var leftProgress = 10;
  7575. if (this.reportTimeType.type == 3) {
  7576. //计算已经待分配工时比例
  7577. let array = this.workForm.domains;
  7578. let totalProgress = 0;
  7579. for (var i=0;i<array.length; i++) {
  7580. totalProgress += array[i].progress;
  7581. }
  7582. if (totalProgress < 100) {
  7583. leftProgress = 100 - totalProgress;
  7584. }
  7585. }
  7586. var addItem = {
  7587. projectId: "",
  7588. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7589. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7590. ),
  7591. content: "",
  7592. progress:leftProgress,
  7593. state:2,//2-表示待提交
  7594. multiWorktime: this.reportTimeType.multiWorktime,
  7595. worktimeList:[{}],
  7596. canEdit: true,
  7597. auditorFirst: '',
  7598. auditorSec: '',
  7599. auditorThird: '',
  7600. ccUserid: ''
  7601. // degreeId: '',
  7602. };
  7603. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7604. this.$set(addItem,'isOvertime',true)
  7605. if(this.reportTimeType.type == 3){
  7606. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7607. }
  7608. }
  7609. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7610. //默认给第一个,必填字段
  7611. addItem.basecostId = this.timeBasecostList[0].id;
  7612. }
  7613. this.workForm.domains.push(addItem);
  7614. document.getElementById('workFormsItemBottom').scrollIntoView()
  7615. this.canEdit = true
  7616. if (this.reportTimeType.type == 0) {
  7617. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7618. var length = this.workForm.domains.length;
  7619. if (length == 2) {
  7620. this.showAddMore = false;
  7621. }
  7622. }
  7623. this.chuji()
  7624. this.seleChn()
  7625. },
  7626. // 移除模块
  7627. delDomain(i) {
  7628. this.workForm.domains.splice(i,1)
  7629. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7630. if (!this.originCanEdit) {
  7631. let iscan = false
  7632. for(let i in this.workForm.domains){
  7633. if(this.workForm.domains[i].canEdit){
  7634. iscan = true
  7635. }
  7636. }
  7637. this.canEdit = iscan
  7638. }
  7639. //检测当前剩下的一个,时间类型是否是全天
  7640. if (this.reportTimeType.type == 0) {
  7641. if (this.workForm.domains[0].timeType == 0) {
  7642. this.showAddMore = false;
  7643. } else {
  7644. this.showAddMore = true;
  7645. }
  7646. }
  7647. if(this.user.timeType.multiWorktime == 1) {
  7648. this.iptChangs()
  7649. } else {
  7650. this.seleChn(0)
  7651. }
  7652. },
  7653. // 改变月份
  7654. changeMonth() {
  7655. this.isWeekend = false
  7656. let date = new Date()
  7657. let nowmon = date.getMonth() + 1
  7658. let nowday = date.getDate()
  7659. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7660. if (this.isBatch == 0) {
  7661. if(this.user.timeType.fillAhead == 0){
  7662. let date_a = new Date(this.workForm.createDate)
  7663. if(date_a.getTime() > date.getTime()){
  7664. this.workForm.createDate = nowdate
  7665. }
  7666. }
  7667. //只有按天填报才能获取当天的日报
  7668. if(!this.isSubstitude){
  7669. let weekday = new Date(this.workForm.createDate).getDay()
  7670. if(this.user.companyId == 817){
  7671. if(weekday == 0){
  7672. this.isWeekend = true
  7673. }
  7674. }else{
  7675. if(weekday == 0 || weekday == 6){
  7676. this.isWeekend = true
  7677. }
  7678. }
  7679. this.getReport()
  7680. }
  7681. }else {
  7682. if(this.user.timeType.fillAhead == 0){
  7683. let date_a = new Date(this.workForm.createDate[1])
  7684. if(date_a.getTime() > date.getTime()){
  7685. this.workForm.createDate[1] = nowdate
  7686. let sdate = new Date(this.workForm.createDate[0])
  7687. let edate = new Date(this.workForm.createDate[1])
  7688. if(sdate > edate){
  7689. this.workForm.createDate[0] = this.workForm.createDate[1]
  7690. }
  7691. }
  7692. }
  7693. }
  7694. },
  7695. // 判断时间段
  7696. fns() {
  7697. for (let k in this.dateAr) {
  7698. if (!this.judege(k)) {
  7699. return false
  7700. }
  7701. }
  7702. return true
  7703. },
  7704. judege(idx){
  7705. for (let k in this.dateAr) {
  7706. if (idx !== k) {
  7707. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7708. return false
  7709. }
  7710. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7711. return false
  7712. }
  7713. }
  7714. }
  7715. return true
  7716. },
  7717. getOverlapData(data) {
  7718. let overlapData = [];
  7719. for (let i = 0; i < data.length; i++) {
  7720. for (let j = i + 1; j < data.length; j++) {
  7721. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7722. overlapData.push(data[i], data[j]);
  7723. }
  7724. }
  7725. }
  7726. return overlapData;
  7727. },
  7728. // 保存日报111111
  7729. submitReport(isDraft) {
  7730. this.isDraft = isDraft;
  7731. this.$refs.workForm.validate(valid => {
  7732. if (valid) {
  7733. if (!isDraft) {
  7734. //针对苏州景昱,单独的检查逻辑
  7735. if (this.user.companyId == 5978) {
  7736. //调接口,先检查工时是否存在异常
  7737. var totalTime = 0;
  7738. for (var t=0;t<this.workForm.domains.length; t++) {
  7739. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7740. }
  7741. var array = [];
  7742. if (this.isBatch) {
  7743. var startDate = new Date(this.workForm.createDate[0]);
  7744. var endDate = new Date(this.workForm.createDate[1]);
  7745. if (startDate > endDate) {
  7746. this.$message({
  7747. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7748. type: "error"
  7749. });
  7750. return
  7751. } else {
  7752. while(true){
  7753. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7754. array.push(workData);
  7755. startDate.setDate(startDate.getDate() + 1);
  7756. if (startDate > endDate) {
  7757. break;
  7758. }
  7759. }
  7760. }
  7761. } else {
  7762. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7763. array.push(workData)
  7764. }
  7765. this.submitingReport = true;
  7766. var passUserId = this.user.id;
  7767. if (this.isSubstitude) {
  7768. passUserId = this.targetUids;
  7769. }
  7770. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7771. res => {
  7772. this.submitingReport = false;
  7773. if (res.code == "ok") {
  7774. this.submitReportSon()
  7775. } else {
  7776. this.$confirm(res.msg, this.$t('other.prompts'), {
  7777. confirmButtonText: this.$t('huLveBingTiJiao'),
  7778. cancelButtonText: this.$t('btn.cancel'),
  7779. type: 'error'
  7780. }).then(() => {
  7781. this.submitReportSon()
  7782. }).catch(() => {
  7783. });
  7784. }
  7785. },
  7786. error => {
  7787. this.$message({
  7788. message: error,
  7789. type: "error"
  7790. });
  7791. });
  7792. } else {
  7793. if(this.totalReportHours < this.user.timeType.allday){
  7794. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  7795. confirmButtonText: this.$t('btn.determine'),
  7796. cancelButtonText: this.$t('btn.cancel'),
  7797. type: 'warning'
  7798. }).then(() => {
  7799. this.submitReportSon()
  7800. }).catch(() => {
  7801. });
  7802. }else{
  7803. this.submitReportSon()
  7804. }
  7805. }
  7806. } else {
  7807. //暂存,不需要检查工时是否超过考勤
  7808. this.submitReportSon()
  7809. }
  7810. }
  7811. });
  7812. },
  7813. submitReportSon() {
  7814. this.dateAr = []
  7815. //检查重叠
  7816. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  7817. let alp = []
  7818. if(this.user.timeType.multiWorktime != 1) {
  7819. for(var p in this.workForm.domains) {
  7820. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  7821. let objs = {}
  7822. objs.s = this.workForm.domains[p].startTime
  7823. objs.e = this.workForm.domains[p].endTime
  7824. alp.push(objs)
  7825. }
  7826. }
  7827. this.dateAr = alp
  7828. if(this.dateAr.length > 0) {
  7829. let trus = this.fns()
  7830. if(!trus) {
  7831. this.$message({
  7832. message: this.$t('message.Filledtimeperiodsoverlap'),
  7833. type: "error"
  7834. });
  7835. return
  7836. }
  7837. }
  7838. } else {
  7839. for(var p in this.workForm.domains) {
  7840. var slll = this.workForm.domains[p]
  7841. for(var o in slll.worktimeList) {
  7842. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  7843. let objs = {}
  7844. objs.s = slll.worktimeList[o].startTime
  7845. objs.e = slll.worktimeList[o].endTime
  7846. alp.push(objs)
  7847. }
  7848. }
  7849. }
  7850. this.dateAr = alp
  7851. if(this.dateAr.length > 0) {
  7852. let trus = this.fns()
  7853. if(!trus) {
  7854. this.$message({
  7855. message: this.$t('message.Filledtimeperiodsoverlap'),
  7856. type: "error"
  7857. });
  7858. return
  7859. }
  7860. }
  7861. }
  7862. }
  7863. //检查子项目
  7864. if (this.user.timeType.subProMustFill == 1) {
  7865. for(var p in this.workForm.domains) {
  7866. var oneProItem = this.workForm.domains[p]
  7867. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  7868. //没有选择子项目
  7869. this.$message({
  7870. message: this.$t('ziXiangMuBiTianQingJianCha'),
  7871. type: "error"
  7872. });
  7873. return
  7874. }
  7875. }
  7876. }
  7877. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  7878. if (this.user.companyId == this.yuzhongCompId) {
  7879. for(var p in this.workForm.domains) {
  7880. var oneProItem = this.workForm.domains[p]
  7881. if (!oneProItem.extraField1) {
  7882. this.$message({
  7883. message: this.$t('jiaoSeBiTianQingJianCha'),
  7884. type: "error"
  7885. });
  7886. return
  7887. }
  7888. if (!oneProItem.extraField2) {
  7889. this.$message({
  7890. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  7891. type: "error"
  7892. });
  7893. return
  7894. }
  7895. if (!oneProItem.extraField3) {
  7896. this.$message({
  7897. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  7898. type: "error"
  7899. });
  7900. return
  7901. }
  7902. }
  7903. }
  7904. // return
  7905. //代填的情况,检查人员是否已经选择
  7906. if (this.isSubstitude) {
  7907. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  7908. this.$message({
  7909. message: this.$t('message.pleaseselectthepersontofillin'),
  7910. type: "error"
  7911. });
  7912. return;
  7913. }
  7914. }
  7915. //检查时间,全天和上下午不能同时存在
  7916. if (this.reportTimeType.type == 0) {
  7917. var alldayNum = 0;
  7918. var amNum = 0;
  7919. var pmNum = 0;
  7920. for(var i in this.workForm.domains) {
  7921. if (this.workForm.domains[i].timeType == 0) {
  7922. alldayNum ++;
  7923. } else if (this.workForm.domains[i].timeType == 1) {
  7924. amNum++;
  7925. } else if (this.workForm.domains[i].timeType == 2) {
  7926. pmNum++;
  7927. }
  7928. }
  7929. if (alldayNum > 1) {
  7930. this.$message({
  7931. // message: "工作时间-全天,只能选择一次",
  7932. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  7933. type: "error"
  7934. });
  7935. return;
  7936. }
  7937. if (amNum > 1) {
  7938. this.$message({
  7939. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  7940. type: "error"
  7941. });
  7942. return;
  7943. }
  7944. if (pmNum > 1) {
  7945. this.$message({
  7946. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  7947. type: "error"
  7948. });
  7949. return;
  7950. }
  7951. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  7952. this.$message({
  7953. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  7954. type: "error"
  7955. });
  7956. return;
  7957. }
  7958. } else if (this.reportTimeType.type == 3) {
  7959. //总百分比不能超过100%
  7960. let total = 0;
  7961. this.workForm.domains.forEach(w=>{total += w.progress});
  7962. if (total > 100) {
  7963. this.$message({
  7964. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  7965. type: "error"
  7966. });
  7967. return;
  7968. } else if (total < 100) {
  7969. this.$message({
  7970. message: this.$t('message.cannotbesubmitted'),
  7971. type: "error"
  7972. });
  7973. return;
  7974. }
  7975. }
  7976. this.listLoading = true;
  7977. let formData = new FormData();
  7978. formData.append("draft", this.isDraft);
  7979. var totalTime = 0;
  7980. for (var t=0;t<this.workForm.domains.length; t++) {
  7981. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7982. }
  7983. //批量填报不校验考勤时长,交给后台校验
  7984. if (!this.isBatch) {
  7985. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  7986. if (this.workForm.time){
  7987. if (this.workForm.time.workHours == 0){
  7988. this.$message({
  7989. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7990. type: 'error'
  7991. })
  7992. return
  7993. }
  7994. }else{
  7995. this.$message({
  7996. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  7997. type: 'error'
  7998. })
  7999. return
  8000. }
  8001. }
  8002. }
  8003. //针对凡己和景昱,苏州博海,此处不校验考勤时长
  8004. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.reportTimeType.type == 1 && this.workForm.time) {
  8005. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8006. this.$message({
  8007. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8008. type: "error"
  8009. });
  8010. return;
  8011. }
  8012. }
  8013. for(var i in this.workForm.domains) {
  8014. // 检查任务/里程碑是否为必填
  8015. let taskRequired = this.user.timeType.taskRequired
  8016. if(taskRequired == 1) {
  8017. if(!this.workForm.domains[i].taskId) {
  8018. this.$message({
  8019. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8020. type: "error"
  8021. });
  8022. return
  8023. }
  8024. }
  8025. if(this.user.timeType.reportAuditType == 3){
  8026. let audItem = {}
  8027. let auditRule = ''
  8028. if(this.workForm.domains[i].id){
  8029. audItem.reportId = this.workForm.domains[i].id
  8030. }
  8031. if(this.user.timeType.auditLevel > 0){
  8032. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8033. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8034. }
  8035. if(this.user.timeType.auditLevel > 1){
  8036. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8037. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8038. }
  8039. if(this.user.timeType.auditLevel > 2){
  8040. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8041. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8042. }
  8043. if(this.workForm.domains[i].ccUserid){
  8044. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8045. }
  8046. if(auditRule){
  8047. auditRule = auditRule.substring(0,auditRule.length - 1)
  8048. this.$message({
  8049. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8050. type: 'error'
  8051. })
  8052. return
  8053. }
  8054. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8055. }
  8056. if (this.user.timeType.customDegreeActive) {
  8057. if (this.user.timeType.customDegreeMultiple) {
  8058. //多选
  8059. if (this.workForm.domains[i].multiDegrIdArray) {
  8060. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8061. degreeArray = degreeArray.replace(/,/g,"@");
  8062. formData.append("multiDegrId", degreeArray);
  8063. } else {
  8064. formData.append("multiDegrId", '[]');
  8065. }
  8066. } else {
  8067. //单选
  8068. if (this.workForm.domains[i].degreeId) {
  8069. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8070. } else {
  8071. formData.append("degreeId", -1);
  8072. }
  8073. }
  8074. } else {
  8075. formData.append("degreeId", -1);
  8076. }
  8077. if(this.workForm.domains[i].customData) {
  8078. // var sss = this.workForm.domains[i].degreeId.toString()
  8079. formData.append("customData", this.workForm.domains[i].customData);
  8080. } else {
  8081. formData.append("customData", 0);
  8082. }
  8083. if(this.workForm.domains[i].customText) {
  8084. formData.append("customText", this.workForm.domains[i].customText);
  8085. } else {
  8086. formData.append("customText", '-');
  8087. }
  8088. if (this.workForm.domains[i].id) {
  8089. formData.append("id", this.workForm.domains[i].id);
  8090. } else {
  8091. formData.append("id", -1);
  8092. }
  8093. formData.append("projectId", this.workForm.domains[i].projectId);
  8094. if (this.workForm.domains[i].subProjectId) {
  8095. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8096. } else {
  8097. formData.append("subProjectId", 0);
  8098. }
  8099. if (this.workForm.domains[i].groupId) {
  8100. formData.append("groupId", this.workForm.domains[i].groupId);
  8101. } else {
  8102. formData.append("groupId", 0);
  8103. }
  8104. if (this.workForm.domains[i].taskId) {
  8105. formData.append("taskId", this.workForm.domains[i].taskId);
  8106. } else {
  8107. formData.append("taskId", 0);
  8108. }
  8109. if (this.workForm.domains[i].taskFinish == true) {
  8110. formData.append("taskFinish", 1);
  8111. } else {
  8112. formData.append("taskFinish", 0);
  8113. }
  8114. formData.append("reportTimeType", this.reportTimeType.type);
  8115. if (this.reportTimeType.type == 0) {
  8116. formData.append("timeType", this.workForm.domains[i].timeType);
  8117. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8118. formData.append("workingTime", workingTime);
  8119. } else if (this.reportTimeType.type == 1){
  8120. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8121. } else if (this.reportTimeType.type == 2) {
  8122. formData.append("endTime", this.workForm.domains[i].endTime);
  8123. formData.append("startTime", this.workForm.domains[i].startTime);
  8124. } else if (this.reportTimeType.type == 3) {
  8125. //按比例分配
  8126. formData.append("progress", this.workForm.domains[i].progress);
  8127. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8128. }
  8129. if(this.user.timeType.choseFromAlbum == 1 ) {
  8130. console.log(this.workForm.domains[i].imgList)
  8131. if(this.workForm.domains[i].imgList) {
  8132. let imgListFor = this.workForm.domains[i].imgList
  8133. for(var b in imgListFor) {
  8134. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8135. }
  8136. console.log(imgListFor)
  8137. let m = JSON.stringify(imgListFor);
  8138. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8139. formData.append("picStr", m);
  8140. } else {
  8141. formData.append("picStr", '[]');
  8142. }
  8143. }
  8144. //处理多个时间事项
  8145. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8146. if (this.reportTimeType.multiWorktime == 1) {
  8147. //检查时间是否有重叠
  8148. var workList = this.workForm.domains[i].worktimeList;
  8149. for (var j=0;j<workList.length; j++) {
  8150. var curItem = workList[j];
  8151. //检查开始时间是否大于结束时间
  8152. if (curItem.startTime >= curItem.endTime) {
  8153. this.$message({
  8154. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8155. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8156. type: "error"
  8157. });
  8158. return;
  8159. }
  8160. //时间不可重叠
  8161. if (this.reportTimeType.timeCanOverlap == 0) {
  8162. for (var p = j+1;p<workList.length; p++) {
  8163. var jItem = workList[p];
  8164. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8165. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8166. this.$message({
  8167. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8168. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8169. type: "error"
  8170. });
  8171. return;
  8172. }
  8173. }
  8174. }
  8175. }
  8176. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8177. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8178. formData.append("content", m);
  8179. } else {
  8180. if (this.workForm.domains[i].content) {
  8181. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8182. m = m.replace(/,/g,",");
  8183. console.log(m, '需要传值的数据')
  8184. // formData.append("content", this.workForm.domains[i].content);
  8185. formData.append("content", m);
  8186. } else {
  8187. formData.append("content", '-');
  8188. }
  8189. }
  8190. if (this.isBatch == 0) {
  8191. formData.append("createDate", this.workForm.createDate);
  8192. } else {
  8193. //批量填报,时间范围
  8194. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8195. }
  8196. if(this.workForm.domains[i].isOvertime) {
  8197. formData.append("isOvertime", 1);
  8198. } else {
  8199. formData.append("isOvertime", 0);
  8200. }
  8201. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8202. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8203. } else {
  8204. formData.append("overtimeHours", 0);
  8205. }
  8206. if(this.workForm.domains[i].basecostId) {
  8207. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8208. } else {
  8209. formData.append("basecostId", 0);
  8210. }
  8211. if (this.workForm.userId != null) {
  8212. var targetUids = '';
  8213. this.workForm.userId.forEach(u=>{
  8214. targetUids += u + '@';
  8215. });
  8216. if (targetUids.length > 0) {
  8217. targetUids = targetUids.substring(0, targetUids.length -1);
  8218. formData.append("targetUids", targetUids);
  8219. }
  8220. }
  8221. //项目专业进度
  8222. if (this.workForm.domains[i].professionProgress) {
  8223. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8224. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8225. formData.append("professionProgress", m);
  8226. } else {
  8227. formData.append("professionProgress", "[]");
  8228. }
  8229. if (this.workForm.domains[i].stage) {
  8230. formData.append("stage", this.workForm.domains[i].stage);
  8231. } else {
  8232. formData.append("stage", "-");
  8233. }
  8234. if (this.workForm.domains[i].projectAuditorId) {
  8235. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8236. } else {
  8237. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8238. this.$message({
  8239. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8240. type: "error"
  8241. });
  8242. return;
  8243. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8244. //分组负责人先审核, 确定是选择了任务分组
  8245. if (this.workForm.domains[i].taskGroups.length == 0) {
  8246. this.$message({
  8247. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8248. type: "error"
  8249. });
  8250. return;
  8251. } else if (!this.workForm.domains[i].groupId) {
  8252. // console.log(this.workForm.domains[i]);
  8253. this.$message({
  8254. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8255. type: "error"
  8256. });
  8257. return;
  8258. }
  8259. }
  8260. }
  8261. if (this.user.companyId == this.yuzhongCompId) {
  8262. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8263. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8264. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8265. }
  8266. //依斯贝的服务Id
  8267. if (this.user.companyId == this.yisibeiCompId) {
  8268. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8269. }
  8270. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8271. this.$message({
  8272. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8273. type: "error"
  8274. });
  8275. return
  8276. }
  8277. if(this.user.timeType.userWithMultiDept == 1) {
  8278. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8279. }
  8280. }
  8281. this.submitingReport = true;
  8282. this.http.uploadFile( this.port.report.editPort, formData,
  8283. res => {
  8284. this.listLoading = false;
  8285. this.submitingReport = false;
  8286. if (res.code == "ok") {
  8287. if(res.msg!=null){
  8288. this.$message({
  8289. dangerouslyUseHTMLString: true,
  8290. message: res.msg,
  8291. type: "warning",
  8292. showClose: true,
  8293. duration: 0
  8294. });
  8295. }else{
  8296. this.$message({
  8297. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8298. type: "success"
  8299. });
  8300. }
  8301. this.dialogVisible = false;
  8302. this.jsDay = 0
  8303. this.jsTime = 0
  8304. this.getReportList();
  8305. this.getDepartment();
  8306. this.getRecentlyProject()
  8307. } else {
  8308. this.$message({
  8309. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8310. type: "error"
  8311. });
  8312. }
  8313. },
  8314. error => {
  8315. this.listLoading = false;
  8316. this.submitingReport = false;
  8317. this.$message({
  8318. message: error,
  8319. type: "error"
  8320. });
  8321. });
  8322. },
  8323. // 判断是展示那个工时导入
  8324. imports() {
  8325. if(this.user.timeType.syncCorpwxTime == 0) {
  8326. this.importDialog = true
  8327. } else {
  8328. this.importWxDialog = true
  8329. }
  8330. },
  8331. // 跳转
  8332. junpToDeskTop(id) {
  8333. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8334. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8335. },
  8336. // 通过日报
  8337. approve(id, item) {
  8338. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8339. this.approveinData = {
  8340. id: id,
  8341. date: this.date +day,
  8342. reportIds: item.id
  8343. }
  8344. if(this.user.timeType.needEvaluate == 1){
  8345. this.$set(this.approveinData,'evaluate','')
  8346. this.approveinDialog = true
  8347. }else{
  8348. this.logining = true;
  8349. this.approveinfun()
  8350. }
  8351. },
  8352. approveinfun(){
  8353. this.http.post( this.port.report.approve, this.approveinData,
  8354. res => {
  8355. this.logining = false;
  8356. if (res.code == "ok") {
  8357. this.approveinDialog = false
  8358. this.$message({
  8359. message: this.$t('message.Reviewsucceeded'),
  8360. type: "success"
  8361. });
  8362. this.refreshReportData(this.approveinData.reportIds);
  8363. this.getDepartment();
  8364. } else {
  8365. this.$message({
  8366. message: res.msg,
  8367. type: "error"
  8368. });
  8369. }
  8370. },
  8371. error => {
  8372. this.logining = false;
  8373. this.$message({
  8374. message: error,
  8375. type: "error"
  8376. });
  8377. });
  8378. },
  8379. //撤回日报
  8380. cancel(item,e) {
  8381. // console.log('can can need',item);
  8382. this.logining = true;
  8383. var ids = '';
  8384. var data = e ? item : item.data;
  8385. data.forEach(element => {
  8386. if(element.id){
  8387. ids +=(element.id+',');
  8388. }
  8389. });
  8390. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8391. res => {
  8392. this.logining = false;
  8393. if (res.code == "ok") {
  8394. this.$message({
  8395. message:this.$t('message.Withdrawalsucceeded'),
  8396. type: "success"
  8397. });
  8398. this.getReportList();
  8399. if(e){this.getReport()}
  8400. this.getDepartment();
  8401. } else {
  8402. this.$message({
  8403. message: res.msg,
  8404. type: "error"
  8405. });
  8406. }
  8407. },
  8408. error => {
  8409. this.logining = false;
  8410. this.$message({
  8411. message: error,
  8412. type: "error"
  8413. });
  8414. });
  8415. },
  8416. showDenyDialog(id,i, item) {
  8417. this.denyReasonDialog = true;
  8418. this.isDenying = false;
  8419. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8420. var ids = item.id;
  8421. // var data = item.data;
  8422. // data.forEach(element => {
  8423. // ids +=(element.id+',');
  8424. // });
  8425. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8426. },
  8427. // 未通过日报
  8428. deny() {
  8429. this.logining = true;
  8430. this.isDenying = true;
  8431. this.http.post( this.port.report.deny, this.denyForm,
  8432. res => {
  8433. this.logining = false;
  8434. this.isDenying = false;
  8435. if (res.code == "ok") {
  8436. this.$message({
  8437. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8438. type: "success"
  8439. });
  8440. this.refreshReportData(this.denyForm.reportIds);
  8441. this.getDepartment();
  8442. this.denyReasonDialog = false;
  8443. } else {
  8444. this.$message({
  8445. message: res.msg,
  8446. type: "error"
  8447. });
  8448. }
  8449. },
  8450. error => {
  8451. this.logining = false;
  8452. this.$message({
  8453. message: error,
  8454. type: "error"
  8455. });
  8456. });
  8457. },
  8458. // 查看工时记录弹窗
  8459. toView() {
  8460. this.toViewDialogVisible = true
  8461. this.toViewloading = true
  8462. this.getToView()
  8463. },
  8464. getToView() {
  8465. this.http.post( '/report-import-log/getList', this.toViewForm,
  8466. res => {
  8467. this.toViewloading = false;
  8468. if (res.code == "ok") {
  8469. // console.log(res.data, '数据数据')
  8470. this.toViewList = res.data.records
  8471. this.toViewForm.total = res.data.total
  8472. } else {
  8473. this.toViewloading = false;
  8474. this.$message({
  8475. message: res.msg,
  8476. type: "error"
  8477. });
  8478. }
  8479. })
  8480. },
  8481. // 触发 selectCat 组件更改他的值
  8482. selectCatCli(obj) {
  8483. // console.log(obj, '看看')
  8484. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8485. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8486. },
  8487. vueCasader(obj) {
  8488. console.log(obj, '看看值', this.departmentList)
  8489. if(obj.distinction == 1 && obj.item) {
  8490. let arr = []
  8491. arr.push(obj.item.value)
  8492. this.exportParam.departmentId = arr
  8493. }
  8494. if(obj.distinction == '10' && obj) {
  8495. const { id, other } = obj
  8496. this.workForm.domains[other].reportTargetDeptId = id
  8497. }
  8498. if(obj.distinction == '14' && obj) {
  8499. let arr = []
  8500. arr.push(obj.id)
  8501. this.deptIdForHasReport = arr
  8502. this.showMonthWorkTime()
  8503. }
  8504. if(obj.distinction == '15' && obj) {
  8505. let arr = []
  8506. arr.push(obj.id)
  8507. this.deptIdForNoReport = arr
  8508. this.showMonthNotWorkTime()
  8509. }
  8510. if(obj.distinction == '16' && obj) {
  8511. let arr = []
  8512. arr.push(obj.id)
  8513. this.deptIdForReminder = arr
  8514. this.showMonthWorkTimeReminder()
  8515. }
  8516. },
  8517. //分页
  8518. handleCurrentChange(val) {
  8519. this.toViewForm.pageIndex = val;
  8520. this.getToView();
  8521. },
  8522. handleSizeChange(val) {
  8523. this.toViewForm.pageSize = val;
  8524. this.getToView();
  8525. },
  8526. getAllUsersList(){
  8527. this.http.post('/user/getSimpleActiveUserList',{
  8528. },res => {
  8529. if(res.code == 'ok'){
  8530. this.allUsersList = res.data
  8531. }else{
  8532. this.$message({
  8533. message: res.msg,
  8534. type: 'error'
  8535. })
  8536. }
  8537. },err => {
  8538. this.$message({
  8539. message: err,
  8540. type: 'error'
  8541. })
  8542. })
  8543. },
  8544. //景昱变更提醒
  8545. changeReminder(item){
  8546. console.log("============",item)
  8547. let parameter={
  8548. startDate: this.WorktimeDatepickValue[0],
  8549. endDate: this.WorktimeDatepickValue[1],
  8550. }
  8551. if(item){
  8552. parameter.createDate=item.createDate,
  8553. parameter.userId=item.userId
  8554. }
  8555. this.http.post('/report/changeReminder',parameter,res => {
  8556. if(res.code == 'ok'){
  8557. this.$message({
  8558. message: res.msg,
  8559. type: 'success'
  8560. })
  8561. }else{
  8562. this.$message({
  8563. message: res.msg,
  8564. type: 'error'
  8565. })
  8566. }
  8567. },err => {
  8568. this.$message({
  8569. message: err,
  8570. type: 'error'
  8571. })
  8572. })
  8573. },
  8574. //景昱取消异常
  8575. cancelReminder(item){
  8576. let parameter={}
  8577. if(item){
  8578. parameter.createDate=item.createDate,
  8579. parameter.userId=item.userId
  8580. }
  8581. this.http.post('/report/cancelReminder',parameter,res => {
  8582. if(res.code == 'ok'){
  8583. this.$message({
  8584. message: res.msg,
  8585. type: 'success'
  8586. })
  8587. }else{
  8588. this.$message({
  8589. message: res.msg,
  8590. type: 'error'
  8591. })
  8592. }
  8593. },err => {
  8594. this.$message({
  8595. message: err,
  8596. type: 'error'
  8597. })
  8598. })
  8599. this.showMonthWorkTimeReminder()
  8600. },
  8601. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8602. fillWeekCustomClne() {
  8603. this.fillWeekDialogVisiCustom = false
  8604. },
  8605. fillWeekCustomClneTwo() {
  8606. this.fillWeekDialogVisiCustomTwo = false
  8607. },
  8608. fillWeekCustomSubmit() {
  8609. this.getReportList();
  8610. this.getDepartment();
  8611. this.getRecentlyProject()
  8612. },
  8613. // 待填日报姓名搜索
  8614. nameAearchSeek(flg) {
  8615. if(!this.nameAearch) {
  8616. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8617. return
  8618. }
  8619. if(flg) {
  8620. this.enterpriseWechatgetUser()
  8621. }
  8622. },
  8623. handleThreeData(userList) {
  8624. console.log(userList, '人员数据')
  8625. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8626. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8627. },
  8628. // 过滤树节点
  8629. filterTreeNodes(treeData, filterKeywords) {
  8630. return treeData.filter((node) => {
  8631. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8632. if (node.children && node.children.length > 0) {
  8633. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8634. }
  8635. return true;
  8636. }
  8637. if (node.children && node.children.length > 0) {
  8638. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8639. return node.children.length > 0;
  8640. }
  8641. return false;
  8642. });
  8643. },
  8644. // 企业微信获取人员
  8645. enterpriseWechatgetUser() {
  8646. this.deptMembDataLoading = true
  8647. this.http.post('/user/getEmployeeList',{
  8648. departmentId: -1,
  8649. pageIndex: 1,
  8650. pageSize: 100,
  8651. keyword: this.nameAearch,
  8652. status: '',
  8653. roleId: '',
  8654. cursor: '',
  8655. onlyDirect: '',
  8656. matchingType: ''
  8657. },res => {
  8658. if(res.code == 'ok'){
  8659. this.deptMembDataLoading = false
  8660. const userListName = res.data.records.map(item => item.name)
  8661. this.handleThreeData(userListName)
  8662. setTimeout(() => {
  8663. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8664. }, 200)
  8665. }else{
  8666. this.deptMembDataLoading = false
  8667. this.$message({
  8668. message: res.msg,
  8669. type: 'error'
  8670. })
  8671. }
  8672. },err => {
  8673. this.deptMembDataLoading = false
  8674. this.$message({
  8675. message: err,
  8676. type: 'error'
  8677. })
  8678. })
  8679. },
  8680. changeTreeNodeStatus(node) {
  8681. console.log(node)
  8682. let allZt = true
  8683. node.expanded = allZt
  8684. for (let i = 0; i < node.childNodes.length; i++) {
  8685. node.childNodes[i].expanded = allZt
  8686. if (node.childNodes[i].childNodes.length > 0) {
  8687. this.changeTreeNodeStatus(node.childNodes[i])
  8688. }
  8689. }
  8690. },
  8691. // 按周填报获取相关任务
  8692. async getWeeklyTaskList(item) {
  8693. console.log(item, '<=== 数据')
  8694. const { projectId, groupId, stage, taskId } = item
  8695. console.log(projectId, groupId, stage)
  8696. let parms = { projectId, isSubstitude: 0 }
  8697. groupId ? parms.groupId = groupId : ''
  8698. stage ? parms.stage = stage : ''
  8699. const { data } = await this.postData('/task/getRecentTask', parms)
  8700. this.zhoBao.taskId = taskId
  8701. this.$set(this.zhoBao, 'taskList', data)
  8702. console.log(this.zhoBao)
  8703. },
  8704. // 封装 post 请求
  8705. postData(url, params) {
  8706. return new Promise((resolve, reject) => {
  8707. this.http.post(url, { ...params },
  8708. res => {
  8709. resolve(res)
  8710. },
  8711. error => {
  8712. this.$message({
  8713. message: error,
  8714. type: "error"
  8715. });
  8716. reject(error)
  8717. })
  8718. })
  8719. },
  8720. // 自定义事件
  8721. selectCal(obj) {
  8722. console.log(obj, '传数据来源')
  8723. if(obj.distinction == '1') {
  8724. this.zhoBao.projectAuditorId = obj.id
  8725. } else if(obj.distinction == '2') {
  8726. this.zhoBao.auditorFirst = obj.id
  8727. } else if(obj.distinction == '3') {
  8728. this.zhoBao.auditorSec = obj.id
  8729. } else if(obj.distinction == '4') {
  8730. this.zhoBao.auditorThird = obj.id
  8731. } else if(obj.distinction == '5') {
  8732. this.zhoBao.ccUserid = obj.id
  8733. } else if(obj.distinction == '12') {
  8734. this.usersListId = obj.id
  8735. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8736. this.searchKeyword = obj.name
  8737. } else {
  8738. this.searchKeyword = ''
  8739. }
  8740. this.searchScreen(0)
  8741. } else if(obj.distinction == '13') {
  8742. this.usersListId = obj.id
  8743. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  8744. this.searchKeyword = obj.name
  8745. } else {
  8746. this.searchKeyword = ''
  8747. }
  8748. this.searchScreen(1)
  8749. }
  8750. }
  8751. },
  8752. created() {
  8753. this.getUsers()
  8754. let height = window.innerHeight;
  8755. this.tableHeight = height - 178;
  8756. const that = this;
  8757. window.onresize = function temp() {
  8758. that.tableHeight = window.innerHeight - 178;
  8759. };
  8760. this.toViewForm.companyId = this.user.companyId
  8761. this.initDrag([{
  8762. type: "LR",
  8763. domClass: {
  8764. // 中间分割线的名字
  8765. resize: "line-line",
  8766. // 左侧盒子的名字
  8767. left: "box-left",
  8768. // 右侧盒子的名字
  8769. right: "box-right",
  8770. // 父级的名字
  8771. box: "box-father",
  8772. },
  8773. otherInfo: {
  8774. // 限制左边栏最低宽度
  8775. leftWidth: 120,
  8776. },
  8777. },
  8778. {
  8779. type: "LR",
  8780. domClass: {
  8781. // 中间分割线的名字
  8782. resize: "line-second",
  8783. // 左侧盒子的名字
  8784. left: "left-laowang",
  8785. // 右侧盒子的名字
  8786. right: "box-second-father",
  8787. // 父级的名字
  8788. box: "grand",
  8789. },
  8790. otherInfo: {
  8791. // 限制左边栏最低宽度
  8792. leftWidth: 120,
  8793. },
  8794. },
  8795. ]);
  8796. }
  8797. };
  8798. </script>
  8799. <style lang="scss" scoped>
  8800. .fillWeekDialogVisiCustom {
  8801. width: 100%;
  8802. height: 70vh;
  8803. }
  8804. .fillWeekCustom {
  8805. .el-dialog__body {
  8806. padding: 20px 20px !important;
  8807. }
  8808. }
  8809. .photos {
  8810. position: relative;
  8811. display: flex;
  8812. flex-wrap: wrap;
  8813. }
  8814. .photos_img {
  8815. width: 120px;
  8816. height: 120px;
  8817. margin-right: 20px;
  8818. margin-bottom: 20px;
  8819. cursor: pointer;
  8820. img {
  8821. width: 100%;
  8822. height: 100%;
  8823. }
  8824. }
  8825. .paginatis {
  8826. padding: 10px 10px;
  8827. background: #f2f2f2;
  8828. }
  8829. .waiting {
  8830. color:orange;
  8831. }
  8832. .filledReportStyle {
  8833. color:#32CD32;
  8834. }
  8835. .RejectStyle {
  8836. color:red;
  8837. }
  8838. .waitSubmitStyle{
  8839. color: #409eff;
  8840. }
  8841. .chooseDate {
  8842. .waiting {
  8843. color: #20a0ff;
  8844. }
  8845. .filledReportStyle {
  8846. color:#20a0ff;
  8847. }
  8848. .RejectStyle {
  8849. color: #20a0ff;
  8850. }
  8851. .waitSubmitStyle{
  8852. color: #20a0ff;
  8853. }
  8854. }
  8855. .allDaily {
  8856. width:100%;
  8857. }
  8858. .report_title {
  8859. padding:10px 0;
  8860. color:#666;
  8861. }
  8862. .clearfix {
  8863. overflow-x: auto;
  8864. white-space: nowrap;
  8865. padding: 15px 0 10px 0;
  8866. // overflow-y: hidden;
  8867. .date_item {
  8868. padding: 0 3px;
  8869. cursor: pointer;
  8870. position: relative;
  8871. }
  8872. .chooseDate {
  8873. position: absolute;
  8874. bottom: -3px;
  8875. width: 37px;
  8876. height: 2px;
  8877. left: 14px;
  8878. background: #20a0ff;
  8879. }
  8880. }
  8881. .one_daily {
  8882. i {
  8883. color: #9ed0ff;
  8884. margin-right: 5px;
  8885. }
  8886. .one_daily_body {
  8887. padding: 10px 0px;
  8888. p {
  8889. margin: 0;
  8890. line-height: 30px;
  8891. }
  8892. }
  8893. ul {
  8894. padding: 0;
  8895. }
  8896. }
  8897. .checkbtn {
  8898. float: right;
  8899. margin-top: -10px;
  8900. }
  8901. .selConStyle{
  8902. margin-top:9rem;
  8903. margin-bottom:11rem;
  8904. .selConStyle_title{
  8905. height: 3rem;
  8906. text-align: center;
  8907. font-size: 17px;
  8908. }
  8909. .el-select{
  8910. margin: 0 15%;
  8911. width: 70%;
  8912. }
  8913. }
  8914. </style>
  8915. <style lang="scss">
  8916. /*去除upload组件过渡效果*/
  8917. .photos .el-upload-list__item {
  8918. transition: none !important;
  8919. }
  8920. .daily {
  8921. .el-card__body {
  8922. height: 80%;
  8923. overflow-y: auto;
  8924. }
  8925. .el-card__header {
  8926. padding: 0 20px;
  8927. }
  8928. }
  8929. .membListClass{
  8930. .el-dialog__body{
  8931. padding-top: 10px;
  8932. }
  8933. }
  8934. // .editReportDialog .el-dialog__footer{
  8935. // position: sticky;
  8936. // bottom: 0;
  8937. // background: #fff;
  8938. // height: 70px;
  8939. // z-index: 1010;
  8940. // }
  8941. .editReportDialog{
  8942. min-width: 800px;
  8943. }
  8944. .touruxiangmu{
  8945. max-width: 1000px;
  8946. }
  8947. </style>
  8948. <style scoped>
  8949. /* 项目标签的样式 */
  8950. .el-tag + .el-tag {
  8951. margin-left: 10px;
  8952. }
  8953. .button-new-tag {
  8954. margin-left: 10px;
  8955. height: 32px;
  8956. line-height: 30px;
  8957. padding-top: 0;
  8958. padding-bottom: 0;
  8959. }
  8960. .input-new-tag {
  8961. width: 90px;
  8962. margin-left: 10px;
  8963. vertical-align: bottom;
  8964. }
  8965. .selectworktime .el-table__fixed-body-wrapper{
  8966. top: 48px !important;
  8967. }
  8968. .selectworktime_export .selectworktime_export_l{
  8969. width: 650px;
  8970. float: left;
  8971. height: 42px;
  8972. }
  8973. .approvalProcessBox{
  8974. margin-left: 30px;
  8975. font-size: 14px;
  8976. line-height: 16px;
  8977. cursor: pointer;
  8978. }
  8979. .approvalProcessBox i {
  8980. margin-right: 0;
  8981. height: 16px;
  8982. width: 16px;
  8983. display: inline-block;
  8984. transform: scale(1.2);
  8985. position: relative;
  8986. top: 0.5px;
  8987. color: #409eff;
  8988. }
  8989. .approvalProcessBox .approvalProcessClick{
  8990. cursor: pointer;
  8991. color: #409eff;
  8992. font-size: 14px;
  8993. }
  8994. .approvalProcessBox:hover .approvalProcessClick{
  8995. color: #3485fb;
  8996. }
  8997. </style>
  8998. <style lang="scss" scoped>
  8999. .bionicClass {
  9000. -webkit-appearance: none;
  9001. background-color: #FFF;
  9002. background-image: none;
  9003. border-radius: 4px;
  9004. border: 1px solid #DCDFE6;
  9005. box-sizing: border-box;
  9006. color: #606266;
  9007. display: inline-block;
  9008. height: 40px;
  9009. line-height: 40px;
  9010. outline: 0;
  9011. padding: 0 15px;
  9012. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9013. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9014. width: 350px;
  9015. cursor: pointer;
  9016. .bionicClassText {
  9017. color: #C0C4CC;
  9018. }
  9019. }
  9020. // 加班样式
  9021. .overtime {
  9022. display: inline-block;
  9023. margin-left: 20px;
  9024. input {
  9025. display: inline-block;
  9026. margin-top: 5px;
  9027. }
  9028. }
  9029. .plus {
  9030. display: inline-block;
  9031. }
  9032. // .tages {
  9033. // float: right;
  9034. // }
  9035. .overtime {
  9036. display: inline-block;
  9037. margin-left: 30px;
  9038. }
  9039. .bloks {
  9040. display: inline-block;
  9041. width: 380px;
  9042. }
  9043. .zhiss {
  9044. display: flex;
  9045. justify-content: space-around;
  9046. align-items: center;
  9047. }
  9048. .zhoFel {
  9049. display: flex;
  9050. justify-content: space-between;
  9051. align-items: center;
  9052. }
  9053. // 左右滑动样式
  9054. .line {
  9055. width: 30px;
  9056. /* height: 500px; */
  9057. background: #f2f2f2;
  9058. cursor: w-resize;
  9059. }
  9060. .box-father {
  9061. border: 8px solid #000;
  9062. }
  9063. .line-second {
  9064. width: 10px;
  9065. /* background: red; */
  9066. }
  9067. .flex {
  9068. display: flex;
  9069. width: 100%;
  9070. }
  9071. .box-left {
  9072. flex: 0 0 400px;
  9073. /* height: 600px; */
  9074. /* background: blue; */
  9075. }
  9076. .box-right {
  9077. /* height: 600px; */
  9078. /* background: green; */
  9079. flex: 1;
  9080. }
  9081. .box-postion {
  9082. width: 200px;
  9083. /* height: 400px; */
  9084. background: #ccc;
  9085. }
  9086. .custom-tree-node {
  9087. flex: 1;
  9088. display: flex;
  9089. align-items: center;
  9090. justify-content: space-between;
  9091. font-size: 14px;
  9092. padding-right: 8px;
  9093. }
  9094. .daitianrbao {
  9095. width: 100%;
  9096. box-sizing: border-box;
  9097. height: 40px;
  9098. border-radius: 4px;
  9099. border: 1px solid #DCDFE6;
  9100. overflow: hidden;
  9101. text-overflow: ellipsis;
  9102. display: flex;
  9103. // align-items: center;
  9104. }
  9105. .daitianrbao .spnn {
  9106. display: inline-block;
  9107. box-sizing: border-box;
  9108. padding: 0 15px;
  9109. overflow: hidden;
  9110. text-overflow: ellipsis;
  9111. }
  9112. .daitianrbao .hover {
  9113. color: #DCDFE6 !important;
  9114. }
  9115. </style>