daily.vue 516 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706
  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 class="el-tree-resetStyles" :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="font-size:13px" class="themeFontColor">
  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 && user.timeType.weeklyChargeFilter != 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 && user.timeType.weeklyChargeFilter != 1" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,(user.companyId == 5814||user.companyId==5693 || user.companyId==4407 || user.companyId == 7812 || user.companyId == 481)?2:0)">{{$t('textLink.helpToFillIn')}}</el-link>
  138. <!-- 苏州景昱,按周填报的模式进行代填日报 -->
  139. <el-link type="primary" v-if="user.companyId == 5978 && permissions.reportsFillOut && user.timeType.enableNewWeeklyfill != 1 && user.timeType.weeklyChargeFilter != 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. <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'color:#ff0000;':''">考勤时长:{{item1.cardTime | amounts}}h</span>
  165. <span style="margin-left:10px;">{{$t('other.totalWorkingHours')}}:{{item1.reportTime | amounts}}h</span>
  166. </span>
  167. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  168. <i class="iconfont firerock-iconliucheng1"></i>
  169. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  170. <!-- 审批流程 -->
  171. {{$t('other.approvalProcess')}}
  172. </span>
  173. </span>
  174. </span>
  175. <div class="checkbtn" style="padding-right:20px;">
  176. <!--编辑和删除日报-->
  177. <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>
  178. <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>
  179. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  180. </div>
  181. <div v-if="user.timeType.enableNewWeeklyfill == 1" style="margin-left:20px;">
  182. <p v-if="item1.summary != null" v-html="'<b>'+item1.summaryTitle+'</b><br>'+item1.summary.replace(/[\r\n]/g,'<br>')"> </p>
  183. <p v-if="item1.attachment != null" >附件
  184. <a v-for="file in JSON.parse(item1.attachment)" style="margin-right:5px;" :href="'/upload/'+file.serverName" :download="file.originName">{{ file.originName }}</a>
  185. </p>
  186. </div>
  187. <div class="one_daily_body">
  188. <el-timeline>
  189. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  190. <el-card shadow="never">
  191. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b>
  192. <span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  193. <span v-if="user.company.packageEngineering == 0">
  194. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0">[
  195. <span v-if="user.timeType.reportAuditType == 7" >
  196. {{$t('other.reviewer')}}:<TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" /><span v-if="item2.projectAuditState==1">√</span>
  197. <span v-if="item2.deptAuditorName">、</span>
  198. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.deptAuditorName, renderIndex: 0 }" /><span v-if="item2.departmentAuditState==1">√</span>
  199. </span>
  200. <span v-else>
  201. <span v-if="item2.isDeptAudit==0">
  202. <span v-if="item2.projectAuditState==0">
  203. <!-- 待项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.waitForTheProjectReviewer')}}
  204. <span v-if="item2.projectAuditorName != null">(
  205. <!-- {{item2.projectAuditorName}} -->
  206. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  207. )</span>
  208. <!-- 审核 --> {{$t('other.audit')}}
  209. </span>
  210. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  211. <!-- 项目审核人 --> {{user.companyId == 469?(item2.projectAuditorName=='程君健'?('待总经办'):"待部门主管"):$t('other.projectAuditor')}}
  212. <span v-if="item2.projectAuditorName != null">(
  213. <!-- {{item2.projectAuditorName}} -->
  214. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  215. )</span>
  216. <!-- 审核通过 --> {{$t('state.approved')}}
  217. </span>
  218. </span>
  219. <span v-else-if="item2.isDeptAudit==1">
  220. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  221. ({{$t('other.await')}}
  222. <TranslationOpenData :configurationItems="{ openType: 'departmentName', openId: user.timeType.reportAuditType==4?item2.buDepartmentName:item2.auditDeptName, renderIndex: 0 }" />
  223. {{$t('other.audit')}})
  224. </span>
  225. </span>
  226. ]</span>
  227. <span style="margin-left:15px;color:#FFA500;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  228. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  229. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1 && user.companyId != '3511'">{{$t('other.automaticReview')}}</span>
  230. </span>
  231. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  232. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  233. </span>
  234. <!-- <el-button v-if="(user.role == 1 || user.role == 2) && item2.state != 1 && user.manageDeptId != 0" size="mini" @click="guanli(item2, item1)" style="float: right;">删除</el-button> -->
  235. <span v-if="user.company.packageEngineering == 1">
  236. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  237. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  238. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  239. <span style="margin-left:15px;color:#FFA500;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
  240. (
  241. <!-- <span v-if="user.userNameNeedTranslate != 1">
  242. {{item2.projectAuditorName}}
  243. </span>
  244. <span v-if="user.userNameNeedTranslate == 1">
  245. <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
  246. </span> -->
  247. <TranslationOpenData :configurationItems="{ openType: 'userName', openId: item2.projectAuditorName, renderIndex: 0 }" />
  248. )
  249. </span>{{$t('other.audit')}} ]</span>
  250. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  251. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  252. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  253. </span>
  254. <!--每个项目上单独审核 -->
  255. <span style="float:right;">
  256. <el-button type="primary" size="small" v-if="item2.state == 1&&user.companyId==3092&&user.timeType.pushReportData == 1 && permissions.reportPush" :underline="false" @click="pushWorkTime(item2.id)">{{'推送'}}</el-button>
  257. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="primary" :loading="logining"
  258. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  259. <el-button v-if="item2.state == 0 && (((permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.isDeptAudit==0 && item2.projectAuditState==0) || (item2.isDeptAudit==1 && item2.auditDeptManagerid == user.id))" type="danger" :loading="logining"
  260. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  261. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId || ((user.timeType.reportAuditType== 5 || user.timeType.reportAuditType== 6)&& (user.id == item2.projectAuditorId || (item2.isDeptAudit == 1 && user.id == item2.auditDeptManagerid)))) && item2.state == 1" type="normal" :loading="logining" size="small"
  262. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  263. <!--自己可以撤回待审核状态的报告 -->
  264. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">{{$t('btn.withdraw')}}</el-button>
  265. </span>
  266. </p>
  267. <p v-if="user.companyId == yuzhongCompId">
  268. <span>{{ $t('jiao-se') }} :{{item2.extraField1? roleList.filter(r=>r.value == item2.extraField1)[0].label:''}}</span>
  269. <span style="margin-left:10px;">{{ $t('gongZuoZhiZe') }} :{{ item2.extraField2? item2.extraField2Name:''}}</span>
  270. <span style="margin-left:10px;">{{ $t('gongZuoNeiRong') }} :{{ item2.extraField3? item2.extraField3Name:''}}</span></p>
  271. <!--任务分组和阶段 -->
  272. <p v-if="item2.groupId != 0">
  273. {{$t('other.taskGroup')}}:{{item2.groupName}}
  274. <span v-if="item2.stage != null && item2.stage != '-' && user.companyId != yuzhongCompId && user.timeType.enableNewWeeklyfill != 1" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span>
  275. </p>
  276. <!-- 工单号,行号 -->
  277. <p v-if="user.timeType.reportExtraField4Name">{{ user.timeType.reportExtraField4Name }}: {{ item2.extraField4 }}</p>
  278. <p v-if="user.timeType.reportExtraField5Name">{{ user.timeType.reportExtraField5Name }}: {{ item2.extraField5 }}</p>
  279. <p v-if="user.timeType.customDegreeActive==1 && ((item2.degree_id != null && item2.degree_id != -1) || item2.multiDegrId)">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  280. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  281. <!-- 自定义日报文本 -->
  282. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  283. <p v-if="user.company.packageEngineering == 1">
  284. {{$t('other.professionalProgress')}}:
  285. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  286. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  287. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  288. </el-tooltip>
  289. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  290. <i class="iconfont firerock-iconshenhetongguo"></i>
  291. </el-tooltip>
  292. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  293. <i class="iconfont firerock-iconshenhebohui"></i>
  294. </el-tooltip>
  295. </span>
  296. </p>
  297. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  298. <span style="margin-left:10px;" v-if="user.companyId==3092">-- {{ $t('fuWu') }} :{{ item2.sapServiceName }}</span>
  299. </p>
  300. <div v-if="item2.multiWorktime==0">
  301. <p style="display: inline-block;" v-if="user.timeType.onlyShowPercent==0">{{$t('time.duration')}}:
  302. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  303. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  304. {{item2.time.toFixed(1)}}h
  305. <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>
  306. </p>
  307. <p style="display: inline-block;" v-else>{{$t('lable.percentageOfTime')}}:
  308. <span style="margin-right:10px;">{{item2.progress}}%</span>
  309. </p>
  310. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  311. </div>
  312. <div v-if="item2.multiWorktime==1" >
  313. <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>
  314. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  315. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  316. <p style="display: inline-block;">{{$t('time.duration')}}:
  317. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  318. {{timeItem.time.toFixed(1)}}h
  319. <span v-if="timeItem.detail" style="margin-left:10px;">
  320. {{timeItem.detail}}
  321. </span>
  322. </p>
  323. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  324. </div>
  325. </div>
  326. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  327. <!--照片的显示 -->
  328. <p v-if="item2.pics != null && item2.pics.length > 0">
  329. <el-image v-for="(pic, index) in item2.pics" :key="index"
  330. style="width: 100px; height: 100px; margin-right:10px;"
  331. :src="pic"
  332. :preview-src-list="item2.pics">
  333. </el-image>
  334. </p>
  335. </el-card>
  336. </el-timeline-item>
  337. </el-timeline>
  338. </div>
  339. </div>
  340. <div v-if="hasMore && !listLoading" style="width:100%;font-size:17px;text-align:center;padding-bottom:15px;"><el-link @click="reqMore" :underline=false class="themeFontColor">{{ $t('jiaZaiGengDuoRiBao') }}</el-link></div>
  341. <!-- 简陋的无报告提示 -->
  342. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. </div>
  348. </el-card>
  349. </div>
  350. <!-- 工时推送日志弹窗 -->
  351. <el-dialog :title="$t('gongShiTuiSongRiZhi')" :visible.sync="pushWorkTimeLogDig" width="70%" :before-close="handleClose">
  352. <template>
  353. <el-button type="primary" size="small" style="float: right" @click="exportPushLog">{{ $t('export.export') }}</el-button>
  354. </template>
  355. <template>
  356. <el-table :data="pushWorkTimeLogData" style="width: 100%" height="500" >
  357. <el-table-column prop="syncTime" :label="$t('tuiSongShiJian')" width="150"></el-table-column>
  358. <el-table-column prop="remark" :label="$t('tuiSongMingCheng')" width="180"></el-table-column>
  359. <el-table-column prop="operator" :label="$t('caozuo')" width="150"></el-table-column>
  360. <el-table-column prop="syncType" :label="$t('tuiSongFangShi')" width="150"></el-table-column>
  361. <el-table-column prop="result" :label="$t('tuiSongJieGuo')" width="250">
  362. <template slot-scope="scope">
  363. <span style="color:green;" v-if="scope.row.result.includes($t('other.successful'))">{{scope.row.result}}</span>
  364. <span style="color:red;" v-if="scope.row.result.includes($t('shiBai'))">{{scope.row.result}}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column prop="resultRemark" :label="$t('bei-zhu')" width="400"></el-table-column>
  368. </el-table>
  369. </template>
  370. <span slot="footer" class="dialog-footer">
  371. <el-button type="primary" @click="pushWorkTimeLogDig = false">{{ $t('guanBi') }}</el-button>
  372. </span>
  373. </el-dialog>
  374. <!-- 填写日报的dialog -->
  375. <el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
  376. <div style="height: 65vh;overflow: auto;">
  377. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  378. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  379. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
  380. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" style="width:200px;"></el-input>
  381. <div class="daitianrbao" @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" style="width:200px;">
  382. <span class="spnn" v-if="workForm.userNames">
  383. <span v-for="(item, index) in workForm.userNames" :key="index">
  384. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  385. <span v-if="index < workForm.userNames.length - 1">,</span>
  386. </span>
  387. </span>
  388. <span class="spnn hover" v-else>
  389. {{$t('defaultText.pleaseSelectAsubstitute')}}
  390. </span>
  391. </div>
  392. </el-form-item>
  393. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  394. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  395. :style="'width:'+(isBatch==0?'200':'320')+'px;'" :type="isBatch==0?'date':'daterange'"
  396. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  397. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  398. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}</div>
  399. <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>
  400. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3&& user.company.companyName != mingyiName" style="margin-left:5px;" @change="changeAllTime"
  401. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  402. <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
  403. <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
  404. <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>
  405. <!-- AI智能填报 -->
  406. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  407. </el-form-item>
  408. <!--考勤时长显示-->
  409. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh">
  410. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  411. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  412. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  413. </span>
  414. <!--批量填报不显示考勤记录-->
  415. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  416. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  417. <span v-if="!isSubstitude && isBatch && user.company.companyName === mingyiName">,{{ $t('workAttendance') }}:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  418. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  419. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  420. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  421. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  422. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  423. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  424. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  425. v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh"
  426. @click="refreshAttendance(workForm.createDate)"></el-button>
  427. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  428. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  429. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  430. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  431. </el-form-item>
  432. <!-- 000000 -->
  433. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  434. <div v-if="reportTimeType.multiWorktime==0">
  435. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  436. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  437. <el-select v-model="domain.timeType" style="width:200px;"
  438. v-if="reportTimeType.type == 0"
  439. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  440. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  441. @change="onTimeTypeChange(domain.timeType)">
  442. <el-option
  443. v-for="item in timeType"
  444. :key="item.value"
  445. :label="item.label"
  446. :value="item.value">
  447. </el-option>
  448. </el-select>
  449. <!-- 数字时长选择 -->
  450. <el-select v-model="domain.workingTime" style="width:200px;"
  451. v-if="reportTimeType.type == 1"
  452. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  453. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  454. @change="seleChn(0,domain)">
  455. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  456. </el-select>
  457. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  458. <span v-if="reportTimeType.type == 2">
  459. <!--时间范围选择 -->
  460. <el-time-picker
  461. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  462. v-model="domain.startTime"
  463. :placeholder="$t('time.startTime')"
  464. style="width:120px;"
  465. format="HH:mm"
  466. value-format="HH:mm"
  467. :picker-options="{
  468. start: '08:00',
  469. end: '23:30'
  470. }"
  471. @change="iptChang()">
  472. </el-time-picker> - <el-time-picker
  473. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  474. v-model="domain.endTime"
  475. :placeholder="$t('time.endTime')"
  476. style="width:120px;"
  477. format="HH:mm"
  478. value-format="HH:mm"
  479. :picker-options="{
  480. start: '08:00',
  481. end: '23:30',
  482. minTime: domain.startTime
  483. }"
  484. @change="iptChang()">
  485. </el-time-picker>
  486. </span>
  487. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  488. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  489. <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>
  490. </div>
  491. </el-form-item>
  492. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  493. :prop="'domains.' + index + '.reportTargetDeptId'"
  494. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  495. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  496. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  497. <span style="float: left">
  498. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  499. </span>
  500. </el-option>
  501. </el-select>
  502. <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>
  503. </el-form-item>
  504. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  505. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  506. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  507. @change="selectProject(domain, index)"
  508. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  509. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  510. <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">
  511. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  512. <span style="float: right;">{{ item.projectName }}</span>
  513. </el-option>
  514. </el-option-group>
  515. </el-select>
  516. <!--昱众不显示子项目-->
  517. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  518. <span style="margin-left:45px;">
  519. {{$t('lable.subproject')}}</span>
  520. <!--子项目 -->
  521. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  522. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  523. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  524. </el-select>
  525. </template>
  526. <template v-if="user.companyId == yuzhongCompId">
  527. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  528. <!--角色选择 -->
  529. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  530. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  531. <el-option
  532. v-for="item in roleList"
  533. :key="item.value"
  534. :label="item.label"
  535. :value="item.value">
  536. </el-option>
  537. </el-select>
  538. </template>
  539. <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%;"
  540. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  541. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  542. </el-link>
  543. <!-- <el-link type="primary" v-if="canEdit"
  544. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  545. </el-form-item>
  546. <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">
  547. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  548. </el-form-item>
  549. <!--如果设置了工时成本预警的预算成本项-->
  550. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  551. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  552. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  553. </el-select>
  554. </el-form-item>
  555. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  556. <template slot="label">
  557. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  558. <span >{{$t('lable.taskGrouping')}}</span>
  559. </template>
  560. <!-- 任务分组 -->
  561. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  562. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  563. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  564. </el-select>
  565. <template v-if="user.companyId == yuzhongCompId">
  566. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  567. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  568. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  569. <el-option
  570. v-for="item in domain.filteredRespList"
  571. :key="item.id"
  572. :label="item.jobRespon"
  573. :value="item.id">
  574. </el-option>
  575. </el-select>
  576. </template>
  577. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  578. <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>
  579. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  580. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  581. @change="changeStages(domain, index)"
  582. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  583. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  584. </el-select>
  585. </template>
  586. </el-form-item>
  587. <!-- 工单号,行号 -->
  588. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  589. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
  590. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  591. </el-option>
  592. </el-select>
  593. </el-form-item>
  594. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  595. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  596. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  597. </el-option>
  598. </el-select>
  599. </el-form-item>
  600. <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">
  601. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  602. <template slot="label">
  603. <span style="color:#FF0000;">*</span>
  604. <span >{{$t('other.projectAuditor')}}</span>
  605. </template>
  606. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  607. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  608. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  609. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  610. </el-option>
  611. </el-select>
  612. <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>
  613. </el-form-item>
  614. </div>
  615. <el-form-item v-if="user.companyId == yuzhongCompId">
  616. <template slot="label">
  617. <span style="color:#FF0000;">*</span>
  618. <span >{{ $t('gongZuoNeiRong') }}</span>
  619. </template>
  620. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  621. :disabled="(workForm.domains[index].state>=2?false:true)" >
  622. <el-option
  623. v-for="item in domain.workContentList"
  624. :key="item.id"
  625. :label="item.workContext"
  626. :value="item.id">
  627. </el-option>
  628. </el-select>
  629. </el-form-item>
  630. <!-- 111111 -->
  631. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  632. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  633. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  634. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  635. <span v-else>{{item.name}}</span>
  636. </el-option>
  637. </el-select>
  638. <template v-if="user.timeType.auditLevel > 1">
  639. <i class="el-icon-right"></i>
  640. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  641. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  642. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  643. <span v-else>{{item.name}}</span>
  644. </el-option>
  645. </el-select>
  646. </template>
  647. <template v-if="user.timeType.auditLevel > 2">
  648. <i class="el-icon-right"></i>
  649. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  650. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  651. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  652. <span v-else>{{item.name}}</span>
  653. </el-option>
  654. </el-select>
  655. </template>
  656. </el-form-item>
  657. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  658. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  659. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  660. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  661. <span v-else>{{item.name}}</span>
  662. </el-option>
  663. </el-select>
  664. </el-form-item>
  665. <!-- 相关维度/自定义维度 -->
  666. <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'">
  667. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  668. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  669. </el-option>
  670. </el-select>
  671. </el-form-item>
  672. <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'">
  673. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  674. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  675. </el-option>
  676. </el-select>
  677. </el-form-item>
  678. <!-- 相关数值 -->
  679. <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">
  680. <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>
  681. </el-form-item>
  682. <!-- 自定义文本 -->
  683. <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">
  684. <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>
  685. </el-form-item>
  686. <!--按比例填报-->
  687. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  688. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  689. <div style="width:400px;">
  690. <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>
  691. <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>
  692. </div>
  693. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  694. <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>
  695. </div>
  696. </el-form-item>
  697. <!--工程专业版本模式下, 各个专业的进度填报 -->
  698. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  699. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  700. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  701. <el-input size="mini" style="width:60px;" v-model="item.progress"
  702. @keyup.native="onProgressChange"
  703. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  704. </span>
  705. </el-form-item>
  706. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  707. <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))" >
  708. <template slot="label" v-if="user.timeType.taskRequired == 1">
  709. <span style="color:#FF0000;">*</span>
  710. <span >{{ $t('other.task') }}</span>
  711. </template>
  712. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  713. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  714. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  715. </el-select>
  716. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  717. </el-form-item>
  718. <!--针对依斯贝的SAP服务-->
  719. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  720. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  721. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  722. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  723. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  724. </el-select>
  725. </el-form-item>
  726. <!--工作事项-->
  727. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  728. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  729. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  730. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  731. </el-form-item>
  732. <!-- 拍照上传 -->
  733. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  734. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  735. <div class="photos">
  736. <div>
  737. <el-upload
  738. list-type="picture-card"
  739. :http-request="(file) => {return addImg(file, index)}"
  740. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  741. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  742. :file-list="domain.imgListUrl" :limit="9"
  743. :disabled="workForm.domains[index].state>=2?false:true">
  744. <i class="el-icon-plus"></i>
  745. </el-upload>
  746. </div>
  747. </div>
  748. </el-form-item>
  749. </div>
  750. <!--多个工作事项填报的情况 -->
  751. <div v-if="reportTimeType.multiWorktime==1">
  752. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  753. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  754. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  755. @change="selectProject(domain, index)"
  756. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  757. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  758. <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">
  759. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  760. <span style="float: right;">{{ item.projectName }}</span>
  761. </el-option>
  762. </el-option-group>
  763. </el-select>
  764. <template v-if="user.timeType.mainProjectState != 1">
  765. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  766. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  767. <!--子项目 -->
  768. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  769. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  770. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  771. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  772. </el-select>
  773. </template>
  774. <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;"
  775. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  776. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  777. </el-link>
  778. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  779. <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>
  780. </div>
  781. <!-- <el-link type="primary" v-if="canEdit"
  782. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  783. </el-form-item>
  784. <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">
  785. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  786. </el-form-item>
  787. <!--如果设置了工时成本预警的预算成本项-->
  788. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  789. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  790. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  791. </el-select>
  792. </el-form-item>
  793. <el-form-item v-if="user.company.packageProject == 1">
  794. <template slot="label">
  795. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  796. <span >{{$t('lable.taskGrouping')}}</span>
  797. </template>
  798. <!-- 任务分组 -->
  799. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  800. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  801. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  802. </el-select>
  803. <!-- 项目的阶段 -->
  804. <span v-if="domain.stages != null && domain.stages.length> 0"
  805. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  806. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  807. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  808. @change="changeStages(domain, index)"
  809. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  810. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  811. </el-select>
  812. </el-form-item>
  813. <el-form-item :label="$t('other.projectAuditor')" >
  814. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  815. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  816. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  817. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  818. </el-option>
  819. </el-select>
  820. <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>
  821. </el-form-item>
  822. <!--工程专业版本模式下, 各个专业的进度填报 -->
  823. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  824. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  825. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  826. <el-input size="mini" style="width:60px;" v-model="item.progress"
  827. @keyup.native="onProgressChange"
  828. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  829. </span>
  830. </el-form-item>
  831. <!-- 相关维度 -->
  832. <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'">
  833. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  834. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  835. </el-option>
  836. </el-select>
  837. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  838. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  839. </el-option>
  840. </el-select>
  841. </el-form-item>
  842. <!-- 相关数值 -->
  843. <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">
  844. <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>
  845. </el-form-item>
  846. <!-- 自定义文本 -->
  847. <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">
  848. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  849. </el-form-item>
  850. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  851. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  852. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  853. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  854. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  855. </el-select>
  856. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  857. </el-form-item>
  858. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  859. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  860. <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>
  861. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  862. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  863. <span v-if="reportTimeType.type == 2">
  864. <!-- <span> -->
  865. <!--时间范围选择 -->
  866. <el-time-picker
  867. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  868. v-model="timeItem.startTime"
  869. :placeholder="$t('time.startTime')"
  870. style="width:120px;"
  871. format="HH:mm"
  872. value-format="HH:mm"
  873. :picker-options="{
  874. start: '00:00',
  875. end: '23:59',
  876. }"
  877. @change="iptChangs()">
  878. </el-time-picker> - <el-time-picker
  879. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  880. v-model="timeItem.endTime"
  881. :placeholder="$t('time.endTime')"
  882. style="width:120px;"
  883. format="HH:mm"
  884. value-format="HH:mm"
  885. :picker-options="{
  886. start: '00:00',
  887. end: '23:59',
  888. minTime: timeItem.startTime
  889. }"
  890. @change="iptChangs()">
  891. </el-time-picker>
  892. </span>
  893. <!--工作细项-->
  894. <el-select v-model="timeItem.detail" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;" filterable="true" v-if="multiOptionData.length>0 && user.canFillMoreOption"
  895. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  896. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  897. </el-select>
  898. </el-form-item>
  899. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  900. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  901. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  902. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  903. ></el-input>
  904. </el-form-item>
  905. </div>
  906. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  907. </div>
  908. <!--照片的显示 -->
  909. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  910. <el-image v-for="(pic, index) in domain.pics" :key="index"
  911. style="width: 100px; height: 100px; margin-right:10px;"
  912. :src="pic"
  913. :preview-src-list="domain.pics">
  914. </el-image>
  915. </p>
  916. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  917. </div>
  918. <span id="workFormsItemBottom"></span>
  919. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  920. </el-form>
  921. </div>
  922. <span slot="footer" class="dialog-footer">
  923. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  924. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  925. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  926. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  927. <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>
  928. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  929. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  930. </span>
  931. </el-dialog>
  932. <!-- 按周填报 -->
  933. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  934. <!-- 按周填报-已填工时-点击 -->
  935. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  936. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  937. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  938. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  939. <el-table-column prop="state" :label="$t('state.states')">
  940. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  941. </el-table-column>
  942. </el-table>
  943. <span slot="footer" class="dialog-footer">
  944. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  945. </span>
  946. </el-dialog>
  947. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  948. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  949. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  950. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  951. <span class="spnn" v-if="workForm.userNames">
  952. <span v-for="(item, index) in workForm.userNames" :key="index">
  953. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  954. <span v-if="index < workForm.userNames.length - 1">,</span>
  955. </span>
  956. </span>
  957. <span class="spnn hover" v-else>
  958. {{$t('defaultText.pleaseSelectAsubstitute')}}
  959. </span>
  960. </div>
  961. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  962. </div>
  963. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  964. <el-form-item style="height:30px;margin-top:-72px;">
  965. <!-- <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> -->
  966. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  967. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  968. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  969. <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>
  970. <el-option
  971. v-for="item in fillProjectList"
  972. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  973. :key="item.id"
  974. :label="item.projectName + '\u3000' + item.projectCode"
  975. :value="item.id">
  976. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  977. <span style="float: right">{{ item.projectName }}</span>
  978. </el-option>
  979. </el-select>
  980. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  981. </el-form-item>
  982. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  983. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  984. <template slot-scope="scope">
  985. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  986. </template>
  987. </el-table-column>
  988. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  989. <template slot-scope="scope">
  990. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  991. <p v-else></p>
  992. </template>
  993. </el-table-column> -->
  994. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  995. <template slot-scope="scope">
  996. <div v-if="scope.row.canFill == 1">
  997. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  998. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  999. <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)" @input="onInputWorkTime(scope.$index)"></el-input-number>
  1000. <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
  1001. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1002. </div>
  1003. </template>
  1004. <template v-else>
  1005. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1006. <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>
  1007. <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>
  1008. <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>
  1009. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1010. </div>
  1011. </template>
  1012. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1013. <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>
  1014. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1015. </div>
  1016. </div>
  1017. <div v-else >
  1018. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1019. </div>
  1020. </template>
  1021. </el-table-column>
  1022. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1023. <template slot-scope="scope">
  1024. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1025. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1026. </span>
  1027. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1028. </template>
  1029. </el-table-column>
  1030. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1031. <template slot-scope="scope">
  1032. <div class="zhiss">
  1033. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1034. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1035. </div>
  1036. </template>
  1037. </el-table-column>
  1038. </el-table>
  1039. </el-form>
  1040. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1041. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1042. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1043. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1044. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1045. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1046. <!--针对景昱,先检查工时是否存在异常-->
  1047. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1048. </span>
  1049. </el-dialog>
  1050. <!-- 重庆物奇私人定制的按周填报 -->
  1051. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1052. <div class="fillWeekDialogVisiCustom">
  1053. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1054. </div>
  1055. </el-dialog>
  1056. <!-- enableNewWeeklyfill==2 -->
  1057. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1058. <div class="fillWeekDialogVisiCustom">
  1059. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1060. </div>
  1061. </el-dialog>
  1062. <!-- 选择时间 -->
  1063. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1064. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1065. <span slot="footer" class="dialog-footer">
  1066. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1067. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1068. </span>
  1069. </el-dialog>
  1070. <!-- 按周填报弹窗 -->
  1071. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1072. <div>
  1073. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1074. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1075. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1076. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1077. </el-select>
  1078. </div>
  1079. <!--如果设置了工时成本预警的预算成本项-->
  1080. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1081. <p>{{$t('lable.budgetSource')}}</p>
  1082. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1083. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1084. </el-select>
  1085. </div>
  1086. <!-- 任务分组 -->
  1087. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1088. <p>{{$t('lable.taskGrouping')}}</p>
  1089. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1090. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1091. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1092. </el-select>
  1093. </div>
  1094. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1095. <p>{{$t('other.inputStage')}}</p>
  1096. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1097. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1098. </el-select>
  1099. </div>
  1100. <!-- 工单号,行号 -->
  1101. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1102. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1103. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1104. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1105. </el-option>
  1106. </el-select>
  1107. </div>
  1108. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1109. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1110. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1111. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1112. </el-option>
  1113. </el-select>
  1114. </div>
  1115. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1116. <p>{{$t('other.reviewer')}}</p>
  1117. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1118. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1119. </el-select>
  1120. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1121. </div>
  1122. <template v-if="user.timeType.reportAuditType == 3">
  1123. <div class="zhoFel">
  1124. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1125. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1126. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1127. </el-select>
  1128. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1129. </div>
  1130. <div class="zhoFel">
  1131. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1132. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1133. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1134. </el-select>
  1135. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1136. </div>
  1137. <div class="zhoFel">
  1138. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1139. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1140. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1141. </el-select>
  1142. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1143. </div>
  1144. <div class="zhoFel">
  1145. <p>{{ $t('chao-song-ren') }}</p>
  1146. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1147. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1148. </el-select>
  1149. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1150. </div>
  1151. </template>
  1152. <!-- 自定义维度 -->
  1153. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1154. <p>{{user.timeType.customDegreeName}}</p>
  1155. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1156. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1157. </el-select>
  1158. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1159. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1160. </el-select>
  1161. </div>
  1162. <!-- 自定义数值 -->
  1163. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1164. <p>{{user.timeType.customDataName}}</p>
  1165. <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>
  1166. </div>
  1167. <!-- 自定义文本 -->
  1168. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1169. <p>{{user.timeType.customTextName}}</p>
  1170. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1171. </div>
  1172. <!-- 选择任务 -->
  1173. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1174. <p>{{ $t('renWuLiChengBei') }}</p>
  1175. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1176. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1177. </el-select>
  1178. </div>
  1179. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1180. <p>{{$t('other.timeSelection')}}</p>
  1181. <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>
  1182. </div>
  1183. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1184. <p>{{$t('other.chooseDuration')}}</p>
  1185. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1186. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1187. </el-select>
  1188. </div>
  1189. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1190. <p>{{$t('lable.percentageOfTime')}}</p>
  1191. <div style="width:400px;display: flex;align-items: center;">
  1192. <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>
  1193. <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>
  1194. </div>
  1195. </div>
  1196. <div class="zhoFel">
  1197. <p>{{$t('other.workMatters')}}</p>
  1198. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1199. </div>
  1200. </div>
  1201. <span slot="footer" class="dialog-footer">
  1202. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1203. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1204. </span>
  1205. </el-dialog>
  1206. <!--导出报表条件选择 -->
  1207. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1208. <el-form ref="form3" :model="exportParam" >
  1209. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1210. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1211. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1212. </el-select>
  1213. </el-form-item>
  1214. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1215. <!-- <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>
  1216. <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> -->
  1217. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1218. </el-form-item>
  1219. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1220. <el-date-picker
  1221. v-model="exportParam.dateRange" :editable="false"
  1222. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1223. :range-separator="$t('other.to')"
  1224. type="daterange"
  1225. :start-placeholder="$t('time.startDate')"
  1226. :end-placeholder="$t('time.endDate')"
  1227. ></el-date-picker>
  1228. </el-form-item>
  1229. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1230. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1231. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1232. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1233. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1234. </el-select>
  1235. </el-form-item>
  1236. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1237. <div class="exportReportRadio">
  1238. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1239. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1240. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1241. <i class="el-icon-question"></i>
  1242. </el-tooltip>
  1243. </div>
  1244. </el-form-item>
  1245. </el-form>
  1246. <div slot="footer" class="dialog-footer">
  1247. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1248. </div>
  1249. </el-dialog>
  1250. <!--导出报表条件选择 -->
  1251. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1252. <el-form ref="form3" :model="exportParam" >
  1253. <el-form-item prop="range" :label="$t('time.dateRange')">
  1254. <el-date-picker
  1255. v-model="exportParam.dateRange" :editable="false"
  1256. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1257. :clearable="true"
  1258. :range-separator="$t('other.to')"
  1259. type="daterange"
  1260. :start-placeholder="$t('time.startDate')"
  1261. :end-placeholder="$t('time.endDate')"
  1262. ></el-date-picker>
  1263. </el-form-item>
  1264. </el-form>
  1265. <div slot="footer" class="dialog-footer">
  1266. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1267. </div>
  1268. </el-dialog>
  1269. <!--人员列表 -->
  1270. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1271. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1272. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1273. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1274. <el-table-column type="selection"></el-table-column>
  1275. <el-table-column prop="label" :label="$t('lable.name')" >
  1276. <template slot-scope="scope">
  1277. <span>
  1278. <!-- {{(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}} -->
  1279. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1280. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1281. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1282. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1283. </span>
  1284. <span v-else>
  1285. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1286. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1287. </span>
  1288. </span>
  1289. </template>
  1290. </el-table-column>
  1291. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1292. <template slot-scope="scope">
  1293. <div>
  1294. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1295. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1296. </div>
  1297. </template>
  1298. </el-table-column>
  1299. </el-table>
  1300. </el-tab-pane>
  1301. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1302. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1303. <el-table-column prop="label" :label="$t('lable.name')" >
  1304. <template slot-scope="scope">
  1305. <!-- <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> -->
  1306. <!-- <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> -->
  1307. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1308. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1309. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1310. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1311. </span>
  1312. <span v-else>
  1313. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1314. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1315. </span>
  1316. </template>
  1317. </el-table-column>
  1318. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1319. <template slot-scope="scope">
  1320. <div>
  1321. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1322. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1323. </div>
  1324. </template>
  1325. </el-table-column>
  1326. </el-table>
  1327. </el-tab-pane>
  1328. </el-tabs>
  1329. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1330. <el-table-column type="selection"></el-table-column>
  1331. <el-table-column prop="label" :label="$t('lable.name')" >
  1332. <template slot-scope="scope">
  1333. <div>
  1334. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1335. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1336. </div>
  1337. </template>
  1338. </el-table-column>
  1339. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1340. <template slot-scope="scope">
  1341. <div>
  1342. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1343. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1344. </div>
  1345. </template>
  1346. </el-table-column>
  1347. </el-table>
  1348. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1349. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1350. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1351. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1352. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1353. </div>
  1354. </el-dialog>
  1355. <!-- 日报审核修改 -->
  1356. <el-dialog
  1357. :title="$t('riBaoShenHeXiuGai')"
  1358. :visible.sync="reportLogCheckDialog"
  1359. width="30%"
  1360. :before-close="handleClose">
  1361. <el-form ref="form3" :model="exportReportLogParam" >
  1362. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1363. <el-date-picker
  1364. v-model="exportReportLogParam.dateRange" :editable="false"
  1365. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1366. :range-separator="$t('other.to')"
  1367. type="daterange"
  1368. :start-placeholder="$t('time.startDate')"
  1369. :end-placeholder="$t('time.endDate')"
  1370. ></el-date-picker>
  1371. </el-form-item>
  1372. </el-form>
  1373. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1374. <br>
  1375. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1376. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1377. <span slot="footer" class="dialog-footer">
  1378. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1379. </span>
  1380. </el-dialog>
  1381. <!-- 按部门选择人员 -->
  1382. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1383. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1384. <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)">
  1385. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1386. </el-input>
  1387. <div class="tree" style="height:400px">
  1388. <el-scrollbar style="height:100%">
  1389. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1390. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1391. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1392. <span class="custom-tree-node" slot-scope="{ node }">
  1393. <span v-if="user.userNameNeedTranslate == '1'">
  1394. <span v-if="node.data.children">
  1395. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1396. </span>
  1397. <span v-else>
  1398. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1399. </span>
  1400. </span>
  1401. <span v-if="user.userNameNeedTranslate != '1'">
  1402. {{ node.label }}
  1403. </span>
  1404. <!-- {{ node.label }} -->
  1405. </span>
  1406. </el-tree>
  1407. </el-scrollbar>
  1408. </div>
  1409. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1410. <div slot="footer" class="dialog-footer">
  1411. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1412. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1413. </div>
  1414. </el-dialog>
  1415. <el-dialog
  1416. v-if="monthWorkTimeDialog"
  1417. :visible.sync="monthWorkTimeDialog"
  1418. :close-on-click-modal="false"
  1419. customClass="customWidth selectworktime"
  1420. width="92%"
  1421. top="60px"
  1422. >
  1423. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1424. <el-tabs v-model="activeName" @tab-click="handleClick">
  1425. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1426. <div class="selectworktime_export" style="margin-top:10px;">
  1427. <div class="selectworktime_export_l">
  1428. <el-date-picker
  1429. class="selecteworktime_datapick"
  1430. v-model="WorktimeDatepickValue"
  1431. value-format="yyyy-MM-dd"
  1432. type="daterange"
  1433. align="right"
  1434. unlink-panels
  1435. :range-separator="$t('other.to')"
  1436. :start-placeholder="$t('time.startDate')"
  1437. :end-placeholder="$t('time.endDate')"
  1438. :default-time="['12:00:00', '12:00:00']"
  1439. size="small"
  1440. popper-class="selecteorktime_datapick_popper"
  1441. @change="showMonthWorkTime()"
  1442. >
  1443. </el-date-picker>
  1444. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1445. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1446. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1447. <!-- 222 -->
  1448. </div>
  1449. <div>
  1450. <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>
  1451. <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>
  1452. <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">
  1453. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1454. </el-input>
  1455. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1456. </div>
  1457. <div style="float: left; height:32px; padding-top:10px;">
  1458. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1459. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1460. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1461. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1462. </div>
  1463. <div style="float: right; vertical-align: middle;height:32px">
  1464. <el-link
  1465. type="primary"
  1466. @click="exportMembWorkHours()"
  1467. >{{$t('export.exportData')}}</el-link
  1468. >
  1469. </div>
  1470. </div>
  1471. <el-table ref="hasworkTbl"
  1472. :data="monthWorkDataS"
  1473. v-el-table-infinite-scroll="listScroll"
  1474. border
  1475. :height="'70vh'"
  1476. highlight-current-row
  1477. style="width: 100%"
  1478. v-loading="tbload"
  1479. :lazy="true"
  1480. :cell-style="hasworkTblCellStyle"
  1481. >
  1482. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1483. <template slot-scope="scope">
  1484. {{ scope.$index + 1 }}
  1485. </template>
  1486. </el-table-column>
  1487. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1488. <template slot-scope="scope">
  1489. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1490. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1491. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1492. <!-- {{scope.row.name}} -->
  1493. </span>
  1494. </template>
  1495. </el-table-column>
  1496. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1497. <template slot-scope="scope">
  1498. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1499. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1500. </template>
  1501. </el-table-column>
  1502. <el-table-column
  1503. min-width="60"
  1504. v-for="(item, index) in pickDateArray"
  1505. :key="index"
  1506. :label="item"
  1507. align="center"
  1508. >
  1509. <template slot="header" slot-scope="scope">
  1510. <div>{{ scope.column.label.dateStr }}</div>
  1511. <div>{{ scope.column.label.weekStr }}</div>
  1512. </template>
  1513. <template slot-scope="scope">
  1514. <div
  1515. v-if="
  1516. scope.row.worktimeList.filter(
  1517. (w) =>
  1518. w.createDate==item.date
  1519. ).length > 0 &&
  1520. scope.row.worktimeList.filter(
  1521. (w) =>w.createDate==item.date
  1522. )[0].workingTime < reportTimeType.allday
  1523. "
  1524. >
  1525. {{
  1526. scope.row.worktimeList.filter(
  1527. (w) =>w.createDate==item.date
  1528. )[0].workingTime.toFixed(1)
  1529. }}
  1530. </div>
  1531. <div
  1532. v-if="
  1533. scope.row.worktimeList.filter(
  1534. (w) =>w.createDate==item.date
  1535. ).length > 0 &&
  1536. scope.row.worktimeList.filter(
  1537. (w) =>w.createDate==item.date
  1538. )[0].workingTime > reportTimeType.allday
  1539. "
  1540. >
  1541. {{
  1542. scope.row.worktimeList.filter(
  1543. (w) =>w.createDate==item.date
  1544. )[0].workingTime.toFixed(1)
  1545. }}
  1546. </div>
  1547. <div
  1548. v-if="
  1549. scope.row.worktimeList.filter(
  1550. (w) =>w.createDate==item.date
  1551. ).length > 0 &&
  1552. scope.row.worktimeList.filter(
  1553. (w) =>w.createDate==item.date
  1554. )[0].workingTime == reportTimeType.allday
  1555. "
  1556. >
  1557. {{
  1558. scope.row.worktimeList.filter(
  1559. (w) =>w.createDate==item.date
  1560. )[0].workingTime
  1561. }}
  1562. </div>
  1563. <div
  1564. v-if="
  1565. scope.row.worktimeList.filter(
  1566. (w) =>w.createDate==item.date
  1567. ).length == 0
  1568. "
  1569. >
  1570. 0
  1571. </div>
  1572. <div
  1573. v-if="
  1574. scope.row.worktimeList.filter(
  1575. (w) =>w.createDate==item.date
  1576. ).length > 0 &&
  1577. typeof scope.row.worktimeList.filter(
  1578. (w) =>w.createDate==item.date
  1579. )[0].workingTime == 'string'
  1580. "
  1581. >
  1582. {{
  1583. scope.row.worktimeList.filter(
  1584. (w) =>w.createDate==item.date
  1585. )[0].workingTime
  1586. }}
  1587. </div>
  1588. </template>
  1589. </el-table-column>
  1590. </el-table>
  1591. <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>
  1592. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1593. </el-tab-pane>
  1594. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1595. <div class="selectworktime_export" style="margin-top:10px">
  1596. <div class="selectworktime_export_l">
  1597. <el-date-picker
  1598. class="selecteworktime_datapick"
  1599. v-model="WorktimeDatepickValue"
  1600. value-format="yyyy-MM-dd"
  1601. type="daterange"
  1602. align="right"
  1603. unlink-panels
  1604. :range-separator="$t('other.to')"
  1605. :start-placeholder="$t('time.startDate')"
  1606. :end-placeholder="$t('time.endDate')"
  1607. :default-time="['12:00:00', '12:00:00']"
  1608. size="small"
  1609. popper-class="selecteorktime_datapick_popper"
  1610. @change="showMonthNotWorkTime()"
  1611. >
  1612. </el-date-picker>
  1613. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1614. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1615. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1616. </div>
  1617. <div>
  1618. <div style="margin-top:10px;">
  1619. <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>
  1620. <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>
  1621. <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">
  1622. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1623. </el-input>
  1624. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1625. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1626. <el-link
  1627. type="primary"
  1628. style="float: right; vertical-align: middle;height:32px"
  1629. @click="exportMembNotWorkHours()"
  1630. >{{$t('export.exportData')}}</el-link
  1631. >
  1632. </div>
  1633. </div>
  1634. </div>
  1635. <el-table
  1636. ref="hasworkTbl2"
  1637. :data="monthNotWorkDateS"
  1638. v-el-table-infinite-scroll="notListScroll"
  1639. border
  1640. :height="'70vh'"
  1641. highlight-current-row
  1642. style="width: 100%"
  1643. v-loading="tbload"
  1644. lazy
  1645. >
  1646. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1647. <template slot-scope="scope">
  1648. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1649. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1650. </template>
  1651. </el-table-column>
  1652. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1653. <template slot-scope="scope">
  1654. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1655. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1656. </template>
  1657. </el-table-column>
  1658. <el-table-column
  1659. min-width="200"
  1660. :label="$t('weekDay.date')"
  1661. align="center"
  1662. prop="createDate"
  1663. >
  1664. </el-table-column>
  1665. <el-table-column
  1666. min-width="200"
  1667. :label="$t('state.states')"
  1668. align="center"
  1669. prop="status"
  1670. />
  1671. <el-table-column
  1672. min-width="200"
  1673. :label="$t('other.attendanceData')"
  1674. prop="cardTime"
  1675. align="center"
  1676. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1677. </el-table>
  1678. <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>
  1679. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1680. </el-tab-pane>
  1681. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="(user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1) && user.companyId!=5978">
  1682. <div class="selectworktime_export" style="margin-top:10px">
  1683. <div class="selectworktime_export_l">
  1684. <el-date-picker
  1685. class="selecteworktime_datapick"
  1686. v-model="notfullSelectDateMonth"
  1687. value-format="yyyy-MM"
  1688. type="month"
  1689. align="right"
  1690. unlink-panels
  1691. size="small"
  1692. popper-class="selecteorktime_datapick_popper"
  1693. @change="showReportTimeLessThanCardTimeList()"
  1694. >
  1695. </el-date-picker>
  1696. </div>
  1697. <div>
  1698. <div style="margin-top:10px;">
  1699. <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="showReportTimeLessThanCardTimeList()"></el-cascader>
  1700. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subject="trandepartmentList" :radios="true" :distinction="'17'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" :selectNameChuan="$t('other.allDepartments')"></vueCascader>
  1701. <el-input style="width:200px;margin-left: 15px" v-if="user.userNameNeedTranslate != '1'" @keyup.enter.native="searchScreen(2)" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1702. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1703. </el-input>
  1704. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1705. <div style="float: right; vertical-align: middle;height:32px">
  1706. <el-link
  1707. type="primary" v-loading="remindering"
  1708. @click="batchRejectAndRemind()" >一键驳回并提醒</el-link>
  1709. <!-- <el-link
  1710. type="primary"
  1711. @click="exportMembWorkHoursReminder()"
  1712. >{{$t('export.exportData')}}</el-link> -->
  1713. </div>
  1714. <!-- <el-link
  1715. type="primary"
  1716. style="float: right; vertical-align: middle;height:32px"
  1717. @click="exportMembNotWorkHours()"
  1718. >{{$t('export.exportData')}}</el-link
  1719. > -->
  1720. </div>
  1721. </div>
  1722. </div>
  1723. <el-table
  1724. ref="hasworkTbl4"
  1725. :data="notFullData"
  1726. border
  1727. :height="'70vh'"
  1728. highlight-current-row
  1729. style="width: 100%"
  1730. v-loading="tbload"
  1731. lazy
  1732. >
  1733. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1734. <template slot-scope="scope">
  1735. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1736. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1737. </template>
  1738. </el-table-column>
  1739. <el-table-column
  1740. min-width="200"
  1741. :label="$t('weekDay.date')"
  1742. align="center"
  1743. prop="createDate"
  1744. >
  1745. </el-table-column>
  1746. <el-table-column
  1747. min-width="200"
  1748. :label="$t('fillReportTime')"
  1749. align="center"
  1750. prop="reportTime"
  1751. />
  1752. <el-table-column
  1753. min-width="200"
  1754. :label="$t('workAttendance')"
  1755. prop="workHours"
  1756. align="center"></el-table-column>
  1757. </el-table>
  1758. </el-tab-pane>
  1759. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1760. <div class="selectworktime_export" style="margin-top:10px;">
  1761. <div class="selectworktime_export_l">
  1762. <el-date-picker
  1763. class="selecteworktime_datapick"
  1764. v-model="WorktimeDatepickValue"
  1765. value-format="yyyy-MM-dd"
  1766. type="daterange"
  1767. align="right"
  1768. unlink-panels
  1769. :range-separator="$t('other.to')"
  1770. :start-placeholder="$t('time.startDate')"
  1771. :end-placeholder="$t('time.endDate')"
  1772. :default-time="['12:00:00', '12:00:00']"
  1773. size="small"
  1774. popper-class="selecteorktime_datapick_popper"
  1775. @change="showMonthWorkTimeReminder()"
  1776. >
  1777. </el-date-picker>
  1778. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1779. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1780. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1781. </div>
  1782. <div>
  1783. <div style="margin-top:10px;">
  1784. <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>
  1785. <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>
  1786. <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">
  1787. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1788. </el-input>
  1789. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1790. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1791. </div>
  1792. </div>
  1793. <div style="float: right; vertical-align: middle;height:32px">
  1794. <el-link
  1795. type="primary" v-loading="remindering"
  1796. @click="changeReminder()"
  1797. >{{ $t('bianGengTiXing') }}</el-link>
  1798. <el-link
  1799. type="primary"
  1800. @click="exportMembWorkHoursReminder()"
  1801. >{{$t('export.exportData')}}</el-link>
  1802. </div>
  1803. </div>
  1804. <el-table ref="hasworkTbl"
  1805. :data="monthWorkDataS"
  1806. v-el-table-infinite-scroll="listScroll"
  1807. border
  1808. :height="'70vh'"
  1809. highlight-current-row
  1810. style="width: 100%"
  1811. v-loading="tbload"
  1812. :lazy="true"
  1813. >
  1814. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1815. <template slot-scope="scope">
  1816. {{ scope.row.createDate}}
  1817. </template>
  1818. </el-table-column>
  1819. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1820. <template slot-scope="scope">
  1821. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1822. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1823. <!-- {{scope.row.name}} -->
  1824. </template>
  1825. </el-table-column>
  1826. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1827. <template slot-scope="scope">
  1828. {{scope.row.invokeValue}}
  1829. </template>
  1830. </el-table-column>
  1831. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1832. <template slot-scope="scope">
  1833. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1834. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1835. </template>
  1836. </el-table-column>
  1837. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1838. <template slot-scope="scope">
  1839. {{ scope.row.workingTime}}
  1840. </template>
  1841. </el-table-column>
  1842. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1843. <template slot-scope="scope">
  1844. {{ scope.row.cardTime}}
  1845. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1846. </template>
  1847. </el-table-column>
  1848. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1849. <template slot-scope="scope">
  1850. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1851. </template>
  1852. </el-table-column>
  1853. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1854. <template slot-scope="scope">
  1855. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1856. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1857. </template>
  1858. </el-table-column>
  1859. </el-table>
  1860. <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>
  1861. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1862. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1863. <label style="font-size: 16px">员工每日已填报工时数</label>
  1864. <el-link
  1865. type="primary"
  1866. style="float: right; margin-right: 60px"
  1867. @click="exportMembWorkHours()"
  1868. >导出已填报数据</el-link
  1869. > -->
  1870. <!-- <el-button >导出</el-button> -->
  1871. <!-- </div> -->
  1872. </el-tab-pane>
  1873. </el-tabs>
  1874. </el-dialog>
  1875. <!--驳回弹出框 -->
  1876. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1877. <div>
  1878. <span style="color:red;">*</span><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')" />
  1879. </div>
  1880. <div slot="footer" class="dialog-footer">
  1881. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1882. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1883. </div>
  1884. </el-dialog>
  1885. <!-- 通过弹出框 -->
  1886. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1887. <div>
  1888. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1889. </div>
  1890. <div slot="footer" class="dialog-footer">
  1891. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1892. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1893. </div>
  1894. </el-dialog>
  1895. <!--批量导入日报 -->
  1896. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1897. <p>1. {{$t('other.download')}}
  1898. <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>
  1899. </p>
  1900. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1901. <p style="display: flex;justify-content: center;">
  1902. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1903. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1904. </el-upload>
  1905. </p>
  1906. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1907. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1908. </div>
  1909. </el-dialog>
  1910. <!-- 工时导入记录弹窗 -->
  1911. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1912. <div style="height: 452px">
  1913. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1914. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1915. <el-table-column prop="userName" :label="$t('other.operator')">
  1916. <template slot-scope="scope">
  1917. <div>
  1918. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1919. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1920. </div>
  1921. </template>
  1922. </el-table-column>
  1923. <el-table-column prop="datel" :label="$t('other.document')">
  1924. <template slot-scope="scope">
  1925. <div>
  1926. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1927. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1928. </div>
  1929. </template>
  1930. </el-table-column>
  1931. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1932. <template slot-scope="scope">
  1933. <div>
  1934. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1935. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1936. </div>
  1937. </template>
  1938. </el-table-column>
  1939. </el-table>
  1940. <el-col :span="24" class="paginatis">
  1941. <el-pagination
  1942. @size-change="handleSizeChange"
  1943. @current-change="handleCurrentChange"
  1944. :page-sizes="[20 , 50 , 80 , 100]"
  1945. :page-size="20"
  1946. layout="total, sizes, prev, pager, next"
  1947. :total="toViewForm.total"
  1948. style="float:right;"
  1949. ></el-pagination>
  1950. </el-col>
  1951. </div>
  1952. </el-dialog>
  1953. <!--基于企业微信考勤数据的工时导入 -->
  1954. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1955. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1956. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1957. </el-step>
  1958. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1959. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1960. </el-steps>
  1961. <div v-if="active==0" style="padding:30px;height:360px;">
  1962. <div style="margin-top:50px;margin-left:280px;">
  1963. <el-date-picker
  1964. v-model="importWxParam.date" :editable="false"
  1965. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1966. :clearable="true"
  1967. :range-separator="$t('other.to')"
  1968. type="daterange"
  1969. :start-placeholder="$t('time.startDate')"
  1970. :end-placeholder="$t('time.endDate')"
  1971. @change="loadCheckInData"
  1972. ></el-date-picker>
  1973. </div>
  1974. </div>
  1975. <div v-if="active==1" style="padding:10px;">
  1976. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1977. style="width: 100%;margin-top:5px;" >
  1978. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1979. <template slot-scope="scope">
  1980. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1981. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1982. </template>
  1983. </el-table-column>
  1984. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1985. </el-table-column>
  1986. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1987. <el-table-column prop="username" :label="$t('screening.employeename')" >
  1988. <template slot-scope="scope">
  1989. <div>
  1990. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  1991. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  1992. </div>
  1993. </template>
  1994. </el-table-column>
  1995. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  1996. <template slot-scope="scope">
  1997. <div>
  1998. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1999. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  2000. </div>
  2001. </template>
  2002. </el-table-column>
  2003. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  2004. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  2005. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  2006. <template slot-scope="scope">
  2007. {{scope.row.workHours.toFixed(1)}}h
  2008. </template>
  2009. </el-table-column>
  2010. </el-table>
  2011. </div>
  2012. <div v-if="active==2" >
  2013. <p style="display: flex;justify-content: center;height:390px;">
  2014. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2015. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2016. </el-upload>
  2017. </p>
  2018. </div>
  2019. <div slot="title">
  2020. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2021. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2022. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2023. <el-link v-if="active==0 && ((showHidden && user.companyId == 469) || user.companyId == 7703) && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2024. <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>
  2025. <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>
  2026. </div>
  2027. <span slot="footer">
  2028. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2029. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2030. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2031. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2032. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2033. </span>
  2034. </el-dialog>
  2035. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2036. <p style="display: flex;justify-content: center;height:100px;">
  2037. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2038. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2039. </el-upload>
  2040. </p>
  2041. </el-dialog>
  2042. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2043. <div>
  2044. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2045. v-model="deleteReportParam.date" :editable="false"
  2046. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2047. :clearable="true"
  2048. :range-separator="$t('other.to')"
  2049. type="daterange"
  2050. :start-placeholder="$t('time.startDate')"
  2051. :end-placeholder="$t('time.endDate')"
  2052. ></el-date-picker>
  2053. </div>
  2054. <div style="margin-top:10px;">
  2055. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2056. <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>
  2057. <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>
  2058. </div>
  2059. <div style="margin-top:10px;">
  2060. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2061. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2062. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2063. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2064. <span v-else>{{item.name}}</span>
  2065. </el-option>
  2066. </el-select>
  2067. </div>
  2068. <span slot="footer">
  2069. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2070. </span>
  2071. </el-dialog>
  2072. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2073. <div>
  2074. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2075. v-model="deleteReportParam.date" :editable="false"
  2076. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2077. :clearable="true"
  2078. :range-separator="$t('other.to')"
  2079. type="daterange"
  2080. :start-placeholder="$t('time.startDate')"
  2081. :end-placeholder="$t('time.endDate')"
  2082. ></el-date-picker>
  2083. </div>
  2084. <div style="margin-top:15px;">
  2085. <span>{{ $t('other.selectdepartment') }}:</span>
  2086. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2087. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2088. size="small" v-if="user.userNameNeedTranslate != 1"
  2089. ></el-cascader>
  2090. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2091. </div>
  2092. <span slot="footer">
  2093. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2094. </span>
  2095. </el-dialog>
  2096. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2097. <div>
  2098. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2099. v-model="modImportTime"
  2100. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2101. :clearable="true"
  2102. type="datetime"
  2103. ></el-date-picker>
  2104. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2105. v-model="modImportUserId"
  2106. >
  2107. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2108. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2109. <span v-else>{{item.name}}</span>
  2110. </el-option>
  2111. </el-select>
  2112. </div>
  2113. <span slot="footer">
  2114. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2115. </span>
  2116. </el-dialog>
  2117. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2118. <div>
  2119. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2120. <el-date-picker
  2121. v-model="ratioYmonth" :editable="false"
  2122. format="yyyyMM" value-format="yyyyMM"
  2123. type="month"
  2124. ></el-date-picker>
  2125. </div>
  2126. <span slot="footer">
  2127. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2128. </span>
  2129. </el-dialog>
  2130. <!--工时批量代填 -->
  2131. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2132. <div>
  2133. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2134. v-model="importWxParam.date" :editable="false"
  2135. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2136. :clearable="true"
  2137. :range-separator="$t('other.to')"
  2138. type="daterange"
  2139. :start-placeholder="$t('time.startDate')"
  2140. :end-placeholder="$t('time.endDate')"
  2141. @change="loadCheckInData"
  2142. ></el-date-picker>
  2143. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2144. </div>
  2145. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2146. :key="timeStamp"
  2147. style="width: 100%;margin-top:5px;" ref="tab">
  2148. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2149. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2150. <template slot-scope="scope">
  2151. <div>
  2152. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2153. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2154. </div>
  2155. </template>
  2156. </el-table-column>
  2157. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2158. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2159. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2160. <template slot-scope="scope">
  2161. {{scope.row.workHours.toFixed(1)}}h
  2162. </template>
  2163. </el-table-column>
  2164. <!--项目名称列表 -->
  2165. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2166. <template slot-scope="scope">
  2167. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2168. </template>
  2169. </el-table-column>
  2170. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2171. <template slot-scope="scope">
  2172. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2173. </template>
  2174. </el-table-column>
  2175. </el-table>
  2176. </el-dialog>
  2177. <!--基于企业微信考勤数据的工时导入 -->
  2178. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2179. <div style="padding-bottom:10px;">
  2180. <p>{{importResultMsg}}</p>
  2181. </div>
  2182. <!-- <span slot="footer" class="dialog-footer">
  2183. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2184. </span> -->
  2185. </el-dialog>
  2186. <!-- 审核流程展示 -->
  2187. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2188. <div style="padding:20px 40px 20px 0">
  2189. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2190. <el-step title="待提交"></el-step>
  2191. <el-step title="员工提交"></el-step>
  2192. <el-step title="审核通过"></el-step>
  2193. </el-steps>
  2194. <el-divider v-if="user.companyId == 7544"></el-divider>
  2195. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2196. <el-timeline :reverse="false" style="margin-top:10px;">
  2197. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2198. <!-- {{item.msg}} -->
  2199. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2200. <span v-if="user.userNameNeedTranslate == 1">
  2201. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2202. <span>{{item.msgCon.two}}</span>
  2203. </span>
  2204. </el-timeline-item>
  2205. </el-timeline>
  2206. </div>
  2207. </el-dialog>
  2208. <!-- 威派格定制 -->
  2209. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2210. </section>
  2211. </template>
  2212. <script>
  2213. // 左右滑动
  2214. import dragMixin from "@/common/js/tensile.js";
  2215. import util from "../../common/js/util";
  2216. // 自定义select组件
  2217. import selectCat from "@/components/select.vue"
  2218. // 引入自定义级联组件
  2219. import vueCascader from "@/components/cascader.vue"
  2220. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2221. // 重庆物奇定制组件
  2222. import WeeklyCustomization from "./weeklyCustomization.vue"
  2223. // 威派格定制转移工时
  2224. import TransferWorkingHours from "./transferWorkingHours.vue"
  2225. // 新的按周填报
  2226. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2227. import { mapMutations } from 'vuex'
  2228. let _that = this
  2229. export default {
  2230. mixins: [dragMixin],
  2231. components: {
  2232. selectCat,
  2233. vueCascader,
  2234. WeeklyCustomization,
  2235. vueMultipleDept,
  2236. TransferWorkingHours,
  2237. NewWeeklyCustomization
  2238. },
  2239. data() {
  2240. return {
  2241. remindering: false,
  2242. onlyHaveAttendance: false,
  2243. notFullData:[],
  2244. notFullOriginList:[],
  2245. singleDate:1,
  2246. subFillProjectList:[],
  2247. curAuditNode: 1,
  2248. refreshingTime: false,
  2249. substitudeStep: 1,
  2250. showHidden: false,
  2251. pageIndex: 0,
  2252. hasMore: true,
  2253. exportType: 0,
  2254. exportingData: false,
  2255. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2256. jobResponseList:[],
  2257. yisibeiCompId: 3092,
  2258. yuzhongCompId: 3385,
  2259. mingyiName : '成都明夷电子科技有限公司',
  2260. // mingyiName : '明夷',
  2261. modItemDataId: null,
  2262. modImportTime: null,
  2263. modImportUserId: null,
  2264. showModImportTimeDialog: false,
  2265. showBatchSimpleApproveReport: false,
  2266. startDeleting: false,
  2267. showBatchDeleteReport: false,
  2268. deleteReportParam: {date:null, userIds:[]},
  2269. isDenying: false,
  2270. targetWeekDate: null,//填写周报中的周日期
  2271. importCardTimeVisi: false,
  2272. startRatioExporting: false,
  2273. exportUserRatio: false,
  2274. ratioYmonth:null,
  2275. hasWrittenReport: false,
  2276. today:null,
  2277. syncTimeLoading: false,
  2278. seluserText: '',
  2279. translation: '1', // 1、文字, 2、部门, 3、人员
  2280. exportLoad: false,
  2281. getPickerOptions: {
  2282. disabledDate: (time) => {
  2283. var date = new Date();
  2284. var year = date.getFullYear();
  2285. var month = date.getMonth() + 1;
  2286. if (month >= 1 && month <= 9) {
  2287. month = "0" + month;
  2288. }
  2289. var currentdate = year.toString() + month.toString();
  2290. var timeyear = time.getFullYear();
  2291. var timemonth = time.getMonth() + 1;
  2292. if (timemonth >= 1 && timemonth <= 9) {
  2293. timemonth = "0" + timemonth;
  2294. }
  2295. var timedate = timeyear.toString() + timemonth.toString();
  2296. if(this.user.timeType.fillAhead == 0){
  2297. return currentdate < timedate;
  2298. }else{
  2299. return false
  2300. }
  2301. }
  2302. },
  2303. alalal: '8.0',
  2304. timeBasecostList:null,
  2305. tbload: false,
  2306. exportTimeDialog: false,
  2307. searchKeyword: '',
  2308. monthWorkDataS: [],
  2309. monthNotWorkDateS: [],
  2310. pickDateArray:[],
  2311. WorktimeDatepickValue: [],
  2312. activeName:"first",
  2313. isLeave: 0,
  2314. submitingReport: false,
  2315. importResultMsg:null,
  2316. showImportResult:false,
  2317. importingData: false,
  2318. isDraft: 0,
  2319. timeStamp: 0,
  2320. projectColumns:[],
  2321. checkinLoading:false,
  2322. importWxParam:{date:null,},
  2323. active:0,
  2324. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2325. importWxDialog:false,
  2326. importDialog:false,
  2327. denyForm:null,
  2328. denyReasonDialog:false,
  2329. monthWorkTimeDialog: false,
  2330. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2331. isSubstitude:false,
  2332. isFill:false,
  2333. unFillList:[],
  2334. fillList:[],
  2335. fillMembList:[],
  2336. fillMembList_leave: [],
  2337. membListVisible: false,
  2338. isBatch:0,//是否是批量填报
  2339. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2340. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2341. 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')],
  2342. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2343. fillStatusList: [],
  2344. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2345. exportReportLogParam:{dateRange:[]},
  2346. exportDialog:false,
  2347. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2348. subProjectList:[],
  2349. canEdit: true,
  2350. originCanEdit: true,
  2351. 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],
  2352. selectTime:null,
  2353. reportTimeType:{},
  2354. curDate:'',
  2355. isAllSelect: false,
  2356. approveDialogVisible:false,
  2357. deptId:null,
  2358. targetUid: null,
  2359. membCount:0,
  2360. selectState:"-1",
  2361. user: JSON.parse(sessionStorage.getItem("user")),
  2362. allUsersList: [],
  2363. showAddMore:false,
  2364. allDate: [],
  2365. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2366. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2367. choseDay: 0,
  2368. tableHeight: 0,
  2369. listLoading: false,
  2370. projectList: [], //项目列表
  2371. fillProjectList: [],
  2372. reportList: [], //日报列表
  2373. reportNames:[], //批量审批列表
  2374. selCon:[], //筛选条件
  2375. selProjectList:[], //筛选后项目列表
  2376. selConShow: true,
  2377. usersList: [], // 全部人员列表
  2378. usersListId: '', // 选中的人员id
  2379. dialogVisible: false, //项目弹窗
  2380. report: '',
  2381. workForm: {
  2382. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2383. domains: [{
  2384. id: null,
  2385. projectId: "",
  2386. workingTime: "",
  2387. timeType:0,
  2388. content: "",
  2389. state: 2,
  2390. multiWorktime:0,
  2391. worktimeList:[],
  2392. degreeId: null,
  2393. auditUserList: [],
  2394. }],
  2395. showRefresh: false,
  2396. },
  2397. workRules: {
  2398. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2399. },
  2400. chooseParticipVisible: false,
  2401. logining: false,
  2402. isDisable: false,
  2403. timeType:[],
  2404. deptMembData: [
  2405. ],
  2406. //部门人员树状结构
  2407. data: [
  2408. {
  2409. id: -1,
  2410. label: this.$t('lable.allStaff'),
  2411. membCount:0
  2412. },
  2413. {
  2414. id: 0,
  2415. label: this.$t('lable.unassigned'),
  2416. }
  2417. ],
  2418. allData:{},
  2419. batchShowData:{},
  2420. option: [],
  2421. deptOptionList: [],
  2422. depData: {
  2423. id: -1,
  2424. label: this.$t('lable.allStaff'),
  2425. },
  2426. defaultProps: {
  2427. children: 'children',
  2428. label: 'label'
  2429. },
  2430. isNew: false,
  2431. selected: false,
  2432. valuet: new Date(),
  2433. domObj: null,
  2434. participator:[],
  2435. chosenMembCount:0,
  2436. jsDay: 0,
  2437. jsTime: 0,
  2438. falsss: false,
  2439. weidu: [],
  2440. weiduList: [],
  2441. yonghuUser: [],
  2442. dateAr: [],
  2443. batchSubFillDialog: false,
  2444. isSubstiS: false,
  2445. fillWeekDialogVisi: false,
  2446. fillWeekDialogVisiCustom: false,
  2447. fillWeekDialogVisiCustomTwo: false,
  2448. zhoData: [],
  2449. weekDateRange: [],
  2450. btnZho: false,
  2451. weekDataLoading: false,
  2452. changdu: 6,
  2453. tianxieDialogVisible: false,
  2454. scopess: {},
  2455. zhoBao: {
  2456. time: '',
  2457. workingTime: '',
  2458. progress: '',
  2459. con: '',
  2460. subProjectId: '',
  2461. stage: '',
  2462. subProjectList: [],
  2463. stages: [],
  2464. },
  2465. zhoBaoIdx: '',
  2466. zhoBaoName: '',
  2467. zhis: {},
  2468. dealList: [],
  2469. toViewDialogVisible: false,
  2470. toViewList: [],
  2471. toViewloading: true,
  2472. toViewForm: {
  2473. pageIndex: '1',
  2474. pageSize: '20',
  2475. total: 0,
  2476. },
  2477. toViewloadings: false,
  2478. tabPositionss: 'top',
  2479. monthTotal: 0,
  2480. monthTotalPage: 0,
  2481. monthTotalLages: 20,
  2482. monthWorkData: [],
  2483. monthNotWorkDate: [],
  2484. monthWorkDataS1: [],
  2485. monthnotTotal: 0,
  2486. monthnotTotalPage: 0,
  2487. monthnotTotalLages: 20,
  2488. monthNotWorkDateS1: [],
  2489. deptMembDataText: '',
  2490. isFlag: false,
  2491. isMore: false,
  2492. stateKey: '0',
  2493. expandDate: [],
  2494. notifySelList:[],
  2495. departmentList: [],
  2496. trandepartmentList:[],
  2497. approvalProcessDialog: false,
  2498. approvalProcessData: [],
  2499. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2500. 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')],
  2501. isWeekend: false,
  2502. canCancelInDialog: false,
  2503. approveinData: {},
  2504. approveinDialog: false,
  2505. reportCanDelete: false,
  2506. weeklyFilledTimeDialog: false,
  2507. weeklyFilledTimeList: [],
  2508. weeklyFilledTimeLoading: false,
  2509. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2510. weeklyFilledTimeCanDelete: false,
  2511. weeklyFilledTimeDate: null,
  2512. leaveAllNum: 0,
  2513. dataLoading: false,
  2514. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2515. vacationTime: {},
  2516. integrationProjectList: [],
  2517. totalReportHours: 0, // 合计的工时
  2518. workTimeForMinYi:0,
  2519. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2520. weekIndex: 1,
  2521. weekParentData: {},
  2522. deptIdForNoReport:[],
  2523. deptIdForReminder:[],
  2524. nameAearch: '', // 企业微信姓名搜索
  2525. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2526. deptMembDataLoading: false,
  2527. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2528. {
  2529. id: 4811,
  2530. // id: 10,
  2531. name: '陕西柘中建设工程有限公司'
  2532. }
  2533. ],
  2534. pushWorkTimeLogDig:false,
  2535. pushWorkTimeLogData:[],
  2536. userReportDeptList: [],
  2537. isReminder:true,
  2538. reportLogCheckDialog:false,
  2539. deptIdForHasReport:[],
  2540. transferWorkingHoursVisable: false,
  2541. multiOptionData:[],
  2542. businessTripsArray: [],
  2543. };
  2544. },
  2545. watch: {
  2546. deptMembDataText(val) {
  2547. this.$refs.chooseMembTree.filter(val);
  2548. }
  2549. },
  2550. filters: {
  2551. // 过滤
  2552. amounts(value) {
  2553. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2554. return 0
  2555. }
  2556. var zhi = +value + 0
  2557. return zhi.toFixed(1)
  2558. },
  2559. // zhoData
  2560. zhoData(value, arr) {
  2561. var dateArray = value.split("-");
  2562. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2563. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2564. // console.log(arr[date.getDay()])
  2565. // return "周" + "日一二三四五六".charAt(date.getDay());
  2566. return arr[date.getDay()]
  2567. },
  2568. // 过滤数字
  2569. numbers(value) {
  2570. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2571. return 0
  2572. }
  2573. return value
  2574. },
  2575. },
  2576. computed: {},
  2577. mounted() {
  2578. var now = new Date();
  2579. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2580. this.today = t;
  2581. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2582. this.exportParam.dateRange = [startStr,t];
  2583. this.exportReportLogParam.dateRange = [startStr,t];
  2584. this.getAllDate(1);
  2585. this.getReportList();
  2586. this.getProjectList();
  2587. this.getFillProjectList();
  2588. this.getTimeType();
  2589. this.getDepartment();
  2590. this.scrollFunction()
  2591. this.userssHu();
  2592. this.getFirstAndLastDay()
  2593. this.getMultiOptionData();
  2594. if(this.user.timeType.reportAuditType == 3){
  2595. this.getAllUsersList()
  2596. }
  2597. if (this.user.company.packageProject == 1) {
  2598. this.getBasecostItemList();
  2599. }
  2600. if(this.user.timeType.userWithMultiDept == 1) {
  2601. this.getDeptMembData();
  2602. }
  2603. if(this.user.timeType.lockWorktime){
  2604. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2605. }
  2606. //设置了下限
  2607. if (this.user.timeType.minReportTime) {
  2608. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2609. }
  2610. const that = this
  2611. if(this.user.userNameNeedTranslate == 1) {
  2612. that.dataLoading = that.$store.state.dataLoading
  2613. this.upDataLoading()
  2614. setTimeout(()=>{
  2615. that.dataLoading = that.$store.state.dataLoading
  2616. }, 1000)
  2617. }
  2618. if (this.user.companyId == this.yuzhongCompId) {
  2619. this.getJobResponList();
  2620. }
  2621. },
  2622. methods: {
  2623. ...mapMutations(['upDataLoading']),
  2624. // 已填工时情况表设置背景色
  2625. hasworkTblCellStyle({ columnIndex, row, column }) {
  2626. if(columnIndex > 2) {
  2627. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2628. const worktimeList = row.worktimeList || []
  2629. const times = this.reportTimeType.allday
  2630. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2631. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2632. const missReport = filterData[0] && filterData[0].missReport;
  2633. const state = filterData[0] && filterData[0].state
  2634. if (missReport) {
  2635. return "backgroundColor: red"
  2636. } else {
  2637. if (state == 0 || state == -1) {
  2638. return "backgroundColor: orange"
  2639. } else if (state == 1) {
  2640. //审核通过
  2641. return "backgroundColor: #32CD32"
  2642. } else if (state == 2) {
  2643. return "backgroundColor: red"
  2644. } else {
  2645. return "backgroundColor: #E0E0E0"
  2646. }
  2647. }
  2648. }
  2649. },
  2650. getMultiOptionData() {
  2651. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2652. res => {
  2653. if (res.code == "ok") {
  2654. this.multiOptionData = res.data;
  2655. } else {
  2656. this.$message({
  2657. message: res.msg,
  2658. type: "error"
  2659. });
  2660. }
  2661. },
  2662. error => {
  2663. this.$message({
  2664. message: error,
  2665. type: "error"
  2666. });
  2667. }
  2668. );
  2669. },
  2670. showReportTimeLessThanCardTimeList() {
  2671. this.monthTotalPage = 0,
  2672. this.tbload = true,
  2673. this.http.post(
  2674. "/report/getReportTimeLessThanCardTimeList",
  2675. {
  2676. date: this.notfullSelectDateMonth,
  2677. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2678. userId: this.usersListId
  2679. },
  2680. (res) => {
  2681. if (res.code == "ok") {
  2682. this.tbload = false
  2683. this.notFullData = res.data;
  2684. this.notFullOriginList = res.data;
  2685. }
  2686. },
  2687. (error) => {
  2688. this.tbload = false
  2689. this.$message({
  2690. message: error,
  2691. type: "error",
  2692. });
  2693. }
  2694. );
  2695. },
  2696. //按选择的日期范围刷新考勤
  2697. refreshWXCardTimeByRange() {
  2698. this.refreshingTime = true;
  2699. this.http.post('/wxcorp/getUserCheckInDayData',{
  2700. companyId: this.user.companyId,
  2701. userId: this.user.id,
  2702. startDate: this.importWxParam.date[0],
  2703. endDate: this.importWxParam.date[1],
  2704. },res => {
  2705. this.refreshingTime = false;
  2706. if(res.code == 'ok'){
  2707. this.loadCheckInData();
  2708. }else {
  2709. this.$message({
  2710. message: res.msg,
  2711. type: 'error'
  2712. })
  2713. }
  2714. },err => {
  2715. this.syncTimeLoading = false;
  2716. this.$message({
  2717. message: err,
  2718. type: 'error'
  2719. })
  2720. })
  2721. },
  2722. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2723. isCustomization(userInfo, permissionArray) {
  2724. const { companyId } = userInfo
  2725. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2726. return isReportPictureRequired
  2727. },
  2728. showHiddenFunction() {
  2729. this.showHidden = true;
  2730. },
  2731. // 获取如何信息选的可填写部门
  2732. getDeptMembData() {
  2733. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2734. if (res.code == "ok") {
  2735. let lists = res.data.userReportDeptList || []
  2736. const optimizedList = lists.map(item => ({
  2737. ...item,
  2738. label: item.departmentName,
  2739. value: item.departmentId,
  2740. }));
  2741. this.$set(this, 'userReportDeptList', optimizedList || []);
  2742. } else {
  2743. this.$message({
  2744. message: res.msg,
  2745. type: "error"
  2746. });
  2747. }
  2748. },error => { });
  2749. },
  2750. //任务被选中
  2751. onTaskSelected(domainItem) {
  2752. //取服务
  2753. if (domainItem.taskId) {
  2754. var that = this;
  2755. var param = {taskId:domainItem.taskId};
  2756. if (this.isSubstitude) {
  2757. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2758. param.userId = this.workForm.userId[0];
  2759. }
  2760. }
  2761. this.http.post('/task/getMyTaskService',param, res => {
  2762. if (res.code == "ok") {
  2763. // domainItem.workContentList = res.data;
  2764. that.$set(domainItem, 'sapServiceId', null);
  2765. that.$set(domainItem, 'serviceList', res.data);
  2766. } else {
  2767. this.$message({
  2768. message: res.msg,
  2769. type: "error"
  2770. });
  2771. }
  2772. },error => {
  2773. this.$message({
  2774. message: error,
  2775. type: "error"
  2776. });
  2777. }
  2778. );
  2779. } else {
  2780. //清空服务
  2781. }
  2782. },
  2783. onBatchTimeChange() {
  2784. //反向计算每日工作时长
  2785. if (this.workForm.createDate) {
  2786. let sdate = new Date(this.workForm.createDate[0]);
  2787. let edate = new Date(this.workForm.createDate[1]);
  2788. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2789. if (days < 0) {
  2790. return;
  2791. }
  2792. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2793. //总时长发生改变,自动按比例计算
  2794. this.workForm.domains.forEach(d=>{
  2795. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2796. });
  2797. }
  2798. },
  2799. //更新工作内容列表
  2800. updateJobContent(domainItem) {
  2801. var that = this;
  2802. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2803. if (res.code == "ok") {
  2804. // domainItem.workContentList = res.data;
  2805. that.$set(domainItem, 'extraField3', null);
  2806. that.$set(domainItem, 'workContentList', res.data);
  2807. } else {
  2808. this.$message({
  2809. message: res.msg,
  2810. type: "error"
  2811. });
  2812. }
  2813. },error => {
  2814. this.$message({
  2815. message: error,
  2816. type: "error"
  2817. });
  2818. }
  2819. );
  2820. },
  2821. updateResponse(domainItem) {
  2822. var that = this;
  2823. var selectPid = domainItem.projectId;
  2824. domainItem.extraField2 = null;
  2825. domainItem.extraField3 = null;
  2826. if (selectPid && domainItem.extraField1) {
  2827. //是否非项目
  2828. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2829. 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));
  2830. domainItem.filteredRespList = filteredRespList;
  2831. }
  2832. },
  2833. getJobResponList() {
  2834. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2835. if (res.code == "ok") {
  2836. this.jobResponseList = res.data;
  2837. } else {
  2838. this.$message({
  2839. message: res.msg,
  2840. type: "error"
  2841. });
  2842. }
  2843. },error => {
  2844. this.$message({
  2845. message: error,
  2846. type: "error"
  2847. });
  2848. }
  2849. );
  2850. },
  2851. openModImportTime(row) {
  2852. this.showModImportTimeDialog = true;
  2853. this.modItemDataId = row.id;
  2854. },
  2855. delImportTime(row) {
  2856. let rowId = row.id;
  2857. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2858. confirmButtonText: this.$t('btn.determine'),
  2859. cancelButtonText: this.$t('btn.cancel'),
  2860. type: "warning"
  2861. })
  2862. .then(() => {
  2863. this.http.post('/report-import-log/delete',{
  2864. id: rowId
  2865. },res => {
  2866. if (res.code == "ok") {
  2867. this.$message({
  2868. message: this.$t('message.successfullyDeleted'),
  2869. type: "success"
  2870. });
  2871. this.getToView();
  2872. } else {
  2873. this.$message({
  2874. message: res.msg,
  2875. type: "error"
  2876. });
  2877. }
  2878. },error => {
  2879. this.$message({
  2880. message: error,
  2881. type: "error"
  2882. });
  2883. }
  2884. );
  2885. }).catch(() => {this.startDeleting = false});
  2886. },
  2887. confirmChangeModTime() {
  2888. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2889. this.$message({
  2890. message: this.$t('message.Pleaseselectatime'),
  2891. type: "error"
  2892. });
  2893. return;
  2894. }
  2895. this.http.post('/report-import-log/changeTime',{
  2896. modLogDateTime: this.modImportTime,
  2897. modImportUserId: this.modImportUserId,
  2898. id: this.modItemDataId
  2899. },res => {
  2900. if (res.code == "ok") {
  2901. this.$message({
  2902. message: this.$t('message.modifyTheSuccess'),
  2903. type: "success"
  2904. });
  2905. this.getToView();
  2906. this.showModImportTimeDialog = false;
  2907. } else {
  2908. this.$message({
  2909. message: res.msg,
  2910. type: "error"
  2911. });
  2912. }
  2913. },error => {
  2914. this.$message({
  2915. message: error,
  2916. type: "error"
  2917. });
  2918. }
  2919. );
  2920. },
  2921. confirmBatchApproveReport() {
  2922. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2923. this.$message({
  2924. message: this.$t('qingXuanZeRiQiFanWei'),
  2925. type: "error"
  2926. });
  2927. return;
  2928. }
  2929. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2930. confirmButtonText: this.$t('btn.determine'),
  2931. cancelButtonText: this.$t('btn.cancel'),
  2932. type: "warning"
  2933. })
  2934. .then(() => {
  2935. this.startDeleting = true;
  2936. let obj = {
  2937. startDate: this.deleteReportParam.date[0],
  2938. endDate: this.deleteReportParam.date[1]
  2939. }
  2940. if(this.deleteReportParam.departmentId) {
  2941. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  2942. } else {
  2943. obj.departmentId = null
  2944. }
  2945. this.http.post('/report/batchApproveByDate',obj,res => {
  2946. if (res.code == "ok") {
  2947. this.$message({
  2948. message: this.$t('state.approved'),
  2949. type: "success"
  2950. });
  2951. this.getReportList();
  2952. this.getDepartment();
  2953. this.startDeleting = false;
  2954. } else {
  2955. this.$message({
  2956. message: res.msg,
  2957. type: "error"
  2958. });
  2959. }
  2960. },error => {
  2961. this.$message({
  2962. message: error,
  2963. type: "error"
  2964. });
  2965. }
  2966. );
  2967. }).catch(() => {this.startDeleting = false});
  2968. },
  2969. confirmBatchDelReport() {
  2970. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  2971. this.$message({
  2972. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  2973. type: "error"
  2974. });
  2975. return;
  2976. }
  2977. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2978. this.$message({
  2979. message: this.$t('qingXuanZeRiQiFanWei'),
  2980. type: "error"
  2981. });
  2982. return;
  2983. }
  2984. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  2985. confirmButtonText: this.$t('btn.determine'),
  2986. cancelButtonText: this.$t('btn.cancel'),
  2987. type: "warning"
  2988. })
  2989. .then(() => {
  2990. this.startDeleting = true;
  2991. this.http.post('/report/batchDelete',{
  2992. userIds: JSON.stringify(this.deleteReportParam.userIds),
  2993. startDate: this.deleteReportParam.date[0],
  2994. endDate: this.deleteReportParam.date[1],
  2995. deptId: this.deleteReportParam.deptId[0]
  2996. },res => {
  2997. if (res.code == "ok") {
  2998. this.$message({
  2999. message: this.$t('message.successfullyDeleted'),
  3000. type: "success"
  3001. });
  3002. this.getReportList();
  3003. this.getDepartment();
  3004. this.startDeleting = false;
  3005. } else {
  3006. this.$message({
  3007. message: res.msg,
  3008. type: "error"
  3009. });
  3010. }
  3011. },error => {
  3012. this.$message({
  3013. message: error,
  3014. type: "error"
  3015. });
  3016. }
  3017. );
  3018. }).catch(() => {this.startDeleting = false});
  3019. },
  3020. getRecentlyProject(userId) {
  3021. this.http.post('/project/nearProject',{userId: userId},res => {
  3022. if(res.code == 'ok'){
  3023. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3024. let topObj = {
  3025. label: this.$t('zuiJinXuanZeXiangMu'),
  3026. peojectList: res.data
  3027. }
  3028. let botomObj = {
  3029. label: this.$t('other.allProject'),
  3030. peojectList: bottomList
  3031. }
  3032. //最近项目如果在fillProjectList中不存在,需要移除
  3033. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3034. this.integrationProjectList = [topObj, botomObj]
  3035. }else {
  3036. this.$message({
  3037. message: res.msg,
  3038. type: 'error'
  3039. })
  3040. }
  3041. },err => {
  3042. this.$message({
  3043. message: err,
  3044. type: 'error'
  3045. })
  3046. })
  3047. },
  3048. handlePictureCardPreview(file, index) {
  3049. let arr = []
  3050. let imgArr = this.workForm.domains[index].imgListUrl
  3051. for(var i in imgArr) {
  3052. arr.push(imgArr[i].url)
  3053. }
  3054. const $viewer = this.$viewerApi({
  3055. images: arr
  3056. });
  3057. },
  3058. // 图片上传
  3059. addImg(e, index) {
  3060. let formData = new FormData()
  3061. formData.append('multipartFile', e.file)
  3062. this.http.uploadFile('/common/uploadFile', formData,
  3063. res => {
  3064. if (res.code == "ok") {
  3065. this.$message({
  3066. message: this.$t('uploadedsuccessfully'),
  3067. type: "success"
  3068. });
  3069. if(!this.workForm.domains[index].imgList) {
  3070. this.workForm.domains[index].imgList = []
  3071. this.workForm.domains[index].imgListUrl = []
  3072. }
  3073. this.workForm.domains[index].imgList.push(res.data)
  3074. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3075. } else {
  3076. this.$message({message: res.msg,type: "error"});
  3077. }
  3078. },
  3079. error => {this.$message({message: error,type: "error"});
  3080. });
  3081. },
  3082. // 删除图片
  3083. delImg(file,fileList, index) {
  3084. let idx = 0
  3085. for(let i in fileList) {
  3086. if(fileList[i].uid == file.uid) {
  3087. idx = i
  3088. }
  3089. }
  3090. this.workForm.domains[index].imgList.splice(idx, 1)
  3091. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3092. },
  3093. test(){
  3094. console.log('test',this.workForm.domains);
  3095. },
  3096. getHour(s1, s2) {
  3097. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3098. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3099. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3100. var ms = s2.getTime() - s1.getTime();
  3101. if (ms < 0) return 0;
  3102. let ma = ms / 1000 / 60 / 60
  3103. return ma; //小时
  3104. },
  3105. refreshDDCardTime(workdate) {
  3106. if (!workdate) return;
  3107. this.syncTimeLoading = true;
  3108. this.http.post('/dingding/refreshUserCardTime',{
  3109. companyId: this.user.companyId,
  3110. userId: this.user.id,
  3111. date: workdate,
  3112. },res => {
  3113. this.syncTimeLoading = false;
  3114. if(res.code == 'ok'){
  3115. if (!res.data) {
  3116. this.$message({
  3117. message: '获取考勤失败',
  3118. type: 'error'
  3119. })
  3120. } else {
  3121. this.workForm.time = res.data;
  3122. }
  3123. }else {
  3124. this.$message({
  3125. message: res.msg,
  3126. type: 'error'
  3127. })
  3128. }
  3129. },err => {
  3130. this.syncTimeLoading = false;
  3131. this.$message({
  3132. message: err,
  3133. type: 'error'
  3134. })
  3135. })
  3136. },
  3137. refreshWXCardTime(workdate) {
  3138. if (!workdate) return;
  3139. this.syncTimeLoading = true;
  3140. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3141. date: workdate,
  3142. },res => {
  3143. this.syncTimeLoading = false;
  3144. if(res.code == 'ok'){
  3145. this.workForm.time = res.data.time;
  3146. }else {
  3147. this.$message({
  3148. message: res.msg,
  3149. type: 'error'
  3150. })
  3151. }
  3152. },err => {
  3153. this.syncTimeLoading = false;
  3154. this.$message({
  3155. message: err,
  3156. type: 'error'
  3157. })
  3158. })
  3159. },
  3160. refreshAttendance(workdate) {
  3161. if (!workdate) return;
  3162. this.syncTimeLoading = true;
  3163. this.http.post('/user-fv-time/syncAttendanceForMingYi',{
  3164. startDate: workdate[0],
  3165. endDate: workdate[1]
  3166. },res => {
  3167. this.syncTimeLoading = false;
  3168. if(res.code == 'ok'){
  3169. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3170. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3171. this.totalReportHours = this.workTimeForMinYi;
  3172. }else {
  3173. this.$message({
  3174. message: res.msg,
  3175. type: 'error'
  3176. })
  3177. }
  3178. },err => {
  3179. this.syncTimeLoading = false;
  3180. this.$message({
  3181. message: err,
  3182. type: 'error'
  3183. })
  3184. })
  3185. },
  3186. refreshBeiSengAttendance(workdate) {
  3187. if (!workdate) return;
  3188. this.syncTimeLoading = true;
  3189. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3190. createDate: workdate
  3191. },res => {
  3192. this.syncTimeLoading = false;
  3193. if(res.code == 'ok'){
  3194. this.workForm.time = res.data;
  3195. }else {
  3196. this.$message({
  3197. message: res.msg,
  3198. type: 'error'
  3199. })
  3200. }
  3201. },err => {
  3202. this.syncTimeLoading = false;
  3203. this.$message({
  3204. message: err,
  3205. type: 'error'
  3206. })
  3207. })
  3208. },
  3209. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3210. this.weeklyFilledTimeDialog = true
  3211. this.weeklyFilledTimeLoading = true
  3212. this.weeklyFilledTimeDate = parameterDate
  3213. this.http.post('/report/getReportList',{
  3214. date: parameterDate,
  3215. userId: this.user.id
  3216. },res => {
  3217. this.weeklyFilledTimeLoading = false
  3218. if(res.code == 'ok'){
  3219. this.weeklyFilledTimeList = res.data[0].data
  3220. let candelete = true
  3221. for(let i in this.weeklyFilledTimeList){
  3222. if(this.weeklyFilledTimeList[i].state < 2){
  3223. candelete = false
  3224. }
  3225. }
  3226. this.weeklyFilledTimeCanDelete = candelete
  3227. }else {
  3228. this.$message({
  3229. message: res.msg,
  3230. type: 'error'
  3231. })
  3232. }
  3233. },err => {
  3234. this.weeklyFilledTimeLoading = false
  3235. this.$message({
  3236. message: err,
  3237. type: 'error'
  3238. })
  3239. })
  3240. },
  3241. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3242. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3243. confirmButtonText: this.$t('btn.determine'),
  3244. cancelButtonText: this.$t('btn.cancel'),
  3245. type: "warning"
  3246. })
  3247. .then(() => {
  3248. this.http.post('/report/delete',{
  3249. userId: this.user.id,
  3250. date: this.weeklyFilledTimeDate
  3251. },res => {
  3252. if (res.code == "ok") {
  3253. this.$message({
  3254. message: this.$t('message.successfullyDeleted'),
  3255. type: "success"
  3256. });
  3257. this.getWeeklyWorkTime()
  3258. this.getReportList();
  3259. this.getDepartment();
  3260. this.weeklyFilledTimeDialog = false;
  3261. } else {
  3262. this.$message({
  3263. message: res.msg,
  3264. type: "error"
  3265. });
  3266. }
  3267. },error => {
  3268. this.$message({
  3269. message: error,
  3270. type: "error"
  3271. });
  3272. }
  3273. );
  3274. }).catch(() => {});
  3275. },
  3276. getApprovalProcess(item){
  3277. // console.log('this.date',this.choseDate);
  3278. this.http.post('/report-log/get',{
  3279. creatorId: item.id,
  3280. createDate: sessionStorage.msg
  3281. },res => {
  3282. if(res.code == 'ok'){
  3283. this.approvalProcessDialog = true
  3284. if(this.user.userNameNeedTranslate == 1) {
  3285. for(var i in res.data) {
  3286. let obj = {
  3287. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3288. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3289. }
  3290. res.data[i].msgCon = obj
  3291. }
  3292. }
  3293. this.approvalProcessData = res.data
  3294. }else{
  3295. this.$message({
  3296. message: res.msg,
  3297. type: 'error'
  3298. })
  3299. }
  3300. },err => {
  3301. this.$message({
  3302. message: err,
  3303. type: 'error'
  3304. })
  3305. })
  3306. //获取审批节点状态
  3307. if (this.user.companyId == 7544) {
  3308. this.http.post('/report/getCurAuditNode',{
  3309. userId: item.id,
  3310. date: sessionStorage.msg
  3311. },res => {
  3312. if(res.code == 'ok'){
  3313. this.curAuditNode = res.data
  3314. }else{
  3315. }
  3316. },err => {
  3317. this.$message({
  3318. message: err,
  3319. type: 'error'
  3320. })
  3321. })
  3322. }
  3323. },
  3324. filterNode(value, data) {
  3325. if (!value) return true;
  3326. return data.label.indexOf(value) !== -1;
  3327. },
  3328. triggerCalculateOT(index) {
  3329. var str = this.workForm.domains[index].overtimeHours + ''
  3330. if(str.indexOf('.') != '-1') {
  3331. var s = str.split('.')[0]
  3332. var st = str.split('.')[1]
  3333. var sts = st.split('')
  3334. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3335. }
  3336. },
  3337. searchScreen(e){
  3338. if(e == 1){
  3339. this.monthNotWorkDateS1 = []
  3340. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3341. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3342. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3343. }
  3344. }
  3345. if (this.monthNotWorkDateS1.length > 50) {
  3346. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3347. }else{
  3348. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3349. }
  3350. } else if (e == 0) {
  3351. this.monthWorkDataS1 = []
  3352. for (let i = 0; i < this.monthWorkData.length; i++) {
  3353. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3354. this.monthWorkDataS1.push(this.monthWorkData[i])
  3355. }
  3356. }
  3357. if (this.monthWorkDataS1.length > 50) {
  3358. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3359. }else{
  3360. this.monthWorkDataS = this.monthWorkDataS1
  3361. }
  3362. } else if (e == 2) {
  3363. this.monthWorkDataS1 = []
  3364. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3365. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3366. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3367. }
  3368. }
  3369. if (this.monthWorkDataS1.length > 50) {
  3370. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3371. }else{
  3372. this.notFullData = this.monthWorkDataS1
  3373. }
  3374. }
  3375. },
  3376. addUpload(data) {
  3377. // var zhi = data.fileName.split('.')[0]
  3378. // var sss = zhi + '.xlsx'
  3379. // return
  3380. var filePath = '/upload/' + data.serverName;
  3381. const a = document.createElement('a'); // 创建a标签
  3382. a.setAttribute('download', data.fileName);// download属性
  3383. a.setAttribute('href', filePath);// href链接
  3384. a.click(); //自执行点击事件
  3385. a.remove();
  3386. },
  3387. restrictNumber(targetId) {
  3388. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3389. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3390. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3391. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3392. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3393. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3394. inpu.value = parseFloat(inpu.value);
  3395. }
  3396. },
  3397. //获取项目下的任务分组
  3398. getTaskGroups(domain, index) {
  3399. domain.groupId=null;
  3400. this.http.post('/task-group/listMyJoinGroup',{
  3401. projectId: domain.projectId,
  3402. isSubstitude: this.isSubstitude ? 1 : 0
  3403. },
  3404. res => {
  3405. if (res.code == "ok") {
  3406. this.workForm.domains[index].taskGroups = res.data;
  3407. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3408. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3409. // this.getGroupStages(domain, index);
  3410. // }
  3411. const projectIdStr = domain.projectId;
  3412. const businessTripsArray = this.businessTripsArray
  3413. const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
  3414. if(list.length > 0) {
  3415. const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
  3416. this.workForm.domains[index].groupId = obj.id || ''
  3417. }
  3418. this.$forceUpdate();
  3419. }
  3420. },
  3421. error => {
  3422. this.$message({
  3423. message: error,
  3424. type: "error"
  3425. });
  3426. }
  3427. );
  3428. },
  3429. //下载填报工时占比报表
  3430. downloadProjectRatio() {
  3431. this.exportUserRatio = true;
  3432. // let now = new Date();
  3433. // let month = now.getMonth();//默认看上个月的
  3434. // let monthStr = month<10? ('0'+month): month;
  3435. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3436. const today = new Date();
  3437. const year = today.getFullYear();
  3438. const month = today.getMonth() + 1;
  3439. let lastMonthYear, lastMonth;
  3440. if (month === 1) {
  3441. lastMonthYear = year - 1;
  3442. lastMonth = 12;
  3443. } else {
  3444. lastMonthYear = year;
  3445. lastMonth = month - 1;
  3446. }
  3447. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3448. },
  3449. confirmDownloadRatio() {
  3450. this.startRatioExporting = true;
  3451. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3452. ymonth: this.ratioYmonth
  3453. },
  3454. res => {
  3455. if (res.code == "ok") {
  3456. this.startRatioExporting = false;
  3457. var filePath = res.data;
  3458. const a = document.createElement('a'); // 创建a标签
  3459. var data = filePath.split("/");
  3460. a.setAttribute('download', data[data.length-1]);// download属性
  3461. a.setAttribute('href', filePath);// href链接
  3462. a.click(); //自执行点击事件
  3463. a.remove();
  3464. } else {
  3465. this.startRatioExporting = false;
  3466. this.$message({
  3467. message: res.msg,
  3468. type: "error"
  3469. });
  3470. }
  3471. },
  3472. error => {
  3473. this.checkinLoading = false;
  3474. this.$message({
  3475. message: error,
  3476. type: "error"
  3477. });
  3478. }
  3479. );
  3480. },
  3481. //下载带企业微信考勤数据的工时统计模板
  3482. downloadCheckInExcel() {
  3483. var param = {
  3484. startDate: this.importWxParam.date[0],
  3485. endDate: this.importWxParam.date[1],
  3486. };
  3487. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3488. param.onlySelfData = false;
  3489. }
  3490. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3491. res => {
  3492. if (res.code == "ok") {
  3493. var filePath = res.data;
  3494. const a = document.createElement('a'); // 创建a标签
  3495. var data = filePath.split("/");
  3496. a.setAttribute('download', data[data.length-1]);// download属性
  3497. a.setAttribute('href', filePath);// href链接
  3498. a.click(); //自执行点击事件
  3499. a.remove();
  3500. } else {
  3501. this.$message({
  3502. message: res.msg,
  3503. type: "error"
  3504. });
  3505. }
  3506. },
  3507. error => {
  3508. this.checkinLoading = false;
  3509. this.$message({
  3510. message: error,
  3511. type: "error"
  3512. });
  3513. }
  3514. );
  3515. },
  3516. pre() {
  3517. if (this.active == 0) return;
  3518. this.active--;
  3519. },
  3520. next() {
  3521. this.active++;
  3522. },
  3523. triggerTotalTime(index) {
  3524. var item = this.checkinList[index];
  3525. var total = 0.0;
  3526. for (var i=0;i<this.projectColumns.length; i++) {
  3527. var key = this.projectColumns[i];
  3528. if (item[key] != null && item[key] != '') {
  3529. total += parseFloat(item[key]);
  3530. }
  3531. }
  3532. item.totalFillTime = total;
  3533. },
  3534. //提交批量代填的数据
  3535. submitBatchSubFillData() {
  3536. var data = JSON.stringify(this.checkinList);
  3537. this.http.post('/user-corpwx-time/submitProjectTime',{
  3538. json: data,
  3539. projectColumns: JSON.stringify(this.projectColumns)
  3540. },
  3541. res => {
  3542. if (res.code == "ok") {
  3543. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3544. this.importWxDialog = false;
  3545. }
  3546. },
  3547. error => {
  3548. this.checkinLoading = false;
  3549. this.$message({
  3550. message: error,
  3551. type: "error"
  3552. });
  3553. }
  3554. );
  3555. },
  3556. loadCheckInData() {
  3557. if (this.importWxParam.date == null) {
  3558. this.checkinList = [];
  3559. return;
  3560. }
  3561. this.checkinLoading = true;
  3562. this.http.post('/user-corpwx-time/getMyData',{
  3563. startDate: this.importWxParam.date[0],
  3564. endDate: this.importWxParam.date[1],
  3565. },
  3566. res => {
  3567. if (res.code == "ok") {
  3568. this.checkinLoading = false;
  3569. this.checkinList = res.data.list;
  3570. this.projectColumns = res.data.projects;
  3571. // 自定义表格会导致表格错乱,需重新计算表格
  3572. this.$nextTick(()=>{
  3573. this.$refs.tab.doLayout()
  3574. })
  3575. }
  3576. },
  3577. error => {
  3578. this.checkinLoading = false;
  3579. this.$message({
  3580. message: error,
  3581. type: "error"
  3582. });
  3583. }
  3584. );
  3585. },
  3586. importCardTime(item) {
  3587. //首先判断文件类型
  3588. let str = item.file.name.split(".");
  3589. let format = str[str.length - 1];
  3590. if (format != "xls" && format != "xlsx") {
  3591. this.$message({
  3592. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3593. type: "error"
  3594. });
  3595. } else {
  3596. this.importingData = true;
  3597. let formData = new FormData();
  3598. formData.append("multipartFile", item.file);
  3599. formData.append("companyId", this.user.companyId);
  3600. this.http.uploadFile('/user-corpwx-time/importCardTime', formData,
  3601. res => {
  3602. this.$refs.uploadCardTime.clearFiles();
  3603. this.importingData = false;
  3604. if (res.code == "ok") {
  3605. //换成弹出框,以免有人等了半天回来啥也没看到
  3606. this.$message({
  3607. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3608. type: "success"
  3609. });
  3610. } else {
  3611. this.$message({
  3612. message: res.msg,
  3613. type: "error"
  3614. });
  3615. }
  3616. },
  3617. error => {
  3618. this.$refs.upload.clearFiles();
  3619. this.listLoading = false;
  3620. this.$message({
  3621. message: error,
  3622. type: "error"
  3623. });
  3624. });
  3625. }
  3626. },
  3627. batchImportWxData(item) {
  3628. //首先判断文件类型
  3629. let str = item.file.name.split(".");
  3630. let format = str[str.length - 1];
  3631. if (format != "xls" && format != "xlsx") {
  3632. this.$message({
  3633. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3634. type: "error"
  3635. });
  3636. } else {
  3637. this.importingData = true;
  3638. let formData = new FormData();
  3639. formData.append("file", item.file);
  3640. formData.append("companyId", this.user.companyId);
  3641. formData.append("withCheckIn", 1);
  3642. this.http.uploadFile('/report/importData', formData,
  3643. res => {
  3644. this.$refs.upload.clearFiles();
  3645. this.showImportResult = true;
  3646. this.importingData = false;
  3647. if (res.code == "ok") {
  3648. //换成弹出框,以免有人等了半天回来啥也没看到
  3649. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3650. this.getReportList();
  3651. this.importWxDialog = false;
  3652. } else {
  3653. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3654. }
  3655. },
  3656. error => {
  3657. this.$refs.upload.clearFiles();
  3658. this.listLoading = false;
  3659. this.$message({
  3660. message: error,
  3661. type: "error"
  3662. });
  3663. });
  3664. }
  3665. },
  3666. batchImportData(item) {
  3667. //首先判断文件类型
  3668. let str = item.file.name.split(".");
  3669. let format = str[str.length - 1];
  3670. if (format != "xls" && format != "xlsx") {
  3671. this.$message({
  3672. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3673. type: "error"
  3674. });
  3675. } else {
  3676. this.importingData = true;
  3677. let formData = new FormData();
  3678. formData.append("file", item.file);
  3679. formData.append("companyId", this.user.companyId);
  3680. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3681. this.http.uploadFile(url, formData,
  3682. res => {
  3683. this.$refs.upload.clearFiles();
  3684. this.importingData = false;
  3685. this.showImportResult = true;
  3686. if (res.code == "ok") {
  3687. //换成弹出框,以免有人等了半天回来啥也没看到
  3688. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3689. this.getReportList();
  3690. this.importWXDialog = false;
  3691. } else {
  3692. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3693. }
  3694. },
  3695. error => {
  3696. this.$refs.upload.clearFiles();
  3697. this.importingData = false;
  3698. this.$message({
  3699. message: error,
  3700. type: "error"
  3701. });
  3702. });
  3703. }
  3704. },
  3705. userssHu() {
  3706. this.http.post('/time-type/getCompanyTimeSetting',{
  3707. companyId: this.user.companyId
  3708. },
  3709. res => {
  3710. if (res.code == "ok") {
  3711. this.yonghuUser = res.data
  3712. }
  3713. },
  3714. error => {
  3715. this.$message({
  3716. message: error,
  3717. type: "error"
  3718. });
  3719. }
  3720. );
  3721. },
  3722. iptBlur(i) {
  3723. if(this.isBatch == 0) {
  3724. return
  3725. }
  3726. var reqParam = {
  3727. startDate: this.workForm.createDate[0],
  3728. endDate: this.workForm.createDate[1]
  3729. };
  3730. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3731. reqParam.userId = this.workForm.userId[0];
  3732. }
  3733. this.http.post('/report/getWorkDays',reqParam,
  3734. res => {
  3735. if (res.code == "ok") {
  3736. this.jsDay = res.data
  3737. this.chuji(i)
  3738. } else {
  3739. this.$message({
  3740. message: res.msg,
  3741. type: "error"
  3742. });
  3743. }
  3744. },
  3745. error => {
  3746. this.$message({
  3747. message: error,
  3748. type: "error"
  3749. });
  3750. }
  3751. );
  3752. //明夷硬编码获取
  3753. if (this.user.company.companyName == this.mingyiName) {
  3754. this.getWorkTimeForMinYi();
  3755. }
  3756. },
  3757. getWorkTimeForMinYi(){
  3758. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3759. startDate: this.workForm.createDate[0],
  3760. endDate: this.workForm.createDate[1]
  3761. },
  3762. res => {
  3763. if (res.code == "ok") {
  3764. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3765. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3766. this.totalReportHours = this.workTimeForMinYi;
  3767. } else {
  3768. this.$message({
  3769. message: res.msg,
  3770. type: "error"
  3771. });
  3772. this.workForm.createDate = [];
  3773. }
  3774. },
  3775. error => {
  3776. this.$message({
  3777. message: error,
  3778. type: "error"
  3779. });
  3780. }
  3781. );
  3782. },
  3783. chuji(i) {
  3784. if(i == 0) {
  3785. this.seleChn(1)
  3786. } else if(i == 1) {
  3787. this.seleChn(0)
  3788. } else if(i == 2) {
  3789. if(this.workForm.domains[0].multiWorktime > 0) {
  3790. this.iptChangs()
  3791. } else {
  3792. this.iptChang()
  3793. }
  3794. } else if(i == 3) {
  3795. this.seleChn(0)
  3796. }
  3797. },
  3798. seleChn(e,domain) {
  3799. if(e == 1) {
  3800. for(var i in this.workForm.domains) {
  3801. if(this.workForm.domains[i].timeType == 0) {
  3802. this.workForm.domains[i].workingTime = 8
  3803. } else {
  3804. this.workForm.domains[i].workingTime = 4
  3805. }
  3806. }
  3807. }
  3808. var quanbu = 0
  3809. var spl = this.workForm.domains
  3810. var zhi = ''
  3811. for(var i in spl) {
  3812. var sp = +spl[i].workingTime + 0
  3813. zhi = this.jsDay * sp
  3814. quanbu = +quanbu + zhi
  3815. }
  3816. this.jsTime = quanbu
  3817. this.totalReportHours = quanbu
  3818. let worktime = this.jsTime
  3819. // 自动计算加班时长
  3820. if(this.isBatch != 0){
  3821. worktime = this.jsTime / this.jsDay
  3822. }
  3823. if(this.user.timeType.fillOvertime && domain){
  3824. let isover = false
  3825. let alltime = 0
  3826. let allover = 0 //此处alltime同上面的worktime
  3827. for(let d in spl){
  3828. if(spl[d].isOvertime){
  3829. isover = true
  3830. allover += spl[d].overtimeHours*1
  3831. }
  3832. alltime += spl[d].workingTime*1
  3833. }
  3834. if(domain.overtimeHours){
  3835. allover = allover - domain.overtimeHours
  3836. }
  3837. if(worktime*1 > this.user.timeType.allday){
  3838. if(isover){
  3839. if(alltime > (allover + this.user.timeType.allday)){
  3840. this.$set(domain,'isOvertime',true)
  3841. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3842. }else{
  3843. this.$set(domain,'isOvertime',false)
  3844. this.$set(domain,'overtimeHours',null)
  3845. if(alltime < (allover + this.user.timeType.allday)){
  3846. let overtime = allover + this.user.timeType.allday - alltime
  3847. for(let pi in spl){
  3848. if(spl[pi].overtimeHours){
  3849. if((overtime - spl[pi].overtimeHours*1) > 0){
  3850. overtime = overtime - spl[pi].overtimeHours*1
  3851. this.$set(spl[pi],'isOvertime',false)
  3852. this.$set(spl[pi],'overtimeHours',null)
  3853. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3854. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3855. break
  3856. }else{
  3857. this.$set(spl[pi],'isOvertime',false)
  3858. this.$set(spl[pi],'overtimeHours',null)
  3859. break
  3860. }
  3861. }
  3862. }
  3863. }
  3864. }
  3865. }else{
  3866. this.$set(domain,'isOvertime',true)
  3867. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3868. }
  3869. }else{
  3870. for(let di in spl){
  3871. this.$set(spl[di],'isOvertime',false)
  3872. this.$set(spl[di],'overtimeHours',null)
  3873. }
  3874. }
  3875. }
  3876. },
  3877. iptChang() {
  3878. var sl = this.workForm.domains
  3879. let timeArr = []
  3880. for(var i in sl) {
  3881. if(sl[i].startTime && sl[i].endTime) {
  3882. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  3883. }
  3884. }
  3885. this.getTimeHours(timeArr)
  3886. },
  3887. iptChangs() {
  3888. var sl = this.workForm.domains
  3889. let timeArr = []
  3890. for(var i in sl) {
  3891. for(var j in sl[i].worktimeList){
  3892. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  3893. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  3894. }
  3895. }
  3896. }
  3897. this.getTimeHours(timeArr)
  3898. },
  3899. // 调用接口或去数据
  3900. getTimeHours(arr) {
  3901. this.http.post('/report/getHoursByTimeRange',{
  3902. timeJsonStr: JSON.stringify(arr)
  3903. },res => {
  3904. if(res.code === 'ok') {
  3905. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  3906. } else {
  3907. this.$message({
  3908. message: res.msg,
  3909. type: 'error'
  3910. })
  3911. }
  3912. },err => {
  3913. this.$message({
  3914. message: err,
  3915. type: 'error'
  3916. })
  3917. })
  3918. },
  3919. // 按周填报调用接口计算时间
  3920. async getWeekHoursByTimeRange(timeRange) {
  3921. const url = '/report/getHoursByTimeRange';
  3922. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  3923. var that = this;
  3924. return new Promise((resolve, reject) => {
  3925. this.http.post(url, data, function(res) {
  3926. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  3927. }, function(err) {
  3928. reject(err);
  3929. });
  3930. });
  3931. },
  3932. removeTimeItem(item, index) {
  3933. item.worktimeList.splice(index, 1);
  3934. this.iptChangs()
  3935. },
  3936. //添加工时
  3937. addNewWorktime(index, item) {
  3938. if(item.worktimeList == null ) {
  3939. item.worktimeList = []
  3940. }
  3941. item.worktimeList.push({});
  3942. },
  3943. //复制项目
  3944. copyProject(index) {
  3945. var leftProgress = 10;
  3946. if (this.reportTimeType.type == 3) {
  3947. //计算已经待分配工时比例
  3948. let array = this.workForm.domains;
  3949. let totalProgress = 0;
  3950. for (var i=0;i<array.length; i++) {
  3951. totalProgress += array[i].progress;
  3952. }
  3953. if (totalProgress < 100) {
  3954. leftProgress = 100 - totalProgress;
  3955. }
  3956. }
  3957. var newIndex = index+1;
  3958. var itemDomain = {
  3959. projectId: this.workForm.domains[index].projectId,
  3960. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  3961. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  3962. ),
  3963. content: "",
  3964. progress:leftProgress,
  3965. state:2,//2-表示待提交
  3966. };
  3967. this.workForm.domains.splice(newIndex, 0,itemDomain);
  3968. if (this.reportTimeType.type == 0) {
  3969. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  3970. var length = this.workForm.domains.length;
  3971. if (length == 2) {
  3972. this.showAddMore = false;
  3973. }
  3974. }
  3975. this.selectProject(itemDomain, newIndex);
  3976. },
  3977. pushWorkTime(reportId){
  3978. let url=''
  3979. if(this.user.timeType.syncSap == 1){
  3980. url='/report/pushProjectReportToSap'
  3981. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3982. var pushDate = this.date + day;
  3983. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  3984. confirmButtonText: this.$t('btn.determine'),
  3985. cancelButtonText: this.$t('btn.cancel'),
  3986. type: 'info'
  3987. }).then(() => {
  3988. const loading = this.$loading({
  3989. lock: true,
  3990. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  3991. spinner: 'el-icon-loading',
  3992. background: 'rgba(0, 0, 0, 0.7)'
  3993. });
  3994. this.http.post(url,{
  3995. pushDate: pushDate,
  3996. reportId: reportId
  3997. },res => {
  3998. loading.close();
  3999. if(res.code == 'ok'){
  4000. this.$message({
  4001. type: 'success',
  4002. message: res.data
  4003. });
  4004. }else{
  4005. this.$message({
  4006. type: 'error',
  4007. message: res.msg
  4008. })
  4009. }
  4010. },err => {
  4011. loading.close();
  4012. this.$message({
  4013. type: 'error',
  4014. message: err
  4015. })
  4016. })
  4017. }).catch(() => {
  4018. });
  4019. }else{
  4020. url='/report/pushReportDataToThird'
  4021. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4022. confirmButtonText: this.$t('btn.determine'),
  4023. cancelButtonText: this.$t('btn.cancel'),
  4024. type: 'info'
  4025. }).then(() => {
  4026. const loading = this.$loading({
  4027. lock: true,
  4028. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4029. spinner: 'el-icon-loading',
  4030. background: 'rgba(0, 0, 0, 0.7)'
  4031. });
  4032. this.http.post(url,{
  4033. yearMonth: this.date
  4034. },res => {
  4035. loading.close();
  4036. if(res.code == 'ok'){
  4037. this.$message({
  4038. type: 'success',
  4039. message: this.$t('tuiSongChengGong')
  4040. });
  4041. }else{
  4042. this.$message({
  4043. type: 'error',
  4044. message: res.msg
  4045. })
  4046. }
  4047. },err => {
  4048. loading.close();
  4049. this.$message({
  4050. type: 'error',
  4051. message: err
  4052. })
  4053. })
  4054. }).catch(() => {
  4055. });
  4056. }
  4057. },
  4058. showWorkTime(){
  4059. this.monthWorkTimeDialog = true;
  4060. this.searchKeyword = ''
  4061. this.WorktimeDatepickValue = this.istoMonth()
  4062. if(this.WorktimeDatepickValue.length == 0){
  4063. let newdate = new Date();
  4064. let nowdate = newdate.toLocaleDateString();
  4065. let getauto = this.getAutoWeekDate(nowdate)
  4066. let nowwd = [getauto[0],getauto[6]]
  4067. this.WorktimeDatepickValue = nowwd
  4068. }
  4069. this.showMonthWorkTime()
  4070. },
  4071. handleClick(t,e){
  4072. if (t.name == "second") {
  4073. this.showMonthNotWorkTime()
  4074. }else if(t.name == "first"){
  4075. this.showMonthWorkTime()
  4076. }else if(t.name == "third"){
  4077. this.showMonthWorkTimeReminder()
  4078. } else if (t.name == "fourth") {
  4079. this.showReportTimeLessThanCardTimeList();
  4080. }
  4081. },
  4082. //导出员工每日填报工时数
  4083. exportMembWorkHours() {
  4084. this.http.post(
  4085. "/report/exportUserDailyWorkTime",
  4086. {
  4087. // month: this.date,
  4088. startDate: this.WorktimeDatepickValue[0],
  4089. endDate: this.WorktimeDatepickValue[1],
  4090. },
  4091. (res) => {
  4092. if (res.code == "ok") {
  4093. let url = res.data;
  4094. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4095. }
  4096. },
  4097. (error) => {
  4098. this.$message({
  4099. message: error,
  4100. type: "error",
  4101. });
  4102. }
  4103. );
  4104. },
  4105. exportMembWorkHoursReminder() {
  4106. this.http.post(
  4107. "/report/exportUserDailyWorkTimeReminder",
  4108. {
  4109. // month: this.date,
  4110. startDate: this.WorktimeDatepickValue[0],
  4111. endDate: this.WorktimeDatepickValue[1],
  4112. },
  4113. (res) => {
  4114. if (res.code == "ok") {
  4115. let url = res.data;
  4116. this.downloadByA('工时异常表.xlsx', url);
  4117. }
  4118. },
  4119. (error) => {
  4120. this.$message({
  4121. message: error,
  4122. type: "error",
  4123. });
  4124. }
  4125. );
  4126. },
  4127. exportMembNotWorkHours() {
  4128. this.http.post(
  4129. "/report/exportNoReportUserList",
  4130. {
  4131. // month: this.date,
  4132. startDate: this.WorktimeDatepickValue[0],
  4133. endDate: this.WorktimeDatepickValue[1],
  4134. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4135. },
  4136. (res) => {
  4137. if (res.code == "ok") {
  4138. let url = res.data;
  4139. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4140. }
  4141. },
  4142. (error) => {
  4143. this.$message({
  4144. message: error,
  4145. type: "error",
  4146. });
  4147. }
  4148. );
  4149. },
  4150. downloadByA(name, url) {
  4151. const a = document.createElement("a"); // 创建a标签
  4152. a.setAttribute("download", name); // download属性
  4153. a.setAttribute("href", url); // href链接
  4154. a.click(); // 自执行点击事件
  4155. a.remove();
  4156. },
  4157. // 是否本月判断
  4158. istoMonth(){
  4159. let todate = new Date()
  4160. let tomonth = todate.getMonth() + 1
  4161. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4162. if(this.date == adate){
  4163. return []
  4164. }else{
  4165. let sedate = new Date(this.date)
  4166. let semonth = sedate.getMonth() + 1
  4167. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4168. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4169. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4170. return [sedates1, sedates2]
  4171. }
  4172. },
  4173. showMonthWorkTime() {
  4174. this.monthTotalPage = 0,
  4175. this.tbload = true
  4176. let parameter={
  4177. startDate: this.WorktimeDatepickValue[0],
  4178. endDate: this.WorktimeDatepickValue[1],
  4179. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4180. }
  4181. this.http.post(
  4182. "/report/getUserDailyWorkTime",
  4183. // "/report/getNoReportUserList",
  4184. parameter,
  4185. (res) => {
  4186. if (res.code == "ok") {
  4187. this.tbload = false;
  4188. this.pickDateArray = res.data.days.map(item => {
  4189. return {
  4190. ...item,
  4191. dateStr: item.label.split('/')[0],
  4192. weekStr: item.label.split('/')[1]
  4193. }
  4194. });
  4195. // console.log('dataarray',res.data.days);
  4196. this.monthWorkData = res.data.list;
  4197. // this.monthWorkDataS = this.monthWorkData
  4198. // this.monthWorkDataS1 = res.data.list
  4199. this.monthTotal = res.data.list.length
  4200. if (this.monthWorkData.length > 50) {
  4201. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4202. }else{
  4203. this.monthWorkDataS = this.monthWorkData
  4204. }
  4205. this.searchScreen(0)
  4206. // this.monthWorkDataS = infoList
  4207. // 判断
  4208. // if (this.monthWorkDataS1.length > 0) {
  4209. // setTimeout(() => {
  4210. // this.tableListener()
  4211. // }, 1000);
  4212. // }
  4213. this.$nextTick(function(){
  4214. this.$refs.hasworkTbl.doLayout();
  4215. });
  4216. // this.$forceUpdate()
  4217. }
  4218. },
  4219. (error) => {
  4220. this.tbload = false
  4221. this.$message({
  4222. message: error,
  4223. type: "error",
  4224. });
  4225. }
  4226. );
  4227. },
  4228. showMonthWorkTimeReminder() {
  4229. this.monthTotalPage = 0,
  4230. this.tbload = true
  4231. let parameter={}
  4232. parameter={
  4233. startDate: this.WorktimeDatepickValue[0],
  4234. endDate: this.WorktimeDatepickValue[1],
  4235. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4236. viewValue:this.isReminder?1:0
  4237. }
  4238. this.http.post(
  4239. "/report/getUserDailyWorkTimeReminder",
  4240. parameter,
  4241. (res) => {
  4242. if (res.code == "ok") {
  4243. this.tbload = false;
  4244. this.monthWorkData = res.data.list;
  4245. this.monthTotal = res.data.list.length
  4246. if (this.monthWorkData.length > 50) {
  4247. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4248. }else{
  4249. this.monthWorkDataS = this.monthWorkData
  4250. }
  4251. this.searchScreen(0)
  4252. this.$nextTick(function(){
  4253. this.$refs.hasworkTbl.doLayout();
  4254. });
  4255. }
  4256. },
  4257. (error) => {
  4258. this.tbload = false
  4259. this.$message({
  4260. message: error,
  4261. type: "error",
  4262. });
  4263. }
  4264. );
  4265. },
  4266. showMonthNotWorkTime() {
  4267. this.monthTotalPage = 0,
  4268. this.tbload = true,
  4269. this.http.post(
  4270. "/report/getNoReportUserList",
  4271. {
  4272. startDate: this.WorktimeDatepickValue[0],
  4273. endDate: this.WorktimeDatepickValue[1],
  4274. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4275. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4276. },
  4277. (res) => {
  4278. if (res.code == "ok") {
  4279. this.tbload = false
  4280. this.monthNotWorkDate = res.data;
  4281. this.monthnotTotal = res.data.length
  4282. if (this.monthNotWorkDate.length > 50) {
  4283. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4284. } else {
  4285. this.monthNotWorkDateS = this.monthNotWorkDate
  4286. }
  4287. this.searchScreen(1)
  4288. this.$nextTick(function(){
  4289. this.$refs.hasworkTbl2.doLayout();
  4290. });
  4291. }
  4292. },
  4293. (error) => {
  4294. this.tbload = false
  4295. this.$message({
  4296. message: error,
  4297. type: "error",
  4298. });
  4299. }
  4300. );
  4301. },
  4302. listScroll(){
  4303. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4304. this.isMore = true
  4305. setTimeout(()=>{
  4306. this.isMore = false
  4307. },1000)
  4308. }else {
  4309. this.isFlag = true
  4310. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4311. this.monthWorkDataS = datalist
  4312. setTimeout(()=>{
  4313. this.isFlag = false
  4314. },300)
  4315. }
  4316. },
  4317. notListScroll(){
  4318. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4319. this.isMore = true
  4320. setTimeout(()=>{
  4321. this.isMore = false
  4322. },1000)
  4323. }else {
  4324. this.isFlag = true
  4325. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4326. this.monthNotWorkDateS = datalist
  4327. // console.log('length',this.monthNotWorkDateS.length)
  4328. setTimeout(()=>{
  4329. this.isFlag = false
  4330. },300)
  4331. }
  4332. },
  4333. getFirstAndLastDay() {
  4334. // 将选定的月份转换为Date对象
  4335. var monthDate = new Date();
  4336. var year = monthDate.getFullYear();
  4337. var month = monthDate.getMonth();
  4338. // 计算起始日和结束日
  4339. var startDay = new Date(year, month, 1);
  4340. var endDay = new Date(year, month + 1, 0);
  4341. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4342. this.WorktimeDatepickValueForMonth=lastmd
  4343. },
  4344. formatDate(date) {
  4345. var year = date.getFullYear();
  4346. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4347. var day = ("0" + date.getDate()).slice(-2);
  4348. return year + "-" + month + "-" + day;
  4349. },
  4350. // 获取默认这zhou日期参数 222
  4351. getLastWeek(e){
  4352. let newdate = new Date()
  4353. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4354. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4355. if(e==1){
  4356. this.WorktimeDatepickValue = lastwd
  4357. this.showMonthWorkTime()
  4358. }else if(e==2){
  4359. this.WorktimeDatepickValue = lastwd
  4360. this.showMonthWorkTimeReminder()
  4361. }else{
  4362. this.WorktimeDatepickValue = lastwd
  4363. this.showMonthNotWorkTime()
  4364. }
  4365. },
  4366. getThisWeek(e){
  4367. let newdate = new Date();
  4368. let nowdate = newdate.toLocaleDateString();
  4369. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4370. if(e==1){
  4371. this.WorktimeDatepickValue = nowwd
  4372. this.showMonthWorkTime()
  4373. }else if(e==2){
  4374. this.WorktimeDatepickValue = nowwd
  4375. this.showMonthWorkTimeReminder()
  4376. }else{
  4377. this.WorktimeDatepickValue = nowwd
  4378. this.showMonthNotWorkTime()
  4379. }
  4380. },
  4381. getDoubleLastWeek(e){
  4382. let newdate = new Date()
  4383. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4384. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4385. if(e==1){
  4386. this.WorktimeDatepickValue = nextwd
  4387. this.showMonthWorkTime()
  4388. }else if(e==2){
  4389. this.WorktimeDatepickValue = nextwd
  4390. this.showMonthWorkTimeReminder()
  4391. }else{
  4392. this.WorktimeDatepickValue = nextwd
  4393. this.showMonthNotWorkTime()
  4394. }
  4395. },
  4396. alreadyAllDate(stime,etime){
  4397. let diffdate = new Array();
  4398. let i=0;
  4399. while(stime<=etime){
  4400. let dateArray = stime.split("-");
  4401. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4402. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4403. let stimewk = this.weekDay[date.getDay()]
  4404. 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')
  4405. 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])
  4406. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4407. let stime_ts = new Date(stime).getTime();
  4408. let next_date = stime_ts + (24*60*60*1000);
  4409. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4410. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4411. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4412. stime = next_dates_y+next_dates_m+next_dates_d;
  4413. i++;
  4414. }
  4415. return diffdate
  4416. },
  4417. getAutoWeekDate(e) {
  4418. let dateString = e;
  4419. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4420. if (dateString.match(dateStringReg)) {
  4421. let presentDate = new Date(dateString),
  4422. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4423. return Array.from(new Array(7), function (val, index) {
  4424. let formatDate = new Date(
  4425. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4426. );
  4427. return (
  4428. formatDate.getFullYear() +
  4429. "-" +
  4430. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4431. "-" +
  4432. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4433. );
  4434. });
  4435. } else {
  4436. throw new Error(
  4437. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4438. );
  4439. }
  4440. },
  4441. onProgressChange() {
  4442. this.$forceUpdate();
  4443. },
  4444. showChooseMembTree() {
  4445. this.chosenMembCount = this.participator.length;
  4446. this.chooseParticipVisible = true;
  4447. },
  4448. onTreeItemChange() {
  4449. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4450. var list = chosenList.filter(item=>item.isUser == 1);
  4451. this.chosenMembCount = list.length;
  4452. },
  4453. findUserInTree() {
  4454. if (this.filterName == '') {
  4455. this.deptMembData = this.allMembData;
  4456. } else {
  4457. var list = this.findRecursively(this.filterName, this.allMembData);
  4458. this.deptMembData = list;
  4459. }
  4460. },
  4461. findRecursively(username, list) {
  4462. var filterList = [];
  4463. for (var i=0;i<list.length; i++) {
  4464. if (list[i].isUser == 1) {
  4465. if (list[i].label.indexOf(username) >= 0) {
  4466. //匹配上了
  4467. filterList.push(list[i]);
  4468. }
  4469. } else if (list[i].children != null && list[i].children.length > 0) {
  4470. var subList = this.findRecursively(username, list[i].children);
  4471. if (subList.length > 0) {
  4472. subList.forEach(s=>filterList.push(s));
  4473. }
  4474. }
  4475. }
  4476. return filterList;
  4477. },
  4478. //确定选择参与人
  4479. chooseParticip() {
  4480. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4481. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4482. //只能选择一个人进行代填,防止任务有问题
  4483. if (this.chosenMembList.length > 1) {
  4484. this.$message({
  4485. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4486. type: "error",
  4487. });
  4488. return;
  4489. }
  4490. this.chooseParticipVisible = false;
  4491. this.workForm.userNames = '';
  4492. this.workForm.userId = [];
  4493. this.participator = [];
  4494. for (var i=0;i<this.chosenMembList.length; i++) {
  4495. this.workForm.userId.push(this.chosenMembList[i].id);
  4496. this.workForm.userNames += this.chosenMembList[i].label+',';
  4497. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4498. this.participator.push(item);
  4499. }
  4500. if (this.workForm.userNames.length > 0) {
  4501. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4502. }
  4503. if(this.user.userNameNeedTranslate == 1) {
  4504. if(this.workForm.userNames) {
  4505. this.workForm.userNames = this.workForm.userNames.split(',')
  4506. }
  4507. }
  4508. //加载该人员的可填报项目
  4509. if (this.workForm.userId.length > 0) {
  4510. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4511. }
  4512. //打通企业微信考勤的情况,获取考勤
  4513. if (this.user.timeType.showCorpwxCardtime) {
  4514. this.getTargetUserCardTime();
  4515. }
  4516. },
  4517. getTargetUserCardTime() {
  4518. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4519. this.http.post('/user-corpwx-time/getUserCardTime',{
  4520. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4521. },
  4522. res => {
  4523. if (res.code == "ok") {
  4524. this.$set(this.workForm,'time', res.data);
  4525. }
  4526. },
  4527. error => {
  4528. this.$message({
  4529. message: error,
  4530. type: "error"
  4531. });
  4532. }
  4533. );
  4534. }
  4535. },
  4536. notifySel(sel){
  4537. // console.log(sel);
  4538. this.notifySelList = sel
  4539. },
  4540. //微信通知人员填写
  4541. Notify(code) {
  4542. if (this.notifySelList.length == 0) return;
  4543. var ids = '';
  4544. this.notifySelList.forEach(f=>{
  4545. ids += f.id+',';
  4546. })
  4547. this.http.post('/user/pushFillReport',{
  4548. ids: ids, date: this.curDate,
  4549. code: code
  4550. },
  4551. res => {
  4552. if (res.code == "ok") {
  4553. this.$message({
  4554. message: this.$t('message.sentSuccessfully'),
  4555. type: "success"
  4556. });
  4557. }
  4558. },
  4559. error => {
  4560. this.$message({
  4561. message: error,
  4562. type: "error"
  4563. });
  4564. }
  4565. );
  4566. },
  4567. //导出人员列表
  4568. exportMemb() {
  4569. if (this.fillMembList.length == 0) return;
  4570. var ids = '';
  4571. this.fillMembList.forEach(f=>{
  4572. ids += f.id+',';
  4573. })
  4574. this.http.post('/user/exportMembList',{
  4575. ids: ids,isFill: this.isFill, date: this.curDate
  4576. },
  4577. res => {
  4578. if (res.code == "ok") {
  4579. var aTag = document.createElement('a');
  4580. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4581. aTag.href = res.data;
  4582. aTag.click();
  4583. }
  4584. },
  4585. error => {
  4586. this.$message({
  4587. message: error,
  4588. type: "error"
  4589. });
  4590. }
  4591. );
  4592. },
  4593. showMembList(fill) {
  4594. this.membListVisible = true;
  4595. if (fill == 0) {
  4596. this.fillMembList = this.unFillList;
  4597. this.isFill = false;
  4598. let leaveList = []
  4599. let unleaveList = []
  4600. for(let i in this.fillMembList){
  4601. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4602. leaveList.push(this.fillMembList[i])
  4603. }else{
  4604. unleaveList.push(this.fillMembList[i])
  4605. }
  4606. }
  4607. this.fillMembList = unleaveList
  4608. this.fillMembList_leave = leaveList
  4609. } else if(fill == 1){
  4610. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4611. this.isFill = true;
  4612. }else{
  4613. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4614. this.isFill = true;
  4615. }
  4616. },
  4617. //获取自己填写的日报状态
  4618. getReportFillStatus() {
  4619. this.http.post('/report/getReportFillStatus',{
  4620. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4621. },
  4622. res => {
  4623. if (res.code == "ok") {
  4624. this.fillStatusList = res.data;
  4625. this.allDate.forEach(d=>{
  4626. var fillInfo = null;
  4627. d.state = null;
  4628. this.fillStatusList.forEach(s=>{
  4629. var d1 = s.createDate.split('-')[2];
  4630. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4631. if (d1.indexOf('0') == 0) {
  4632. d1 = d1.substring(1,d1.length);
  4633. }
  4634. if (d1 == d2) {
  4635. d.state = s.state;
  4636. d.missReport = s.missReport;//是否漏填
  4637. d.exceedCardTime = s.exceedCardTime
  4638. }
  4639. })
  4640. })
  4641. this.$forceUpdate();
  4642. }
  4643. },
  4644. error => {
  4645. this.$message({
  4646. message: error,
  4647. type: "error"
  4648. });
  4649. }
  4650. );
  4651. },
  4652. scrollFunction () {
  4653. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4654. if (this.domObj.attachEvent) { // IE
  4655. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4656. } else if (this.domObj.addEventListener) {
  4657. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4658. }
  4659. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4660. },
  4661. mouseScroll(event) { // google 浏览器下
  4662. let detail = event.wheelDelta || event.detail
  4663. let moveForwardStep = -1
  4664. let moveBackStep = 1
  4665. let step = 0
  4666. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4667. event.preventDefault() // 阻止浏览器默认事件
  4668. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4669. },
  4670. // //左右滚动
  4671. // wheel(e){
  4672. // var a = document.getElementById("dateScroll");
  4673. // var scroll_width = 80; //滚动一下的距离
  4674. // var e = e || window.event, v;
  4675. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4676. // if(v>3||-v>3) v=-v;
  4677. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4678. // e.preventDefault(); //阻止浏览器的默认滚动
  4679. // },
  4680. showExportDialog() {
  4681. this.exportType = 0
  4682. this.exportDialog = true;
  4683. },
  4684. showExportTimeDialog() {
  4685. this.exportTimeDialog = true;
  4686. },
  4687. changeAllTime() {
  4688. //总时长发生改变,自动按比例计算
  4689. this.workForm.domains.forEach(d=>{
  4690. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4691. });
  4692. //计算jsTime
  4693. if (this.workForm.createDate) {
  4694. let sdate = new Date(this.workForm.createDate[0]);
  4695. let edate = new Date(this.workForm.createDate[1]);
  4696. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4697. if (days < 0) {
  4698. days = 0;
  4699. }
  4700. this.jsTime = this.reportTimeType.allday * days;
  4701. }
  4702. },
  4703. // 是否加班的单机事件
  4704. check() {
  4705. this.selected = !this.selected
  4706. this.isNew = this.selected
  4707. },
  4708. updateSubProject() {
  4709. this.$forceUpdate();
  4710. },
  4711. selectDegreeId(domain, index) {
  4712. this.http.post('/report/defaultDegree',{
  4713. projectId: domain.projectId
  4714. },
  4715. res => {
  4716. if (res.code == "ok") {
  4717. if(res.data) {
  4718. this.workForm.domains[index].degreeId = res.data.id + ''
  4719. this.$forceUpdate();
  4720. }
  4721. }
  4722. },
  4723. error => {
  4724. this.$message({
  4725. message: error,
  4726. type: "error"
  4727. });
  4728. }
  4729. );
  4730. },
  4731. //项目选中了, 加载子项目
  4732. selectProject(domain, index) {
  4733. if(!domain.projectId){
  4734. return;
  4735. }
  4736. // 默认选中上次填写的自定义维度
  4737. if(this.yonghuUser.customDegreeActive == 1) {
  4738. this.selectDegreeId(domain, index)
  4739. }
  4740. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4741. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4742. this.http.post('/sub-project/list',{
  4743. projectId: domain.projectId,
  4744. isReport: true
  4745. },
  4746. res => {
  4747. //清空之前选中的子项目
  4748. // this.workForm.domains[index].subProjectId = 0;
  4749. if (res.code == "ok") {
  4750. this.workForm.domains[index].subProjectList = res.data;
  4751. this.workForm.domains[index].subProjectId = null;
  4752. this.$forceUpdate();
  4753. }
  4754. },
  4755. error => {
  4756. this.$message({
  4757. message: error,
  4758. type: "error"
  4759. });
  4760. }
  4761. );
  4762. //项目相关的近期任务
  4763. if (this.user.company.packageProject == 1) {
  4764. this.getRecentTaskList(domain, index);
  4765. //获取项目相关专业
  4766. if (this.user.company.packageEngineering == 1) {
  4767. this.getProjectProfessions(domain, index);
  4768. }
  4769. //获取项目下的任务分组
  4770. this.getTaskGroups(domain, index);
  4771. }
  4772. // 获取项目相关的维度
  4773. // domain.degreeId = null
  4774. this.$set(domain,'degreeId',null)
  4775. this.$set(domain,'multiDegrIdArray',null)
  4776. this.dimension(domain, index);
  4777. //获取项目审核人
  4778. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4779. this.getProjectAuditorList(domain, index);
  4780. } else {
  4781. //按分组的负责人来审核
  4782. domain.projectAuditorId = null;
  4783. domain.projectAuditorName = null;
  4784. domain.auditUserList = null;
  4785. }
  4786. if (this.reportTimeType.type == 3) {
  4787. //新增项目时,自动计算
  4788. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4789. }
  4790. //加载昱众的工作职责
  4791. if (this.user.companyId == this.yuzhongCompId) {
  4792. this.updateResponse(domain);
  4793. }
  4794. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4795. if(reportExtraField4Name || reportExtraField5Name) {
  4796. this.getInfoByProjectId(domain, index)
  4797. }
  4798. },
  4799. getInfoByProjectId(domain, index, flag = true) {
  4800. const { projectId } = domain
  4801. const projectList = this.fillProjectList || this.subFillProjectList
  4802. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4803. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  4804. projectId: projectCode,
  4805. date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1]
  4806. },
  4807. res => {
  4808. if (res.code == "ok") {
  4809. if(flag) {
  4810. this.workForm.domains[index].extraField4 = ''
  4811. this.workForm.domains[index].extraField5 = ''
  4812. }
  4813. if((res.data.orderIds || []).length > 0) {
  4814. this.workForm.domains[index].extraField4 = res.data.orderIds[0]
  4815. }
  4816. this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
  4817. this.workForm.domains[index].reportExtraField5List = res.data.lines || []
  4818. this.$forceUpdate();
  4819. }
  4820. },
  4821. error => {
  4822. this.$message({
  4823. message: error,
  4824. type: "error"
  4825. });
  4826. }
  4827. );
  4828. },
  4829. getRecentTaskList(domain, index) {
  4830. //刷新任务时,清空服务
  4831. this.$set(domain, 'sapServiceId', null);
  4832. this.$set(domain, 'taskId', null);
  4833. var param = {
  4834. projectId: domain.projectId,
  4835. isSubstitude:this.isSubstitude?1:0,
  4836. };
  4837. if (domain.groupId) {
  4838. param.groupId = domain.groupId;
  4839. }
  4840. if (domain.stage) {
  4841. param.stage = domain.stage;
  4842. }
  4843. //专业版代填,获取代填员工的任务
  4844. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4845. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4846. this.$message({
  4847. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4848. type: "error"
  4849. });
  4850. return;
  4851. } else {
  4852. param.userId = this.workForm.userId[0];
  4853. }
  4854. }
  4855. this.http.post('/task/getRecentTask',param,
  4856. res => {
  4857. if (res.code == "ok") {
  4858. this.workForm.domains[index].allTaskList = res.data;
  4859. this.workForm.domains[index].taskList = res.data;
  4860. this.$forceUpdate();
  4861. }
  4862. },
  4863. error => {
  4864. this.$message({
  4865. message: error,
  4866. type: "error"
  4867. });
  4868. }
  4869. );
  4870. },
  4871. //获取项目审核人
  4872. getProjectAuditorList(domainItem, index) {
  4873. if(domainItem.projectId == '') {
  4874. return
  4875. }
  4876. domainItem.projectAuditorId = null;
  4877. domainItem.projectAuditorName = null;
  4878. var param = { projectId: domainItem.projectId};
  4879. if (this.isSubstitude) {
  4880. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4881. param.userId = this.workForm.userId[0];
  4882. }
  4883. }
  4884. this.http.post('/project-auditor/getList',param,
  4885. res => {
  4886. if (res.code == "ok") {
  4887. domainItem.auditUserList = res.data;
  4888. if (res.data.length==0) {
  4889. this.$message({
  4890. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  4891. type: "error"
  4892. });
  4893. } else if (res.data.length==1) {
  4894. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  4895. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  4896. }
  4897. this.$forceUpdate();
  4898. }
  4899. },
  4900. error => {
  4901. this.$message({
  4902. message: error,
  4903. type: "error"
  4904. });
  4905. }
  4906. );
  4907. },
  4908. // 获取维度数据
  4909. dimension(domain, index) {
  4910. if(domain.projectId == '') {
  4911. return
  4912. }
  4913. this.http.post('/project/getDegreeList',{
  4914. projectId: domain.projectId,
  4915. },
  4916. res => {
  4917. if (res.code == "ok") {
  4918. // console.log("维度数据",res.data);
  4919. this.workForm.domains[index].wuduList = res.data
  4920. // this.workForm = this.workForm
  4921. this.$forceUpdate()
  4922. }
  4923. },
  4924. error => {
  4925. this.$message({
  4926. message: error,
  4927. type: "error"
  4928. });
  4929. }
  4930. );
  4931. },
  4932. //切换任务阶段
  4933. changeStages(domain, index) {
  4934. if (domain.stage == null || domain.stage == '') {
  4935. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  4936. } else {
  4937. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  4938. }
  4939. this.getRecentTaskList(domain, index);
  4940. this.$forceUpdate();
  4941. },
  4942. getGroupStages(domain, index, keepStage) {
  4943. // console.log(domain);
  4944. if(!domain.groupId){
  4945. domain.projectAuditorId = ''
  4946. domain.stages = []
  4947. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  4948. domain.taskId = ''
  4949. domain.sapServiceId = ''
  4950. }
  4951. if(this.user.timeType.reportAuditType >= 1){
  4952. domain.auditUserList = []
  4953. }
  4954. this.$forceUpdate();
  4955. return
  4956. }
  4957. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  4958. res => {
  4959. if (res.code == "ok") {
  4960. if (!keepStage) {
  4961. domain.stage = '';
  4962. }
  4963. domain.stages = res.data;
  4964. this.getRecentTaskList(domain, index);
  4965. this.$forceUpdate();
  4966. }
  4967. },
  4968. error => {
  4969. this.$message({
  4970. message: error,
  4971. type: "error"
  4972. });
  4973. });
  4974. //检查当前的项目是否需要获取分组的负责人
  4975. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  4976. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  4977. res => {
  4978. if (res.code == "ok") {
  4979. domain.getProjectAuditorList = res.data;
  4980. domain.auditUserList = res.data;
  4981. if (res.data.length==1) {
  4982. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  4983. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  4984. } else if (res.data.length==0) {
  4985. domain.projectAuditorId = null;
  4986. domain.projectAuditorName = null;
  4987. }
  4988. this.$forceUpdate();
  4989. }
  4990. },
  4991. error => {
  4992. this.$message({
  4993. message: error,
  4994. type: "error"
  4995. });
  4996. });
  4997. }
  4998. },
  4999. getProjectProfessions(domain, index) {
  5000. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  5001. res => {
  5002. if (res.code == "ok") {
  5003. this.workForm.domains[index].professionProgress = res.data;
  5004. this.$forceUpdate();
  5005. }
  5006. },
  5007. error => {
  5008. this.$message({
  5009. message: error,
  5010. type: "error"
  5011. });
  5012. });
  5013. },
  5014. //删除自己的日报
  5015. deleteReport() {
  5016. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5017. confirmButtonText: this.$t('btn.determine'),
  5018. cancelButtonText: this.$t('btn.cancel'),
  5019. type: "warning"
  5020. })
  5021. .then(() => {
  5022. this.listLoading = true;
  5023. this.http.post('/report/delete',{
  5024. userId: this.user.id,
  5025. date: this.workForm.createDate
  5026. },
  5027. res => {
  5028. this.listLoading = false;
  5029. if (res.code == "ok") {
  5030. this.$message({
  5031. message: this.$t('message.successfullyDeleted'),
  5032. type: "success"
  5033. });
  5034. this.getReportList();
  5035. this.getDepartment();
  5036. this.dialogVisible = false;
  5037. } else {
  5038. this.$message({
  5039. message: res.msg,
  5040. type: "error"
  5041. });
  5042. }
  5043. },
  5044. error => {
  5045. this.listLoading = false;
  5046. this.$message({
  5047. message: error,
  5048. type: "error"
  5049. });
  5050. }
  5051. );
  5052. })
  5053. .catch(() => {});
  5054. },
  5055. // 管理员删除日报
  5056. guanli(item) {
  5057. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5058. let param = {date: this.date + day, userId: item.id};
  5059. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5060. confirmButtonText: this.$t('btn.determine'),
  5061. cancelButtonText: this.$t('btn.cancel'),
  5062. type: "warning"
  5063. })
  5064. .then(() => {
  5065. this.listLoading = true;
  5066. this.http.post('/report/delete',param,
  5067. res => {
  5068. this.listLoading = false;
  5069. if (res.code == "ok") {
  5070. this.$message({
  5071. message: this.$t('message.successfullyDeleted'),
  5072. type: "success"
  5073. });
  5074. this.getReportList();
  5075. this.getDepartment();
  5076. this.dialogVisible = false;
  5077. } else {
  5078. this.$message({
  5079. message: res.msg,
  5080. type: "error"
  5081. });
  5082. }
  5083. },
  5084. error => {
  5085. this.listLoading = false;
  5086. this.$message({
  5087. message: error,
  5088. type: "error"
  5089. });
  5090. }
  5091. );
  5092. })
  5093. .catch(() => {});
  5094. },
  5095. selectAll() {
  5096. if (this.isAllSelect) {
  5097. var keys = [];
  5098. this.reportNames.forEach(b=>{
  5099. keys.push(b.id);
  5100. })
  5101. this.$refs.approveTree.setCheckedKeys(keys);
  5102. } else {
  5103. this.$refs.approveTree.setCheckedKeys([]);
  5104. }
  5105. },
  5106. removeEmptyNode(list) {
  5107. for (var i=0;i<list.length;i++) {
  5108. var cnt = 0;
  5109. if (list[i].membCount == 0) {
  5110. list.splice(i, 1);
  5111. i--;
  5112. } else if (list[i].children != null) {
  5113. this.removeEmptyNode(list[i].children);
  5114. }
  5115. }
  5116. },
  5117. calculateMembCount(list) {
  5118. for (var i in list) {
  5119. var cnt = 0;
  5120. if (list[i].children != null) {
  5121. this.calculateMembCount(list[i].children);
  5122. for (var m in list[i].children) {
  5123. cnt += list[i].children[m].membCount;
  5124. }
  5125. }
  5126. if (list[i].isUser == 1) {
  5127. cnt++;
  5128. this.membCount++;
  5129. }
  5130. list[i].membCount = cnt;
  5131. }
  5132. },
  5133. stateChange() {
  5134. // console.log(this.allData,'alldate');
  5135. this.membCount = 0;
  5136. if (this.selectState == -1) {
  5137. //全部状态
  5138. this.data = this.allData;
  5139. } else {
  5140. //未填报
  5141. this.seluserText = ''
  5142. var newData = JSON.parse(JSON.stringify(this.allData));
  5143. this.filterState(this.selectState, newData);
  5144. this.data = newData;
  5145. }
  5146. this.calculateMembCount(this.data);
  5147. this.data[0].membCount = this.membCount;//总人数
  5148. },
  5149. //按状态过滤部门人员
  5150. filterState(state, list) {
  5151. for (var i =0;i<list.length; i++) {
  5152. var obj = list[i];
  5153. if (obj.isUser == 1) {
  5154. var match = false;
  5155. if (state == -2) {
  5156. if (obj.state == null) {
  5157. match = true;
  5158. }
  5159. } else {
  5160. if (obj.state == state) {
  5161. match = true;
  5162. }
  5163. }
  5164. if (!match) {
  5165. list.splice(i, 1);
  5166. i--;
  5167. } else {
  5168. }
  5169. } else {
  5170. if (obj.children != null) {
  5171. this.filterState(state, obj.children);
  5172. }
  5173. }
  5174. }
  5175. },
  5176. //a按名称过滤部门人员
  5177. async seluserforText(){
  5178. const { userNameNeedTranslate } = this.user
  5179. this.membCount = 0;
  5180. var newData = JSON.parse(JSON.stringify(this.allData));
  5181. let textList = [this.seluserText]
  5182. if(userNameNeedTranslate == 1) {
  5183. this.dataLoading = true
  5184. let res = await this.postData('/user/getEmployeeList', {
  5185. keyword: this.seluserText,
  5186. cursor: '',
  5187. departmentId: -1,
  5188. pageIndex: 1,
  5189. pageSize: 1000
  5190. })
  5191. textList = res.data.records.map(item => item.name)
  5192. this.dataLoading = false
  5193. }
  5194. // return
  5195. this.seluserforTextin(this.seluserText, newData, textList)
  5196. this.data = newData;
  5197. this.calculateMembCount(this.data);
  5198. this.data[0].membCount = this.membCount;//总人数
  5199. },
  5200. seluserforTextin(text, list, textList = []){
  5201. for (var i =0;i<list.length; i++) {
  5202. var obj = list[i];
  5203. if (obj.isUser == 1) {
  5204. var match = false;
  5205. // if (obj.label.indexOf(text) != -1) {
  5206. // match = true
  5207. // }
  5208. if(textList.some(item => item.includes(obj.label))) {
  5209. match = true
  5210. }
  5211. if (!match) {
  5212. list.splice(i, 1);
  5213. i--;
  5214. } else {
  5215. }
  5216. } else {
  5217. if (obj.children != null) {
  5218. this.seluserforTextin(text, obj.children, textList);
  5219. }
  5220. }
  5221. }
  5222. },
  5223. // 当节点发生变化时
  5224. nodeChangeExpand(data) {
  5225. // 保存当前展开的节点
  5226. let flag = false
  5227. this.nodeModelData.some(item => {
  5228. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5229. flag = true
  5230. return true
  5231. }
  5232. })
  5233. if (!flag) { // 不存在则存到数组里
  5234. this.nodeModelData.push(data.id)
  5235. }
  5236. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5237. },
  5238. nodeChangeCollapse(data) {
  5239. this.nodeModelData.some((item, i) => {
  5240. if (item === data.id) {
  5241. this.nodeModelData.length = i
  5242. }
  5243. })
  5244. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5245. },
  5246. // 部门列表点击
  5247. handleNodeClick(data) {
  5248. // this.dealList = data
  5249. this.theValues(data.id, this.allData)
  5250. // this.depData = data;
  5251. var list = [];
  5252. if (data.id == -1) {
  5253. this.deptId = null;
  5254. this.targetUid = null;
  5255. list = this.data;
  5256. } else if (data.isUser == 1) {
  5257. this.deptId = null;
  5258. this.targetUid = data.id;
  5259. } else {
  5260. this.deptId = data.id;
  5261. this.targetUid = null;
  5262. list.push(data);
  5263. }
  5264. this.getReportList();
  5265. if (list.length > 0) {
  5266. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5267. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5268. }
  5269. },
  5270. exportPushLog(){
  5271. this.http.post('/sap-sync-log/export',{},
  5272. res => {
  5273. if (res.code == "ok") {
  5274. var filePath = res.data;
  5275. var fName = '推送日志.xlsx'
  5276. const a = document.createElement('a'); // 创建a标签
  5277. a.setAttribute('download', fName);// download属性
  5278. a.setAttribute('href', filePath);// href链接
  5279. a.click(); //自执行点击事件
  5280. a.remove();
  5281. } else {
  5282. this.$message({
  5283. message: res.msg,
  5284. type: "error"
  5285. });
  5286. }
  5287. },
  5288. error => {
  5289. this.$message({
  5290. message: error,
  5291. type: "error"
  5292. });
  5293. });
  5294. },
  5295. theValues(id, item) {
  5296. for(var i in item) {
  5297. if(item[i].id == id) {
  5298. this.depData = item[i]
  5299. if(id == '-1') {
  5300. this.translation = '1'
  5301. } else {
  5302. if(item[i].children) {
  5303. this.translation = '2'
  5304. } else {
  5305. this.translation = '3'
  5306. }
  5307. }
  5308. return
  5309. } else {
  5310. if(item[i].children) {
  5311. this.theValues(id, item[i].children)
  5312. }
  5313. }
  5314. }
  5315. },
  5316. //获取可以选择的代填的人员列表
  5317. getSubstitudeUserDeptList() {
  5318. if (this.deptMembData.length == 0) {
  5319. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5320. res => {
  5321. if (res.code == "ok") {
  5322. let noAllData = JSON.parse(JSON.stringify(res.data));
  5323. if (noAllData.length > 0) {
  5324. // if (noAllData[0].label == '全部人员') {
  5325. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5326. noAllData.splice(0,1);
  5327. }
  5328. }
  5329. this.setUserToDept(noAllData);
  5330. this.deptMembData = noAllData;
  5331. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5332. } else {
  5333. this.$message({
  5334. message: res.msg,
  5335. type: "error"
  5336. });
  5337. }
  5338. },
  5339. error => {
  5340. this.$message({
  5341. message: error,
  5342. type: "error"
  5343. });
  5344. });
  5345. }
  5346. },
  5347. // 获取部门列表
  5348. getDepartmentForApprove() {
  5349. this.http.post( this.port.manage.depList, {},
  5350. res => {
  5351. if (res.code == "ok") {
  5352. var list1 = JSON.parse(JSON.stringify(res.data));
  5353. this.deptOptionList = this.changeArr(list1);
  5354. } else {
  5355. this.$message({
  5356. message: res.msg,
  5357. type: "error"
  5358. });
  5359. }
  5360. },
  5361. error => {
  5362. this.$message({
  5363. message: error,
  5364. type: "error"
  5365. });
  5366. });
  5367. },
  5368. // 获取部门列表
  5369. getDepartment() {
  5370. //如果没有权限,就不需要获取
  5371. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5372. return;
  5373. }
  5374. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5375. var param = {date:this.date + day};
  5376. this.http.post("/report/getMembList", param,
  5377. res => {
  5378. if (res.code == "ok") {
  5379. if(res.data.length == 0){
  5380. return
  5381. }
  5382. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5383. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5384. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5385. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5386. // if (this.user.role > 0) {
  5387. // }
  5388. list.splice(0,0,{
  5389. id: -1,
  5390. label: this.$t('lable.allStaff'),
  5391. })
  5392. this.membCount = 0;
  5393. //设置员工到部门下面
  5394. this.setUserToDept(list);
  5395. this.data = list;
  5396. // console.log('data',this.data);
  5397. this.expandDate = [this.data[1].id]
  5398. this.allData = list;
  5399. // if (noAllData.length > 0) {
  5400. // if (noAllData[0].label == '全部人员') {
  5401. // noAllData.splice(0,1);
  5402. // }
  5403. // }
  5404. // this.setUserToDept(noAllData);
  5405. // this.deptMembData = noAllData;
  5406. this.option = this.changeArr(list1);
  5407. list[0].membCount = this.membCount;
  5408. if (this.depData.id == -1) {
  5409. this.depData.membCount = this.membCount;
  5410. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5411. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5412. } else {
  5413. if (this.depData.isUser == null) {
  5414. var dep = this.findTargetDept(this.data, this.depData.id);
  5415. var membDeptList = [];
  5416. membDeptList.push(dep);
  5417. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5418. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5419. }
  5420. }
  5421. if (this.depData.isUser == null) {
  5422. if (this.isFill) {
  5423. this.fillMembList = this.fillList;
  5424. } else {
  5425. this.fillMembList = this.unFillList;
  5426. }
  5427. }
  5428. this.leaveAllNum = 0
  5429. for(let i in this.unFillList){
  5430. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5431. this.leaveAllNum += 1
  5432. }
  5433. }
  5434. this.stateChange()
  5435. } else {
  5436. this.$message({
  5437. message: res.msg,
  5438. type: "error"
  5439. });
  5440. }
  5441. },
  5442. error => {
  5443. this.$message({
  5444. message: error,
  5445. type: "error"
  5446. });
  5447. });
  5448. this.getReportFillStatus();
  5449. },
  5450. findTargetDept(list, deptId) {
  5451. var t = null;
  5452. for (var i=0;i<list.length; i++) {
  5453. if (list[i].isUser == null && list[i].id == deptId) {
  5454. t = list[i];
  5455. break;
  5456. }
  5457. }
  5458. if (t == null) {
  5459. for (var i=0;i<list.length; i++) {
  5460. if (list[i].children != null && list[i].children.length > 0) {
  5461. t = this.findTargetDept(list[i].children, deptId);
  5462. if (t != null) {
  5463. break;
  5464. }
  5465. }
  5466. }
  5467. }
  5468. return t;
  5469. },
  5470. getUserMembListFromDeptList(list, isFill) {
  5471. var membList = [];
  5472. for (var i in list) {
  5473. var deptName = list[i].label;
  5474. if (list[i].userList != null) {
  5475. list[i].userList.forEach(element => {
  5476. if (isFill == 0) {
  5477. //获取未填的
  5478. if (element.state == null) {
  5479. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5480. membList.push(obj);
  5481. }
  5482. } else {
  5483. if (element.state != null) {
  5484. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5485. membList.push(obj);
  5486. }
  5487. }
  5488. });
  5489. }
  5490. if (list[i].children != null) {
  5491. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5492. }
  5493. }
  5494. return membList;
  5495. },
  5496. setUserToDept(list) {
  5497. for (var i in list) {
  5498. var cnt = 0;
  5499. if (list[i].children != null) {
  5500. this.setUserToDept(list[i].children);
  5501. for (var m in list[i].children) {
  5502. cnt += list[i].children[m].membCount;
  5503. }
  5504. }
  5505. if (list[i].userList != null) {
  5506. if (list[i].children == null) {
  5507. list[i].children = [];
  5508. }
  5509. list[i].userList.forEach(element => {
  5510. var obj = {
  5511. id: element.id,
  5512. label:element.name,
  5513. state:element.state,
  5514. parentId:element.departmentId,
  5515. isUser:1,
  5516. workingTime: element.workingTime,
  5517. leaveDays: element.leaveDays,
  5518. leaveTimes: element.leaveTimes
  5519. };
  5520. list[i].children.push(obj);
  5521. this.membCount++;
  5522. cnt++;
  5523. });
  5524. }
  5525. list[i].membCount = cnt;
  5526. }
  5527. },
  5528. // 修改数组
  5529. changeArr(arr) {
  5530. for (var i = 0; i < arr.length; i++) {
  5531. if(arr[i].id != -1 && arr[i].id != 0) {
  5532. if (arr[i].children != null && arr[i].children.length>0) {
  5533. arr[i].children = this.changeArr(arr[i].children);
  5534. }
  5535. arr[i].id && (arr[i].value = arr[i].id);
  5536. delete arr[i].id;
  5537. }
  5538. }
  5539. for(var i in arr) {
  5540. if(arr[i].id == -1 || arr[i].id == 0) {
  5541. arr.splice(i,1)
  5542. }
  5543. }
  5544. return arr;
  5545. },
  5546. //时间段范围设置改动,监听
  5547. onTimeTypeChange(timeType) {
  5548. this.seleChn(1)
  5549. this.showAddMore = true;
  5550. for(var i in this.workForm.domains) {
  5551. if (this.workForm.domains[i].timeType == 0) {
  5552. this.showAddMore = false;
  5553. break;
  5554. }
  5555. }
  5556. if (this.showAddMore) {
  5557. //检测数量
  5558. if (this.workForm.domains.length == 2) {
  5559. this.showAddMore = false;
  5560. } else {
  5561. this.showAddMore = true;
  5562. }
  5563. }
  5564. },
  5565. getTimeType() {
  5566. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5567. res => {
  5568. if (res.code == "ok") {
  5569. var t = res.data;
  5570. this.reportTimeType = t;
  5571. if (this.reportTimeType.type > 0) {
  5572. this.showAddMore = true;
  5573. }
  5574. //转化时间格式
  5575. if (t.allday != null) {
  5576. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5577. }
  5578. if (t.am != null) {
  5579. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5580. }
  5581. if (t.pm != null) {
  5582. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5583. }
  5584. let arr = []
  5585. for(var i in res.data.excludeTimeList) {
  5586. let obj = {
  5587. s: res.data.excludeTimeList[i].startTime,
  5588. e: res.data.excludeTimeList[i].endTime,
  5589. }
  5590. arr.push(obj)
  5591. }
  5592. this.vacationTime = arr
  5593. } else {
  5594. this.$message({
  5595. message: res.msg,
  5596. type: "error"
  5597. });
  5598. }
  5599. },
  5600. error => {
  5601. this.listLoading = false;
  5602. this.$message({
  5603. message: error,
  5604. type: "error"
  5605. });
  5606. });
  5607. },
  5608. // 改变月份 -------
  5609. changeMonthOut() {
  5610. this.getAllDate();
  5611. this.getReportList();
  5612. this.getDepartment();
  5613. },
  5614. // 选择日期
  5615. choseDate(i, item) {
  5616. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5617. return
  5618. }
  5619. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5620. this.choseDay = i;
  5621. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5622. sessionStorage.msg = this.date + day,
  5623. this.getReportList();
  5624. this.getDepartment();
  5625. this.curDate = item.date;
  5626. },
  5627. canClick(i, item){
  5628. let nowDate = new Date()
  5629. let nowDateYear = nowDate.getFullYear()
  5630. let itemYear = parseInt(this.date.split('-')[0])
  5631. let nowDateMonth = nowDate.getMonth() + 1
  5632. let itemMonth = parseInt(this.date.split('-')[1])
  5633. let nowDateDay = nowDate.getDate()
  5634. let itemDay = parseInt(item.showDate.split('.')[1])
  5635. if(nowDateYear < itemYear){
  5636. return false
  5637. }else if(nowDateYear == itemYear){
  5638. if(nowDateMonth < itemMonth){
  5639. return false
  5640. }else if(nowDateMonth == itemMonth){
  5641. if(nowDateDay < itemDay){
  5642. return false
  5643. }
  5644. }
  5645. }
  5646. },
  5647. // 获取日期列表
  5648. getAllDate(e) {
  5649. var dayArry = [];
  5650. var day = this.getCountDays();
  5651. let curMonthDay = null;
  5652. for (var k = 1; k <= day; k++) {
  5653. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5654. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5655. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5656. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5657. if(sessionStorage.msg) {
  5658. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5659. this.choseDay = k - 1;
  5660. curMonthDay = str;
  5661. }
  5662. } else {
  5663. if (new Date().getDate() == k) {
  5664. this.choseDay = k - 1;
  5665. }
  5666. }
  5667. } else {
  5668. this.choseDay = 0;
  5669. }
  5670. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5671. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5672. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5673. }
  5674. this.allDate = dayArry;
  5675. //不能超过最大日期
  5676. if (this.choseDay > day-1) {
  5677. this.choseDay = day-1;
  5678. }
  5679. if(sessionStorage.from != 1){
  5680. let nowmonth = new Date().getMonth() + 1
  5681. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5682. let nowdate = new Date().getDate()
  5683. if(nowd == this.date){
  5684. if(e && sessionStorage.msg){
  5685. }else{
  5686. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5687. }
  5688. let nowday = new Date(sessionStorage.msg).getDate()
  5689. this.choseDay = nowday - 1
  5690. let monthdate = new Date(sessionStorage.msg)
  5691. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5692. }else{
  5693. if(e && sessionStorage.msg){
  5694. }else{
  5695. sessionStorage.msg = this.date + '-01'
  5696. }
  5697. let monthdate = new Date(sessionStorage.msg)
  5698. this.choseDay = monthdate.getDate() - 1
  5699. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5700. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5701. }
  5702. }else{
  5703. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5704. }
  5705. //从消息点击跳转过来的,直接加载指定日期
  5706. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5707. this.curDate = sessionStorage.msg;
  5708. sessionStorage.from = 0;
  5709. } else {
  5710. // if (curMonthDay != null) {
  5711. // // this.curDate = curMonthDay;
  5712. // let d = new Date(sessionStorage.msg)
  5713. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5714. // } else {
  5715. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5716. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5717. // }
  5718. }
  5719. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5720. // if(!sessionStorage.msg){
  5721. // let msgday = this.choseDay + 1
  5722. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5723. // }
  5724. this.getReportFillStatus();
  5725. },
  5726. getCountDays() {
  5727. var newstr = this.date.replace(/-/g, "/");
  5728. var curDate = new Date(newstr+'/01');
  5729. var curMonth = curDate.getMonth();
  5730. curDate.setMonth(curMonth + 1);
  5731. curDate.setDate(0);
  5732. return curDate.getDate();
  5733. },
  5734. reqMore() {
  5735. if (this.hasMore) {
  5736. this.pageIndex++;
  5737. this.requestHttpReports();
  5738. }
  5739. },
  5740. //加载日报数据
  5741. requestHttpReports() {
  5742. //请求数据
  5743. this.listLoading = true;
  5744. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5745. let param = {date: this.date + day};
  5746. if (this.deptId) {
  5747. param.deptId = this.deptId;
  5748. }
  5749. if (this.targetUid) {
  5750. param.userId = this.targetUid;
  5751. }
  5752. //传页码
  5753. if (this.hasMore) {
  5754. param.pageIndex = this.pageIndex;
  5755. }
  5756. this.http.post( this.port.report.list, param,
  5757. res => {
  5758. this.listLoading = false;
  5759. if (res.code == "ok") {
  5760. //扩增
  5761. if (res.data.data.length > 0) {
  5762. this.reportList = this.reportList.concat(res.data.data);
  5763. } else if (this.pageIndex > 1){
  5764. this.$message({
  5765. message: this.$t('meiYouGengDuoShuJuLe'),
  5766. type: "info"
  5767. });
  5768. }
  5769. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5770. if(document.querySelector("#day"+this.choseDay)){
  5771. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5772. }
  5773. } else {
  5774. this.$message({
  5775. message: res.msg,
  5776. type: "error"
  5777. });
  5778. }
  5779. },
  5780. error => {
  5781. this.listLoading = false;
  5782. this.$message({
  5783. message: error,
  5784. type: "error"
  5785. });
  5786. });
  5787. },
  5788. //获取日报列表
  5789. getReportList() {
  5790. //初始化,重置数据
  5791. this.pageIndex = 0;
  5792. this.hasMore = true;
  5793. this.reportList = [];
  5794. this.requestHttpReports();
  5795. },
  5796. //刷新日报状态,用于审核后更新
  5797. refreshReportData(reportId) {
  5798. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5799. res => {
  5800. if (res.code == "ok") {
  5801. for (var m=0;m<this.reportList.length; m++) {
  5802. var d = this.reportList[m].data;
  5803. var find = d.filter(r=>r.id == reportId);
  5804. if (find.length > 0) {
  5805. find[0].state = res.data.state;
  5806. if (find[0].state == 2) {//被驳回,要可以编辑
  5807. this.reportList[m].state = 2;
  5808. }
  5809. find[0].isDeptAudit = res.data.isDeptAudit;
  5810. find[0].departmentAuditState = res.data.departmentAuditState;
  5811. find[0].projectAuditorName = res.data.projectAuditorName;
  5812. find[0].projectAuditorId = res.data.projectAuditorId;
  5813. find[0].projectAuditState = res.data.projectAuditState;
  5814. find[0].rejectUserid = res.data.rejectUserid;
  5815. find[0].rejectUsername = res.data.rejectUsername;
  5816. find[0].rejectReason = res.data.rejectReason;
  5817. this.$forceUpdate();
  5818. break;
  5819. }
  5820. }
  5821. } else {
  5822. this.$message({
  5823. message: res.msg,
  5824. type: "error"
  5825. });
  5826. }
  5827. },
  5828. error => {
  5829. this.listLoading = false;
  5830. this.$message({
  5831. message: error,
  5832. type: "error"
  5833. });
  5834. });
  5835. },
  5836. //导出员工工时统计
  5837. exportUserTime() {
  5838. this.listLoading = true;
  5839. var param = {};
  5840. if (this.exportParam.dateRange != null) {
  5841. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5842. }
  5843. this.http.post('/department/exportDeptStatistic', param,
  5844. res => {
  5845. this.listLoading = false;
  5846. if (res.code == "ok") {
  5847. location.href = res.data;
  5848. this.exportTimeDialog = false;
  5849. } else {
  5850. this.$message({
  5851. message: res.msg,
  5852. type: "error"
  5853. });
  5854. }
  5855. },
  5856. error => {
  5857. this.listLoading = false;
  5858. this.$message({
  5859. message: error,
  5860. type: "error"
  5861. });
  5862. });
  5863. },
  5864. //导出日报
  5865. exportReport() {
  5866. this.exportingData = true;
  5867. var param = {};
  5868. if (this.exportParam.dateRange != null) {
  5869. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5870. }
  5871. if (this.exportParam.projectId != null) {
  5872. param.projectId = this.exportParam.projectId;
  5873. }
  5874. if (this.exportParam.departmentId != null) {
  5875. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  5876. param.departmentIds = this.exportParam.departmentId.join(',')
  5877. }
  5878. param.stateKey = this.stateKey
  5879. // param.departmentId = this.user.departmentId
  5880. this.http.post(this.port.report.export, param,
  5881. res => {
  5882. this.exportingData = false;
  5883. if (res.code == "ok") {
  5884. var filePath = res.data;
  5885. const a = document.createElement('a'); // 创建a标签
  5886. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  5887. a.setAttribute('href', filePath);// href链接
  5888. a.click(); //自执行点击事件
  5889. a.remove();
  5890. this.exportDialog = false;
  5891. } else {
  5892. this.$message({
  5893. message: res.msg,
  5894. type: "error"
  5895. });
  5896. }
  5897. },
  5898. error => {
  5899. this.exportingData = false;
  5900. this.$message({
  5901. message: error,
  5902. type: "error"
  5903. });
  5904. });
  5905. },
  5906. //导出日报审核记录
  5907. exportReportLog() {
  5908. this.exportingData = true;
  5909. var param = {};
  5910. if (this.exportReportLogParam.dateRange != null) {
  5911. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  5912. }
  5913. this.http.post('/report-log/exportReportLog', param,
  5914. res => {
  5915. this.exportingData = false;
  5916. if (res.code == "ok") {
  5917. var filePath = res.data;
  5918. const a = document.createElement('a'); // 创建a标签
  5919. a.setAttribute('download','日报审核记录.xlsx');// download属性
  5920. a.setAttribute('href', filePath);// href链接
  5921. a.click(); //自执行点击事件
  5922. a.remove();
  5923. this.exportDialog = false;
  5924. } else {
  5925. this.$message({
  5926. message: res.msg,
  5927. type: "error"
  5928. });
  5929. }
  5930. },
  5931. error => {
  5932. this.exportingData = false;
  5933. this.$message({
  5934. message: error,
  5935. type: "error"
  5936. });
  5937. });
  5938. },
  5939. restUserCardTime(item){
  5940. let param={}
  5941. param.userId=item.userId
  5942. param.createDate=item.createDate
  5943. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  5944. res => {
  5945. if (res.code == "ok") {
  5946. this.showMonthWorkTimeReminder()
  5947. } else {
  5948. this.$message({
  5949. message: res.msg,
  5950. type: "error"
  5951. });
  5952. }
  5953. },
  5954. error => {
  5955. this.$message({
  5956. message: error,
  5957. type: "error"
  5958. });
  5959. });
  5960. },
  5961. importReportLog(item){
  5962. //首先判断文件类型
  5963. let str = item.file.name.split(".");
  5964. let format = str[str.length - 1];
  5965. if (format != "xls" && format != "xlsx") {
  5966. this.$message({
  5967. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  5968. type: "error"
  5969. });
  5970. } else {
  5971. const loading = this.$loading({
  5972. lock: true,
  5973. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  5974. spinner: 'el-icon-loading',
  5975. background: 'rgba(0, 0, 0, 0.7)'
  5976. });
  5977. let formData = new FormData();
  5978. formData.append("multipartFile", item.file);
  5979. this.http.uploadFile('/report-log/importReportLogChange', formData,
  5980. res => {
  5981. this.$refs.upload.clearFiles();
  5982. loading.close();
  5983. if (res.code == "ok") {
  5984. this.$message({
  5985. message: res.msg,
  5986. type: "success"
  5987. });
  5988. } else {
  5989. this.$message({
  5990. message: res.msg,
  5991. type: "error"
  5992. });
  5993. }
  5994. },
  5995. error => {
  5996. this.$refs.upload.clearFiles();
  5997. loading.close();
  5998. this.$message({
  5999. message: error,
  6000. type: "error"
  6001. });
  6002. });
  6003. }
  6004. },
  6005. //获取项目列表
  6006. getProjectList() {
  6007. this.listLoading = true;
  6008. this.http.post( this.port.project.list, {},
  6009. res => {
  6010. this.listLoading = false;
  6011. if (res.code == "ok") {
  6012. for(var i in res.data) {
  6013. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6014. res.data[i].projectCode = ''
  6015. }
  6016. }
  6017. this.projectList = res.data;
  6018. } else {
  6019. this.$message({
  6020. message: res.msg,
  6021. type: "error"
  6022. });
  6023. }
  6024. },
  6025. error => {
  6026. this.listLoading = false;
  6027. this.$message({
  6028. message: error,
  6029. type: "error"
  6030. });
  6031. });
  6032. },
  6033. getSubUsersFillProjectList(userId) {
  6034. this.http.post( this.port.project.list, {
  6035. forReport: 1,
  6036. userId: userId
  6037. },res => {
  6038. if (res.code == "ok") {
  6039. for(var i in res.data) {
  6040. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6041. res.data[i].projectCode = ''
  6042. }
  6043. }
  6044. this.subFillProjectList = res.data;
  6045. this.getRecentlyProject(userId)
  6046. } else {
  6047. this.$message({
  6048. message: res.msg,
  6049. type: "error"
  6050. });
  6051. }
  6052. },
  6053. error => {
  6054. this.$message({
  6055. message: error,
  6056. type: "error"
  6057. });
  6058. });
  6059. },
  6060. // 获取填报日报的项目下拉列表
  6061. getFillProjectList() {
  6062. this.http.post( this.port.project.list, {
  6063. forReport: 1
  6064. },res => {
  6065. if (res.code == "ok") {
  6066. for(var i in res.data) {
  6067. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6068. res.data[i].projectCode = ''
  6069. }
  6070. }
  6071. this.fillProjectList = res.data;
  6072. this.getRecentlyProject()
  6073. } else {
  6074. this.$message({
  6075. message: res.msg,
  6076. type: "error"
  6077. });
  6078. }
  6079. },
  6080. error => {
  6081. this.$message({
  6082. message: error,
  6083. type: "error"
  6084. });
  6085. });
  6086. },
  6087. //自己填写日报时,刷新到自己的可填报日报列表
  6088. refreshToMyReportProjectList() {
  6089. this.getRecentlyProject();
  6090. },
  6091. getBasecostItemList() {
  6092. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6093. companyId: this.user.companyId
  6094. },
  6095. res => {
  6096. if (res.code == "ok") {
  6097. this.timeBasecostList = res.data;
  6098. }
  6099. });
  6100. },
  6101. getAIReport(createDate) {
  6102. this.http.post('/report/getAIReport', {},
  6103. res => {
  6104. if (res.code == "ok") {
  6105. var quanbu = 0
  6106. this.jsDay = 1
  6107. var zhi = ''
  6108. var slp = res.data
  6109. for(var i in slp) {
  6110. var sp = +slp[i].workingTime + 0
  6111. zhi = this.jsDay * sp
  6112. quanbu = +quanbu + zhi
  6113. }
  6114. this.jsTime = quanbu
  6115. var aiReportData = res.data;
  6116. this.canCancelInDialog = false
  6117. if(aiReportData.length != 0) {
  6118. var arr = [];
  6119. for(var i in aiReportData) {
  6120. arr.push({
  6121. id: null,
  6122. projectId: aiReportData[i].projectId,
  6123. workingTime: aiReportData[i].workingTime,
  6124. content: '',
  6125. progress:100,
  6126. state: 2,
  6127. timeType: aiReportData[i].timeType,
  6128. subProjectList: aiReportData[i].subProjectList,
  6129. taskList: aiReportData[i].taskList,
  6130. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6131. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6132. taskId: aiReportData[i].taskId,
  6133. startTime: aiReportData[i].startTime,
  6134. endTime: aiReportData[i].endTime,
  6135. isOvertime: 0,
  6136. progress:aiReportData[i].progress,
  6137. professionProgress: aiReportData[i].professionProgressList,
  6138. stages:aiReportData[i].stages,
  6139. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6140. pics: null,
  6141. multiWorktime: aiReportData[i].multiWorktime || 0,
  6142. worktimeList: [{}],
  6143. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6144. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6145. wuduList: aiReportData[i].degreeList,
  6146. taskGroups:aiReportData[i].taskGroups,
  6147. customData: aiReportData[i].customData,//自定义的数值
  6148. auditUserList: aiReportData[i].auditUserList,
  6149. projectAuditorId: aiReportData[i].projectAuditorId,
  6150. projectAuditorName: aiReportData[i].projectAuditorName,
  6151. overtimeHours: aiReportData[i].overtimeHours,
  6152. customText: aiReportData[i].customText,
  6153. basecostId: aiReportData[i].basecostId,
  6154. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6155. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6156. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6157. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6158. canEdit: true
  6159. })
  6160. }
  6161. this.workForm.domains = arr;
  6162. } else {
  6163. }
  6164. this.canEdit = true;
  6165. this.originCanEdit = true;
  6166. this.seleChn()
  6167. } else {
  6168. this.$message({
  6169. message: res.msg,
  6170. type: "error"
  6171. });
  6172. }
  6173. },
  6174. error => {
  6175. this.$message({
  6176. message: error,
  6177. type: "error"
  6178. });
  6179. });
  6180. },
  6181. // 获取个人某天的日报 111111
  6182. getReport() {
  6183. this.http.post( this.port.report.getPort, {
  6184. date: this.workForm.createDate
  6185. },
  6186. res => {
  6187. if (res.code == "ok") {
  6188. var quanbu = 0
  6189. this.jsDay = 1
  6190. var zhi = ''
  6191. var slp = res.data.report
  6192. for(var i in slp) {
  6193. var sp = +slp[i].workingTime + 0
  6194. zhi = this.jsDay * sp
  6195. quanbu = +quanbu + zhi
  6196. }
  6197. this.jsTime = quanbu
  6198. var list = res.data;
  6199. this.report = list;
  6200. this.reportTimeType = this.report.timeType;
  6201. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6202. this.isWeekend = !this.report.isWorkDay;
  6203. this.canCancelInDialog = false;
  6204. this.hasWrittenReport = list.report.length != 0;
  6205. if(list.report.length != 0) {
  6206. var arr = [];
  6207. this.canEdit = false;
  6208. let candelete = true
  6209. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6210. for(var i in list.report) {
  6211. var flg = null
  6212. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6213. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6214. var filteredRespList = null
  6215. if (targetP.length > 0) {
  6216. var isPublic = targetP[0].isPublic;
  6217. 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);
  6218. }
  6219. let copyData = {
  6220. id: list.report[i].id,
  6221. projectId: list.report[i].projectId,
  6222. workingTime: list.report[i].workingTime,
  6223. content: list.report[i].content,
  6224. state: list.report[i].state,
  6225. timeType: list.report[i].timeType,
  6226. subProjectList: list.report[i].subProjectList,
  6227. taskList: list.report[i].taskList,
  6228. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6229. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6230. taskId: list.report[i].taskId,
  6231. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6232. startTime: list.report[i].startTime,
  6233. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6234. endTime: list.report[i].endTime,
  6235. isOvertime: flg,
  6236. progress:list.report[i].progress,
  6237. professionProgress: list.report[i].professionProgressList,
  6238. stages:list.report[i].stages,
  6239. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6240. pics: list.report[i].pics,
  6241. multiWorktime: list.report[i].multiWorktime,
  6242. worktimeList: list.report[i].worktimeList,
  6243. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6244. multiDegrIdArray: list.report[i].multiDegrIdList,
  6245. wuduList: list.report[i].degreeList,
  6246. taskGroups:list.report[i].taskGroups,
  6247. customData: list.report[i].customData,//自定义的数值
  6248. auditUserList: list.report[i].auditUserList,
  6249. overtimeHours: list.report[i].overtimeHours,
  6250. customText: list.report[i].customText,
  6251. basecostId: list.report[i].basecostId,
  6252. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6253. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6254. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6255. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6256. canEdit: list.report[i].state >= 2 ? true : false,
  6257. extraField1: list.report[i].extraField1,
  6258. extraField2: list.report[i].extraField2,
  6259. extraField3: list.report[i].extraField3,
  6260. extraField4: list.report[i].extraField4,
  6261. extraField5: list.report[i].extraField5,
  6262. workContentList: list.report[i].workContentList,
  6263. filteredRespList: filteredRespList,
  6264. serviceList: list.report[i].serviceList,
  6265. sapServiceId: list.report[i].sapServiceId,
  6266. reportTargetDeptId: list.report[i].deptId
  6267. }
  6268. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6269. //分组负责人审核的情况下,前端不需要显示,无需设置
  6270. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6271. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6272. }
  6273. arr.push(copyData);
  6274. if (list.report[i].state >= 2) {
  6275. this.canEdit = true;
  6276. }
  6277. if(list.report[i].state < 2){
  6278. candelete = false
  6279. }
  6280. if (list.report[i].state == 0){
  6281. this.canCancelInDialog = true
  6282. }
  6283. // 加判断
  6284. if(this.user.timeType.choseFromAlbum == 1) {
  6285. let arrList = []
  6286. for(var k in list.report[i].pics) {
  6287. let obj = {
  6288. name: k,
  6289. url: list.report[i].pics[k]
  6290. }
  6291. arrList.push(obj)
  6292. }
  6293. arr[i].imgListUrl = arrList
  6294. arr[i].imgList = list.report[i].pics
  6295. }
  6296. if(reportExtraField4Name || reportExtraField5Name) {
  6297. this.getInfoByProjectId(copyData, i, false)
  6298. }
  6299. }
  6300. this.reportCanDelete = candelete
  6301. this.workForm = {
  6302. createDate: this.workForm.createDate,
  6303. domains: arr,
  6304. userNames:null,
  6305. userId:null,
  6306. time: list.time,
  6307. showRefresh: list.showRefresh
  6308. }
  6309. } else {
  6310. this.workForm = {
  6311. createDate: this.workForm.createDate,
  6312. domains: [{
  6313. id: null,
  6314. projectId: "",
  6315. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6316. content: "",
  6317. progress:100,
  6318. state: 2,
  6319. timeType:0,
  6320. multiWorktime: this.reportTimeType.multiWorktime,
  6321. worktimeList:[{}],
  6322. canEdit: true,
  6323. auditorFirst: '',
  6324. auditorSec: '',
  6325. auditorThird: '',
  6326. ccUserid: ''
  6327. }],
  6328. userId:null,
  6329. userNames:null,
  6330. time: this.report.time,
  6331. showRefresh: list.showRefresh
  6332. }
  6333. // businessTrips 有数据的情况下
  6334. const businessTrips = res.data.businessTrips || []
  6335. this.businessTripsArray = res.data.businessTrips || []
  6336. if(businessTrips.length > 0) {
  6337. this.workForm.domains = businessTrips.map((item, index) => {
  6338. return {
  6339. id: null,
  6340. projectId: item.projectId,
  6341. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6342. content: "",
  6343. progress:100,
  6344. state: 2,
  6345. timeType:0,
  6346. multiWorktime: this.reportTimeType.multiWorktime,
  6347. worktimeList:[{}],
  6348. canEdit: true,
  6349. auditorFirst: '',
  6350. auditorSec: '',
  6351. auditorThird: '',
  6352. ccUserid: ''
  6353. }
  6354. })
  6355. for(let domainsIndex in this.workForm.domains) {
  6356. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6357. }
  6358. }
  6359. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6360. this.$set(this.workForm.domains[0],'isOvertime',true)
  6361. if(this.reportTimeType.type != 2){
  6362. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6363. }
  6364. }
  6365. if(this.user.timeType.type == 1) {
  6366. var shuzhi = this.user.timeType.allday + ''
  6367. // console.log('执行一次', shuzhi.indexOf('.'))
  6368. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6369. }
  6370. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6371. //默认给第一个,必填字段
  6372. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6373. }
  6374. this.canEdit = true;
  6375. }
  6376. this.originCanEdit = this.canEdit;
  6377. this.seleChn()
  6378. } else {
  6379. this.$message({
  6380. message: res.msg,
  6381. type: "error"
  6382. });
  6383. }
  6384. },
  6385. error => {
  6386. this.$message({
  6387. message: error,
  6388. type: "error"
  6389. });
  6390. });
  6391. },
  6392. guanbi() {
  6393. this.falsss = false,
  6394. this.workTimeForMinYi=0
  6395. },
  6396. // 打开日报填写
  6397. fillInReport(i, isBatch) {
  6398. this.isWeekend = false
  6399. this.reportCanDelete = false
  6400. // console.log(this.user.timeType.type, '选择时长')
  6401. if(i != 1) {
  6402. this.falsss = false
  6403. } else {
  6404. this.falsss = true
  6405. }
  6406. if (this.isSubstitude) {
  6407. this.getSubstitudeUserDeptList();
  6408. } else {
  6409. this.refreshToMyReportProjectList();
  6410. }
  6411. if(i == -1 || this.isSubstitude) {
  6412. this.isDisable = false;
  6413. } else {
  6414. this.isDisable = true;
  6415. }
  6416. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6417. this.isBatch = isBatch;
  6418. if (this.isBatch == 0 && !this.isSubstitude) {
  6419. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6420. let weekday = new Date(this.workForm.createDate).getDay()
  6421. if(this.user.companyId == 817){
  6422. if(weekday == 0){
  6423. this.isWeekend = true
  6424. }
  6425. }else{
  6426. if(weekday == 0 || weekday == 6){
  6427. this.isWeekend = true
  6428. }
  6429. }
  6430. this.getReport(i);
  6431. } else {
  6432. this.jsTime = 0
  6433. this.jsDay = 0
  6434. this.workForm = {
  6435. createDate: null,//批量填报没有日期
  6436. domains: [{
  6437. id: null,
  6438. projectId: "",
  6439. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6440. content: "",
  6441. progress:100,
  6442. state: 2,
  6443. timeType:0,
  6444. multiWorktime: this.reportTimeType.multiWorktime,
  6445. worktimeList:[{}],
  6446. canEdit: true,
  6447. }],
  6448. }
  6449. if(this.user.timeType.type == 1) {
  6450. var shuzhi = this.user.timeType.allday + ''
  6451. // console.log('执行二次')
  6452. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6453. }
  6454. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6455. this.workForm.showRefresh = true;
  6456. }
  6457. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6458. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6459. }
  6460. this.canEdit = true;
  6461. }
  6462. if (this.isSubstitude) {
  6463. //代填情况,默认计算合计工时
  6464. this.jsDay = 1
  6465. this.seleChn();
  6466. }
  6467. this.dialogVisible = true;
  6468. },
  6469. //按周填报的弹窗口中编辑单项目相关数据
  6470. setWeekFormReportItem(reportId, i, names, row,sss) {
  6471. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6472. this.http.post('/report/getReportById', {
  6473. reportId: reportId
  6474. },
  6475. res => {
  6476. if (res.code == "ok") {
  6477. var data = res.data.report;
  6478. sss.subProjectId = data.subProjectId
  6479. sss.subProjectList = data.subProjectList;
  6480. sss.stage = data.stage
  6481. sss.subProjectList = data.subProjectList
  6482. sss.stages = data.stages
  6483. sss.taskGroups = data.taskGroups;
  6484. sss.auditUserList = data.auditUserList;
  6485. sss.degreeId = data.degreeId;
  6486. sss.customData = data.customData;
  6487. sss.wuduList = data.degreeList;
  6488. if(reportExtraField4Name || reportExtraField5Name) {
  6489. sss.extraField4 = data.extraField4 || ''
  6490. sss.extraField5 = data.extraField5 || ''
  6491. }
  6492. this.zhoBaoIdx = i
  6493. this.zhoBaoName = names
  6494. this.zhoBao = sss
  6495. this.zhis = row
  6496. if (sss.groupId) {
  6497. //最后一个参数表示是否保留stage的值,不要重置为空
  6498. this.getGroupStages(this.zhoBao, 0, true)
  6499. }
  6500. if(reportExtraField4Name || reportExtraField5Name) {
  6501. this.weekGetInfoByProjectId(sss)
  6502. }
  6503. this.$forceUpdate();
  6504. }
  6505. });
  6506. },
  6507. // 重新计算合计
  6508. fillInThePedometerOnAWeeklyBasis(index) {
  6509. const weeklyItem = this.zhoData[index] || {}
  6510. const dynamicProjectList = this.selProjectList || []
  6511. const collectionArray = dynamicProjectList.map(item => {
  6512. const name = item.projectName
  6513. return Number(weeklyItem[name].workingTime || 0)
  6514. })
  6515. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6516. this.zhoData[index].he = totalNum
  6517. },
  6518. //输入工时触发
  6519. onInputWorkTime(index) {
  6520. const weeklyItem = this.zhoData[index] || {}
  6521. },
  6522. // 按周填报里内容的填写
  6523. showWeekItemEdit(item, i, projectId,names, row) {
  6524. if (item.state == 0) {
  6525. this.$message({
  6526. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6527. type: "error"
  6528. });
  6529. return;
  6530. }
  6531. if (item.state == 1) {
  6532. this.$message({
  6533. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6534. type: "error"
  6535. });
  6536. return;
  6537. }
  6538. if(this.user.timeType.notAllowedNoAttendance == 1){
  6539. if(this.zhoData[i].corpTime){
  6540. if(this.zhoData[i].corpTime.workHours == 0){
  6541. this.$message({
  6542. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6543. type: 'error'
  6544. })
  6545. return
  6546. }
  6547. }else{
  6548. this.$message({
  6549. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6550. type: 'error'
  6551. })
  6552. return
  6553. }
  6554. }
  6555. var obj = {}
  6556. obj.projectId = projectId
  6557. this.tianxieDialogVisible = true
  6558. this.scopess = item
  6559. var sss = {}
  6560. if (item.id != null) {
  6561. sss.id = item.id;
  6562. sss.state = item.state;
  6563. } else {
  6564. sss.id = -1;
  6565. sss.state = 3;
  6566. }
  6567. sss.projectId = projectId;
  6568. sss.progress = item.progress
  6569. sss.time = item.time
  6570. sss.content = item.content;
  6571. if (sss.time == '' && this.reportTimeType.type == 2) {
  6572. //取已填时间范围中最大的一个作为开始时间
  6573. var startTime = '09:00';
  6574. var fillStartTime = '00:00';
  6575. for (var t in this.selProjectList) {
  6576. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6577. if (fillItem.time) {
  6578. if (fillItem.time[1] > fillStartTime) {
  6579. fillStartTime = fillItem.time[1];
  6580. }
  6581. }
  6582. }
  6583. if (fillStartTime == '00:00') {
  6584. fillStartTime = '09:00';
  6585. }
  6586. var fillEndMax = '18:00';
  6587. if (fillStartTime >= '18:00') {
  6588. fillEndMax = '23:59';
  6589. }
  6590. sss.time = [fillStartTime, fillEndMax];
  6591. }
  6592. sss.groupId = item.groupId
  6593. sss.stage = item.stage;
  6594. sss.workingTime = item.workingTime
  6595. sss.projectAuditorId = item.projectAuditorId;
  6596. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6597. //默认选中第一个
  6598. sss.basecostId = this.timeBasecostList[0].id;
  6599. }
  6600. var hasEdited = this.zhoData[i][names].hasEdited;
  6601. if (hasEdited) {
  6602. console.log('执行到了这个')
  6603. console.log('执行到了这个', { ...item }, obj)
  6604. sss = { ...item }
  6605. //编辑过了
  6606. sss.subProjectId = item.subProjectId
  6607. sss.stage = item.stage
  6608. sss.subProjectList = item.subProjectList
  6609. sss.stages = item.stages
  6610. sss.taskGroups = item.taskGroups;
  6611. // sss.auditUserList = obj.auditUserList ;
  6612. sss.degreeId = item.degreeId;
  6613. sss.customData = item.customData;
  6614. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6615. //只有一个审核人,自动设置上去
  6616. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6617. }
  6618. sss.wuduList = item.wuduList;
  6619. this.zhoBaoIdx = i
  6620. this.zhoBaoName = names
  6621. this.zhoBao = sss
  6622. this.zhis = row
  6623. if (sss.groupId) {
  6624. //最后一个参数表示是否保留stage的值,不要重置为空
  6625. this.getGroupStages(this.zhoBao, 0, true)
  6626. }
  6627. this.$forceUpdate();
  6628. this.getWeeklyTaskList(sss)
  6629. } else {
  6630. //第一次打开,获取数据
  6631. if (sss.id == -1) {
  6632. //新填报的
  6633. this.selectProject(obj, 0);
  6634. var that = this
  6635. setTimeout(() =>{
  6636. sss.subProjectId = that.workForm.domains[0].subProjectId
  6637. sss.subProjectList = item.subProjectList;
  6638. sss.stage = that.workForm.domains[0].stage
  6639. sss.subProjectList = that.workForm.domains[0].subProjectList
  6640. sss.stages = that.workForm.domains[0].stages
  6641. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6642. sss.auditUserList = obj.auditUserList;
  6643. sss.degreeId = item.degreeId;
  6644. sss.customData = item.customData;
  6645. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6646. //只有一个审核人,自动设置上去
  6647. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6648. }
  6649. sss.wuduList = row[0].wuduList
  6650. that.zhoBaoIdx = i
  6651. that.zhoBaoName = names
  6652. that.zhoBao = sss
  6653. that.zhis = row
  6654. if (sss.groupId) {
  6655. //最后一个参数表示是否保留stage的值,不要重置为空
  6656. this.getGroupStages(that.zhoBao, 0, false)
  6657. }
  6658. that.$forceUpdate();
  6659. this.getWeeklyTaskList(sss)
  6660. },600);
  6661. } else {
  6662. //编辑填报过的;数据库已经存在的
  6663. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6664. }
  6665. if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
  6666. setTimeout(() => {
  6667. this.weekGetInfoByProjectId(sss)
  6668. }, 1000)
  6669. }
  6670. }
  6671. },
  6672. weekGetInfoByProjectId(item) {
  6673. console.log(item, '<=== item')
  6674. const { projectId } = item
  6675. const projectList = this.fillProjectList || this.subFillProjectList
  6676. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6677. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  6678. projectId: projectCode,
  6679. date: this.zhoData[this.zhoBaoIdx].zhoDataTime
  6680. },
  6681. res => {
  6682. if (res.code == "ok") {
  6683. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6684. this.zhoBao.reportExtraField5List = res.data.lines || []
  6685. if((res.data.orderIds || []).length > 0) {
  6686. this.zhoBao.extraField4 = res.data.orderIds[0]
  6687. }
  6688. console.log(this.zhoBao, '<===== this.zhoBao')
  6689. this.$forceUpdate();
  6690. }
  6691. },
  6692. error => {
  6693. this.$message({
  6694. message: error,
  6695. type: "error"
  6696. });
  6697. });
  6698. // console.log(item)
  6699. // console.log(this.zhoBao)
  6700. },
  6701. // 按周填报里内容的填写点击确定
  6702. setWeekProItemData() {
  6703. //专业版模式下,任务分组和阶段必填
  6704. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6705. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6706. this.$message({
  6707. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6708. type: "error"
  6709. });
  6710. return;
  6711. }
  6712. }
  6713. // 检查任务分组
  6714. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6715. this.$message({
  6716. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6717. type: "error"
  6718. });
  6719. return
  6720. }
  6721. //检查子项目是否必填
  6722. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6723. this.$message({
  6724. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6725. type: "error"
  6726. });
  6727. return;
  6728. }
  6729. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6730. this.$message({
  6731. message: this.$t('message.Pleaseselectareviewer'),
  6732. type: "error"
  6733. });
  6734. return
  6735. }
  6736. if(this.user.timeType.reportAuditType == 3){
  6737. let auditTips = ''
  6738. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6739. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6740. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6741. if(auditTips){
  6742. auditTips = auditTips.substring(0,auditTips.length - 1)
  6743. this.$message({
  6744. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6745. type: 'error'
  6746. })
  6747. return
  6748. }
  6749. }
  6750. let errtips = ''
  6751. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6752. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6753. errtips += this.user.timeType.customDegreeName + '、'
  6754. }
  6755. }
  6756. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6757. errtips += this.user.timeType.customDataName + '、'
  6758. }
  6759. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6760. errtips += this.user.timeType.customTextName + '、'
  6761. }
  6762. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6763. errtips += this.$t('other.workMatters') +'、'
  6764. }
  6765. if(errtips){
  6766. errtips = errtips.substring(0,errtips.length - 1)
  6767. this.$message({
  6768. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6769. type: 'error'
  6770. })
  6771. return
  6772. }
  6773. this.tianxieDialogVisible = false
  6774. var zhong = this.zhoData
  6775. this.zhoBao.hasEdited = true;
  6776. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6777. this.zhoData = zhong
  6778. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6779. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6780. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6781. },
  6782. // 获取本周
  6783. getCurrentWeek() {
  6784. //今天
  6785. this.targetWeekDate = new Date();
  6786. this.initWeekFormData();
  6787. // this.jiazai()
  6788. },
  6789. // 获取上周
  6790. handleGetPrevWeek() {
  6791. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6792. this.initWeekFormData();
  6793. // this.jiazai()
  6794. },
  6795. // 获取下周
  6796. handleGetNextvWeek() {
  6797. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6798. this.initWeekFormData()
  6799. },
  6800. // 加载动画
  6801. jiazai() {
  6802. this.weekDataLoading = true
  6803. var that = this
  6804. setTimeout(() =>{
  6805. that.weekDataLoading = false
  6806. },1000);
  6807. },
  6808. // 转时间格式
  6809. dealdate(date) {
  6810. const dt = new Date(date)
  6811. const y = dt.getFullYear()
  6812. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6813. const d = (dt.getDate() + '').padStart(2, '0')
  6814. return `${y}-${m}-${d}`
  6815. },
  6816. // 按周填报
  6817. fillInReportss() {
  6818. window.addEventListener('scroll', this.handleScroll, true)
  6819. // this.jiazai()
  6820. this.fillWeekDialogVisi = true;
  6821. if (this.isSubstitude) {
  6822. this.substitudeStep = 1;
  6823. this.getSubstitudeUserDeptList();
  6824. } else {
  6825. this.getCurrentWeek();
  6826. }
  6827. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6828. //重新获取工时预警类型的预算项
  6829. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6830. companyId: this.user.companyId
  6831. },
  6832. res => {
  6833. if (res.code == "ok") {
  6834. this.timeBasecostList = res.data;
  6835. }
  6836. });
  6837. }
  6838. },
  6839. fillInReportCustom() {
  6840. this.weekIndex++
  6841. this.weekParentData = {
  6842. isSubstitude: this.isSubstitude
  6843. }
  6844. this.fillWeekDialogVisiCustom = true
  6845. },
  6846. // 按周填报的项目筛选
  6847. selListFun(){
  6848. this.selProjectList = []
  6849. if(this.selCon.length){
  6850. for (let i = 0; i < this.selCon.length; i++) {
  6851. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6852. }
  6853. this.selConShow = false ;
  6854. for (let i in this.zhoData) {
  6855. var obj = this.zhoData[i];
  6856. for(var j in this.selProjectList) {
  6857. var xinzhi = this.selProjectList[j].projectName
  6858. obj[xinzhi] = {}
  6859. obj[xinzhi].time = ''
  6860. obj[xinzhi].content = ''
  6861. obj[xinzhi].progress = 0
  6862. obj[xinzhi].workingTime = 0
  6863. }
  6864. }
  6865. this.initWeekFormData();
  6866. }else{
  6867. this.$message({
  6868. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  6869. type:'error'
  6870. })
  6871. }
  6872. },
  6873. setWeekCardTimeData(list) {
  6874. for(let i in list){
  6875. let datei = '';
  6876. if (this.user.timeType.showDdCardtime == 1) {
  6877. datei = list[i].workDate;
  6878. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6879. datei = list[i].createDate;
  6880. } else if (this.user.timeType.syncFanwei == 1) {
  6881. datei = list[i].workDate;
  6882. }
  6883. for(let m in this.zhoData) {
  6884. if(datei == this.zhoData[m].zhoDataTime){
  6885. let item = {
  6886. startTime: list[i].startTime,
  6887. endTime: list[i].endTime,
  6888. workHours: list[i].workHours,
  6889. otTime: list[i].otTime
  6890. }
  6891. this.$set(this.zhoData[m],'corpTime',item)
  6892. }
  6893. }
  6894. }
  6895. },
  6896. getWeeklyCardTime(){ //按周填报获取考勤信息
  6897. let dateStr = []
  6898. for(let i in this.zhoData){
  6899. dateStr.push(this.zhoData[i].zhoDataTime)
  6900. }
  6901. this.http.post('/report/getWeeklyCardTime',{
  6902. dateStr: JSON.stringify(dateStr)
  6903. },res => {
  6904. if(res.code == 'ok'){
  6905. for(let i in res.data){
  6906. let datei = '';
  6907. if (this.user.timeType.showDdCardtime == 1) {
  6908. datei = res.data[i].workDate.split('-');
  6909. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  6910. datei = res.data[i].createDate.split('-');
  6911. }
  6912. for(let m in this.zhoData){
  6913. let datem = new Date(this.zhoData[m].zhoDataTime)
  6914. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  6915. let item = {
  6916. startTime: res.data[i].startTime,
  6917. endTime: res.data[i].endTime,
  6918. workHours: res.data[i].workHours
  6919. }
  6920. this.$set(this.zhoData[m],'corpTime',item)
  6921. }
  6922. }
  6923. }
  6924. }else{
  6925. this.$message({
  6926. message: res.msg,
  6927. type: 'error'
  6928. })
  6929. }
  6930. },err => {
  6931. this.$message({
  6932. message: err,
  6933. type: 'error'
  6934. })
  6935. })
  6936. },
  6937. selListqx(){
  6938. this.fillWeekDialogVisi = false
  6939. this.selProjectList = []
  6940. this.selCon = []
  6941. },
  6942. handleScroll() {
  6943. this.changdu = this.projectList.length + 1
  6944. },
  6945. // 自动选择时间点的事件
  6946. // async zhoTimes(item, i) {
  6947. // var iss = i
  6948. // if(item.time == null) {
  6949. // return
  6950. // } else {
  6951. // const zhi = this.zhoData[iss];
  6952. // let he = 0;
  6953. // const timeArr = Object.values(zhi)
  6954. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  6955. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  6956. // const data = await this.getWeekHoursByTimeRange(timeArr);
  6957. // console.log(data, 'data');
  6958. // zhi.he = `${he}h`;
  6959. // }
  6960. // },
  6961. async zhoTimes(item, index) {
  6962. const zho = this.zhoData[index];
  6963. if (!item.time) {
  6964. return;
  6965. }
  6966. const timeArr = Object.values(zho)
  6967. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  6968. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  6969. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  6970. zho.he = `${totalHours[0]}h`;
  6971. },
  6972. // 判断两个时间段是否重叠
  6973. timeOverlap(idx, dateAr) {
  6974. let zhi = 0
  6975. for (let k in dateAr) {
  6976. if (idx !== k) {
  6977. 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))) {
  6978. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  6979. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  6980. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  6981. }
  6982. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  6983. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6984. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  6985. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  6986. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6987. } else {
  6988. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  6989. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  6990. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  6991. }
  6992. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  6993. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  6994. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  6995. }
  6996. }
  6997. }
  6998. }
  6999. }
  7000. return zhi
  7001. },
  7002. // 计算时间
  7003. getHourMinutes(str, end) {
  7004. var he = 0
  7005. var date2 = '2021/12/12 ' + end +':00'
  7006. var date1 = '2021/12/12 ' + str +':00'
  7007. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  7008. var leave1=date3%(24*3600*1000)
  7009. var hours=Math.floor(leave1/(3600*1000))
  7010. var leave2=leave1%(3600*1000)
  7011. var minutes=Math.floor(leave2/(60*1000))
  7012. var shi = hours+'.'+ minutes
  7013. return he += +shi
  7014. },
  7015. // 自动选择事件长度的事件
  7016. zhoXuan(item, i) {
  7017. var iss = i
  7018. if(item.time == null) {
  7019. return
  7020. } else {
  7021. var zhi = this.zhoData[iss]
  7022. var he = 0
  7023. for(var i in zhi) {
  7024. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  7025. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  7026. console.log('执行')
  7027. he += +zhi[i].workingTime
  7028. }
  7029. }
  7030. zhi.he = he + 'h'
  7031. }
  7032. },
  7033. getPushWorkLogData(){
  7034. this.http.post('/sap-sync-log/list', {},
  7035. res => {
  7036. if (res.code == "ok") {
  7037. this.pushWorkTimeLogData = res.data;
  7038. } else {
  7039. this.$message({
  7040. message: res.msg,
  7041. type: "error"
  7042. });
  7043. }
  7044. },
  7045. error => {
  7046. this.$message({
  7047. message: error,
  7048. type: "error"
  7049. });
  7050. });
  7051. },
  7052. // 获取全部人员
  7053. getUsers() {
  7054. this.http.post('/user/getSimpleActiveUserList', {},
  7055. res => {
  7056. if (res.code == "ok") {
  7057. this.usersList = res.data;
  7058. } else {
  7059. this.$message({
  7060. message: res.msg,
  7061. type: "error"
  7062. });
  7063. }
  7064. },
  7065. error => {
  7066. this.$message({
  7067. message: error,
  7068. type: "error"
  7069. });
  7070. });
  7071. },
  7072. // 按时间比例
  7073. addBli(item, i) {
  7074. var iss = i
  7075. if(item.time == null) {
  7076. return
  7077. } else {
  7078. var zhi = this.zhoData[iss]
  7079. var he = 0
  7080. for(var i in zhi) {
  7081. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7082. he += +zhi[i].workingTime
  7083. }
  7084. }
  7085. zhi.he = he.toFixed(1) + 'h'
  7086. }
  7087. },
  7088. //按周填报选择的项目发生变化,需要设置列
  7089. onSelProjectChange() {
  7090. for (let i = 0; i < this.selCon.length; i++) {
  7091. var exists = false;
  7092. for (let j = 0; j < this.selProjectList.length; j++) {
  7093. if (this.selProjectList[j].id == this.selCon[i]) {
  7094. exists = true;
  7095. break;
  7096. }
  7097. }
  7098. if (!exists) {
  7099. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7100. this.selProjectList.push(newProject);
  7101. //添加新项目
  7102. for (var w in this.zhoData) {
  7103. var dayItem = this.zhoData[w];
  7104. var pName = newProject.projectName;
  7105. dayItem[pName] = {};
  7106. dayItem[pName].time = ''
  7107. dayItem[pName].content = ''
  7108. dayItem[pName].progress = 0
  7109. dayItem[pName].workingTime = 0
  7110. }
  7111. }
  7112. }
  7113. //去掉
  7114. for (let j = 0; j < this.selProjectList.length; j++) {
  7115. var exists = false;
  7116. for (let i = 0; i < this.selCon.length; i++) {
  7117. if (this.selProjectList[j].id == this.selCon[i]) {
  7118. exists = true;
  7119. break;
  7120. }
  7121. }
  7122. if (!exists) {
  7123. this.selProjectList.splice(j, 1);
  7124. j--;
  7125. }
  7126. }
  7127. this.loadFilledWeekReportItem();
  7128. //刷新表格
  7129. // this.$refs.weekTable.doLayout();
  7130. },
  7131. //根据选中的项目来刷新填写表格
  7132. loadFilledWeekReportItem() {
  7133. for (var w in this.zhoData) {
  7134. var dayItem = this.zhoData[w];
  7135. for (var i = 0; i < this.selProjectList.length; i++) {
  7136. var curColumnProject = this.selProjectList[i];
  7137. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7138. for (var t in dayItem.reportList) {
  7139. //有日报的项目,不能取消选择
  7140. for (var p in this.fillProjectList) {
  7141. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7142. }
  7143. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7144. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7145. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7146. if (this.reportTimeType.type == 2) {
  7147. //时间段模式
  7148. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7149. }
  7150. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7151. break;
  7152. }
  7153. }
  7154. // dayItem[curColumnProject.projectName] = matchReportItem;
  7155. }
  7156. }
  7157. this.$nextTick(()=>{
  7158. this.$refs.weekTable.doLayout();
  7159. });
  7160. },
  7161. initWeekFormData() {
  7162. this.weekDataLoading = true;
  7163. for (var p in this.fillProjectList) {
  7164. this.fillProjectList[p].canCancel = 1;
  7165. }
  7166. var param = {
  7167. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7168. };
  7169. if (this.isSubstitude) {
  7170. //传代填人的userId
  7171. param.targetUserId = this.workForm.userId[0];
  7172. }
  7173. this.http.post('/report/getWeeklyReportData',param,res => {
  7174. this.weekDataLoading = false;
  7175. if(res.code == 'ok'){
  7176. let projectList = res.data.projectList;
  7177. if (projectList.length > 0) {
  7178. //有选择过项目进行填报,直接选中
  7179. this.selProjectList = projectList;
  7180. this.selCon = [];
  7181. for (let i = 0; i < projectList.length; i++) {
  7182. this.selCon.push(projectList[i].id);
  7183. }
  7184. }
  7185. //设置日期
  7186. this.weekDateRange = res.data.dateList;
  7187. this.zhoData = [];
  7188. var arrst = []
  7189. for(var i in this.weekDateRange) {
  7190. var obj = {}
  7191. obj.zhoDataTime = this.weekDateRange[i].date
  7192. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7193. obj.he = this.weekDateRange[i].filledTime;
  7194. obj.canFill = this.weekDateRange[i].canFill;
  7195. // obj.filledTime = this.weekDateRange[i].filledTime;
  7196. obj.reportList = this.weekDateRange[i].reportList;
  7197. //初始化,防止渲染报错
  7198. for (var j = 0; j < this.selProjectList.length; j++) {
  7199. var pName = this.selProjectList[j].projectName
  7200. obj[pName] = {}
  7201. obj[pName].time = ''
  7202. obj[pName].content = ''
  7203. obj[pName].progress = 0
  7204. obj[pName].workingTime = 0
  7205. }
  7206. arrst.push(obj)
  7207. }
  7208. this.zhoData = arrst
  7209. this.setWeekCardTimeData(res.data.cardTimeList);
  7210. this.loadFilledWeekReportItem();
  7211. }else{
  7212. this.$message({
  7213. message: res.msg,
  7214. type: 'error'
  7215. })
  7216. }
  7217. },err => {
  7218. this.$message({
  7219. message: err,
  7220. type: 'error'
  7221. })
  7222. })
  7223. },
  7224. zhoZhi(res, i) {
  7225. var zhi = 0
  7226. for(var i in res) {
  7227. if(i != 'zhoDataTime' && i != 'he') {
  7228. zhi += +res[i]
  7229. }
  7230. }
  7231. res.he = zhi
  7232. },
  7233. zhoBtn(i) {
  7234. // this.zhoData.split(i, 1)
  7235. var arr = this.zhoData
  7236. arr.splice(i, 1)
  7237. },
  7238. zhoAddlast(){
  7239. this.selConShow = true
  7240. },
  7241. closeAddWeeklyReport(){
  7242. this.fillWeekDialogVisi = false
  7243. this.selConShow = true
  7244. this.selProjectList = []
  7245. this.selCon = []
  7246. },
  7247. checkDateWorkTime() {
  7248. //针对苏州景昱,单独的检查逻辑
  7249. if (this.user.companyId == 5978) {
  7250. //调接口,先检查工时是否存在异常
  7251. var zhi = this.zhoData;
  7252. var array = [];
  7253. for(let n in zhi){
  7254. if(zhi[n].he){
  7255. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7256. array.push(workData)
  7257. }
  7258. }
  7259. this.submitingReport = true;
  7260. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7261. res => {
  7262. this.submitingReport = false;
  7263. if (res.code == "ok") {
  7264. this.submitWeekReport(0)
  7265. } else {
  7266. this.$confirm(res.msg, this.$t('other.prompts'), {
  7267. confirmButtonText: this.$t('huLveBingTiJiao'),
  7268. cancelButtonText: this.$t('btn.cancel'),
  7269. type: 'error'
  7270. }).then(() => {
  7271. this.submitWeekReport(0)
  7272. }).catch(() => {
  7273. });
  7274. }
  7275. },
  7276. error => {
  7277. this.$message({
  7278. message: error,
  7279. type: "error"
  7280. });
  7281. });
  7282. }
  7283. },
  7284. // 提交按周填报
  7285. submitWeekReport(isDraft) {
  7286. var zhi = this.zhoData
  7287. var ll = 0
  7288. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7289. if(this.reportTimeType.type == 2) {
  7290. for(var i in zhi) {
  7291. this.dateAr = []
  7292. var alp = []
  7293. var zhis = zhi[i]
  7294. for(var j in zhis) {
  7295. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7296. let objs = {}
  7297. objs.s = zhis[j].time[0]
  7298. objs.e = zhis[j].time[1]
  7299. objs.p = j
  7300. alp.push(objs)
  7301. }
  7302. }
  7303. this.dateAr = alp
  7304. if (this.reportTimeType.timeCanOverlap == 0) {
  7305. let str = this.$t('message.Filledtimeperiodsoverlap')
  7306. if(this.dateAr.length > 0) {
  7307. const trus = this.fns();
  7308. const overlapDataTime = this.getOverlapData(alp);
  7309. if (overlapDataTime.length > 0) {
  7310. const arrList = overlapDataTime.map((item) => item.p);
  7311. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7312. }
  7313. ll += 1
  7314. if(!trus) {
  7315. this.$message({
  7316. message: str,
  7317. type: 'error'
  7318. })
  7319. return false
  7320. }
  7321. }
  7322. } else {
  7323. if(this.dateAr.length > 0) {
  7324. ll +=1 ;
  7325. }
  7326. }
  7327. }
  7328. if(ll == 0) {
  7329. this.$message({
  7330. message: this.$t('message.Pleasefillinthetime'),
  7331. type: 'error'
  7332. })
  7333. return false
  7334. }
  7335. } else if(this.reportTimeType.type == 1){
  7336. for(var i in zhi) {
  7337. var zhis = zhi[i]
  7338. for(var j in zhis) {
  7339. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7340. ll += 1
  7341. }
  7342. }
  7343. }
  7344. if(ll == 0) {
  7345. this.$message({
  7346. message: this.$t('message.Pleaseselectatime'),
  7347. type: 'error'
  7348. })
  7349. return false
  7350. }
  7351. let overcorp = ''
  7352. for(let n in zhi){
  7353. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7354. overcorp += zhi[n].zhoDataTime + ','
  7355. }
  7356. }
  7357. if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
  7358. overcorp = overcorp.substring(0,overcorp.length - 1)
  7359. this.$message({
  7360. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7361. type: 'error'
  7362. })
  7363. return
  7364. }
  7365. }
  7366. var submits = []
  7367. let formData = new FormData();
  7368. formData.append("draft", isDraft);
  7369. if(this.reportTimeType.multiWorktime == 1){
  7370. for (var i in this.zhoData) {
  7371. var zhoD = this.zhoData[i]
  7372. var flgs = false
  7373. for(var j in zhoD) {
  7374. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7375. flgs = true
  7376. // formData.append("degreeId", "-1");
  7377. formData.append("id", '-1');
  7378. if (this.isSubstitude) {
  7379. formData.append('targetUids',this.workForm.userId[0]);
  7380. }
  7381. for(var s in this.selProjectList) {
  7382. if(j == this.selProjectList[s].projectName) {
  7383. formData.append("projectId", this.selProjectList[s].id);
  7384. break;
  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("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7405. formData.append("reportTimeType", this.reportTimeType.type);
  7406. formData.append("endTime", '');
  7407. formData.append("startTime", '');
  7408. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7409. var lix = []
  7410. var objjs = {}
  7411. objjs.startTime = zhoD[j].time[0]
  7412. objjs.endTime = zhoD[j].time[1]
  7413. if (zhoD[j].content == null || zhoD[j].content == '') {
  7414. zhoD[j].content == '-'
  7415. }
  7416. objjs.content = zhoD[j].content
  7417. lix.push(objjs)
  7418. var zhiZhi = JSON.stringify(lix)
  7419. zhiZhi = zhiZhi.replace(/,/g,"@");
  7420. formData.append("content", zhiZhi)
  7421. formData.append("isOvertime", 0)
  7422. formData.append("professionProgress", "[]")
  7423. if (zhoD[j].groupId) {
  7424. formData.append("groupId",zhoD[j].groupId)
  7425. } else {
  7426. //解决后台groupId数组越界的问题
  7427. formData.append("groupId",0)
  7428. }
  7429. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7430. formData.append("createDate",zhoD.zhoDataTime)
  7431. if (zhoD[j].projectAuditorId) {
  7432. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7433. }
  7434. if(zhoD[j].basecostId) {
  7435. formData.append("basecostId", zhoD[j].basecostId);
  7436. } else {
  7437. formData.append("basecostId", 0);
  7438. }
  7439. if(this.user.timeType.customDegreeActive){
  7440. if (this.user.timeType.customDegreeMultiple) {
  7441. if (zhoD[j].multiDegrIdArray) {
  7442. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7443. } else {
  7444. formData.append('multiDegrId','[]')
  7445. }
  7446. } else {
  7447. if (zhoD[j].degreeId) {
  7448. formData.append('degreeId',zhoD[j].degreeId)
  7449. } else {
  7450. formData.append('degreeId','-1')
  7451. }
  7452. }
  7453. }else{
  7454. formData.append("degreeId", "-1");
  7455. }
  7456. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7457. formData.append('customData',zhoD[j].customData)
  7458. }else if(this.user.timeType.customDataActive){
  7459. formData.append('customData',0)
  7460. }
  7461. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7462. formData.append('customText',zhoD[j].customText)
  7463. }else if(this.user.timeType.customTextActive){
  7464. formData.append('customText','-')
  7465. }
  7466. if(reportExtraField4Name || reportExtraField5Name) {
  7467. formData.append('extraField4', zhoD[j].extraField4 || '')
  7468. formData.append('extraField5', zhoD[j].extraField5 || '')
  7469. }
  7470. }
  7471. }
  7472. }
  7473. } else {
  7474. for (var i in this.zhoData) {
  7475. var zhoD = this.zhoData[i]
  7476. var flgs = false
  7477. if(this.reportTimeType.type == 2) {
  7478. for(var k in this.selProjectList) {
  7479. var pItem = this.selProjectList[k];
  7480. var pName = pItem.projectName;
  7481. var j = pName;
  7482. var pid = pItem.id;
  7483. console.log('j==周报中的项目='+j);
  7484. if(zhoD[j].time && zhoD[j].time != 'null') {
  7485. flgs = true
  7486. // formData.append("degreeId", "-1");
  7487. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7488. if (this.isSubstitude) {
  7489. formData.append('targetUids',this.workForm.userId[0]);
  7490. }
  7491. formData.append("projectId", pid);
  7492. if(this.user.timeType.reportAuditType == 3){
  7493. let audItem = {}
  7494. if(this.user.timeType.auditLevel > 0){
  7495. audItem.auditorFirst = zhoD[j].auditorFirst
  7496. }
  7497. if(this.user.timeType.auditLevel > 1){
  7498. audItem.auditorSec = zhoD[j].auditorSec
  7499. }
  7500. if(this.user.timeType.auditLevel > 2){
  7501. audItem.auditorThird = zhoD[j].auditorThird
  7502. }
  7503. if(zhoD[j].ccUserid){
  7504. audItem.ccUserid = zhoD[j].ccUserid
  7505. }
  7506. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7507. }
  7508. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7509. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7510. formData.append("reportTimeType", this.reportTimeType.type);
  7511. formData.append("endTime", zhoD[j].time[1]);
  7512. formData.append("startTime", zhoD[j].time[0]);
  7513. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7514. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7515. formData.append("isOvertime", 0)
  7516. formData.append("professionProgress", "[]")
  7517. if (zhoD[j].groupId) {
  7518. formData.append("groupId",zhoD[j].groupId)
  7519. } else {
  7520. //解决后台groupId数组越界的问题
  7521. formData.append("groupId",0)
  7522. }
  7523. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7524. formData.append("createDate",zhoD.zhoDataTime)
  7525. if (zhoD[j].projectAuditorId) {
  7526. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7527. } else {
  7528. //对齐数据
  7529. formData.append("projectAuditorId",'-');
  7530. }
  7531. if(zhoD[j].basecostId) {
  7532. formData.append("basecostId", zhoD[j].basecostId);
  7533. } else {
  7534. formData.append("basecostId", 0);
  7535. }
  7536. if(this.user.timeType.customDegreeActive){
  7537. if (this.user.timeType.customDegreeMultiple) {
  7538. if (zhoD[j].multiDegrIdArray) {
  7539. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7540. } else {
  7541. formData.append("multiDegrId", "[]");
  7542. }
  7543. } else {
  7544. if (zhoD[j].degreeId) {
  7545. formData.append('degreeId',zhoD[j].degreeId)
  7546. } else {
  7547. formData.append("degreeId", "-1");
  7548. }
  7549. }
  7550. }else{
  7551. formData.append("degreeId", "-1");
  7552. }
  7553. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7554. formData.append('customData',zhoD[j].customData)
  7555. }else if(this.user.timeType.customDataActive){
  7556. formData.append('customData',0)
  7557. }
  7558. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7559. formData.append('customText',zhoD[j].customText)
  7560. }else if(this.user.timeType.customTextActive){
  7561. formData.append('customText','-')
  7562. }
  7563. if(reportExtraField4Name || reportExtraField5Name) {
  7564. formData.append('extraField4', zhoD[j].extraField4 || '')
  7565. formData.append('extraField5', zhoD[j].extraField5 || '')
  7566. }
  7567. }
  7568. }
  7569. } else {
  7570. for(var k in this.selProjectList) {
  7571. var pItem = this.selProjectList[k];
  7572. var pName = pItem.projectName;
  7573. var j = pName;
  7574. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7575. flgs = true
  7576. // formData.append("degreeId", "-1");
  7577. console.log('进入了workFpppp==='+j);
  7578. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7579. if (this.isSubstitude) {
  7580. formData.append('targetUids',this.workForm.userId[0]);
  7581. }
  7582. formData.append("projectId", pItem.id);
  7583. if(this.user.timeType.reportAuditType == 3){
  7584. let audItem = {}
  7585. if(this.user.timeType.auditLevel > 0){
  7586. audItem.auditorFirst = zhoD[j].auditorFirst
  7587. }
  7588. if(this.user.timeType.auditLevel > 1){
  7589. audItem.auditorSec = zhoD[j].auditorSec
  7590. }
  7591. if(this.user.timeType.auditLevel > 2){
  7592. audItem.auditorThird = zhoD[j].auditorThird
  7593. }
  7594. if(zhoD[j].ccUserid){
  7595. audItem.ccUserid = zhoD[j].ccUserid
  7596. }
  7597. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7598. }
  7599. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7600. // formData.append("subProjectId", zhoD[j].subProjectId);
  7601. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7602. formData.append("reportTimeType", this.reportTimeType.type);
  7603. if(this.reportTimeType.type == 1) {
  7604. formData.append("workingTime", zhoD[j].workingTime);
  7605. } else if(this.reportTimeType.type == 2) {
  7606. formData.append("endTime", zhoD[j].time[1]);
  7607. formData.append("startTime", zhoD[j].time[0]);
  7608. } else if(this.reportTimeType.type == 3) {
  7609. formData.append("progress", zhoD[j].progress);
  7610. formData.append("workingTime", zhoD[j].workingTime);
  7611. }
  7612. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7613. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7614. formData.append("isOvertime", 0)
  7615. formData.append("professionProgress", "[]")
  7616. if (zhoD[j].groupId) {
  7617. formData.append("groupId",zhoD[j].groupId)
  7618. } else {
  7619. //解决后台groupId数组越界的问题
  7620. formData.append("groupId",0)
  7621. }
  7622. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7623. formData.append("createDate",zhoD.zhoDataTime)
  7624. if (zhoD[j].projectAuditorId) {
  7625. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7626. } else {
  7627. //对齐数据
  7628. formData.append("projectAuditorId",'-')
  7629. }
  7630. if(zhoD[j].basecostId) {
  7631. formData.append("basecostId", zhoD[j].basecostId);
  7632. } else {
  7633. formData.append("basecostId", 0);
  7634. }
  7635. if(this.user.timeType.customDegreeActive){
  7636. if (this.user.timeType.customDegreeMultiple) {
  7637. if (zhoD[j].multiDegrIdArray) {
  7638. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7639. } else {
  7640. formData.append("multiDegrId", "[]");
  7641. }
  7642. } else {
  7643. if (zhoD[j].degreeId) {
  7644. formData.append('degreeId',zhoD[j].degreeId)
  7645. } else {
  7646. formData.append("degreeId", "-1");
  7647. }
  7648. }
  7649. }else{
  7650. formData.append("degreeId", "-1");
  7651. }
  7652. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7653. formData.append('customData',zhoD[j].customData)
  7654. }else if(this.user.timeType.customDataActive){
  7655. formData.append('customData',0)
  7656. }
  7657. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7658. formData.append('customText',zhoD[j].customText)
  7659. }else if(this.user.timeType.customTextActive){
  7660. formData.append('customText','-')
  7661. }
  7662. if(reportExtraField4Name || reportExtraField5Name) {
  7663. formData.append('extraField4', zhoD[j].extraField4 || '')
  7664. formData.append('extraField5', zhoD[j].extraField5 || '')
  7665. }
  7666. }
  7667. }
  7668. }
  7669. }
  7670. }
  7671. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7672. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7673. if(!next) {
  7674. this.$message({
  7675. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7676. type: 'error'
  7677. })
  7678. return
  7679. }
  7680. // 自定义维度
  7681. this.submitingReport = true;
  7682. this.http.uploadFile( this.port.report.editPort, formData,
  7683. res => {
  7684. // this.listLoading = false;
  7685. this.submitingReport = false;
  7686. if (res.code == "ok") {
  7687. this.$message({
  7688. message: this.$t('message.fillinsuccessfully'),
  7689. type: "success"
  7690. });
  7691. this.fillWeekDialogVisi = false
  7692. this.selConShow = true
  7693. this.zhoData = []
  7694. this.weekDateRange = ''
  7695. this.getReportList();
  7696. this.getDepartment();
  7697. // 关闭弹窗 并 清空
  7698. this.selProjectList = []
  7699. this.selCon = []
  7700. this.getRecentlyProject()
  7701. } else {
  7702. this.$message({
  7703. message: res.msg,
  7704. type: "error"
  7705. });
  7706. }
  7707. },
  7708. error => {
  7709. this.submitingReport = false;
  7710. this.$message({
  7711. message: error,
  7712. type: "error"
  7713. });
  7714. });
  7715. },
  7716. handleGroupAuditorData(data) {
  7717. const { reportAuditType } = this.user.timeType
  7718. if(reportAuditType != 1 && reportAuditType != 2) {
  7719. return {next: true}
  7720. }
  7721. let arrList = [];
  7722. Object.entries(data).forEach(([key, obj]) => {
  7723. Object.entries(obj).forEach(([projectName, projectData]) => {
  7724. if (projectData.workingTime && !projectData.groupId) {
  7725. arrList.push({
  7726. projectName,
  7727. date: obj.zhoDataTime,
  7728. dateText: obj.zhoDataTimeTxt
  7729. });
  7730. }
  7731. });
  7732. });
  7733. if(arrList.length > 0) {
  7734. return {
  7735. next: false,
  7736. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7737. }
  7738. } else {
  7739. return {
  7740. next: true,
  7741. error: [],
  7742. }
  7743. }
  7744. },
  7745. ChangeHourMinutestr (str) {
  7746. if (str !== "0" && str !== "" && str !== null) {
  7747. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7748. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7749. } else {
  7750. return "";
  7751. }
  7752. },
  7753. // 得到两个日期中间的日期
  7754. getdiffdate(stime,etime){
  7755. //初始化日期列表,数组
  7756. var diffdate = new Array();
  7757. var i=0;
  7758. //开始日期小于等于结束日期,并循环
  7759. while(stime<=etime){
  7760. diffdate[i] = stime;
  7761. //获取开始日期时间戳
  7762. var stime_ts = new Date(stime).getTime();
  7763. //增加一天时间戳后的日期
  7764. var next_date = stime_ts + (24*60*60*1000);
  7765. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7766. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7767. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7768. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7769. stime = next_dates_y+next_dates_m+next_dates_d;
  7770. //增加数组key
  7771. i++;
  7772. }
  7773. return diffdate;
  7774. },
  7775. // 添加模块
  7776. addDomain(i) {
  7777. var leftProgress = 10;
  7778. if (this.reportTimeType.type == 3) {
  7779. //计算已经待分配工时比例
  7780. let array = this.workForm.domains;
  7781. let totalProgress = 0;
  7782. for (var i=0;i<array.length; i++) {
  7783. totalProgress += array[i].progress;
  7784. }
  7785. if (totalProgress < 100) {
  7786. leftProgress = 100 - totalProgress;
  7787. }
  7788. }
  7789. var addItem = {
  7790. projectId: "",
  7791. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7792. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7793. ),
  7794. content: "",
  7795. progress:leftProgress,
  7796. state:2,//2-表示待提交
  7797. multiWorktime: this.reportTimeType.multiWorktime,
  7798. worktimeList:[{}],
  7799. canEdit: true,
  7800. auditorFirst: '',
  7801. auditorSec: '',
  7802. auditorThird: '',
  7803. ccUserid: ''
  7804. // degreeId: '',
  7805. };
  7806. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7807. this.$set(addItem,'isOvertime',true)
  7808. if(this.reportTimeType.type == 3){
  7809. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7810. }
  7811. }
  7812. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7813. //默认给第一个,必填字段
  7814. addItem.basecostId = this.timeBasecostList[0].id;
  7815. }
  7816. this.workForm.domains.push(addItem);
  7817. document.getElementById('workFormsItemBottom').scrollIntoView()
  7818. this.canEdit = true
  7819. if (this.reportTimeType.type == 0) {
  7820. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7821. var length = this.workForm.domains.length;
  7822. if (length == 2) {
  7823. this.showAddMore = false;
  7824. }
  7825. }
  7826. this.chuji()
  7827. this.seleChn()
  7828. },
  7829. // 移除模块
  7830. delDomain(i) {
  7831. this.workForm.domains.splice(i,1)
  7832. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7833. if (!this.originCanEdit) {
  7834. let iscan = false
  7835. for(let i in this.workForm.domains){
  7836. if(this.workForm.domains[i].canEdit){
  7837. iscan = true
  7838. }
  7839. }
  7840. this.canEdit = iscan
  7841. }
  7842. //检测当前剩下的一个,时间类型是否是全天
  7843. if (this.reportTimeType.type == 0) {
  7844. if (this.workForm.domains[0].timeType == 0) {
  7845. this.showAddMore = false;
  7846. } else {
  7847. this.showAddMore = true;
  7848. }
  7849. }
  7850. if(this.user.timeType.multiWorktime == 1) {
  7851. this.iptChangs()
  7852. } else {
  7853. this.seleChn(0)
  7854. }
  7855. },
  7856. // 改变月份
  7857. changeMonth() {
  7858. this.isWeekend = false
  7859. let date = new Date()
  7860. let nowmon = date.getMonth() + 1
  7861. let nowday = date.getDate()
  7862. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  7863. if (this.isBatch == 0) {
  7864. if(this.user.timeType.fillAhead == 0){
  7865. let date_a = new Date(this.workForm.createDate)
  7866. if(date_a.getTime() > date.getTime()){
  7867. this.workForm.createDate = nowdate
  7868. }
  7869. }
  7870. //只有按天填报才能获取当天的日报
  7871. if(!this.isSubstitude){
  7872. let weekday = new Date(this.workForm.createDate).getDay()
  7873. if(this.user.companyId == 817){
  7874. if(weekday == 0){
  7875. this.isWeekend = true
  7876. }
  7877. }else{
  7878. if(weekday == 0 || weekday == 6){
  7879. this.isWeekend = true
  7880. }
  7881. }
  7882. this.getReport()
  7883. } else {
  7884. //获取代填人员的考勤
  7885. if (this.user.timeType.showCorpwxCardtime == 1) {
  7886. this.getTargetUserCardTime();
  7887. }
  7888. }
  7889. }else {
  7890. if(this.user.timeType.fillAhead == 0){
  7891. let date_a = new Date(this.workForm.createDate[1])
  7892. if(date_a.getTime() > date.getTime()){
  7893. this.workForm.createDate[1] = nowdate
  7894. let sdate = new Date(this.workForm.createDate[0])
  7895. let edate = new Date(this.workForm.createDate[1])
  7896. if(sdate > edate){
  7897. this.workForm.createDate[0] = this.workForm.createDate[1]
  7898. }
  7899. }
  7900. }
  7901. }
  7902. },
  7903. // 判断时间段
  7904. fns() {
  7905. for (let k in this.dateAr) {
  7906. if (!this.judege(k)) {
  7907. return false
  7908. }
  7909. }
  7910. return true
  7911. },
  7912. judege(idx){
  7913. for (let k in this.dateAr) {
  7914. if (idx !== k) {
  7915. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  7916. return false
  7917. }
  7918. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  7919. return false
  7920. }
  7921. }
  7922. }
  7923. return true
  7924. },
  7925. getOverlapData(data) {
  7926. let overlapData = [];
  7927. for (let i = 0; i < data.length; i++) {
  7928. for (let j = i + 1; j < data.length; j++) {
  7929. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  7930. overlapData.push(data[i], data[j]);
  7931. }
  7932. }
  7933. }
  7934. return overlapData;
  7935. },
  7936. // 保存日报111111
  7937. submitReport(isDraft) {
  7938. this.isDraft = isDraft;
  7939. this.$refs.workForm.validate(valid => {
  7940. if (valid) {
  7941. if (!isDraft) {
  7942. //针对苏州景昱,单独的检查逻辑
  7943. if (this.user.companyId == 5978) {
  7944. //调接口,先检查工时是否存在异常
  7945. var totalTime = 0;
  7946. for (var t=0;t<this.workForm.domains.length; t++) {
  7947. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  7948. }
  7949. var array = [];
  7950. if (this.isBatch) {
  7951. var startDate = new Date(this.workForm.createDate[0]);
  7952. var endDate = new Date(this.workForm.createDate[1]);
  7953. if (startDate > endDate) {
  7954. this.$message({
  7955. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  7956. type: "error"
  7957. });
  7958. return
  7959. } else {
  7960. while(true){
  7961. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  7962. array.push(workData);
  7963. startDate.setDate(startDate.getDate() + 1);
  7964. if (startDate > endDate) {
  7965. break;
  7966. }
  7967. }
  7968. }
  7969. } else {
  7970. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  7971. array.push(workData)
  7972. }
  7973. this.submitingReport = true;
  7974. var passUserId = this.user.id;
  7975. if (this.isSubstitude) {
  7976. passUserId = this.targetUids;
  7977. }
  7978. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  7979. res => {
  7980. this.submitingReport = false;
  7981. if (res.code == "ok") {
  7982. this.submitReportSon()
  7983. } else {
  7984. this.$confirm(res.msg, this.$t('other.prompts'), {
  7985. confirmButtonText: this.$t('huLveBingTiJiao'),
  7986. cancelButtonText: this.$t('btn.cancel'),
  7987. type: 'error'
  7988. }).then(() => {
  7989. this.submitReportSon()
  7990. }).catch(() => {
  7991. });
  7992. }
  7993. },
  7994. error => {
  7995. this.$message({
  7996. message: error,
  7997. type: "error"
  7998. });
  7999. });
  8000. } else if (this.user.companyId == 469) {
  8001. //试点,针对赛元微电子校验考勤工时
  8002. if (this.workForm.time && this.workForm.time.workHours) {
  8003. if (this.totalReportHours > this.workForm.time.workHours) {
  8004. this.$message({
  8005. message: '填报工时不得超过考勤时长',
  8006. type: "error"
  8007. });
  8008. } else if (this.totalReportHours < this.workForm.time.workHours) {
  8009. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  8010. confirmButtonText: this.$t('btn.determine'),
  8011. cancelButtonText: this.$t('btn.cancel'),
  8012. type: 'warning'
  8013. }).then(() => {
  8014. this.submitReportSon()
  8015. }).catch(() => {
  8016. });
  8017. } else {
  8018. this.submitReportSon();
  8019. }
  8020. } else {
  8021. this.$message({
  8022. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  8023. type: "error"
  8024. });
  8025. }
  8026. } else {
  8027. if(this.totalReportHours < this.user.timeType.allday){
  8028. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  8029. confirmButtonText: this.$t('btn.determine'),
  8030. cancelButtonText: this.$t('btn.cancel'),
  8031. type: 'warning'
  8032. }).then(() => {
  8033. this.submitReportSon()
  8034. }).catch(() => {
  8035. });
  8036. }else{
  8037. this.submitReportSon()
  8038. }
  8039. }
  8040. } else {
  8041. //暂存,不需要检查工时是否超过考勤
  8042. this.submitReportSon()
  8043. }
  8044. }
  8045. });
  8046. },
  8047. submitReportSon() {
  8048. this.dateAr = []
  8049. //检查重叠
  8050. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8051. let alp = []
  8052. if(this.user.timeType.multiWorktime != 1) {
  8053. for(var p in this.workForm.domains) {
  8054. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8055. let objs = {}
  8056. objs.s = this.workForm.domains[p].startTime
  8057. objs.e = this.workForm.domains[p].endTime
  8058. alp.push(objs)
  8059. }
  8060. }
  8061. this.dateAr = alp
  8062. if(this.dateAr.length > 0) {
  8063. let trus = this.fns()
  8064. if(!trus) {
  8065. this.$message({
  8066. message: this.$t('message.Filledtimeperiodsoverlap'),
  8067. type: "error"
  8068. });
  8069. return
  8070. }
  8071. }
  8072. } else {
  8073. for(var p in this.workForm.domains) {
  8074. var slll = this.workForm.domains[p]
  8075. for(var o in slll.worktimeList) {
  8076. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8077. let objs = {}
  8078. objs.s = slll.worktimeList[o].startTime
  8079. objs.e = slll.worktimeList[o].endTime
  8080. alp.push(objs)
  8081. }
  8082. }
  8083. }
  8084. this.dateAr = alp
  8085. if(this.dateAr.length > 0) {
  8086. let trus = this.fns()
  8087. if(!trus) {
  8088. this.$message({
  8089. message: this.$t('message.Filledtimeperiodsoverlap'),
  8090. type: "error"
  8091. });
  8092. return
  8093. }
  8094. }
  8095. }
  8096. }
  8097. //检查子项目
  8098. if (this.user.timeType.subProMustFill == 1) {
  8099. for(var p in this.workForm.domains) {
  8100. var oneProItem = this.workForm.domains[p]
  8101. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8102. //没有选择子项目
  8103. this.$message({
  8104. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8105. type: "error"
  8106. });
  8107. return
  8108. }
  8109. }
  8110. }
  8111. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8112. if (this.user.companyId == this.yuzhongCompId) {
  8113. for(var p in this.workForm.domains) {
  8114. var oneProItem = this.workForm.domains[p]
  8115. if (!oneProItem.extraField1) {
  8116. this.$message({
  8117. message: this.$t('jiaoSeBiTianQingJianCha'),
  8118. type: "error"
  8119. });
  8120. return
  8121. }
  8122. if (!oneProItem.extraField2) {
  8123. this.$message({
  8124. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8125. type: "error"
  8126. });
  8127. return
  8128. }
  8129. if (!oneProItem.extraField3) {
  8130. this.$message({
  8131. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8132. type: "error"
  8133. });
  8134. return
  8135. }
  8136. }
  8137. }
  8138. // return
  8139. //代填的情况,检查人员是否已经选择
  8140. if (this.isSubstitude) {
  8141. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8142. this.$message({
  8143. message: this.$t('message.pleaseselectthepersontofillin'),
  8144. type: "error"
  8145. });
  8146. return;
  8147. }
  8148. }
  8149. //检查时间,全天和上下午不能同时存在
  8150. if (this.reportTimeType.type == 0) {
  8151. var alldayNum = 0;
  8152. var amNum = 0;
  8153. var pmNum = 0;
  8154. for(var i in this.workForm.domains) {
  8155. if (this.workForm.domains[i].timeType == 0) {
  8156. alldayNum ++;
  8157. } else if (this.workForm.domains[i].timeType == 1) {
  8158. amNum++;
  8159. } else if (this.workForm.domains[i].timeType == 2) {
  8160. pmNum++;
  8161. }
  8162. }
  8163. if (alldayNum > 1) {
  8164. this.$message({
  8165. // message: "工作时间-全天,只能选择一次",
  8166. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8167. type: "error"
  8168. });
  8169. return;
  8170. }
  8171. if (amNum > 1) {
  8172. this.$message({
  8173. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8174. type: "error"
  8175. });
  8176. return;
  8177. }
  8178. if (pmNum > 1) {
  8179. this.$message({
  8180. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8181. type: "error"
  8182. });
  8183. return;
  8184. }
  8185. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8186. this.$message({
  8187. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8188. type: "error"
  8189. });
  8190. return;
  8191. }
  8192. } else if (this.reportTimeType.type == 3) {
  8193. //总百分比不能超过100%
  8194. let total = 0;
  8195. this.workForm.domains.forEach(w=>{total += w.progress});
  8196. if (total > 100) {
  8197. this.$message({
  8198. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8199. type: "error"
  8200. });
  8201. return;
  8202. } else if (total < 100) {
  8203. this.$message({
  8204. message: this.$t('message.cannotbesubmitted'),
  8205. type: "error"
  8206. });
  8207. return;
  8208. }
  8209. }
  8210. this.listLoading = true;
  8211. let formData = new FormData();
  8212. formData.append("draft", this.isDraft);
  8213. var totalTime = 0;
  8214. for (var t=0;t<this.workForm.domains.length; t++) {
  8215. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8216. }
  8217. //批量填报不校验考勤时长,交给后台校验
  8218. if (!this.isBatch) {
  8219. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0){
  8220. if (this.workForm.time){
  8221. if (this.workForm.time.workHours == 0){
  8222. this.$message({
  8223. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8224. type: 'error'
  8225. })
  8226. return
  8227. }
  8228. }else{
  8229. this.$message({
  8230. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8231. type: 'error'
  8232. })
  8233. return
  8234. }
  8235. }
  8236. }
  8237. //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
  8238. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
  8239. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8240. this.$message({
  8241. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8242. type: "error"
  8243. });
  8244. return;
  8245. }
  8246. }
  8247. for(var i in this.workForm.domains) {
  8248. // 检查任务/里程碑是否为必填
  8249. let taskRequired = this.user.timeType.taskRequired
  8250. if(taskRequired == 1) {
  8251. if(!this.workForm.domains[i].taskId) {
  8252. this.$message({
  8253. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8254. type: "error"
  8255. });
  8256. return
  8257. }
  8258. }
  8259. if(this.user.timeType.reportAuditType == 3){
  8260. let audItem = {}
  8261. let auditRule = ''
  8262. if(this.workForm.domains[i].id){
  8263. audItem.reportId = this.workForm.domains[i].id
  8264. }
  8265. if(this.user.timeType.auditLevel > 0){
  8266. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8267. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8268. }
  8269. if(this.user.timeType.auditLevel > 1){
  8270. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8271. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8272. }
  8273. if(this.user.timeType.auditLevel > 2){
  8274. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8275. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8276. }
  8277. if(this.workForm.domains[i].ccUserid){
  8278. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8279. }
  8280. if(auditRule){
  8281. auditRule = auditRule.substring(0,auditRule.length - 1)
  8282. this.$message({
  8283. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8284. type: 'error'
  8285. })
  8286. return
  8287. }
  8288. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8289. }
  8290. if (this.user.timeType.customDegreeActive) {
  8291. if (this.user.timeType.customDegreeMultiple) {
  8292. //多选
  8293. if (this.workForm.domains[i].multiDegrIdArray) {
  8294. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8295. degreeArray = degreeArray.replace(/,/g,"@");
  8296. formData.append("multiDegrId", degreeArray);
  8297. } else {
  8298. formData.append("multiDegrId", '[]');
  8299. }
  8300. } else {
  8301. //单选
  8302. if (this.workForm.domains[i].degreeId) {
  8303. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8304. } else {
  8305. formData.append("degreeId", -1);
  8306. }
  8307. }
  8308. } else {
  8309. formData.append("degreeId", -1);
  8310. }
  8311. if(this.workForm.domains[i].customData) {
  8312. // var sss = this.workForm.domains[i].degreeId.toString()
  8313. formData.append("customData", this.workForm.domains[i].customData);
  8314. } else {
  8315. formData.append("customData", 0);
  8316. }
  8317. if(this.workForm.domains[i].customText) {
  8318. formData.append("customText", this.workForm.domains[i].customText);
  8319. } else {
  8320. formData.append("customText", '-');
  8321. }
  8322. if (this.workForm.domains[i].id) {
  8323. formData.append("id", this.workForm.domains[i].id);
  8324. } else {
  8325. formData.append("id", -1);
  8326. }
  8327. formData.append("projectId", this.workForm.domains[i].projectId);
  8328. if (this.workForm.domains[i].subProjectId) {
  8329. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8330. } else {
  8331. formData.append("subProjectId", 0);
  8332. }
  8333. if (this.workForm.domains[i].groupId) {
  8334. formData.append("groupId", this.workForm.domains[i].groupId);
  8335. } else {
  8336. formData.append("groupId", 0);
  8337. }
  8338. if (this.workForm.domains[i].taskId) {
  8339. formData.append("taskId", this.workForm.domains[i].taskId);
  8340. } else {
  8341. formData.append("taskId", 0);
  8342. }
  8343. if (this.workForm.domains[i].taskFinish == true) {
  8344. formData.append("taskFinish", 1);
  8345. } else {
  8346. formData.append("taskFinish", 0);
  8347. }
  8348. formData.append("reportTimeType", this.reportTimeType.type);
  8349. if (this.reportTimeType.type == 0) {
  8350. formData.append("timeType", this.workForm.domains[i].timeType);
  8351. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8352. formData.append("workingTime", workingTime);
  8353. } else if (this.reportTimeType.type == 1){
  8354. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8355. } else if (this.reportTimeType.type == 2) {
  8356. formData.append("endTime", this.workForm.domains[i].endTime);
  8357. formData.append("startTime", this.workForm.domains[i].startTime);
  8358. } else if (this.reportTimeType.type == 3) {
  8359. //按比例分配
  8360. formData.append("progress", this.workForm.domains[i].progress);
  8361. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8362. }
  8363. if(this.user.timeType.choseFromAlbum == 1 ) {
  8364. console.log(this.workForm.domains[i].imgList)
  8365. if(this.workForm.domains[i].imgList) {
  8366. let imgListFor = this.workForm.domains[i].imgList
  8367. for(var b in imgListFor) {
  8368. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8369. }
  8370. console.log(imgListFor)
  8371. let m = JSON.stringify(imgListFor);
  8372. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8373. formData.append("picStr", m);
  8374. } else {
  8375. formData.append("picStr", '[]');
  8376. }
  8377. }
  8378. //处理多个时间事项
  8379. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8380. if (this.reportTimeType.multiWorktime == 1) {
  8381. //检查时间是否有重叠
  8382. var workList = this.workForm.domains[i].worktimeList;
  8383. for (var j=0;j<workList.length; j++) {
  8384. var curItem = workList[j];
  8385. //检查开始时间是否大于结束时间
  8386. if (curItem.startTime >= curItem.endTime) {
  8387. this.$message({
  8388. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8389. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8390. type: "error"
  8391. });
  8392. return;
  8393. }
  8394. //时间不可重叠
  8395. if (this.reportTimeType.timeCanOverlap == 0) {
  8396. for (var p = j+1;p<workList.length; p++) {
  8397. var jItem = workList[p];
  8398. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8399. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8400. this.$message({
  8401. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8402. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8403. type: "error"
  8404. });
  8405. return;
  8406. }
  8407. }
  8408. }
  8409. }
  8410. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8411. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8412. formData.append("content", m);
  8413. } else {
  8414. if (this.workForm.domains[i].content) {
  8415. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8416. m = m.replace(/,/g,",");
  8417. console.log(m, '需要传值的数据')
  8418. // formData.append("content", this.workForm.domains[i].content);
  8419. formData.append("content", m);
  8420. } else {
  8421. formData.append("content", '-');
  8422. }
  8423. }
  8424. if (this.isBatch == 0) {
  8425. formData.append("createDate", this.workForm.createDate);
  8426. } else {
  8427. //批量填报,时间范围
  8428. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8429. }
  8430. if(this.workForm.domains[i].isOvertime) {
  8431. formData.append("isOvertime", 1);
  8432. } else {
  8433. formData.append("isOvertime", 0);
  8434. }
  8435. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8436. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8437. } else {
  8438. formData.append("overtimeHours", 0);
  8439. }
  8440. if(this.workForm.domains[i].basecostId) {
  8441. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8442. } else {
  8443. formData.append("basecostId", 0);
  8444. }
  8445. if (this.workForm.userId != null) {
  8446. var targetUids = '';
  8447. this.workForm.userId.forEach(u=>{
  8448. targetUids += u + '@';
  8449. });
  8450. if (targetUids.length > 0) {
  8451. targetUids = targetUids.substring(0, targetUids.length -1);
  8452. formData.append("targetUids", targetUids);
  8453. }
  8454. }
  8455. //项目专业进度
  8456. if (this.workForm.domains[i].professionProgress) {
  8457. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8458. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8459. formData.append("professionProgress", m);
  8460. } else {
  8461. formData.append("professionProgress", "[]");
  8462. }
  8463. if (this.workForm.domains[i].stage) {
  8464. formData.append("stage", this.workForm.domains[i].stage);
  8465. } else {
  8466. formData.append("stage", "-");
  8467. }
  8468. if (this.workForm.domains[i].projectAuditorId) {
  8469. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8470. } else {
  8471. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8472. this.$message({
  8473. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8474. type: "error"
  8475. });
  8476. return;
  8477. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8478. //分组负责人先审核, 确定是选择了任务分组
  8479. if (this.workForm.domains[i].taskGroups.length == 0) {
  8480. this.$message({
  8481. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8482. type: "error"
  8483. });
  8484. return;
  8485. } else if (!this.workForm.domains[i].groupId) {
  8486. // console.log(this.workForm.domains[i]);
  8487. this.$message({
  8488. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8489. type: "error"
  8490. });
  8491. return;
  8492. }
  8493. }
  8494. }
  8495. if (this.user.companyId == this.yuzhongCompId) {
  8496. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8497. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8498. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8499. }
  8500. //依斯贝的服务Id
  8501. if (this.user.companyId == this.yisibeiCompId) {
  8502. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8503. }
  8504. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8505. this.$message({
  8506. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8507. type: "error"
  8508. });
  8509. return
  8510. }
  8511. if(this.user.timeType.userWithMultiDept == 1) {
  8512. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8513. }
  8514. if(this.user.timeType.reportExtraField4Name) {
  8515. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8516. }
  8517. if(this.user.timeType.reportExtraField5Name) {
  8518. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8519. }
  8520. }
  8521. this.submitingReport = true;
  8522. this.http.uploadFile( this.port.report.editPort, formData,
  8523. res => {
  8524. this.listLoading = false;
  8525. this.submitingReport = false;
  8526. if (res.code == "ok") {
  8527. if(res.msg!=null){
  8528. this.$message({
  8529. dangerouslyUseHTMLString: true,
  8530. message: res.msg,
  8531. type: "warning",
  8532. showClose: true,
  8533. duration: 0
  8534. });
  8535. }else{
  8536. this.$message({
  8537. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8538. type: "success"
  8539. });
  8540. }
  8541. this.dialogVisible = false;
  8542. this.jsDay = 0
  8543. this.jsTime = 0
  8544. this.getReportList();
  8545. this.getDepartment();
  8546. this.getRecentlyProject()
  8547. } else {
  8548. this.$message({
  8549. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8550. type: "error"
  8551. });
  8552. }
  8553. },
  8554. error => {
  8555. this.listLoading = false;
  8556. this.submitingReport = false;
  8557. this.$message({
  8558. message: error,
  8559. type: "error"
  8560. });
  8561. });
  8562. },
  8563. // 判断是展示那个工时导入
  8564. imports() {
  8565. if(this.user.timeType.syncCorpwxTime == 0) {
  8566. this.importDialog = true
  8567. } else {
  8568. this.importWxDialog = true
  8569. }
  8570. },
  8571. // 跳转
  8572. junpToDeskTop(id) {
  8573. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8574. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8575. },
  8576. // 通过日报
  8577. approve(id, item) {
  8578. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8579. this.approveinData = {
  8580. id: id,
  8581. date: this.date +day,
  8582. reportIds: item.id
  8583. }
  8584. if(this.user.timeType.needEvaluate == 1){
  8585. this.$set(this.approveinData,'evaluate','')
  8586. this.approveinDialog = true
  8587. }else{
  8588. this.logining = true;
  8589. this.approveinfun()
  8590. }
  8591. },
  8592. approveinfun(){
  8593. this.http.post( this.port.report.approve, this.approveinData,
  8594. res => {
  8595. this.logining = false;
  8596. if (res.code == "ok") {
  8597. this.approveinDialog = false
  8598. this.$message({
  8599. message: this.$t('message.Reviewsucceeded'),
  8600. type: "success"
  8601. });
  8602. this.refreshReportData(this.approveinData.reportIds);
  8603. this.getDepartment();
  8604. } else {
  8605. this.$message({
  8606. message: res.msg,
  8607. type: "error"
  8608. });
  8609. }
  8610. },
  8611. error => {
  8612. this.logining = false;
  8613. this.$message({
  8614. message: error,
  8615. type: "error"
  8616. });
  8617. });
  8618. },
  8619. //撤回日报
  8620. cancel(item,e) {
  8621. // console.log('can can need',item);
  8622. this.logining = true;
  8623. var ids = '';
  8624. var data = e ? item : item.data;
  8625. data.forEach(element => {
  8626. if(element.id){
  8627. ids +=(element.id+',');
  8628. }
  8629. });
  8630. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8631. res => {
  8632. this.logining = false;
  8633. if (res.code == "ok") {
  8634. this.$message({
  8635. message:this.$t('message.Withdrawalsucceeded'),
  8636. type: "success"
  8637. });
  8638. this.getReportList();
  8639. if(e){this.getReport()}
  8640. this.getDepartment();
  8641. } else {
  8642. this.$message({
  8643. message: res.msg,
  8644. type: "error"
  8645. });
  8646. }
  8647. },
  8648. error => {
  8649. this.logining = false;
  8650. this.$message({
  8651. message: error,
  8652. type: "error"
  8653. });
  8654. });
  8655. },
  8656. showDenyDialog(id,i, item) {
  8657. this.denyReasonDialog = true;
  8658. this.isDenying = false;
  8659. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8660. var ids = item.id;
  8661. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8662. },
  8663. // 未通过日报
  8664. deny() {
  8665. this.logining = true;
  8666. this.isDenying = true;
  8667. this.http.post( this.port.report.deny, this.denyForm,
  8668. res => {
  8669. this.logining = false;
  8670. this.isDenying = false;
  8671. if (res.code == "ok") {
  8672. this.$message({
  8673. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8674. type: "success"
  8675. });
  8676. this.refreshReportData(this.denyForm.reportIds);
  8677. this.getDepartment();
  8678. this.denyReasonDialog = false;
  8679. } else {
  8680. this.$message({
  8681. message: res.msg,
  8682. type: "error"
  8683. });
  8684. }
  8685. },
  8686. error => {
  8687. this.logining = false;
  8688. this.$message({
  8689. message: error,
  8690. type: "error"
  8691. });
  8692. });
  8693. },
  8694. // 查看工时记录弹窗
  8695. toView() {
  8696. this.toViewDialogVisible = true
  8697. this.toViewloading = true
  8698. this.getToView()
  8699. },
  8700. getToView() {
  8701. this.http.post( '/report-import-log/getList', this.toViewForm,
  8702. res => {
  8703. this.toViewloading = false;
  8704. if (res.code == "ok") {
  8705. // console.log(res.data, '数据数据')
  8706. this.toViewList = res.data.records
  8707. this.toViewForm.total = res.data.total
  8708. } else {
  8709. this.toViewloading = false;
  8710. this.$message({
  8711. message: res.msg,
  8712. type: "error"
  8713. });
  8714. }
  8715. })
  8716. },
  8717. // 触发 selectCat 组件更改他的值
  8718. selectCatCli(obj) {
  8719. // console.log(obj, '看看')
  8720. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8721. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8722. },
  8723. vueCasader(obj) {
  8724. if(obj.distinction == 1 && obj.item) {
  8725. let arr = []
  8726. arr.push(obj.item.value)
  8727. this.exportParam.departmentId = arr
  8728. }
  8729. if(obj.distinction == '10' && obj) {
  8730. const { id, other } = obj
  8731. this.workForm.domains[other].reportTargetDeptId = id
  8732. }
  8733. if(obj.distinction == '14' && obj) {
  8734. let arr = []
  8735. arr.push(obj.id)
  8736. this.deptIdForHasReport = arr
  8737. this.showMonthWorkTime()
  8738. }
  8739. if(obj.distinction == '15' && obj) {
  8740. let arr = []
  8741. arr.push(obj.id)
  8742. this.deptIdForNoReport = arr
  8743. this.showMonthNotWorkTime()
  8744. }
  8745. if(obj.distinction == '16' && obj) {
  8746. let arr = []
  8747. arr.push(obj.id)
  8748. this.deptIdForReminder = arr
  8749. this.showMonthWorkTimeReminder()
  8750. }
  8751. if(obj.distinction == '17' && obj) {
  8752. let arr = []
  8753. arr.push(obj.id)
  8754. this.deptIdForHasReport = arr
  8755. this.showReportTimeLessThanCardTimeList();
  8756. }
  8757. },
  8758. //分页
  8759. handleCurrentChange(val) {
  8760. this.toViewForm.pageIndex = val;
  8761. this.getToView();
  8762. },
  8763. handleSizeChange(val) {
  8764. this.toViewForm.pageSize = val;
  8765. this.getToView();
  8766. },
  8767. getAllUsersList(){
  8768. this.http.post('/user/getSimpleActiveUserList',{
  8769. },res => {
  8770. if(res.code == 'ok'){
  8771. this.allUsersList = res.data
  8772. }else{
  8773. this.$message({
  8774. message: res.msg,
  8775. type: 'error'
  8776. })
  8777. }
  8778. },err => {
  8779. this.$message({
  8780. message: err,
  8781. type: 'error'
  8782. })
  8783. })
  8784. },
  8785. //考勤工时异常,一键驳回并提醒修改
  8786. batchRejectAndRemind(item){
  8787. this.$confirm('您确定要一键驳回异常考勤工时的日报并发送消息提醒吗?',this.$t('other.prompts'), {
  8788. confirmButtonText: this.$t('btn.determine'),
  8789. cancelButtonText: this.$t('btn.cancel'),
  8790. type: "warning"
  8791. })
  8792. .then(() => {
  8793. let parameter={
  8794. ymonth: this.notfullSelectDateMonth
  8795. }
  8796. this.remindering = true;
  8797. this.http.post('/report/rejectAbnormalReportTime',parameter,res => {
  8798. this.remindering = false;
  8799. if(res.code == 'ok'){
  8800. this.$message({
  8801. message: res.msg,
  8802. type: 'success'
  8803. })
  8804. }else{
  8805. this.$message({
  8806. message: res.msg,
  8807. type: 'error'
  8808. })
  8809. }
  8810. },err => {
  8811. this.$message({
  8812. message: err,
  8813. type: 'error'
  8814. })
  8815. })
  8816. }).catch(() => {this.startDeleting = false});
  8817. },
  8818. //景昱变更提醒
  8819. changeReminder(item){
  8820. let parameter={
  8821. startDate: this.WorktimeDatepickValue[0],
  8822. endDate: this.WorktimeDatepickValue[1],
  8823. }
  8824. if(item){
  8825. parameter.createDate=item.createDate,
  8826. parameter.userId=item.userId
  8827. }
  8828. this.remindering = true;
  8829. this.http.post('/report/changeReminder',parameter,res => {
  8830. this.remindering = false;
  8831. if(res.code == 'ok'){
  8832. this.$message({
  8833. message: res.msg,
  8834. type: 'success'
  8835. })
  8836. }else{
  8837. this.$message({
  8838. message: res.msg,
  8839. type: 'error'
  8840. })
  8841. }
  8842. },err => {
  8843. this.$message({
  8844. message: err,
  8845. type: 'error'
  8846. })
  8847. })
  8848. },
  8849. //景昱取消异常
  8850. cancelReminder(item){
  8851. let parameter={}
  8852. if(item){
  8853. parameter.createDate=item.createDate,
  8854. parameter.userId=item.userId
  8855. }
  8856. this.http.post('/report/cancelReminder',parameter,res => {
  8857. if(res.code == 'ok'){
  8858. this.$message({
  8859. message: res.msg,
  8860. type: 'success'
  8861. })
  8862. }else{
  8863. this.$message({
  8864. message: res.msg,
  8865. type: 'error'
  8866. })
  8867. }
  8868. },err => {
  8869. this.$message({
  8870. message: err,
  8871. type: 'error'
  8872. })
  8873. })
  8874. this.showMonthWorkTimeReminder()
  8875. },
  8876. // 重庆物奇私人定制的按周填报弹窗关闭事件
  8877. fillWeekCustomClne() {
  8878. this.fillWeekDialogVisiCustom = false
  8879. },
  8880. fillWeekCustomClneTwo() {
  8881. this.fillWeekDialogVisiCustomTwo = false
  8882. },
  8883. fillWeekCustomSubmit() {
  8884. this.getReportList();
  8885. this.getDepartment();
  8886. this.getRecentlyProject()
  8887. },
  8888. // 待填日报姓名搜索
  8889. nameAearchSeek(flg) {
  8890. if(!this.nameAearch) {
  8891. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8892. return
  8893. }
  8894. if(flg) {
  8895. this.enterpriseWechatgetUser()
  8896. }
  8897. },
  8898. handleThreeData(userList) {
  8899. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  8900. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  8901. },
  8902. // 过滤树节点
  8903. filterTreeNodes(treeData, filterKeywords) {
  8904. return treeData.filter((node) => {
  8905. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  8906. if (node.children && node.children.length > 0) {
  8907. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8908. }
  8909. return true;
  8910. }
  8911. if (node.children && node.children.length > 0) {
  8912. node.children = this.filterTreeNodes(node.children, filterKeywords);
  8913. return node.children.length > 0;
  8914. }
  8915. return false;
  8916. });
  8917. },
  8918. // 企业微信获取人员
  8919. enterpriseWechatgetUser() {
  8920. this.deptMembDataLoading = true
  8921. this.http.post('/user/getEmployeeList',{
  8922. departmentId: -1,
  8923. pageIndex: 1,
  8924. pageSize: 100,
  8925. keyword: this.nameAearch,
  8926. status: '',
  8927. roleId: '',
  8928. cursor: '',
  8929. onlyDirect: '',
  8930. matchingType: ''
  8931. },res => {
  8932. if(res.code == 'ok'){
  8933. this.deptMembDataLoading = false
  8934. const userListName = res.data.records.map(item => item.name)
  8935. this.handleThreeData(userListName)
  8936. setTimeout(() => {
  8937. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  8938. }, 200)
  8939. }else{
  8940. this.deptMembDataLoading = false
  8941. this.$message({
  8942. message: res.msg,
  8943. type: 'error'
  8944. })
  8945. }
  8946. },err => {
  8947. this.deptMembDataLoading = false
  8948. this.$message({
  8949. message: err,
  8950. type: 'error'
  8951. })
  8952. })
  8953. },
  8954. changeTreeNodeStatus(node) {
  8955. let allZt = true
  8956. node.expanded = allZt
  8957. for (let i = 0; i < node.childNodes.length; i++) {
  8958. node.childNodes[i].expanded = allZt
  8959. if (node.childNodes[i].childNodes.length > 0) {
  8960. this.changeTreeNodeStatus(node.childNodes[i])
  8961. }
  8962. }
  8963. },
  8964. // 按周填报获取相关任务
  8965. async getWeeklyTaskList(item) {
  8966. const { projectId, groupId, stage, taskId } = item
  8967. let parms = { projectId, isSubstitude: 0 }
  8968. groupId ? parms.groupId = groupId : ''
  8969. stage ? parms.stage = stage : ''
  8970. const { data } = await this.postData('/task/getRecentTask', parms)
  8971. this.zhoBao.taskId = taskId
  8972. this.$set(this.zhoBao, 'taskList', data)
  8973. },
  8974. // 封装 post 请求
  8975. postData(url, params) {
  8976. return new Promise((resolve, reject) => {
  8977. this.http.post(url, { ...params },
  8978. res => {
  8979. resolve(res)
  8980. },
  8981. error => {
  8982. this.$message({
  8983. message: error,
  8984. type: "error"
  8985. });
  8986. reject(error)
  8987. })
  8988. })
  8989. },
  8990. // 自定义事件
  8991. selectCal(obj) {
  8992. if(obj.distinction == '1') {
  8993. this.zhoBao.projectAuditorId = obj.id
  8994. } else if(obj.distinction == '2') {
  8995. this.zhoBao.auditorFirst = obj.id
  8996. } else if(obj.distinction == '3') {
  8997. this.zhoBao.auditorSec = obj.id
  8998. } else if(obj.distinction == '4') {
  8999. this.zhoBao.auditorThird = obj.id
  9000. } else if(obj.distinction == '5') {
  9001. this.zhoBao.ccUserid = obj.id
  9002. } else if(obj.distinction == '12') {
  9003. this.usersListId = obj.id
  9004. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9005. this.searchKeyword = obj.name
  9006. } else {
  9007. this.searchKeyword = ''
  9008. }
  9009. this.searchScreen(0)
  9010. } else if(obj.distinction == '13') {
  9011. this.usersListId = obj.id
  9012. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9013. this.searchKeyword = obj.name
  9014. } else {
  9015. this.searchKeyword = ''
  9016. }
  9017. this.searchScreen(1)
  9018. } else if(obj.distinction == '15') {
  9019. this.usersListId = obj.id
  9020. this.showReportTimeLessThanCardTimeList();
  9021. }
  9022. }
  9023. },
  9024. created() {
  9025. this.getUsers()
  9026. let height = window.innerHeight;
  9027. this.tableHeight = height - 178;
  9028. const that = this;
  9029. window.onresize = function temp() {
  9030. that.tableHeight = window.innerHeight - 178;
  9031. };
  9032. this.toViewForm.companyId = this.user.companyId
  9033. this.initDrag([{
  9034. type: "LR",
  9035. domClass: {
  9036. // 中间分割线的名字
  9037. resize: "line-line",
  9038. // 左侧盒子的名字
  9039. left: "box-left",
  9040. // 右侧盒子的名字
  9041. right: "box-right",
  9042. // 父级的名字
  9043. box: "box-father",
  9044. },
  9045. otherInfo: {
  9046. // 限制左边栏最低宽度
  9047. leftWidth: 120,
  9048. },
  9049. },
  9050. {
  9051. type: "LR",
  9052. domClass: {
  9053. // 中间分割线的名字
  9054. resize: "line-second",
  9055. // 左侧盒子的名字
  9056. left: "left-laowang",
  9057. // 右侧盒子的名字
  9058. right: "box-second-father",
  9059. // 父级的名字
  9060. box: "grand",
  9061. },
  9062. otherInfo: {
  9063. // 限制左边栏最低宽度
  9064. leftWidth: 120,
  9065. },
  9066. },
  9067. ]);
  9068. }
  9069. };
  9070. </script>
  9071. <style lang="scss" scoped>
  9072. @import "../../assets/scss/handle";
  9073. .themeFontColor {
  9074. @include font_color("color");
  9075. }
  9076. .fillWeekDialogVisiCustom {
  9077. width: 100%;
  9078. height: 70vh;
  9079. }
  9080. .fillWeekCustom {
  9081. .el-dialog__body {
  9082. padding: 20px 20px !important;
  9083. }
  9084. }
  9085. .photos {
  9086. position: relative;
  9087. display: flex;
  9088. flex-wrap: wrap;
  9089. }
  9090. .photos_img {
  9091. width: 120px;
  9092. height: 120px;
  9093. margin-right: 20px;
  9094. margin-bottom: 20px;
  9095. cursor: pointer;
  9096. img {
  9097. width: 100%;
  9098. height: 100%;
  9099. }
  9100. }
  9101. .paginatis {
  9102. padding: 10px 10px;
  9103. background: #f2f2f2;
  9104. }
  9105. .waiting {
  9106. color:orange;
  9107. }
  9108. .filledReportStyle {
  9109. color:#32CD32;
  9110. }
  9111. .RejectStyle {
  9112. color:red;
  9113. }
  9114. .waitSubmitStyle{
  9115. @include font_color("color");
  9116. }
  9117. .chooseDate {
  9118. .waiting {
  9119. @include font_color("color");
  9120. }
  9121. .filledReportStyle {
  9122. @include font_color("color");
  9123. }
  9124. .RejectStyle {
  9125. @include font_color("color");
  9126. }
  9127. .waitSubmitStyle{
  9128. @include font_color("color");
  9129. }
  9130. }
  9131. .allDaily {
  9132. width:100%;
  9133. }
  9134. .report_title {
  9135. padding:10px 0;
  9136. color:#666;
  9137. }
  9138. .clearfix {
  9139. overflow-x: auto;
  9140. white-space: nowrap;
  9141. padding: 15px 0 10px 0;
  9142. // overflow-y: hidden;
  9143. .date_item {
  9144. padding: 0 3px;
  9145. cursor: pointer;
  9146. position: relative;
  9147. }
  9148. .chooseDate {
  9149. position: absolute;
  9150. bottom: -3px;
  9151. width: 37px;
  9152. height: 2px;
  9153. left: 14px;
  9154. @include background_color("background_color");
  9155. }
  9156. }
  9157. .one_daily {
  9158. i {
  9159. @include font_color("color1");
  9160. margin-right: 5px;
  9161. }
  9162. .one_daily_body {
  9163. padding: 10px 0px;
  9164. p {
  9165. margin: 0;
  9166. line-height: 30px;
  9167. }
  9168. }
  9169. ul {
  9170. padding: 0;
  9171. }
  9172. }
  9173. .checkbtn {
  9174. float: right;
  9175. margin-top: -10px;
  9176. }
  9177. .selConStyle{
  9178. margin-top:9rem;
  9179. margin-bottom:11rem;
  9180. .selConStyle_title{
  9181. height: 3rem;
  9182. text-align: center;
  9183. font-size: 17px;
  9184. }
  9185. .el-select{
  9186. margin: 0 15%;
  9187. width: 70%;
  9188. }
  9189. }
  9190. </style>
  9191. <style lang="scss">
  9192. /*去除upload组件过渡效果*/
  9193. .photos .el-upload-list__item {
  9194. transition: none !important;
  9195. }
  9196. .daily {
  9197. .el-card__body {
  9198. height: 80%;
  9199. overflow-y: auto;
  9200. }
  9201. .el-card__header {
  9202. padding: 0 20px;
  9203. }
  9204. }
  9205. .membListClass{
  9206. .el-dialog__body{
  9207. padding-top: 10px;
  9208. }
  9209. }
  9210. // .editReportDialog .el-dialog__footer{
  9211. // position: sticky;
  9212. // bottom: 0;
  9213. // background: #fff;
  9214. // height: 70px;
  9215. // z-index: 1010;
  9216. // }
  9217. .editReportDialog{
  9218. min-width: 800px;
  9219. }
  9220. .touruxiangmu{
  9221. max-width: 1000px;
  9222. }
  9223. </style>
  9224. <style scoped>
  9225. /* 项目标签的样式 */
  9226. .el-tag + .el-tag {
  9227. margin-left: 10px;
  9228. }
  9229. .button-new-tag {
  9230. margin-left: 10px;
  9231. height: 32px;
  9232. line-height: 30px;
  9233. padding-top: 0;
  9234. padding-bottom: 0;
  9235. }
  9236. .input-new-tag {
  9237. width: 90px;
  9238. margin-left: 10px;
  9239. vertical-align: bottom;
  9240. }
  9241. .selectworktime .el-table__fixed-body-wrapper{
  9242. top: 48px !important;
  9243. }
  9244. .selectworktime_export .selectworktime_export_l{
  9245. width: 650px;
  9246. float: left;
  9247. height: 42px;
  9248. }
  9249. .approvalProcessBox{
  9250. margin-left: 30px;
  9251. font-size: 14px;
  9252. line-height: 16px;
  9253. cursor: pointer;
  9254. }
  9255. .approvalProcessBox i {
  9256. margin-right: 0;
  9257. height: 16px;
  9258. width: 16px;
  9259. display: inline-block;
  9260. transform: scale(1.2);
  9261. position: relative;
  9262. top: 0.5px;
  9263. @include font_color("color");
  9264. }
  9265. .approvalProcessBox .approvalProcessClick{
  9266. cursor: pointer;
  9267. @include font_color("color");
  9268. font-size: 14px;
  9269. }
  9270. .approvalProcessBox:hover .approvalProcessClick{
  9271. color: #3485fb;
  9272. }
  9273. </style>
  9274. <style lang="scss" scoped>
  9275. .bionicClass {
  9276. -webkit-appearance: none;
  9277. background-color: #FFF;
  9278. background-image: none;
  9279. border-radius: 4px;
  9280. border: 1px solid #DCDFE6;
  9281. box-sizing: border-box;
  9282. color: #606266;
  9283. display: inline-block;
  9284. height: 40px;
  9285. line-height: 40px;
  9286. outline: 0;
  9287. padding: 0 15px;
  9288. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9289. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9290. width: 350px;
  9291. cursor: pointer;
  9292. .bionicClassText {
  9293. color: #C0C4CC;
  9294. }
  9295. }
  9296. // 加班样式
  9297. .overtime {
  9298. display: inline-block;
  9299. margin-left: 20px;
  9300. input {
  9301. display: inline-block;
  9302. margin-top: 5px;
  9303. }
  9304. }
  9305. .plus {
  9306. display: inline-block;
  9307. }
  9308. // .tages {
  9309. // float: right;
  9310. // }
  9311. .overtime {
  9312. display: inline-block;
  9313. margin-left: 30px;
  9314. }
  9315. .bloks {
  9316. display: inline-block;
  9317. width: 380px;
  9318. }
  9319. .zhiss {
  9320. display: flex;
  9321. justify-content: space-around;
  9322. align-items: center;
  9323. }
  9324. .zhoFel {
  9325. display: flex;
  9326. justify-content: space-between;
  9327. align-items: center;
  9328. }
  9329. // 左右滑动样式
  9330. .line {
  9331. width: 30px;
  9332. /* height: 500px; */
  9333. background: #f2f2f2;
  9334. cursor: w-resize;
  9335. }
  9336. .box-father {
  9337. border: 8px solid #000;
  9338. }
  9339. .line-second {
  9340. width: 10px;
  9341. /* background: red; */
  9342. }
  9343. .flex {
  9344. display: flex;
  9345. width: 100%;
  9346. }
  9347. .box-left {
  9348. flex: 0 0 400px;
  9349. /* height: 600px; */
  9350. /* background: blue; */
  9351. }
  9352. .box-right {
  9353. /* height: 600px; */
  9354. /* background: green; */
  9355. flex: 1;
  9356. }
  9357. .box-postion {
  9358. width: 200px;
  9359. /* height: 400px; */
  9360. background: #ccc;
  9361. }
  9362. .custom-tree-node {
  9363. flex: 1;
  9364. display: flex;
  9365. align-items: center;
  9366. justify-content: space-between;
  9367. font-size: 14px;
  9368. padding-right: 8px;
  9369. }
  9370. .daitianrbao {
  9371. width: 100%;
  9372. box-sizing: border-box;
  9373. height: 40px;
  9374. border-radius: 4px;
  9375. border: 1px solid #DCDFE6;
  9376. overflow: hidden;
  9377. text-overflow: ellipsis;
  9378. display: flex;
  9379. // align-items: center;
  9380. }
  9381. .daitianrbao .spnn {
  9382. display: inline-block;
  9383. box-sizing: border-box;
  9384. padding: 0 15px;
  9385. overflow: hidden;
  9386. text-overflow: ellipsis;
  9387. }
  9388. .daitianrbao .hover {
  9389. color: #DCDFE6 !important;
  9390. }
  9391. </style>