daily.vue 526 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889
  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 || user.companyName == mingyiName)?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 == '*' ? item2.time : 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 === '*' ? '*' : 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 == '*' ? item2.time : 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 === '*' ? '*' : 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. <template v-if="user.company.companyName === mingyiName">
  406. <span v-if="isBatch">,考勤时长:{{this.workTimeForMinYi}}{{$t('time.hour')}}</span>
  407. <span v-if="!isBatch"> 考勤时长:<span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}},{{workForm.time.workHours}}{{$t('time.hour')}}</span> </span>
  408. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" icon="el-icon-refresh"
  409. @click="refreshAttendance(workForm.createDate)"></el-button>
  410. </template>
  411. <!-- AI智能填报 -->
  412. <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >{{ $t('zhiNengTianBao') }}</el-button>
  413. </el-form-item>
  414. <!--考勤时长显示-->
  415. <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.showRefresh && user.company.companyName != mingyiName">
  416. <template v-if="user.companyId != 7536">
  417. <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  418. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  419. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  420. </span>
  421. </template>
  422. <template v-if="user.companyId == 7536 && workForm.time">
  423. {{workForm.time.isOffiBusiness?'出差':'工作'}}{{workForm.time.workHours}}{{$t('time.hour')}}
  424. <span v-if="workForm.time.askLeaveTime">|&nbsp;{{ $t('other.AskForLeave') }}{{ workForm.time.askLeaveTime }}{{$t('time.hour')}}</span>
  425. <span v-if="workForm.time.otTime" style="color:#FFA500;">|&nbsp;加班{{ workForm.time.otTime }}{{$t('time.hour')}}</span>
  426. </template>
  427. <!--批量填报不显示考勤记录-->
  428. <span v-if="!isBatch && (user.timeType.syncDingding==1 || user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei==1)&&!workForm.time" >{{$t('other.noAttendanceRecord')}}</span>
  429. <!--针对明夷,批量填报(不含代填)情况下显示考勤时长-->
  430. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  431. v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh"
  432. @click="refreshWXCardTime(workForm.createDate)"></el-button>
  433. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  434. v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh"
  435. @click="refreshDDCardTime(workForm.createDate)"></el-button>
  436. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  437. v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh"
  438. @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
  439. <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading"
  440. v-if="!isBatch && user.companyId === 7536" icon="el-icon-refresh"
  441. @click="refreshBeiSengAttendanceTwo(workForm.createDate)"></el-button>
  442. <span v-if="user.companyId==5978" style="margin-left:5px;" class="themeFontColor"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
  443. </el-form-item>
  444. <!-- 000000 -->
  445. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  446. <div v-if="reportTimeType.multiWorktime==0">
  447. <el-form-item v-if="reportTimeType.type != 3 && !(permissions.reportHideWorkingHours && workForm.domains[index].state == 1)" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  448. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  449. <el-select v-model="domain.timeType" style="width:200px;"
  450. v-if="reportTimeType.type == 0"
  451. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  452. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  453. @change="onTimeTypeChange(domain.timeType)">
  454. <el-option
  455. v-for="item in timeType"
  456. :key="item.value"
  457. :label="item.label"
  458. :value="item.value">
  459. </el-option>
  460. </el-select>
  461. <!-- 数字时长选择 -->
  462. <el-select v-model="domain.workingTime" style="width:200px;"
  463. v-if="reportTimeType.type == 1"
  464. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  465. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  466. @change="seleChn(0,domain)">
  467. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  468. </el-select>
  469. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  470. <span v-if="reportTimeType.type == 2">
  471. <!--时间范围选择 -->
  472. <el-time-picker
  473. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  474. v-model="domain.startTime"
  475. :placeholder="$t('time.startTime')"
  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. }"
  483. @change="iptChang()">
  484. </el-time-picker> - <el-time-picker
  485. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  486. v-model="domain.endTime"
  487. :placeholder="$t('time.endTime')"
  488. style="width:120px;"
  489. format="HH:mm"
  490. value-format="HH:mm"
  491. :picker-options="{
  492. start: '08:00',
  493. end: '23:30',
  494. minTime: domain.startTime
  495. }"
  496. @change="iptChang()">
  497. </el-time-picker>
  498. </span>
  499. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  500. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  501. <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>
  502. </div>
  503. </el-form-item>
  504. <el-form-item :label="$t('tianBaoBuMen')" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
  505. :prop="'domains.' + index + '.reportTargetDeptId'"
  506. :rules="{ required: true, message: $t('qing-xuan-ze-bu-men'), trigger: ['change','blur'] }">
  507. <el-select v-model="domain.reportTargetDeptId" :placeholder="$t('qing-xuan-ze-bu-men')" style="width:200px;" :clearable="true" v-if="user.userNameNeedTranslate == 0">
  508. <el-option v-for="depts in userReportDeptList" :key="depts.departmentId" :value="depts.departmentId" :label="depts.departmentName">
  509. <span style="float: left">
  510. <TranslationOpenDataText type='departmentName' :openid='depts.departmentName'></TranslationOpenDataText>
  511. </span>
  512. </el-option>
  513. </el-select>
  514. <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>
  515. </el-form-item>
  516. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  517. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  518. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  519. @change="selectProject(domain, index)"
  520. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  521. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  522. <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">
  523. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  524. <span style="float: right;">{{ item.projectName }}</span>
  525. </el-option>
  526. </el-option-group>
  527. </el-select>
  528. <!--昱众不显示子项目-->
  529. <template v-if="user.timeType.mainProjectState != 1 && user.companyId != yuzhongCompId && domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''">
  530. <span style="margin-left:45px;">
  531. {{$t('lable.subproject')}}</span>
  532. <!--子项目 -->
  533. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  534. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  535. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  536. </el-select>
  537. </template>
  538. <template v-if="user.companyId == yuzhongCompId">
  539. <span style="color:#FF0000;margin-left:45px;">*</span><span style="margin-left:3px;">{{ $t('jiaoSeXuanZe') }}</span>
  540. <!--角色选择 -->
  541. <el-select v-model="domain.extraField1" style="width:200px;margin-left:10px;" placeHolder="请选择"
  542. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateResponse(domain)">
  543. <el-option
  544. v-for="item in roleList"
  545. :key="item.value"
  546. :label="item.label"
  547. :value="item.value">
  548. </el-option>
  549. </el-select>
  550. </template>
  551. <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%;"
  552. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  553. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  554. </el-link>
  555. <!-- <el-link type="primary" v-if="canEdit"
  556. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  557. </el-form-item>
  558. <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">
  559. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  560. </el-form-item>
  561. <!--如果设置了工时成本预警的预算成本项-->
  562. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  563. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  564. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  565. </el-select>
  566. </el-form-item>
  567. <el-form-item v-if="user.company.packageProject == 1&& (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&&domain.isPublic != 1))">
  568. <template slot="label">
  569. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1 || user.timeType.reportAuditType == 1 || user.timeType.reportAuditType == 2 || user.timeType.reportAuditType == 9">*</span>
  570. <span >{{$t('lable.taskGrouping')}}</span>
  571. </template>
  572. <!-- 任务分组 -->
  573. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  574. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  575. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  576. </el-select>
  577. <template v-if="user.companyId == yuzhongCompId">
  578. <span style="margin-left:45px;"><span style="color:#FF0000;">*</span>{{ $t('gongZuoZhiZe') }}</span>
  579. <el-select v-model="domain.extraField2" style="width:200px;margin-left:10px;" :placeHolder="$t('defaultText.pleaseChoose')"
  580. :disabled="(workForm.domains[index].state>=2?false:true)" @change="updateJobContent(domain)">
  581. <el-option
  582. v-for="item in domain.filteredRespList"
  583. :key="item.id"
  584. :label="item.jobRespon"
  585. :value="item.id">
  586. </el-option>
  587. </el-select>
  588. </template>
  589. <template v-else-if="!user.timeType.hideStages"><!-- 项目的阶段 -->
  590. <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>
  591. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  592. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  593. @change="changeStages(domain, index)"
  594. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  595. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  596. </el-select>
  597. </template>
  598. </el-form-item>
  599. <!-- 工单号,行号 -->
  600. <el-form-item :label="user.timeType.reportExtraField4Name" v-if="user.timeType.reportExtraField4Name">
  601. <el-select v-model="domain.extraField4" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable >
  602. <el-option v-for="lin in (domain.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  603. </el-option>
  604. </el-select>
  605. </el-form-item>
  606. <el-form-item :label="user.timeType.reportExtraField5Name" v-if="user.timeType.reportExtraField5Name">
  607. <el-select v-model="domain.extraField5" placeholder="请选择" @change="onProgressChange" :disabled="!domain.canEdit" filterable clearable>
  608. <el-option v-for="lin in (domain.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  609. </el-option>
  610. </el-select>
  611. </el-form-item>
  612. <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">
  613. <el-form-item v-if="user.timeType.reportAuditType != 3 && user.timeType.reportAuditType != 5 && domain.auditUserList.length > 0">
  614. <template slot="label">
  615. <span style="color:#FF0000;">*</span>
  616. <span >{{$t('other.projectAuditor')}}</span>
  617. </template>
  618. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  619. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  620. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  621. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  622. </el-option>
  623. </el-select>
  624. <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>
  625. </el-form-item>
  626. </div>
  627. <el-form-item v-if="user.companyId == yuzhongCompId">
  628. <template slot="label">
  629. <span style="color:#FF0000;">*</span>
  630. <span >{{ $t('gongZuoNeiRong') }}</span>
  631. </template>
  632. <el-select v-model="domain.extraField3" style="width:200px;" :placeHolder="$t('defaultText.pleaseChoose')" @change="$forceUpdate()"
  633. :disabled="(workForm.domains[index].state>=2?false:true)" >
  634. <el-option
  635. v-for="item in domain.workContentList"
  636. :key="item.id"
  637. :label="item.workContext"
  638. :value="item.id">
  639. </el-option>
  640. </el-select>
  641. </el-form-item>
  642. <!-- 111111 -->
  643. <el-form-item :label="$t('other.reviewer')" v-if="user.timeType.reportAuditType == 3">
  644. <el-select v-model="domain.auditorFirst" :placeholder="$t('di-yi-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  645. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  646. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  647. <span v-else>{{item.name}}</span>
  648. </el-option>
  649. </el-select>
  650. <template v-if="user.timeType.auditLevel > 1">
  651. <i class="el-icon-right"></i>
  652. <el-select v-model="domain.auditorSec" :placeholder="$t('di-er-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  653. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  654. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  655. <span v-else>{{item.name}}</span>
  656. </el-option>
  657. </el-select>
  658. </template>
  659. <template v-if="user.timeType.auditLevel > 2">
  660. <i class="el-icon-right"></i>
  661. <el-select v-model="domain.auditorThird" :placeholder="$t('di-san-shen-he-ren')" :disabled="!domain.canEdit" style="width:200px;">
  662. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  663. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  664. <span v-else>{{item.name}}</span>
  665. </el-option>
  666. </el-select>
  667. </template>
  668. </el-form-item>
  669. <el-form-item :label="$t('chao-song-ren')" v-if="user.timeType.reportAuditType == 3">
  670. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  671. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id">
  672. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  673. <span v-else>{{item.name}}</span>
  674. </el-option>
  675. </el-select>
  676. </el-form-item>
  677. <!-- 相关维度/自定义维度 -->
  678. <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'">
  679. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;" filterable>
  680. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  681. </el-option>
  682. </el-select>
  683. </el-form-item>
  684. <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'">
  685. <el-select v-model="domain.multiDegrIdArray" multiple clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:75%;margin-right:7%" filterable>
  686. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  687. </el-option>
  688. </el-select>
  689. </el-form-item>
  690. <!-- 相关数值 -->
  691. <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">
  692. <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>
  693. </el-form-item>
  694. <!-- 自定义文本 -->
  695. <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">
  696. <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>
  697. </el-form-item>
  698. <!--按比例填报-->
  699. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  700. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  701. <div style="width:400px;">
  702. <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>
  703. <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>
  704. </div>
  705. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  706. <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>
  707. </div>
  708. </el-form-item>
  709. <!--工程专业版本模式下, 各个专业的进度填报 -->
  710. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  711. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  712. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  713. <el-input size="mini" style="width:60px;" v-model="item.progress"
  714. @keyup.native="onProgressChange"
  715. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  716. </span>
  717. </el-form-item>
  718. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  719. <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))" >
  720. <template slot="label" v-if="user.timeType.taskRequired == 1">
  721. <span style="color:#FF0000;">*</span>
  722. <span >{{ $t('other.task') }}</span>
  723. </template>
  724. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  725. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="onTaskSelected(domain)">
  726. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  727. </el-select>
  728. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined && user.companyId != '5608'">{{$t('state.completed')}}</el-checkbox>
  729. </el-form-item>
  730. <!--针对依斯贝的SAP服务-->
  731. <el-form-item v-if="user.companyId==3092" :label="$t('fuWu')" :prop="'domains.' + index + '.sapServiceId'"
  732. :rules=" { required: true, message: $t('qingXuanZeFuWu'), trigger: 'blur' }">
  733. <el-select v-model="domain.sapServiceId" :placeholder="$t('qingXuanZeFuWu')" style="width:75%;margin-right:7%" filterable="true"
  734. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" >
  735. <el-option v-for="item in domain.serviceList" :key="item.id" :label="item.serviceName" :value="item.id"></el-option>
  736. </el-select>
  737. </el-form-item>
  738. <!--工作事项-->
  739. <el-form-item :label="$t('other.workMatters') " :prop="'domains.' + index + '.content'"
  740. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  741. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
  742. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  743. </el-form-item>
  744. <!-- 拍照上传 -->
  745. <el-form-item :label="$t('tuPianShangChuan')" v-if="user.timeType.choseFromAlbum == 1" :prop="'domains.' + index + '.imgListUrl'"
  746. :rules="isCustomization(user, reportPictureRequired) ? { required: true, message: $t('pleaseselectpictures'), trigger: 'blur' } : null">
  747. <div class="photos">
  748. <div>
  749. <el-upload
  750. list-type="picture-card"
  751. :http-request="(file) => {return addImg(file, index)}"
  752. :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
  753. :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
  754. :file-list="domain.imgListUrl" :limit="9"
  755. :disabled="workForm.domains[index].state>=2?false:true">
  756. <i class="el-icon-plus"></i>
  757. </el-upload>
  758. </div>
  759. </div>
  760. </el-form-item>
  761. </div>
  762. <!--多个工作事项填报的情况 -->
  763. <div v-if="reportTimeType.multiWorktime==1">
  764. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  765. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  766. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  767. @change="selectProject(domain, index)"
  768. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  769. <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
  770. <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">
  771. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  772. <span style="float: right;">{{ item.projectName }}</span>
  773. </el-option>
  774. </el-option-group>
  775. </el-select>
  776. <template v-if="user.timeType.mainProjectState != 1">
  777. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  778. style="margin-left:45px;"><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</span>
  779. <!--子项目 -->
  780. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  781. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  782. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  783. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  784. </el-select>
  785. </template>
  786. <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;"
  787. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  788. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  789. </el-link>
  790. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  791. <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>
  792. </div>
  793. <!-- <el-link type="primary" v-if="canEdit"
  794. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  795. </el-form-item>
  796. <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">
  797. <span>{{fillProjectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  798. </el-form-item>
  799. <!--如果设置了工时成本预警的预算成本项-->
  800. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  801. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  802. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  803. </el-select>
  804. </el-form-item>
  805. <el-form-item v-if="user.company.packageProject == 1">
  806. <template slot="label">
  807. <span style="color:#FF0000;" v-if="user.timeType.taskGroupRequired == 1">*</span>
  808. <span >{{$t('lable.taskGrouping')}}</span>
  809. </template>
  810. <!-- 任务分组 -->
  811. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  812. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  813. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  814. </el-select>
  815. <!-- 项目的阶段 -->
  816. <span v-if="domain.stages != null && domain.stages.length> 0"
  817. style="margin-left:30px;"> {{$t('other.inputStage')}}</span>
  818. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  819. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  820. @change="changeStages(domain, index)"
  821. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  822. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  823. </el-select>
  824. </el-form-item>
  825. <el-form-item :label="$t('other.projectAuditor')" >
  826. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  827. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  828. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText></span>
  829. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  830. </el-option>
  831. </el-select>
  832. <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>
  833. </el-form-item>
  834. <!--工程专业版本模式下, 各个专业的进度填报 -->
  835. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  836. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  837. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  838. <el-input size="mini" style="width:60px;" v-model="item.progress"
  839. @keyup.native="onProgressChange"
  840. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  841. </span>
  842. </el-form-item>
  843. <!-- 相关维度 -->
  844. <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'">
  845. <el-select v-if="!yonghuUser.customDegreeMultiple" v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  846. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  847. </el-option>
  848. </el-select>
  849. <el-select v-else v-model="domain.multiDegrIdArray" multiple :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')" filterable>
  850. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  851. </el-option>
  852. </el-select>
  853. </el-form-item>
  854. <!-- 相关数值 -->
  855. <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">
  856. <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>
  857. </el-form-item>
  858. <!-- 自定义文本 -->
  859. <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">
  860. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  861. </el-form-item>
  862. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  863. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  864. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  865. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  866. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  867. </el-select>
  868. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  869. </el-form-item>
  870. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  871. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  872. <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>
  873. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  874. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  875. <span v-if="reportTimeType.type == 2">
  876. <!-- <span> -->
  877. <!--时间范围选择 -->
  878. <el-time-picker
  879. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  880. v-model="timeItem.startTime"
  881. :placeholder="$t('time.startTime')"
  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. }"
  889. @change="iptChangs()">
  890. </el-time-picker> - <el-time-picker
  891. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  892. v-model="timeItem.endTime"
  893. :placeholder="$t('time.endTime')"
  894. style="width:120px;"
  895. format="HH:mm"
  896. value-format="HH:mm"
  897. :picker-options="{
  898. start: '00:00',
  899. end: '23:59',
  900. minTime: timeItem.startTime
  901. }"
  902. @change="iptChangs()">
  903. </el-time-picker>
  904. </span>
  905. <!--工作细项-->
  906. <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"
  907. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  908. <el-option v-for="item in multiOptionData" :key="item.value" :label="item.value" :value="item.value"></el-option>
  909. </el-select>
  910. </el-form-item>
  911. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  912. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  913. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  914. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  915. ></el-input>
  916. </el-form-item>
  917. </div>
  918. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  919. </div>
  920. <!--照片的显示 -->
  921. <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  922. <el-image v-for="(pic, index) in domain.pics" :key="index"
  923. style="width: 100px; height: 100px; margin-right:10px;"
  924. :src="pic"
  925. :preview-src-list="domain.pics">
  926. </el-image>
  927. </p>
  928. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
  929. </div>
  930. <span id="workFormsItemBottom"></span>
  931. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
  932. </el-form>
  933. </div>
  934. <span slot="footer" class="dialog-footer">
  935. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  936. <span style="margin-right:20px" v-if="!(user.company.companyName == mingyiName && isSubstitude)">{{ $t('heJiGongShi') }}:{{totalReportHours}}{{ $t('time.hour') }}</span>
  937. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  938. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  939. <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>
  940. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  941. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  942. </span>
  943. </el-dialog>
  944. <!-- 按周填报 -->
  945. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="fillWeekDialogVisi" width="1250px" :close-on-click-modal="false" @closed="guanbi(),closeAddWeeklyReport()" top="6.2vh">
  946. <!-- 按周填报-已填工时-点击 -->
  947. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  948. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  949. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  950. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  951. <el-table-column prop="state" :label="$t('state.states')">
  952. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  953. </el-table-column>
  954. </el-table>
  955. <span slot="footer" class="dialog-footer">
  956. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  957. </span>
  958. </el-dialog>
  959. <div v-if="isSubstitude && substitudeStep == 1" style="width:300px;margin:0 auto;" >
  960. <el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames" size="small"
  961. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  962. <div @click="showChooseMembTree" v-if="user.userNameNeedTranslate == 1" >
  963. <span class="spnn" v-if="workForm.userNames">
  964. <span v-for="(item, index) in workForm.userNames" :key="index">
  965. <span><TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText></span>
  966. <span v-if="index < workForm.userNames.length - 1">,</span>
  967. </span>
  968. </span>
  969. <span class="spnn hover" v-else>
  970. {{$t('defaultText.pleaseSelectAsubstitute')}}
  971. </span>
  972. </div>
  973. <el-button @click="substitudeStep = 2; getCurrentWeek();" style="margin-top:10px;margin-left:100px" type="primary">{{ $t('btn.nextStep') }}</el-button>
  974. </div>
  975. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!isSubstitude || (substitudeStep == 2 && isSubstitude && workForm.userNames && workForm.userNames.length>0)">
  976. <el-form-item style="height:30px;margin-top:-72px;">
  977. <!-- <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> -->
  978. <el-button @click="handleGetPrevWeek()" size="small">&lt;&lt;</el-button>
  979. <el-button @click="getCurrentWeek()" size="small">{{$t('time.thisWeek')}}</el-button>
  980. <el-button @click="handleGetNextvWeek()" size="small">&gt;&gt;</el-button>
  981. <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>
  982. <el-option
  983. v-for="item in fillProjectList"
  984. :disabled="(item.status!=1 && item.status!=4) || !item.canCancel"
  985. :key="item.id"
  986. :label="item.projectName + '\u3000' + item.projectCode"
  987. :value="item.id">
  988. <span style="float: left; color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
  989. <span style="float: right">{{ item.projectName }}</span>
  990. </el-option>
  991. </el-select>
  992. <span style="float:right;margin-right:10px;">{{ $t('defaultText.selectProject') }}</span>
  993. </el-form-item>
  994. <el-table ref="weekTable" :data="zhoData" style="width: 100%" v-loading="weekDataLoading" max-height="620" stripe>
  995. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  996. <template slot-scope="scope">
  997. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTimeTxt}})
  998. </template>
  999. </el-table-column>
  1000. <!-- <el-table-column fixed="left" label="已填(h)" width="75" prop="filledTime" align="center">
  1001. <template slot-scope="scope">
  1002. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  1003. <p v-else></p>
  1004. </template>
  1005. </el-table-column> -->
  1006. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="150" >
  1007. <template slot-scope="scope">
  1008. <div v-if="scope.row.canFill == 1">
  1009. <template v-if="!(scope.row[item.projectName].state == 1 && permissions.reportHideWorkingHours)">
  1010. <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
  1011. <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
  1012. <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>
  1013. <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>
  1014. <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
  1015. </div>
  1016. </template>
  1017. <template v-else>
  1018. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1019. <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>
  1020. <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>
  1021. <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>
  1022. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1023. </div>
  1024. </template>
  1025. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">
  1026. <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>
  1027. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  1028. </div>
  1029. </template>
  1030. <template v-else>
  1031. <el-link type="success" :underline="false">*(已通过)</el-link>
  1032. </template>
  1033. </div>
  1034. <div v-else >
  1035. <span style="color:#999999;">{{ $t('buKeChaoQianTianBao') }}</span>
  1036. </div>
  1037. </template>
  1038. </el-table-column>
  1039. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="160" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  1040. <template slot-scope="scope">
  1041. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours.toFixed(1) + 'h'}}
  1042. <span v-if="scope.row.corpTime.otTime" style="color:#FFA500"><br/>加班:{{scope.row.corpTime.otTime+'h'}}</span>
  1043. </span>
  1044. <span v-else style="color:#999999;">{{$t('other.noAttendanceRecord')}}</span>
  1045. </template>
  1046. </el-table-column>
  1047. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  1048. <template slot-scope="scope">
  1049. <div class="zhiss">
  1050. <p>{{parseFloat(scope.row.he).toFixed(1)}}</p>
  1051. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  1052. </div>
  1053. </template>
  1054. </el-table-column>
  1055. </el-table>
  1056. </el-form>
  1057. <span slot="footer" class="dialog-footer" v-if="!isSubstitude || substitudeStep == 2">
  1058. <span v-if="isSubstitude" style="float:left;color:orange;">{{ $t('zhengZaiWei') }}【{{workForm.userNames}}】{{ $t('daiTian') }}</span>
  1059. <!-- <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button> -->
  1060. <el-button @click="closeAddWeeklyReport()" :loading="submitingReport">{{$t('btn.cancel')}}</el-button>
  1061. <el-button @click="submitWeekReport(1)" :loading="submitingReport" >{{$t('btn.temporaryStorage')}}</el-button>
  1062. <el-button v-if="user.companyId != 5978" type="primary" @click="submitWeekReport(0)" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1063. <!--针对景昱,先检查工时是否存在异常-->
  1064. <el-button v-if="user.companyId == 5978" type="primary" @click="checkDateWorkTime()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  1065. </span>
  1066. </el-dialog>
  1067. <!-- 重庆物奇私人定制的按周填报 -->
  1068. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustom" width="1400px" :before-close="handleClose" top="7.5vh">
  1069. <div class="fillWeekDialogVisiCustom">
  1070. <WeeklyCustomization @weekClose="fillWeekCustomClne" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></WeeklyCustomization>
  1071. </div>
  1072. </el-dialog>
  1073. <!-- enableNewWeeklyfill==2 -->
  1074. <el-dialog :title="$t('textLink.fillInAWeek')" class="fillWeekCustom" :visible.sync="fillWeekDialogVisiCustomTwo" width="1400px" :before-close="handleClose" top="7.5vh">
  1075. <div class="fillWeekDialogVisiCustom">
  1076. <NewWeeklyCustomization @weekClose="fillWeekCustomClneTwo" @weekSubmit="fillWeekCustomSubmit" :key="weekIndex" :weekParentData="weekParentData"></NewWeeklyCustomization>
  1077. </div>
  1078. </el-dialog>
  1079. <!-- 选择时间 -->
  1080. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  1081. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  1082. <span slot="footer" class="dialog-footer">
  1083. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  1084. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  1085. </span>
  1086. </el-dialog>
  1087. <!-- 按周填报弹窗 -->
  1088. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="500px" :before-close="handleClose">
  1089. <div>
  1090. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  1091. <p><span v-if="user.timeType.subProMustFill==1" style="color:red;">*</span>{{$t('lable.subproject')}}</p>
  1092. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1093. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1094. </el-select>
  1095. </div>
  1096. <!--如果设置了工时成本预警的预算成本项-->
  1097. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  1098. <p>{{$t('lable.budgetSource')}}</p>
  1099. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  1100. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  1101. </el-select>
  1102. </div>
  1103. <!-- 任务分组 -->
  1104. <div class="zhoFel" v-if="user.company.packageProject == 1">
  1105. <p>{{$t('lable.taskGrouping')}}</p>
  1106. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  1107. @change="getGroupStages(zhoBao, 0), getWeeklyTaskList(zhoBao)">
  1108. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1109. </el-select>
  1110. </div>
  1111. <div class="zhoFel" v-if="user.company.packageProject == 1 && !user.timeType.hideStages && zhoBao.stages != null && zhoBao.stages.length> 0">
  1112. <p>{{$t('other.inputStage')}}</p>
  1113. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" @change="getWeeklyTaskList(zhoBao)">
  1114. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  1115. </el-select>
  1116. </div>
  1117. <!-- 工单号,行号 -->
  1118. <div class="zhoFel" v-if="user.timeType.reportExtraField4Name">
  1119. <p>{{ user.timeType.reportExtraField4Name }}</p>
  1120. <el-select v-model="zhoBao.extraField4" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1121. <el-option v-for="lin in (zhoBao.reportExtraField4List || [])" :key="lin" :label="lin" :value="lin">
  1122. </el-option>
  1123. </el-select>
  1124. </div>
  1125. <div class="zhoFel" v-if="user.timeType.reportExtraField5Name">
  1126. <p>{{ user.timeType.reportExtraField5Name }}</p>
  1127. <el-select v-model="zhoBao.extraField5" placeholder="请选择" @change="onProgressChange" filterable style="width: 355px" clearable>
  1128. <el-option v-for="lin in (zhoBao.reportExtraField5List || [])" :key="lin" :label="lin" :value="lin">
  1129. </el-option>
  1130. </el-select>
  1131. </div>
  1132. <div class="zhoFel" v-if="user.timeType.reportAuditType == 0 || user.timeType.reportAuditType == 4">
  1133. <p>{{$t('other.reviewer')}}</p>
  1134. <el-select v-model="zhoBao.projectAuditorId" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1135. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  1136. </el-select>
  1137. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="zhoBao.auditUserList" :subjectId="zhoBao.projectAuditorId" :distinction="'1'" @selectCal="selectCal"></selectCat>
  1138. </div>
  1139. <template v-if="user.timeType.reportAuditType == 3">
  1140. <div class="zhoFel">
  1141. <p>{{ $t('di-yi-shen-he-ren') }}</p>
  1142. <el-select v-model="zhoBao.auditorFirst" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-yi-shen-he-ren')" style="width: 355px">
  1143. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1144. </el-select>
  1145. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorFirst" :distinction="'2'" @selectCal="selectCal"></selectCat>
  1146. </div>
  1147. <div class="zhoFel">
  1148. <p>{{ $t('di-er-shen-he-ren') }}</p>
  1149. <el-select v-model="zhoBao.auditorSec" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-er-shen-he-ren')" style="width: 355px">
  1150. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1151. </el-select>
  1152. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorSec" :distinction="'3'" @selectCal="selectCal"></selectCat>
  1153. </div>
  1154. <div class="zhoFel">
  1155. <p>{{ $t('di-san-shen-he-ren') }}</p>
  1156. <el-select v-model="zhoBao.auditorThird" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('di-san-shen-he-ren')" style="width: 355px">
  1157. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1158. </el-select>
  1159. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.auditorThird" :distinction="'4'" @selectCal="selectCal"></selectCat>
  1160. </div>
  1161. <div class="zhoFel">
  1162. <p>{{ $t('chao-song-ren') }}</p>
  1163. <el-select v-model="zhoBao.ccUserid" v-if="user.userNameNeedTranslate != 1" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  1164. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1165. </el-select>
  1166. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'355'" :subject="allUsersList" :subjectId="zhoBao.ccUserid" :distinction="'5'" @selectCal="selectCal"></selectCat>
  1167. </div>
  1168. </template>
  1169. <!-- 自定义维度 -->
  1170. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  1171. <p>{{user.timeType.customDegreeName}}</p>
  1172. <el-select v-if="!user.timeType.customDegreeMultiple" v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1173. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1174. </el-select>
  1175. <el-select v-else v-model="zhoBao.multiDegrIdArray" multiple :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable>
  1176. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  1177. </el-select>
  1178. </div>
  1179. <!-- 自定义数值 -->
  1180. <div class="zhoFel" v-if="user.timeType.customDataActive">
  1181. <p>{{user.timeType.customDataName}}</p>
  1182. <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>
  1183. </div>
  1184. <!-- 自定义文本 -->
  1185. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  1186. <p>{{user.timeType.customTextName}}</p>
  1187. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  1188. </div>
  1189. <!-- 选择任务 -->
  1190. <div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
  1191. <p>{{ $t('renWuLiChengBei') }}</p>
  1192. <el-select v-model="zhoBao.taskId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px" filterable @change="$forceUpdate()">
  1193. <el-option v-for="item in zhoBao.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  1194. </el-select>
  1195. </div>
  1196. <div class="zhoFel" v-if="reportTimeType.type == 2">
  1197. <p>{{$t('other.timeSelection')}}</p>
  1198. <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>
  1199. </div>
  1200. <div class="zhoFel" v-if="reportTimeType.type == 1">
  1201. <p>{{$t('other.chooseDuration')}}</p>
  1202. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  1203. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  1204. </el-select>
  1205. </div>
  1206. <div class="zhoFel" v-if="reportTimeType.type == 3">
  1207. <p>{{$t('lable.percentageOfTime')}}</p>
  1208. <div style="width:400px;display: flex;align-items: center;">
  1209. <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>
  1210. <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>
  1211. </div>
  1212. </div>
  1213. <div class="zhoFel">
  1214. <p>{{$t('other.workMatters')}}</p>
  1215. <el-input type="textarea" v-model="zhoBao.content" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  1216. </div>
  1217. </div>
  1218. <span slot="footer" class="dialog-footer">
  1219. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  1220. <el-button type="primary" @click="setWeekProItemData()">{{$t('btn.determine')}}</el-button>
  1221. </span>
  1222. </el-dialog>
  1223. <!--导出报表条件选择 -->
  1224. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  1225. <el-form ref="form3" :model="exportParam" >
  1226. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  1227. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  1228. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  1229. </el-select>
  1230. </el-form-item>
  1231. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  1232. <!-- <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>
  1233. <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> -->
  1234. <vueMultipleDept v-model="exportParam.departmentId" :selectType="'2'"></vueMultipleDept>
  1235. </el-form-item>
  1236. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1237. <el-date-picker
  1238. v-model="exportParam.dateRange" :editable="false"
  1239. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1240. :range-separator="$t('other.to')"
  1241. type="daterange"
  1242. :start-placeholder="$t('time.startDate')"
  1243. :end-placeholder="$t('time.endDate')"
  1244. ></el-date-picker>
  1245. </el-form-item>
  1246. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  1247. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  1248. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  1249. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  1250. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  1251. </el-select>
  1252. </el-form-item>
  1253. <el-form-item :label="customConfigurationRow.name">
  1254. <el-select v-model="exportParam.plate" placeholder="请选择" clearable filterable>
  1255. <el-option v-for="item in customConfigurationRow.subUserCustomList || []" :key="item.id" :label="item.name" :value="item.newId"></el-option>
  1256. </el-select>
  1257. </el-form-item>
  1258. <el-form-item prop="exportType" :label="$t('daoChuFangShi')" v-if="user.companyId == '936'">
  1259. <div class="exportReportRadio">
  1260. <el-radio v-model="exportType" :label="0">{{ $t('wanZhengDaoChu') }}</el-radio>
  1261. <el-radio v-model="exportType" :label="1">{{ $t('jingJianDaoChu') }}</el-radio>
  1262. <el-tooltip effect="dark" :content="$t('jingJianRiBaoBuHanGongZuoShiXiangHeShenPiXinXiShuJuLiangGengXiaoDaoChuGengKuai')" placement="top-start">
  1263. <i class="el-icon-question"></i>
  1264. </el-tooltip>
  1265. </div>
  1266. </el-form-item>
  1267. </el-form>
  1268. <div slot="footer" class="dialog-footer">
  1269. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="exportingData">{{$t('export.export')}}</el-button>
  1270. </div>
  1271. </el-dialog>
  1272. <!--导出报表条件选择 -->
  1273. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  1274. <el-form ref="form3" :model="exportParam" >
  1275. <el-form-item prop="range" :label="$t('time.dateRange')">
  1276. <el-date-picker
  1277. v-model="exportParam.dateRange" :editable="false"
  1278. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1279. :clearable="true"
  1280. :range-separator="$t('other.to')"
  1281. type="daterange"
  1282. :start-placeholder="$t('time.startDate')"
  1283. :end-placeholder="$t('time.endDate')"
  1284. ></el-date-picker>
  1285. </el-form-item>
  1286. </el-form>
  1287. <div slot="footer" class="dialog-footer">
  1288. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  1289. </div>
  1290. </el-dialog>
  1291. <!--人员列表 -->
  1292. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  1293. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  1294. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  1295. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  1296. <el-table-column type="selection"></el-table-column>
  1297. <el-table-column prop="label" :label="$t('lable.name')" >
  1298. <template slot-scope="scope">
  1299. <span>
  1300. <!-- {{(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}} -->
  1301. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1302. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1303. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1304. <span>{{scope.row.leaveDays ? '(' + $t('other.AskForLeave') +scope.row.leaveDays.toFixed(1) + $t('time.day') +')' : '(' + $t('other.AskForLeave') + scope.row.leaveTimes + 'h)'}}</span>
  1305. </span>
  1306. <span v-else>
  1307. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1308. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1309. </span>
  1310. </span>
  1311. </template>
  1312. </el-table-column>
  1313. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1314. <template slot-scope="scope">
  1315. <div>
  1316. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1317. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1318. </div>
  1319. </template>
  1320. </el-table-column>
  1321. </el-table>
  1322. </el-tab-pane>
  1323. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  1324. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  1325. <el-table-column prop="label" :label="$t('lable.name')" >
  1326. <template slot-scope="scope">
  1327. <!-- <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> -->
  1328. <!-- <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> -->
  1329. <span v-if="scope.row.leaveDays || scope.row.leaveTimes">
  1330. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1331. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1332. <span>{{scope.row.leaveDays.toFixed(1) ? '(' + leaveTypeName[scope.row.leaveType] + ')' : '(' + leaveTypeName[scope.row.leaveType] + ')'}}</span>
  1333. </span>
  1334. <span v-else>
  1335. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1336. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1337. </span>
  1338. </template>
  1339. </el-table-column>
  1340. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1341. <template slot-scope="scope">
  1342. <div>
  1343. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1344. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1345. </div>
  1346. </template>
  1347. </el-table-column>
  1348. </el-table>
  1349. </el-tab-pane>
  1350. </el-tabs>
  1351. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  1352. <el-table-column type="selection"></el-table-column>
  1353. <el-table-column prop="label" :label="$t('lable.name')" >
  1354. <template slot-scope="scope">
  1355. <div>
  1356. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='scope.row.label'></TranslationOpenDataText></span>
  1357. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.label}}</span>
  1358. </div>
  1359. </template>
  1360. </el-table-column>
  1361. <el-table-column prop="deptName" :label="$t('lable.department')" >
  1362. <template slot-scope="scope">
  1363. <div>
  1364. <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.deptName'></TranslationOpenDataText></span>
  1365. <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.deptName}}</span>
  1366. </div>
  1367. </template>
  1368. </el-table-column>
  1369. </el-table>
  1370. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  1371. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  1372. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  1373. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  1374. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  1375. </div>
  1376. </el-dialog>
  1377. <!-- 日报审核修改 -->
  1378. <el-dialog
  1379. :title="$t('riBaoShenHeXiuGai')"
  1380. :visible.sync="reportLogCheckDialog"
  1381. width="30%"
  1382. :before-close="handleClose">
  1383. <el-form ref="form3" :model="exportReportLogParam" >
  1384. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  1385. <el-date-picker
  1386. v-model="exportReportLogParam.dateRange" :editable="false"
  1387. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1388. :range-separator="$t('other.to')"
  1389. type="daterange"
  1390. :start-placeholder="$t('time.startDate')"
  1391. :end-placeholder="$t('time.endDate')"
  1392. ></el-date-picker>
  1393. </el-form-item>
  1394. </el-form>
  1395. <el-link type="primary" @click="exportReportLog">{{ $t('daoChuRiBaoShenHeJiLuShuJu') }}</el-link>
  1396. <br>
  1397. <el-upload ref="upload" action="#" :limit="1" :http-request="importReportLog" :show-file-list="false">
  1398. <el-link type="primary" @click="importReportLog">{{ $t('daoRuRiBaoShenHeJiLuXiuGaiShuJu') }}</el-link></el-upload>
  1399. <span slot="footer" class="dialog-footer">
  1400. <el-button type="primary" @click="reportLogCheckDialog = false">{{ $t('Shutdown') }}</el-button>
  1401. </span>
  1402. </el-dialog>
  1403. <!-- 按部门选择人员 -->
  1404. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1405. <el-input v-if="user.userNameNeedTranslate != 1" style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  1406. <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)">
  1407. <el-button slot="append" icon="el-icon-search" @click="nameAearchSeek(true)"></el-button>
  1408. </el-input>
  1409. <div class="tree" style="height:400px">
  1410. <el-scrollbar style="height:100%">
  1411. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id" v-loading="deptMembDataLoading"
  1412. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  1413. highlight-current :filter-node-method="filterNode" :default-expand-all="expandAlltree">
  1414. <span class="custom-tree-node" slot-scope="{ node }">
  1415. <span v-if="user.userNameNeedTranslate == '1'">
  1416. <span v-if="node.data.children">
  1417. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  1418. </span>
  1419. <span v-else>
  1420. <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
  1421. </span>
  1422. </span>
  1423. <span v-if="user.userNameNeedTranslate != '1'">
  1424. {{ node.label }}
  1425. </span>
  1426. <!-- {{ node.label }} -->
  1427. </span>
  1428. </el-tree>
  1429. </el-scrollbar>
  1430. </div>
  1431. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  1432. <div slot="footer" class="dialog-footer">
  1433. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  1434. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  1435. </div>
  1436. </el-dialog>
  1437. <el-dialog
  1438. v-if="monthWorkTimeDialog"
  1439. :visible.sync="monthWorkTimeDialog"
  1440. :close-on-click-modal="false"
  1441. customClass="customWidth selectworktime"
  1442. width="92%"
  1443. top="60px"
  1444. >
  1445. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1446. <el-tabs v-model="activeName" @tab-click="handleClick">
  1447. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1448. <div class="selectworktime_export" style="margin-top:10px;">
  1449. <div class="selectworktime_export_l">
  1450. <el-date-picker
  1451. class="selecteworktime_datapick"
  1452. v-model="WorktimeDatepickValue"
  1453. value-format="yyyy-MM-dd"
  1454. type="daterange"
  1455. align="right"
  1456. unlink-panels
  1457. :range-separator="$t('other.to')"
  1458. :start-placeholder="$t('time.startDate')"
  1459. :end-placeholder="$t('time.endDate')"
  1460. :default-time="['12:00:00', '12:00:00']"
  1461. size="small"
  1462. popper-class="selecteorktime_datapick_popper"
  1463. @change="showMonthWorkTime()"
  1464. >
  1465. </el-date-picker>
  1466. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1467. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1468. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1469. <!-- 222 -->
  1470. </div>
  1471. <div>
  1472. <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>
  1473. <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>
  1474. <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">
  1475. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1476. </el-input>
  1477. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1478. </div>
  1479. <div style="float: left; height:32px; padding-top:10px;">
  1480. <span style="width:20px;height:20px;background-color: orange;padding:5px 8px;">{{ $t('state.WaitingAudit') }}</span>
  1481. <span style="width:20px;height:20px;background-color: #32CD32;padding:5px 8px;margin-left:10px;">{{ $t('state.alreadyPassed') }}</span>
  1482. <span style="width:20px;height:20px;background-color: red;padding:5px 8px;margin-left:10px;">{{ $t('yiBoHuiLouTian') }}</span>
  1483. <span style="width:20px;height:20px;background-color: #E0E0E0;padding:5px 8px;margin-left:10px;">{{ $t('weiTiJiao') }}</span>
  1484. </div>
  1485. <div style="float: right; vertical-align: middle;height:32px">
  1486. <el-link
  1487. type="primary"
  1488. @click="exportMembWorkHours()"
  1489. >{{$t('export.exportData')}}</el-link
  1490. >
  1491. </div>
  1492. </div>
  1493. <el-table ref="hasworkTbl"
  1494. :data="monthWorkDataS"
  1495. v-el-table-infinite-scroll="listScroll"
  1496. border
  1497. :height="'70vh'"
  1498. highlight-current-row
  1499. style="width: 100%"
  1500. v-loading="tbload"
  1501. :lazy="true"
  1502. :cell-style="hasworkTblCellStyle"
  1503. >
  1504. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1505. <template slot-scope="scope">
  1506. {{ scope.$index + 1 }}
  1507. </template>
  1508. </el-table-column>
  1509. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1510. <template slot-scope="scope">
  1511. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1512. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1513. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1514. <!-- {{scope.row.name}} -->
  1515. </span>
  1516. </template>
  1517. </el-table-column>
  1518. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1519. <template slot-scope="scope">
  1520. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1521. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1522. </template>
  1523. </el-table-column>
  1524. <el-table-column
  1525. min-width="60"
  1526. v-for="(item, index) in pickDateArray"
  1527. :key="index"
  1528. :label="item"
  1529. align="center"
  1530. >
  1531. <template slot="header" slot-scope="scope">
  1532. <div>{{ scope.column.label.dateStr }}</div>
  1533. <div>{{ scope.column.label.weekStr }}</div>
  1534. </template>
  1535. <template slot-scope="scope">
  1536. <div
  1537. v-if="
  1538. scope.row.worktimeList.filter(
  1539. (w) =>
  1540. w.createDate==item.date
  1541. ).length > 0 &&
  1542. scope.row.worktimeList.filter(
  1543. (w) =>w.createDate==item.date
  1544. )[0].workingTime < reportTimeType.allday
  1545. "
  1546. >
  1547. {{
  1548. scope.row.worktimeList.filter(
  1549. (w) =>w.createDate==item.date
  1550. )[0].workingTime.toFixed(1)
  1551. }}
  1552. </div>
  1553. <div
  1554. v-if="
  1555. scope.row.worktimeList.filter(
  1556. (w) =>w.createDate==item.date
  1557. ).length > 0 &&
  1558. scope.row.worktimeList.filter(
  1559. (w) =>w.createDate==item.date
  1560. )[0].workingTime > reportTimeType.allday
  1561. "
  1562. >
  1563. {{
  1564. scope.row.worktimeList.filter(
  1565. (w) =>w.createDate==item.date
  1566. )[0].workingTime.toFixed(1)
  1567. }}
  1568. </div>
  1569. <div
  1570. v-if="
  1571. scope.row.worktimeList.filter(
  1572. (w) =>w.createDate==item.date
  1573. ).length > 0 &&
  1574. scope.row.worktimeList.filter(
  1575. (w) =>w.createDate==item.date
  1576. )[0].workingTime == reportTimeType.allday
  1577. "
  1578. >
  1579. {{
  1580. scope.row.worktimeList.filter(
  1581. (w) =>w.createDate==item.date
  1582. )[0].workingTime
  1583. }}
  1584. </div>
  1585. <div
  1586. v-if="
  1587. scope.row.worktimeList.filter(
  1588. (w) =>w.createDate==item.date
  1589. ).length == 0
  1590. "
  1591. >
  1592. 0
  1593. </div>
  1594. <div
  1595. v-if="
  1596. scope.row.worktimeList.filter(
  1597. (w) =>w.createDate==item.date
  1598. ).length > 0 &&
  1599. typeof scope.row.worktimeList.filter(
  1600. (w) =>w.createDate==item.date
  1601. )[0].workingTime == 'string'
  1602. "
  1603. >
  1604. {{
  1605. scope.row.worktimeList.filter(
  1606. (w) =>w.createDate==item.date
  1607. )[0].workingTime
  1608. }}
  1609. </div>
  1610. </template>
  1611. </el-table-column>
  1612. </el-table>
  1613. <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>
  1614. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1615. </el-tab-pane>
  1616. <el-tab-pane :label="$t('weiTiJiaoRenYuanLieBiao')" name="second" >
  1617. <div class="selectworktime_export" style="margin-top:10px">
  1618. <div class="selectworktime_export_l">
  1619. <el-date-picker
  1620. class="selecteworktime_datapick"
  1621. v-model="WorktimeDatepickValue"
  1622. value-format="yyyy-MM-dd"
  1623. type="daterange"
  1624. align="right"
  1625. unlink-panels
  1626. :range-separator="$t('other.to')"
  1627. :start-placeholder="$t('time.startDate')"
  1628. :end-placeholder="$t('time.endDate')"
  1629. :default-time="['12:00:00', '12:00:00']"
  1630. size="small"
  1631. popper-class="selecteorktime_datapick_popper"
  1632. @change="showMonthNotWorkTime()"
  1633. >
  1634. </el-date-picker>
  1635. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1636. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1637. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1638. </div>
  1639. <div>
  1640. <div style="margin-top:10px;">
  1641. <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>
  1642. <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>
  1643. <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">
  1644. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1645. </el-input>
  1646. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
  1647. <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
  1648. <el-link
  1649. type="primary"
  1650. style="float: right; vertical-align: middle;height:32px"
  1651. @click="exportMembNotWorkHours()"
  1652. >{{$t('export.exportData')}}</el-link
  1653. >
  1654. </div>
  1655. </div>
  1656. </div>
  1657. <el-table
  1658. ref="hasworkTbl2"
  1659. :data="monthNotWorkDateS"
  1660. v-el-table-infinite-scroll="notListScroll"
  1661. border
  1662. :height="'70vh'"
  1663. highlight-current-row
  1664. style="width: 100%"
  1665. v-loading="tbload"
  1666. lazy
  1667. >
  1668. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1669. <template slot-scope="scope">
  1670. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText></span>
  1671. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1672. </template>
  1673. </el-table-column>
  1674. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1675. <template slot-scope="scope">
  1676. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1677. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1678. </template>
  1679. </el-table-column>
  1680. <el-table-column
  1681. min-width="200"
  1682. :label="$t('weekDay.date')"
  1683. align="center"
  1684. prop="createDate"
  1685. >
  1686. </el-table-column>
  1687. <el-table-column
  1688. min-width="200"
  1689. :label="$t('state.states')"
  1690. align="center"
  1691. prop="status"
  1692. />
  1693. <el-table-column
  1694. min-width="200"
  1695. :label="$t('other.attendanceData')"
  1696. prop="cardTime"
  1697. align="center"
  1698. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1699. </el-table>
  1700. <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>
  1701. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1702. </el-tab-pane>
  1703. <el-tab-pane :label="$t('cardtimenotfull')" name="fourth" v-if="(user.timeType.syncCorpwxTime==1 || user.timeType.syncFanwei == 1) && user.companyId!=5978">
  1704. <div class="selectworktime_export" style="margin-top:10px">
  1705. <div class="selectworktime_export_l">
  1706. <el-date-picker
  1707. class="selecteworktime_datapick"
  1708. v-model="notfullSelectDateMonth"
  1709. value-format="yyyy-MM"
  1710. type="month"
  1711. align="right"
  1712. unlink-panels
  1713. size="small"
  1714. popper-class="selecteorktime_datapick_popper"
  1715. @change="showReportTimeLessThanCardTimeList()"
  1716. >
  1717. </el-date-picker>
  1718. </div>
  1719. <div>
  1720. <div style="margin-top:10px;">
  1721. <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>
  1722. <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>
  1723. <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">
  1724. <el-button slot="append" @click="searchScreen(2)" icon="el-icon-search"></el-button>
  1725. </el-input>
  1726. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
  1727. <div style="float: right; vertical-align: middle;height:32px">
  1728. <el-link v-if="user.companyId==7536" style="margin-right: 14px"
  1729. type="primary" v-loading="refreshAttendanceLoading"
  1730. @click="refreshAttendanceCli()" >刷新考勤</el-link>
  1731. <el-link
  1732. type="primary" v-loading="remindering"
  1733. @click="batchRejectAndRemind()" >一键驳回并提醒</el-link>
  1734. <!-- <el-link
  1735. type="primary"
  1736. @click="exportMembWorkHoursReminder()"
  1737. >{{$t('export.exportData')}}</el-link> -->
  1738. </div>
  1739. <!-- <el-link
  1740. type="primary"
  1741. style="float: right; vertical-align: middle;height:32px"
  1742. @click="exportMembNotWorkHours()"
  1743. >{{$t('export.exportData')}}</el-link
  1744. > -->
  1745. </div>
  1746. </div>
  1747. </div>
  1748. <el-table
  1749. ref="hasworkTbl4"
  1750. :data="notFullData"
  1751. border
  1752. :height="'70vh'"
  1753. highlight-current-row
  1754. style="width: 100%"
  1755. v-loading="tbload"
  1756. lazy
  1757. >
  1758. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1759. <template slot-scope="scope">
  1760. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1761. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1762. </template>
  1763. </el-table-column>
  1764. <el-table-column
  1765. min-width="200"
  1766. :label="$t('weekDay.date')"
  1767. align="center"
  1768. prop="createDate"
  1769. >
  1770. </el-table-column>
  1771. <el-table-column
  1772. min-width="200"
  1773. :label="$t('fillReportTime')"
  1774. align="center"
  1775. prop="reportTime"
  1776. />
  1777. <el-table-column
  1778. min-width="200"
  1779. :label="$t('workAttendance')"
  1780. prop="workHours"
  1781. align="center"></el-table-column>
  1782. </el-table>
  1783. </el-tab-pane>
  1784. <el-tab-pane v-if="user.companyId==5978" :label="$t('gongShiYiChangMingXi')" name="third">
  1785. <div class="selectworktime_export" style="margin-top:10px;">
  1786. <div class="selectworktime_export_l">
  1787. <el-date-picker
  1788. class="selecteworktime_datapick"
  1789. v-model="WorktimeDatepickValue"
  1790. value-format="yyyy-MM-dd"
  1791. type="daterange"
  1792. align="right"
  1793. unlink-panels
  1794. :range-separator="$t('other.to')"
  1795. :start-placeholder="$t('time.startDate')"
  1796. :end-placeholder="$t('time.endDate')"
  1797. :default-time="['12:00:00', '12:00:00']"
  1798. size="small"
  1799. popper-class="selecteorktime_datapick_popper"
  1800. @change="showMonthWorkTimeReminder()"
  1801. >
  1802. </el-date-picker>
  1803. <el-button size="small" @click="getDoubleLastWeek(2)">{{$t('time.twoWeeksAgo')}}</el-button>
  1804. <el-button size="small" @click="getLastWeek(2)">{{$t('time.lastWeek')}}</el-button>
  1805. <el-button size="small" @click="getThisWeek(2)">{{$t('time.nextWeek')}}</el-button>
  1806. </div>
  1807. <div>
  1808. <div style="margin-top:10px;">
  1809. <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>
  1810. <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>
  1811. <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">
  1812. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1813. </el-input>
  1814. <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'12'" :clearable="true" @selectCal="selectCal"></selectCat>
  1815. <el-checkbox v-model="isReminder" @change="showMonthWorkTimeReminder()">{{ $t('shiFouYiChang') }}</el-checkbox>
  1816. </div>
  1817. </div>
  1818. <div style="float: right; vertical-align: middle;height:32px">
  1819. <el-link
  1820. type="primary" v-loading="remindering"
  1821. @click="changeReminder()"
  1822. >{{ $t('bianGengTiXing') }}</el-link>
  1823. <el-link
  1824. type="primary"
  1825. @click="exportMembWorkHoursReminder()"
  1826. >{{$t('export.exportData')}}</el-link>
  1827. </div>
  1828. </div>
  1829. <el-table ref="hasworkTbl"
  1830. :data="monthWorkDataS"
  1831. v-el-table-infinite-scroll="listScroll"
  1832. border
  1833. :height="'70vh'"
  1834. highlight-current-row
  1835. style="width: 100%"
  1836. v-loading="tbload"
  1837. :lazy="true"
  1838. >
  1839. <el-table-column width="120" type="index" fixed="left" :label="$t('weekDay.date')">
  1840. <template slot-scope="scope">
  1841. {{ scope.row.createDate}}
  1842. </template>
  1843. </el-table-column>
  1844. <el-table-column width="120" prop="name" fixed="left" :label="$t('lable.name')">
  1845. <template slot-scope="scope">
  1846. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.name'></TranslationOpenDataText></span>
  1847. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1848. <!-- {{scope.row.name}} -->
  1849. </template>
  1850. </el-table-column>
  1851. <el-table-column width="100" prop="invokeValue" fixed="left" :label="$t('costtype')">
  1852. <template slot-scope="scope">
  1853. {{scope.row.invokeValue}}
  1854. </template>
  1855. </el-table-column>
  1856. <el-table-column prop="departmentName" width="170" fixed="left" :label="$t('lable.department')">
  1857. <template slot-scope="scope">
  1858. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  1859. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1860. </template>
  1861. </el-table-column>
  1862. <el-table-column width="160" type="index" fixed="left" :label="$t('tianBaoGongShi')">
  1863. <template slot-scope="scope">
  1864. {{ scope.row.workingTime}}
  1865. </template>
  1866. </el-table-column>
  1867. <el-table-column width="160" type="index" fixed="left" :label="$t('kaoQinGongShi')">
  1868. <template slot-scope="scope">
  1869. {{ scope.row.cardTime}}
  1870. <i class="el-icon-refresh" @click="restUserCardTime(scope.row)"></i>
  1871. </template>
  1872. </el-table-column>
  1873. <el-table-column width="160" type="index" fixed="left" :label="$t('shiFouYiChang')">
  1874. <template slot-scope="scope">
  1875. {{ scope.row.exceedCardTime==0?$t('state.no'):$t('state.yes')}}
  1876. </template>
  1877. </el-table-column>
  1878. <el-table-column width="160" type="index" fixed="left" :label="$t('cuiBan')">
  1879. <template slot-scope="scope">
  1880. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="changeReminder(scope.row)">{{ $t('bianGengTiXing') }}</el-link>
  1881. <el-link v-if="scope.row.exceedCardTime==1" type="primary" @click="cancelReminder(scope.row)">{{ $t('quXiaoYiChang') }}</el-link>
  1882. </template>
  1883. </el-table-column>
  1884. </el-table>
  1885. <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>
  1886. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1887. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1888. <label style="font-size: 16px">员工每日已填报工时数</label>
  1889. <el-link
  1890. type="primary"
  1891. style="float: right; margin-right: 60px"
  1892. @click="exportMembWorkHours()"
  1893. >导出已填报数据</el-link
  1894. > -->
  1895. <!-- <el-button >导出</el-button> -->
  1896. <!-- </div> -->
  1897. </el-tab-pane>
  1898. </el-tabs>
  1899. </el-dialog>
  1900. <!--驳回弹出框 -->
  1901. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1902. <div>
  1903. <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')" />
  1904. </div>
  1905. <div slot="footer" class="dialog-footer">
  1906. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1907. <el-button type="primary" :loading="isDenying" @click="deny()" :disabled="user.timeType.forceRejectReason && !denyForm.reason">{{$t('btn.submit')}}</el-button>
  1908. </div>
  1909. </el-dialog>
  1910. <!-- 通过弹出框 -->
  1911. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1912. <div>
  1913. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1914. </div>
  1915. <div slot="footer" class="dialog-footer">
  1916. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1917. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1918. </div>
  1919. </el-dialog>
  1920. <!--批量导入日报 -->
  1921. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1922. <p>1. {{$t('other.download')}}
  1923. <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>
  1924. </p>
  1925. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1926. <p style="display: flex;justify-content: center;">
  1927. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1928. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1929. </el-upload>
  1930. </p>
  1931. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1932. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1933. </div>
  1934. </el-dialog>
  1935. <!-- 工时导入记录弹窗 -->
  1936. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1937. <div style="height: 452px">
  1938. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1939. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1940. <el-table-column prop="userName" :label="$t('other.operator')">
  1941. <template slot-scope="scope">
  1942. <div>
  1943. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  1944. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  1945. </div>
  1946. </template>
  1947. </el-table-column>
  1948. <el-table-column prop="datel" :label="$t('other.document')">
  1949. <template slot-scope="scope">
  1950. <div>
  1951. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1952. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1953. </div>
  1954. </template>
  1955. </el-table-column>
  1956. <el-table-column :label="$t('operation')" v-if="showHidden && user.companyId == 469 && user.roleName=='超级管理员'">
  1957. <template slot-scope="scope">
  1958. <div>
  1959. <el-button type="default" size="small" @click="openModImportTime(scope.row)">{{ $t('xiuGaiDaoRuJiLu') }}</el-button>
  1960. <el-button type="primary" size="small" @click="delImportTime(scope.row)">{{ $t('shan-chu-ji-lu') }}</el-button>
  1961. </div>
  1962. </template>
  1963. </el-table-column>
  1964. </el-table>
  1965. <el-col :span="24" class="paginatis">
  1966. <el-pagination
  1967. @size-change="handleSizeChange"
  1968. @current-change="handleCurrentChange"
  1969. :page-sizes="[20 , 50 , 80 , 100]"
  1970. :page-size="20"
  1971. layout="total, sizes, prev, pager, next"
  1972. :total="toViewForm.total"
  1973. style="float:right;"
  1974. ></el-pagination>
  1975. </el-col>
  1976. </div>
  1977. </el-dialog>
  1978. <!--基于企业微信考勤数据的工时导入 -->
  1979. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1980. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1981. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1982. </el-step>
  1983. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1984. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1985. </el-steps>
  1986. <div v-if="active==0" style="padding:30px;height:360px;">
  1987. <div style="margin-top:50px;margin-left:280px;">
  1988. <el-date-picker
  1989. v-model="importWxParam.date" :editable="false"
  1990. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1991. :clearable="true"
  1992. :range-separator="$t('other.to')"
  1993. type="daterange"
  1994. :start-placeholder="$t('time.startDate')"
  1995. :end-placeholder="$t('time.endDate')"
  1996. @change="loadCheckInData"
  1997. ></el-date-picker>
  1998. </div>
  1999. </div>
  2000. <div v-if="active==1" style="padding:10px;">
  2001. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  2002. style="width: 100%;margin-top:5px;" >
  2003. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  2004. <template slot-scope="scope">
  2005. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  2006. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  2007. </template>
  2008. </el-table-column>
  2009. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  2010. </el-table-column>
  2011. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  2012. <el-table-column prop="username" :label="$t('screening.employeename')" >
  2013. <template slot-scope="scope">
  2014. <div>
  2015. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2016. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2017. </div>
  2018. </template>
  2019. </el-table-column>
  2020. <el-table-column prop="departmentName" :label="$t('lable.department')" >
  2021. <template slot-scope="scope">
  2022. <div>
  2023. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
  2024. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  2025. </div>
  2026. </template>
  2027. </el-table-column>
  2028. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  2029. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  2030. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  2031. <template slot-scope="scope">
  2032. {{scope.row.workHours.toFixed(1)}}h
  2033. </template>
  2034. </el-table-column>
  2035. </el-table>
  2036. </div>
  2037. <div v-if="active==2" >
  2038. <p style="display: flex;justify-content: center;height:390px;">
  2039. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  2040. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2041. </el-upload>
  2042. </p>
  2043. </div>
  2044. <div slot="title">
  2045. <span style="font-size:16px;" @click="showHiddenFunction">{{$t('other.Batchimportofworkinghours')}}</span>
  2046. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  2047. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="downloadProjectRatio">{{ $t('xiaZaiTianBaoGongShiZhanBiBiao') }}</el-link>
  2048. <el-link v-if="active==0 && ((showHidden && user.companyId == 469) || user.companyId == 7703 || user.companyId == 7544) && user.roleName.indexOf('管理员') > 0" style="float:right;margin-right:100px;" type="primary" @click="importCardTimeVisi = true">{{ $t('daoRuKaoQinShiChang') }}</el-link>
  2049. <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>
  2050. <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>
  2051. </div>
  2052. <span slot="footer">
  2053. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  2054. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  2055. <el-button @click="refreshWXCardTimeByRange" v-if="active == 1" :loading="refreshingTime">刷新考勤</el-button>
  2056. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  2057. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  2058. </span>
  2059. </el-dialog>
  2060. <el-dialog :title="$t('daoRuKaoQinShiChang')" v-if="importCardTimeVisi" :visible.sync="importCardTimeVisi" width="200">
  2061. <p style="display: flex;justify-content: center;height:100px;">
  2062. <el-upload style="margin-top:10px;" ref="uploadCardTime" action="#" :limit="1" :http-request="importCardTime" :show-file-list="false">
  2063. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  2064. </el-upload>
  2065. </p>
  2066. </el-dialog>
  2067. <el-dialog :title="$t('piLiangShanChuRiBao')" v-if="showBatchDeleteReport" :visible.sync="showBatchDeleteReport" width="200">
  2068. <div>
  2069. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2070. v-model="deleteReportParam.date" :editable="false"
  2071. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2072. :clearable="true"
  2073. :range-separator="$t('other.to')"
  2074. type="daterange"
  2075. :start-placeholder="$t('time.startDate')"
  2076. :end-placeholder="$t('time.endDate')"
  2077. ></el-date-picker>
  2078. </div>
  2079. <div style="margin-top:10px;">
  2080. <span>{{ $t('qing-xuan-ze-bu-men') }}:</span>
  2081. <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>
  2082. <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>
  2083. </div>
  2084. <div style="margin-top:10px;">
  2085. <span>{{ $t('qingXuanZeYuanGong') }}:</span>
  2086. <el-select v-model="deleteReportParam.userIds" :placeholder="$t('defaultText.pleaseChoose')" style="width:500px;" filterable multiple>
  2087. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2088. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2089. <span v-else>{{item.name}}</span>
  2090. </el-option>
  2091. </el-select>
  2092. </div>
  2093. <span slot="footer">
  2094. <el-button @click="confirmBatchDelReport" :loading="startDeleting" >{{ $t('kaiShiShanChu') }}</el-button>
  2095. </span>
  2096. </el-dialog>
  2097. <el-dialog :title="$t('piLiangShenHeRiBao')" v-if="showBatchSimpleApproveReport" :visible.sync="showBatchSimpleApproveReport" width="200">
  2098. <div>
  2099. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2100. v-model="deleteReportParam.date" :editable="false"
  2101. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2102. :clearable="true"
  2103. :range-separator="$t('other.to')"
  2104. type="daterange"
  2105. :start-placeholder="$t('time.startDate')"
  2106. :end-placeholder="$t('time.endDate')"
  2107. ></el-date-picker>
  2108. </div>
  2109. <div style="margin-top:15px;">
  2110. <span>{{ $t('other.selectdepartment') }}:</span>
  2111. <el-cascader v-model="deleteReportParam.departmentId" :placeholder="$t('other.allDepartments')" style="width: 350px;margin-left:25px;"
  2112. :options="deptOptionList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
  2113. size="small" v-if="user.userNameNeedTranslate != 1"
  2114. ></el-cascader>
  2115. <vueCascader :size="'small'" :widthStr="'191'" :clearable="true" :subject="deptOptionList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  2116. </div>
  2117. <span slot="footer">
  2118. <el-button @click="confirmBatchApproveReport" :loading="startDeleting" >{{ $t('shenPiTongGuo') }}</el-button>
  2119. </span>
  2120. </el-dialog>
  2121. <el-dialog :title="$t('xiuGaiDaoRuJiLu')" v-if="showModImportTimeDialog" :visible.sync="showModImportTimeDialog" width="200">
  2122. <div>
  2123. <span>{{ $t('other.timeSelection') }}:</span><el-date-picker
  2124. v-model="modImportTime"
  2125. format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
  2126. :clearable="true"
  2127. type="datetime"
  2128. ></el-date-picker>
  2129. <span>{{ $t('xuanZeDaoRuRenYuan') }}</span><el-select
  2130. v-model="modImportUserId"
  2131. >
  2132. <el-option v-for="item in usersList" :key="item.id" :label="item.name" :value="item.id">
  2133. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText></span>
  2134. <span v-else>{{item.name}}</span>
  2135. </el-option>
  2136. </el-select>
  2137. </div>
  2138. <span slot="footer">
  2139. <el-button @click="confirmChangeModTime" >{{ $t('queRen') }}</el-button>
  2140. </span>
  2141. </el-dialog>
  2142. <el-dialog :title="$t('daoChuYuanGongTianBaoGongShiZhanBi')" v-if="exportUserRatio" :visible.sync="exportUserRatio" width="200">
  2143. <div>
  2144. <span>{{ $t('qingXuanZeNianYue') }}</span>
  2145. <el-date-picker
  2146. v-model="ratioYmonth" :editable="false"
  2147. format="yyyyMM" value-format="yyyyMM"
  2148. type="month"
  2149. ></el-date-picker>
  2150. </div>
  2151. <span slot="footer">
  2152. <el-button @click="confirmDownloadRatio" :loading="startRatioExporting" :disabled="startRatioExporting">{{ $t('export.export') }}</el-button>
  2153. </span>
  2154. </el-dialog>
  2155. <!--工时批量代填 -->
  2156. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  2157. <div>
  2158. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  2159. v-model="importWxParam.date" :editable="false"
  2160. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  2161. :clearable="true"
  2162. :range-separator="$t('other.to')"
  2163. type="daterange"
  2164. :start-placeholder="$t('time.startDate')"
  2165. :end-placeholder="$t('time.endDate')"
  2166. @change="loadCheckInData"
  2167. ></el-date-picker>
  2168. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  2169. </div>
  2170. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  2171. :key="timeStamp"
  2172. style="width: 100%;margin-top:5px;" ref="tab">
  2173. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  2174. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left">
  2175. <template slot-scope="scope">
  2176. <div>
  2177. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.username'></TranslationOpenDataText></span>
  2178. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.username}}</span>
  2179. </div>
  2180. </template>
  2181. </el-table-column>
  2182. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  2183. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  2184. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  2185. <template slot-scope="scope">
  2186. {{scope.row.workHours.toFixed(1)}}h
  2187. </template>
  2188. </el-table-column>
  2189. <!--项目名称列表 -->
  2190. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  2191. <template slot-scope="scope">
  2192. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  2193. </template>
  2194. </el-table-column>
  2195. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  2196. <template slot-scope="scope">
  2197. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  2198. </template>
  2199. </el-table-column>
  2200. </el-table>
  2201. </el-dialog>
  2202. <!--基于企业微信考勤数据的工时导入 -->
  2203. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  2204. <div style="padding-bottom:10px;">
  2205. <p>{{importResultMsg}}</p>
  2206. </div>
  2207. <!-- <span slot="footer" class="dialog-footer">
  2208. <el-button type="primary" @click="showImportResult=false">关闭</el-button>
  2209. </span> -->
  2210. </el-dialog>
  2211. <!-- 审核流程展示 -->
  2212. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="500px">
  2213. <div style="padding:20px 40px 20px 0">
  2214. <el-steps :active="curAuditNode" align-center="true" finish-status="success" v-if="user.companyId == 7544">
  2215. <el-step title="待提交"></el-step>
  2216. <el-step title="员工提交"></el-step>
  2217. <el-step title="审核通过"></el-step>
  2218. </el-steps>
  2219. <el-divider v-if="user.companyId == 7544"></el-divider>
  2220. <p style="color:#aaaaaa;" v-if="user.companyId == 7544">审核记录</p>
  2221. <el-timeline :reverse="false" style="margin-top:10px;">
  2222. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">
  2223. <!-- {{item.msg}} -->
  2224. <span v-if="user.userNameNeedTranslate != 1">{{item.msg}}</span>
  2225. <span v-if="user.userNameNeedTranslate == 1">
  2226. <span><TranslationOpenDataText type='userName' :openid='item.msgCon.one'></TranslationOpenDataText></span>
  2227. <span>{{item.msgCon.two}}</span>
  2228. </span>
  2229. </el-timeline-item>
  2230. </el-timeline>
  2231. </div>
  2232. </el-dialog>
  2233. <!-- 威派格定制 -->
  2234. <TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
  2235. </section>
  2236. </template>
  2237. <script>
  2238. // 左右滑动
  2239. import dragMixin from "@/common/js/tensile.js";
  2240. import util from "../../common/js/util";
  2241. // 自定义select组件
  2242. import selectCat from "@/components/select.vue"
  2243. // 引入自定义级联组件
  2244. import vueCascader from "@/components/cascader.vue"
  2245. import vueMultipleDept from "@/components/vueMultipleDept.vue"
  2246. // 重庆物奇定制组件
  2247. import WeeklyCustomization from "./weeklyCustomization.vue"
  2248. // 威派格定制转移工时
  2249. import TransferWorkingHours from "./transferWorkingHours.vue"
  2250. // 新的按周填报
  2251. import NewWeeklyCustomization from "./newWeeklyCustomization.vue"
  2252. import { mapMutations } from 'vuex'
  2253. let _that = this
  2254. export default {
  2255. mixins: [dragMixin],
  2256. components: {
  2257. selectCat,
  2258. vueCascader,
  2259. WeeklyCustomization,
  2260. vueMultipleDept,
  2261. TransferWorkingHours,
  2262. NewWeeklyCustomization
  2263. },
  2264. data() {
  2265. return {
  2266. remindering: false,
  2267. onlyHaveAttendance: false,
  2268. notFullData:[],
  2269. notFullOriginList:[],
  2270. singleDate:1,
  2271. subFillProjectList:[],
  2272. curAuditNode: 1,
  2273. refreshingTime: false,
  2274. substitudeStep: 1,
  2275. showHidden: false,
  2276. pageIndex: 0,
  2277. hasMore: true,
  2278. exportType: 0,
  2279. exportingData: false,
  2280. roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
  2281. jobResponseList:[],
  2282. yisibeiCompId: 3092,
  2283. yuzhongCompId: 3385,
  2284. mingyiName : '成都明夷电子科技股份有限公司',
  2285. // mingyiName : '明夷',
  2286. modItemDataId: null,
  2287. modImportTime: null,
  2288. modImportUserId: null,
  2289. showModImportTimeDialog: false,
  2290. showBatchSimpleApproveReport: false,
  2291. startDeleting: false,
  2292. showBatchDeleteReport: false,
  2293. deleteReportParam: {date:null, userIds:[]},
  2294. isDenying: false,
  2295. targetWeekDate: null,//填写周报中的周日期
  2296. importCardTimeVisi: false,
  2297. startRatioExporting: false,
  2298. exportUserRatio: false,
  2299. ratioYmonth:null,
  2300. hasWrittenReport: false,
  2301. today:null,
  2302. syncTimeLoading: false,
  2303. seluserText: '',
  2304. translation: '1', // 1、文字, 2、部门, 3、人员
  2305. exportLoad: false,
  2306. getPickerOptions: {
  2307. disabledDate: (time) => {
  2308. var date = new Date();
  2309. var year = date.getFullYear();
  2310. var month = date.getMonth() + 1;
  2311. if (month >= 1 && month <= 9) {
  2312. month = "0" + month;
  2313. }
  2314. var currentdate = year.toString() + month.toString();
  2315. var timeyear = time.getFullYear();
  2316. var timemonth = time.getMonth() + 1;
  2317. if (timemonth >= 1 && timemonth <= 9) {
  2318. timemonth = "0" + timemonth;
  2319. }
  2320. var timedate = timeyear.toString() + timemonth.toString();
  2321. if(this.user.timeType.fillAhead == 0){
  2322. return currentdate < timedate;
  2323. }else{
  2324. return false
  2325. }
  2326. }
  2327. },
  2328. alalal: '8.0',
  2329. timeBasecostList:null,
  2330. tbload: false,
  2331. exportTimeDialog: false,
  2332. searchKeyword: '',
  2333. monthWorkDataS: [],
  2334. monthNotWorkDateS: [],
  2335. pickDateArray:[],
  2336. WorktimeDatepickValue: [],
  2337. activeName:"first",
  2338. isLeave: 0,
  2339. submitingReport: false,
  2340. importResultMsg:null,
  2341. showImportResult:false,
  2342. importingData: false,
  2343. isDraft: 0,
  2344. timeStamp: 0,
  2345. projectColumns:[],
  2346. checkinLoading:false,
  2347. importWxParam:{date:null,},
  2348. active:0,
  2349. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  2350. importWxDialog:false,
  2351. importDialog:false,
  2352. denyForm:null,
  2353. denyReasonDialog:false,
  2354. monthWorkTimeDialog: false,
  2355. notfullSelectDateMonth:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2356. isSubstitude:false,
  2357. isFill:false,
  2358. unFillList:[],
  2359. fillList:[],
  2360. fillMembList:[],
  2361. fillMembList_leave: [],
  2362. membListVisible: false,
  2363. isBatch:0,//是否是批量填报
  2364. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  2365. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  2366. 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')],
  2367. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  2368. fillStatusList: [],
  2369. exportParam:{projectId: null, dateRange:[], departmentId: null},
  2370. exportReportLogParam:{dateRange:[]},
  2371. exportDialog:false,
  2372. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  2373. subProjectList:[],
  2374. canEdit: true,
  2375. originCanEdit: true,
  2376. 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],
  2377. selectTime:null,
  2378. reportTimeType:{},
  2379. curDate:'',
  2380. isAllSelect: false,
  2381. approveDialogVisible:false,
  2382. deptId:null,
  2383. targetUid: null,
  2384. membCount:0,
  2385. selectState:"-1",
  2386. user: JSON.parse(sessionStorage.getItem("user")),
  2387. allUsersList: [],
  2388. showAddMore:false,
  2389. allDate: [],
  2390. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  2391. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  2392. choseDay: 0,
  2393. tableHeight: 0,
  2394. listLoading: false,
  2395. projectList: [], //项目列表
  2396. fillProjectList: [],
  2397. reportList: [], //日报列表
  2398. reportNames:[], //批量审批列表
  2399. selCon:[], //筛选条件
  2400. selProjectList:[], //筛选后项目列表
  2401. selConShow: true,
  2402. usersList: [], // 全部人员列表
  2403. usersListId: '', // 选中的人员id
  2404. dialogVisible: false, //项目弹窗
  2405. report: '',
  2406. workForm: {
  2407. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  2408. domains: [{
  2409. id: null,
  2410. projectId: "",
  2411. workingTime: "",
  2412. timeType:0,
  2413. content: "",
  2414. state: 2,
  2415. multiWorktime:0,
  2416. worktimeList:[],
  2417. degreeId: null,
  2418. auditUserList: [],
  2419. }],
  2420. showRefresh: false,
  2421. },
  2422. workRules: {
  2423. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  2424. },
  2425. chooseParticipVisible: false,
  2426. logining: false,
  2427. isDisable: false,
  2428. timeType:[],
  2429. deptMembData: [
  2430. ],
  2431. //部门人员树状结构
  2432. data: [
  2433. {
  2434. id: -1,
  2435. label: this.$t('lable.allStaff'),
  2436. membCount:0
  2437. },
  2438. {
  2439. id: 0,
  2440. label: this.$t('lable.unassigned'),
  2441. }
  2442. ],
  2443. allData:{},
  2444. batchShowData:{},
  2445. option: [],
  2446. deptOptionList: [],
  2447. depData: {
  2448. id: -1,
  2449. label: this.$t('lable.allStaff'),
  2450. },
  2451. defaultProps: {
  2452. children: 'children',
  2453. label: 'label'
  2454. },
  2455. isNew: false,
  2456. selected: false,
  2457. valuet: new Date(),
  2458. domObj: null,
  2459. participator:[],
  2460. chosenMembCount:0,
  2461. jsDay: 0,
  2462. jsTime: 0,
  2463. falsss: false,
  2464. weidu: [],
  2465. weiduList: [],
  2466. yonghuUser: [],
  2467. dateAr: [],
  2468. batchSubFillDialog: false,
  2469. isSubstiS: false,
  2470. fillWeekDialogVisi: false,
  2471. fillWeekDialogVisiCustom: false,
  2472. fillWeekDialogVisiCustomTwo: false,
  2473. zhoData: [],
  2474. weekDateRange: [],
  2475. btnZho: false,
  2476. weekDataLoading: false,
  2477. changdu: 6,
  2478. tianxieDialogVisible: false,
  2479. scopess: {},
  2480. zhoBao: {
  2481. time: '',
  2482. workingTime: '',
  2483. progress: '',
  2484. con: '',
  2485. subProjectId: '',
  2486. stage: '',
  2487. subProjectList: [],
  2488. stages: [],
  2489. },
  2490. zhoBaoIdx: '',
  2491. zhoBaoName: '',
  2492. zhis: {},
  2493. dealList: [],
  2494. toViewDialogVisible: false,
  2495. toViewList: [],
  2496. toViewloading: true,
  2497. toViewForm: {
  2498. pageIndex: '1',
  2499. pageSize: '20',
  2500. total: 0,
  2501. },
  2502. toViewloadings: false,
  2503. tabPositionss: 'top',
  2504. monthTotal: 0,
  2505. monthTotalPage: 0,
  2506. monthTotalLages: 20,
  2507. monthWorkData: [],
  2508. monthNotWorkDate: [],
  2509. monthWorkDataS1: [],
  2510. monthnotTotal: 0,
  2511. monthnotTotalPage: 0,
  2512. monthnotTotalLages: 20,
  2513. monthNotWorkDateS1: [],
  2514. deptMembDataText: '',
  2515. isFlag: false,
  2516. isMore: false,
  2517. stateKey: '0',
  2518. expandDate: [],
  2519. notifySelList:[],
  2520. departmentList: [],
  2521. trandepartmentList:[],
  2522. approvalProcessDialog: false,
  2523. approvalProcessData: [],
  2524. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  2525. 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')],
  2526. isWeekend: false,
  2527. canCancelInDialog: false,
  2528. approveinData: {},
  2529. approveinDialog: false,
  2530. reportCanDelete: false,
  2531. weeklyFilledTimeDialog: false,
  2532. weeklyFilledTimeList: [],
  2533. weeklyFilledTimeLoading: false,
  2534. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  2535. weeklyFilledTimeCanDelete: false,
  2536. weeklyFilledTimeDate: null,
  2537. leaveAllNum: 0,
  2538. dataLoading: false,
  2539. zhoBaoSelectableRange: ['09:30 - 12:00'], // 选择时间的可选时间段
  2540. vacationTime: {},
  2541. integrationProjectList: [],
  2542. totalReportHours: 0, // 合计的工时
  2543. workTimeForMinYi:0,
  2544. nodeModelData: localStorage.getItem('nodeModelDataKey') ? JSON.parse(localStorage.getItem('nodeModelDataKey')) : [],
  2545. weekIndex: 1,
  2546. weekParentData: {},
  2547. deptIdForNoReport:[],
  2548. deptIdForReminder:[],
  2549. nameAearch: '', // 企业微信姓名搜索
  2550. deptMembDataBackups: [], // 企业微信备份代填日报的树形结构
  2551. deptMembDataLoading: false,
  2552. reportPictureRequired: [ // 针对填写日报图片必填得公司
  2553. {
  2554. id: 4811,
  2555. // id: 10,
  2556. name: '陕西柘中建设工程有限公司'
  2557. }
  2558. ],
  2559. pushWorkTimeLogDig:false,
  2560. pushWorkTimeLogData:[],
  2561. userReportDeptList: [],
  2562. isReminder:true,
  2563. reportLogCheckDialog:false,
  2564. deptIdForHasReport:[],
  2565. transferWorkingHoursVisable: false,
  2566. multiOptionData:[],
  2567. businessTripsArray: [],
  2568. refreshAttendanceLoading: false,
  2569. customConfigurationRow: {
  2570. subUserCustomList: []
  2571. }
  2572. };
  2573. },
  2574. watch: {
  2575. deptMembDataText(val) {
  2576. this.$refs.chooseMembTree.filter(val);
  2577. }
  2578. },
  2579. filters: {
  2580. // 过滤
  2581. amounts(value) {
  2582. if(value == '*') {
  2583. return '*'
  2584. }
  2585. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  2586. return 0
  2587. }
  2588. var zhi = +value + 0
  2589. return zhi.toFixed(1)
  2590. },
  2591. // zhoData
  2592. zhoData(value, arr) {
  2593. var dateArray = value.split("-");
  2594. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2595. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  2596. // console.log(arr[date.getDay()])
  2597. // return "周" + "日一二三四五六".charAt(date.getDay());
  2598. return arr[date.getDay()]
  2599. },
  2600. // 过滤数字
  2601. numbers(value) {
  2602. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  2603. return 0
  2604. }
  2605. return value
  2606. },
  2607. },
  2608. computed: {},
  2609. mounted() {
  2610. var now = new Date();
  2611. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  2612. this.today = t;
  2613. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  2614. this.exportParam.dateRange = [startStr,t];
  2615. this.exportReportLogParam.dateRange = [startStr,t];
  2616. this.getAllDate(1);
  2617. this.getReportList();
  2618. this.getProjectList();
  2619. this.getFillProjectList();
  2620. this.getTimeType();
  2621. this.getDepartment();
  2622. this.scrollFunction()
  2623. this.userssHu();
  2624. this.getFirstAndLastDay()
  2625. this.getMultiOptionData();
  2626. if(this.user.timeType.reportAuditType == 3){
  2627. this.getAllUsersList()
  2628. }
  2629. if (this.user.company.packageProject == 1) {
  2630. this.getBasecostItemList();
  2631. }
  2632. if(this.user.timeType.userWithMultiDept == 1) {
  2633. this.getDeptMembData();
  2634. }
  2635. if(this.user.timeType.lockWorktime){
  2636. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  2637. }
  2638. //设置了下限
  2639. if (this.user.timeType.minReportTime) {
  2640. this.timeRange = this.timeRange.filter(item => {return item >= this.user.timeType.minReportTime})
  2641. }
  2642. const that = this
  2643. if(this.user.userNameNeedTranslate == 1) {
  2644. that.dataLoading = that.$store.state.dataLoading
  2645. this.upDataLoading()
  2646. setTimeout(()=>{
  2647. that.dataLoading = that.$store.state.dataLoading
  2648. }, 1000)
  2649. }
  2650. if (this.user.companyId == this.yuzhongCompId) {
  2651. this.getJobResponList();
  2652. }
  2653. },
  2654. methods: {
  2655. ...mapMutations(['upDataLoading']),
  2656. // 刷新考勤
  2657. refreshAttendanceCli() {
  2658. const firstDay = this.dayjs(this.date, 'YYYY-MM').startOf('month');
  2659. const lastDay = this.dayjs(this.date, 'YYYY-MM').endOf('month');
  2660. const formData = {
  2661. startDate: firstDay.format('YYYY-MM-DD'),
  2662. endDate: lastDay.format('YYYY-MM-DD')
  2663. }
  2664. this.refreshAttendanceLoading = true;
  2665. this.http.post('/user-fv-time/syncHongHuFvTime',{
  2666. ...formData
  2667. },res => {
  2668. this.refreshAttendanceLoading = false;
  2669. if(res.code == 'ok'){
  2670. this.$message({
  2671. message: `刷新成功!`,
  2672. type: 'success'
  2673. })
  2674. this.showReportTimeLessThanCardTimeList()
  2675. }else {
  2676. this.$message({
  2677. message: res.msg,
  2678. type: 'error'
  2679. })
  2680. }
  2681. },err => {
  2682. this.refreshAttendanceLoading = false;
  2683. this.$message({
  2684. message: err,
  2685. type: 'error'
  2686. })
  2687. })
  2688. },
  2689. // 已填工时情况表设置背景色
  2690. hasworkTblCellStyle({ columnIndex, row, column }) {
  2691. if(columnIndex > 2) {
  2692. const dateSingle = this.pickDateArray[columnIndex - 3].date
  2693. const worktimeList = row.worktimeList || []
  2694. const times = this.reportTimeType.allday
  2695. const filterData = worktimeList.filter(item => item.createDate == dateSingle)
  2696. const isWorkDate = filterData[0] && filterData[0].workingTime;
  2697. const missReport = filterData[0] && filterData[0].missReport;
  2698. const state = filterData[0] && filterData[0].state
  2699. if (missReport) {
  2700. return "backgroundColor: red"
  2701. } else {
  2702. if (state == 0 || state == -1) {
  2703. return "backgroundColor: orange"
  2704. } else if (state == 1) {
  2705. //审核通过
  2706. return "backgroundColor: #32CD32"
  2707. } else if (state == 2) {
  2708. return "backgroundColor: red"
  2709. } else {
  2710. return "backgroundColor: #E0E0E0"
  2711. }
  2712. }
  2713. }
  2714. },
  2715. getMultiOptionData() {
  2716. this.http.post('/company-dict/getAll ',{companyId: this.user.companyId, code: 'multiOption'},
  2717. res => {
  2718. if (res.code == "ok") {
  2719. this.multiOptionData = res.data;
  2720. } else {
  2721. this.$message({
  2722. message: res.msg,
  2723. type: "error"
  2724. });
  2725. }
  2726. },
  2727. error => {
  2728. this.$message({
  2729. message: error,
  2730. type: "error"
  2731. });
  2732. }
  2733. );
  2734. },
  2735. showReportTimeLessThanCardTimeList() {
  2736. this.monthTotalPage = 0,
  2737. this.tbload = true,
  2738. this.http.post(
  2739. "/report/getReportTimeLessThanCardTimeList",
  2740. {
  2741. date: this.notfullSelectDateMonth,
  2742. deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  2743. userId: this.usersListId,
  2744. },
  2745. (res) => {
  2746. if (res.code == "ok") {
  2747. this.tbload = false
  2748. this.notFullData = res.data;
  2749. this.notFullOriginList = res.data;
  2750. }
  2751. },
  2752. (error) => {
  2753. this.tbload = false
  2754. this.$message({
  2755. message: error,
  2756. type: "error",
  2757. });
  2758. }
  2759. );
  2760. },
  2761. //按选择的日期范围刷新考勤
  2762. refreshWXCardTimeByRange() {
  2763. this.refreshingTime = true;
  2764. var param = {
  2765. companyId: this.user.companyId,
  2766. startDate: this.importWxParam.date[0],
  2767. endDate: this.importWxParam.date[1],
  2768. }
  2769. //非管理员只能看到自己的
  2770. if (this.user.roleName.indexOf('管理员') == -1) {
  2771. param.userId = this.user.id;
  2772. }
  2773. this.http.post('/wxcorp/getUserCheckInDayData',param,res => {
  2774. this.refreshingTime = false;
  2775. if(res.code == 'ok'){
  2776. this.loadCheckInData();
  2777. }else {
  2778. this.$message({
  2779. message: res.msg,
  2780. type: 'error'
  2781. })
  2782. }
  2783. },err => {
  2784. this.syncTimeLoading = false;
  2785. this.$message({
  2786. message: err,
  2787. type: 'error'
  2788. })
  2789. })
  2790. },
  2791. // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
  2792. isCustomization(userInfo, permissionArray) {
  2793. const { companyId } = userInfo
  2794. const isReportPictureRequired = permissionArray.some(item => item.id == companyId)
  2795. return isReportPictureRequired
  2796. },
  2797. showHiddenFunction() {
  2798. this.showHidden = true;
  2799. },
  2800. // 获取如何信息选的可填写部门
  2801. getDeptMembData() {
  2802. this.http.post('/user/getUserInfo', {userId: this.user.id}, res => {
  2803. if (res.code == "ok") {
  2804. let lists = res.data.userReportDeptList || []
  2805. const optimizedList = lists.map(item => ({
  2806. ...item,
  2807. label: item.departmentName,
  2808. value: item.departmentId,
  2809. }));
  2810. this.$set(this, 'userReportDeptList', optimizedList || []);
  2811. } else {
  2812. this.$message({
  2813. message: res.msg,
  2814. type: "error"
  2815. });
  2816. }
  2817. },error => { });
  2818. },
  2819. //任务被选中
  2820. onTaskSelected(domainItem) {
  2821. //取服务
  2822. if (domainItem.taskId) {
  2823. var that = this;
  2824. var param = {taskId:domainItem.taskId};
  2825. if (this.isSubstitude) {
  2826. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  2827. param.userId = this.workForm.userId[0];
  2828. }
  2829. }
  2830. this.http.post('/task/getMyTaskService',param, res => {
  2831. if (res.code == "ok") {
  2832. // domainItem.workContentList = res.data;
  2833. that.$set(domainItem, 'sapServiceId', null);
  2834. that.$set(domainItem, 'serviceList', res.data);
  2835. } else {
  2836. this.$message({
  2837. message: res.msg,
  2838. type: "error"
  2839. });
  2840. }
  2841. },error => {
  2842. this.$message({
  2843. message: error,
  2844. type: "error"
  2845. });
  2846. }
  2847. );
  2848. } else {
  2849. //清空服务
  2850. }
  2851. },
  2852. onBatchTimeChange() {
  2853. //反向计算每日工作时长
  2854. if (this.workForm.createDate) {
  2855. let sdate = new Date(this.workForm.createDate[0]);
  2856. let edate = new Date(this.workForm.createDate[1]);
  2857. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  2858. if (days < 0) {
  2859. return;
  2860. }
  2861. this.reportTimeType.allday = (this.jsTime/days).toFixed(1);
  2862. //总时长发生改变,自动按比例计算
  2863. this.workForm.domains.forEach(d=>{
  2864. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2865. });
  2866. }
  2867. },
  2868. //更新工作内容列表
  2869. updateJobContent(domainItem) {
  2870. var that = this;
  2871. this.http.post('/project/getFunWorkContextList',{id:domainItem.extraField2},res => {
  2872. if (res.code == "ok") {
  2873. // domainItem.workContentList = res.data;
  2874. that.$set(domainItem, 'extraField3', null);
  2875. that.$set(domainItem, 'workContentList', res.data);
  2876. } else {
  2877. this.$message({
  2878. message: res.msg,
  2879. type: "error"
  2880. });
  2881. }
  2882. },error => {
  2883. this.$message({
  2884. message: error,
  2885. type: "error"
  2886. });
  2887. }
  2888. );
  2889. },
  2890. updateResponse(domainItem) {
  2891. var that = this;
  2892. var selectPid = domainItem.projectId;
  2893. domainItem.extraField2 = null;
  2894. domainItem.extraField3 = null;
  2895. if (selectPid && domainItem.extraField1) {
  2896. //是否非项目
  2897. var isPublic = domainItem.isPublic;//this.fillProjectList.filter(p=>p.id == selectPid)[0].isPublic;
  2898. 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));
  2899. domainItem.filteredRespList = filteredRespList;
  2900. }
  2901. },
  2902. getJobResponList() {
  2903. this.http.post('/project/getFunctionalDivisionList',{},res => {
  2904. if (res.code == "ok") {
  2905. this.jobResponseList = res.data;
  2906. } else {
  2907. this.$message({
  2908. message: res.msg,
  2909. type: "error"
  2910. });
  2911. }
  2912. },error => {
  2913. this.$message({
  2914. message: error,
  2915. type: "error"
  2916. });
  2917. }
  2918. );
  2919. },
  2920. openModImportTime(row) {
  2921. this.showModImportTimeDialog = true;
  2922. this.modItemDataId = row.id;
  2923. },
  2924. delImportTime(row) {
  2925. let rowId = row.id;
  2926. this.$confirm(this.$t('ninQueDingYaoShanChuGaiTiaoJiLuMa'),this.$t('other.prompts'), {
  2927. confirmButtonText: this.$t('btn.determine'),
  2928. cancelButtonText: this.$t('btn.cancel'),
  2929. type: "warning"
  2930. })
  2931. .then(() => {
  2932. this.http.post('/report-import-log/delete',{
  2933. id: rowId
  2934. },res => {
  2935. if (res.code == "ok") {
  2936. this.$message({
  2937. message: this.$t('message.successfullyDeleted'),
  2938. type: "success"
  2939. });
  2940. this.getToView();
  2941. } else {
  2942. this.$message({
  2943. message: res.msg,
  2944. type: "error"
  2945. });
  2946. }
  2947. },error => {
  2948. this.$message({
  2949. message: error,
  2950. type: "error"
  2951. });
  2952. }
  2953. );
  2954. }).catch(() => {this.startDeleting = false});
  2955. },
  2956. confirmChangeModTime() {
  2957. if (this.modImportTime == null || this.modImportTime.length == 0) {
  2958. this.$message({
  2959. message: this.$t('message.Pleaseselectatime'),
  2960. type: "error"
  2961. });
  2962. return;
  2963. }
  2964. this.http.post('/report-import-log/changeTime',{
  2965. modLogDateTime: this.modImportTime,
  2966. modImportUserId: this.modImportUserId,
  2967. id: this.modItemDataId
  2968. },res => {
  2969. if (res.code == "ok") {
  2970. this.$message({
  2971. message: this.$t('message.modifyTheSuccess'),
  2972. type: "success"
  2973. });
  2974. this.getToView();
  2975. this.showModImportTimeDialog = false;
  2976. } else {
  2977. this.$message({
  2978. message: res.msg,
  2979. type: "error"
  2980. });
  2981. }
  2982. },error => {
  2983. this.$message({
  2984. message: error,
  2985. type: "error"
  2986. });
  2987. }
  2988. );
  2989. },
  2990. confirmBatchApproveReport() {
  2991. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  2992. this.$message({
  2993. message: this.$t('qingXuanZeRiQiFanWei'),
  2994. type: "error"
  2995. });
  2996. return;
  2997. }
  2998. this.$confirm(this.$t('ninQueDingYaoShenHeTongGuoGaiShiJianDuanNeiQuanBuDeRiBaoMa'),this.$t('other.prompts'), {
  2999. confirmButtonText: this.$t('btn.determine'),
  3000. cancelButtonText: this.$t('btn.cancel'),
  3001. type: "warning"
  3002. })
  3003. .then(() => {
  3004. this.startDeleting = true;
  3005. let obj = {
  3006. startDate: this.deleteReportParam.date[0],
  3007. endDate: this.deleteReportParam.date[1]
  3008. }
  3009. if(this.deleteReportParam.departmentId) {
  3010. obj.departmentId = this.deleteReportParam.departmentId[this.deleteReportParam.departmentId.length - 1]
  3011. } else {
  3012. obj.departmentId = null
  3013. }
  3014. this.http.post('/report/batchApproveByDate',obj,res => {
  3015. if (res.code == "ok") {
  3016. this.$message({
  3017. message: this.$t('state.approved'),
  3018. type: "success"
  3019. });
  3020. this.getReportList();
  3021. this.getDepartment();
  3022. this.startDeleting = false;
  3023. } else {
  3024. this.$message({
  3025. message: res.msg,
  3026. type: "error"
  3027. });
  3028. }
  3029. },error => {
  3030. this.$message({
  3031. message: error,
  3032. type: "error"
  3033. });
  3034. }
  3035. );
  3036. }).catch(() => {this.startDeleting = false});
  3037. },
  3038. confirmBatchDelReport() {
  3039. if (this.deleteReportParam.userIds.length == 0 && !this.deleteReportParam.deptId) {
  3040. this.$message({
  3041. message: this.$t('qingXuanZeBuMenHuoRenYuan'),
  3042. type: "error"
  3043. });
  3044. return;
  3045. }
  3046. if (this.deleteReportParam.date == null || this.deleteReportParam.date.length == 0) {
  3047. this.$message({
  3048. message: this.$t('qingXuanZeRiQiFanWei'),
  3049. type: "error"
  3050. });
  3051. return;
  3052. }
  3053. this.$confirm(this.$t('ninQueDingYaoShanChuGaiShiJianDuanNeiDeRiBaoMaShanChuHouJiangBuKeHuiFu'),this.$t('other.prompts'), {
  3054. confirmButtonText: this.$t('btn.determine'),
  3055. cancelButtonText: this.$t('btn.cancel'),
  3056. type: "warning"
  3057. })
  3058. .then(() => {
  3059. this.startDeleting = true;
  3060. this.http.post('/report/batchDelete',{
  3061. userIds: JSON.stringify(this.deleteReportParam.userIds),
  3062. startDate: this.deleteReportParam.date[0],
  3063. endDate: this.deleteReportParam.date[1],
  3064. deptId: this.deleteReportParam.deptId[0]
  3065. },res => {
  3066. if (res.code == "ok") {
  3067. this.$message({
  3068. message: this.$t('message.successfullyDeleted'),
  3069. type: "success"
  3070. });
  3071. this.getReportList();
  3072. this.getDepartment();
  3073. this.startDeleting = false;
  3074. } else {
  3075. this.$message({
  3076. message: res.msg,
  3077. type: "error"
  3078. });
  3079. }
  3080. },error => {
  3081. this.$message({
  3082. message: error,
  3083. type: "error"
  3084. });
  3085. }
  3086. );
  3087. }).catch(() => {this.startDeleting = false});
  3088. },
  3089. getRecentlyProject(userId) {
  3090. this.http.post('/project/nearProject',{userId: userId},res => {
  3091. if(res.code == 'ok'){
  3092. var bottomList = userId == null?this.fillProjectList:this.subFillProjectList;
  3093. let topObj = {
  3094. label: this.$t('zuiJinXuanZeXiangMu'),
  3095. peojectList: res.data
  3096. }
  3097. let botomObj = {
  3098. label: this.$t('other.allProject'),
  3099. peojectList: bottomList
  3100. }
  3101. //最近项目如果在fillProjectList中不存在,需要移除
  3102. topObj.peojectList = topObj.peojectList.filter(top=>bottomList.find(fp=>fp.id==top.id) != null);
  3103. this.integrationProjectList = [topObj, botomObj]
  3104. }else {
  3105. this.$message({
  3106. message: res.msg,
  3107. type: 'error'
  3108. })
  3109. }
  3110. },err => {
  3111. this.$message({
  3112. message: err,
  3113. type: 'error'
  3114. })
  3115. })
  3116. },
  3117. handlePictureCardPreview(file, index) {
  3118. let arr = []
  3119. let imgArr = this.workForm.domains[index].imgListUrl
  3120. for(var i in imgArr) {
  3121. arr.push(imgArr[i].url)
  3122. }
  3123. const $viewer = this.$viewerApi({
  3124. images: arr
  3125. });
  3126. },
  3127. // 图片上传
  3128. addImg(e, index) {
  3129. let formData = new FormData()
  3130. formData.append('multipartFile', e.file)
  3131. this.http.uploadFile('/common/uploadFile', formData,
  3132. res => {
  3133. if (res.code == "ok") {
  3134. this.$message({
  3135. message: this.$t('uploadedsuccessfully'),
  3136. type: "success"
  3137. });
  3138. if(!this.workForm.domains[index].imgList) {
  3139. this.workForm.domains[index].imgList = []
  3140. this.workForm.domains[index].imgListUrl = []
  3141. }
  3142. this.workForm.domains[index].imgList.push(res.data)
  3143. this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
  3144. } else {
  3145. this.$message({message: res.msg,type: "error"});
  3146. }
  3147. },
  3148. error => {this.$message({message: error,type: "error"});
  3149. });
  3150. },
  3151. // 删除图片
  3152. delImg(file,fileList, index) {
  3153. let idx = 0
  3154. for(let i in fileList) {
  3155. if(fileList[i].uid == file.uid) {
  3156. idx = i
  3157. }
  3158. }
  3159. this.workForm.domains[index].imgList.splice(idx, 1)
  3160. this.workForm.domains[index].imgListUrl.splice(idx, 1)
  3161. },
  3162. test(){
  3163. console.log('test',this.workForm.domains);
  3164. },
  3165. getHour(s1, s2) {
  3166. var reDate = /\d{4}-\d{1,2}-\d{1,2} /;
  3167. s1 = new Date((reDate.test(s1) ? s1 : '2018-1-1 ' + s1).replace(/-/g, '/'));
  3168. s2 = new Date((reDate.test(s2) ? s2 : '2018-1-1 ' + s2).replace(/-/g, '/'));
  3169. var ms = s2.getTime() - s1.getTime();
  3170. if (ms < 0) return 0;
  3171. let ma = ms / 1000 / 60 / 60
  3172. return ma; //小时
  3173. },
  3174. refreshDDCardTime(workdate) {
  3175. if (!workdate) return;
  3176. this.syncTimeLoading = true;
  3177. this.http.post('/dingding/refreshUserCardTime',{
  3178. companyId: this.user.companyId,
  3179. userId: this.user.id,
  3180. date: workdate,
  3181. },res => {
  3182. this.syncTimeLoading = false;
  3183. if(res.code == 'ok'){
  3184. if (!res.data) {
  3185. this.$message({
  3186. message: '获取考勤失败',
  3187. type: 'error'
  3188. })
  3189. } else {
  3190. this.workForm.time = res.data;
  3191. }
  3192. }else {
  3193. this.$message({
  3194. message: res.msg,
  3195. type: 'error'
  3196. })
  3197. }
  3198. },err => {
  3199. this.syncTimeLoading = false;
  3200. this.$message({
  3201. message: err,
  3202. type: 'error'
  3203. })
  3204. })
  3205. },
  3206. refreshWXCardTime(workdate) {
  3207. if (!workdate) return;
  3208. this.syncTimeLoading = true;
  3209. this.http.post('/user-corpwx-time/getPunchRecordBySelf',{
  3210. date: workdate,
  3211. },res => {
  3212. this.syncTimeLoading = false;
  3213. if(res.code == 'ok'){
  3214. this.workForm.time = res.data.time;
  3215. }else {
  3216. this.$message({
  3217. message: res.msg,
  3218. type: 'error'
  3219. })
  3220. }
  3221. },err => {
  3222. this.syncTimeLoading = false;
  3223. this.$message({
  3224. message: err,
  3225. type: 'error'
  3226. })
  3227. })
  3228. },
  3229. refreshAttendance(workdate) {
  3230. if (!workdate) return;
  3231. if (this.isSubstitude && this.workForm.userId == null) return;
  3232. this.syncTimeLoading = true;
  3233. var param = {};
  3234. if (this.isBatch) {
  3235. param = {
  3236. startDate: workdate[0],
  3237. endDate: workdate[1],
  3238. userId: this.isSubstitude? this.workForm.userId[0] : this.user.id,
  3239. isBatch: this.isBatch
  3240. }
  3241. } else {
  3242. param = {
  3243. startDate: workdate,
  3244. endDate: workdate,
  3245. userId: this.user.id,
  3246. isBatch: this.isBatch
  3247. }
  3248. }
  3249. this.http.post('/user-fv-time/syncAttendanceForMingYi',param,res => {
  3250. this.syncTimeLoading = false;
  3251. if(res.code == 'ok'){
  3252. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3253. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3254. this.totalReportHours = this.workTimeForMinYi;
  3255. }else {
  3256. this.$message({
  3257. message: res.msg,
  3258. type: 'error'
  3259. })
  3260. }
  3261. },err => {
  3262. this.syncTimeLoading = false;
  3263. this.$message({
  3264. message: err,
  3265. type: 'error'
  3266. })
  3267. })
  3268. },
  3269. refreshBeiSengAttendance(workdate) {
  3270. if (!workdate) return;
  3271. this.syncTimeLoading = true;
  3272. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser',{
  3273. createDate: workdate
  3274. },res => {
  3275. this.syncTimeLoading = false;
  3276. if(res.code == 'ok'){
  3277. this.workForm.time = res.data;
  3278. }else {
  3279. this.$message({
  3280. message: res.msg,
  3281. type: 'error'
  3282. })
  3283. }
  3284. },err => {
  3285. this.syncTimeLoading = false;
  3286. this.$message({
  3287. message: err,
  3288. type: 'error'
  3289. })
  3290. })
  3291. },
  3292. refreshBeiSengAttendanceTwo(workdate) {
  3293. if (!workdate) return;
  3294. this.syncTimeLoading = true;
  3295. this.http.post('/user-fv-time/syncHongHuFvTime',{
  3296. startDate: workdate,
  3297. endDate: workdate,
  3298. userId: this.user.id
  3299. },res => {
  3300. this.syncTimeLoading = false;
  3301. if(res.code == 'ok'){
  3302. this.workForm.time = res.data;
  3303. }else {
  3304. this.$message({
  3305. message: res.msg,
  3306. type: 'error'
  3307. })
  3308. }
  3309. },err => {
  3310. this.syncTimeLoading = false;
  3311. this.$message({
  3312. message: err,
  3313. type: 'error'
  3314. })
  3315. })
  3316. },
  3317. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  3318. this.weeklyFilledTimeDialog = true
  3319. this.weeklyFilledTimeLoading = true
  3320. this.weeklyFilledTimeDate = parameterDate
  3321. this.http.post('/report/getReportList',{
  3322. date: parameterDate,
  3323. userId: this.user.id
  3324. },res => {
  3325. this.weeklyFilledTimeLoading = false
  3326. if(res.code == 'ok'){
  3327. this.weeklyFilledTimeList = res.data[0].data
  3328. let candelete = true
  3329. for(let i in this.weeklyFilledTimeList){
  3330. if(this.weeklyFilledTimeList[i].state < 2){
  3331. candelete = false
  3332. }
  3333. }
  3334. this.weeklyFilledTimeCanDelete = candelete
  3335. }else {
  3336. this.$message({
  3337. message: res.msg,
  3338. type: 'error'
  3339. })
  3340. }
  3341. },err => {
  3342. this.weeklyFilledTimeLoading = false
  3343. this.$message({
  3344. message: err,
  3345. type: 'error'
  3346. })
  3347. })
  3348. },
  3349. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  3350. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3351. confirmButtonText: this.$t('btn.determine'),
  3352. cancelButtonText: this.$t('btn.cancel'),
  3353. type: "warning"
  3354. })
  3355. .then(() => {
  3356. this.http.post('/report/delete',{
  3357. userId: this.user.id,
  3358. date: this.weeklyFilledTimeDate
  3359. },res => {
  3360. if (res.code == "ok") {
  3361. this.$message({
  3362. message: this.$t('message.successfullyDeleted'),
  3363. type: "success"
  3364. });
  3365. this.getWeeklyWorkTime()
  3366. this.getReportList();
  3367. this.getDepartment();
  3368. this.weeklyFilledTimeDialog = false;
  3369. } else {
  3370. this.$message({
  3371. message: res.msg,
  3372. type: "error"
  3373. });
  3374. }
  3375. },error => {
  3376. this.$message({
  3377. message: error,
  3378. type: "error"
  3379. });
  3380. }
  3381. );
  3382. }).catch(() => {});
  3383. },
  3384. getApprovalProcess(item){
  3385. // console.log('this.date',this.choseDate);
  3386. this.http.post('/report-log/get',{
  3387. creatorId: item.id,
  3388. createDate: sessionStorage.msg
  3389. },res => {
  3390. if(res.code == 'ok'){
  3391. this.approvalProcessDialog = true
  3392. if(this.user.userNameNeedTranslate == 1) {
  3393. for(var i in res.data) {
  3394. let obj = {
  3395. one: res.data[i].msg.split('$userName=')[1].split('$')[0],
  3396. two: res.data[i].msg.split('$userName=')[1].split('$')[1],
  3397. }
  3398. res.data[i].msgCon = obj
  3399. }
  3400. }
  3401. this.approvalProcessData = res.data
  3402. }else{
  3403. this.$message({
  3404. message: res.msg,
  3405. type: 'error'
  3406. })
  3407. }
  3408. },err => {
  3409. this.$message({
  3410. message: err,
  3411. type: 'error'
  3412. })
  3413. })
  3414. //获取审批节点状态
  3415. if (this.user.companyId == 7544) {
  3416. this.http.post('/report/getCurAuditNode',{
  3417. userId: item.id,
  3418. date: sessionStorage.msg
  3419. },res => {
  3420. if(res.code == 'ok'){
  3421. this.curAuditNode = res.data
  3422. }else{
  3423. }
  3424. },err => {
  3425. this.$message({
  3426. message: err,
  3427. type: 'error'
  3428. })
  3429. })
  3430. }
  3431. },
  3432. filterNode(value, data) {
  3433. if (!value) return true;
  3434. return data.label.indexOf(value) !== -1;
  3435. },
  3436. triggerCalculateOT(index) {
  3437. var str = this.workForm.domains[index].overtimeHours + ''
  3438. if(str.indexOf('.') != '-1') {
  3439. var s = str.split('.')[0]
  3440. var st = str.split('.')[1]
  3441. var sts = st.split('')
  3442. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  3443. }
  3444. },
  3445. searchScreen(e){
  3446. if(e == 1){
  3447. this.monthNotWorkDateS1 = []
  3448. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  3449. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  3450. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  3451. }
  3452. }
  3453. if (this.monthNotWorkDateS1.length > 50) {
  3454. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  3455. }else{
  3456. this.monthNotWorkDateS = this.monthNotWorkDateS1
  3457. }
  3458. } else if (e == 0) {
  3459. this.monthWorkDataS1 = []
  3460. for (let i = 0; i < this.monthWorkData.length; i++) {
  3461. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  3462. this.monthWorkDataS1.push(this.monthWorkData[i])
  3463. }
  3464. }
  3465. if (this.monthWorkDataS1.length > 50) {
  3466. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  3467. }else{
  3468. this.monthWorkDataS = this.monthWorkDataS1
  3469. }
  3470. } else if (e == 2) {
  3471. this.monthWorkDataS1 = []
  3472. for (let i = 0; i < this.notFullOriginList.length; i++) {
  3473. if(this.notFullOriginList[i].name.indexOf(this.searchKeyword) != -1){
  3474. this.monthWorkDataS1.push(this.notFullOriginList[i])
  3475. }
  3476. }
  3477. if (this.monthWorkDataS1.length > 50) {
  3478. this.notFullData = this.monthWorkDataS1.slice(0,50);
  3479. }else{
  3480. this.notFullData = this.monthWorkDataS1
  3481. }
  3482. }
  3483. },
  3484. addUpload(data) {
  3485. // var zhi = data.fileName.split('.')[0]
  3486. // var sss = zhi + '.xlsx'
  3487. // return
  3488. var filePath = '/upload/' + data.serverName;
  3489. const a = document.createElement('a'); // 创建a标签
  3490. a.setAttribute('download', data.fileName);// download属性
  3491. a.setAttribute('href', filePath);// href链接
  3492. a.click(); //自执行点击事件
  3493. a.remove();
  3494. },
  3495. restrictNumber(targetId) {
  3496. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  3497. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  3498. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  3499. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  3500. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  3501. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  3502. inpu.value = parseFloat(inpu.value);
  3503. }
  3504. },
  3505. //获取项目下的任务分组
  3506. getTaskGroups(domain, index) {
  3507. domain.groupId=null;
  3508. this.http.post('/task-group/listMyJoinGroup',{
  3509. projectId: domain.projectId,
  3510. isSubstitude: this.isSubstitude ? 1 : 0
  3511. },
  3512. res => {
  3513. if (res.code == "ok") {
  3514. this.workForm.domains[index].taskGroups = res.data;
  3515. // if (this.workForm.domains[index].taskGroups.length > 0) {
  3516. // this.workForm.domains[index].groupId = this.workForm.domains[index].taskGroups[0].id;
  3517. // this.getGroupStages(domain, index);
  3518. // }
  3519. const projectIdStr = domain.projectId;
  3520. const businessTripsArray = this.businessTripsArray
  3521. const list = businessTripsArray.filter(item => item.projectId == projectIdStr)
  3522. if(list.length > 0) {
  3523. const obj = res.data.find(item => item.name.indexOf('出差工时') != -1) || {}
  3524. this.workForm.domains[index].groupId = obj.id || ''
  3525. }
  3526. this.$forceUpdate();
  3527. }
  3528. },
  3529. error => {
  3530. this.$message({
  3531. message: error,
  3532. type: "error"
  3533. });
  3534. }
  3535. );
  3536. },
  3537. //下载填报工时占比报表
  3538. downloadProjectRatio() {
  3539. this.exportUserRatio = true;
  3540. // let now = new Date();
  3541. // let month = now.getMonth();//默认看上个月的
  3542. // let monthStr = month<10? ('0'+month): month;
  3543. // this.ratioYmonth = now.getFullYear()+''+monthStr;
  3544. const today = new Date();
  3545. const year = today.getFullYear();
  3546. const month = today.getMonth() + 1;
  3547. let lastMonthYear, lastMonth;
  3548. if (month === 1) {
  3549. lastMonthYear = year - 1;
  3550. lastMonth = 12;
  3551. } else {
  3552. lastMonthYear = year;
  3553. lastMonth = month - 1;
  3554. }
  3555. this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
  3556. },
  3557. confirmDownloadRatio() {
  3558. this.startRatioExporting = true;
  3559. this.http.post('/user-corpwx-time/exportProjectTimeRatio',{
  3560. ymonth: this.ratioYmonth
  3561. },
  3562. res => {
  3563. if (res.code == "ok") {
  3564. this.startRatioExporting = false;
  3565. var filePath = res.data;
  3566. const a = document.createElement('a'); // 创建a标签
  3567. var data = filePath.split("/");
  3568. a.setAttribute('download', data[data.length-1]);// download属性
  3569. a.setAttribute('href', filePath);// href链接
  3570. a.click(); //自执行点击事件
  3571. a.remove();
  3572. } else {
  3573. this.startRatioExporting = false;
  3574. this.$message({
  3575. message: res.msg,
  3576. type: "error"
  3577. });
  3578. }
  3579. },
  3580. error => {
  3581. this.checkinLoading = false;
  3582. this.$message({
  3583. message: error,
  3584. type: "error"
  3585. });
  3586. }
  3587. );
  3588. },
  3589. //下载带企业微信考勤数据的工时统计模板
  3590. downloadCheckInExcel() {
  3591. var param = {
  3592. startDate: this.importWxParam.date[0],
  3593. endDate: this.importWxParam.date[1],
  3594. };
  3595. if (this.user.roleName == '超级管理员' || this.user.roleName == '财务管理员') {
  3596. param.onlySelfData = false;
  3597. }
  3598. this.http.post('/user-corpwx-time/exportCheckInExcel',param,
  3599. res => {
  3600. if (res.code == "ok") {
  3601. var filePath = res.data;
  3602. const a = document.createElement('a'); // 创建a标签
  3603. var data = filePath.split("/");
  3604. a.setAttribute('download', data[data.length-1]);// download属性
  3605. a.setAttribute('href', filePath);// href链接
  3606. a.click(); //自执行点击事件
  3607. a.remove();
  3608. } else {
  3609. this.$message({
  3610. message: res.msg,
  3611. type: "error"
  3612. });
  3613. }
  3614. },
  3615. error => {
  3616. this.checkinLoading = false;
  3617. this.$message({
  3618. message: error,
  3619. type: "error"
  3620. });
  3621. }
  3622. );
  3623. },
  3624. pre() {
  3625. if (this.active == 0) return;
  3626. this.active--;
  3627. },
  3628. next() {
  3629. this.active++;
  3630. },
  3631. triggerTotalTime(index) {
  3632. var item = this.checkinList[index];
  3633. var total = 0.0;
  3634. for (var i=0;i<this.projectColumns.length; i++) {
  3635. var key = this.projectColumns[i];
  3636. if (item[key] != null && item[key] != '') {
  3637. total += parseFloat(item[key]);
  3638. }
  3639. }
  3640. item.totalFillTime = total;
  3641. },
  3642. //提交批量代填的数据
  3643. submitBatchSubFillData() {
  3644. var data = JSON.stringify(this.checkinList);
  3645. this.http.post('/user-corpwx-time/submitProjectTime',{
  3646. json: data,
  3647. projectColumns: JSON.stringify(this.projectColumns)
  3648. },
  3649. res => {
  3650. if (res.code == "ok") {
  3651. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  3652. this.importWxDialog = false;
  3653. }
  3654. },
  3655. error => {
  3656. this.checkinLoading = false;
  3657. this.$message({
  3658. message: error,
  3659. type: "error"
  3660. });
  3661. }
  3662. );
  3663. },
  3664. loadCheckInData() {
  3665. if (this.importWxParam.date == null) {
  3666. this.checkinList = [];
  3667. return;
  3668. }
  3669. this.checkinLoading = true;
  3670. this.http.post('/user-corpwx-time/getMyData',{
  3671. startDate: this.importWxParam.date[0],
  3672. endDate: this.importWxParam.date[1],
  3673. },
  3674. res => {
  3675. if (res.code == "ok") {
  3676. this.checkinLoading = false;
  3677. this.checkinList = res.data.list;
  3678. this.projectColumns = res.data.projects;
  3679. // 自定义表格会导致表格错乱,需重新计算表格
  3680. this.$nextTick(()=>{
  3681. this.$refs.tab.doLayout()
  3682. })
  3683. }
  3684. },
  3685. error => {
  3686. this.checkinLoading = false;
  3687. this.$message({
  3688. message: error,
  3689. type: "error"
  3690. });
  3691. }
  3692. );
  3693. },
  3694. importCardTime(item) {
  3695. //首先判断文件类型
  3696. let str = item.file.name.split(".");
  3697. let format = str[str.length - 1];
  3698. if (format != "xls" && format != "xlsx") {
  3699. this.$message({
  3700. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3701. type: "error"
  3702. });
  3703. } else {
  3704. this.importingData = true;
  3705. let formData = new FormData();
  3706. formData.append("multipartFile", item.file);
  3707. formData.append("companyId", this.user.companyId);
  3708. this.http.uploadFile(this.user.companyId == 7703?'/user-corpwx-time/importZhengBeiAttendance':'/user-corpwx-time/importCardTime', formData,
  3709. res => {
  3710. this.$refs.uploadCardTime.clearFiles();
  3711. this.importingData = false;
  3712. if (res.code == "ok") {
  3713. //换成弹出框,以免有人等了半天回来啥也没看到
  3714. this.$message({
  3715. message: this.$t('daoRuKaoQinShiChangChengGong'),
  3716. type: "success"
  3717. });
  3718. } else {
  3719. this.$message({
  3720. message: res.msg,
  3721. type: "error"
  3722. });
  3723. }
  3724. },
  3725. error => {
  3726. this.$refs.upload.clearFiles();
  3727. this.listLoading = false;
  3728. this.$message({
  3729. message: error,
  3730. type: "error"
  3731. });
  3732. });
  3733. }
  3734. },
  3735. batchImportWxData(item) {
  3736. //首先判断文件类型
  3737. let str = item.file.name.split(".");
  3738. let format = str[str.length - 1];
  3739. if (format != "xls" && format != "xlsx") {
  3740. this.$message({
  3741. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3742. type: "error"
  3743. });
  3744. } else {
  3745. this.importingData = true;
  3746. let formData = new FormData();
  3747. formData.append("file", item.file);
  3748. formData.append("companyId", this.user.companyId);
  3749. formData.append("withCheckIn", 1);
  3750. this.http.uploadFile('/report/importData', formData,
  3751. res => {
  3752. this.$refs.upload.clearFiles();
  3753. this.showImportResult = true;
  3754. this.importingData = false;
  3755. if (res.code == "ok") {
  3756. //换成弹出框,以免有人等了半天回来啥也没看到
  3757. this.importResultMsg = this.$t('chengGongDaoRu') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  3758. this.getReportList();
  3759. this.importWxDialog = false;
  3760. } else {
  3761. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3762. }
  3763. },
  3764. error => {
  3765. this.$refs.upload.clearFiles();
  3766. this.listLoading = false;
  3767. this.$message({
  3768. message: error,
  3769. type: "error"
  3770. });
  3771. });
  3772. }
  3773. },
  3774. batchImportData(item) {
  3775. //首先判断文件类型
  3776. let str = item.file.name.split(".");
  3777. let format = str[str.length - 1];
  3778. if (format != "xls" && format != "xlsx") {
  3779. this.$message({
  3780. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  3781. type: "error"
  3782. });
  3783. } else {
  3784. this.importingData = true;
  3785. let formData = new FormData();
  3786. formData.append("file", item.file);
  3787. formData.append("companyId", this.user.companyId);
  3788. let url = (this.user.timeType.enableNewWeeklyfill == 1 || this.user.companyId==936 || this.user.companyId == 839 || this.user.timeType.importReportAuditNormal == 1)?'/report/importNewData':'/report/importData'
  3789. this.http.uploadFile(url, formData,
  3790. res => {
  3791. this.$refs.upload.clearFiles();
  3792. this.importingData = false;
  3793. this.showImportResult = true;
  3794. if (res.code == "ok") {
  3795. //换成弹出框,以免有人等了半天回来啥也没看到
  3796. this.importResultMsg = this.$t('chengGongDaoRu')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  3797. this.getReportList();
  3798. this.importWXDialog = false;
  3799. } else {
  3800. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  3801. }
  3802. },
  3803. error => {
  3804. this.$refs.upload.clearFiles();
  3805. this.importingData = false;
  3806. this.$message({
  3807. message: error,
  3808. type: "error"
  3809. });
  3810. });
  3811. }
  3812. },
  3813. userssHu() {
  3814. this.http.post('/time-type/getCompanyTimeSetting',{
  3815. companyId: this.user.companyId
  3816. },
  3817. res => {
  3818. if (res.code == "ok") {
  3819. this.yonghuUser = res.data
  3820. }
  3821. },
  3822. error => {
  3823. this.$message({
  3824. message: error,
  3825. type: "error"
  3826. });
  3827. }
  3828. );
  3829. },
  3830. iptBlur(i) {
  3831. if(this.isBatch == 0) {
  3832. return
  3833. }
  3834. var reqParam = {
  3835. startDate: this.workForm.createDate[0],
  3836. endDate: this.workForm.createDate[1]
  3837. };
  3838. if (this.isSubstitude && this.workForm.userId != null && this.workForm.userId.length>0) {
  3839. reqParam.userId = this.workForm.userId[0];
  3840. }
  3841. this.http.post('/report/getWorkDays',reqParam,
  3842. res => {
  3843. if (res.code == "ok") {
  3844. this.jsDay = res.data
  3845. this.chuji(i)
  3846. } else {
  3847. this.$message({
  3848. message: res.msg,
  3849. type: "error"
  3850. });
  3851. }
  3852. },
  3853. error => {
  3854. this.$message({
  3855. message: error,
  3856. type: "error"
  3857. });
  3858. }
  3859. );
  3860. //明夷硬编码获取
  3861. if (this.user.company.companyName == this.mingyiName) {
  3862. this.getWorkTimeForMinYi();
  3863. }
  3864. },
  3865. getWorkTimeForMinYi(){
  3866. if (this.isSubstitude && this.workForm.userId == null) {
  3867. this.$message({
  3868. message: "请先选择代填人员",
  3869. type: "error"
  3870. });
  3871. this.workForm.createDate = null;
  3872. return;
  3873. }
  3874. this.http.post('/user-fv-time/getMinYiWorkHour',{
  3875. startDate: this.workForm.createDate[0],
  3876. endDate: this.workForm.createDate[1],
  3877. userId: this.isSubstitude?this.workForm.userId[0]:this.user.id
  3878. },
  3879. res => {
  3880. if (res.code == "ok") {
  3881. this.workTimeForMinYi = parseFloat(res.data.workHours);
  3882. this.reportTimeType.allday = parseFloat(res.data.avgWorkDayHours);
  3883. this.totalReportHours = this.workTimeForMinYi;
  3884. } else {
  3885. this.$message({
  3886. message: res.msg,
  3887. type: "error"
  3888. });
  3889. this.workForm.createDate = [];
  3890. }
  3891. },
  3892. error => {
  3893. this.$message({
  3894. message: error,
  3895. type: "error"
  3896. });
  3897. }
  3898. );
  3899. },
  3900. chuji(i) {
  3901. if(i == 0) {
  3902. this.seleChn(1)
  3903. } else if(i == 1) {
  3904. this.seleChn(0)
  3905. } else if(i == 2) {
  3906. if(this.workForm.domains[0].multiWorktime > 0) {
  3907. this.iptChangs()
  3908. } else {
  3909. this.iptChang()
  3910. }
  3911. } else if(i == 3) {
  3912. this.seleChn(0)
  3913. }
  3914. },
  3915. seleChn(e,domain) {
  3916. if(e == 1) {
  3917. for(var i in this.workForm.domains) {
  3918. if(this.workForm.domains[i].timeType == 0) {
  3919. this.workForm.domains[i].workingTime = 8
  3920. } else {
  3921. this.workForm.domains[i].workingTime = 4
  3922. }
  3923. }
  3924. }
  3925. var quanbu = 0
  3926. var spl = this.workForm.domains
  3927. var zhi = ''
  3928. for(var i in spl) {
  3929. var sp = +spl[i].workingTime + 0
  3930. zhi = this.jsDay * sp
  3931. quanbu = +quanbu + zhi
  3932. }
  3933. this.jsTime = quanbu
  3934. this.totalReportHours = quanbu
  3935. let worktime = this.jsTime
  3936. // 自动计算加班时长
  3937. if(this.isBatch != 0){
  3938. worktime = this.jsTime / this.jsDay
  3939. }
  3940. if(this.user.timeType.fillOvertime && domain){
  3941. let isover = false
  3942. let alltime = 0
  3943. let allover = 0 //此处alltime同上面的worktime
  3944. for(let d in spl){
  3945. if(spl[d].isOvertime){
  3946. isover = true
  3947. allover += spl[d].overtimeHours*1
  3948. }
  3949. alltime += spl[d].workingTime*1
  3950. }
  3951. if(domain.overtimeHours){
  3952. allover = allover - domain.overtimeHours
  3953. }
  3954. if(worktime*1 > this.user.timeType.allday){
  3955. if(isover){
  3956. if(alltime > (allover + this.user.timeType.allday)){
  3957. this.$set(domain,'isOvertime',true)
  3958. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  3959. }else{
  3960. this.$set(domain,'isOvertime',false)
  3961. this.$set(domain,'overtimeHours',null)
  3962. if(alltime < (allover + this.user.timeType.allday)){
  3963. let overtime = allover + this.user.timeType.allday - alltime
  3964. for(let pi in spl){
  3965. if(spl[pi].overtimeHours){
  3966. if((overtime - spl[pi].overtimeHours*1) > 0){
  3967. overtime = overtime - spl[pi].overtimeHours*1
  3968. this.$set(spl[pi],'isOvertime',false)
  3969. this.$set(spl[pi],'overtimeHours',null)
  3970. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  3971. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  3972. break
  3973. }else{
  3974. this.$set(spl[pi],'isOvertime',false)
  3975. this.$set(spl[pi],'overtimeHours',null)
  3976. break
  3977. }
  3978. }
  3979. }
  3980. }
  3981. }
  3982. }else{
  3983. this.$set(domain,'isOvertime',true)
  3984. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  3985. }
  3986. }else{
  3987. for(let di in spl){
  3988. this.$set(spl[di],'isOvertime',false)
  3989. this.$set(spl[di],'overtimeHours',null)
  3990. }
  3991. }
  3992. }
  3993. },
  3994. iptChang() {
  3995. var sl = this.workForm.domains
  3996. let timeArr = []
  3997. for(var i in sl) {
  3998. if(sl[i].startTime && sl[i].endTime) {
  3999. timeArr.push({startTime: sl[i].startTime, endTime: sl[i].endTime})
  4000. }
  4001. }
  4002. this.getTimeHours(timeArr)
  4003. },
  4004. iptChangs() {
  4005. var sl = this.workForm.domains
  4006. let timeArr = []
  4007. for(var i in sl) {
  4008. for(var j in sl[i].worktimeList){
  4009. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  4010. timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
  4011. }
  4012. }
  4013. }
  4014. this.getTimeHours(timeArr)
  4015. },
  4016. // 调用接口或去数据
  4017. getTimeHours(arr) {
  4018. this.http.post('/report/getHoursByTimeRange',{
  4019. timeJsonStr: JSON.stringify(arr)
  4020. },res => {
  4021. if(res.code === 'ok') {
  4022. this.$set(this, 'totalReportHours', +res.data * this.jsDay)
  4023. } else {
  4024. this.$message({
  4025. message: res.msg,
  4026. type: 'error'
  4027. })
  4028. }
  4029. },err => {
  4030. this.$message({
  4031. message: err,
  4032. type: 'error'
  4033. })
  4034. })
  4035. },
  4036. // 按周填报调用接口计算时间
  4037. async getWeekHoursByTimeRange(timeRange) {
  4038. const url = '/report/getHoursByTimeRange';
  4039. const data = { timeJsonStr: `${JSON.stringify(timeRange)}` };
  4040. var that = this;
  4041. return new Promise((resolve, reject) => {
  4042. this.http.post(url, data, function(res) {
  4043. res.code === 'ok' ? resolve(res.data) : that.$message({message:res.msg,type: 'error'});
  4044. }, function(err) {
  4045. reject(err);
  4046. });
  4047. });
  4048. },
  4049. removeTimeItem(item, index) {
  4050. item.worktimeList.splice(index, 1);
  4051. this.iptChangs()
  4052. },
  4053. //添加工时
  4054. addNewWorktime(index, item) {
  4055. if(item.worktimeList == null ) {
  4056. item.worktimeList = []
  4057. }
  4058. item.worktimeList.push({});
  4059. },
  4060. //复制项目
  4061. copyProject(index) {
  4062. var leftProgress = 10;
  4063. if (this.reportTimeType.type == 3) {
  4064. //计算已经待分配工时比例
  4065. let array = this.workForm.domains;
  4066. let totalProgress = 0;
  4067. for (var i=0;i<array.length; i++) {
  4068. totalProgress += array[i].progress;
  4069. }
  4070. if (totalProgress < 100) {
  4071. leftProgress = 100 - totalProgress;
  4072. }
  4073. }
  4074. var newIndex = index+1;
  4075. var itemDomain = {
  4076. projectId: this.workForm.domains[index].projectId,
  4077. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  4078. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  4079. ),
  4080. content: "",
  4081. progress:leftProgress,
  4082. state:2,//2-表示待提交
  4083. };
  4084. this.workForm.domains.splice(newIndex, 0,itemDomain);
  4085. if (this.reportTimeType.type == 0) {
  4086. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  4087. var length = this.workForm.domains.length;
  4088. if (length == 2) {
  4089. this.showAddMore = false;
  4090. }
  4091. }
  4092. this.selectProject(itemDomain, newIndex);
  4093. },
  4094. pushWorkTime(reportId){
  4095. let url=''
  4096. if(this.user.timeType.syncSap == 1){
  4097. url='/report/pushProjectReportToSap'
  4098. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4099. var pushDate = this.date + day;
  4100. this.$confirm(reportId?this.$t('queRenTuiSongDangQianGongShi'):(this.$t('queRenTuiSong')+pushDate+this.$t('deGongShi')), this.$t('other.prompts'), {
  4101. confirmButtonText: this.$t('btn.determine'),
  4102. cancelButtonText: this.$t('btn.cancel'),
  4103. type: 'info'
  4104. }).then(() => {
  4105. const loading = this.$loading({
  4106. lock: true,
  4107. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4108. spinner: 'el-icon-loading',
  4109. background: 'rgba(0, 0, 0, 0.7)'
  4110. });
  4111. this.http.post(url,{
  4112. pushDate: pushDate,
  4113. reportId: reportId
  4114. },res => {
  4115. loading.close();
  4116. if(res.code == 'ok'){
  4117. this.$message({
  4118. type: 'success',
  4119. message: res.data
  4120. });
  4121. }else{
  4122. this.$message({
  4123. type: 'error',
  4124. message: res.msg
  4125. })
  4126. }
  4127. },err => {
  4128. loading.close();
  4129. this.$message({
  4130. type: 'error',
  4131. message: err
  4132. })
  4133. })
  4134. }).catch(() => {
  4135. });
  4136. }else{
  4137. url='/report/pushReportDataToThird'
  4138. this.$confirm(this.$t('queRenTuiSong')+this.date+this.$t('yueDeGongShi'), this.$t('other.prompts'), {
  4139. confirmButtonText: this.$t('btn.determine'),
  4140. cancelButtonText: this.$t('btn.cancel'),
  4141. type: 'info'
  4142. }).then(() => {
  4143. const loading = this.$loading({
  4144. lock: true,
  4145. text: this.$t('zhengZaiTuiSongZhongQingNaiXinDengDai'),
  4146. spinner: 'el-icon-loading',
  4147. background: 'rgba(0, 0, 0, 0.7)'
  4148. });
  4149. this.http.post(url,{
  4150. yearMonth: this.date
  4151. },res => {
  4152. loading.close();
  4153. if(res.code == 'ok'){
  4154. this.$message({
  4155. type: 'success',
  4156. message: this.$t('tuiSongChengGong')
  4157. });
  4158. }else{
  4159. this.$message({
  4160. type: 'error',
  4161. message: res.msg
  4162. })
  4163. }
  4164. },err => {
  4165. loading.close();
  4166. this.$message({
  4167. type: 'error',
  4168. message: err
  4169. })
  4170. })
  4171. }).catch(() => {
  4172. });
  4173. }
  4174. },
  4175. showWorkTime(){
  4176. this.monthWorkTimeDialog = true;
  4177. this.searchKeyword = ''
  4178. this.WorktimeDatepickValue = this.istoMonth()
  4179. if(this.WorktimeDatepickValue.length == 0){
  4180. let newdate = new Date();
  4181. let nowdate = newdate.toLocaleDateString();
  4182. let getauto = this.getAutoWeekDate(nowdate)
  4183. let nowwd = [getauto[0],getauto[6]]
  4184. this.WorktimeDatepickValue = nowwd
  4185. }
  4186. this.showMonthWorkTime()
  4187. },
  4188. handleClick(t,e){
  4189. if (t.name == "second") {
  4190. this.showMonthNotWorkTime()
  4191. }else if(t.name == "first"){
  4192. this.showMonthWorkTime()
  4193. }else if(t.name == "third"){
  4194. this.showMonthWorkTimeReminder()
  4195. } else if (t.name == "fourth") {
  4196. this.showReportTimeLessThanCardTimeList();
  4197. }
  4198. },
  4199. //导出员工每日填报工时数
  4200. exportMembWorkHours() {
  4201. this.http.post(
  4202. "/report/exportUserDailyWorkTime",
  4203. {
  4204. // month: this.date,
  4205. startDate: this.WorktimeDatepickValue[0],
  4206. endDate: this.WorktimeDatepickValue[1],
  4207. },
  4208. (res) => {
  4209. if (res.code == "ok") {
  4210. let url = res.data;
  4211. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4212. }
  4213. },
  4214. (error) => {
  4215. this.$message({
  4216. message: error,
  4217. type: "error",
  4218. });
  4219. }
  4220. );
  4221. },
  4222. exportMembWorkHoursReminder() {
  4223. this.http.post(
  4224. "/report/exportUserDailyWorkTimeReminder",
  4225. {
  4226. // month: this.date,
  4227. startDate: this.WorktimeDatepickValue[0],
  4228. endDate: this.WorktimeDatepickValue[1],
  4229. },
  4230. (res) => {
  4231. if (res.code == "ok") {
  4232. let url = res.data;
  4233. this.downloadByA('工时异常表.xlsx', url);
  4234. }
  4235. },
  4236. (error) => {
  4237. this.$message({
  4238. message: error,
  4239. type: "error",
  4240. });
  4241. }
  4242. );
  4243. },
  4244. exportMembNotWorkHours() {
  4245. this.http.post(
  4246. "/report/exportNoReportUserList",
  4247. {
  4248. // month: this.date,
  4249. startDate: this.WorktimeDatepickValue[0],
  4250. endDate: this.WorktimeDatepickValue[1],
  4251. onlyHaveAttendance: this.onlyHaveAttendance?1:0
  4252. },
  4253. (res) => {
  4254. if (res.code == "ok") {
  4255. let url = res.data;
  4256. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xlsx', url);
  4257. }
  4258. },
  4259. (error) => {
  4260. this.$message({
  4261. message: error,
  4262. type: "error",
  4263. });
  4264. }
  4265. );
  4266. },
  4267. downloadByA(name, url) {
  4268. const a = document.createElement("a"); // 创建a标签
  4269. a.setAttribute("download", name); // download属性
  4270. a.setAttribute("href", url); // href链接
  4271. a.click(); // 自执行点击事件
  4272. a.remove();
  4273. },
  4274. // 是否本月判断
  4275. istoMonth(){
  4276. let todate = new Date()
  4277. let tomonth = todate.getMonth() + 1
  4278. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  4279. if(this.date == adate){
  4280. return []
  4281. }else{
  4282. let sedate = new Date(this.date)
  4283. let semonth = sedate.getMonth() + 1
  4284. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  4285. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  4286. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  4287. return [sedates1, sedates2]
  4288. }
  4289. },
  4290. showMonthWorkTime() {
  4291. this.monthTotalPage = 0,
  4292. this.tbload = true
  4293. let parameter={
  4294. startDate: this.WorktimeDatepickValue[0],
  4295. endDate: this.WorktimeDatepickValue[1],
  4296. hasReportDeptId:this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
  4297. }
  4298. this.http.post(
  4299. "/report/getUserDailyWorkTime",
  4300. // "/report/getNoReportUserList",
  4301. parameter,
  4302. (res) => {
  4303. if (res.code == "ok") {
  4304. this.tbload = false;
  4305. this.pickDateArray = res.data.days.map(item => {
  4306. return {
  4307. ...item,
  4308. dateStr: item.label.split('/')[0],
  4309. weekStr: item.label.split('/')[1]
  4310. }
  4311. });
  4312. // console.log('dataarray',res.data.days);
  4313. this.monthWorkData = res.data.list;
  4314. // this.monthWorkDataS = this.monthWorkData
  4315. // this.monthWorkDataS1 = res.data.list
  4316. this.monthTotal = res.data.list.length
  4317. if (this.monthWorkData.length > 50) {
  4318. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4319. }else{
  4320. this.monthWorkDataS = this.monthWorkData
  4321. }
  4322. this.searchScreen(0)
  4323. // this.monthWorkDataS = infoList
  4324. // 判断
  4325. // if (this.monthWorkDataS1.length > 0) {
  4326. // setTimeout(() => {
  4327. // this.tableListener()
  4328. // }, 1000);
  4329. // }
  4330. this.$nextTick(function(){
  4331. this.$refs.hasworkTbl.doLayout();
  4332. });
  4333. // this.$forceUpdate()
  4334. }
  4335. },
  4336. (error) => {
  4337. this.tbload = false
  4338. this.$message({
  4339. message: error,
  4340. type: "error",
  4341. });
  4342. }
  4343. );
  4344. },
  4345. showMonthWorkTimeReminder() {
  4346. this.monthTotalPage = 0,
  4347. this.tbload = true
  4348. let parameter={}
  4349. parameter={
  4350. startDate: this.WorktimeDatepickValue[0],
  4351. endDate: this.WorktimeDatepickValue[1],
  4352. deptId:this.deptIdForReminder.length>0?this.deptIdForReminder[this.deptIdForReminder.length-1]:null,
  4353. viewValue:this.isReminder?1:0
  4354. }
  4355. this.http.post(
  4356. "/report/getUserDailyWorkTimeReminder",
  4357. parameter,
  4358. (res) => {
  4359. if (res.code == "ok") {
  4360. this.tbload = false;
  4361. this.monthWorkData = res.data.list;
  4362. this.monthTotal = res.data.list.length
  4363. if (this.monthWorkData.length > 50) {
  4364. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  4365. }else{
  4366. this.monthWorkDataS = this.monthWorkData
  4367. }
  4368. this.searchScreen(0)
  4369. this.$nextTick(function(){
  4370. this.$refs.hasworkTbl.doLayout();
  4371. });
  4372. }
  4373. },
  4374. (error) => {
  4375. this.tbload = false
  4376. this.$message({
  4377. message: error,
  4378. type: "error",
  4379. });
  4380. }
  4381. );
  4382. },
  4383. showMonthNotWorkTime() {
  4384. this.monthTotalPage = 0,
  4385. this.tbload = true,
  4386. this.http.post(
  4387. "/report/getNoReportUserList",
  4388. {
  4389. startDate: this.WorktimeDatepickValue[0],
  4390. endDate: this.WorktimeDatepickValue[1],
  4391. noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
  4392. onlyHaveAttendance:this.onlyHaveAttendance?1:0
  4393. },
  4394. (res) => {
  4395. if (res.code == "ok") {
  4396. this.tbload = false
  4397. this.monthNotWorkDate = res.data;
  4398. this.monthnotTotal = res.data.length
  4399. if (this.monthNotWorkDate.length > 50) {
  4400. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  4401. } else {
  4402. this.monthNotWorkDateS = this.monthNotWorkDate
  4403. }
  4404. this.searchScreen(1)
  4405. this.$nextTick(function(){
  4406. this.$refs.hasworkTbl2.doLayout();
  4407. });
  4408. }
  4409. },
  4410. (error) => {
  4411. this.tbload = false
  4412. this.$message({
  4413. message: error,
  4414. type: "error",
  4415. });
  4416. }
  4417. );
  4418. },
  4419. listScroll(){
  4420. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  4421. this.isMore = true
  4422. setTimeout(()=>{
  4423. this.isMore = false
  4424. },1000)
  4425. }else {
  4426. this.isFlag = true
  4427. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  4428. this.monthWorkDataS = datalist
  4429. setTimeout(()=>{
  4430. this.isFlag = false
  4431. },300)
  4432. }
  4433. },
  4434. notListScroll(){
  4435. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  4436. this.isMore = true
  4437. setTimeout(()=>{
  4438. this.isMore = false
  4439. },1000)
  4440. }else {
  4441. this.isFlag = true
  4442. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  4443. this.monthNotWorkDateS = datalist
  4444. // console.log('length',this.monthNotWorkDateS.length)
  4445. setTimeout(()=>{
  4446. this.isFlag = false
  4447. },300)
  4448. }
  4449. },
  4450. getFirstAndLastDay() {
  4451. // 将选定的月份转换为Date对象
  4452. var monthDate = new Date();
  4453. var year = monthDate.getFullYear();
  4454. var month = monthDate.getMonth();
  4455. // 计算起始日和结束日
  4456. var startDay = new Date(year, month, 1);
  4457. var endDay = new Date(year, month + 1, 0);
  4458. let lastmd = [this.formatDate(startDay),this.formatDate(endDay)]
  4459. this.WorktimeDatepickValueForMonth=lastmd
  4460. },
  4461. formatDate(date) {
  4462. var year = date.getFullYear();
  4463. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  4464. var day = ("0" + date.getDate()).slice(-2);
  4465. return year + "-" + month + "-" + day;
  4466. },
  4467. // 获取默认这zhou日期参数 222
  4468. getLastWeek(e){
  4469. let newdate = new Date()
  4470. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  4471. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  4472. if(e==1){
  4473. this.WorktimeDatepickValue = lastwd
  4474. this.showMonthWorkTime()
  4475. }else if(e==2){
  4476. this.WorktimeDatepickValue = lastwd
  4477. this.showMonthWorkTimeReminder()
  4478. }else{
  4479. this.WorktimeDatepickValue = lastwd
  4480. this.showMonthNotWorkTime()
  4481. }
  4482. },
  4483. getThisWeek(e){
  4484. let newdate = new Date();
  4485. let nowdate = newdate.toLocaleDateString();
  4486. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  4487. if(e==1){
  4488. this.WorktimeDatepickValue = nowwd
  4489. this.showMonthWorkTime()
  4490. }else if(e==2){
  4491. this.WorktimeDatepickValue = nowwd
  4492. this.showMonthWorkTimeReminder()
  4493. }else{
  4494. this.WorktimeDatepickValue = nowwd
  4495. this.showMonthNotWorkTime()
  4496. }
  4497. },
  4498. getDoubleLastWeek(e){
  4499. let newdate = new Date()
  4500. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  4501. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  4502. if(e==1){
  4503. this.WorktimeDatepickValue = nextwd
  4504. this.showMonthWorkTime()
  4505. }else if(e==2){
  4506. this.WorktimeDatepickValue = nextwd
  4507. this.showMonthWorkTimeReminder()
  4508. }else{
  4509. this.WorktimeDatepickValue = nextwd
  4510. this.showMonthNotWorkTime()
  4511. }
  4512. },
  4513. alreadyAllDate(stime,etime){
  4514. let diffdate = new Array();
  4515. let i=0;
  4516. while(stime<=etime){
  4517. let dateArray = stime.split("-");
  4518. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  4519. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  4520. let stimewk = this.weekDay[date.getDay()]
  4521. 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')
  4522. 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])
  4523. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  4524. let stime_ts = new Date(stime).getTime();
  4525. let next_date = stime_ts + (24*60*60*1000);
  4526. let next_dates_y = new Date(next_date).getFullYear()+'-';
  4527. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4528. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4529. stime = next_dates_y+next_dates_m+next_dates_d;
  4530. i++;
  4531. }
  4532. return diffdate
  4533. },
  4534. getAutoWeekDate(e) {
  4535. let dateString = e;
  4536. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  4537. if (dateString.match(dateStringReg)) {
  4538. let presentDate = new Date(dateString),
  4539. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  4540. return Array.from(new Array(7), function (val, index) {
  4541. let formatDate = new Date(
  4542. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  4543. );
  4544. return (
  4545. formatDate.getFullYear() +
  4546. "-" +
  4547. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  4548. "-" +
  4549. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  4550. );
  4551. });
  4552. } else {
  4553. throw new Error(
  4554. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  4555. );
  4556. }
  4557. },
  4558. onProgressChange() {
  4559. this.$forceUpdate();
  4560. },
  4561. showChooseMembTree() {
  4562. this.chosenMembCount = this.participator.length;
  4563. this.chooseParticipVisible = true;
  4564. },
  4565. onTreeItemChange() {
  4566. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4567. var list = chosenList.filter(item=>item.isUser == 1);
  4568. this.chosenMembCount = list.length;
  4569. },
  4570. findUserInTree() {
  4571. if (this.filterName == '') {
  4572. this.deptMembData = this.allMembData;
  4573. } else {
  4574. var list = this.findRecursively(this.filterName, this.allMembData);
  4575. this.deptMembData = list;
  4576. }
  4577. },
  4578. findRecursively(username, list) {
  4579. var filterList = [];
  4580. for (var i=0;i<list.length; i++) {
  4581. if (list[i].isUser == 1) {
  4582. if (list[i].label.indexOf(username) >= 0) {
  4583. //匹配上了
  4584. filterList.push(list[i]);
  4585. }
  4586. } else if (list[i].children != null && list[i].children.length > 0) {
  4587. var subList = this.findRecursively(username, list[i].children);
  4588. if (subList.length > 0) {
  4589. subList.forEach(s=>filterList.push(s));
  4590. }
  4591. }
  4592. }
  4593. return filterList;
  4594. },
  4595. //确定选择参与人
  4596. chooseParticip() {
  4597. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  4598. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  4599. //只能选择一个人进行代填,防止任务有问题
  4600. if (this.chosenMembList.length > 1) {
  4601. this.$message({
  4602. message: this.$t('meiCiJinZhiChiDaiTianYiGeRen'),
  4603. type: "error",
  4604. });
  4605. return;
  4606. }
  4607. this.chooseParticipVisible = false;
  4608. this.workForm.userNames = '';
  4609. this.workForm.userId = [];
  4610. this.participator = [];
  4611. for (var i=0;i<this.chosenMembList.length; i++) {
  4612. this.workForm.userId.push(this.chosenMembList[i].id);
  4613. this.workForm.userNames += this.chosenMembList[i].label+',';
  4614. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  4615. this.participator.push(item);
  4616. }
  4617. if (this.workForm.userNames.length > 0) {
  4618. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  4619. }
  4620. if(this.user.userNameNeedTranslate == 1) {
  4621. if(this.workForm.userNames) {
  4622. this.workForm.userNames = this.workForm.userNames.split(',')
  4623. }
  4624. }
  4625. //加载该人员的可填报项目
  4626. if (this.workForm.userId.length > 0) {
  4627. this.getSubUsersFillProjectList(this.workForm.userId[0]);
  4628. }
  4629. //打通企业微信考勤的情况,获取考勤
  4630. if (this.user.timeType.showCorpwxCardtime) {
  4631. this.getTargetUserCardTime();
  4632. }
  4633. },
  4634. getTargetUserCardTime() {
  4635. if (this.workForm.createDate && this.workForm.userId && this.workForm.userId.length > 0) {
  4636. this.http.post('/user-corpwx-time/getUserCardTime',{
  4637. userId: this.workForm.userId[0], date: this.workForm.createDate,
  4638. },
  4639. res => {
  4640. if (res.code == "ok") {
  4641. this.$set(this.workForm,'time', res.data);
  4642. }
  4643. },
  4644. error => {
  4645. this.$message({
  4646. message: error,
  4647. type: "error"
  4648. });
  4649. }
  4650. );
  4651. }
  4652. },
  4653. notifySel(sel){
  4654. // console.log(sel);
  4655. this.notifySelList = sel
  4656. },
  4657. //微信通知人员填写
  4658. Notify(code) {
  4659. if (this.notifySelList.length == 0) return;
  4660. var ids = '';
  4661. this.notifySelList.forEach(f=>{
  4662. ids += f.id+',';
  4663. })
  4664. this.http.post('/user/pushFillReport',{
  4665. ids: ids, date: this.curDate,
  4666. code: code
  4667. },
  4668. res => {
  4669. if (res.code == "ok") {
  4670. this.$message({
  4671. message: this.$t('message.sentSuccessfully'),
  4672. type: "success"
  4673. });
  4674. }
  4675. },
  4676. error => {
  4677. this.$message({
  4678. message: error,
  4679. type: "error"
  4680. });
  4681. }
  4682. );
  4683. },
  4684. //导出人员列表
  4685. exportMemb() {
  4686. if (this.fillMembList.length == 0) return;
  4687. var ids = '';
  4688. this.fillMembList.forEach(f=>{
  4689. ids += f.id+',';
  4690. })
  4691. this.http.post('/user/exportMembList',{
  4692. ids: ids,isFill: this.isFill, date: this.curDate
  4693. },
  4694. res => {
  4695. if (res.code == "ok") {
  4696. var aTag = document.createElement('a');
  4697. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  4698. aTag.href = res.data;
  4699. aTag.click();
  4700. }
  4701. },
  4702. error => {
  4703. this.$message({
  4704. message: error,
  4705. type: "error"
  4706. });
  4707. }
  4708. );
  4709. },
  4710. showMembList(fill) {
  4711. this.membListVisible = true;
  4712. if (fill == 0) {
  4713. this.fillMembList = this.unFillList;
  4714. this.isFill = false;
  4715. let leaveList = []
  4716. let unleaveList = []
  4717. for(let i in this.fillMembList){
  4718. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  4719. leaveList.push(this.fillMembList[i])
  4720. }else{
  4721. unleaveList.push(this.fillMembList[i])
  4722. }
  4723. }
  4724. this.fillMembList = unleaveList
  4725. this.fillMembList_leave = leaveList
  4726. } else if(fill == 1){
  4727. this.fillMembList = this.fillList.filter(item => item.state != 3);
  4728. this.isFill = true;
  4729. }else{
  4730. this.fillMembList = this.fillList.filter(item => item.state == 3);
  4731. this.isFill = true;
  4732. }
  4733. },
  4734. //获取自己填写的日报状态
  4735. getReportFillStatus() {
  4736. this.http.post('/report/getReportFillStatus',{
  4737. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  4738. },
  4739. res => {
  4740. if (res.code == "ok") {
  4741. this.fillStatusList = res.data;
  4742. this.allDate.forEach(d=>{
  4743. var fillInfo = null;
  4744. d.state = null;
  4745. this.fillStatusList.forEach(s=>{
  4746. var d1 = s.createDate.split('-')[2];
  4747. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  4748. if (d1.indexOf('0') == 0) {
  4749. d1 = d1.substring(1,d1.length);
  4750. }
  4751. if (d1 == d2) {
  4752. d.state = s.state;
  4753. d.missReport = s.missReport;//是否漏填
  4754. d.exceedCardTime = s.exceedCardTime
  4755. }
  4756. })
  4757. })
  4758. this.$forceUpdate();
  4759. }
  4760. },
  4761. error => {
  4762. this.$message({
  4763. message: error,
  4764. type: "error"
  4765. });
  4766. }
  4767. );
  4768. },
  4769. scrollFunction () {
  4770. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  4771. if (this.domObj.attachEvent) { // IE
  4772. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  4773. } else if (this.domObj.addEventListener) {
  4774. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  4775. }
  4776. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  4777. },
  4778. mouseScroll(event) { // google 浏览器下
  4779. let detail = event.wheelDelta || event.detail
  4780. let moveForwardStep = -1
  4781. let moveBackStep = 1
  4782. let step = 0
  4783. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  4784. event.preventDefault() // 阻止浏览器默认事件
  4785. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  4786. },
  4787. // //左右滚动
  4788. // wheel(e){
  4789. // var a = document.getElementById("dateScroll");
  4790. // var scroll_width = 80; //滚动一下的距离
  4791. // var e = e || window.event, v;
  4792. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  4793. // if(v>3||-v>3) v=-v;
  4794. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  4795. // e.preventDefault(); //阻止浏览器的默认滚动
  4796. // },
  4797. showExportDialog() {
  4798. this.exportType = 0
  4799. this.exportDialog = true;
  4800. this.getCustomConfigurationItems()
  4801. },
  4802. showExportTimeDialog() {
  4803. this.exportTimeDialog = true;
  4804. },
  4805. changeAllTime() {
  4806. //总时长发生改变,自动按比例计算
  4807. this.workForm.domains.forEach(d=>{
  4808. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  4809. });
  4810. //计算jsTime
  4811. if (this.workForm.createDate) {
  4812. let sdate = new Date(this.workForm.createDate[0]);
  4813. let edate = new Date(this.workForm.createDate[1]);
  4814. let days = (edate.getTime() - sdate.getTime())/(24*3600*1000) + 1;
  4815. if (days < 0) {
  4816. days = 0;
  4817. }
  4818. this.jsTime = this.reportTimeType.allday * days;
  4819. }
  4820. },
  4821. // 是否加班的单机事件
  4822. check() {
  4823. this.selected = !this.selected
  4824. this.isNew = this.selected
  4825. },
  4826. updateSubProject() {
  4827. this.$forceUpdate();
  4828. },
  4829. selectDegreeId(domain, index) {
  4830. this.http.post('/report/defaultDegree',{
  4831. projectId: domain.projectId
  4832. },
  4833. res => {
  4834. if (res.code == "ok") {
  4835. if(res.data) {
  4836. this.workForm.domains[index].degreeId = res.data.id + ''
  4837. this.$forceUpdate();
  4838. }
  4839. }
  4840. },
  4841. error => {
  4842. this.$message({
  4843. message: error,
  4844. type: "error"
  4845. });
  4846. }
  4847. );
  4848. },
  4849. //项目选中了, 加载子项目
  4850. selectProject(domain, index) {
  4851. if(!domain.projectId){
  4852. return;
  4853. }
  4854. // 默认选中上次填写的自定义维度
  4855. if(this.yonghuUser.customDegreeActive == 1) {
  4856. this.selectDegreeId(domain, index)
  4857. }
  4858. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  4859. domain.isPublic = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].isPublic;
  4860. this.http.post('/sub-project/list',{
  4861. projectId: domain.projectId,
  4862. isReport: true
  4863. },
  4864. res => {
  4865. //清空之前选中的子项目
  4866. // this.workForm.domains[index].subProjectId = 0;
  4867. if (res.code == "ok") {
  4868. this.workForm.domains[index].subProjectList = res.data;
  4869. this.workForm.domains[index].subProjectId = null;
  4870. this.$forceUpdate();
  4871. }
  4872. },
  4873. error => {
  4874. this.$message({
  4875. message: error,
  4876. type: "error"
  4877. });
  4878. }
  4879. );
  4880. //项目相关的近期任务
  4881. if (this.user.company.packageProject == 1) {
  4882. this.getRecentTaskList(domain, index);
  4883. //获取项目相关专业
  4884. if (this.user.company.packageEngineering == 1) {
  4885. this.getProjectProfessions(domain, index);
  4886. }
  4887. //获取项目下的任务分组
  4888. this.getTaskGroups(domain, index);
  4889. }
  4890. // 获取项目相关的维度
  4891. // domain.degreeId = null
  4892. this.$set(domain,'degreeId',null)
  4893. this.$set(domain,'multiDegrIdArray',null)
  4894. this.dimension(domain, index);
  4895. //获取项目审核人
  4896. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  4897. this.getProjectAuditorList(domain, index);
  4898. } else {
  4899. //按分组的负责人来审核
  4900. domain.projectAuditorId = null;
  4901. domain.projectAuditorName = null;
  4902. domain.auditUserList = null;
  4903. }
  4904. if (this.reportTimeType.type == 3) {
  4905. //新增项目时,自动计算
  4906. domain.workingTime = (this.reportTimeType.allday * domain.progress/100).toFixed(1);
  4907. }
  4908. //加载昱众的工作职责
  4909. if (this.user.companyId == this.yuzhongCompId) {
  4910. this.updateResponse(domain);
  4911. }
  4912. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  4913. if(reportExtraField4Name || reportExtraField5Name) {
  4914. this.getInfoByProjectId(domain, index)
  4915. }
  4916. },
  4917. getInfoByProjectId(domain, index, flag = true) {
  4918. const { projectId } = domain
  4919. const projectList = this.fillProjectList || this.subFillProjectList
  4920. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  4921. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  4922. projectId: projectCode,
  4923. date: this.isBatch == 0 ? this.workForm.createDate : this.workForm.createDate[1]
  4924. },
  4925. res => {
  4926. if (res.code == "ok") {
  4927. if(flag) {
  4928. this.workForm.domains[index].extraField4 = ''
  4929. this.workForm.domains[index].extraField5 = ''
  4930. }
  4931. if((res.data.orderIds || []).length > 0) {
  4932. this.workForm.domains[index].extraField4 = res.data.orderIds[0]
  4933. }
  4934. this.workForm.domains[index].reportExtraField4List = res.data.orderIds || []
  4935. this.workForm.domains[index].reportExtraField5List = res.data.lines || []
  4936. this.$forceUpdate();
  4937. }
  4938. },
  4939. error => {
  4940. this.$message({
  4941. message: error,
  4942. type: "error"
  4943. });
  4944. }
  4945. );
  4946. },
  4947. getRecentTaskList(domain, index) {
  4948. //刷新任务时,清空服务
  4949. this.$set(domain, 'sapServiceId', null);
  4950. this.$set(domain, 'taskId', null);
  4951. var param = {
  4952. projectId: domain.projectId,
  4953. isSubstitude:this.isSubstitude?1:0,
  4954. };
  4955. if (domain.groupId) {
  4956. param.groupId = domain.groupId;
  4957. }
  4958. if (domain.stage) {
  4959. param.stage = domain.stage;
  4960. }
  4961. //专业版代填,获取代填员工的任务
  4962. if (this.user.company.packageProject==1 && this.isSubstitude) {
  4963. if (!this.workForm.userId || this.workForm.userId.length == 0) {
  4964. this.$message({
  4965. message: this.$t('qingXuanZeDaiTianDeYuanGong'),
  4966. type: "error"
  4967. });
  4968. return;
  4969. } else {
  4970. param.userId = this.workForm.userId[0];
  4971. }
  4972. }
  4973. this.http.post('/task/getRecentTask',param,
  4974. res => {
  4975. if (res.code == "ok") {
  4976. this.workForm.domains[index].allTaskList = res.data;
  4977. this.workForm.domains[index].taskList = res.data;
  4978. this.$forceUpdate();
  4979. }
  4980. },
  4981. error => {
  4982. this.$message({
  4983. message: error,
  4984. type: "error"
  4985. });
  4986. }
  4987. );
  4988. },
  4989. //获取项目审核人
  4990. getProjectAuditorList(domainItem, index) {
  4991. if(domainItem.projectId == '') {
  4992. return
  4993. }
  4994. domainItem.projectAuditorId = null;
  4995. domainItem.projectAuditorName = null;
  4996. var param = { projectId: domainItem.projectId};
  4997. if (this.isSubstitude) {
  4998. if (this.workForm.userId != null && this.workForm.userId.length>0) {
  4999. param.userId = this.workForm.userId[0];
  5000. }
  5001. }
  5002. this.http.post('/project-auditor/getList',param,
  5003. res => {
  5004. if (res.code == "ok") {
  5005. domainItem.auditUserList = res.data;
  5006. if (res.data.length==0) {
  5007. this.$message({
  5008. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  5009. type: "error"
  5010. });
  5011. } else if (res.data.length==1) {
  5012. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  5013. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  5014. }
  5015. this.$forceUpdate();
  5016. }
  5017. },
  5018. error => {
  5019. this.$message({
  5020. message: error,
  5021. type: "error"
  5022. });
  5023. }
  5024. );
  5025. },
  5026. // 获取维度数据
  5027. dimension(domain, index) {
  5028. if(domain.projectId == '') {
  5029. return
  5030. }
  5031. this.http.post('/project/getDegreeList',{
  5032. projectId: domain.projectId,
  5033. },
  5034. res => {
  5035. if (res.code == "ok") {
  5036. // console.log("维度数据",res.data);
  5037. this.workForm.domains[index].wuduList = res.data
  5038. // this.workForm = this.workForm
  5039. this.$forceUpdate()
  5040. }
  5041. },
  5042. error => {
  5043. this.$message({
  5044. message: error,
  5045. type: "error"
  5046. });
  5047. }
  5048. );
  5049. },
  5050. //切换任务阶段
  5051. changeStages(domain, index) {
  5052. if (domain.stage == null || domain.stage == '') {
  5053. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  5054. } else {
  5055. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  5056. }
  5057. this.getRecentTaskList(domain, index);
  5058. this.$forceUpdate();
  5059. },
  5060. getGroupStages(domain, index, keepStage) {
  5061. if(this.user.companyId == '7536') {
  5062. const taskGroupsList = domain.taskGroups
  5063. const groupId = domain.groupId
  5064. const taskGroupRow = taskGroupsList.find(item => item.id == groupId)
  5065. if(groupId && taskGroupRow.name.indexOf('出差工时') != '-1') {
  5066. domain.extraField4 = ''
  5067. domain.extraField5 = ''
  5068. }
  5069. }
  5070. console.log(domain);
  5071. if(!domain.groupId){
  5072. domain.projectAuditorId = ''
  5073. domain.stages = []
  5074. if(this.user.companyId == '3092') { // 针对 公司id为3092的公司清空任务分组时一起清空任务和服务
  5075. domain.taskId = ''
  5076. domain.sapServiceId = ''
  5077. }
  5078. if(this.user.timeType.reportAuditType >= 1){
  5079. domain.auditUserList = []
  5080. }
  5081. this.$forceUpdate();
  5082. return
  5083. }
  5084. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  5085. res => {
  5086. if (res.code == "ok") {
  5087. if (!keepStage) {
  5088. domain.stage = '';
  5089. }
  5090. domain.stages = res.data;
  5091. this.getRecentTaskList(domain, index);
  5092. this.$forceUpdate();
  5093. }
  5094. },
  5095. error => {
  5096. this.$message({
  5097. message: error,
  5098. type: "error"
  5099. });
  5100. });
  5101. //检查当前的项目是否需要获取分组的负责人
  5102. if (this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9) {
  5103. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  5104. res => {
  5105. if (res.code == "ok") {
  5106. domain.getProjectAuditorList = res.data;
  5107. domain.auditUserList = res.data;
  5108. if (res.data.length==1) {
  5109. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  5110. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  5111. } else if (res.data.length==0) {
  5112. domain.projectAuditorId = null;
  5113. domain.projectAuditorName = null;
  5114. }
  5115. this.$forceUpdate();
  5116. }
  5117. },
  5118. error => {
  5119. this.$message({
  5120. message: error,
  5121. type: "error"
  5122. });
  5123. });
  5124. }
  5125. },
  5126. getProjectProfessions(domain, index) {
  5127. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  5128. res => {
  5129. if (res.code == "ok") {
  5130. this.workForm.domains[index].professionProgress = res.data;
  5131. this.$forceUpdate();
  5132. }
  5133. },
  5134. error => {
  5135. this.$message({
  5136. message: error,
  5137. type: "error"
  5138. });
  5139. });
  5140. },
  5141. //删除自己的日报
  5142. deleteReport() {
  5143. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5144. confirmButtonText: this.$t('btn.determine'),
  5145. cancelButtonText: this.$t('btn.cancel'),
  5146. type: "warning"
  5147. })
  5148. .then(() => {
  5149. this.listLoading = true;
  5150. this.http.post('/report/delete',{
  5151. userId: this.user.id,
  5152. date: this.workForm.createDate
  5153. },
  5154. res => {
  5155. this.listLoading = false;
  5156. if (res.code == "ok") {
  5157. this.$message({
  5158. message: this.$t('message.successfullyDeleted'),
  5159. type: "success"
  5160. });
  5161. this.getReportList();
  5162. this.getDepartment();
  5163. this.dialogVisible = false;
  5164. } else {
  5165. this.$message({
  5166. message: res.msg,
  5167. type: "error"
  5168. });
  5169. }
  5170. },
  5171. error => {
  5172. this.listLoading = false;
  5173. this.$message({
  5174. message: error,
  5175. type: "error"
  5176. });
  5177. }
  5178. );
  5179. })
  5180. .catch(() => {});
  5181. },
  5182. // 管理员删除日报
  5183. guanli(item) {
  5184. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5185. let param = {date: this.date + day, userId: item.id};
  5186. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  5187. confirmButtonText: this.$t('btn.determine'),
  5188. cancelButtonText: this.$t('btn.cancel'),
  5189. type: "warning"
  5190. })
  5191. .then(() => {
  5192. this.listLoading = true;
  5193. this.http.post('/report/delete',param,
  5194. res => {
  5195. this.listLoading = false;
  5196. if (res.code == "ok") {
  5197. this.$message({
  5198. message: this.$t('message.successfullyDeleted'),
  5199. type: "success"
  5200. });
  5201. this.getReportList();
  5202. this.getDepartment();
  5203. this.dialogVisible = false;
  5204. } else {
  5205. this.$message({
  5206. message: res.msg,
  5207. type: "error"
  5208. });
  5209. }
  5210. },
  5211. error => {
  5212. this.listLoading = false;
  5213. this.$message({
  5214. message: error,
  5215. type: "error"
  5216. });
  5217. }
  5218. );
  5219. })
  5220. .catch(() => {});
  5221. },
  5222. selectAll() {
  5223. if (this.isAllSelect) {
  5224. var keys = [];
  5225. this.reportNames.forEach(b=>{
  5226. keys.push(b.id);
  5227. })
  5228. this.$refs.approveTree.setCheckedKeys(keys);
  5229. } else {
  5230. this.$refs.approveTree.setCheckedKeys([]);
  5231. }
  5232. },
  5233. removeEmptyNode(list) {
  5234. for (var i=0;i<list.length;i++) {
  5235. var cnt = 0;
  5236. if (list[i].membCount == 0) {
  5237. list.splice(i, 1);
  5238. i--;
  5239. } else if (list[i].children != null) {
  5240. this.removeEmptyNode(list[i].children);
  5241. }
  5242. }
  5243. },
  5244. calculateMembCount(list) {
  5245. for (var i in list) {
  5246. var cnt = 0;
  5247. if (list[i].children != null) {
  5248. this.calculateMembCount(list[i].children);
  5249. for (var m in list[i].children) {
  5250. cnt += list[i].children[m].membCount;
  5251. }
  5252. }
  5253. if (list[i].isUser == 1) {
  5254. cnt++;
  5255. this.membCount++;
  5256. }
  5257. list[i].membCount = cnt;
  5258. }
  5259. },
  5260. stateChange() {
  5261. // console.log(this.allData,'alldate');
  5262. this.membCount = 0;
  5263. if (this.selectState == -1) {
  5264. //全部状态
  5265. this.data = this.allData;
  5266. } else {
  5267. //未填报
  5268. this.seluserText = ''
  5269. var newData = JSON.parse(JSON.stringify(this.allData));
  5270. this.filterState(this.selectState, newData);
  5271. this.data = newData;
  5272. }
  5273. this.calculateMembCount(this.data);
  5274. this.data[0].membCount = this.membCount;//总人数
  5275. },
  5276. //按状态过滤部门人员
  5277. filterState(state, list) {
  5278. for (var i =0;i<list.length; i++) {
  5279. var obj = list[i];
  5280. if (obj.isUser == 1) {
  5281. var match = false;
  5282. if (state == -2) {
  5283. if (obj.state == null) {
  5284. match = true;
  5285. }
  5286. } else {
  5287. if (obj.state == state) {
  5288. match = true;
  5289. }
  5290. }
  5291. if (!match) {
  5292. list.splice(i, 1);
  5293. i--;
  5294. } else {
  5295. }
  5296. } else {
  5297. if (obj.children != null) {
  5298. this.filterState(state, obj.children);
  5299. }
  5300. }
  5301. }
  5302. },
  5303. //a按名称过滤部门人员
  5304. async seluserforText(){
  5305. const { userNameNeedTranslate } = this.user
  5306. this.membCount = 0;
  5307. var newData = JSON.parse(JSON.stringify(this.allData));
  5308. let textList = [this.seluserText]
  5309. if(userNameNeedTranslate == 1) {
  5310. this.dataLoading = true
  5311. let res = await this.postData('/user/getEmployeeList', {
  5312. keyword: this.seluserText,
  5313. cursor: '',
  5314. departmentId: -1,
  5315. pageIndex: 1,
  5316. pageSize: 1000
  5317. })
  5318. textList = res.data.records.map(item => item.name)
  5319. this.dataLoading = false
  5320. }
  5321. // return
  5322. this.seluserforTextin(this.seluserText, newData, textList)
  5323. this.data = newData;
  5324. this.calculateMembCount(this.data);
  5325. this.data[0].membCount = this.membCount;//总人数
  5326. },
  5327. seluserforTextin(text, list, textList = []){
  5328. for (var i =0;i<list.length; i++) {
  5329. var obj = list[i];
  5330. if (obj.isUser == 1) {
  5331. var match = false;
  5332. // if (obj.label.indexOf(text) != -1) {
  5333. // match = true
  5334. // }
  5335. if(textList.some(item => item.includes(obj.label))) {
  5336. match = true
  5337. }
  5338. if (!match) {
  5339. list.splice(i, 1);
  5340. i--;
  5341. } else {
  5342. }
  5343. } else {
  5344. if (obj.children != null) {
  5345. this.seluserforTextin(text, obj.children, textList);
  5346. }
  5347. }
  5348. }
  5349. },
  5350. // 当节点发生变化时
  5351. nodeChangeExpand(data) {
  5352. // 保存当前展开的节点
  5353. let flag = false
  5354. this.nodeModelData.some(item => {
  5355. if (item === data.id) { // 判断当前节点是否存在, 存在不做处理
  5356. flag = true
  5357. return true
  5358. }
  5359. })
  5360. if (!flag) { // 不存在则存到数组里
  5361. this.nodeModelData.push(data.id)
  5362. }
  5363. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5364. },
  5365. nodeChangeCollapse(data) {
  5366. this.nodeModelData.some((item, i) => {
  5367. if (item === data.id) {
  5368. this.nodeModelData.length = i
  5369. }
  5370. })
  5371. localStorage.setItem('nodeModelDataKey', JSON.stringify(this.nodeModelData))
  5372. },
  5373. // 部门列表点击
  5374. handleNodeClick(data) {
  5375. // this.dealList = data
  5376. this.theValues(data.id, this.allData)
  5377. // this.depData = data;
  5378. var list = [];
  5379. if (data.id == -1) {
  5380. this.deptId = null;
  5381. this.targetUid = null;
  5382. list = this.data;
  5383. } else if (data.isUser == 1) {
  5384. this.deptId = null;
  5385. this.targetUid = data.id;
  5386. } else {
  5387. this.deptId = data.id;
  5388. this.targetUid = null;
  5389. list.push(data);
  5390. }
  5391. this.getReportList();
  5392. if (list.length > 0) {
  5393. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  5394. this.fillList = this.getUserMembListFromDeptList(list, 1)
  5395. }
  5396. },
  5397. exportPushLog(){
  5398. this.http.post('/sap-sync-log/export',{},
  5399. res => {
  5400. if (res.code == "ok") {
  5401. var filePath = res.data;
  5402. var fName = '推送日志.xlsx'
  5403. const a = document.createElement('a'); // 创建a标签
  5404. a.setAttribute('download', fName);// download属性
  5405. a.setAttribute('href', filePath);// href链接
  5406. a.click(); //自执行点击事件
  5407. a.remove();
  5408. } else {
  5409. this.$message({
  5410. message: res.msg,
  5411. type: "error"
  5412. });
  5413. }
  5414. },
  5415. error => {
  5416. this.$message({
  5417. message: error,
  5418. type: "error"
  5419. });
  5420. });
  5421. },
  5422. theValues(id, item) {
  5423. for(var i in item) {
  5424. if(item[i].id == id) {
  5425. this.depData = item[i]
  5426. if(id == '-1') {
  5427. this.translation = '1'
  5428. } else {
  5429. if(item[i].children) {
  5430. this.translation = '2'
  5431. } else {
  5432. this.translation = '3'
  5433. }
  5434. }
  5435. return
  5436. } else {
  5437. if(item[i].children) {
  5438. this.theValues(id, item[i].children)
  5439. }
  5440. }
  5441. }
  5442. },
  5443. //获取可以选择的代填的人员列表
  5444. getSubstitudeUserDeptList() {
  5445. if (this.deptMembData.length == 0) {
  5446. this.http.post("/department/listMyMembs", {includeInactiveUser: 1},
  5447. res => {
  5448. if (res.code == "ok") {
  5449. let noAllData = JSON.parse(JSON.stringify(res.data));
  5450. if (noAllData.length > 0) {
  5451. // if (noAllData[0].label == '全部人员') {
  5452. if (noAllData[0].label == this.$t('lable.allStaff')) {
  5453. noAllData.splice(0,1);
  5454. }
  5455. }
  5456. this.setUserToDept(noAllData);
  5457. this.deptMembData = noAllData;
  5458. this.deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembData))
  5459. } else {
  5460. this.$message({
  5461. message: res.msg,
  5462. type: "error"
  5463. });
  5464. }
  5465. },
  5466. error => {
  5467. this.$message({
  5468. message: error,
  5469. type: "error"
  5470. });
  5471. });
  5472. }
  5473. },
  5474. // 获取部门列表
  5475. getDepartmentForApprove() {
  5476. this.http.post( this.port.manage.depList, {},
  5477. res => {
  5478. if (res.code == "ok") {
  5479. var list1 = JSON.parse(JSON.stringify(res.data));
  5480. this.deptOptionList = this.changeArr(list1);
  5481. } else {
  5482. this.$message({
  5483. message: res.msg,
  5484. type: "error"
  5485. });
  5486. }
  5487. },
  5488. error => {
  5489. this.$message({
  5490. message: error,
  5491. type: "error"
  5492. });
  5493. });
  5494. },
  5495. // 获取部门列表
  5496. getDepartment() {
  5497. //如果没有权限,就不需要获取
  5498. if (!(this.permissions.reportsCompany || this.user.manageDeptId != 0 || this.permissions.reportsDept)) {
  5499. return;
  5500. }
  5501. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5502. var param = {date:this.date + day};
  5503. this.http.post("/report/getMembList", param,
  5504. res => {
  5505. if (res.code == "ok") {
  5506. if(res.data.length == 0){
  5507. return
  5508. }
  5509. this.departmentList = JSON.parse(JSON.stringify(res.data))
  5510. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  5511. this.trandepartmentList=this.changeArr(JSON.parse(JSON.stringify(res.data)))
  5512. // let noAllData = JSON.parse(JSON.stringify(res.data));
  5513. // if (this.user.role > 0) {
  5514. // }
  5515. list.splice(0,0,{
  5516. id: -1,
  5517. label: this.$t('lable.allStaff'),
  5518. })
  5519. this.membCount = 0;
  5520. //设置员工到部门下面
  5521. this.setUserToDept(list);
  5522. this.data = list;
  5523. // console.log('data',this.data);
  5524. this.expandDate = [this.data[1].id]
  5525. this.allData = list;
  5526. // if (noAllData.length > 0) {
  5527. // if (noAllData[0].label == '全部人员') {
  5528. // noAllData.splice(0,1);
  5529. // }
  5530. // }
  5531. // this.setUserToDept(noAllData);
  5532. // this.deptMembData = noAllData;
  5533. this.option = this.changeArr(list1);
  5534. list[0].membCount = this.membCount;
  5535. if (this.depData.id == -1) {
  5536. this.depData.membCount = this.membCount;
  5537. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  5538. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  5539. } else {
  5540. if (this.depData.isUser == null) {
  5541. var dep = this.findTargetDept(this.data, this.depData.id);
  5542. var membDeptList = [];
  5543. membDeptList.push(dep);
  5544. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  5545. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  5546. }
  5547. }
  5548. if (this.depData.isUser == null) {
  5549. if (this.isFill) {
  5550. this.fillMembList = this.fillList;
  5551. } else {
  5552. this.fillMembList = this.unFillList;
  5553. }
  5554. }
  5555. this.leaveAllNum = 0
  5556. for(let i in this.unFillList){
  5557. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  5558. this.leaveAllNum += 1
  5559. }
  5560. }
  5561. this.stateChange()
  5562. } else {
  5563. this.$message({
  5564. message: res.msg,
  5565. type: "error"
  5566. });
  5567. }
  5568. },
  5569. error => {
  5570. this.$message({
  5571. message: error,
  5572. type: "error"
  5573. });
  5574. });
  5575. this.getReportFillStatus();
  5576. },
  5577. findTargetDept(list, deptId) {
  5578. var t = null;
  5579. for (var i=0;i<list.length; i++) {
  5580. if (list[i].isUser == null && list[i].id == deptId) {
  5581. t = list[i];
  5582. break;
  5583. }
  5584. }
  5585. if (t == null) {
  5586. for (var i=0;i<list.length; i++) {
  5587. if (list[i].children != null && list[i].children.length > 0) {
  5588. t = this.findTargetDept(list[i].children, deptId);
  5589. if (t != null) {
  5590. break;
  5591. }
  5592. }
  5593. }
  5594. }
  5595. return t;
  5596. },
  5597. getUserMembListFromDeptList(list, isFill) {
  5598. var membList = [];
  5599. for (var i in list) {
  5600. var deptName = list[i].label;
  5601. if (list[i].userList != null) {
  5602. list[i].userList.forEach(element => {
  5603. if (isFill == 0) {
  5604. //获取未填的
  5605. if (element.state == null) {
  5606. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  5607. membList.push(obj);
  5608. }
  5609. } else {
  5610. if (element.state != null) {
  5611. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  5612. membList.push(obj);
  5613. }
  5614. }
  5615. });
  5616. }
  5617. if (list[i].children != null) {
  5618. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  5619. }
  5620. }
  5621. return membList;
  5622. },
  5623. setUserToDept(list) {
  5624. for (var i in list) {
  5625. var cnt = 0;
  5626. if (list[i].children != null) {
  5627. this.setUserToDept(list[i].children);
  5628. for (var m in list[i].children) {
  5629. cnt += list[i].children[m].membCount;
  5630. }
  5631. }
  5632. if (list[i].userList != null) {
  5633. if (list[i].children == null) {
  5634. list[i].children = [];
  5635. }
  5636. list[i].userList.forEach(element => {
  5637. var obj = {
  5638. id: element.id,
  5639. label:element.name,
  5640. state:element.state,
  5641. parentId:element.departmentId,
  5642. isUser:1,
  5643. workingTime: element.workingTime,
  5644. leaveDays: element.leaveDays,
  5645. leaveTimes: element.leaveTimes
  5646. };
  5647. list[i].children.push(obj);
  5648. this.membCount++;
  5649. cnt++;
  5650. });
  5651. }
  5652. list[i].membCount = cnt;
  5653. }
  5654. },
  5655. // 修改数组
  5656. changeArr(arr) {
  5657. for (var i = 0; i < arr.length; i++) {
  5658. if(arr[i].id != -1 && arr[i].id != 0) {
  5659. if (arr[i].children != null && arr[i].children.length>0) {
  5660. arr[i].children = this.changeArr(arr[i].children);
  5661. }
  5662. arr[i].id && (arr[i].value = arr[i].id);
  5663. delete arr[i].id;
  5664. }
  5665. }
  5666. for(var i in arr) {
  5667. if(arr[i].id == -1 || arr[i].id == 0) {
  5668. arr.splice(i,1)
  5669. }
  5670. }
  5671. return arr;
  5672. },
  5673. //时间段范围设置改动,监听
  5674. onTimeTypeChange(timeType) {
  5675. this.seleChn(1)
  5676. this.showAddMore = true;
  5677. for(var i in this.workForm.domains) {
  5678. if (this.workForm.domains[i].timeType == 0) {
  5679. this.showAddMore = false;
  5680. break;
  5681. }
  5682. }
  5683. if (this.showAddMore) {
  5684. //检测数量
  5685. if (this.workForm.domains.length == 2) {
  5686. this.showAddMore = false;
  5687. } else {
  5688. this.showAddMore = true;
  5689. }
  5690. }
  5691. },
  5692. getTimeType() {
  5693. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  5694. res => {
  5695. if (res.code == "ok") {
  5696. var t = res.data;
  5697. this.reportTimeType = t;
  5698. if (this.reportTimeType.type > 0) {
  5699. this.showAddMore = true;
  5700. }
  5701. //转化时间格式
  5702. if (t.allday != null) {
  5703. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  5704. }
  5705. if (t.am != null) {
  5706. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  5707. }
  5708. if (t.pm != null) {
  5709. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  5710. }
  5711. let arr = []
  5712. for(var i in res.data.excludeTimeList) {
  5713. let obj = {
  5714. s: res.data.excludeTimeList[i].startTime,
  5715. e: res.data.excludeTimeList[i].endTime,
  5716. }
  5717. arr.push(obj)
  5718. }
  5719. this.vacationTime = arr
  5720. } else {
  5721. this.$message({
  5722. message: res.msg,
  5723. type: "error"
  5724. });
  5725. }
  5726. },
  5727. error => {
  5728. this.listLoading = false;
  5729. this.$message({
  5730. message: error,
  5731. type: "error"
  5732. });
  5733. });
  5734. },
  5735. // 改变月份 -------
  5736. changeMonthOut() {
  5737. this.getAllDate();
  5738. this.getReportList();
  5739. this.getDepartment();
  5740. },
  5741. // 选择日期
  5742. choseDate(i, item) {
  5743. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  5744. return
  5745. }
  5746. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  5747. this.choseDay = i;
  5748. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5749. sessionStorage.msg = this.date + day,
  5750. this.getReportList();
  5751. this.getDepartment();
  5752. this.curDate = item.date;
  5753. },
  5754. canClick(i, item){
  5755. let nowDate = new Date()
  5756. let nowDateYear = nowDate.getFullYear()
  5757. let itemYear = parseInt(this.date.split('-')[0])
  5758. let nowDateMonth = nowDate.getMonth() + 1
  5759. let itemMonth = parseInt(this.date.split('-')[1])
  5760. let nowDateDay = nowDate.getDate()
  5761. let itemDay = parseInt(item.showDate.split('.')[1])
  5762. if(nowDateYear < itemYear){
  5763. return false
  5764. }else if(nowDateYear == itemYear){
  5765. if(nowDateMonth < itemMonth){
  5766. return false
  5767. }else if(nowDateMonth == itemMonth){
  5768. if(nowDateDay < itemDay){
  5769. return false
  5770. }
  5771. }
  5772. }
  5773. },
  5774. // 获取日期列表
  5775. getAllDate(e) {
  5776. var dayArry = [];
  5777. var day = this.getCountDays();
  5778. let curMonthDay = null;
  5779. for (var k = 1; k <= day; k++) {
  5780. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  5781. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  5782. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  5783. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  5784. if(sessionStorage.msg) {
  5785. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  5786. this.choseDay = k - 1;
  5787. curMonthDay = str;
  5788. }
  5789. } else {
  5790. if (new Date().getDate() == k) {
  5791. this.choseDay = k - 1;
  5792. }
  5793. }
  5794. } else {
  5795. this.choseDay = 0;
  5796. }
  5797. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  5798. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  5799. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  5800. }
  5801. this.allDate = dayArry;
  5802. //不能超过最大日期
  5803. if (this.choseDay > day-1) {
  5804. this.choseDay = day-1;
  5805. }
  5806. if(sessionStorage.from != 1){
  5807. let nowmonth = new Date().getMonth() + 1
  5808. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  5809. let nowdate = new Date().getDate()
  5810. if(nowd == this.date){
  5811. if(e && sessionStorage.msg){
  5812. }else{
  5813. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  5814. }
  5815. let nowday = new Date(sessionStorage.msg).getDate()
  5816. this.choseDay = nowday - 1
  5817. let monthdate = new Date(sessionStorage.msg)
  5818. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5819. }else{
  5820. if(e && sessionStorage.msg){
  5821. }else{
  5822. sessionStorage.msg = this.date + '-01'
  5823. }
  5824. let monthdate = new Date(sessionStorage.msg)
  5825. this.choseDay = monthdate.getDate() - 1
  5826. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  5827. // console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  5828. }
  5829. }else{
  5830. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  5831. }
  5832. //从消息点击跳转过来的,直接加载指定日期
  5833. if (sessionStorage.from == 1 && sessionStorage.msg) {
  5834. this.curDate = sessionStorage.msg;
  5835. sessionStorage.from = 0;
  5836. } else {
  5837. // if (curMonthDay != null) {
  5838. // // this.curDate = curMonthDay;
  5839. // let d = new Date(sessionStorage.msg)
  5840. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5841. // } else {
  5842. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  5843. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  5844. // }
  5845. }
  5846. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  5847. // if(!sessionStorage.msg){
  5848. // let msgday = this.choseDay + 1
  5849. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  5850. // }
  5851. this.getReportFillStatus();
  5852. },
  5853. getCountDays() {
  5854. var newstr = this.date.replace(/-/g, "/");
  5855. var curDate = new Date(newstr+'/01');
  5856. var curMonth = curDate.getMonth();
  5857. curDate.setMonth(curMonth + 1);
  5858. curDate.setDate(0);
  5859. return curDate.getDate();
  5860. },
  5861. reqMore() {
  5862. if (this.hasMore) {
  5863. this.pageIndex++;
  5864. this.requestHttpReports();
  5865. }
  5866. },
  5867. //加载日报数据
  5868. requestHttpReports() {
  5869. //请求数据
  5870. this.listLoading = true;
  5871. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5872. let param = {date: this.date + day};
  5873. if (this.deptId) {
  5874. param.deptId = this.deptId;
  5875. }
  5876. if (this.targetUid) {
  5877. param.userId = this.targetUid;
  5878. }
  5879. //传页码
  5880. if (this.hasMore) {
  5881. param.pageIndex = this.pageIndex;
  5882. }
  5883. this.http.post( this.port.report.list, param,
  5884. res => {
  5885. this.listLoading = false;
  5886. if (res.code == "ok") {
  5887. //扩增
  5888. if (res.data.data.length > 0) {
  5889. this.reportList = this.reportList.concat(res.data.data);
  5890. } else if (this.pageIndex > 1){
  5891. this.$message({
  5892. message: this.$t('meiYouGengDuoShuJuLe'),
  5893. type: "info"
  5894. });
  5895. }
  5896. this.hasMore = res.data.hasMore;//标记是否还有更多数据
  5897. if(document.querySelector("#day"+this.choseDay)){
  5898. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  5899. }
  5900. } else {
  5901. this.$message({
  5902. message: res.msg,
  5903. type: "error"
  5904. });
  5905. }
  5906. },
  5907. error => {
  5908. this.listLoading = false;
  5909. this.$message({
  5910. message: error,
  5911. type: "error"
  5912. });
  5913. });
  5914. },
  5915. //获取日报列表
  5916. getReportList() {
  5917. //初始化,重置数据
  5918. this.pageIndex = 0;
  5919. this.hasMore = true;
  5920. this.reportList = [];
  5921. this.requestHttpReports();
  5922. },
  5923. //刷新日报状态,用于审核后更新
  5924. refreshReportData(reportId) {
  5925. this.http.post('/report/getDetailReportById', {reportId:reportId},
  5926. res => {
  5927. if (res.code == "ok") {
  5928. for (var m=0;m<this.reportList.length; m++) {
  5929. var d = this.reportList[m].data;
  5930. var find = d.filter(r=>r.id == reportId);
  5931. if (find.length > 0) {
  5932. find[0].state = res.data.state;
  5933. if (find[0].state == 2) {//被驳回,要可以编辑
  5934. this.reportList[m].state = 2;
  5935. }
  5936. find[0].isDeptAudit = res.data.isDeptAudit;
  5937. find[0].departmentAuditState = res.data.departmentAuditState;
  5938. find[0].projectAuditorName = res.data.projectAuditorName;
  5939. find[0].projectAuditorId = res.data.projectAuditorId;
  5940. find[0].projectAuditState = res.data.projectAuditState;
  5941. find[0].rejectUserid = res.data.rejectUserid;
  5942. find[0].rejectUsername = res.data.rejectUsername;
  5943. find[0].rejectReason = res.data.rejectReason;
  5944. this.$forceUpdate();
  5945. break;
  5946. }
  5947. }
  5948. } else {
  5949. this.$message({
  5950. message: res.msg,
  5951. type: "error"
  5952. });
  5953. }
  5954. },
  5955. error => {
  5956. this.listLoading = false;
  5957. this.$message({
  5958. message: error,
  5959. type: "error"
  5960. });
  5961. });
  5962. },
  5963. //导出员工工时统计
  5964. exportUserTime() {
  5965. this.listLoading = true;
  5966. var param = {};
  5967. if (this.exportParam.dateRange != null) {
  5968. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  5969. }
  5970. this.http.post('/department/exportDeptStatistic', param,
  5971. res => {
  5972. this.listLoading = false;
  5973. if (res.code == "ok") {
  5974. location.href = res.data;
  5975. this.exportTimeDialog = false;
  5976. } else {
  5977. this.$message({
  5978. message: res.msg,
  5979. type: "error"
  5980. });
  5981. }
  5982. },
  5983. error => {
  5984. this.listLoading = false;
  5985. this.$message({
  5986. message: error,
  5987. type: "error"
  5988. });
  5989. });
  5990. },
  5991. //导出日报
  5992. exportReport() {
  5993. this.exportingData = true;
  5994. var param = {};
  5995. if (this.exportParam.dateRange != null) {
  5996. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1], exportType: this.exportType};
  5997. }
  5998. if (this.exportParam.projectId != null) {
  5999. param.projectId = this.exportParam.projectId;
  6000. }
  6001. if (this.exportParam.departmentId != null) {
  6002. // param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  6003. param.departmentIds = this.exportParam.departmentId.join(',')
  6004. }
  6005. if(this.exportParam.plate) {
  6006. param.plate = this.exportParam.plate
  6007. }
  6008. param.stateKey = this.stateKey
  6009. // param.departmentId = this.user.departmentId
  6010. this.http.post(this.port.report.export, param,
  6011. res => {
  6012. this.exportingData = false;
  6013. if (res.code == "ok") {
  6014. var filePath = res.data;
  6015. const a = document.createElement('a'); // 创建a标签
  6016. a.setAttribute('download', this.$t('other.dailyWork') + '.xlsx');// download属性
  6017. a.setAttribute('href', filePath);// href链接
  6018. a.click(); //自执行点击事件
  6019. a.remove();
  6020. this.exportDialog = false;
  6021. } else {
  6022. this.$message({
  6023. message: res.msg,
  6024. type: "error"
  6025. });
  6026. }
  6027. },
  6028. error => {
  6029. this.exportingData = false;
  6030. this.$message({
  6031. message: error,
  6032. type: "error"
  6033. });
  6034. });
  6035. },
  6036. //导出日报审核记录
  6037. exportReportLog() {
  6038. this.exportingData = true;
  6039. var param = {};
  6040. if (this.exportReportLogParam.dateRange != null) {
  6041. param = {startDate:this.exportReportLogParam.dateRange[0], endDate: this.exportReportLogParam.dateRange[1], exportType: this.exportType};
  6042. }
  6043. this.http.post('/report-log/exportReportLog', param,
  6044. res => {
  6045. this.exportingData = false;
  6046. if (res.code == "ok") {
  6047. var filePath = res.data;
  6048. const a = document.createElement('a'); // 创建a标签
  6049. a.setAttribute('download','日报审核记录.xlsx');// download属性
  6050. a.setAttribute('href', filePath);// href链接
  6051. a.click(); //自执行点击事件
  6052. a.remove();
  6053. this.exportDialog = false;
  6054. } else {
  6055. this.$message({
  6056. message: res.msg,
  6057. type: "error"
  6058. });
  6059. }
  6060. },
  6061. error => {
  6062. this.exportingData = false;
  6063. this.$message({
  6064. message: error,
  6065. type: "error"
  6066. });
  6067. });
  6068. },
  6069. restUserCardTime(item){
  6070. let param={}
  6071. param.userId=item.userId
  6072. param.createDate=item.createDate
  6073. this.http.post('/user-with-beisen/getAttendanceStatisticWithUser', param,
  6074. res => {
  6075. if (res.code == "ok") {
  6076. this.showMonthWorkTimeReminder()
  6077. } else {
  6078. this.$message({
  6079. message: res.msg,
  6080. type: "error"
  6081. });
  6082. }
  6083. },
  6084. error => {
  6085. this.$message({
  6086. message: error,
  6087. type: "error"
  6088. });
  6089. });
  6090. },
  6091. importReportLog(item){
  6092. //首先判断文件类型
  6093. let str = item.file.name.split(".");
  6094. let format = str[str.length - 1];
  6095. if (format != "xls" && format != "xlsx") {
  6096. this.$message({
  6097. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  6098. type: "error"
  6099. });
  6100. } else {
  6101. const loading = this.$loading({
  6102. lock: true,
  6103. text: this.$t('zhengZaiDaoRuXiuGaiZhongQingNaiXinDengDai'),
  6104. spinner: 'el-icon-loading',
  6105. background: 'rgba(0, 0, 0, 0.7)'
  6106. });
  6107. let formData = new FormData();
  6108. formData.append("multipartFile", item.file);
  6109. this.http.uploadFile('/report-log/importReportLogChange', formData,
  6110. res => {
  6111. this.$refs.upload.clearFiles();
  6112. loading.close();
  6113. if (res.code == "ok") {
  6114. this.$message({
  6115. message: res.msg,
  6116. type: "success"
  6117. });
  6118. } else {
  6119. this.$message({
  6120. message: res.msg,
  6121. type: "error"
  6122. });
  6123. }
  6124. },
  6125. error => {
  6126. this.$refs.upload.clearFiles();
  6127. loading.close();
  6128. this.$message({
  6129. message: error,
  6130. type: "error"
  6131. });
  6132. });
  6133. }
  6134. },
  6135. //获取项目列表
  6136. getProjectList() {
  6137. this.listLoading = true;
  6138. this.http.post( this.port.project.list, {},
  6139. res => {
  6140. this.listLoading = false;
  6141. if (res.code == "ok") {
  6142. for(var i in res.data) {
  6143. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6144. res.data[i].projectCode = ''
  6145. }
  6146. }
  6147. this.projectList = res.data;
  6148. } else {
  6149. this.$message({
  6150. message: res.msg,
  6151. type: "error"
  6152. });
  6153. }
  6154. },
  6155. error => {
  6156. this.listLoading = false;
  6157. this.$message({
  6158. message: error,
  6159. type: "error"
  6160. });
  6161. });
  6162. },
  6163. getSubUsersFillProjectList(userId) {
  6164. this.http.post( this.port.project.list, {
  6165. forReport: 1,
  6166. userId: userId
  6167. },res => {
  6168. if (res.code == "ok") {
  6169. for(var i in res.data) {
  6170. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6171. res.data[i].projectCode = ''
  6172. }
  6173. }
  6174. this.subFillProjectList = res.data;
  6175. this.getRecentlyProject(userId)
  6176. } else {
  6177. this.$message({
  6178. message: res.msg,
  6179. type: "error"
  6180. });
  6181. }
  6182. },
  6183. error => {
  6184. this.$message({
  6185. message: error,
  6186. type: "error"
  6187. });
  6188. });
  6189. },
  6190. // 获取填报日报的项目下拉列表
  6191. getFillProjectList() {
  6192. this.http.post( this.port.project.list, {
  6193. forReport: 1
  6194. },res => {
  6195. if (res.code == "ok") {
  6196. for(var i in res.data) {
  6197. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  6198. res.data[i].projectCode = ''
  6199. }
  6200. }
  6201. this.fillProjectList = res.data;
  6202. this.getRecentlyProject()
  6203. } else {
  6204. this.$message({
  6205. message: res.msg,
  6206. type: "error"
  6207. });
  6208. }
  6209. },
  6210. error => {
  6211. this.$message({
  6212. message: error,
  6213. type: "error"
  6214. });
  6215. });
  6216. },
  6217. //自己填写日报时,刷新到自己的可填报日报列表
  6218. refreshToMyReportProjectList() {
  6219. this.getRecentlyProject();
  6220. },
  6221. getBasecostItemList() {
  6222. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6223. companyId: this.user.companyId
  6224. },
  6225. res => {
  6226. if (res.code == "ok") {
  6227. this.timeBasecostList = res.data;
  6228. }
  6229. });
  6230. },
  6231. getAIReport(createDate) {
  6232. this.http.post('/report/getAIReport', {},
  6233. res => {
  6234. if (res.code == "ok") {
  6235. var quanbu = 0
  6236. this.jsDay = 1
  6237. var zhi = ''
  6238. var slp = res.data
  6239. for(var i in slp) {
  6240. var sp = +slp[i].workingTime + 0
  6241. zhi = this.jsDay * sp
  6242. quanbu = +quanbu + zhi
  6243. }
  6244. this.jsTime = quanbu
  6245. var aiReportData = res.data;
  6246. this.canCancelInDialog = false
  6247. if(aiReportData.length != 0) {
  6248. var arr = [];
  6249. for(var i in aiReportData) {
  6250. arr.push({
  6251. id: null,
  6252. projectId: aiReportData[i].projectId,
  6253. workingTime: aiReportData[i].workingTime,
  6254. content: '',
  6255. progress:100,
  6256. state: 2,
  6257. timeType: aiReportData[i].timeType,
  6258. subProjectList: aiReportData[i].subProjectList,
  6259. taskList: aiReportData[i].taskList,
  6260. subProjectId: aiReportData[i].subProjectId == 0?null:aiReportData[i].subProjectId,
  6261. groupId: aiReportData[i].groupId == 0?null:aiReportData[i].groupId,
  6262. taskId: aiReportData[i].taskId,
  6263. startTime: aiReportData[i].startTime,
  6264. endTime: aiReportData[i].endTime,
  6265. isOvertime: 0,
  6266. progress:aiReportData[i].progress,
  6267. professionProgress: aiReportData[i].professionProgressList,
  6268. stages:aiReportData[i].stages,
  6269. stage:aiReportData[i].stage == '-'?null:aiReportData[i].stage,
  6270. pics: null,
  6271. multiWorktime: aiReportData[i].multiWorktime || 0,
  6272. worktimeList: [{}],
  6273. degreeId: aiReportData[i].degreeId==-1?null:aiReportData[i].degreeId,
  6274. multiDegrIdArray: aiReportData[i].multiDegrId?JSON.parse(aiReportData[i].multiDegrId):null,
  6275. wuduList: aiReportData[i].degreeList,
  6276. taskGroups:aiReportData[i].taskGroups,
  6277. customData: aiReportData[i].customData,//自定义的数值
  6278. auditUserList: aiReportData[i].auditUserList,
  6279. projectAuditorId: aiReportData[i].projectAuditorId,
  6280. projectAuditorName: aiReportData[i].projectAuditorName,
  6281. overtimeHours: aiReportData[i].overtimeHours,
  6282. customText: aiReportData[i].customText,
  6283. basecostId: aiReportData[i].basecostId,
  6284. auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
  6285. auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
  6286. auditorThird: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorThird ? aiReportData[i].auditorSetting.auditorThird : '',
  6287. ccUserid: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.ccUserid ? aiReportData[i].auditorSetting.ccUserid : '',
  6288. canEdit: true,
  6289. content: aiReportData[i].content
  6290. })
  6291. }
  6292. this.workForm.domains = arr;
  6293. } else {
  6294. }
  6295. this.canEdit = true;
  6296. this.originCanEdit = true;
  6297. this.seleChn()
  6298. } else {
  6299. this.$message({
  6300. message: res.msg,
  6301. type: "error"
  6302. });
  6303. }
  6304. },
  6305. error => {
  6306. this.$message({
  6307. message: error,
  6308. type: "error"
  6309. });
  6310. });
  6311. },
  6312. // 获取个人某天的日报 111111
  6313. getReport() {
  6314. this.http.post( this.port.report.getPort, {
  6315. date: this.workForm.createDate
  6316. },
  6317. res => {
  6318. if (res.code == "ok") {
  6319. var quanbu = 0
  6320. this.jsDay = 1
  6321. var zhi = ''
  6322. var slp = res.data.report
  6323. for(var i in slp) {
  6324. var sp = +slp[i].workingTime + 0
  6325. zhi = this.jsDay * sp
  6326. quanbu = +quanbu + zhi
  6327. }
  6328. this.jsTime = quanbu
  6329. var list = res.data;
  6330. this.report = list;
  6331. this.reportTimeType = this.report.timeType;
  6332. //从后端接口的数据设置是否是周末,后端会判断节假日以及中航工业一周6天工作日的情况
  6333. this.isWeekend = !this.report.isWorkDay;
  6334. this.canCancelInDialog = false;
  6335. this.hasWrittenReport = list.report.length != 0;
  6336. if(list.report.length != 0) {
  6337. var arr = [];
  6338. this.canEdit = false;
  6339. let candelete = true
  6340. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6341. for(var i in list.report) {
  6342. var flg = null
  6343. list.report[i].isOvertime == 1 ? flg = true : flg = false
  6344. var targetP = this.fillProjectList.filter(p=>p.id == list.report[i].projectId);
  6345. var filteredRespList = null
  6346. if (targetP.length > 0) {
  6347. var isPublic = targetP[0].isPublic;
  6348. 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);
  6349. }
  6350. let copyData = {
  6351. id: list.report[i].id,
  6352. projectId: list.report[i].projectId,
  6353. workingTime: list.report[i].workingTime,
  6354. content: list.report[i].content,
  6355. state: list.report[i].state,
  6356. timeType: list.report[i].timeType,
  6357. subProjectList: list.report[i].subProjectList,
  6358. taskList: list.report[i].taskList,
  6359. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  6360. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  6361. taskId: list.report[i].taskId,
  6362. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  6363. startTime: list.report[i].startTime,
  6364. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  6365. endTime: list.report[i].endTime,
  6366. isOvertime: flg,
  6367. progress:list.report[i].progress,
  6368. professionProgress: list.report[i].professionProgressList,
  6369. stages:list.report[i].stages,
  6370. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  6371. pics: list.report[i].pics,
  6372. multiWorktime: list.report[i].multiWorktime,
  6373. worktimeList: list.report[i].worktimeList,
  6374. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  6375. multiDegrIdArray: list.report[i].multiDegrIdList,
  6376. wuduList: list.report[i].degreeList,
  6377. taskGroups:list.report[i].taskGroups,
  6378. customData: list.report[i].customData,//自定义的数值
  6379. auditUserList: list.report[i].auditUserList,
  6380. overtimeHours: list.report[i].overtimeHours,
  6381. customText: list.report[i].customText,
  6382. basecostId: list.report[i].basecostId,
  6383. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  6384. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  6385. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  6386. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  6387. canEdit: list.report[i].state >= 2 ? true : false,
  6388. extraField1: list.report[i].extraField1,
  6389. extraField2: list.report[i].extraField2,
  6390. extraField3: list.report[i].extraField3,
  6391. extraField4: list.report[i].extraField4,
  6392. extraField5: list.report[i].extraField5,
  6393. workContentList: list.report[i].workContentList,
  6394. filteredRespList: filteredRespList,
  6395. serviceList: list.report[i].serviceList,
  6396. sapServiceId: list.report[i].sapServiceId,
  6397. reportTargetDeptId: list.report[i].deptId
  6398. }
  6399. if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
  6400. //分组负责人审核的情况下,前端不需要显示,无需设置
  6401. copyData.projectAuditorId = list.report[i].projectAuditorId;
  6402. copyData.projectAuditorName = list.report[i].projectAuditorName;
  6403. }
  6404. arr.push(copyData);
  6405. if (list.report[i].state >= 2) {
  6406. this.canEdit = true;
  6407. }
  6408. if(list.report[i].state < 2){
  6409. candelete = false
  6410. }
  6411. if (list.report[i].state == 0){
  6412. this.canCancelInDialog = true
  6413. }
  6414. // 加判断
  6415. if(this.user.timeType.choseFromAlbum == 1) {
  6416. let arrList = []
  6417. for(var k in list.report[i].pics) {
  6418. let obj = {
  6419. name: k,
  6420. url: list.report[i].pics[k]
  6421. }
  6422. arrList.push(obj)
  6423. }
  6424. arr[i].imgListUrl = arrList
  6425. arr[i].imgList = list.report[i].pics
  6426. }
  6427. if((reportExtraField4Name || reportExtraField5Name) && list.report[i].state >= 2) {
  6428. this.getInfoByProjectId(copyData, i, false)
  6429. }
  6430. }
  6431. this.reportCanDelete = candelete
  6432. this.workForm = {
  6433. createDate: this.workForm.createDate,
  6434. domains: arr,
  6435. userNames:null,
  6436. userId:null,
  6437. time: list.time,
  6438. showRefresh: list.showRefresh
  6439. }
  6440. } else {
  6441. this.workForm = {
  6442. createDate: this.workForm.createDate,
  6443. domains: [{
  6444. id: null,
  6445. projectId: "",
  6446. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6447. content: "",
  6448. progress:100,
  6449. state: 2,
  6450. timeType:0,
  6451. multiWorktime: this.reportTimeType.multiWorktime,
  6452. worktimeList:[{}],
  6453. canEdit: true,
  6454. auditorFirst: '',
  6455. auditorSec: '',
  6456. auditorThird: '',
  6457. ccUserid: ''
  6458. }],
  6459. userId:null,
  6460. userNames:null,
  6461. time: this.report.time,
  6462. showRefresh: list.showRefresh
  6463. }
  6464. // businessTrips 有数据的情况下
  6465. const businessTrips = res.data.businessTrips || []
  6466. this.businessTripsArray = res.data.businessTrips || []
  6467. if(businessTrips.length > 0) {
  6468. this.workForm.domains = businessTrips.map((item, index) => {
  6469. return {
  6470. id: null,
  6471. projectId: item.projectId,
  6472. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6473. content: "",
  6474. progress:100,
  6475. state: 2,
  6476. timeType:0,
  6477. multiWorktime: this.reportTimeType.multiWorktime,
  6478. worktimeList:[{}],
  6479. canEdit: true,
  6480. auditorFirst: '',
  6481. auditorSec: '',
  6482. auditorThird: '',
  6483. ccUserid: ''
  6484. }
  6485. })
  6486. for(let domainsIndex in this.workForm.domains) {
  6487. this.selectProject(this.workForm.domains[domainsIndex], domainsIndex)
  6488. }
  6489. }
  6490. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  6491. this.$set(this.workForm.domains[0],'isOvertime',true)
  6492. if(this.reportTimeType.type != 2){
  6493. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  6494. }
  6495. }
  6496. if(this.user.timeType.type == 1) {
  6497. var shuzhi = this.user.timeType.allday + ''
  6498. // console.log('执行一次', shuzhi.indexOf('.'))
  6499. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6500. }
  6501. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6502. //默认给第一个,必填字段
  6503. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6504. }
  6505. this.canEdit = true;
  6506. }
  6507. this.originCanEdit = this.canEdit;
  6508. this.seleChn()
  6509. } else {
  6510. this.$message({
  6511. message: res.msg,
  6512. type: "error"
  6513. });
  6514. }
  6515. },
  6516. error => {
  6517. this.$message({
  6518. message: error,
  6519. type: "error"
  6520. });
  6521. });
  6522. },
  6523. guanbi() {
  6524. this.falsss = false,
  6525. this.workTimeForMinYi=0
  6526. },
  6527. // 打开日报填写
  6528. fillInReport(i, isBatch) {
  6529. this.isWeekend = false
  6530. this.reportCanDelete = false
  6531. // console.log(this.user.timeType.type, '选择时长')
  6532. if(i != 1) {
  6533. this.falsss = false
  6534. } else {
  6535. this.falsss = true
  6536. }
  6537. if (this.isSubstitude) {
  6538. this.getSubstitudeUserDeptList();
  6539. } else {
  6540. this.refreshToMyReportProjectList();
  6541. }
  6542. if(i == -1 || this.isSubstitude) {
  6543. this.isDisable = false;
  6544. } else {
  6545. this.isDisable = true;
  6546. }
  6547. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  6548. this.isBatch = isBatch;
  6549. if (this.isBatch == 0 && !this.isSubstitude) {
  6550. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  6551. let weekday = new Date(this.workForm.createDate).getDay()
  6552. if(this.user.companyId == 817){
  6553. if(weekday == 0){
  6554. this.isWeekend = true
  6555. }
  6556. }else{
  6557. if(weekday == 0 || weekday == 6){
  6558. this.isWeekend = true
  6559. }
  6560. }
  6561. this.getReport(i);
  6562. } else {
  6563. this.jsTime = 0
  6564. this.jsDay = 0
  6565. this.workForm = {
  6566. createDate: null,//批量填报没有日期
  6567. domains: [{
  6568. id: null,
  6569. projectId: "",
  6570. workingTime: this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1),
  6571. content: "",
  6572. progress:100,
  6573. state: 2,
  6574. timeType:0,
  6575. multiWorktime: this.reportTimeType.multiWorktime,
  6576. worktimeList:[{}],
  6577. canEdit: true,
  6578. }],
  6579. }
  6580. if(this.user.timeType.type == 1) {
  6581. var shuzhi = this.user.timeType.allday + ''
  6582. // console.log('执行二次')
  6583. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  6584. }
  6585. if (this.isSubstitude && this.user.timeType.showCorpwxCardtime) {
  6586. this.workForm.showRefresh = true;
  6587. }
  6588. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  6589. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  6590. }
  6591. this.canEdit = true;
  6592. }
  6593. if (this.isSubstitude) {
  6594. //代填情况,默认计算合计工时
  6595. this.jsDay = 1
  6596. this.seleChn();
  6597. }
  6598. this.dialogVisible = true;
  6599. },
  6600. //按周填报的弹窗口中编辑单项目相关数据
  6601. setWeekFormReportItem(reportId, i, names, row,sss) {
  6602. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  6603. this.http.post('/report/getReportById', {
  6604. reportId: reportId
  6605. },
  6606. res => {
  6607. if (res.code == "ok") {
  6608. var data = res.data.report;
  6609. sss.subProjectId = data.subProjectId
  6610. sss.subProjectList = data.subProjectList;
  6611. sss.stage = data.stage
  6612. sss.subProjectList = data.subProjectList
  6613. sss.stages = data.stages
  6614. sss.taskGroups = data.taskGroups;
  6615. sss.auditUserList = data.auditUserList;
  6616. sss.degreeId = data.degreeId;
  6617. sss.customData = data.customData;
  6618. sss.wuduList = data.degreeList;
  6619. if(reportExtraField4Name || reportExtraField5Name) {
  6620. sss.extraField4 = data.extraField4 || ''
  6621. sss.extraField5 = data.extraField5 || ''
  6622. }
  6623. this.zhoBaoIdx = i
  6624. this.zhoBaoName = names
  6625. this.zhoBao = sss
  6626. this.zhis = row
  6627. if (sss.groupId) {
  6628. //最后一个参数表示是否保留stage的值,不要重置为空
  6629. this.getGroupStages(this.zhoBao, 0, true)
  6630. }
  6631. if(reportExtraField4Name || reportExtraField5Name) {
  6632. this.weekGetInfoByProjectId(sss)
  6633. }
  6634. this.$forceUpdate();
  6635. }
  6636. });
  6637. },
  6638. // 重新计算合计
  6639. fillInThePedometerOnAWeeklyBasis(index) {
  6640. const weeklyItem = this.zhoData[index] || {}
  6641. const dynamicProjectList = this.selProjectList || []
  6642. const collectionArray = dynamicProjectList.map(item => {
  6643. const name = item.projectName
  6644. return Number(weeklyItem[name].workingTime || 0)
  6645. })
  6646. const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
  6647. this.zhoData[index].he = totalNum
  6648. },
  6649. //输入工时触发
  6650. onInputWorkTime(index) {
  6651. const weeklyItem = this.zhoData[index] || {}
  6652. },
  6653. // 按周填报里内容的填写
  6654. showWeekItemEdit(item, i, projectId,names, row) {
  6655. if (item.state == 0) {
  6656. this.$message({
  6657. message: this.$t('daiShenHeZhuangTaiBuKeXiuGaiQingFanHuiDaoChaKanRiBaoZhongXianCheHui'),
  6658. type: "error"
  6659. });
  6660. return;
  6661. }
  6662. if (item.state == 1) {
  6663. this.$message({
  6664. message: this.$t('yiTongGuoZhuangTaiBuKeXiuGai'),
  6665. type: "error"
  6666. });
  6667. return;
  6668. }
  6669. if(this.user.timeType.notAllowedNoAttendance == 1){
  6670. if(this.zhoData[i].corpTime){
  6671. if(this.zhoData[i].corpTime.workHours == 0){
  6672. this.$message({
  6673. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6674. type: 'error'
  6675. })
  6676. return
  6677. }
  6678. }else{
  6679. this.$message({
  6680. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  6681. type: 'error'
  6682. })
  6683. return
  6684. }
  6685. }
  6686. var obj = {}
  6687. obj.projectId = projectId
  6688. this.tianxieDialogVisible = true
  6689. this.scopess = item
  6690. var sss = {}
  6691. if (item.id != null) {
  6692. sss.id = item.id;
  6693. sss.state = item.state;
  6694. } else {
  6695. sss.id = -1;
  6696. sss.state = 3;
  6697. }
  6698. sss.projectId = projectId;
  6699. sss.progress = item.progress
  6700. sss.time = item.time
  6701. sss.content = item.content;
  6702. if (sss.time == '' && this.reportTimeType.type == 2) {
  6703. //取已填时间范围中最大的一个作为开始时间
  6704. var startTime = '09:00';
  6705. var fillStartTime = '00:00';
  6706. for (var t in this.selProjectList) {
  6707. var fillItem = this.zhoData[i][this.selProjectList[t].projectName];
  6708. if (fillItem.time) {
  6709. if (fillItem.time[1] > fillStartTime) {
  6710. fillStartTime = fillItem.time[1];
  6711. }
  6712. }
  6713. }
  6714. if (fillStartTime == '00:00') {
  6715. fillStartTime = '09:00';
  6716. }
  6717. var fillEndMax = '18:00';
  6718. if (fillStartTime >= '18:00') {
  6719. fillEndMax = '23:59';
  6720. }
  6721. sss.time = [fillStartTime, fillEndMax];
  6722. }
  6723. sss.groupId = item.groupId
  6724. sss.stage = item.stage;
  6725. sss.workingTime = item.workingTime
  6726. sss.projectAuditorId = item.projectAuditorId;
  6727. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  6728. //默认选中第一个
  6729. sss.basecostId = this.timeBasecostList[0].id;
  6730. }
  6731. var hasEdited = this.zhoData[i][names].hasEdited;
  6732. if (hasEdited) {
  6733. console.log('执行到了这个')
  6734. console.log('执行到了这个', { ...item }, obj)
  6735. sss = { ...item }
  6736. //编辑过了
  6737. sss.subProjectId = item.subProjectId
  6738. sss.stage = item.stage
  6739. sss.subProjectList = item.subProjectList
  6740. sss.stages = item.stages
  6741. sss.taskGroups = item.taskGroups;
  6742. // sss.auditUserList = obj.auditUserList ;
  6743. sss.degreeId = item.degreeId;
  6744. sss.customData = item.customData;
  6745. if (sss.auditUserList != null && sss.auditUserList.length == 1) {
  6746. //只有一个审核人,自动设置上去
  6747. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6748. }
  6749. sss.wuduList = item.wuduList;
  6750. this.zhoBaoIdx = i
  6751. this.zhoBaoName = names
  6752. this.zhoBao = sss
  6753. this.zhis = row
  6754. if (sss.groupId) {
  6755. //最后一个参数表示是否保留stage的值,不要重置为空
  6756. this.getGroupStages(this.zhoBao, 0, true)
  6757. }
  6758. this.$forceUpdate();
  6759. this.getWeeklyTaskList(sss)
  6760. } else {
  6761. //第一次打开,获取数据
  6762. if (sss.id == -1) {
  6763. //新填报的
  6764. this.selectProject(obj, 0);
  6765. var that = this
  6766. setTimeout(() =>{
  6767. sss.subProjectId = that.workForm.domains[0].subProjectId
  6768. sss.subProjectList = item.subProjectList;
  6769. sss.stage = that.workForm.domains[0].stage
  6770. sss.subProjectList = that.workForm.domains[0].subProjectList
  6771. sss.stages = that.workForm.domains[0].stages
  6772. sss.taskGroups = that.workForm.domains[0].taskGroups;
  6773. sss.auditUserList = obj.auditUserList;
  6774. sss.degreeId = item.degreeId;
  6775. sss.customData = item.customData;
  6776. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  6777. //只有一个审核人,自动设置上去
  6778. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  6779. }
  6780. sss.wuduList = row[0].wuduList
  6781. that.zhoBaoIdx = i
  6782. that.zhoBaoName = names
  6783. that.zhoBao = sss
  6784. that.zhis = row
  6785. if (sss.groupId) {
  6786. //最后一个参数表示是否保留stage的值,不要重置为空
  6787. this.getGroupStages(that.zhoBao, 0, false)
  6788. }
  6789. that.$forceUpdate();
  6790. this.getWeeklyTaskList(sss)
  6791. },600);
  6792. } else {
  6793. //编辑填报过的;数据库已经存在的
  6794. this.setWeekFormReportItem(sss.id, i, names, row, sss);
  6795. }
  6796. if(this.user.timeType.reportExtraField4Name || this.user.timeType.reportExtraField5Name) {
  6797. setTimeout(() => {
  6798. this.weekGetInfoByProjectId(sss)
  6799. }, 1000)
  6800. }
  6801. }
  6802. },
  6803. weekGetInfoByProjectId(item) {
  6804. console.log(item, '<=== item')
  6805. const { projectId } = item
  6806. const projectList = this.fillProjectList || this.subFillProjectList
  6807. const { projectCode = '' } = projectList.find(item => item.id == projectId)
  6808. this.http.post('/erpOrderInfo/getInfoByProjectId',{
  6809. projectId: projectCode,
  6810. date: this.zhoData[this.zhoBaoIdx].zhoDataTime
  6811. },
  6812. res => {
  6813. if (res.code == "ok") {
  6814. this.zhoBao.reportExtraField4List = res.data.orderIds || []
  6815. this.zhoBao.reportExtraField5List = res.data.lines || []
  6816. if((res.data.orderIds || []).length > 0) {
  6817. this.zhoBao.extraField4 = res.data.orderIds[0]
  6818. }
  6819. console.log(this.zhoBao, '<===== this.zhoBao')
  6820. this.$forceUpdate();
  6821. }
  6822. },
  6823. error => {
  6824. this.$message({
  6825. message: error,
  6826. type: "error"
  6827. });
  6828. });
  6829. // console.log(item)
  6830. // console.log(this.zhoBao)
  6831. },
  6832. // 按周填报里内容的填写点击确定
  6833. setWeekProItemData() {
  6834. //专业版模式下,任务分组和阶段必填
  6835. if (this.user.company.packageProject == 1 && this.user.companyId === 3917) {
  6836. if (!this.zhoBao.groupId || !this.zhoBao.stage) {
  6837. this.$message({
  6838. message: this.$t('renWuFenZuHeJieDuanBiTianQingJianCha'),
  6839. type: "error"
  6840. });
  6841. return;
  6842. }
  6843. }
  6844. // 检查任务分组
  6845. if(this.user.timeType.taskGroupRequired == 1 && !this.zhoBao.groupId){
  6846. this.$message({
  6847. message: this.$t('renWuFenZuBiTianQingJianCha'),
  6848. type: "error"
  6849. });
  6850. return
  6851. }
  6852. //检查子项目是否必填
  6853. if (this.user.timeType.subProMustFill == 1 && this.zhoBao.subProjectList && this.zhoBao.subProjectList.length > 0 && !this.zhoBao.subProjectId) {
  6854. this.$message({
  6855. message: this.$t('ziXiangMuBiTianQingJianCha'),
  6856. type: "error"
  6857. });
  6858. return;
  6859. }
  6860. if (!this.zhoBao.projectAuditorId &&(this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4)) {
  6861. this.$message({
  6862. message: this.$t('message.Pleaseselectareviewer'),
  6863. type: "error"
  6864. });
  6865. return
  6866. }
  6867. if(this.user.timeType.reportAuditType == 3){
  6868. let auditTips = ''
  6869. if(!this.zhoBao.auditorFirst){ auditTips += this.$t('di-yi') }
  6870. // if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  6871. // if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  6872. if(auditTips){
  6873. auditTips = auditTips.substring(0,auditTips.length - 1)
  6874. this.$message({
  6875. message: this.$t('defaultText.pleaseChoose') + auditTips + this.$t('other.reviewer'),
  6876. type: 'error'
  6877. })
  6878. return
  6879. }
  6880. }
  6881. let errtips = ''
  6882. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0) {
  6883. if ((!this.user.timeType.customDegreeMultiple && !this.zhoBao.degreeId) || (this.user.timeType.customDegreeMultiple && (!this.zhoBao.multiDegrIdArray || this.zhoBao.multiDegrIdArray.length==0))) {
  6884. errtips += this.user.timeType.customDegreeName + '、'
  6885. }
  6886. }
  6887. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  6888. errtips += this.user.timeType.customDataName + '、'
  6889. }
  6890. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  6891. errtips += this.user.timeType.customTextName + '、'
  6892. }
  6893. if(this.user.timeType.workContentState == 1 && !this.zhoBao.content){
  6894. errtips += this.$t('other.workMatters') +'、'
  6895. }
  6896. if(errtips){
  6897. errtips = errtips.substring(0,errtips.length - 1)
  6898. this.$message({
  6899. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  6900. type: 'error'
  6901. })
  6902. return
  6903. }
  6904. if(this.user.companyId == '7536') {
  6905. const taskGroupsList = this.zhoBao.taskGroups
  6906. const groupId = this.zhoBao.groupId
  6907. const taskGroupRow = taskGroupsList.find(item => item.id == groupId)
  6908. const extraField4 = this.zhoBao.extraField4
  6909. const extraField5 = this.zhoBao.extraField5
  6910. if(groupId && taskGroupRow.name.indexOf('研发工时') != '-1' && (extraField4 || extraField5)) {
  6911. this.$message({
  6912. message: `选择了研发工时,请勿填写工单号和行号`,
  6913. type: "error"
  6914. });
  6915. return
  6916. }
  6917. }
  6918. this.tianxieDialogVisible = false
  6919. var zhong = this.zhoData
  6920. this.zhoBao.hasEdited = true;
  6921. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  6922. this.zhoData = zhong
  6923. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  6924. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  6925. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  6926. },
  6927. // 获取本周
  6928. getCurrentWeek() {
  6929. //今天
  6930. this.targetWeekDate = new Date();
  6931. this.initWeekFormData();
  6932. // this.jiazai()
  6933. },
  6934. // 获取上周
  6935. handleGetPrevWeek() {
  6936. this.targetWeekDate = new Date(this.targetWeekDate.getTime() - 7*24*3600*1000);
  6937. this.initWeekFormData();
  6938. // this.jiazai()
  6939. },
  6940. // 获取下周
  6941. handleGetNextvWeek() {
  6942. this.targetWeekDate = new Date(this.targetWeekDate.getTime() + 7*24*3600*1000);
  6943. this.initWeekFormData()
  6944. },
  6945. // 加载动画
  6946. jiazai() {
  6947. this.weekDataLoading = true
  6948. var that = this
  6949. setTimeout(() =>{
  6950. that.weekDataLoading = false
  6951. },1000);
  6952. },
  6953. // 转时间格式
  6954. dealdate(date) {
  6955. const dt = new Date(date)
  6956. const y = dt.getFullYear()
  6957. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  6958. const d = (dt.getDate() + '').padStart(2, '0')
  6959. return `${y}-${m}-${d}`
  6960. },
  6961. // 按周填报
  6962. fillInReportss() {
  6963. window.addEventListener('scroll', this.handleScroll, true)
  6964. // this.jiazai()
  6965. this.fillWeekDialogVisi = true;
  6966. if (this.isSubstitude) {
  6967. this.substitudeStep = 1;
  6968. this.getSubstitudeUserDeptList();
  6969. } else {
  6970. this.getCurrentWeek();
  6971. }
  6972. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  6973. //重新获取工时预警类型的预算项
  6974. this.http.post('/project-basecost-setting/getReportBasecostList', {
  6975. companyId: this.user.companyId
  6976. },
  6977. res => {
  6978. if (res.code == "ok") {
  6979. this.timeBasecostList = res.data;
  6980. }
  6981. });
  6982. }
  6983. },
  6984. fillInReportCustom() {
  6985. this.weekIndex++
  6986. this.weekParentData = {
  6987. isSubstitude: this.isSubstitude
  6988. }
  6989. this.fillWeekDialogVisiCustom = true
  6990. },
  6991. // 按周填报的项目筛选
  6992. selListFun(){
  6993. this.selProjectList = []
  6994. if(this.selCon.length){
  6995. for (let i = 0; i < this.selCon.length; i++) {
  6996. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  6997. }
  6998. this.selConShow = false ;
  6999. for (let i in this.zhoData) {
  7000. var obj = this.zhoData[i];
  7001. for(var j in this.selProjectList) {
  7002. var xinzhi = this.selProjectList[j].projectName
  7003. obj[xinzhi] = {}
  7004. obj[xinzhi].time = ''
  7005. obj[xinzhi].content = ''
  7006. obj[xinzhi].progress = 0
  7007. obj[xinzhi].workingTime = 0
  7008. }
  7009. }
  7010. this.initWeekFormData();
  7011. }else{
  7012. this.$message({
  7013. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  7014. type:'error'
  7015. })
  7016. }
  7017. },
  7018. setWeekCardTimeData(list) {
  7019. for(let i in list){
  7020. let datei = '';
  7021. if (this.user.timeType.showDdCardtime == 1) {
  7022. datei = list[i].workDate;
  7023. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  7024. datei = list[i].createDate;
  7025. } else if (this.user.timeType.syncFanwei == 1) {
  7026. datei = list[i].workDate;
  7027. }
  7028. for(let m in this.zhoData) {
  7029. if(datei == this.zhoData[m].zhoDataTime){
  7030. let item = {
  7031. startTime: list[i].startTime,
  7032. endTime: list[i].endTime,
  7033. workHours: list[i].workHours,
  7034. otTime: list[i].otTime
  7035. }
  7036. this.$set(this.zhoData[m],'corpTime',item)
  7037. }
  7038. }
  7039. }
  7040. },
  7041. getWeeklyCardTime(){ //按周填报获取考勤信息
  7042. let dateStr = []
  7043. for(let i in this.zhoData){
  7044. dateStr.push(this.zhoData[i].zhoDataTime)
  7045. }
  7046. this.http.post('/report/getWeeklyCardTime',{
  7047. dateStr: JSON.stringify(dateStr)
  7048. },res => {
  7049. if(res.code == 'ok'){
  7050. for(let i in res.data){
  7051. let datei = '';
  7052. if (this.user.timeType.showDdCardtime == 1) {
  7053. datei = res.data[i].workDate.split('-');
  7054. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  7055. datei = res.data[i].createDate.split('-');
  7056. }
  7057. for(let m in this.zhoData){
  7058. let datem = new Date(this.zhoData[m].zhoDataTime)
  7059. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  7060. let item = {
  7061. startTime: res.data[i].startTime,
  7062. endTime: res.data[i].endTime,
  7063. workHours: res.data[i].workHours
  7064. }
  7065. this.$set(this.zhoData[m],'corpTime',item)
  7066. }
  7067. }
  7068. }
  7069. }else{
  7070. this.$message({
  7071. message: res.msg,
  7072. type: 'error'
  7073. })
  7074. }
  7075. },err => {
  7076. this.$message({
  7077. message: err,
  7078. type: 'error'
  7079. })
  7080. })
  7081. },
  7082. selListqx(){
  7083. this.fillWeekDialogVisi = false
  7084. this.selProjectList = []
  7085. this.selCon = []
  7086. },
  7087. handleScroll() {
  7088. this.changdu = this.projectList.length + 1
  7089. },
  7090. // 自动选择时间点的事件
  7091. // async zhoTimes(item, i) {
  7092. // var iss = i
  7093. // if(item.time == null) {
  7094. // return
  7095. // } else {
  7096. // const zhi = this.zhoData[iss];
  7097. // let he = 0;
  7098. // const timeArr = Object.values(zhi)
  7099. // .filter(item => item.time && item.time.length > 0 && item !== zhi.zhoDataTime && item !== zhi.he)
  7100. // .map(item => ({ startTime: item.time[0], endTime: item.time[1] }));
  7101. // const data = await this.getWeekHoursByTimeRange(timeArr);
  7102. // console.log(data, 'data');
  7103. // zhi.he = `${he}h`;
  7104. // }
  7105. // },
  7106. async zhoTimes(item, index) {
  7107. const zho = this.zhoData[index];
  7108. if (!item.time) {
  7109. return;
  7110. }
  7111. const timeArr = Object.values(zho)
  7112. .filter(({ time }) => time && time.length > 0 && time !== zho.zhoDataTime && time !== zho.he)
  7113. .map(({ time }) => ({ startTime: time[0], endTime: time[1] }));
  7114. const totalHours = await Promise.all([{}].map(() => this.getWeekHoursByTimeRange(timeArr)));
  7115. zho.he = `${totalHours[0]}h`;
  7116. },
  7117. // 判断两个时间段是否重叠
  7118. timeOverlap(idx, dateAr) {
  7119. let zhi = 0
  7120. for (let k in dateAr) {
  7121. if (idx !== k) {
  7122. 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))) {
  7123. // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
  7124. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
  7125. zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
  7126. }
  7127. // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
  7128. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7129. zhi += +this.getHour(dateAr[idx].s, dateAr[k].e)
  7130. } else if(dateAr[idx].s < dateAr[k].s && dateAr[idx].e > dateAr[k].e) {
  7131. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7132. } else {
  7133. // 选择的结束时间处于设置的休息时间段内 (选择的结束时间处于的休息时间段)
  7134. if(dateAr[k].e < dateAr[idx].e && dateAr[k].e > dateAr[idx].s) {
  7135. zhi += +this.getHour(dateAr[k].e, dateAr[idx].e)
  7136. }
  7137. // 选择的开始时间处于设置的休息时间段内 (选择的开始时间处于的休息时间段)
  7138. if(dateAr[idx].s > dateAr[k].s && dateAr[idx].s < dateAr[k].e) {
  7139. zhi += +this.getHour(dateAr[k].e, dateAr[idx].s)
  7140. }
  7141. }
  7142. }
  7143. }
  7144. }
  7145. return zhi
  7146. },
  7147. // 计算时间
  7148. getHourMinutes(str, end) {
  7149. var he = 0
  7150. var date2 = '2021/12/12 ' + end +':00'
  7151. var date1 = '2021/12/12 ' + str +':00'
  7152. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  7153. var leave1=date3%(24*3600*1000)
  7154. var hours=Math.floor(leave1/(3600*1000))
  7155. var leave2=leave1%(3600*1000)
  7156. var minutes=Math.floor(leave2/(60*1000))
  7157. var shi = hours+'.'+ minutes
  7158. return he += +shi
  7159. },
  7160. // 自动选择事件长度的事件
  7161. zhoXuan(item, i) {
  7162. var iss = i
  7163. if(item.time == null) {
  7164. return
  7165. } else {
  7166. var zhi = this.zhoData[iss]
  7167. var he = 0
  7168. for(var i in zhi) {
  7169. const workingTimeStr = zhi[i].workingTime ? zhi[i].workingTime + '' : ''
  7170. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && workingTimeStr.length > 0) {
  7171. console.log('执行')
  7172. he += +zhi[i].workingTime
  7173. }
  7174. }
  7175. zhi.he = he + 'h'
  7176. }
  7177. },
  7178. getPushWorkLogData(){
  7179. this.http.post('/sap-sync-log/list', {},
  7180. res => {
  7181. if (res.code == "ok") {
  7182. this.pushWorkTimeLogData = res.data;
  7183. } else {
  7184. this.$message({
  7185. message: res.msg,
  7186. type: "error"
  7187. });
  7188. }
  7189. },
  7190. error => {
  7191. this.$message({
  7192. message: error,
  7193. type: "error"
  7194. });
  7195. });
  7196. },
  7197. // 获取全部人员
  7198. getUsers() {
  7199. this.http.post('/user/getSimpleActiveUserList', {},
  7200. res => {
  7201. if (res.code == "ok") {
  7202. this.usersList = res.data;
  7203. } else {
  7204. this.$message({
  7205. message: res.msg,
  7206. type: "error"
  7207. });
  7208. }
  7209. },
  7210. error => {
  7211. this.$message({
  7212. message: error,
  7213. type: "error"
  7214. });
  7215. });
  7216. },
  7217. // 按时间比例
  7218. addBli(item, i) {
  7219. var iss = i
  7220. if(item.time == null) {
  7221. return
  7222. } else {
  7223. var zhi = this.zhoData[iss]
  7224. var he = 0
  7225. for(var i in zhi) {
  7226. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  7227. he += +zhi[i].workingTime
  7228. }
  7229. }
  7230. zhi.he = he.toFixed(1) + 'h'
  7231. }
  7232. },
  7233. //按周填报选择的项目发生变化,需要设置列
  7234. onSelProjectChange() {
  7235. for (let i = 0; i < this.selCon.length; i++) {
  7236. var exists = false;
  7237. for (let j = 0; j < this.selProjectList.length; j++) {
  7238. if (this.selProjectList[j].id == this.selCon[i]) {
  7239. exists = true;
  7240. break;
  7241. }
  7242. }
  7243. if (!exists) {
  7244. var newProject = this.fillProjectList.filter(f=>f.id == this.selCon[i])[0];
  7245. this.selProjectList.push(newProject);
  7246. //添加新项目
  7247. for (var w in this.zhoData) {
  7248. var dayItem = this.zhoData[w];
  7249. var pName = newProject.projectName;
  7250. dayItem[pName] = {};
  7251. dayItem[pName].time = ''
  7252. dayItem[pName].content = ''
  7253. dayItem[pName].progress = 0
  7254. dayItem[pName].workingTime = 0
  7255. }
  7256. }
  7257. }
  7258. //去掉
  7259. for (let j = 0; j < this.selProjectList.length; j++) {
  7260. var exists = false;
  7261. for (let i = 0; i < this.selCon.length; i++) {
  7262. if (this.selProjectList[j].id == this.selCon[i]) {
  7263. exists = true;
  7264. break;
  7265. }
  7266. }
  7267. if (!exists) {
  7268. this.selProjectList.splice(j, 1);
  7269. j--;
  7270. }
  7271. }
  7272. this.loadFilledWeekReportItem();
  7273. //刷新表格
  7274. // this.$refs.weekTable.doLayout();
  7275. },
  7276. //根据选中的项目来刷新填写表格
  7277. loadFilledWeekReportItem() {
  7278. for (var w in this.zhoData) {
  7279. var dayItem = this.zhoData[w];
  7280. for (var i = 0; i < this.selProjectList.length; i++) {
  7281. var curColumnProject = this.selProjectList[i];
  7282. var dayProjectReportItem = dayItem[curColumnProject.projectName];
  7283. for (var t in dayItem.reportList) {
  7284. //有日报的项目,不能取消选择
  7285. for (var p in this.fillProjectList) {
  7286. if (this.fillProjectList[p].id == dayItem.reportList[t].projectId) this.fillProjectList[p].canCancel = 0;
  7287. }
  7288. if (dayItem.reportList[t].projectId == curColumnProject.id) {
  7289. // console.log('dateItem=='+JSON.stringify(dayItem.reportList[t]));
  7290. dayItem[curColumnProject.projectName] = dayItem.reportList[t];
  7291. if (this.reportTimeType.type == 2) {
  7292. //时间段模式
  7293. dayItem[curColumnProject.projectName].time = [dayItem.reportList[t].startTime, dayItem.reportList[t].endTime];
  7294. }
  7295. // this.$set(dayItem, curColumnProject.projectName, dayItem.reportList[t]);
  7296. break;
  7297. }
  7298. }
  7299. // dayItem[curColumnProject.projectName] = matchReportItem;
  7300. }
  7301. }
  7302. this.$nextTick(()=>{
  7303. this.$refs.weekTable.doLayout();
  7304. });
  7305. },
  7306. initWeekFormData() {
  7307. this.weekDataLoading = true;
  7308. for (var p in this.fillProjectList) {
  7309. this.fillProjectList[p].canCancel = 1;
  7310. }
  7311. var param = {
  7312. targetDate: util.formatDate.format(this.targetWeekDate, "yyyy-MM-dd")
  7313. };
  7314. if (this.isSubstitude) {
  7315. //传代填人的userId
  7316. param.targetUserId = this.workForm.userId[0];
  7317. }
  7318. this.http.post('/report/getWeeklyReportData',param,res => {
  7319. this.weekDataLoading = false;
  7320. if(res.code == 'ok'){
  7321. let projectList = res.data.projectList;
  7322. if (projectList.length > 0) {
  7323. //有选择过项目进行填报,直接选中
  7324. this.selProjectList = projectList;
  7325. this.selCon = [];
  7326. for (let i = 0; i < projectList.length; i++) {
  7327. this.selCon.push(projectList[i].id);
  7328. }
  7329. }
  7330. //设置日期
  7331. this.weekDateRange = res.data.dateList;
  7332. this.zhoData = [];
  7333. var arrst = []
  7334. for(var i in this.weekDateRange) {
  7335. var obj = {}
  7336. obj.zhoDataTime = this.weekDateRange[i].date
  7337. obj.zhoDataTimeTxt = this.weekDateRange[i].weekDayTxt
  7338. obj.he = this.weekDateRange[i].filledTime;
  7339. obj.canFill = this.weekDateRange[i].canFill;
  7340. // obj.filledTime = this.weekDateRange[i].filledTime;
  7341. obj.reportList = this.weekDateRange[i].reportList;
  7342. //初始化,防止渲染报错
  7343. for (var j = 0; j < this.selProjectList.length; j++) {
  7344. var pName = this.selProjectList[j].projectName
  7345. obj[pName] = {}
  7346. obj[pName].time = ''
  7347. obj[pName].content = ''
  7348. obj[pName].progress = 0
  7349. obj[pName].workingTime = 0
  7350. }
  7351. arrst.push(obj)
  7352. }
  7353. this.zhoData = arrst
  7354. this.setWeekCardTimeData(res.data.cardTimeList);
  7355. this.loadFilledWeekReportItem();
  7356. }else{
  7357. this.$message({
  7358. message: res.msg,
  7359. type: 'error'
  7360. })
  7361. }
  7362. },err => {
  7363. this.$message({
  7364. message: err,
  7365. type: 'error'
  7366. })
  7367. })
  7368. },
  7369. zhoZhi(res, i) {
  7370. var zhi = 0
  7371. for(var i in res) {
  7372. if(i != 'zhoDataTime' && i != 'he') {
  7373. zhi += +res[i]
  7374. }
  7375. }
  7376. res.he = zhi
  7377. },
  7378. zhoBtn(i) {
  7379. // this.zhoData.split(i, 1)
  7380. var arr = this.zhoData
  7381. arr.splice(i, 1)
  7382. },
  7383. zhoAddlast(){
  7384. this.selConShow = true
  7385. },
  7386. closeAddWeeklyReport(){
  7387. this.fillWeekDialogVisi = false
  7388. this.selConShow = true
  7389. this.selProjectList = []
  7390. this.selCon = []
  7391. },
  7392. checkDateWorkTime() {
  7393. //针对苏州景昱,单独的检查逻辑
  7394. if (this.user.companyId == 5978) {
  7395. //调接口,先检查工时是否存在异常
  7396. var zhi = this.zhoData;
  7397. var array = [];
  7398. for(let n in zhi){
  7399. if(zhi[n].he){
  7400. var workData = {date: zhi[n].zhoDataTime, workingTime: zhi[n].he};
  7401. array.push(workData)
  7402. }
  7403. }
  7404. this.submitingReport = true;
  7405. this.http.post('/report/checkBeiSengCardTime', {userId:this.user.id, dateWorkingTime:JSON.stringify(array)},
  7406. res => {
  7407. this.submitingReport = false;
  7408. if (res.code == "ok") {
  7409. this.submitWeekReport(0)
  7410. } else {
  7411. this.$confirm(res.msg, this.$t('other.prompts'), {
  7412. confirmButtonText: this.$t('huLveBingTiJiao'),
  7413. cancelButtonText: this.$t('btn.cancel'),
  7414. type: 'error'
  7415. }).then(() => {
  7416. this.submitWeekReport(0)
  7417. }).catch(() => {
  7418. });
  7419. }
  7420. },
  7421. error => {
  7422. this.$message({
  7423. message: error,
  7424. type: "error"
  7425. });
  7426. });
  7427. }
  7428. },
  7429. // 提交按周填报
  7430. submitWeekReport(isDraft) {
  7431. var zhi = this.zhoData
  7432. var ll = 0
  7433. const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
  7434. if(this.reportTimeType.type == 2) {
  7435. for(var i in zhi) {
  7436. this.dateAr = []
  7437. var alp = []
  7438. var zhis = zhi[i]
  7439. for(var j in zhis) {
  7440. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  7441. let objs = {}
  7442. objs.s = zhis[j].time[0]
  7443. objs.e = zhis[j].time[1]
  7444. objs.p = j
  7445. alp.push(objs)
  7446. }
  7447. }
  7448. this.dateAr = alp
  7449. if (this.reportTimeType.timeCanOverlap == 0) {
  7450. let str = this.$t('message.Filledtimeperiodsoverlap')
  7451. if(this.dateAr.length > 0) {
  7452. const trus = this.fns();
  7453. const overlapDataTime = this.getOverlapData(alp);
  7454. if (overlapDataTime.length > 0) {
  7455. const arrList = overlapDataTime.map((item) => item.p);
  7456. str = `${this.zhoData[i].zhoDataTime} 【${arrList.join(',')}】项目 填写的时间段重叠`;
  7457. }
  7458. ll += 1
  7459. if(!trus) {
  7460. this.$message({
  7461. message: str,
  7462. type: 'error'
  7463. })
  7464. return false
  7465. }
  7466. }
  7467. } else {
  7468. if(this.dateAr.length > 0) {
  7469. ll +=1 ;
  7470. }
  7471. }
  7472. }
  7473. if(ll == 0) {
  7474. this.$message({
  7475. message: this.$t('message.Pleasefillinthetime'),
  7476. type: 'error'
  7477. })
  7478. return false
  7479. }
  7480. } else if(this.reportTimeType.type == 1){
  7481. for(var i in zhi) {
  7482. var zhis = zhi[i]
  7483. for(var j in zhis) {
  7484. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  7485. ll += 1
  7486. }
  7487. }
  7488. }
  7489. if(ll == 0) {
  7490. this.$message({
  7491. message: this.$t('message.Pleaseselectatime'),
  7492. type: 'error'
  7493. })
  7494. return false
  7495. }
  7496. let overcorp = ''
  7497. for(let n in zhi){
  7498. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  7499. overcorp += zhi[n].zhoDataTime + ','
  7500. }
  7501. }
  7502. if(this.user.companyId != 5978 && this.user.companyId != 7536 && overcorp != ''){
  7503. overcorp = overcorp.substring(0,overcorp.length - 1)
  7504. this.$message({
  7505. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  7506. type: 'error'
  7507. })
  7508. return
  7509. }
  7510. }
  7511. var submits = []
  7512. let formData = new FormData();
  7513. formData.append("draft", isDraft);
  7514. if(this.reportTimeType.multiWorktime == 1){
  7515. for (var i in this.zhoData) {
  7516. var zhoD = this.zhoData[i]
  7517. var flgs = false
  7518. for(var j in zhoD) {
  7519. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  7520. flgs = true
  7521. // formData.append("degreeId", "-1");
  7522. formData.append("id", '-1');
  7523. if (this.isSubstitude) {
  7524. formData.append('targetUids',this.workForm.userId[0]);
  7525. }
  7526. for(var s in this.selProjectList) {
  7527. if(j == this.selProjectList[s].projectName) {
  7528. formData.append("projectId", this.selProjectList[s].id);
  7529. break;
  7530. }
  7531. }
  7532. if(this.user.timeType.reportAuditType == 3){
  7533. let audItem = {}
  7534. if(this.user.timeType.auditLevel > 0){
  7535. audItem.auditorFirst = zhoD[j].auditorFirst
  7536. }
  7537. if(this.user.timeType.auditLevel > 1){
  7538. audItem.auditorSec = zhoD[j].auditorSec
  7539. }
  7540. if(this.user.timeType.auditLevel > 2){
  7541. audItem.auditorThird = zhoD[j].auditorThird
  7542. }
  7543. if(zhoD[j].ccUserid){
  7544. audItem.ccUserid = zhoD[j].ccUserid
  7545. }
  7546. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7547. }
  7548. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7549. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7550. formData.append("reportTimeType", this.reportTimeType.type);
  7551. formData.append("endTime", '');
  7552. formData.append("startTime", '');
  7553. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7554. var lix = []
  7555. var objjs = {}
  7556. objjs.startTime = zhoD[j].time[0]
  7557. objjs.endTime = zhoD[j].time[1]
  7558. if (zhoD[j].content == null || zhoD[j].content == '') {
  7559. zhoD[j].content == '-'
  7560. }
  7561. objjs.content = zhoD[j].content
  7562. lix.push(objjs)
  7563. var zhiZhi = JSON.stringify(lix)
  7564. zhiZhi = zhiZhi.replace(/,/g,"@");
  7565. formData.append("content", zhiZhi)
  7566. formData.append("isOvertime", 0)
  7567. formData.append("professionProgress", "[]")
  7568. if (zhoD[j].groupId) {
  7569. formData.append("groupId",zhoD[j].groupId)
  7570. } else {
  7571. //解决后台groupId数组越界的问题
  7572. formData.append("groupId",0)
  7573. }
  7574. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7575. formData.append("createDate",zhoD.zhoDataTime)
  7576. if (zhoD[j].projectAuditorId) {
  7577. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7578. }
  7579. if(zhoD[j].basecostId) {
  7580. formData.append("basecostId", zhoD[j].basecostId);
  7581. } else {
  7582. formData.append("basecostId", 0);
  7583. }
  7584. if(this.user.timeType.customDegreeActive){
  7585. if (this.user.timeType.customDegreeMultiple) {
  7586. if (zhoD[j].multiDegrIdArray) {
  7587. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray));
  7588. } else {
  7589. formData.append('multiDegrId','[]')
  7590. }
  7591. } else {
  7592. if (zhoD[j].degreeId) {
  7593. formData.append('degreeId',zhoD[j].degreeId)
  7594. } else {
  7595. formData.append('degreeId','-1')
  7596. }
  7597. }
  7598. }else{
  7599. formData.append("degreeId", "-1");
  7600. }
  7601. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7602. formData.append('customData',zhoD[j].customData)
  7603. }else if(this.user.timeType.customDataActive){
  7604. formData.append('customData',0)
  7605. }
  7606. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7607. formData.append('customText',zhoD[j].customText)
  7608. }else if(this.user.timeType.customTextActive){
  7609. formData.append('customText','-')
  7610. }
  7611. if(reportExtraField4Name || reportExtraField5Name) {
  7612. formData.append('extraField4', zhoD[j].extraField4 || '')
  7613. formData.append('extraField5', zhoD[j].extraField5 || '')
  7614. }
  7615. }
  7616. }
  7617. }
  7618. } else {
  7619. for (var i in this.zhoData) {
  7620. var zhoD = this.zhoData[i]
  7621. var flgs = false
  7622. if(this.reportTimeType.type == 2) {
  7623. for(var k in this.selProjectList) {
  7624. var pItem = this.selProjectList[k];
  7625. var pName = pItem.projectName;
  7626. var j = pName;
  7627. var pid = pItem.id;
  7628. console.log('j==周报中的项目='+j);
  7629. if(zhoD[j].time && zhoD[j].time != 'null') {
  7630. flgs = true
  7631. // formData.append("degreeId", "-1");
  7632. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7633. if (this.isSubstitude) {
  7634. formData.append('targetUids',this.workForm.userId[0]);
  7635. }
  7636. formData.append("projectId", pid);
  7637. if(this.user.timeType.reportAuditType == 3){
  7638. let audItem = {}
  7639. if(this.user.timeType.auditLevel > 0){
  7640. audItem.auditorFirst = zhoD[j].auditorFirst
  7641. }
  7642. if(this.user.timeType.auditLevel > 1){
  7643. audItem.auditorSec = zhoD[j].auditorSec
  7644. }
  7645. if(this.user.timeType.auditLevel > 2){
  7646. audItem.auditorThird = zhoD[j].auditorThird
  7647. }
  7648. if(zhoD[j].ccUserid){
  7649. audItem.ccUserid = zhoD[j].ccUserid
  7650. }
  7651. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7652. }
  7653. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  7654. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7655. formData.append("reportTimeType", this.reportTimeType.type);
  7656. formData.append("endTime", zhoD[j].time[1]);
  7657. formData.append("startTime", zhoD[j].time[0]);
  7658. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7659. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7660. formData.append("isOvertime", 0)
  7661. formData.append("professionProgress", "[]")
  7662. if (zhoD[j].groupId) {
  7663. formData.append("groupId",zhoD[j].groupId)
  7664. } else {
  7665. //解决后台groupId数组越界的问题
  7666. formData.append("groupId",0)
  7667. }
  7668. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7669. formData.append("createDate",zhoD.zhoDataTime)
  7670. if (zhoD[j].projectAuditorId) {
  7671. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7672. } else {
  7673. //对齐数据
  7674. formData.append("projectAuditorId",'-');
  7675. }
  7676. if(zhoD[j].basecostId) {
  7677. formData.append("basecostId", zhoD[j].basecostId);
  7678. } else {
  7679. formData.append("basecostId", 0);
  7680. }
  7681. if(this.user.timeType.customDegreeActive){
  7682. if (this.user.timeType.customDegreeMultiple) {
  7683. if (zhoD[j].multiDegrIdArray) {
  7684. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7685. } else {
  7686. formData.append("multiDegrId", "[]");
  7687. }
  7688. } else {
  7689. if (zhoD[j].degreeId) {
  7690. formData.append('degreeId',zhoD[j].degreeId)
  7691. } else {
  7692. formData.append("degreeId", "-1");
  7693. }
  7694. }
  7695. }else{
  7696. formData.append("degreeId", "-1");
  7697. }
  7698. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7699. formData.append('customData',zhoD[j].customData)
  7700. }else if(this.user.timeType.customDataActive){
  7701. formData.append('customData',0)
  7702. }
  7703. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7704. formData.append('customText',zhoD[j].customText)
  7705. }else if(this.user.timeType.customTextActive){
  7706. formData.append('customText','-')
  7707. }
  7708. if(reportExtraField4Name || reportExtraField5Name) {
  7709. formData.append('extraField4', zhoD[j].extraField4 || '')
  7710. formData.append('extraField5', zhoD[j].extraField5 || '')
  7711. }
  7712. }
  7713. }
  7714. } else {
  7715. for(var k in this.selProjectList) {
  7716. var pItem = this.selProjectList[k];
  7717. var pName = pItem.projectName;
  7718. var j = pName;
  7719. if(zhoD[j].workingTime && zhoD[j].workingTime != 'null') {
  7720. flgs = true
  7721. // formData.append("degreeId", "-1");
  7722. console.log('进入了workFpppp==='+j);
  7723. formData.append("id", zhoD[j].id==null?'-1':zhoD[j].id);
  7724. if (this.isSubstitude) {
  7725. formData.append('targetUids',this.workForm.userId[0]);
  7726. }
  7727. formData.append("projectId", pItem.id);
  7728. if(this.user.timeType.reportAuditType == 3){
  7729. let audItem = {}
  7730. if(this.user.timeType.auditLevel > 0){
  7731. audItem.auditorFirst = zhoD[j].auditorFirst
  7732. }
  7733. if(this.user.timeType.auditLevel > 1){
  7734. audItem.auditorSec = zhoD[j].auditorSec
  7735. }
  7736. if(this.user.timeType.auditLevel > 2){
  7737. audItem.auditorThird = zhoD[j].auditorThird
  7738. }
  7739. if(zhoD[j].ccUserid){
  7740. audItem.ccUserid = zhoD[j].ccUserid
  7741. }
  7742. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  7743. }
  7744. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  7745. // formData.append("subProjectId", zhoD[j].subProjectId);
  7746. formData.append("taskId", zhoD[j].taskId ? zhoD[j].taskId : 0);
  7747. formData.append("reportTimeType", this.reportTimeType.type);
  7748. if(this.reportTimeType.type == 1) {
  7749. formData.append("workingTime", zhoD[j].workingTime);
  7750. } else if(this.reportTimeType.type == 2) {
  7751. formData.append("endTime", zhoD[j].time[1]);
  7752. formData.append("startTime", zhoD[j].time[0]);
  7753. } else if(this.reportTimeType.type == 3) {
  7754. formData.append("progress", zhoD[j].progress);
  7755. formData.append("workingTime", zhoD[j].workingTime);
  7756. }
  7757. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  7758. zhoD[j].content == '' || zhoD[j].content == null ? formData.append("content", '-') : formData.append("content", zhoD[j].content)
  7759. formData.append("isOvertime", 0)
  7760. formData.append("professionProgress", "[]")
  7761. if (zhoD[j].groupId) {
  7762. formData.append("groupId",zhoD[j].groupId)
  7763. } else {
  7764. //解决后台groupId数组越界的问题
  7765. formData.append("groupId",0)
  7766. }
  7767. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  7768. formData.append("createDate",zhoD.zhoDataTime)
  7769. if (zhoD[j].projectAuditorId) {
  7770. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  7771. } else {
  7772. //对齐数据
  7773. formData.append("projectAuditorId",'-')
  7774. }
  7775. if(zhoD[j].basecostId) {
  7776. formData.append("basecostId", zhoD[j].basecostId);
  7777. } else {
  7778. formData.append("basecostId", 0);
  7779. }
  7780. if(this.user.timeType.customDegreeActive){
  7781. if (this.user.timeType.customDegreeMultiple) {
  7782. if (zhoD[j].multiDegrIdArray) {
  7783. formData.append('multiDegrId',JSON.stringify(zhoD[j].multiDegrIdArray))
  7784. } else {
  7785. formData.append("multiDegrId", "[]");
  7786. }
  7787. } else {
  7788. if (zhoD[j].degreeId) {
  7789. formData.append('degreeId',zhoD[j].degreeId)
  7790. } else {
  7791. formData.append("degreeId", "-1");
  7792. }
  7793. }
  7794. }else{
  7795. formData.append("degreeId", "-1");
  7796. }
  7797. if(this.user.timeType.customDataActive && zhoD[j].customData){
  7798. formData.append('customData',zhoD[j].customData)
  7799. }else if(this.user.timeType.customDataActive){
  7800. formData.append('customData',0)
  7801. }
  7802. if(this.user.timeType.customTextActive && zhoD[j].customText){
  7803. formData.append('customText',zhoD[j].customText)
  7804. }else if(this.user.timeType.customTextActive){
  7805. formData.append('customText','-')
  7806. }
  7807. if(reportExtraField4Name || reportExtraField5Name) {
  7808. formData.append('extraField4', zhoD[j].extraField4 || '')
  7809. formData.append('extraField5', zhoD[j].extraField5 || '')
  7810. }
  7811. }
  7812. }
  7813. }
  7814. }
  7815. }
  7816. // 对于先分组负责人审核再项目经理审核的模式,分组要必选
  7817. let { next, error } = this.handleGroupAuditorData(this.zhoData)
  7818. if(!next) {
  7819. this.$message({
  7820. message: `【${error.join('、')}】` + this.$t('qingTianXieRenWuFenZu'),
  7821. type: 'error'
  7822. })
  7823. return
  7824. }
  7825. // 自定义维度
  7826. this.submitingReport = true;
  7827. this.http.uploadFile( this.port.report.editPort, formData,
  7828. res => {
  7829. // this.listLoading = false;
  7830. this.submitingReport = false;
  7831. if (res.code == "ok") {
  7832. this.$message({
  7833. message: this.$t('message.fillinsuccessfully'),
  7834. type: "success"
  7835. });
  7836. this.fillWeekDialogVisi = false
  7837. this.selConShow = true
  7838. this.zhoData = []
  7839. this.weekDateRange = ''
  7840. this.getReportList();
  7841. this.getDepartment();
  7842. // 关闭弹窗 并 清空
  7843. this.selProjectList = []
  7844. this.selCon = []
  7845. this.getRecentlyProject()
  7846. } else {
  7847. this.$message({
  7848. message: res.msg,
  7849. type: "error"
  7850. });
  7851. }
  7852. },
  7853. error => {
  7854. this.submitingReport = false;
  7855. this.$message({
  7856. message: error,
  7857. type: "error"
  7858. });
  7859. });
  7860. },
  7861. handleGroupAuditorData(data) {
  7862. const { reportAuditType } = this.user.timeType
  7863. if(reportAuditType != 1 && reportAuditType != 2) {
  7864. return {next: true}
  7865. }
  7866. let arrList = [];
  7867. Object.entries(data).forEach(([key, obj]) => {
  7868. Object.entries(obj).forEach(([projectName, projectData]) => {
  7869. if (projectData.workingTime && !projectData.groupId) {
  7870. arrList.push({
  7871. projectName,
  7872. date: obj.zhoDataTime,
  7873. dateText: obj.zhoDataTimeTxt
  7874. });
  7875. }
  7876. });
  7877. });
  7878. if(arrList.length > 0) {
  7879. return {
  7880. next: false,
  7881. error: arrList.map(item => `【${item.date} ${item.dateText} `+ this.$t('zhongDe')+ `(${item.projectName})` + this.$t('other.project')+ `】`),
  7882. }
  7883. } else {
  7884. return {
  7885. next: true,
  7886. error: [],
  7887. }
  7888. }
  7889. },
  7890. ChangeHourMinutestr (str) {
  7891. if (str !== "0" && str !== "" && str !== null) {
  7892. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  7893. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  7894. } else {
  7895. return "";
  7896. }
  7897. },
  7898. // 得到两个日期中间的日期
  7899. getdiffdate(stime,etime){
  7900. //初始化日期列表,数组
  7901. var diffdate = new Array();
  7902. var i=0;
  7903. //开始日期小于等于结束日期,并循环
  7904. while(stime<=etime){
  7905. diffdate[i] = stime;
  7906. //获取开始日期时间戳
  7907. var stime_ts = new Date(stime).getTime();
  7908. //增加一天时间戳后的日期
  7909. var next_date = stime_ts + (24*60*60*1000);
  7910. //拼接年月日,这里的月份会返回(0-11),所以要+1
  7911. var next_dates_y = new Date(next_date).getFullYear()+'-';
  7912. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  7913. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  7914. stime = next_dates_y+next_dates_m+next_dates_d;
  7915. //增加数组key
  7916. i++;
  7917. }
  7918. return diffdate;
  7919. },
  7920. // 添加模块
  7921. addDomain(i) {
  7922. var leftProgress = 10;
  7923. if (this.reportTimeType.type == 3) {
  7924. //计算已经待分配工时比例
  7925. let array = this.workForm.domains;
  7926. let totalProgress = 0;
  7927. for (var i=0;i<array.length; i++) {
  7928. totalProgress += array[i].progress;
  7929. }
  7930. if (totalProgress < 100) {
  7931. leftProgress = 100 - totalProgress;
  7932. }
  7933. }
  7934. var addItem = {
  7935. projectId: "",
  7936. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):(
  7937. this.reportTimeType.type==2?"":(this.reportTimeType.allday).toFixed(1)
  7938. ),
  7939. content: "",
  7940. progress:leftProgress,
  7941. state:2,//2-表示待提交
  7942. multiWorktime: this.reportTimeType.multiWorktime,
  7943. worktimeList:[{}],
  7944. canEdit: true,
  7945. auditorFirst: '',
  7946. auditorSec: '',
  7947. auditorThird: '',
  7948. ccUserid: ''
  7949. // degreeId: '',
  7950. };
  7951. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  7952. this.$set(addItem,'isOvertime',true)
  7953. if(this.reportTimeType.type == 3){
  7954. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  7955. }
  7956. }
  7957. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  7958. //默认给第一个,必填字段
  7959. addItem.basecostId = this.timeBasecostList[0].id;
  7960. }
  7961. this.workForm.domains.push(addItem);
  7962. document.getElementById('workFormsItemBottom').scrollIntoView()
  7963. this.canEdit = true
  7964. if (this.reportTimeType.type == 0) {
  7965. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  7966. var length = this.workForm.domains.length;
  7967. if (length == 2) {
  7968. this.showAddMore = false;
  7969. }
  7970. }
  7971. this.chuji()
  7972. this.seleChn()
  7973. },
  7974. // 移除模块
  7975. delDomain(i) {
  7976. this.workForm.domains.splice(i,1)
  7977. //最初不可编辑的情况下,可能存在添加后删除,保留的都是审核通过的,则变成不可编辑。 如果最初是可编辑的,则一直可编辑提交。
  7978. if (!this.originCanEdit) {
  7979. let iscan = false
  7980. for(let i in this.workForm.domains){
  7981. if(this.workForm.domains[i].canEdit){
  7982. iscan = true
  7983. }
  7984. }
  7985. this.canEdit = iscan
  7986. }
  7987. //检测当前剩下的一个,时间类型是否是全天
  7988. if (this.reportTimeType.type == 0) {
  7989. if (this.workForm.domains[0].timeType == 0) {
  7990. this.showAddMore = false;
  7991. } else {
  7992. this.showAddMore = true;
  7993. }
  7994. }
  7995. if(this.user.timeType.multiWorktime == 1) {
  7996. this.iptChangs()
  7997. } else {
  7998. this.seleChn(0)
  7999. }
  8000. },
  8001. // 改变月份
  8002. changeMonth() {
  8003. this.isWeekend = false
  8004. let date = new Date()
  8005. let nowmon = date.getMonth() + 1
  8006. let nowday = date.getDate()
  8007. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  8008. if (this.isBatch == 0) {
  8009. if(this.user.timeType.fillAhead == 0){
  8010. let date_a = new Date(this.workForm.createDate)
  8011. if(date_a.getTime() > date.getTime()){
  8012. this.workForm.createDate = nowdate
  8013. }
  8014. }
  8015. //只有按天填报才能获取当天的日报
  8016. if(!this.isSubstitude){
  8017. let weekday = new Date(this.workForm.createDate).getDay()
  8018. if(this.user.companyId == 817){
  8019. if(weekday == 0){
  8020. this.isWeekend = true
  8021. }
  8022. }else{
  8023. if(weekday == 0 || weekday == 6){
  8024. this.isWeekend = true
  8025. }
  8026. }
  8027. this.getReport()
  8028. } else {
  8029. //获取代填人员的考勤
  8030. if (this.user.timeType.showCorpwxCardtime == 1) {
  8031. this.getTargetUserCardTime();
  8032. }
  8033. }
  8034. }else {
  8035. if(this.user.timeType.fillAhead == 0){
  8036. let date_a = new Date(this.workForm.createDate[1])
  8037. if(date_a.getTime() > date.getTime()){
  8038. this.workForm.createDate[1] = nowdate
  8039. let sdate = new Date(this.workForm.createDate[0])
  8040. let edate = new Date(this.workForm.createDate[1])
  8041. if(sdate > edate){
  8042. this.workForm.createDate[0] = this.workForm.createDate[1]
  8043. }
  8044. }
  8045. }
  8046. }
  8047. },
  8048. // 判断时间段
  8049. fns() {
  8050. for (let k in this.dateAr) {
  8051. if (!this.judege(k)) {
  8052. return false
  8053. }
  8054. }
  8055. return true
  8056. },
  8057. judege(idx){
  8058. for (let k in this.dateAr) {
  8059. if (idx !== k) {
  8060. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  8061. return false
  8062. }
  8063. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  8064. return false
  8065. }
  8066. }
  8067. }
  8068. return true
  8069. },
  8070. getOverlapData(data) {
  8071. let overlapData = [];
  8072. for (let i = 0; i < data.length; i++) {
  8073. for (let j = i + 1; j < data.length; j++) {
  8074. if (data[i].s < data[j].e && data[j].s < data[i].e) {
  8075. overlapData.push(data[i], data[j]);
  8076. }
  8077. }
  8078. }
  8079. return overlapData;
  8080. },
  8081. // 保存日报111111
  8082. submitReport(isDraft) {
  8083. this.isDraft = isDraft;
  8084. this.$refs.workForm.validate(valid => {
  8085. if (valid) {
  8086. if (!isDraft) {
  8087. //针对苏州景昱,单独的检查逻辑
  8088. if (this.user.companyId == 5978) {
  8089. //调接口,先检查工时是否存在异常
  8090. var totalTime = 0;
  8091. for (var t=0;t<this.workForm.domains.length; t++) {
  8092. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8093. }
  8094. var array = [];
  8095. if (this.isBatch) {
  8096. var startDate = new Date(this.workForm.createDate[0]);
  8097. var endDate = new Date(this.workForm.createDate[1]);
  8098. if (startDate > endDate) {
  8099. this.$message({
  8100. message: this.$t('kaiShiRiQiBuNengDaYuJieShuRiQi'),
  8101. type: "error"
  8102. });
  8103. return
  8104. } else {
  8105. while(true){
  8106. var workData = {date: util.formatDate.format(startDate, "yyyy-MM-dd"), workingTime: totalTime};
  8107. array.push(workData);
  8108. startDate.setDate(startDate.getDate() + 1);
  8109. if (startDate > endDate) {
  8110. break;
  8111. }
  8112. }
  8113. }
  8114. } else {
  8115. var workData = {date: this.workForm.createDate, workingTime: totalTime};
  8116. array.push(workData)
  8117. }
  8118. this.submitingReport = true;
  8119. var passUserId = this.user.id;
  8120. if (this.isSubstitude) {
  8121. passUserId = this.targetUids;
  8122. }
  8123. this.http.post('/report/checkBeiSengCardTime', {userId:passUserId, dateWorkingTime:JSON.stringify(array)},
  8124. res => {
  8125. this.submitingReport = false;
  8126. if (res.code == "ok") {
  8127. this.submitReportSon()
  8128. } else {
  8129. this.$confirm(res.msg, this.$t('other.prompts'), {
  8130. confirmButtonText: this.$t('huLveBingTiJiao'),
  8131. cancelButtonText: this.$t('btn.cancel'),
  8132. type: 'error'
  8133. }).then(() => {
  8134. this.submitReportSon()
  8135. }).catch(() => {
  8136. });
  8137. }
  8138. },
  8139. error => {
  8140. this.$message({
  8141. message: error,
  8142. type: "error"
  8143. });
  8144. });
  8145. } else if (this.user.companyId == 469) {
  8146. //试点,针对赛元微电子校验考勤工时
  8147. if (this.workForm.time && this.workForm.time.workHours) {
  8148. if (this.totalReportHours > this.workForm.time.workHours) {
  8149. this.$message({
  8150. message: '填报工时不得超过考勤时长',
  8151. type: "error"
  8152. });
  8153. } else if (this.totalReportHours < this.workForm.time.workHours) {
  8154. this.$confirm('还剩余'+(this.workForm.time.workHours-this.totalReportHours).toFixed(1)+'h考勤时长尚未分配,是否确定提交', this.$t('other.prompts'), {
  8155. confirmButtonText: this.$t('btn.determine'),
  8156. cancelButtonText: this.$t('btn.cancel'),
  8157. type: 'warning'
  8158. }).then(() => {
  8159. this.submitReportSon()
  8160. }).catch(() => {
  8161. });
  8162. } else {
  8163. this.submitReportSon();
  8164. }
  8165. } else {
  8166. this.$message({
  8167. message: '暂无考勤数据,无法填报。请尝试刷新考勤记录。',
  8168. type: "error"
  8169. });
  8170. }
  8171. } else {
  8172. if(this.totalReportHours < this.user.timeType.allday){
  8173. this.$confirm(this.$t('dangRiGongShiBuZu') + this.user.timeType.allday.toFixed(1) + this.$t('xiaoShiShiFouQueDingTiJiao'), this.$t('other.prompts'), {
  8174. confirmButtonText: this.$t('btn.determine'),
  8175. cancelButtonText: this.$t('btn.cancel'),
  8176. type: 'warning'
  8177. }).then(() => {
  8178. this.submitReportSon()
  8179. }).catch(() => {
  8180. });
  8181. }else{
  8182. this.submitReportSon()
  8183. }
  8184. }
  8185. } else {
  8186. //暂存,不需要检查工时是否超过考勤
  8187. this.submitReportSon()
  8188. }
  8189. }
  8190. });
  8191. },
  8192. submitReportSon() {
  8193. this.dateAr = []
  8194. //检查重叠
  8195. if (this.user.timeType.reportTimeType == 2 && this.user.timeType.timeCanOverlap == 0) {
  8196. let alp = []
  8197. if(this.user.timeType.multiWorktime != 1) {
  8198. for(var p in this.workForm.domains) {
  8199. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  8200. let objs = {}
  8201. objs.s = this.workForm.domains[p].startTime
  8202. objs.e = this.workForm.domains[p].endTime
  8203. alp.push(objs)
  8204. }
  8205. }
  8206. this.dateAr = alp
  8207. if(this.dateAr.length > 0) {
  8208. let trus = this.fns()
  8209. if(!trus) {
  8210. this.$message({
  8211. message: this.$t('message.Filledtimeperiodsoverlap'),
  8212. type: "error"
  8213. });
  8214. return
  8215. }
  8216. }
  8217. } else {
  8218. for(var p in this.workForm.domains) {
  8219. var slll = this.workForm.domains[p]
  8220. for(var o in slll.worktimeList) {
  8221. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  8222. let objs = {}
  8223. objs.s = slll.worktimeList[o].startTime
  8224. objs.e = slll.worktimeList[o].endTime
  8225. alp.push(objs)
  8226. }
  8227. }
  8228. }
  8229. this.dateAr = alp
  8230. if(this.dateAr.length > 0) {
  8231. let trus = this.fns()
  8232. if(!trus) {
  8233. this.$message({
  8234. message: this.$t('message.Filledtimeperiodsoverlap'),
  8235. type: "error"
  8236. });
  8237. return
  8238. }
  8239. }
  8240. }
  8241. }
  8242. //检查子项目
  8243. if (this.user.timeType.subProMustFill == 1) {
  8244. for(var p in this.workForm.domains) {
  8245. var oneProItem = this.workForm.domains[p]
  8246. if (oneProItem.subProjectList.length > 0 && !oneProItem.subProjectId) {
  8247. //没有选择子项目
  8248. this.$message({
  8249. message: this.$t('ziXiangMuBiTianQingJianCha'),
  8250. type: "error"
  8251. });
  8252. return
  8253. }
  8254. }
  8255. }
  8256. //昱众需要检查新增的角色,工作职责,工作内容是否填写
  8257. if (this.user.companyId == this.yuzhongCompId) {
  8258. for(var p in this.workForm.domains) {
  8259. var oneProItem = this.workForm.domains[p]
  8260. if (!oneProItem.extraField1) {
  8261. this.$message({
  8262. message: this.$t('jiaoSeBiTianQingJianCha'),
  8263. type: "error"
  8264. });
  8265. return
  8266. }
  8267. if (!oneProItem.extraField2) {
  8268. this.$message({
  8269. message: this.$t('gongZuoZhiZeBiTianQingJianCha'),
  8270. type: "error"
  8271. });
  8272. return
  8273. }
  8274. if (!oneProItem.extraField3) {
  8275. this.$message({
  8276. message: this.$t('gongZuoNeiRongBiTianQingJianCha'),
  8277. type: "error"
  8278. });
  8279. return
  8280. }
  8281. }
  8282. }
  8283. // return
  8284. //代填的情况,检查人员是否已经选择
  8285. if (this.isSubstitude) {
  8286. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  8287. this.$message({
  8288. message: this.$t('message.pleaseselectthepersontofillin'),
  8289. type: "error"
  8290. });
  8291. return;
  8292. }
  8293. }
  8294. //检查时间,全天和上下午不能同时存在
  8295. if (this.reportTimeType.type == 0) {
  8296. var alldayNum = 0;
  8297. var amNum = 0;
  8298. var pmNum = 0;
  8299. for(var i in this.workForm.domains) {
  8300. if (this.workForm.domains[i].timeType == 0) {
  8301. alldayNum ++;
  8302. } else if (this.workForm.domains[i].timeType == 1) {
  8303. amNum++;
  8304. } else if (this.workForm.domains[i].timeType == 2) {
  8305. pmNum++;
  8306. }
  8307. }
  8308. if (alldayNum > 1) {
  8309. this.$message({
  8310. // message: "工作时间-全天,只能选择一次",
  8311. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  8312. type: "error"
  8313. });
  8314. return;
  8315. }
  8316. if (amNum > 1) {
  8317. this.$message({
  8318. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  8319. type: "error"
  8320. });
  8321. return;
  8322. }
  8323. if (pmNum > 1) {
  8324. this.$message({
  8325. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  8326. type: "error"
  8327. });
  8328. return;
  8329. }
  8330. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  8331. this.$message({
  8332. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  8333. type: "error"
  8334. });
  8335. return;
  8336. }
  8337. } else if (this.reportTimeType.type == 3) {
  8338. //总百分比不能超过100%
  8339. let total = 0;
  8340. this.workForm.domains.forEach(w=>{total += w.progress});
  8341. if (total > 100) {
  8342. this.$message({
  8343. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  8344. type: "error"
  8345. });
  8346. return;
  8347. } else if (total < 100) {
  8348. this.$message({
  8349. message: this.$t('message.cannotbesubmitted'),
  8350. type: "error"
  8351. });
  8352. return;
  8353. }
  8354. }
  8355. this.listLoading = true;
  8356. let formData = new FormData();
  8357. formData.append("draft", this.isDraft);
  8358. var totalTime = 0;
  8359. for (var t=0;t<this.workForm.domains.length; t++) {
  8360. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  8361. }
  8362. //批量填报不校验考勤时长,交给后台校验
  8363. if (!this.isBatch) {
  8364. if(this.user.timeType.notAllowedNoAttendance == 1 && this.isDraft == 0 && !(this.isSubstitude && this.user.timeType.notCheckCardtime)){
  8365. if (this.workForm.time){
  8366. if (this.workForm.time.workHours == 0){
  8367. this.$message({
  8368. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8369. type: 'error'
  8370. })
  8371. return
  8372. }
  8373. }else{
  8374. this.$message({
  8375. message: this.$t('wu-kao-qin-ji-lu-bu-ke-tian-bao'),
  8376. type: 'error'
  8377. })
  8378. return
  8379. }
  8380. }
  8381. }
  8382. //针对凡己和景昱,苏州博海,泓浒(暂时) 此处不校验考勤时长
  8383. if (this.user.companyId != 3918 && this.user.companyId != 5978 && this.user.companyId != 4281 && this.user.companyId != 7536 && this.reportTimeType.type == 1 && this.workForm.time) {
  8384. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  8385. this.$message({
  8386. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  8387. type: "error"
  8388. });
  8389. return;
  8390. }
  8391. }
  8392. for(var i in this.workForm.domains) {
  8393. // 检查任务/里程碑是否为必填
  8394. let taskRequired = this.user.timeType.taskRequired
  8395. if(taskRequired == 1) {
  8396. if(!this.workForm.domains[i].taskId) {
  8397. this.$message({
  8398. message: `【${this.workForm.domains[i].projectName}】`+this.$t('qingXuanZeRenWuLiChengBei'),
  8399. type: "error"
  8400. });
  8401. return
  8402. }
  8403. }
  8404. if(this.user.timeType.reportAuditType == 3){
  8405. let audItem = {}
  8406. let auditRule = ''
  8407. if(this.workForm.domains[i].id){
  8408. audItem.reportId = this.workForm.domains[i].id
  8409. }
  8410. if(this.user.timeType.auditLevel > 0){
  8411. if(!this.workForm.domains[i].auditorFirst){ auditRule += this.$t('di-yi') }
  8412. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  8413. }
  8414. if(this.user.timeType.auditLevel > 1){
  8415. // if(!this.workForm.domains[i].auditorSec){ auditRule += '第二、' }
  8416. audItem.auditorSec = this.workForm.domains[i].auditorSec
  8417. }
  8418. if(this.user.timeType.auditLevel > 2){
  8419. // if(!this.workForm.domains[i].auditorThird){ auditRule += '第三、' }
  8420. audItem.auditorThird = this.workForm.domains[i].auditorThird
  8421. }
  8422. if(this.workForm.domains[i].ccUserid){
  8423. audItem.ccUserid = this.workForm.domains[i].ccUserid
  8424. }
  8425. if(auditRule){
  8426. auditRule = auditRule.substring(0,auditRule.length - 1)
  8427. this.$message({
  8428. message: this.$t('qing-zhi-ding') + auditRule + this.$t('other.reviewer'),
  8429. type: 'error'
  8430. })
  8431. return
  8432. }
  8433. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  8434. }
  8435. if (this.user.timeType.customDegreeActive) {
  8436. if (this.user.timeType.customDegreeMultiple) {
  8437. //多选
  8438. if (this.workForm.domains[i].multiDegrIdArray) {
  8439. var degreeArray = JSON.stringify(this.workForm.domains[i].multiDegrIdArray);
  8440. degreeArray = degreeArray.replace(/,/g,"@");
  8441. formData.append("multiDegrId", degreeArray);
  8442. } else {
  8443. formData.append("multiDegrId", '[]');
  8444. }
  8445. } else {
  8446. //单选
  8447. if (this.workForm.domains[i].degreeId) {
  8448. formData.append("degreeId", this.workForm.domains[i].degreeId);
  8449. } else {
  8450. formData.append("degreeId", -1);
  8451. }
  8452. }
  8453. } else {
  8454. formData.append("degreeId", -1);
  8455. }
  8456. if(this.workForm.domains[i].customData) {
  8457. // var sss = this.workForm.domains[i].degreeId.toString()
  8458. formData.append("customData", this.workForm.domains[i].customData);
  8459. } else {
  8460. formData.append("customData", 0);
  8461. }
  8462. if(this.workForm.domains[i].customText) {
  8463. formData.append("customText", this.workForm.domains[i].customText);
  8464. } else {
  8465. formData.append("customText", '-');
  8466. }
  8467. if (this.workForm.domains[i].id) {
  8468. formData.append("id", this.workForm.domains[i].id);
  8469. } else {
  8470. formData.append("id", -1);
  8471. }
  8472. formData.append("projectId", this.workForm.domains[i].projectId);
  8473. if (this.workForm.domains[i].subProjectId) {
  8474. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  8475. } else {
  8476. formData.append("subProjectId", 0);
  8477. }
  8478. if (this.workForm.domains[i].groupId) {
  8479. formData.append("groupId", this.workForm.domains[i].groupId);
  8480. } else {
  8481. formData.append("groupId", 0);
  8482. }
  8483. if (this.workForm.domains[i].taskId) {
  8484. formData.append("taskId", this.workForm.domains[i].taskId);
  8485. } else {
  8486. formData.append("taskId", 0);
  8487. }
  8488. if (this.workForm.domains[i].taskFinish == true) {
  8489. formData.append("taskFinish", 1);
  8490. } else {
  8491. formData.append("taskFinish", 0);
  8492. }
  8493. formData.append("reportTimeType", this.reportTimeType.type);
  8494. if (this.reportTimeType.type == 0) {
  8495. formData.append("timeType", this.workForm.domains[i].timeType);
  8496. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  8497. formData.append("workingTime", workingTime);
  8498. } else if (this.reportTimeType.type == 1){
  8499. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8500. } else if (this.reportTimeType.type == 2) {
  8501. formData.append("endTime", this.workForm.domains[i].endTime);
  8502. formData.append("startTime", this.workForm.domains[i].startTime);
  8503. } else if (this.reportTimeType.type == 3) {
  8504. //按比例分配
  8505. formData.append("progress", this.workForm.domains[i].progress);
  8506. formData.append("workingTime", this.workForm.domains[i].workingTime);
  8507. }
  8508. if(this.user.timeType.choseFromAlbum == 1 ) {
  8509. console.log(this.workForm.domains[i].imgList)
  8510. if(this.workForm.domains[i].imgList) {
  8511. let imgListFor = this.workForm.domains[i].imgList
  8512. for(var b in imgListFor) {
  8513. imgListFor[b] = imgListFor[b].replace('/upload/', '')
  8514. }
  8515. console.log(imgListFor)
  8516. let m = JSON.stringify(imgListFor);
  8517. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8518. formData.append("picStr", m);
  8519. } else {
  8520. formData.append("picStr", '[]');
  8521. }
  8522. }
  8523. //处理多个时间事项
  8524. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  8525. if (this.reportTimeType.multiWorktime == 1) {
  8526. //检查时间是否有重叠
  8527. var workList = this.workForm.domains[i].worktimeList;
  8528. for (var j=0;j<workList.length; j++) {
  8529. var curItem = workList[j];
  8530. //检查开始时间是否大于结束时间
  8531. if (curItem.startTime >= curItem.endTime) {
  8532. this.$message({
  8533. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  8534. this.$t('message.Endtimemustbegreaterthanstarttime'),
  8535. type: "error"
  8536. });
  8537. return;
  8538. }
  8539. //时间不可重叠
  8540. if (this.reportTimeType.timeCanOverlap == 0) {
  8541. for (var p = j+1;p<workList.length; p++) {
  8542. var jItem = workList[p];
  8543. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  8544. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  8545. this.$message({
  8546. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  8547. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  8548. type: "error"
  8549. });
  8550. return;
  8551. }
  8552. }
  8553. }
  8554. }
  8555. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  8556. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8557. formData.append("content", m);
  8558. } else {
  8559. if (this.workForm.domains[i].content) {
  8560. let m = JSON.parse(JSON.stringify(this.workForm.domains[i].content));
  8561. m = m.replace(/,/g,",");
  8562. console.log(m, '需要传值的数据')
  8563. // formData.append("content", this.workForm.domains[i].content);
  8564. formData.append("content", m);
  8565. } else {
  8566. formData.append("content", '-');
  8567. }
  8568. }
  8569. if (this.isBatch == 0) {
  8570. formData.append("createDate", this.workForm.createDate);
  8571. } else {
  8572. //批量填报,时间范围
  8573. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  8574. }
  8575. if(this.workForm.domains[i].isOvertime) {
  8576. formData.append("isOvertime", 1);
  8577. } else {
  8578. formData.append("isOvertime", 0);
  8579. }
  8580. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  8581. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  8582. } else {
  8583. formData.append("overtimeHours", 0);
  8584. }
  8585. if(this.workForm.domains[i].basecostId) {
  8586. formData.append("basecostId", this.workForm.domains[i].basecostId);
  8587. } else {
  8588. formData.append("basecostId", 0);
  8589. }
  8590. if (this.workForm.userId != null) {
  8591. var targetUids = '';
  8592. this.workForm.userId.forEach(u=>{
  8593. targetUids += u + '@';
  8594. });
  8595. if (targetUids.length > 0) {
  8596. targetUids = targetUids.substring(0, targetUids.length -1);
  8597. formData.append("targetUids", targetUids);
  8598. }
  8599. }
  8600. //项目专业进度
  8601. if (this.workForm.domains[i].professionProgress) {
  8602. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  8603. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  8604. formData.append("professionProgress", m);
  8605. } else {
  8606. formData.append("professionProgress", "[]");
  8607. }
  8608. if (this.workForm.domains[i].stage) {
  8609. formData.append("stage", this.workForm.domains[i].stage);
  8610. } else {
  8611. formData.append("stage", "-");
  8612. }
  8613. if (this.workForm.domains[i].projectAuditorId) {
  8614. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  8615. } else {
  8616. if (this.user.timeType.reportAuditType == 0 || this.user.timeType.reportAuditType == 4) {
  8617. this.$message({
  8618. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  8619. type: "error"
  8620. });
  8621. return;
  8622. } else if(this.user.timeType.reportAuditType == 1 || this.user.timeType.reportAuditType == 2 || this.user.timeType.reportAuditType == 9){
  8623. //分组负责人先审核, 确定是选择了任务分组
  8624. if (this.workForm.domains[i].taskGroups.length == 0) {
  8625. this.$message({
  8626. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  8627. type: "error"
  8628. });
  8629. return;
  8630. } else if (!this.workForm.domains[i].groupId) {
  8631. // console.log(this.workForm.domains[i]);
  8632. this.$message({
  8633. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  8634. type: "error"
  8635. });
  8636. return;
  8637. }
  8638. }
  8639. }
  8640. if (this.user.companyId == this.yuzhongCompId) {
  8641. formData.append('extraField1', this.workForm.domains[i].extraField1);
  8642. formData.append('extraField2', this.workForm.domains[i].extraField2);
  8643. formData.append('extraField3', this.workForm.domains[i].extraField3);
  8644. }
  8645. //依斯贝的服务Id
  8646. if (this.user.companyId == this.yisibeiCompId) {
  8647. formData.append('sapServiceId', this.workForm.domains[i].sapServiceId);
  8648. }
  8649. if(this.user.timeType.taskGroupRequired == 1 && !this.workForm.domains[i].groupId) {
  8650. this.$message({
  8651. message: this.$t('defaultText.pleaseChoose') + `【${this.workForm.domains[i].projectName}】`+ this.$t('xiangMuXiaDeRenWuFenZu'),
  8652. type: "error"
  8653. });
  8654. return
  8655. }
  8656. if(this.user.timeType.userWithMultiDept == 1) {
  8657. formData.append('reportTargetDeptId', this.workForm.domains[i].reportTargetDeptId||-1);
  8658. }
  8659. if(this.user.timeType.reportExtraField4Name) {
  8660. formData.append('extraField4', this.workForm.domains[i].extraField4 || '');
  8661. }
  8662. if(this.user.timeType.reportExtraField5Name) {
  8663. formData.append('extraField5', this.workForm.domains[i].extraField5 || '');
  8664. }
  8665. if(this.user.companyId == 7536) {
  8666. const taskGroupsList = this.workForm.domains[i].taskGroups
  8667. const groupId = this.workForm.domains[i].groupId
  8668. const taskGroupRow = taskGroupsList.find(item => item.id == groupId)
  8669. const extraField4 = this.workForm.domains[i].extraField4
  8670. const extraField5 = this.workForm.domains[i].extraField5
  8671. const projectName = this.workForm.domains[i].projectName
  8672. if(taskGroupRow.name.indexOf('研发工时') != '-1' && (extraField4 || extraField5)) {
  8673. this.$message({
  8674. message: `【${projectName}】项目选择了研发工时,请勿填写工单号和行号`,
  8675. type: "error"
  8676. });
  8677. return
  8678. }
  8679. }
  8680. }
  8681. this.submitingReport = true;
  8682. this.http.uploadFile( this.port.report.editPort, formData,
  8683. res => {
  8684. this.listLoading = false;
  8685. this.submitingReport = false;
  8686. if (res.code == "ok") {
  8687. if(res.msg!=null){
  8688. this.$message({
  8689. dangerouslyUseHTMLString: true,
  8690. message: res.msg,
  8691. type: "warning",
  8692. showClose: true,
  8693. duration: 0
  8694. });
  8695. }else{
  8696. this.$message({
  8697. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  8698. type: "success"
  8699. });
  8700. }
  8701. this.dialogVisible = false;
  8702. this.jsDay = 0
  8703. this.jsTime = 0
  8704. this.getReportList();
  8705. this.getDepartment();
  8706. this.getRecentlyProject()
  8707. } else {
  8708. this.$message({
  8709. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  8710. type: "error"
  8711. });
  8712. }
  8713. },
  8714. error => {
  8715. this.listLoading = false;
  8716. this.submitingReport = false;
  8717. this.$message({
  8718. message: error,
  8719. type: "error"
  8720. });
  8721. });
  8722. },
  8723. // 判断是展示那个工时导入
  8724. imports() {
  8725. if(this.user.timeType.syncCorpwxTime == 0) {
  8726. this.importDialog = true
  8727. } else {
  8728. this.importWxDialog = true
  8729. }
  8730. },
  8731. // 跳转
  8732. junpToDeskTop(id) {
  8733. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8734. this.$router.push("/desktop/" + id + "/" + this.date +day);
  8735. },
  8736. // 通过日报
  8737. approve(id, item) {
  8738. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8739. this.approveinData = {
  8740. id: id,
  8741. date: this.date +day,
  8742. reportIds: item.id
  8743. }
  8744. if(this.user.timeType.needEvaluate == 1){
  8745. this.$set(this.approveinData,'evaluate','')
  8746. this.approveinDialog = true
  8747. }else{
  8748. this.logining = true;
  8749. this.approveinfun()
  8750. }
  8751. },
  8752. approveinfun(){
  8753. this.http.post( this.port.report.approve, this.approveinData,
  8754. res => {
  8755. this.logining = false;
  8756. if (res.code == "ok") {
  8757. this.approveinDialog = false
  8758. this.$message({
  8759. message: this.$t('message.Reviewsucceeded'),
  8760. type: "success"
  8761. });
  8762. this.refreshReportData(this.approveinData.reportIds);
  8763. this.getDepartment();
  8764. } else {
  8765. this.$message({
  8766. message: res.msg,
  8767. type: "error"
  8768. });
  8769. }
  8770. },
  8771. error => {
  8772. this.logining = false;
  8773. this.$message({
  8774. message: error,
  8775. type: "error"
  8776. });
  8777. });
  8778. },
  8779. //撤回日报
  8780. cancel(item,e) {
  8781. // console.log('can can need',item);
  8782. this.logining = true;
  8783. var ids = '';
  8784. var data = e ? item : item.data;
  8785. data.forEach(element => {
  8786. if(element.id){
  8787. ids +=(element.id+',');
  8788. }
  8789. });
  8790. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  8791. res => {
  8792. this.logining = false;
  8793. if (res.code == "ok") {
  8794. this.$message({
  8795. message:this.$t('message.Withdrawalsucceeded'),
  8796. type: "success"
  8797. });
  8798. this.getReportList();
  8799. if(e){this.getReport()}
  8800. this.getDepartment();
  8801. } else {
  8802. this.$message({
  8803. message: res.msg,
  8804. type: "error"
  8805. });
  8806. }
  8807. },
  8808. error => {
  8809. this.logining = false;
  8810. this.$message({
  8811. message: error,
  8812. type: "error"
  8813. });
  8814. });
  8815. },
  8816. showDenyDialog(id,i, item) {
  8817. this.denyReasonDialog = true;
  8818. this.isDenying = false;
  8819. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  8820. var ids = item.id;
  8821. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  8822. },
  8823. // 未通过日报
  8824. deny() {
  8825. this.logining = true;
  8826. this.isDenying = true;
  8827. this.http.post( this.port.report.deny, this.denyForm,
  8828. res => {
  8829. this.logining = false;
  8830. this.isDenying = false;
  8831. if (res.code == "ok") {
  8832. this.$message({
  8833. message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
  8834. type: "success"
  8835. });
  8836. this.refreshReportData(this.denyForm.reportIds);
  8837. this.getDepartment();
  8838. this.denyReasonDialog = false;
  8839. } else {
  8840. this.$message({
  8841. message: res.msg,
  8842. type: "error"
  8843. });
  8844. }
  8845. },
  8846. error => {
  8847. this.logining = false;
  8848. this.$message({
  8849. message: error,
  8850. type: "error"
  8851. });
  8852. });
  8853. },
  8854. // 查看工时记录弹窗
  8855. toView() {
  8856. this.toViewDialogVisible = true
  8857. this.toViewloading = true
  8858. this.getToView()
  8859. },
  8860. getToView() {
  8861. this.http.post( '/report-import-log/getList', this.toViewForm,
  8862. res => {
  8863. this.toViewloading = false;
  8864. if (res.code == "ok") {
  8865. // console.log(res.data, '数据数据')
  8866. this.toViewList = res.data.records
  8867. this.toViewForm.total = res.data.total
  8868. } else {
  8869. this.toViewloading = false;
  8870. this.$message({
  8871. message: res.msg,
  8872. type: "error"
  8873. });
  8874. }
  8875. })
  8876. },
  8877. // 触发 selectCat 组件更改他的值
  8878. selectCatCli(obj) {
  8879. // console.log(obj, '看看')
  8880. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  8881. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  8882. },
  8883. vueCasader(obj) {
  8884. if(obj.distinction == 1 && obj.item) {
  8885. let arr = []
  8886. arr.push(obj.item.value)
  8887. this.exportParam.departmentId = arr
  8888. }
  8889. if(obj.distinction == '10' && obj) {
  8890. const { id, other } = obj
  8891. this.workForm.domains[other].reportTargetDeptId = id
  8892. }
  8893. if(obj.distinction == '14' && obj) {
  8894. let arr = []
  8895. arr.push(obj.id)
  8896. this.deptIdForHasReport = arr
  8897. this.showMonthWorkTime()
  8898. }
  8899. if(obj.distinction == '15' && obj) {
  8900. let arr = []
  8901. arr.push(obj.id)
  8902. this.deptIdForNoReport = arr
  8903. this.showMonthNotWorkTime()
  8904. }
  8905. if(obj.distinction == '16' && obj) {
  8906. let arr = []
  8907. arr.push(obj.id)
  8908. this.deptIdForReminder = arr
  8909. this.showMonthWorkTimeReminder()
  8910. }
  8911. if(obj.distinction == '17' && obj) {
  8912. let arr = []
  8913. arr.push(obj.id)
  8914. this.deptIdForHasReport = arr
  8915. this.showReportTimeLessThanCardTimeList();
  8916. }
  8917. },
  8918. //分页
  8919. handleCurrentChange(val) {
  8920. this.toViewForm.pageIndex = val;
  8921. this.getToView();
  8922. },
  8923. handleSizeChange(val) {
  8924. this.toViewForm.pageSize = val;
  8925. this.getToView();
  8926. },
  8927. getAllUsersList(){
  8928. this.http.post('/user/getSimpleActiveUserList',{
  8929. },res => {
  8930. if(res.code == 'ok'){
  8931. this.allUsersList = res.data
  8932. }else{
  8933. this.$message({
  8934. message: res.msg,
  8935. type: 'error'
  8936. })
  8937. }
  8938. },err => {
  8939. this.$message({
  8940. message: err,
  8941. type: 'error'
  8942. })
  8943. })
  8944. },
  8945. //考勤工时异常,一键驳回并提醒修改
  8946. batchRejectAndRemind(item){
  8947. this.$confirm('您确定要一键驳回异常考勤工时的日报并发送消息提醒吗?',this.$t('other.prompts'), {
  8948. confirmButtonText: this.$t('btn.determine'),
  8949. cancelButtonText: this.$t('btn.cancel'),
  8950. type: "warning"
  8951. })
  8952. .then(() => {
  8953. let parameter={
  8954. ymonth: this.notfullSelectDateMonth
  8955. }
  8956. this.remindering = true;
  8957. this.http.post('/report/rejectAbnormalReportTime',parameter,res => {
  8958. this.remindering = false;
  8959. if(res.code == 'ok'){
  8960. this.$message({
  8961. message: res.msg,
  8962. type: 'success'
  8963. })
  8964. }else{
  8965. this.$message({
  8966. message: res.msg,
  8967. type: 'error'
  8968. })
  8969. }
  8970. },err => {
  8971. this.$message({
  8972. message: err,
  8973. type: 'error'
  8974. })
  8975. })
  8976. }).catch(() => {this.startDeleting = false});
  8977. },
  8978. //景昱变更提醒
  8979. changeReminder(item){
  8980. let parameter={
  8981. startDate: this.WorktimeDatepickValue[0],
  8982. endDate: this.WorktimeDatepickValue[1],
  8983. }
  8984. if(item){
  8985. parameter.createDate=item.createDate,
  8986. parameter.userId=item.userId
  8987. }
  8988. this.remindering = true;
  8989. this.http.post('/report/changeReminder',parameter,res => {
  8990. this.remindering = false;
  8991. if(res.code == 'ok'){
  8992. this.$message({
  8993. message: res.msg,
  8994. type: 'success'
  8995. })
  8996. }else{
  8997. this.$message({
  8998. message: res.msg,
  8999. type: 'error'
  9000. })
  9001. }
  9002. },err => {
  9003. this.$message({
  9004. message: err,
  9005. type: 'error'
  9006. })
  9007. })
  9008. },
  9009. //景昱取消异常
  9010. cancelReminder(item){
  9011. let parameter={}
  9012. if(item){
  9013. parameter.createDate=item.createDate,
  9014. parameter.userId=item.userId
  9015. }
  9016. this.http.post('/report/cancelReminder',parameter,res => {
  9017. if(res.code == 'ok'){
  9018. this.$message({
  9019. message: res.msg,
  9020. type: 'success'
  9021. })
  9022. }else{
  9023. this.$message({
  9024. message: res.msg,
  9025. type: 'error'
  9026. })
  9027. }
  9028. },err => {
  9029. this.$message({
  9030. message: err,
  9031. type: 'error'
  9032. })
  9033. })
  9034. this.showMonthWorkTimeReminder()
  9035. },
  9036. // 重庆物奇私人定制的按周填报弹窗关闭事件
  9037. fillWeekCustomClne() {
  9038. this.fillWeekDialogVisiCustom = false
  9039. },
  9040. fillWeekCustomClneTwo() {
  9041. this.fillWeekDialogVisiCustomTwo = false
  9042. },
  9043. fillWeekCustomSubmit() {
  9044. this.getReportList();
  9045. this.getDepartment();
  9046. this.getRecentlyProject()
  9047. },
  9048. // 待填日报姓名搜索
  9049. nameAearchSeek(flg) {
  9050. if(!this.nameAearch) {
  9051. this.deptMembData = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  9052. return
  9053. }
  9054. if(flg) {
  9055. this.enterpriseWechatgetUser()
  9056. }
  9057. },
  9058. handleThreeData(userList) {
  9059. let deptMembDataBackups = JSON.parse(JSON.stringify(this.deptMembDataBackups))
  9060. this.deptMembData = this.filterTreeNodes(deptMembDataBackups, userList)
  9061. },
  9062. // 过滤树节点
  9063. filterTreeNodes(treeData, filterKeywords) {
  9064. return treeData.filter((node) => {
  9065. if (filterKeywords.some((keyword) => node.label.includes(keyword))) {
  9066. if (node.children && node.children.length > 0) {
  9067. node.children = this.filterTreeNodes(node.children, filterKeywords);
  9068. }
  9069. return true;
  9070. }
  9071. if (node.children && node.children.length > 0) {
  9072. node.children = this.filterTreeNodes(node.children, filterKeywords);
  9073. return node.children.length > 0;
  9074. }
  9075. return false;
  9076. });
  9077. },
  9078. // 企业微信获取人员
  9079. enterpriseWechatgetUser() {
  9080. this.deptMembDataLoading = true
  9081. this.http.post('/user/getEmployeeList',{
  9082. departmentId: -1,
  9083. pageIndex: 1,
  9084. pageSize: 100,
  9085. keyword: this.nameAearch,
  9086. status: '',
  9087. roleId: '',
  9088. cursor: '',
  9089. onlyDirect: '',
  9090. matchingType: ''
  9091. },res => {
  9092. if(res.code == 'ok'){
  9093. this.deptMembDataLoading = false
  9094. const userListName = res.data.records.map(item => item.name)
  9095. this.handleThreeData(userListName)
  9096. setTimeout(() => {
  9097. this.changeTreeNodeStatus(this.$refs.chooseMembTree.store.root)
  9098. }, 200)
  9099. }else{
  9100. this.deptMembDataLoading = false
  9101. this.$message({
  9102. message: res.msg,
  9103. type: 'error'
  9104. })
  9105. }
  9106. },err => {
  9107. this.deptMembDataLoading = false
  9108. this.$message({
  9109. message: err,
  9110. type: 'error'
  9111. })
  9112. })
  9113. },
  9114. changeTreeNodeStatus(node) {
  9115. let allZt = true
  9116. node.expanded = allZt
  9117. for (let i = 0; i < node.childNodes.length; i++) {
  9118. node.childNodes[i].expanded = allZt
  9119. if (node.childNodes[i].childNodes.length > 0) {
  9120. this.changeTreeNodeStatus(node.childNodes[i])
  9121. }
  9122. }
  9123. },
  9124. // 按周填报获取相关任务
  9125. async getWeeklyTaskList(item) {
  9126. const { projectId, groupId, stage, taskId } = item
  9127. let parms = { projectId, isSubstitude: 0 }
  9128. groupId ? parms.groupId = groupId : ''
  9129. stage ? parms.stage = stage : ''
  9130. const { data } = await this.postData('/task/getRecentTask', parms)
  9131. this.zhoBao.taskId = taskId
  9132. this.$set(this.zhoBao, 'taskList', data)
  9133. },
  9134. getCustomConfigurationItems() {
  9135. this.postData('/user-custom/getUserCustomFirstPullDown', {}).then(res => {
  9136. // this.customConfigurationRow = res.data || { subUserCustomList: [] }
  9137. const { subUserCustomList = [], plate = '' } = res.data
  9138. this.customConfigurationRow = {
  9139. ...res.data,
  9140. subUserCustomList: subUserCustomList.map(item => {
  9141. return {
  9142. ...item,
  9143. newId: `${plate}-${item.name}`
  9144. }
  9145. })
  9146. }
  9147. console.log(this.customConfigurationRow)
  9148. })
  9149. },
  9150. // 封装 post 请求
  9151. postData(url, params) {
  9152. return new Promise((resolve, reject) => {
  9153. this.http.post(url, { ...params },
  9154. res => {
  9155. resolve(res)
  9156. },
  9157. error => {
  9158. this.$message({
  9159. message: error,
  9160. type: "error"
  9161. });
  9162. reject(error)
  9163. })
  9164. })
  9165. },
  9166. // 自定义事件
  9167. selectCal(obj) {
  9168. if(obj.distinction == '1') {
  9169. this.zhoBao.projectAuditorId = obj.id
  9170. } else if(obj.distinction == '2') {
  9171. this.zhoBao.auditorFirst = obj.id
  9172. } else if(obj.distinction == '3') {
  9173. this.zhoBao.auditorSec = obj.id
  9174. } else if(obj.distinction == '4') {
  9175. this.zhoBao.auditorThird = obj.id
  9176. } else if(obj.distinction == '5') {
  9177. this.zhoBao.ccUserid = obj.id
  9178. } else if(obj.distinction == '12') {
  9179. this.usersListId = obj.id
  9180. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9181. this.searchKeyword = obj.name
  9182. } else {
  9183. this.searchKeyword = ''
  9184. }
  9185. this.searchScreen(0)
  9186. } else if(obj.distinction == '13') {
  9187. this.usersListId = obj.id
  9188. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  9189. this.searchKeyword = obj.name
  9190. } else {
  9191. this.searchKeyword = ''
  9192. }
  9193. this.searchScreen(1)
  9194. } else if(obj.distinction == '15') {
  9195. this.usersListId = obj.id
  9196. this.showReportTimeLessThanCardTimeList();
  9197. }
  9198. }
  9199. },
  9200. created() {
  9201. this.getUsers()
  9202. let height = window.innerHeight;
  9203. this.tableHeight = height - 178;
  9204. const that = this;
  9205. window.onresize = function temp() {
  9206. that.tableHeight = window.innerHeight - 178;
  9207. };
  9208. this.toViewForm.companyId = this.user.companyId
  9209. this.initDrag([{
  9210. type: "LR",
  9211. domClass: {
  9212. // 中间分割线的名字
  9213. resize: "line-line",
  9214. // 左侧盒子的名字
  9215. left: "box-left",
  9216. // 右侧盒子的名字
  9217. right: "box-right",
  9218. // 父级的名字
  9219. box: "box-father",
  9220. },
  9221. otherInfo: {
  9222. // 限制左边栏最低宽度
  9223. leftWidth: 120,
  9224. },
  9225. },
  9226. {
  9227. type: "LR",
  9228. domClass: {
  9229. // 中间分割线的名字
  9230. resize: "line-second",
  9231. // 左侧盒子的名字
  9232. left: "left-laowang",
  9233. // 右侧盒子的名字
  9234. right: "box-second-father",
  9235. // 父级的名字
  9236. box: "grand",
  9237. },
  9238. otherInfo: {
  9239. // 限制左边栏最低宽度
  9240. leftWidth: 120,
  9241. },
  9242. },
  9243. ]);
  9244. }
  9245. };
  9246. </script>
  9247. <style lang="scss" scoped>
  9248. @import "../../assets/scss/handle";
  9249. .themeFontColor {
  9250. @include font_color("color");
  9251. }
  9252. .fillWeekDialogVisiCustom {
  9253. width: 100%;
  9254. height: 70vh;
  9255. }
  9256. .fillWeekCustom {
  9257. .el-dialog__body {
  9258. padding: 20px 20px !important;
  9259. }
  9260. }
  9261. .photos {
  9262. position: relative;
  9263. display: flex;
  9264. flex-wrap: wrap;
  9265. }
  9266. .photos_img {
  9267. width: 120px;
  9268. height: 120px;
  9269. margin-right: 20px;
  9270. margin-bottom: 20px;
  9271. cursor: pointer;
  9272. img {
  9273. width: 100%;
  9274. height: 100%;
  9275. }
  9276. }
  9277. .paginatis {
  9278. padding: 10px 10px;
  9279. background: #f2f2f2;
  9280. }
  9281. .waiting {
  9282. color:orange;
  9283. }
  9284. .filledReportStyle {
  9285. color:#32CD32;
  9286. }
  9287. .RejectStyle {
  9288. color:red;
  9289. }
  9290. .waitSubmitStyle{
  9291. @include font_color("color");
  9292. }
  9293. .chooseDate {
  9294. .waiting {
  9295. @include font_color("color");
  9296. }
  9297. .filledReportStyle {
  9298. @include font_color("color");
  9299. }
  9300. .RejectStyle {
  9301. @include font_color("color");
  9302. }
  9303. .waitSubmitStyle{
  9304. @include font_color("color");
  9305. }
  9306. }
  9307. .allDaily {
  9308. width:100%;
  9309. }
  9310. .report_title {
  9311. padding:10px 0;
  9312. color:#666;
  9313. }
  9314. .clearfix {
  9315. overflow-x: auto;
  9316. white-space: nowrap;
  9317. padding: 15px 0 10px 0;
  9318. // overflow-y: hidden;
  9319. .date_item {
  9320. padding: 0 3px;
  9321. cursor: pointer;
  9322. position: relative;
  9323. }
  9324. .chooseDate {
  9325. position: absolute;
  9326. bottom: -3px;
  9327. width: 37px;
  9328. height: 2px;
  9329. left: 14px;
  9330. @include background_color("background_color");
  9331. }
  9332. }
  9333. .one_daily {
  9334. i {
  9335. @include font_color("color1");
  9336. margin-right: 5px;
  9337. }
  9338. .one_daily_body {
  9339. padding: 10px 0px;
  9340. p {
  9341. margin: 0;
  9342. line-height: 30px;
  9343. }
  9344. }
  9345. ul {
  9346. padding: 0;
  9347. }
  9348. }
  9349. .checkbtn {
  9350. float: right;
  9351. margin-top: -10px;
  9352. }
  9353. .selConStyle{
  9354. margin-top:9rem;
  9355. margin-bottom:11rem;
  9356. .selConStyle_title{
  9357. height: 3rem;
  9358. text-align: center;
  9359. font-size: 17px;
  9360. }
  9361. .el-select{
  9362. margin: 0 15%;
  9363. width: 70%;
  9364. }
  9365. }
  9366. </style>
  9367. <style lang="scss">
  9368. /*去除upload组件过渡效果*/
  9369. .photos .el-upload-list__item {
  9370. transition: none !important;
  9371. }
  9372. .daily {
  9373. .el-card__body {
  9374. height: 80%;
  9375. overflow-y: auto;
  9376. }
  9377. .el-card__header {
  9378. padding: 0 20px;
  9379. }
  9380. }
  9381. .membListClass{
  9382. .el-dialog__body{
  9383. padding-top: 10px;
  9384. }
  9385. }
  9386. // .editReportDialog .el-dialog__footer{
  9387. // position: sticky;
  9388. // bottom: 0;
  9389. // background: #fff;
  9390. // height: 70px;
  9391. // z-index: 1010;
  9392. // }
  9393. .editReportDialog{
  9394. min-width: 800px;
  9395. }
  9396. .touruxiangmu{
  9397. max-width: 1000px;
  9398. }
  9399. </style>
  9400. <style scoped>
  9401. /* 项目标签的样式 */
  9402. .el-tag + .el-tag {
  9403. margin-left: 10px;
  9404. }
  9405. .button-new-tag {
  9406. margin-left: 10px;
  9407. height: 32px;
  9408. line-height: 30px;
  9409. padding-top: 0;
  9410. padding-bottom: 0;
  9411. }
  9412. .input-new-tag {
  9413. width: 90px;
  9414. margin-left: 10px;
  9415. vertical-align: bottom;
  9416. }
  9417. .selectworktime .el-table__fixed-body-wrapper{
  9418. top: 48px !important;
  9419. }
  9420. .selectworktime_export .selectworktime_export_l{
  9421. width: 650px;
  9422. float: left;
  9423. height: 42px;
  9424. }
  9425. .approvalProcessBox{
  9426. margin-left: 30px;
  9427. font-size: 14px;
  9428. line-height: 16px;
  9429. cursor: pointer;
  9430. }
  9431. .approvalProcessBox i {
  9432. margin-right: 0;
  9433. height: 16px;
  9434. width: 16px;
  9435. display: inline-block;
  9436. transform: scale(1.2);
  9437. position: relative;
  9438. top: 0.5px;
  9439. @include font_color("color");
  9440. }
  9441. .approvalProcessBox .approvalProcessClick{
  9442. cursor: pointer;
  9443. @include font_color("color");
  9444. font-size: 14px;
  9445. }
  9446. .approvalProcessBox:hover .approvalProcessClick{
  9447. color: #3485fb;
  9448. }
  9449. </style>
  9450. <style lang="scss" scoped>
  9451. .bionicClass {
  9452. -webkit-appearance: none;
  9453. background-color: #FFF;
  9454. background-image: none;
  9455. border-radius: 4px;
  9456. border: 1px solid #DCDFE6;
  9457. box-sizing: border-box;
  9458. color: #606266;
  9459. display: inline-block;
  9460. height: 40px;
  9461. line-height: 40px;
  9462. outline: 0;
  9463. padding: 0 15px;
  9464. -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9465. transition: border-color .2s cubic-bezier(.645,.045,.355,1);
  9466. width: 350px;
  9467. cursor: pointer;
  9468. .bionicClassText {
  9469. color: #C0C4CC;
  9470. }
  9471. }
  9472. // 加班样式
  9473. .overtime {
  9474. display: inline-block;
  9475. margin-left: 20px;
  9476. input {
  9477. display: inline-block;
  9478. margin-top: 5px;
  9479. }
  9480. }
  9481. .plus {
  9482. display: inline-block;
  9483. }
  9484. // .tages {
  9485. // float: right;
  9486. // }
  9487. .overtime {
  9488. display: inline-block;
  9489. margin-left: 30px;
  9490. }
  9491. .bloks {
  9492. display: inline-block;
  9493. width: 380px;
  9494. }
  9495. .zhiss {
  9496. display: flex;
  9497. justify-content: space-around;
  9498. align-items: center;
  9499. }
  9500. .zhoFel {
  9501. display: flex;
  9502. justify-content: space-between;
  9503. align-items: center;
  9504. }
  9505. // 左右滑动样式
  9506. .line {
  9507. width: 30px;
  9508. /* height: 500px; */
  9509. background: #f2f2f2;
  9510. cursor: w-resize;
  9511. }
  9512. .box-father {
  9513. border: 8px solid #000;
  9514. }
  9515. .line-second {
  9516. width: 10px;
  9517. /* background: red; */
  9518. }
  9519. .flex {
  9520. display: flex;
  9521. width: 100%;
  9522. }
  9523. .box-left {
  9524. flex: 0 0 400px;
  9525. /* height: 600px; */
  9526. /* background: blue; */
  9527. }
  9528. .box-right {
  9529. /* height: 600px; */
  9530. /* background: green; */
  9531. flex: 1;
  9532. }
  9533. .box-postion {
  9534. width: 200px;
  9535. /* height: 400px; */
  9536. background: #ccc;
  9537. }
  9538. .custom-tree-node {
  9539. flex: 1;
  9540. display: flex;
  9541. align-items: center;
  9542. justify-content: space-between;
  9543. font-size: 14px;
  9544. padding-right: 8px;
  9545. }
  9546. .daitianrbao {
  9547. width: 100%;
  9548. box-sizing: border-box;
  9549. height: 40px;
  9550. border-radius: 4px;
  9551. border: 1px solid #DCDFE6;
  9552. overflow: hidden;
  9553. text-overflow: ellipsis;
  9554. display: flex;
  9555. // align-items: center;
  9556. }
  9557. .daitianrbao .spnn {
  9558. display: inline-block;
  9559. box-sizing: border-box;
  9560. padding: 0 15px;
  9561. overflow: hidden;
  9562. text-overflow: ellipsis;
  9563. }
  9564. .daitianrbao .hover {
  9565. color: #DCDFE6 !important;
  9566. }
  9567. </style>