daily.vue 326 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259
  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="选择月份" :picker-options="getPickerOptions"></el-date-picker>
  11. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  12. </div>
  13. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  14. <span v-for="(item,index) in allDate" :id="'day'+index" class="date_item"
  15. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 55px;text-align: center;' + (canClick(index,item) == false && user.timeType.fillAhead == 0 ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  16. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  17. <div style="text-align:center;"><span :class="statusStyle[item.state]">{{item.showDate}}</span>
  18. <br>
  19. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  20. <span class="chooseDate" v-if="index == choseDay"></span>
  21. </div>
  22. </div>
  23. </span>
  24. </div>
  25. </div>
  26. <div style="display:flex;">
  27. <div class="grand flex">
  28. <div class="left-laowang" style="flex: 0 0 210px;overflow: hidden;" v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept">
  29. <div v-if="permissions.reportsCompany || user.manageDeptId != 0 || permissions.reportsDept" :style="'overflow-x:hidden;overflow-y:auto;height:' + tableHeight + 'px;'">
  30. <div style="width: 100%;box-sizing: border-box;padding-right: 10px;">
  31. <el-select v-model="selectState" size="small" @change="stateChange" style="100%">
  32. <el-option value="-1" :label="$t('state.allState')">{{$t('state.allState')}}</el-option>
  33. <el-option value="-2" :label="$t('state.DidNotFillIn')">{{$t('state.DidNotFillIn')}}</el-option>
  34. <el-option value="1" :label="$t('state.alreadyPassed')">{{$t('state.alreadyPassed')}}</el-option>
  35. <el-option value="0" :label="$t('state.WaitingAudit')">{{$t('state.WaitingAudit')}}</el-option>
  36. <el-option value="2" :label="$t('state.notThrough')">{{$t('state.notThrough')}}</el-option>
  37. <el-option value="3" :label="$t('state.waitingsubmit')">{{$t('state.waitingsubmit')}}</el-option>
  38. </el-select></div>
  39. <div>
  40. <el-tree :data="data" @node-click="handleNodeClick" node-key="id" :default-expanded-keys="expandDate">
  41. <span class="custom-tree-node" style="position: relative;box-sizing: border-box;width: 10%;" slot-scope="{ node, data}">
  42. <!-- <span>{{ node.label }}</span> -->
  43. <span style="padding-right: 50px;box-sizing: border-box;overflow:hidden;text-overflow:ellipsis;line-height: 36px; display: inline-block;">
  44. <span v-if="user.userNameNeedTranslate == '1'">
  45. <span v-if="node.data.children">
  46. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  47. </span>
  48. <span v-else>
  49. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  50. </span>
  51. </span>
  52. <span v-if="user.userNameNeedTranslate != '1'">
  53. {{ node.label }}
  54. </span>
  55. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  56. </span>
  57. <div style="position: absolute;right: 15px;">
  58. <span v-if="data.isUser == 1 && data.state == null && !data.leaveDays && !data.leaveTimes" style="color:red;font-size:13px">
  59. <!-- 未填报 -->
  60. {{$t('state.DidNotFillIn')}}
  61. </span>
  62. <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'">
  63. <!-- {{data.leaveDays ? (data.leaveDays >= 1 ? '当日请假' : '未填报(请假' + data.leaveDays + '天)') : (data.leaveTimes >= user.timeType.allday ? '当日请假' : '未填报(请假' + data.leaveTimes + 'h)')}} -->
  64. {{data.leaveDays ? (data.leaveDays >= 1 ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveDays + $t('time.day')+')') : (data.leaveTimes >= user.timeType.allday ? $t('other.AskForLeaveOnTheSameDay') : $t('state.DidNotFillIn') + '('+$t('other.AskForLeave') + data.leaveTimes + 'h)')}}
  65. </span>
  66. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;font-size:13px">
  67. <!-- 待审核 -->
  68. {{$t('state.WaitingAudit')}}({{data.workingTime.toFixed(1) + 'h'}})
  69. </span>
  70. <span v-if="data.isUser == 1 && data.state == 1" style="color:#32cd32;font-size:13px">
  71. <!-- 已通过 -->
  72. {{$t('state.alreadyPassed')}}({{data.workingTime.toFixed(1) + 'h'}})
  73. </span>
  74. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;font-size:13px">
  75. <!-- 未通过 -->
  76. {{$t('state.notThrough')}}({{data.workingTime.toFixed(1) + 'h'}})
  77. </span>
  78. <span v-if="data.isUser == 1 && data.state == 3" style="color:#409eff;font-size:13px">
  79. <!-- 待提交 -->
  80. {{$t('state.waitingsubmit')}}({{data.workingTime.toFixed(1) + 'h'}})
  81. </span>
  82. </div>
  83. </span>
  84. </el-tree>
  85. </div>
  86. </div>
  87. </div>
  88. <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">
  89. <div style="line-height: 5px;text-align: center;color: rgb(151 151 151);">
  90. -
  91. -
  92. -
  93. </div>
  94. </div>
  95. <div style="width: 200px; flex: 1;padding: 0 10px;" class="box-second-father">
  96. <!-- <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div> -->
  97. <div class="allDaily" style="float:left;flex-grow:1">
  98. <!--系统管理员和部门负责人 -->
  99. <div class="report_title" style="display:flex;justify-content: space-between;">
  100. <span>
  101. <span>{{$t('other.dailyWork')}} ({{curDate}})</span>
  102. <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept"> |
  103. <!-- {{depData != null ?depData.label:""}} -->
  104. <span v-if="translation == '1' && user.userNameNeedTranslate == '1'">{{depData != null ?depData.label:""}}</span>
  105. <span v-if="translation == '2' && user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  106. <span v-if="translation == '3' && user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='depData.label'></ww-open-data></span>
  107. <span v-if="user.userNameNeedTranslate != '1'">{{depData != null ?depData.label:""}}</span>
  108. <span v-if="targetUid == null">
  109. <!-- - 已提交 -->
  110. -{{$t('state.hasBeenSubmitted')}}
  111. <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')}},
  112. <!-- 待提交 -->
  113. {{$t('state.waitingsubmit')}}
  114. <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')}},
  115. <!-- 漏填 -->
  116. {{$t('state.missFillReport')}}
  117. <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')}}
  118. <span v-if="leaveAllNum">{{', 全天请假' + leaveAllNum + '人'}}</span></el-link>
  119. </span>
  120. </span>
  121. </span>
  122. <span style="float:right;">
  123. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">{{$t('textLink.fillInTheWork')}}</el-link>
  124. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">{{$t('textLink.fillInAWeek')}}</el-link>
  125. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,2)">{{$t('textLink.helpToFillIn')}}</el-link>
  126. <el-link type="primary" v-if="permissions.reportBatch" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">{{$t('textLink.batchFillIn')}}</el-link>
  127. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">{{$t('textLink.workHoursImport')}}</el-link>
  128. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog" v-if="permissions.reportExport">{{$t('textLink.exportWork')}}</el-link>
  129. <!--部门负责人给个导出工时的功能 -->
  130. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">{{$t('textLink.exportingTimeStatistics')}}</el-link>
  131. </span>
  132. </div>
  133. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  134. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  135. <i class="fa fa-circle"></i>
  136. <!-- {{item1.name}} -->
  137. <span v-if="user.userNameNeedTranslate == '1'">
  138. <ww-open-data type='userName' :openid='item1.name'></ww-open-data>
  139. </span>
  140. <span v-if="user.userNameNeedTranslate != '1'">
  141. {{item1.name}}
  142. </span>
  143. <span style="margin-left:30px;">
  144. <span style="margin-right:20px;">
  145. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  146. <!-- 工作总时长: -->
  147. {{$t('other.totalWorkingHours')}}
  148. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  149. <span >{{item1.reportTime | amounts}}</span>h
  150. </span>
  151. <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
  152. <i class="iconfont firerock-iconliucheng1"></i>
  153. <span class="approvalProcessClick" @click="getApprovalProcess(item1)">
  154. <!-- 审批流程 -->
  155. {{$t('other.approvalProcess')}}
  156. </span>
  157. </span>
  158. </span>
  159. <div class="checkbtn" style="padding-right:20px;">
  160. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">{{$t('btn.editWorkReport')}}</el-button>
  161. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">{{$t('btn.delete')}}</el-button>
  162. </div>
  163. <div class="one_daily_body">
  164. <el-timeline>
  165. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  166. <el-card shadow="never">
  167. <p><!-- 项目 -->{{$t('other.project')}}:<b v-if="item2.projectCode">{{item2.projectCode + '/'}}</b><b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  168. <span v-if="user.company.packageEngineering == 0">
  169. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  170. <span v-if="item2.isDeptAudit==0">
  171. <span v-if="item2.projectAuditState==0">
  172. <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
  173. <span v-if="item2.projectAuditorName != null">(
  174. <!-- {{item2.projectAuditorName}} -->
  175. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data></span>
  176. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  177. )</span>
  178. <!-- 审核 --> {{$t('other.audit')}}
  179. </span>
  180. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  181. <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
  182. <span v-if="item2.projectAuditorName != null">(
  183. <!-- {{item2.projectAuditorName}} -->
  184. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data></span>
  185. <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
  186. )</span>
  187. <!-- 审核通过 --> {{$t('state.approved')}}
  188. </span>
  189. </span>
  190. <span v-else-if="item2.isDeptAudit==1">
  191. <!-- {{($t('other.await') +' '+ item2.auditDeptName +' '+ $t('other.audit'))}} -->
  192. ({{$t('other.await')}}
  193. <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data></span>
  194. <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
  195. {{$t('other.audit')}})
  196. </span>
  197. ]</span>
  198. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  199. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]
  200. <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
  201. </span>
  202. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  203. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  204. </span>
  205. <!-- <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> -->
  206. <span v-if="user.company.packageEngineering == 1">
  207. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ {{$t('other.importWaitingForReview')}} ]</span>
  208. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ {{$t('other.waitingForProfessionalReview')}} ]</span>
  209. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ {{$t('other.waitingForDepartmentReview')}} ]</span>
  210. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ {{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>{{$t('other.audit')}} ]</span>
  211. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ {{$t('state.alreadyPassed')}} ]</span>
  212. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ {{$t('state.rejected')}} ] {{$t('other.reason')}}:{{item2.rejectReason}}</span>
  213. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ {{$t('state.waitingsubmit')}} ]</span>
  214. </span>
  215. <!--每个项目上单独审核 -->
  216. <span style="float:right;">
  217. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  218. size="small" @click="approve(item1.id, item2)">{{$t('btn.through')}}</el-button>
  219. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  220. size="small" @click="showDenyDialog(item1.id,0, item2)">{{$t('btn.rejected')}}</el-button>
  221. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  222. @click="showDenyDialog(item1.id,1, item2)">{{$t('btn.undo')}}</el-button>
  223. <!--自己可以撤回待审核状态的报告 -->
  224. <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>
  225. </span>
  226. </p>
  227. <!--任务分组和阶段 -->
  228. <p v-if="item2.groupId != 0">{{$t('other.taskGroup')}}:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">{{$t('other.inputStage')}}:{{item2.stage}}</span></p>
  229. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  230. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  231. <!-- 自定义日报文本 -->
  232. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  233. <p v-if="user.company.packageEngineering == 1">
  234. {{$t('other.professionalProgress')}}:
  235. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  236. <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
  237. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  238. </el-tooltip>
  239. <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
  240. <i class="iconfont firerock-iconshenhetongguo"></i>
  241. </el-tooltip>
  242. <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
  243. <i class="iconfont firerock-iconshenhebohui"></i>
  244. </el-tooltip>
  245. </span>
  246. </p>
  247. <p v-if="item2.taskId != null">{{$t('other.task')}}:{{item2.taskName}}
  248. </p>
  249. <div v-if="item2.multiWorktime==0">
  250. <p style="display: inline-block;">{{$t('time.duration')}}:
  251. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  252. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  253. {{item2.time.toFixed(1)}}h
  254. <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
  255. </p>
  256. <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
  257. </div>
  258. <div v-if="item2.multiWorktime==1" >
  259. <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">加班<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
  260. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  261. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  262. <p style="display: inline-block;">{{$t('time.duration')}}:
  263. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  264. {{timeItem.time.toFixed(1)}}h
  265. </p>
  266. <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
  267. </div>
  268. </div>
  269. <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
  270. <!--照片的显示 -->
  271. <p v-if="item2.pics != null && item2.pics.length > 0">
  272. <el-image v-for="(pic, index) in item2.pics" :key="index"
  273. style="width: 100px; height: 100px; margin-right:10px;"
  274. :src="pic"
  275. :preview-src-list="item2.pics">
  276. </el-image>
  277. </p>
  278. </el-card>
  279. </el-timeline-item>
  280. </el-timeline>
  281. </div>
  282. </div>
  283. <!-- 简陋的无报告提示 -->
  284. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}{{$t('other.noReportYet')}}</div>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. </el-card>
  291. </div>
  292. <!-- 填写日报的dialog -->
  293. <el-dialog :title="editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" style="height:95%" :close-on-click-modal="false" @closed="guanbi()" custom-class="editReportDialog" ref="editReportDialog">
  294. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  295. <el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
  296. <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
  297. :placeholder="$t('defaultText.pleaseSelectAsubstitute')" ></el-input>
  298. </el-form-item>
  299. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  300. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  301. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  302. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" :placeholder="$t('defaultText.selectWorkDate')" :disabled="isDisable"></el-date-picker>
  303. <div v-if="falsss" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{jsTime}} {{$t('time.hour')}}</div>
  304. <div v-if="isBatch!=0" style="display: inline-block;margin-left:10px">{{jsDay}} {{$t('time.day')}}, {{$t('other.fillInTheTotal')}} {{jsTime}} {{$t('time.hour')}}</div>
  305. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0? $t('other.total'):$t('weekDay.daily')}}{{$t('time.duration')}}:</span>
  306. <el-input-number :disabled="(!canEdit || user.timeType.lockWorktime) && !isWeekend" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  307. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  308. <span v-if="reportTimeType.type == 3">{{$t('time.hour')}}</span>
  309. <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}{{$t('time.hour')}}</span>
  310. <span v-if="user.timeType.syncDingding==1&&!workForm.time">{{$t('other.noAttendanceRecord')}}</span>
  311. </el-form-item>
  312. <!-- 000000 -->
  313. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  314. <div v-if="reportTimeType.multiWorktime==0">
  315. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?$t('screening.workHours'):$t('screening.workTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  316. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHours'), trigger: 'blur' }">
  317. <el-select v-model="domain.timeType" style="width:200px;"
  318. v-if="reportTimeType.type == 0"
  319. :placeholder="$t('defaultText.pleaseSelectWorkingHours')"
  320. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  321. @change="onTimeTypeChange(domain.timeType)">
  322. <el-option
  323. v-for="item in timeType"
  324. :key="item.value"
  325. :label="item.label"
  326. :value="item.value">
  327. </el-option>
  328. </el-select>
  329. <!-- 数字时长选择 -->
  330. <el-select v-model="domain.workingTime" style="width:200px;"
  331. v-if="reportTimeType.type == 1"
  332. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  333. :placeholder="$t('defaultText.pleaseSelectWorkingHours') + domain.workingTime"
  334. @change="seleChn(0,domain)">
  335. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  336. </el-select>
  337. <span v-if="reportTimeType.type == 1">{{$t('time.hour')}}</span>
  338. <span v-if="reportTimeType.type == 2">
  339. <!--时间范围选择 -->
  340. <el-time-picker
  341. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  342. v-model="domain.startTime"
  343. :placeholder="$t('time.startTime')"
  344. style="width:120px;"
  345. format="HH:mm"
  346. value-format="HH:mm"
  347. :picker-options="{
  348. start: '08:00',
  349. end: '23:30'
  350. }"
  351. @change="iptChang()">
  352. </el-time-picker> - <el-time-picker
  353. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  354. v-model="domain.endTime"
  355. :placeholder="$t('time.endTime')"
  356. style="width:120px;"
  357. format="HH:mm"
  358. value-format="HH:mm"
  359. :picker-options="{
  360. start: '08:00',
  361. end: '23:30',
  362. minTime: domain.startTime
  363. }"
  364. @change="iptChang()">
  365. </el-time-picker>
  366. </span>
  367. <div class="overtime" v-if="user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)">
  368. <el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  369. <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>
  370. </div>
  371. </el-form-item>
  372. <el-form-item :label="user.companyId==781? $t('screening.workTasks') : $t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  373. :rules="{ required: true, message: user.companyId==781? $t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  374. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?$t('defaultText.pleaseSelectaJob'): $t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  375. @change="selectProject(domain, index)"
  376. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  377. <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
  378. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  379. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  380. <span style="float: right;">{{ item.projectName }}</span>
  381. </el-option>
  382. </el-select>
  383. <template v-if="user.timeType.mainProjectState != 1">
  384. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  385. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  386. <!--子项目 -->
  387. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  388. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  389. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  390. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  391. </el-select>
  392. </template>
  393. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  394. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  395. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  396. </el-link>
  397. <!-- <el-link type="primary" v-if="canEdit"
  398. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  399. </el-form-item>
  400. <el-form-item :label="user.companyId==781? $t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  401. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  402. </el-form-item>
  403. <!--如果设置了工时成本预警的预算成本项-->
  404. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  405. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()" style="width:200px;">
  406. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  407. </el-select>
  408. </el-form-item>
  409. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  410. <!-- 任务分组 -->
  411. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  412. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  413. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  414. </el-select>
  415. <!-- 项目的阶段 -->
  416. <span v-if="domain.stages != null && domain.stages.length> 0"
  417. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  418. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  419. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  420. @change="changeStages(domain, index)"
  421. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  422. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  423. </el-select>
  424. </el-form-item>
  425. <el-form-item :label="user.companyId==781? $t('other.reviewer') : $t('other.projectAuditor')" v-if="user.timeType.reportAuditType != 3">
  426. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'" style="width:200px;">
  427. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  428. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  429. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  430. </el-option>
  431. </el-select>
  432. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="domain.projectAuditorId ? true : false" @selectCatCli="selectCatCli"></selectCat>
  433. </el-form-item>
  434. <!-- 111111 -->
  435. <el-form-item label="审核人" v-if="user.timeType.reportAuditType == 3">
  436. <el-select v-model="domain.auditorFirst" placeholder="第一审核人" :disabled="!domain.canEdit" style="width:200px;">
  437. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  438. </el-select>
  439. <template v-if="user.timeType.auditLevel > 1">
  440. <i class="el-icon-right"></i>
  441. <el-select v-model="domain.auditorSec" placeholder="第二审核人" :disabled="!domain.canEdit" style="width:200px;">
  442. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  443. </el-select>
  444. </template>
  445. <template v-if="user.timeType.auditLevel > 2">
  446. <i class="el-icon-right"></i>
  447. <el-select v-model="domain.auditorThird" placeholder="第三审核人" :disabled="!domain.canEdit" style="width:200px;">
  448. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  449. </el-select>
  450. </template>
  451. </el-form-item>
  452. <el-form-item label="抄送人" v-if="user.timeType.reportAuditType == 3">
  453. <el-select v-model="domain.ccUserid" clearable :disabled="!domain.canEdit" style="width:200px;">
  454. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  455. </el-select>
  456. </el-form-item>
  457. <!-- 相关维度/自定义维度 -->
  458. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1" :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'">
  459. <el-select v-model="domain.degreeId" clearable :placeholder="$t('defaultText.pleaseChoose')" :disabled="!domain.canEdit" style="width:200px;">
  460. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  461. </el-option>
  462. </el-select>
  463. </el-form-item>
  464. <!-- 相关数值 -->
  465. <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">
  466. <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>
  467. </el-form-item>
  468. <!-- 自定义文本 -->
  469. <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">
  470. <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>
  471. </el-form-item>
  472. <el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  473. :rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
  474. <div style="width:300px;">
  475. <el-col span="14"><el-slider :disabled="!domain.canEdit" v-model="domain.progress" :min="5" :show-tooltip="false" :step="5" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  476. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}{{$t('time.hour')}}</span></el-col>
  477. </div>
  478. <div class="overtime" v-if="user.timeType.fillOvertime || isWeekend"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.WorkOvertime')}}</el-checkbox>
  479. <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>
  480. </div>
  481. </el-form-item>
  482. <!--工程专业版本模式下, 各个专业的进度填报 -->
  483. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  484. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  485. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  486. <el-input size="mini" style="width:60px;" v-model="item.progress"
  487. @keyup.native="onProgressChange"
  488. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  489. </span>
  490. </el-form-item>
  491. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  492. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  493. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  494. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  495. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  496. </el-select>
  497. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  498. </el-form-item>
  499. <el-form-item :label="user.companyId==781? $t('other.specificContentAndResults') : $t('other.workMatters') " :prop="'domains.' + index + '.content'"
  500. :rules="user.timeType.workContentState == 1 ? { required: true, message: user.companyId==781? $t('other.tianspecificContentAndResults'):$t('other.tianworkMatters'), trigger: 'blur' } : null">
  501. <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable
  502. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  503. </el-form-item>
  504. </div>
  505. <!--多个工作事项填报的情况 -->
  506. <div v-if="reportTimeType.multiWorktime==1">
  507. <el-form-item :label="$t('screening.inputProject')" :prop="'domains.' + index + '.projectId'"
  508. :rules="{ required: true, message: $t('defaultText.pleaseSelectSnItem'), trigger: ['change','blur'] }">
  509. <el-select v-model="domain.projectId" :placeholder="$t('defaultText.pleaseSelectSnItem')" style="width:200px;" clearable="true" filterable="true" value-key="id"
  510. @change="selectProject(domain, index)"
  511. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" popper-class="projectSelectPopperClass">
  512. <el-option v-for="item in fillProjectList" :disabled="item.status!=1 && item.status!=4" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  513. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  514. <span style="float: right;">{{ item.projectName }}</span>
  515. </el-option>
  516. </el-select>
  517. <template v-if="user.timeType.mainProjectState != 1">
  518. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  519. style="margin-left:45px;">{{$t('lable.subproject')}}</span>
  520. <!--子项目 -->
  521. <el-select v-model="domain.subProjectId" :placeholder="$t('defaultText.PleaseSelectaSub-item')" style="width:200px;margin-left:10px;" clearable="true"
  522. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  523. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  524. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  525. </el-select>
  526. </template>
  527. <el-link v-if="index >= 1&&domain.canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  528. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  529. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  530. </el-link>
  531. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!domain.canEdit" v-model="domain.isOvertime">{{$t('other.IncludingOvertime')}}</el-checkbox>
  532. <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>
  533. </div>
  534. <!-- <el-link type="primary" v-if="canEdit"
  535. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link> -->
  536. </el-form-item>
  537. <el-form-item :label="user.companyId==781?$t('other.describe'):$t('other.projectDescription')" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  538. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  539. </el-form-item>
  540. <!--如果设置了工时成本预警的预算成本项-->
  541. <el-form-item :label="$t('lable.budgetSource')" v-if="user.company.packageProject==1&&timeBasecostList &&timeBasecostList.length>0">
  542. <el-select v-model="domain.basecostId" :disabled="!domain.canEdit" @change="$forceUpdate()">
  543. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  544. </el-select>
  545. </el-form-item>
  546. <el-form-item :label="$t('lable.taskGrouping')" v-if="user.company.packageProject == 1">
  547. <!-- 任务分组 -->
  548. <el-select v-model="domain.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" style="width:200px;" clearable="true"
  549. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  550. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  551. </el-select>
  552. <!-- 项目的阶段 -->
  553. <span v-if="domain.stages != null && domain.stages.length> 0"
  554. style="margin-left:30px;">{{$t('other.inputStage')}}</span>
  555. <el-select v-model="domain.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width:200px;margin-left:10px;"
  556. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  557. @change="changeStages(domain, index)"
  558. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  559. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  560. </el-select>
  561. </el-form-item>
  562. <el-form-item :label="$t('other.projectAuditor')" >
  563. <el-select v-model="domain.projectAuditorId" :disabled="!domain.canEdit" @change="$forceUpdate()" v-if="user.userNameNeedTranslate != '1'">
  564. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id">
  565. <span style="float: left" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
  566. <span style="float: left" v-if="user.userNameNeedTranslate != '1'">{{item.auditorName}}</span>
  567. </el-option>
  568. </el-select>
  569. <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'small'" :subject="domain.auditUserList" :idx="index" :subjectId="domain.projectAuditorId" ref="selectCat" :flg="true" @selectCatCli="selectCatCli"></selectCat>
  570. </el-form-item>
  571. <!--工程专业版本模式下, 各个专业的进度填报 -->
  572. <el-form-item :label="$t('other.professionalProgress')" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  573. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  574. <span>{{item.professionName}}</span> / {{$t('other.schedule')}}:
  575. <el-input size="mini" style="width:60px;" v-model="item.progress"
  576. @keyup.native="onProgressChange"
  577. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  578. </span>
  579. </el-form-item>
  580. <!-- 相关维度 -->
  581. <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'">
  582. <el-select v-model="domain.degreeId" :disabled="!domain.canEdit" clearable :placeholder="$t('defaultText.pleaseChoose')">
  583. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  584. </el-option>
  585. </el-select>
  586. </el-form-item>
  587. <!-- 相关数值 -->
  588. <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">
  589. <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>
  590. </el-form-item>
  591. <!-- 自定义文本 -->
  592. <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">
  593. <el-input :disabled="!domain.canEdit" v-model="domain.customText" style="width:75%;margin-right:7%" type="textarea" :rows="1" maxlength="1000"></el-input>
  594. </el-form-item>
  595. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  596. <el-form-item :label="$t('other.task')+' / '+$t('other.milestone')" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  597. <el-select v-model="domain.taskId" :placeholder="$t('defaultText.pleaseChoose')" style="width:75%;margin-right:7%" filterable="true"
  598. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  599. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  600. </el-select>
  601. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">{{$t('state.completed')}}</el-checkbox>
  602. </el-form-item>
  603. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  604. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  605. <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>
  606. <el-form-item :label="$t('screening.workHours')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  607. :rules="{ required: true, message: $t('defaultText.pleaseSelectWorkingHourss'), trigger: 'blur' }">
  608. <span v-if="reportTimeType.type == 2">
  609. <!-- <span> -->
  610. <!--时间范围选择 -->
  611. <el-time-picker
  612. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  613. v-model="timeItem.startTime"
  614. :placeholder="$t('time.startTime')"
  615. style="width:120px;"
  616. format="HH:mm"
  617. value-format="HH:mm"
  618. :picker-options="{
  619. start: '00:00',
  620. end: '23:59',
  621. }"
  622. @change="iptChangs()">
  623. </el-time-picker> - <el-time-picker
  624. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  625. v-model="timeItem.endTime"
  626. :placeholder="$t('time.endTime')"
  627. style="width:120px;"
  628. format="HH:mm"
  629. value-format="HH:mm"
  630. :picker-options="{
  631. start: '00:00',
  632. end: '23:59',
  633. minTime: timeItem.startTime
  634. }"
  635. @change="iptChangs()">
  636. </el-time-picker>
  637. </span>
  638. </el-form-item>
  639. <el-form-item :label="$t('other.workMatters')" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  640. :rules="user.timeType.workContentState == 1 ? { required: true, message: $t('other.tianworkMatters'), trigger: 'blur' } : null">
  641. <el-input v-model="timeItem.content" type="textarea" :rows="2" :placeholder="$t('other.tianworkMatters')" clearable
  642. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  643. ></el-input>
  644. </el-form-item>
  645. </div>
  646. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">{{$t('other.AddWorkTime')}}</el-link>
  647. </div>
  648. <!--照片的显示 -->
  649. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  650. <el-image v-for="(pic, index) in domain.pics" :key="index"
  651. style="width: 100px; height: 100px; margin-right:10px;"
  652. :src="pic"
  653. :preview-src-list="domain.pics">
  654. </el-image>
  655. </p>
  656. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  657. </div>
  658. <span id="workFormsItemBottom"></span>
  659. <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;position:sticky;bottom:70px;background:#fff;z-index:1010">{{$t('other.addMore')}}</el-link>
  660. </el-form>
  661. <span slot="footer" class="dialog-footer">
  662. <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
  663. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
  664. <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
  665. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
  666. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  667. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >{{$t('btn.submit')}}</el-button>
  668. </span>
  669. </el-dialog>
  670. <!-- 按周填报 -->
  671. <el-dialog :title="$t('textLink.fillInAWeek')" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  672. <!-- 按周填报-已填工时-点击 -->
  673. <el-dialog append-to-body :title="$t('lable.filledReport')" :visible.sync="weeklyFilledTimeDialog" width="50%" :close-on-click-modal="false">
  674. <el-table :data="weeklyFilledTimeList" v-loading="weeklyFilledTimeLoading">
  675. <el-table-column prop="project" :label="$t('headerTop.projectName')"></el-table-column>
  676. <el-table-column prop="time" :label="$t('time.workingHours')+'(h)'"></el-table-column>
  677. <el-table-column prop="state" :label="$t('state.states')">
  678. <template slot-scope="scope">{{workReportStateString[scope.row.state]}}</template>
  679. </el-table-column>
  680. <!-- <el-table-column label="操作">
  681. <template slot-scope="scope">
  682. <el-button v-if="scope.row.state == 2 || scope.row.state == 3" size="small" @click="weeklyFilledTimeDelete(scope.row)">删除</el-button>
  683. </template>
  684. </el-table-column> -->
  685. </el-table>
  686. <span slot="footer" class="dialog-footer">
  687. <el-button @click="weeklyFilledTimeDelete()" size="small" type="danger" v-if="weeklyFilledTimeCanDelete">{{$t('btn.delete')}}</el-button>
  688. </span>
  689. </el-dialog>
  690. <el-form ref="WeekWorkForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  691. <el-form-item :label="$t('screening.workingDate')" prop="createDate">
  692. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" 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>
  693. <el-button @click="handleGetPrevWeek()">{{$t('time.lastWeek')}}</el-button>
  694. <el-button @click="handleGetNextvWeek()">{{$t('time.nextWeek')}}</el-button>
  695. <el-button @click="getCurrentWeek()">{{$t('time.thisWeek')}}</el-button>
  696. <el-button @click="newDates()">{{$t('time.addedDate')}}</el-button>
  697. </el-form-item>
  698. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
  699. <el-table-column fixed="left" prop="zhoDataTime" :label="$t('weekDay.date')" width="160">
  700. <template slot-scope="scope">
  701. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData(weekDay)}})
  702. </template>
  703. </el-table-column>
  704. <el-table-column fixed="left" :label="$t('other.hoursFilled')+ '(h)'" width="100" prop="filledTime" align="center">
  705. <template slot-scope="scope">
  706. <el-link type="primary" v-if="scope.row.filledTime" @click="weeklyFilledTimeClick(scope.row.zhoDataTime)">{{scope.row.filledTime}}</el-link>
  707. <p v-else></p>
  708. </template>
  709. </el-table-column>
  710. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  711. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" min-width="200">
  712. <template slot-scope="scope">
  713. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  714. <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</el-button>
  715. <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</el-button>
  716. <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]}}</el-button>
  717. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  718. </div>
  719. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  720. <el-button v-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]}}</el-button>
  721. <el-button v-else type="text" >{{$t('defaultText.pleaseFillOut')}}</el-button>
  722. </div>
  723. </template>
  724. </el-table-column>
  725. <el-table-column fixed="right" :label="$t('other.attendancePunch')" width="150" v-if="user.timeType.showDdCardtime == 1 || user.timeType.showCorpwxCardtime == 1">
  726. <template slot-scope="scope">
  727. <span v-if="scope.row.corpTime">{{scope.row.corpTime.startTime + '-' + scope.row.corpTime.endTime + ',' + scope.row.corpTime.workHours + 'h'}}</span>
  728. <span v-else>{{$t('other.noAttendanceRecord')}}</span>
  729. </template>
  730. </el-table-column>
  731. <el-table-column fixed="right" prop="he" :label="$t('other.totals')+'(h)'" width="120">
  732. <template slot-scope="scope">
  733. <div class="zhiss">
  734. <p>{{scope.row.filledTime ? parseFloat(scope.row.he) + scope.row.filledTime*1 : parseFloat(scope.row.he)}}</p>
  735. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  736. </div>
  737. </template>
  738. </el-table-column>
  739. </el-table>
  740. </el-form>
  741. <!-- 按周填报项目筛选 -->
  742. <div v-if="selConShow" class="selConStyle">
  743. <div class="selConStyle_title">{{$t('defaultText.pleaseSelectTheItemYouWantToFillIn')}}</div>
  744. <el-select v-model="selCon" multiple :placeholder="$t('defaultText.pleaseChoose')" filterable>
  745. <el-option
  746. v-for="item in fillProjectList"
  747. :disabled="item.status!=1 && item.status!=4"
  748. :key="item.id"
  749. :label="item.projectName"
  750. :value="item.id">
  751. </el-option>
  752. </el-select>
  753. </div>
  754. <span slot="footer" class="dialog-footer" v-if="selConShow">
  755. <el-button @click="selListqx()">{{$t('btn.cancel')}}</el-button>
  756. <el-button type="primary" @click="selListFun()">{{$t('btn.nextStep')}}</el-button>
  757. <!-- :loading="submitingReport" -->
  758. </span>
  759. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  760. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">{{$t('defaultText.selectProject')}}</el-button>
  761. <el-button @click="zhoAddqx()">{{$t('btn.cancel')}}</el-button>
  762. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">{{$t('btn.submit')}}</el-button>
  763. </span>
  764. </el-dialog>
  765. <!-- 选择时间 -->
  766. <el-dialog :title="$t('other.timeSelection')" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  767. <span>{{$t('other.thisIsAPieceOfInformation')}}</span>
  768. <span slot="footer" class="dialog-footer">
  769. <el-button @click="btnZho = false">{{$t('btn.cancel')}}</el-button>
  770. <el-button type="primary" @click="btnZho = false">{{$t('btn.determine')}}</el-button>
  771. </span>
  772. </el-dialog>
  773. <!-- 按周填报弹窗 -->
  774. <el-dialog :title="$t('defaultText.pleaseFillOut')" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
  775. <div>
  776. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0 && user.timeType.mainProjectState != 1">
  777. <p>{{$t('lable.subproject')}}</p>
  778. <el-select v-model="zhoBao.subProjectId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  779. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  780. </el-select>
  781. </div>
  782. <!--如果设置了工时成本预警的预算成本项-->
  783. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  784. <p>{{$t('lable.budgetSource')}}</p>
  785. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  786. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  787. </el-select>
  788. </div>
  789. <!-- 任务分组 -->
  790. <div class="zhoFel" v-if="user.company.packageProject == 1">
  791. <p>{{$t('lable.taskGrouping')}}</p>
  792. <el-select v-model="zhoBao.groupId" :placeholder="$t('defaultText.pleaseSelectaTaskGroup')" clearable="true" style="width: 355px"
  793. @change="getGroupStages(zhoBao, 0)">
  794. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  795. </el-select>
  796. </div>
  797. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  798. <p>{{$t('other.inputStage')}}</p>
  799. <el-select v-model="zhoBao.stage" :placeholder="$t('defaultText.pleaseChoose')" style="width: 355px" clearable="true" >
  800. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  801. </el-select>
  802. </div>
  803. <div class="zhoFel" v-if="user.timeType.reportAuditType != 3">
  804. <p>{{$t('other.reviewer')}}</p>
  805. <el-select v-model="zhoBao.projectAuditorId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  806. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  807. </el-select>
  808. </div>
  809. <template v-if="user.timeType.reportAuditType == 3">
  810. <div class="zhoFel">
  811. <p>第一审核人</p>
  812. <el-select v-model="zhoBao.auditorFirst" placeholder="第一审核人" style="width: 355px">
  813. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  814. </el-select>
  815. </div>
  816. <div class="zhoFel">
  817. <p>第二审核人</p>
  818. <el-select v-model="zhoBao.auditorSec" placeholder="第二审核人" style="width: 355px">
  819. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  820. </el-select>
  821. </div>
  822. <div class="zhoFel">
  823. <p>第三审核人</p>
  824. <el-select v-model="zhoBao.auditorThird" placeholder="第三审核人" style="width: 355px">
  825. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  826. </el-select>
  827. </div>
  828. <div class="zhoFel">
  829. <p>抄送人</p>
  830. <el-select v-model="zhoBao.ccUserid" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  831. <el-option v-for="item in allUsersList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  832. </el-select>
  833. </div>
  834. </template>
  835. <!-- 自定义维度 -->
  836. <div class="zhoFel" v-if="user.timeType.customDegreeActive">
  837. <p>{{user.timeType.customDegreeName}}</p>
  838. <el-select v-model="zhoBao.degreeId" :placeholder="$t('defaultText.pleaseChoose')" clearable="true" style="width: 355px">
  839. <el-option v-for="item in zhoBao.wuduList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  840. </el-select>
  841. </div>
  842. <!-- 自定义数值 -->
  843. <div class="zhoFel" v-if="user.timeType.customDataActive">
  844. <p>{{user.timeType.customDataName}}</p>
  845. <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>
  846. </div>
  847. <!-- 自定义文本 -->
  848. <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
  849. <p>{{user.timeType.customTextName}}</p>
  850. <el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
  851. </div>
  852. <div class="zhoFel" v-if="reportTimeType.type == 2">
  853. <p>{{$t('other.timeSelection')}}</p>
  854. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" :placeholder="$t('time.selectTimeRange')"></el-time-picker>
  855. </div>
  856. <div class="zhoFel" v-if="reportTimeType.type == 1">
  857. <p>{{$t('other.chooseDuration')}}</p>
  858. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" :placeholder="$t('defaultText.pleaseSelectWorkingHours')">
  859. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  860. </el-select>
  861. </div>
  862. <div class="zhoFel" v-if="reportTimeType.type == 3">
  863. <p>{{$t('lable.percentageOfTime')}}</p>
  864. <div style="width:355px;display: flex;align-items: center;">
  865. <el-col span="23"><el-slider style="margin-left: 5px;width:249px;" v-model="zhoBao.progress" :min="0" :show-tooltip="false" :step="10" @input="zhoBao.workingTime = (reportTimeType.allday*zhoBao.progress/100).toFixed(1)"></el-slider></el-col>
  866. <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>
  867. </div>
  868. </div>
  869. <div class="zhoFel">
  870. <p>{{$t('other.workMatters')}}</p>
  871. <el-input type="textarea" v-model="zhoBao.con" :placeholder="$t('other.tianworkMatters')" style="width: 355px" clearable></el-input>
  872. </div>
  873. </div>
  874. <span slot="footer" class="dialog-footer">
  875. <el-button @click="tianxieDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  876. <el-button type="primary" @click="btnTianxiaes()">{{$t('btn.determine')}}</el-button>
  877. </span>
  878. </el-dialog>
  879. <!-- 批量日报审核 -->
  880. <el-dialog :title="$t('other.bulkProjectReportReview')" :visible.sync="approveDialogVisible" width="500px" >
  881. <el-checkbox v-model="isAllSelect" :label="$t('btn.selectAll')" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  882. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  883. </el-tree>
  884. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">{{$t('other.responsibleForTheProjectLength')}}</div>
  885. <span slot="footer" class="dialog-footer">
  886. <el-button @click="approveDialogVisible = false">{{$t('btn.cancel')}}</el-button>
  887. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">{{$t('state.approved')}}</el-button>
  888. </span>
  889. </el-dialog>
  890. <!--导出报表条件选择 -->
  891. <el-dialog :title="$t('textLink.exportWork')" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  892. <el-form ref="form3" :model="exportParam" >
  893. <el-form-item prop="projectId" :label="$t('defaultText.selectProject')">
  894. <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable filterable style="width:350px;">
  895. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  896. </el-select>
  897. </el-form-item>
  898. <el-form-item prop="departmentId" :label="$t('other.selectdepartment')" v-if="permissions.reportsCompany">
  899. <el-cascader v-model="exportParam.departmentId" :placeholder="$t('other.allDepartments')" :options="departmentList" :props="{ checkStrictly: true, value: 'id' }" clearable style="width: 350px;"></el-cascader>
  900. </el-form-item>
  901. <el-form-item prop="projectId" :label="$t('time.dateRange')">
  902. <el-date-picker
  903. v-model="exportParam.dateRange" :editable="false"
  904. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  905. :clearable="true"
  906. :range-separator="$t('other.to')"
  907. type="daterange"
  908. :start-placeholder="$t('time.startDate')"
  909. :end-placeholder="$t('time.endDate')"
  910. ></el-date-picker>
  911. </el-form-item>
  912. <el-form-item prop="stateKey" :label="$t('other.doesItContain')">
  913. <el-select v-model="stateKey" :placeholder="$t('defaultText.pleaseChoose')" filterable style="width:350px;">
  914. <el-option :label="$t('state.alreadyPassed')" value="0"></el-option>
  915. <el-option :label="$t('state.WaitingAudit')" value="2"></el-option>
  916. <el-option :label="$t('state.alreadyPassedAndWaitingAudit')" value="1"></el-option>
  917. </el-select>
  918. </el-form-item>
  919. </el-form>
  920. <div slot="footer" class="dialog-footer">
  921. <el-button type="primary" @click="exportReport" style="width:100%;" :loading="listLoading">{{$t('export.export')}}</el-button>
  922. </div>
  923. </el-dialog>
  924. <!--导出报表条件选择 -->
  925. <el-dialog :title="$t('other.laborStatisticsExport')" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  926. <el-form ref="form3" :model="exportParam" >
  927. <el-form-item prop="range" :label="$t('time.dateRange')">
  928. <el-date-picker
  929. v-model="exportParam.dateRange" :editable="false"
  930. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  931. :clearable="true"
  932. :range-separator="$t('other.to')"
  933. type="daterange"
  934. :start-placeholder="$t('time.startDate')"
  935. :end-placeholder="$t('time.endDate')"
  936. ></el-date-picker>
  937. </el-form-item>
  938. </el-form>
  939. <div slot="footer" class="dialog-footer">
  940. <el-button type="primary" @click="exportUserTime" style="width:100%;" >{{$t('export.export')}}</el-button>
  941. </div>
  942. </el-dialog>
  943. <!--人员列表 -->
  944. <el-dialog :title="(isFill?$t('other.filled'):$t('other.unfilled'))+$t('other.personnelList')" v-if="membListVisible" :visible.sync="membListVisible" width="500px" class="membListClass">
  945. <el-tabs v-model="isLeave" v-if="!isFill && (user.timeType.syncCorpwxTime == 1 || user.timeType.syncDingding == 1 || user.company.packageOa == 1)" type="card">
  946. <el-tab-pane :label="$t('other.unfilledontheday')+'(' + fillMembList.length + $t('other.people')+')'" :name="0">
  947. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel">
  948. <el-table-column type="selection"></el-table-column>
  949. <el-table-column prop="label" :label="$t('lable.name')" >
  950. <template slot-scope="scope">
  951. <span>{{(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}}</span>
  952. </template>
  953. </el-table-column>
  954. <el-table-column prop="deptName" :label="$t('lable.department')" >
  955. </el-table-column>
  956. </el-table>
  957. </el-tab-pane>
  958. <el-tab-pane :label="$t('other.takeDayOff')+'(' + fillMembList_leave.length + $t('other.people') +')'" :name="1">
  959. <el-table :show-header="true" :data="fillMembList_leave" highlight-current-row :height="400" style="width: 100%;">
  960. <el-table-column prop="label" :label="$t('lable.name')" >
  961. <template slot-scope="scope">
  962. <!-- <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> -->
  963. <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>
  964. </template>
  965. </el-table-column>
  966. <el-table-column prop="deptName" :label="$t('lable.department')" >
  967. </el-table-column>
  968. </el-table>
  969. </el-tab-pane>
  970. </el-tabs>
  971. <el-table :show-header="true" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;" @selection-change="notifySel" v-else>
  972. <el-table-column type="selection"></el-table-column>
  973. <el-table-column prop="label" :label="$t('lable.name')" ></el-table-column>
  974. <el-table-column prop="deptName" :label="$t('lable.department')" >
  975. </el-table-column>
  976. </el-table>
  977. <div slot="footer" class="dialog-footer" v-if="!(isLeave == 1 && !isFill)">
  978. <el-button type="primary" @click="Notify(0)" v-if="!isFill && this.user.corpwxUserid" :disabled="fillMembList == 0">{{$t('other.enterpriseWeChatReminder')}}</el-button>
  979. <el-button type="primary" @click="Notify(1)" v-if="!isFill && !this.user.corpwxUserid && this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.dingNingurgefilling')}}</el-button>
  980. <el-button type="primary" @click="Notify(2)" v-if="!isFill && !this.user.corpwxUserid && !this.user.dingdingUserid" :disabled="fillMembList == 0">{{$t('other.weChatReminder')}}</el-button>
  981. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">{{$t('export.export')}}</el-button>
  982. </div>
  983. </el-dialog>
  984. <!-- 按部门选择人员 -->
  985. <el-dialog :title="$t('defaultText.selectthepersonwhneedstofillinthereport')" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  986. <el-input style="width:100%" v-model="deptMembDataText" :placeholder="$t('defaultText.pleaseEnterNametoSearch')"></el-input>
  987. <div class="tree" style="height:400px">
  988. <el-scrollbar style="height:100%">
  989. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  990. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  991. highlight-current :filter-node-method="filterNode"></el-tree>
  992. </el-scrollbar>
  993. </div>
  994. <div>{{$t('btn.choose')}}&nbsp;{{chosenMembCount}}&nbsp;{{$t('other.people')}}</div>
  995. <div slot="footer" class="dialog-footer">
  996. <el-button @click="chooseParticipVisible = false" >{{$t('btn.cancel')}}</el-button>
  997. <el-button type="primary" @click="chooseParticip()" >{{$t('btn.submit')}}</el-button>
  998. </div>
  999. </el-dialog>
  1000. <el-dialog
  1001. v-if="monthWorkTimeDialog"
  1002. :visible.sync="monthWorkTimeDialog"
  1003. :close-on-click-modal="false"
  1004. customClass="customWidth selectworktime"
  1005. width="63%"
  1006. title=""
  1007. >
  1008. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  1009. <el-tabs v-model="activeName" @tab-click="handleClick">
  1010. <el-tab-pane :label="$t('other.completedHours')" name="first">
  1011. <div class="selectworktime_export" style="margin-top:10px;">
  1012. <div class="selectworktime_export_l">
  1013. <el-date-picker
  1014. class="selecteworktime_datapick"
  1015. v-model="WorktimeDatepickValue"
  1016. value-format="yyyy-MM-dd"
  1017. type="daterange"
  1018. align="right"
  1019. unlink-panels
  1020. :range-separator="$t('other.to')"
  1021. :start-placeholder="$t('time.startDate')"
  1022. :end-placeholder="$t('time.endDate')"
  1023. :default-time="['12:00:00', '12:00:00']"
  1024. size="small"
  1025. popper-class="selecteorktime_datapick_popper"
  1026. @change="showMonthWorkTime()"
  1027. >
  1028. </el-date-picker>
  1029. <el-button size="small" @click="getDoubleLastWeek(1)">{{$t('time.twoWeeksAgo')}}</el-button>
  1030. <el-button size="small" @click="getLastWeek(1)">{{$t('time.lastWeek')}}</el-button>
  1031. <el-button size="small" @click="getThisWeek(1)">{{$t('time.nextWeek')}}</el-button>
  1032. <!-- 222 -->
  1033. </div>
  1034. <div>
  1035. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1036. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  1037. </el-input>
  1038. </div>
  1039. <el-link
  1040. type="primary"
  1041. style="float: right; vertical-align: middle;height:32px"
  1042. @click="exportMembWorkHours()"
  1043. >{{$t('export.exportData')}}</el-link
  1044. >
  1045. </div>
  1046. <el-table ref="hasworkTbl"
  1047. :data="monthWorkDataS"
  1048. v-el-table-infinite-scroll="listScroll"
  1049. border
  1050. :height="500"
  1051. highlight-current-row
  1052. style="width: 100%"
  1053. v-loading="tbload"
  1054. :lazy="true"
  1055. >
  1056. <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
  1057. <template slot-scope="scope">
  1058. {{ scope.$index + 1 }}
  1059. </template>
  1060. </el-table-column>
  1061. <el-table-column width="105" prop="name" fixed="left" :label="$t('lable.name')">
  1062. <template slot-scope="scope">
  1063. <span :style="scope.row.worktimeList.length==0?'color:red':''">
  1064. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1065. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1066. <!-- {{scope.row.name}} -->
  1067. </span>
  1068. </template>
  1069. </el-table-column>
  1070. <el-table-column prop="departmentName" fixed="left" :label="$t('lable.department')">
  1071. <template slot-scope="scope">
  1072. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  1073. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  1074. </template>
  1075. </el-table-column>
  1076. <el-table-column
  1077. min-width="105"
  1078. v-for="(item, index) in pickDateArray"
  1079. :key="index"
  1080. :label="item.label"
  1081. align="center"
  1082. >
  1083. <template slot-scope="scope">
  1084. <div
  1085. style="color: red"
  1086. v-if="
  1087. scope.row.worktimeList.filter(
  1088. (w) =>
  1089. w.createDate==item.date
  1090. ).length > 0 &&
  1091. scope.row.worktimeList.filter(
  1092. (w) =>w.createDate==item.date
  1093. )[0].workingTime < reportTimeType.allday
  1094. "
  1095. >
  1096. {{
  1097. scope.row.worktimeList.filter(
  1098. (w) =>w.createDate==item.date
  1099. )[0].workingTime.toFixed(1)
  1100. }}
  1101. </div>
  1102. <div
  1103. style="color: #20a0ff"
  1104. v-if="
  1105. scope.row.worktimeList.filter(
  1106. (w) =>w.createDate==item.date
  1107. ).length > 0 &&
  1108. scope.row.worktimeList.filter(
  1109. (w) =>w.createDate==item.date
  1110. )[0].workingTime > reportTimeType.allday
  1111. "
  1112. >
  1113. {{
  1114. scope.row.worktimeList.filter(
  1115. (w) =>w.createDate==item.date
  1116. )[0].workingTime.toFixed(1)
  1117. }}
  1118. </div>
  1119. <div
  1120. v-if="
  1121. scope.row.worktimeList.filter(
  1122. (w) =>w.createDate==item.date
  1123. ).length > 0 &&
  1124. scope.row.worktimeList.filter(
  1125. (w) =>w.createDate==item.date
  1126. )[0].workingTime == reportTimeType.allday
  1127. "
  1128. >
  1129. {{
  1130. scope.row.worktimeList.filter(
  1131. (w) =>w.createDate==item.date
  1132. )[0].workingTime
  1133. }}
  1134. </div>
  1135. <div
  1136. v-if="
  1137. scope.row.worktimeList.filter(
  1138. (w) =>w.createDate==item.date
  1139. ).length == 0
  1140. "
  1141. >
  1142. 0
  1143. </div>
  1144. <div
  1145. v-if="
  1146. scope.row.worktimeList.filter(
  1147. (w) =>w.createDate==item.date
  1148. ).length > 0 &&
  1149. typeof scope.row.worktimeList.filter(
  1150. (w) =>w.createDate==item.date
  1151. )[0].workingTime == 'string'
  1152. "
  1153. >
  1154. {{
  1155. scope.row.worktimeList.filter(
  1156. (w) =>w.createDate==item.date
  1157. )[0].workingTime
  1158. }}
  1159. </div>
  1160. </template>
  1161. </el-table-column>
  1162. </el-table>
  1163. <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>
  1164. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
  1165. <!-- <div slot="title" class="dialog-title selectworktime_title">
  1166. <label style="font-size: 16px">员工每日已填报工时数</label>
  1167. <el-link
  1168. type="primary"
  1169. style="float: right; margin-right: 60px"
  1170. @click="exportMembWorkHours()"
  1171. >导出已填报数据</el-link
  1172. > -->
  1173. <!-- <el-button >导出</el-button> -->
  1174. <!-- </div> -->
  1175. </el-tab-pane>
  1176. <el-tab-pane :label="$t('other.unfilledPersonList')" name="second" >
  1177. <div class="selectworktime_export" style="margin-top:10px">
  1178. <div class="selectworktime_export_l">
  1179. <el-date-picker
  1180. class="selecteworktime_datapick"
  1181. v-model="WorktimeDatepickValue"
  1182. value-format="yyyy-MM-dd"
  1183. type="daterange"
  1184. align="right"
  1185. unlink-panels
  1186. :range-separator="$t('other.to')"
  1187. :start-placeholder="$t('time.startDate')"
  1188. :end-placeholder="$t('time.endDate')"
  1189. :default-time="['12:00:00', '12:00:00']"
  1190. size="small"
  1191. popper-class="selecteorktime_datapick_popper"
  1192. @change="showMonthNotWorkTime()"
  1193. >
  1194. </el-date-picker>
  1195. <el-button size="small" @click="getDoubleLastWeek()">{{$t('time.twoWeeksAgo')}}</el-button>
  1196. <el-button size="small" @click="getLastWeek()">{{$t('time.lastWeek')}}</el-button>
  1197. <el-button size="small" @click="getThisWeek()">{{$t('time.nextWeek')}}</el-button>
  1198. </div>
  1199. <div>
  1200. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" :placeholder="$t('defaultText.pleaseEnterNametoSearch')" clearable="true" size="small">
  1201. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  1202. </el-input>
  1203. </div>
  1204. <el-link
  1205. type="primary"
  1206. style="float: right; vertical-align: middle;height:32px"
  1207. @click="exportMembNotWorkHours()"
  1208. >{{$t('export.exportData')}}</el-link
  1209. >
  1210. </div>
  1211. <el-table
  1212. ref="hasworkTbl2"
  1213. :data="monthNotWorkDateS"
  1214. v-el-table-infinite-scroll="notListScroll"
  1215. border
  1216. :height="500"
  1217. highlight-current-row
  1218. style="width: 100%"
  1219. v-loading="tbload"
  1220. lazy
  1221. >
  1222. <el-table-column min-width="150" :label="$t('lable.department')" prop="department">
  1223. <template slot-scope="scope">
  1224. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.department'></ww-open-data></span>
  1225. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.department}}</span>
  1226. </template>
  1227. </el-table-column>
  1228. <el-table-column min-width="150" prop="name" :label="$t('lable.name')" >
  1229. <template slot-scope="scope">
  1230. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
  1231. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.name}}</span>
  1232. </template>
  1233. </el-table-column>
  1234. <el-table-column
  1235. min-width="200"
  1236. :label="$t('weekDay.date')"
  1237. align="center"
  1238. prop="createDate"
  1239. >
  1240. </el-table-column>
  1241. <el-table-column
  1242. min-width="200"
  1243. :label="$t('state.states')"
  1244. align="center"
  1245. prop="status"
  1246. />
  1247. <el-table-column
  1248. min-width="200"
  1249. :label="$t('other.attendanceData')"
  1250. prop="cardTime"
  1251. align="center"
  1252. v-if="user.timeType.syncCorpwxTime == 1"></el-table-column>
  1253. </el-table>
  1254. <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>
  1255. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="success" center show-icon></el-alert>
  1256. </el-tab-pane>
  1257. </el-tabs>
  1258. </el-dialog>
  1259. <!--驳回弹出框 -->
  1260. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1261. <div>
  1262. <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')" />
  1263. </div>
  1264. <div slot="footer" class="dialog-footer">
  1265. <el-button @click="denyReasonDialog = false" >{{$t('btn.cancel')}}</el-button>
  1266. <el-button type="primary" @click="deny()" >{{$t('btn.submit')}}</el-button>
  1267. </div>
  1268. </el-dialog>
  1269. <!-- 通过弹出框 -->
  1270. <el-dialog :title="$t('other.reviewEvaluation')" v-if="approveinDialog" :visible.sync="approveinDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1271. <div>
  1272. <el-input type="textarea" v-model="approveinData.evaluate" rows="2" :placeholder="$t('defaultText.Pleaseenterthereviewyoudecidetopass')" />
  1273. </div>
  1274. <div slot="footer" class="dialog-footer">
  1275. <el-button @click="approveinDialog = false" >{{$t('btn.cancel')}}</el-button>
  1276. <el-button type="primary" @click="approveinfun()" >{{$t('btn.submit')}}</el-button>
  1277. </div>
  1278. </el-dialog>
  1279. <!--批量导入日报 -->
  1280. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1281. <p>1. {{$t('other.download')}}
  1282. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/'+$t('template.EmployeeHoursStatisticsTemplate')+'2.xlsx'" :download="$t('template.EmployeeTimeImportTemplate')+'.xlsx'">{{$t('template.EmployeeHoursStatisticsTemplate') + '.xlsx'}}</el-link>
  1283. </p>
  1284. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  1285. <p style="display: flex;justify-content: center;">
  1286. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1287. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  1288. </el-upload>
  1289. </p>
  1290. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1291. <el-link type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1292. </div>
  1293. </el-dialog>
  1294. <!-- 工时导入记录弹窗 -->
  1295. <el-dialog :title="$t('other.viewLaborImportRecords')" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1296. <div style="height: 452px">
  1297. <el-table :data="toViewList" stripe style="width: 100%;" height="400" :loading="toViewLoading">
  1298. <el-table-column prop="indate" :label="$t('other.ImportTime')"> </el-table-column>
  1299. <el-table-column prop="userName" :label="$t('other.operator')"> </el-table-column>
  1300. <el-table-column prop="datel" :label="$t('other.document')">
  1301. <template slot-scope="scope">
  1302. <div>
  1303. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1304. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1305. </div>
  1306. </template>
  1307. </el-table-column>
  1308. </el-table>
  1309. <el-col :span="24" class="paginatis">
  1310. <el-pagination
  1311. @size-change="handleSizeChange"
  1312. @current-change="handleCurrentChange"
  1313. :page-sizes="[20 , 50 , 80 , 100]"
  1314. :page-size="20"
  1315. layout="total, sizes, prev, pager, next"
  1316. :total="toViewForm.total"
  1317. style="float:right;"
  1318. ></el-pagination>
  1319. </el-col>
  1320. </div>
  1321. </el-dialog>
  1322. <!--基于企业微信考勤数据的工时导入 -->
  1323. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1324. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1325. <el-step :title="$t('other.selectadaterangetoimporthours')">
  1326. </el-step>
  1327. <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
  1328. <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
  1329. </el-steps>
  1330. <div v-if="active==0" style="padding:30px;height:360px;">
  1331. <div style="margin-top:50px;margin-left:280px;">
  1332. <el-date-picker
  1333. v-model="importWxParam.date" :editable="false"
  1334. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1335. :clearable="true"
  1336. :range-separator="$t('other.to')"
  1337. type="daterange"
  1338. :start-placeholder="$t('time.startDate')"
  1339. :end-placeholder="$t('time.endDate')"
  1340. @change="loadCheckInData"
  1341. ></el-date-picker>
  1342. </div>
  1343. </div>
  1344. <div v-if="active==1" style="padding:10px;">
  1345. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1346. style="width: 100%;margin-top:5px;" >
  1347. <el-table-column prop="hasPassed" :label="$t('other.approvalStatus')" width="100px">
  1348. <template slot-scope="scope">
  1349. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">{{$t('state.tried')}}</span>
  1350. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">{{$t('state.untrial')}}</span>
  1351. </template>
  1352. </el-table-column>
  1353. <el-table-column prop="createDate" :label="$t('screening.workingDate')" >
  1354. </el-table-column>
  1355. <el-table-column prop="weekDayTxt" :label="$t('weekDay.Week')" ></el-table-column>
  1356. <el-table-column prop="username" :label="$t('screening.employeename')" ></el-table-column>
  1357. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" ></el-table-column>
  1358. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" ></el-table-column>
  1359. <el-table-column prop="workHours" :label="$t('other.actualworkinghours')" align="right">
  1360. <template slot-scope="scope">
  1361. {{scope.row.workHours.toFixed(1)}}h
  1362. </template>
  1363. </el-table-column>
  1364. </el-table>
  1365. </div>
  1366. <div v-if="active==2" >
  1367. <p style="display: flex;justify-content: center;height:390px;">
  1368. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1369. <el-button type="primary" :underline="false" :loading="importingData">{{$t('other.chooseFileAndUpload')}}</el-button>
  1370. </el-upload>
  1371. </p>
  1372. </div>
  1373. <div slot="title">
  1374. <span style="font-size:16px;">{{$t('other.Batchimportofworkinghours')}}</span>
  1375. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">{{$t('other.viewLaborImportRecords')}}</el-link>
  1376. </div>
  1377. <span slot="footer">
  1378. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1379. type="primary" @click="downloadCheckInExcel">{{$t('template.DownloadEmployeeHourStatisticsTemplate')}}.xlsx</el-link>
  1380. <el-button @click="pre" v-if="active!=0">{{$t('btn.previousstep')}}</el-button>
  1381. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">{{$t('btn.nextStep')}}</el-button>
  1382. </span>
  1383. </el-dialog>
  1384. <!--工时批量代填 -->
  1385. <el-dialog :title="$t('title.Fillinginbatchesofworkinghours')" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1386. <div>
  1387. <span>{{$t('time.selectdaterange')}}:</span><el-date-picker
  1388. v-model="importWxParam.date" :editable="false"
  1389. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1390. :clearable="true"
  1391. :range-separator="$t('other.to')"
  1392. type="daterange"
  1393. :start-placeholder="$t('time.startDate')"
  1394. :end-placeholder="$t('time.endDate')"
  1395. @change="loadCheckInData"
  1396. ></el-date-picker>
  1397. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">{{$t('btn.submit')}}</el-button>
  1398. </div>
  1399. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1400. :key="timeStamp"
  1401. style="width: 100%;margin-top:5px;" ref="tab">
  1402. <el-table-column prop="createDate" :label="$t('screening.workingDate')" width="100px" fixed="left"></el-table-column>
  1403. <el-table-column prop="username" :label="$t('screening.employeename')" width="80px" fixed="left"></el-table-column>
  1404. <el-table-column prop="startTime" :label="$t('screening.workinghoursss')" width="80px" fixed="left"></el-table-column>
  1405. <el-table-column prop="endTime" :label="$t('screening.off-dutytime')" width="80px" fixed="left"></el-table-column>
  1406. <el-table-column prop="workHours" :label="$t('screening.workTime')" width="80px" align="right" fixed="left">
  1407. <template slot-scope="scope">
  1408. {{scope.row.workHours.toFixed(1)}}h
  1409. </template>
  1410. </el-table-column>
  1411. <!--项目名称列表 -->
  1412. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1413. <template slot-scope="scope">
  1414. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1415. </template>
  1416. </el-table-column>
  1417. <el-table-column prop="totalFillTime" :label="$t('other.totalworkinghours')" fixed="right">
  1418. <template slot-scope="scope">
  1419. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1420. </template>
  1421. </el-table-column>
  1422. </el-table>
  1423. </el-dialog>
  1424. <!--基于企业微信考勤数据的工时导入 -->
  1425. <el-dialog :title="$t('title.Workhoursimportresult')" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1426. <div>
  1427. <span>{{importResultMsg}}</span>
  1428. </div>
  1429. <span slot="footer" class="dialog-footer">
  1430. <el-button type="primary" @click="showImportResult=false">{{$t('btn.submit')}}</el-button>
  1431. </span>
  1432. </el-dialog>
  1433. <!-- 审核流程展示 -->
  1434. <el-dialog :title="$t('title.reviewProcess')" v-if="approvalProcessDialog" :visible.sync="approvalProcessDialog" customClass="customWidth" width="400px">
  1435. <div style="padding:20px 40px 20px 0">
  1436. <el-timeline :reverse="false">
  1437. <el-timeline-item v-for="item in approvalProcessData" :key="item.id" :timestamp="item.operateDate">{{item.msg}}</el-timeline-item>
  1438. </el-timeline>
  1439. </div>
  1440. </el-dialog>
  1441. </section>
  1442. </template>
  1443. <script>
  1444. // 左右滑动
  1445. import dragMixin from "@/common/js/tensile.js";
  1446. import util from "../../common/js/util";
  1447. // 自定义select组件
  1448. import selectCat from "@/components/select.vue"
  1449. let _that = this
  1450. export default {
  1451. mixins: [dragMixin],
  1452. components: {
  1453. selectCat
  1454. },
  1455. data() {
  1456. return {
  1457. translation: '1', // 1、文字, 2、部门, 3、人员
  1458. exportLoad: false,
  1459. getPickerOptions: {
  1460. disabledDate: (time) => {
  1461. var date = new Date();
  1462. var year = date.getFullYear();
  1463. var month = date.getMonth() + 1;
  1464. if (month >= 1 && month <= 9) {
  1465. month = "0" + month;
  1466. }
  1467. var currentdate = year.toString() + month.toString();
  1468. var timeyear = time.getFullYear();
  1469. var timemonth = time.getMonth() + 1;
  1470. if (timemonth >= 1 && timemonth <= 9) {
  1471. timemonth = "0" + timemonth;
  1472. }
  1473. var timedate = timeyear.toString() + timemonth.toString();
  1474. if(this.user.timeType.fillAhead == 0){
  1475. return currentdate < timedate;
  1476. }else{
  1477. return false
  1478. }
  1479. }
  1480. },
  1481. alalal: '8.0',
  1482. timeBasecostList:null,
  1483. tbload: false,
  1484. exportTimeDialog: false,
  1485. searchKeyword: '',
  1486. monthWorkDataS: [],
  1487. monthNotWorkDateS: [],
  1488. pickDateArray:[],
  1489. WorktimeDatepickValue: [],
  1490. activeName:"first",
  1491. isLeave: 0,
  1492. submitingReport: false,
  1493. importResultMsg:null,
  1494. showImportResult:false,
  1495. importingData: false,
  1496. isDraft: 0,
  1497. timeStamp: 0,
  1498. projectColumns:[],
  1499. checkinLoading:false,
  1500. importWxParam:{date:null,},
  1501. active:0,
  1502. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1503. importWxDialog:false,
  1504. importDialog:false,
  1505. denyForm:null,
  1506. denyReasonDialog:false,
  1507. monthWorkTimeDialog: false,
  1508. isSubstitude:false,
  1509. isFill:false,
  1510. unFillList:[],
  1511. fillList:[],
  1512. fillMembList:[],
  1513. fillMembList_leave: [],
  1514. membListVisible: false,
  1515. isBatch:0,//是否是批量填报
  1516. editTitle: [this.$t('textLink.fillInTheWork'),this.$t('textLink.batchFillIn'),this.$t('textLink.helpToFillIn')],
  1517. // weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1518. 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')],
  1519. statusStyle:["waiting", "filledReportStyle", "RejectStyle", "waitSubmitStyle"],
  1520. fillStatusList: [],
  1521. exportParam:{projectId: null, dateRange:[], departmentId: null},
  1522. exportDialog:false,
  1523. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1524. subProjectList:[],
  1525. canEdit: true,
  1526. timeRange:[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],
  1527. selectTime:null,
  1528. reportTimeType:{},
  1529. curDate:'',
  1530. isAllSelect: false,
  1531. approveDialogVisible:false,
  1532. deptId:null,
  1533. targetUid: null,
  1534. membCount:0,
  1535. selectState:"-1",
  1536. user: JSON.parse(sessionStorage.getItem("user")),
  1537. allUsersList: [],
  1538. showAddMore:false,
  1539. allDate: [],
  1540. typeList:[this.$t('other.allDay'),this.$t('other.morning'),this.$t('other.afternoon')],
  1541. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1542. choseDay: 0,
  1543. tableHeight: 0,
  1544. listLoading: false,
  1545. projectList: [], //项目列表
  1546. fillProjectList: [],
  1547. reportList: [], //日报列表
  1548. reportNames:[], //批量审批列表
  1549. selCon:[], //筛选条件
  1550. selProjectList:[], //筛选后项目列表
  1551. selConShow: true,
  1552. dialogVisible: false, //项目弹窗
  1553. report: '',
  1554. workForm: {
  1555. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1556. domains: [{
  1557. id: null,
  1558. projectId: "",
  1559. workingTime: "",
  1560. timeType:0,
  1561. content: "",
  1562. state: 2,
  1563. multiWorktime:0,
  1564. worktimeList:[],
  1565. degreeId: null,
  1566. auditUserList: []
  1567. }],
  1568. },
  1569. workRules: {
  1570. createDate: [{ required: true, message: this.$t('defaultText.pleaseselectaworkdate'), trigger: "change" }],
  1571. },
  1572. chooseParticipVisible: false,
  1573. logining: false,
  1574. isDisable: false,
  1575. timeType:[],
  1576. deptMembData: [
  1577. ],
  1578. //部门人员树状结构
  1579. data: [
  1580. {
  1581. id: -1,
  1582. label: this.$t('lable.allStaff'),
  1583. membCount:0
  1584. },
  1585. {
  1586. id: 0,
  1587. label: this.$t('lable.unassigned'),
  1588. }
  1589. ],
  1590. allData:{},
  1591. batchShowData:{},
  1592. option: [],
  1593. depData: {
  1594. id: -1,
  1595. label: this.$t('lable.allStaff'),
  1596. },
  1597. defaultProps: {
  1598. children: 'children',
  1599. label: 'label'
  1600. },
  1601. isNew: false,
  1602. selected: false,
  1603. valuet: new Date(),
  1604. domObj: null,
  1605. participator:[],
  1606. chosenMembCount:0,
  1607. jsDay: 0,
  1608. jsTime: 0,
  1609. falsss: false,
  1610. weidu: [],
  1611. weiduList: [],
  1612. yonghuUser: [],
  1613. dateAr: [],
  1614. batchSubFillDialog: false,
  1615. isSubstiS: false,
  1616. diasZho: false,
  1617. zhoData: [],
  1618. zhoRqi: [],
  1619. btnZho: false,
  1620. zhoLoading: false,
  1621. changdu: 6,
  1622. tianxieDialogVisible: false,
  1623. scopess: {},
  1624. zhoBao: {
  1625. time: '',
  1626. workingTime: '',
  1627. progress: '',
  1628. con: '',
  1629. subProjectId: '',
  1630. stage: '',
  1631. subProjectList: [],
  1632. stages: [],
  1633. },
  1634. zhoBaoIdx: '',
  1635. zhoBaoName: '',
  1636. zhis: {},
  1637. dealList: [],
  1638. toViewDialogVisible: false,
  1639. toViewList: [],
  1640. toViewloading: true,
  1641. toViewForm: {
  1642. pageIndex: '1',
  1643. pageSize: '20',
  1644. total: 0,
  1645. },
  1646. toViewloadings: false,
  1647. tabPositionss: 'top',
  1648. monthTotal: 0,
  1649. monthTotalPage: 0,
  1650. monthTotalLages: 20,
  1651. monthWorkData: [],
  1652. monthNotWorkDate: [],
  1653. monthWorkDataS1: [],
  1654. monthnotTotal: 0,
  1655. monthnotTotalPage: 0,
  1656. monthnotTotalLages: 20,
  1657. monthNotWorkDateS1: [],
  1658. deptMembDataText: '',
  1659. isFlag: false,
  1660. isMore: false,
  1661. stateKey: '0',
  1662. expandDate: [],
  1663. notifySelList:[],
  1664. departmentList: [],
  1665. approvalProcessDialog: false,
  1666. approvalProcessData: [],
  1667. // leaveTypeName: ['事假','病假','年假','产假','婚假','丧假','调休假','陪产假','其他',],
  1668. 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')],
  1669. isWeekend: false,
  1670. canCancelInDialog: false,
  1671. approveinData: {},
  1672. approveinDialog: false,
  1673. reportCanDelete: false,
  1674. weeklyFilledTimeDialog: false,
  1675. weeklyFilledTimeList: [],
  1676. weeklyFilledTimeLoading: false,
  1677. workReportStateString: [this.$t('state.WaitingAudit'),this.$t('state.alreadyPassed'),this.$t('state.rejected'),this.$t('state.waitingsubmit')],
  1678. weeklyFilledTimeCanDelete: false,
  1679. weeklyFilledTimeDate: null,
  1680. leaveAllNum: 0
  1681. };
  1682. },
  1683. watch: {
  1684. deptMembDataText(val) {
  1685. this.$refs.chooseMembTree.filter(val);
  1686. }
  1687. },
  1688. filters: {
  1689. // 过滤
  1690. amounts(value) {
  1691. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1692. return 0
  1693. }
  1694. var zhi = +value + 0
  1695. return zhi.toFixed(1)
  1696. },
  1697. // zhoData
  1698. zhoData(value, arr) {
  1699. var dateArray = value.split("-");
  1700. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1701. // console.log("周" + "日一二三四五六".charAt(date.getDay()), '答应的值来你看看')
  1702. // console.log(arr[date.getDay()])
  1703. // return "周" + "日一二三四五六".charAt(date.getDay());
  1704. return arr[date.getDay()]
  1705. },
  1706. // 过滤数字
  1707. numbers(value) {
  1708. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1709. return 0
  1710. }
  1711. return value
  1712. },
  1713. },
  1714. methods: {
  1715. test(){
  1716. console.log('test',this.depData,this.data[0].membCount,this.reportList.length);
  1717. },
  1718. weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
  1719. this.weeklyFilledTimeDialog = true
  1720. this.weeklyFilledTimeLoading = true
  1721. this.weeklyFilledTimeDate = parameterDate
  1722. this.http.post('/report/getReportList',{
  1723. date: parameterDate,
  1724. userId: this.user.id
  1725. },res => {
  1726. this.weeklyFilledTimeLoading = false
  1727. if(res.code == 'ok'){
  1728. this.weeklyFilledTimeList = res.data[0].data
  1729. let candelete = true
  1730. for(let i in this.weeklyFilledTimeList){
  1731. if(this.weeklyFilledTimeList[i].state < 2){
  1732. candelete = false
  1733. }
  1734. }
  1735. this.weeklyFilledTimeCanDelete = candelete
  1736. }else {
  1737. this.$message({
  1738. message: res.msg,
  1739. type: 'error'
  1740. })
  1741. }
  1742. },err => {
  1743. this.weeklyFilledTimeLoading = false
  1744. this.$message({
  1745. message: err,
  1746. type: 'error'
  1747. })
  1748. })
  1749. },
  1750. weeklyFilledTimeDelete(){ //按周填报-已填工时-点击-删除
  1751. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  1752. confirmButtonText: this.$t('btn.determine'),
  1753. cancelButtonText: this.$t('btn.cancel'),
  1754. type: "warning"
  1755. })
  1756. .then(() => {
  1757. this.http.post('/report/delete',{
  1758. userId: this.user.id,
  1759. date: this.weeklyFilledTimeDate
  1760. },res => {
  1761. if (res.code == "ok") {
  1762. this.$message({
  1763. message: this.$t('message.successfullyDeleted'),
  1764. type: "success"
  1765. });
  1766. this.getWeeklyWorkTime()
  1767. this.getReportList();
  1768. this.getDepartment();
  1769. this.weeklyFilledTimeDialog = false;
  1770. } else {
  1771. this.$message({
  1772. message: res.msg,
  1773. type: "error"
  1774. });
  1775. }
  1776. },error => {
  1777. this.$message({
  1778. message: error,
  1779. type: "error"
  1780. });
  1781. }
  1782. );
  1783. }).catch(() => {});
  1784. },
  1785. getApprovalProcess(item){
  1786. // console.log('this.date',this.choseDate);
  1787. this.http.post('/report-log/get',{
  1788. creatorId: item.id,
  1789. createDate: sessionStorage.msg
  1790. },res => {
  1791. if(res.code == 'ok'){
  1792. this.approvalProcessDialog = true
  1793. this.approvalProcessData = res.data
  1794. }else{
  1795. this.$message({
  1796. message: res.msg,
  1797. type: 'error'
  1798. })
  1799. }
  1800. },err => {
  1801. this.$message({
  1802. message: err,
  1803. type: 'error'
  1804. })
  1805. })
  1806. },
  1807. filterNode(value, data) {
  1808. if (!value) return true;
  1809. return data.label.indexOf(value) !== -1;
  1810. },
  1811. triggerCalculateOT(index) {
  1812. var str = this.workForm.domains[index].overtimeHours + ''
  1813. if(str.indexOf('.') != '-1') {
  1814. var s = str.split('.')[0]
  1815. var st = str.split('.')[1]
  1816. var sts = st.split('')
  1817. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  1818. }
  1819. },
  1820. searchScreen(e){
  1821. if(e){
  1822. this.monthNotWorkDateS1 = []
  1823. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  1824. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  1825. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  1826. }
  1827. }
  1828. if (this.monthNotWorkDateS1.length > 50) {
  1829. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  1830. }else{
  1831. this.monthNotWorkDateS = this.monthNotWorkDateS1
  1832. }
  1833. // if (this.monthNotWorkDateS1.length > 0) {
  1834. // setTimeout(() => {
  1835. // this.tableListenernot()
  1836. // }, 1000);
  1837. // }
  1838. }else{
  1839. this.monthWorkDataS1 = []
  1840. for (let i = 0; i < this.monthWorkData.length; i++) {
  1841. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  1842. this.monthWorkDataS1.push(this.monthWorkData[i])
  1843. }
  1844. }
  1845. if (this.monthWorkDataS1.length > 50) {
  1846. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  1847. }else{
  1848. this.monthWorkDataS = this.monthWorkDataS1
  1849. }
  1850. // if (this.monthWorkDataS1.length > 0) {
  1851. // setTimeout(() => {
  1852. // this.tableListener()
  1853. // }, 1000);
  1854. // }
  1855. }
  1856. },
  1857. addUpload(data) {
  1858. // var zhi = data.fileName.split('.')[0]
  1859. // var sss = zhi + '.xlsx'
  1860. // return
  1861. var filePath = '/upload/' + data.serverName;
  1862. const a = document.createElement('a'); // 创建a标签
  1863. a.setAttribute('download', data.fileName);// download属性
  1864. a.setAttribute('href', filePath);// href链接
  1865. a.click(); //自执行点击事件
  1866. a.remove();
  1867. },
  1868. restrictNumber(targetId) {
  1869. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  1870. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1871. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1872. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1873. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1874. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1875. inpu.value = parseFloat(inpu.value);
  1876. }
  1877. },
  1878. //获取项目下的任务分组
  1879. getTaskGroups(domain, index) {
  1880. domain.groupId=null;
  1881. this.http.post('/task-group/listMyJoinGroup',{
  1882. projectId: domain.projectId,
  1883. isSubstitude: this.isSubstitude ? 1 : 0
  1884. },
  1885. res => {
  1886. if (res.code == "ok") {
  1887. this.workForm.domains[index].taskGroups = res.data;
  1888. this.$forceUpdate();
  1889. }
  1890. },
  1891. error => {
  1892. this.$message({
  1893. message: error,
  1894. type: "error"
  1895. });
  1896. }
  1897. );
  1898. },
  1899. //下载带企业微信考勤数据的工时统计模板
  1900. downloadCheckInExcel() {
  1901. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  1902. startDate: this.importWxParam.date[0],
  1903. endDate: this.importWxParam.date[1],
  1904. },
  1905. res => {
  1906. if (res.code == "ok") {
  1907. var filePath = res.data;
  1908. const a = document.createElement('a'); // 创建a标签
  1909. var data = filePath.split("/");
  1910. a.setAttribute('download', data[data.length-1]);// download属性
  1911. a.setAttribute('href', filePath);// href链接
  1912. a.click(); //自执行点击事件
  1913. a.remove();
  1914. } else {
  1915. this.$message({
  1916. message: res.msg,
  1917. type: "error"
  1918. });
  1919. }
  1920. },
  1921. error => {
  1922. this.checkinLoading = false;
  1923. this.$message({
  1924. message: error,
  1925. type: "error"
  1926. });
  1927. }
  1928. );
  1929. },
  1930. pre() {
  1931. if (this.active == 0) return;
  1932. this.active--;
  1933. },
  1934. next() {
  1935. this.active++;
  1936. },
  1937. triggerTotalTime(index) {
  1938. var item = this.checkinList[index];
  1939. var total = 0.0;
  1940. for (var i=0;i<this.projectColumns.length; i++) {
  1941. var key = this.projectColumns[i];
  1942. if (item[key] != null && item[key] != '') {
  1943. total += parseFloat(item[key]);
  1944. }
  1945. }
  1946. item.totalFillTime = total;
  1947. },
  1948. //提交批量代填的数据
  1949. submitBatchSubFillData() {
  1950. var data = JSON.stringify(this.checkinList);
  1951. this.http.post('/user-corpwx-time/submitProjectTime',{
  1952. json: data,
  1953. projectColumns: JSON.stringify(this.projectColumns)
  1954. },
  1955. res => {
  1956. if (res.code == "ok") {
  1957. this.$message({message:this.$t('message.submittedSuccessfully'), type:'success'});
  1958. this.importWxDialog = false;
  1959. }
  1960. },
  1961. error => {
  1962. this.checkinLoading = false;
  1963. this.$message({
  1964. message: error,
  1965. type: "error"
  1966. });
  1967. }
  1968. );
  1969. },
  1970. loadCheckInData() {
  1971. if (this.importWxParam.date == null) {
  1972. this.checkinList = [];
  1973. return;
  1974. }
  1975. this.checkinLoading = true;
  1976. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  1977. startDate: this.importWxParam.date[0],
  1978. endDate: this.importWxParam.date[1],
  1979. },
  1980. res => {
  1981. if (res.code == "ok") {
  1982. this.checkinLoading = false;
  1983. this.checkinList = res.data.list;
  1984. this.projectColumns = res.data.projects;
  1985. // 自定义表格会导致表格错乱,需重新计算表格
  1986. this.$nextTick(()=>{
  1987. this.$refs.tab.doLayout()
  1988. })
  1989. }
  1990. },
  1991. error => {
  1992. this.checkinLoading = false;
  1993. this.$message({
  1994. message: error,
  1995. type: "error"
  1996. });
  1997. }
  1998. );
  1999. },
  2000. batchImportWxData(item) {
  2001. //首先判断文件类型
  2002. let str = item.file.name.split(".");
  2003. let format = str[str.length - 1];
  2004. if (format != "xls" && format != "xlsx") {
  2005. this.$message({
  2006. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2007. type: "error"
  2008. });
  2009. } else {
  2010. this.importingData = true;
  2011. let formData = new FormData();
  2012. formData.append("file", item.file);
  2013. formData.append("companyId", this.user.companyId);
  2014. formData.append("withCheckIn", 1);
  2015. this.http.uploadFile('/report/importData', formData,
  2016. res => {
  2017. this.$refs.upload.clearFiles();
  2018. this.showImportResult = true;
  2019. this.importingData = false;
  2020. if (res.code == "ok") {
  2021. //换成弹出框,以免有人等了半天回来啥也没看到
  2022. this.importResultMsg = this.$t('other.successful') + ':' + this.$t('other.importSuccess') +res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");
  2023. this.getReportList();
  2024. this.importWxDialog = false;
  2025. } else {
  2026. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2027. }
  2028. },
  2029. error => {
  2030. this.$refs.upload.clearFiles();
  2031. this.listLoading = false;
  2032. this.$message({
  2033. message: error,
  2034. type: "error"
  2035. });
  2036. });
  2037. }
  2038. },
  2039. batchImportData(item) {
  2040. //首先判断文件类型
  2041. let str = item.file.name.split(".");
  2042. let format = str[str.length - 1];
  2043. if (format != "xls" && format != "xlsx") {
  2044. this.$message({
  2045. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  2046. type: "error"
  2047. });
  2048. } else {
  2049. this.importingData = true;
  2050. let formData = new FormData();
  2051. formData.append("file", item.file);
  2052. formData.append("companyId", this.user.companyId);
  2053. this.http.uploadFile('/report/importData', formData,
  2054. res => {
  2055. this.$refs.upload.clearFiles();
  2056. this.importingData = false;
  2057. this.showImportResult = true;
  2058. if (res.code == "ok") {
  2059. //换成弹出框,以免有人等了半天回来啥也没看到
  2060. this.importResultMsg = this.$t('other.importSuccess')+res.data+this.$t('other.workHourData')+(res.msg?res.msg:"");;
  2061. this.getReportList();
  2062. this.importWXDialog = false;
  2063. } else {
  2064. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  2065. }
  2066. },
  2067. error => {
  2068. this.$refs.upload.clearFiles();
  2069. this.importingData = false;
  2070. this.$message({
  2071. message: error,
  2072. type: "error"
  2073. });
  2074. });
  2075. }
  2076. },
  2077. userssHu() {
  2078. this.http.post('/time-type/getCompanyTimeSetting',{
  2079. companyId: this.user.companyId
  2080. },
  2081. res => {
  2082. if (res.code == "ok") {
  2083. this.yonghuUser = res.data
  2084. }
  2085. },
  2086. error => {
  2087. this.$message({
  2088. message: error,
  2089. type: "error"
  2090. });
  2091. }
  2092. );
  2093. },
  2094. iptBlur(i) {
  2095. if(this.isBatch == 0) {
  2096. return
  2097. }
  2098. this.http.post('/report/getWorkDays',{
  2099. startDate: this.workForm.createDate[0],
  2100. endDate: this.workForm.createDate[1]
  2101. },
  2102. res => {
  2103. if (res.code == "ok") {
  2104. this.jsDay = res.data
  2105. this.chuji(i)
  2106. } else {
  2107. this.$message({
  2108. message: res.msg,
  2109. type: "error"
  2110. });
  2111. this.workForm.createDate = [];
  2112. }
  2113. },
  2114. error => {
  2115. this.$message({
  2116. message: error,
  2117. type: "error"
  2118. });
  2119. }
  2120. );
  2121. var sl = this.workForm.domains
  2122. this.chuji(i)
  2123. },
  2124. chuji(i) {
  2125. if(i == 0) {
  2126. this.seleChn(1)
  2127. } else if(i == 1) {
  2128. this.seleChn(0)
  2129. } else if(i == 2) {
  2130. if(this.workForm.domains[0].multiWorktime > 0) {
  2131. this.iptChangs()
  2132. } else {
  2133. this.iptChang()
  2134. }
  2135. } else if(i == 3) {
  2136. this.seleChn(0)
  2137. }
  2138. },
  2139. seleChn(e,domain) {
  2140. if(e == 1) {
  2141. for(var i in this.workForm.domains) {
  2142. if(this.workForm.domains[i].timeType == 0) {
  2143. this.workForm.domains[i].workingTime = 8
  2144. } else {
  2145. this.workForm.domains[i].workingTime = 4
  2146. }
  2147. }
  2148. }
  2149. var quanbu = 0
  2150. var spl = this.workForm.domains
  2151. var zhi = ''
  2152. for(var i in spl) {
  2153. var sp = +spl[i].workingTime + 0
  2154. zhi = this.jsDay * sp
  2155. quanbu = +quanbu + zhi
  2156. }
  2157. this.jsTime = quanbu
  2158. let worktime = this.jsTime
  2159. // 自动计算加班时长
  2160. if(this.isBatch != 0){
  2161. worktime = this.jsTime / this.jsDay
  2162. }
  2163. if(this.user.timeType.fillOvertime && domain){
  2164. let isover = false
  2165. let alltime = 0
  2166. let allover = 0 //此处alltime同上面的worktime
  2167. for(let d in spl){
  2168. if(spl[d].isOvertime){
  2169. isover = true
  2170. allover += spl[d].overtimeHours*1
  2171. }
  2172. alltime += spl[d].workingTime*1
  2173. }
  2174. if(domain.overtimeHours){
  2175. allover = allover - domain.overtimeHours
  2176. }
  2177. if(worktime*1 > this.user.timeType.allday){
  2178. if(isover){
  2179. if(alltime > (allover + this.user.timeType.allday)){
  2180. this.$set(domain,'isOvertime',true)
  2181. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday - allover)
  2182. }else{
  2183. this.$set(domain,'isOvertime',false)
  2184. this.$set(domain,'overtimeHours',null)
  2185. if(alltime < (allover + this.user.timeType.allday)){
  2186. let overtime = allover + this.user.timeType.allday - alltime
  2187. for(let pi in spl){
  2188. if(spl[pi].overtimeHours){
  2189. if((overtime - spl[pi].overtimeHours*1) > 0){
  2190. overtime = overtime - spl[pi].overtimeHours*1
  2191. this.$set(spl[pi],'isOvertime',false)
  2192. this.$set(spl[pi],'overtimeHours',null)
  2193. }else if((overtime - spl[pi].overtimeHours*1) < 0){
  2194. this.$set(spl[pi],'overtimeHours',spl[pi].overtimeHours*1 - overtime)
  2195. break
  2196. }else{
  2197. this.$set(spl[pi],'isOvertime',false)
  2198. this.$set(spl[pi],'overtimeHours',null)
  2199. break
  2200. }
  2201. }
  2202. }
  2203. }
  2204. }
  2205. }else{
  2206. this.$set(domain,'isOvertime',true)
  2207. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  2208. }
  2209. }else{
  2210. for(let di in spl){
  2211. this.$set(spl[di],'isOvertime',false)
  2212. this.$set(spl[di],'overtimeHours',null)
  2213. }
  2214. }
  2215. }
  2216. },
  2217. iptChang() {
  2218. var sl = this.workForm.domains
  2219. var quanbu = 0
  2220. var zhi = ''
  2221. for(var i in sl) {
  2222. if(sl[i].startTime && sl[i].endTime) {
  2223. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  2224. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  2225. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2226. var leave1=date3%(24*3600*1000)
  2227. var hours=Math.floor(leave1/(3600*1000))
  2228. var leave2=leave1%(3600*1000)
  2229. var minutes=Math.floor(leave2/(60*1000))
  2230. var shi = hours+'.'+ minutes
  2231. var sll = +shi + 0
  2232. zhi = this.jsDay * sll
  2233. quanbu = +quanbu + zhi
  2234. }
  2235. }
  2236. this.jsTime = quanbu
  2237. },
  2238. iptChangs() {
  2239. var sl = this.workForm.domains
  2240. var quanbu = 0
  2241. var zhi = ''
  2242. for(var i in sl) {
  2243. for(var j in sl[i].worktimeList){
  2244. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  2245. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  2246. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  2247. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  2248. var leave1=date3%(24*3600*1000)
  2249. var hours=Math.floor(leave1/(3600*1000))
  2250. var leave2=leave1%(3600*1000)
  2251. var minutes=Math.floor(leave2/(60*1000))
  2252. var shi = hours+'.'+ minutes
  2253. var sll = +shi + 0
  2254. zhi = this.jsDay * sll
  2255. quanbu = +quanbu + zhi
  2256. }
  2257. }
  2258. }
  2259. this.jsTime = quanbu
  2260. },
  2261. removeTimeItem(item, index) {
  2262. item.worktimeList.splice(index, 1);
  2263. this.iptChangs()
  2264. },
  2265. //添加工时
  2266. addNewWorktime(index, item) {
  2267. if(item.worktimeList == null ) {
  2268. item.worktimeList = []
  2269. }
  2270. item.worktimeList.push({});
  2271. },
  2272. //复制项目
  2273. copyProject(index) {
  2274. var leftProgress = 10;
  2275. if (this.reportTimeType.type == 3) {
  2276. //计算已经待分配工时比例
  2277. let array = this.workForm.domains;
  2278. let totalProgress = 0;
  2279. for (var i=0;i<array.length; i++) {
  2280. totalProgress += array[i].progress;
  2281. }
  2282. if (totalProgress < 100) {
  2283. leftProgress = 100 - totalProgress;
  2284. }
  2285. }
  2286. var newIndex = index+1;
  2287. var itemDomain = {
  2288. projectId: this.workForm.domains[index].projectId,
  2289. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  2290. content: "",
  2291. progress:leftProgress,
  2292. state:2,//2-表示待提交
  2293. };
  2294. this.workForm.domains.splice(newIndex, 0,itemDomain);
  2295. if (this.reportTimeType.type == 0) {
  2296. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  2297. var length = this.workForm.domains.length;
  2298. if (length == 2) {
  2299. this.showAddMore = false;
  2300. }
  2301. }
  2302. this.selectProject(itemDomain, newIndex);
  2303. },
  2304. showWorkTime(){
  2305. this.monthWorkTimeDialog = true;
  2306. this.searchKeyword = ''
  2307. this.WorktimeDatepickValue = this.istoMonth()
  2308. if(this.WorktimeDatepickValue.length == 0){
  2309. let newdate = new Date();
  2310. let nowdate = newdate.toLocaleDateString();
  2311. let getauto = this.getAutoWeekDate(nowdate)
  2312. let nowwd = [getauto[0],getauto[6]]
  2313. this.WorktimeDatepickValue = nowwd
  2314. }
  2315. this.showMonthWorkTime()
  2316. },
  2317. handleClick(t,e){
  2318. if (t.name == "first") {
  2319. this.showMonthWorkTime()
  2320. }else{
  2321. this.showMonthNotWorkTime()
  2322. }
  2323. },
  2324. //导出员工每日填报工时数
  2325. exportMembWorkHours() {
  2326. this.http.post(
  2327. "/report/exportUserDailyWorkTime",
  2328. {
  2329. // month: this.date,
  2330. startDate: this.WorktimeDatepickValue[0],
  2331. endDate: this.WorktimeDatepickValue[1],
  2332. },
  2333. (res) => {
  2334. if (res.code == "ok") {
  2335. let url = res.data;
  2336. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2337. }
  2338. },
  2339. (error) => {
  2340. this.$message({
  2341. message: error,
  2342. type: "error",
  2343. });
  2344. }
  2345. );
  2346. },
  2347. exportMembNotWorkHours() {
  2348. this.http.post(
  2349. "/report/exportNoReportUserList",
  2350. {
  2351. // month: this.date,
  2352. startDate: this.WorktimeDatepickValue[0],
  2353. endDate: this.WorktimeDatepickValue[1],
  2354. },
  2355. (res) => {
  2356. if (res.code == "ok") {
  2357. let url = res.data;
  2358. this.downloadByA(this.$t('template.Staffdailyworkinghoursstatistics') + '.xls', url);
  2359. }
  2360. },
  2361. (error) => {
  2362. this.$message({
  2363. message: error,
  2364. type: "error",
  2365. });
  2366. }
  2367. );
  2368. },
  2369. downloadByA(name, url) {
  2370. const a = document.createElement("a"); // 创建a标签
  2371. a.setAttribute("download", name); // download属性
  2372. a.setAttribute("href", url); // href链接
  2373. a.click(); // 自执行点击事件
  2374. a.remove();
  2375. },
  2376. // 是否本月判断
  2377. istoMonth(){
  2378. let todate = new Date()
  2379. let tomonth = todate.getMonth() + 1
  2380. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  2381. if(this.date == adate){
  2382. return []
  2383. }else{
  2384. let sedate = new Date(this.date)
  2385. let semonth = sedate.getMonth() + 1
  2386. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  2387. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  2388. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  2389. return [sedates1, sedates2]
  2390. }
  2391. },
  2392. showMonthWorkTime() {
  2393. this.monthTotalPage = 0,
  2394. this.tbload = true
  2395. this.http.post(
  2396. "/report/getUserDailyWorkTime",
  2397. // "/report/getNoReportUserList",
  2398. {
  2399. // month: this.date,
  2400. startDate: this.WorktimeDatepickValue[0],
  2401. endDate: this.WorktimeDatepickValue[1],
  2402. },
  2403. (res) => {
  2404. if (res.code == "ok") {
  2405. this.tbload = false;
  2406. this.pickDateArray = res.data.days;
  2407. // console.log('dataarray',res.data.days);
  2408. this.monthWorkData = res.data.list;
  2409. // this.monthWorkDataS = this.monthWorkData
  2410. // this.monthWorkDataS1 = res.data.list
  2411. this.monthTotal = res.data.list.length
  2412. if (this.monthWorkData.length > 50) {
  2413. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  2414. }else{
  2415. this.monthWorkDataS = this.monthWorkData
  2416. }
  2417. this.searchScreen(0)
  2418. // this.monthWorkDataS = infoList
  2419. // 判断
  2420. // if (this.monthWorkDataS1.length > 0) {
  2421. // setTimeout(() => {
  2422. // this.tableListener()
  2423. // }, 1000);
  2424. // }
  2425. this.$nextTick(function(){
  2426. this.$refs.hasworkTbl.doLayout();
  2427. });
  2428. // this.$forceUpdate()
  2429. }
  2430. },
  2431. (error) => {
  2432. this.tbload = false
  2433. this.$message({
  2434. message: error,
  2435. type: "error",
  2436. });
  2437. }
  2438. );
  2439. },
  2440. // tableListener(){
  2441. // let that = this;
  2442. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  2443. // // 添加scroll监听事件
  2444. // dom.addEventListener("scroll", function () {
  2445. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2446. // if (scrollDistance < 2) {
  2447. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  2448. // that.monthTotalPage++; //当前页数自增
  2449. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  2450. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  2451. // var infoList = arrList.splice(
  2452. // that.monthTotalPage * that.monthTotalLages,
  2453. // that.monthTotalLages
  2454. // );
  2455. // // 数据添加
  2456. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  2457. // }
  2458. // }
  2459. // })
  2460. // },
  2461. showMonthNotWorkTime() {
  2462. this.monthTotalPage = 0,
  2463. this.tbload = true
  2464. this.http.post(
  2465. "/report/getNoReportUserList",
  2466. {
  2467. startDate: this.WorktimeDatepickValue[0],
  2468. endDate: this.WorktimeDatepickValue[1],
  2469. },
  2470. (res) => {
  2471. if (res.code == "ok") {
  2472. this.tbload = false
  2473. this.monthNotWorkDate = res.data;
  2474. // this.monthNotWorkDateS1 = res.data
  2475. this.monthnotTotal = res.data.length
  2476. // 2222111
  2477. if (this.monthNotWorkDate.length > 50) {
  2478. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  2479. } else {
  2480. this.monthNotWorkDateS = this.monthNotWorkDate
  2481. }
  2482. this.searchScreen(1)
  2483. // 判断
  2484. // if (this.monthnotworkDateS1.length > 0) {
  2485. // setTimeout(() => {
  2486. // this.tableListenernot()
  2487. // }, 1000);
  2488. // }
  2489. this.$nextTick(function(){
  2490. this.$refs.hasworkTbl2.doLayout();
  2491. });
  2492. }
  2493. },
  2494. (error) => {
  2495. this.tbload = false
  2496. this.$message({
  2497. message: error,
  2498. type: "error",
  2499. });
  2500. }
  2501. );
  2502. },
  2503. // tableListenernot(){
  2504. // let that = this;
  2505. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  2506. // dom.addEventListener("scroll", function () {
  2507. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  2508. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2509. // if (scrollDistance2 < 2) {
  2510. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  2511. // that.monthnotTotalPage++; //当前页数自增
  2512. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  2513. // var infoList = arrList.splice(
  2514. // that.monthnotTotalPage * that.monthnotTotalLages,
  2515. // that.monthnotTotalLages
  2516. // );
  2517. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  2518. // }
  2519. // }
  2520. // })
  2521. // },
  2522. listScroll(){
  2523. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  2524. this.isMore = true
  2525. setTimeout(()=>{
  2526. this.isMore = false
  2527. },1000)
  2528. }else {
  2529. this.isFlag = true
  2530. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  2531. this.monthWorkDataS = datalist
  2532. setTimeout(()=>{
  2533. this.isFlag = false
  2534. },300)
  2535. }
  2536. },
  2537. notListScroll(){
  2538. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  2539. this.isMore = true
  2540. setTimeout(()=>{
  2541. this.isMore = false
  2542. },1000)
  2543. }else {
  2544. this.isFlag = true
  2545. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  2546. this.monthNotWorkDateS = datalist
  2547. // console.log('length',this.monthNotWorkDateS.length)
  2548. setTimeout(()=>{
  2549. this.isFlag = false
  2550. },300)
  2551. }
  2552. },
  2553. // 获取默认这zhou日期参数 222
  2554. getLastWeek(e){
  2555. let newdate = new Date()
  2556. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  2557. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  2558. if(e){
  2559. this.WorktimeDatepickValue = lastwd
  2560. this.showMonthWorkTime()
  2561. }else{
  2562. this.WorktimeDatepickValue = lastwd
  2563. this.showMonthNotWorkTime()
  2564. }
  2565. },
  2566. getThisWeek(e){
  2567. let newdate = new Date();
  2568. let nowdate = newdate.toLocaleDateString();
  2569. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  2570. if(e){
  2571. this.WorktimeDatepickValue = nowwd
  2572. this.showMonthWorkTime()
  2573. }else{
  2574. this.WorktimeDatepickValue = nowwd
  2575. this.showMonthNotWorkTime()
  2576. }
  2577. },
  2578. getDoubleLastWeek(e){
  2579. let newdate = new Date()
  2580. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  2581. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  2582. if(e){
  2583. this.WorktimeDatepickValue = nextwd
  2584. this.showMonthWorkTime()
  2585. }else{
  2586. this.WorktimeDatepickValue = nextwd
  2587. this.showMonthNotWorkTime()
  2588. }
  2589. },
  2590. alreadyAllDate(stime,etime){
  2591. let diffdate = new Array();
  2592. let i=0;
  2593. while(stime<=etime){
  2594. let dateArray = stime.split("-");
  2595. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2596. // let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  2597. let stimewk = this.weekDay[date.getDay()]
  2598. 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')
  2599. 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])
  2600. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  2601. let stime_ts = new Date(stime).getTime();
  2602. let next_date = stime_ts + (24*60*60*1000);
  2603. let next_dates_y = new Date(next_date).getFullYear()+'-';
  2604. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  2605. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  2606. stime = next_dates_y+next_dates_m+next_dates_d;
  2607. i++;
  2608. }
  2609. return diffdate
  2610. },
  2611. getAutoWeekDate(e) {
  2612. let dateString = e;
  2613. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  2614. if (dateString.match(dateStringReg)) {
  2615. let presentDate = new Date(dateString),
  2616. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  2617. return Array.from(new Array(7), function (val, index) {
  2618. let formatDate = new Date(
  2619. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  2620. );
  2621. return (
  2622. formatDate.getFullYear() +
  2623. "-" +
  2624. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  2625. "-" +
  2626. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  2627. );
  2628. });
  2629. } else {
  2630. throw new Error(
  2631. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  2632. );
  2633. }
  2634. },
  2635. onProgressChange() {
  2636. this.$forceUpdate();
  2637. },
  2638. showChooseMembTree() {
  2639. this.chosenMembCount = this.participator.length;
  2640. this.chooseParticipVisible = true;
  2641. },
  2642. onTreeItemChange() {
  2643. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2644. var list = chosenList.filter(item=>item.isUser == 1);
  2645. this.chosenMembCount = list.length;
  2646. },
  2647. findUserInTree() {
  2648. if (this.filterName == '') {
  2649. this.deptMembData = this.allMembData;
  2650. } else {
  2651. var list = this.findRecursively(this.filterName, this.allMembData);
  2652. this.deptMembData = list;
  2653. }
  2654. },
  2655. findRecursively(username, list) {
  2656. var filterList = [];
  2657. for (var i=0;i<list.length; i++) {
  2658. if (list[i].isUser == 1) {
  2659. if (list[i].label.indexOf(username) >= 0) {
  2660. //匹配上了
  2661. filterList.push(list[i]);
  2662. }
  2663. } else if (list[i].children != null && list[i].children.length > 0) {
  2664. var subList = this.findRecursively(username, list[i].children);
  2665. if (subList.length > 0) {
  2666. subList.forEach(s=>filterList.push(s));
  2667. }
  2668. }
  2669. }
  2670. return filterList;
  2671. },
  2672. //确定选择参与人
  2673. chooseParticip() {
  2674. this.chooseParticipVisible = false;
  2675. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2676. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2677. this.workForm.userNames = '';
  2678. this.workForm.userId = [];
  2679. this.participator = [];
  2680. for (var i=0;i<this.chosenMembList.length; i++) {
  2681. this.workForm.userId.push(this.chosenMembList[i].id);
  2682. this.workForm.userNames += this.chosenMembList[i].label+',';
  2683. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2684. this.participator.push(item);
  2685. }
  2686. if (this.workForm.userNames.length > 0) {
  2687. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  2688. }
  2689. },
  2690. notifySel(sel){
  2691. // console.log(sel);
  2692. this.notifySelList = sel
  2693. },
  2694. //微信通知人员填写
  2695. Notify(code) {
  2696. if (this.notifySelList.length == 0) return;
  2697. var ids = '';
  2698. this.notifySelList.forEach(f=>{
  2699. ids += f.id+',';
  2700. })
  2701. this.http.post('/user/pushFillReport',{
  2702. ids: ids, date: this.curDate,
  2703. code: code
  2704. },
  2705. res => {
  2706. if (res.code == "ok") {
  2707. this.$message({
  2708. message: this.$t('message.sentSuccessfully'),
  2709. type: "success"
  2710. });
  2711. }
  2712. },
  2713. error => {
  2714. this.$message({
  2715. message: error,
  2716. type: "error"
  2717. });
  2718. }
  2719. );
  2720. },
  2721. //导出人员列表
  2722. exportMemb() {
  2723. if (this.fillMembList.length == 0) return;
  2724. var ids = '';
  2725. this.fillMembList.forEach(f=>{
  2726. ids += f.id+',';
  2727. })
  2728. this.http.post('/user/exportMembList',{
  2729. ids: ids,isFill: this.isFill, date: this.curDate
  2730. },
  2731. res => {
  2732. if (res.code == "ok") {
  2733. var aTag = document.createElement('a');
  2734. aTag.download = this.curDate+(this.isFill?this.$t('other.filled'):this.$t('other.unfilled'))+this.$t('other.personnelList')+".xls";
  2735. aTag.href = res.data;
  2736. aTag.click();
  2737. }
  2738. },
  2739. error => {
  2740. this.$message({
  2741. message: error,
  2742. type: "error"
  2743. });
  2744. }
  2745. );
  2746. },
  2747. showMembList(fill) {
  2748. this.membListVisible = true;
  2749. if (fill == 0) {
  2750. this.fillMembList = this.unFillList;
  2751. this.isFill = false;
  2752. let leaveList = []
  2753. let unleaveList = []
  2754. for(let i in this.fillMembList){
  2755. if(this.fillMembList[i].leaveDays >= 1 || this.fillMembList[i].leaveTimes >= this.user.timeType.allday){
  2756. leaveList.push(this.fillMembList[i])
  2757. }else{
  2758. unleaveList.push(this.fillMembList[i])
  2759. }
  2760. }
  2761. this.fillMembList = unleaveList
  2762. this.fillMembList_leave = leaveList
  2763. } else if(fill == 1){
  2764. this.fillMembList = this.fillList.filter(item => item.state != 3);
  2765. this.isFill = true;
  2766. }else{
  2767. this.fillMembList = this.fillList.filter(item => item.state == 3);
  2768. this.isFill = true;
  2769. }
  2770. },
  2771. //获取自己填写的日报状态
  2772. getReportFillStatus() {
  2773. this.http.post('/report/getReportFillStatus',{
  2774. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2775. },
  2776. res => {
  2777. if (res.code == "ok") {
  2778. this.fillStatusList = res.data;
  2779. this.allDate.forEach(d=>{
  2780. var fillInfo = null;
  2781. d.state = null;
  2782. this.fillStatusList.forEach(s=>{
  2783. // console.log(d)
  2784. var d1 = s.createDate.split('-')[2];
  2785. var d2 = d.date.split(this.$t('weekDay.month'))[1].split(this.$t('weekDay.day'))[0];
  2786. // console.log(d2, '我被执行了')
  2787. if (d1.indexOf('0') == 0) {
  2788. d1 = d1.substring(1,d1.length);
  2789. }
  2790. if (d1 == d2) {
  2791. d.state = s.state;
  2792. }
  2793. })
  2794. })
  2795. this.$forceUpdate();
  2796. }
  2797. },
  2798. error => {
  2799. this.$message({
  2800. message: error,
  2801. type: "error"
  2802. });
  2803. }
  2804. );
  2805. },
  2806. scrollFunction () {
  2807. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  2808. if (this.domObj.attachEvent) { // IE
  2809. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  2810. } else if (this.domObj.addEventListener) {
  2811. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  2812. }
  2813. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  2814. },
  2815. mouseScroll(event) { // google 浏览器下
  2816. let detail = event.wheelDelta || event.detail
  2817. let moveForwardStep = -1
  2818. let moveBackStep = 1
  2819. let step = 0
  2820. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  2821. event.preventDefault() // 阻止浏览器默认事件
  2822. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  2823. },
  2824. // //左右滚动
  2825. // wheel(e){
  2826. // var a = document.getElementById("dateScroll");
  2827. // var scroll_width = 80; //滚动一下的距离
  2828. // var e = e || window.event, v;
  2829. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  2830. // if(v>3||-v>3) v=-v;
  2831. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  2832. // e.preventDefault(); //阻止浏览器的默认滚动
  2833. // },
  2834. showExportDialog() {
  2835. this.exportDialog = true;
  2836. },
  2837. showExportTimeDialog() {
  2838. this.exportTimeDialog = true;
  2839. },
  2840. changeAllTime() {
  2841. //总时长发生改变,自动按比例计算
  2842. this.workForm.domains.forEach(d=>{
  2843. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2844. });
  2845. },
  2846. // 是否加班的单机事件
  2847. check() {
  2848. this.selected = !this.selected
  2849. this.isNew = this.selected
  2850. },
  2851. updateSubProject() {
  2852. this.$forceUpdate();
  2853. },
  2854. //项目选中了, 加载子项目
  2855. selectProject(domain, index) {
  2856. if(!domain.projectId){
  2857. return;
  2858. }
  2859. // console.log('projectId===',domain.projectId);
  2860. domain.projectName = this.fillProjectList.filter(p=>p.id == domain.projectId)[0].projectName;
  2861. this.http.post('/sub-project/list',{
  2862. projectId: domain.projectId
  2863. },
  2864. res => {
  2865. //清空之前选中的子项目
  2866. // this.workForm.domains[index].subProjectId = 0;
  2867. if (res.code == "ok") {
  2868. this.workForm.domains[index].subProjectList = res.data;
  2869. this.workForm.domains[index].subProjectId = null;
  2870. this.$forceUpdate();
  2871. }
  2872. },
  2873. error => {
  2874. this.$message({
  2875. message: error,
  2876. type: "error"
  2877. });
  2878. }
  2879. );
  2880. //项目相关的近期任务
  2881. if (this.user.company.packageProject == 1) {
  2882. this.http.post('/task/getRecentTask',{
  2883. projectId: domain.projectId,
  2884. isSubstitude:this.isSubstitude?1:0
  2885. },
  2886. res => {
  2887. if (res.code == "ok") {
  2888. this.workForm.domains[index].allTaskList = res.data;
  2889. this.workForm.domains[index].taskList = res.data;
  2890. this.$forceUpdate();
  2891. }
  2892. },
  2893. error => {
  2894. this.$message({
  2895. message: error,
  2896. type: "error"
  2897. });
  2898. }
  2899. );
  2900. }
  2901. //获取项目相关专业
  2902. if (this.user.company.packageEngineering == 1) {
  2903. this.getProjectProfessions(domain, index);
  2904. }
  2905. // 获取项目相关的维度
  2906. // domain.degreeId = null
  2907. this.$set(domain,'degreeId',null)
  2908. this.dimension(domain, index);
  2909. //获取项目下的任务分组
  2910. this.getTaskGroups(domain, index);
  2911. //获取项目审核人
  2912. if (this.user.timeType.reportAuditType == 0) {
  2913. this.getProjectAuditorList(domain, index);
  2914. } else {
  2915. //按分组的负责人来审核
  2916. domain.projectAuditorId = null;
  2917. domain.projectAuditorName = null;
  2918. domain.auditUserList = null;
  2919. }
  2920. },
  2921. //获取项目审核人
  2922. getProjectAuditorList(domainItem, index) {
  2923. if(domainItem.projectId == '') {
  2924. return
  2925. }
  2926. domainItem.projectAuditorId = null;
  2927. domainItem.projectAuditorName = null;
  2928. this.http.post('/project-auditor/getList',{
  2929. projectId: domainItem.projectId,
  2930. },
  2931. res => {
  2932. if (res.code == "ok") {
  2933. domainItem.auditUserList = res.data;
  2934. if (res.data.length==0) {
  2935. this.$message({
  2936. message: this.$t('message.Dailyreviewerhasnotbeensetpleasecontacttheprojectmanager'),
  2937. type: "error"
  2938. });
  2939. } else if (res.data.length==1) {
  2940. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  2941. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  2942. }
  2943. this.$forceUpdate();
  2944. }
  2945. },
  2946. error => {
  2947. this.$message({
  2948. message: error,
  2949. type: "error"
  2950. });
  2951. }
  2952. );
  2953. },
  2954. // 获取维度数据
  2955. dimension(domain, index) {
  2956. if(domain.projectId == '') {
  2957. return
  2958. }
  2959. this.http.post('/project/getDegreeList',{
  2960. projectId: domain.projectId,
  2961. },
  2962. res => {
  2963. if (res.code == "ok") {
  2964. // console.log("维度数据",res.data);
  2965. this.workForm.domains[index].wuduList = res.data
  2966. // this.workForm = this.workForm
  2967. this.$forceUpdate()
  2968. }
  2969. },
  2970. error => {
  2971. this.$message({
  2972. message: error,
  2973. type: "error"
  2974. });
  2975. }
  2976. );
  2977. },
  2978. //切换任务阶段
  2979. changeStages(domain, index) {
  2980. if (domain.stage == null || domain.stage == '') {
  2981. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  2982. } else {
  2983. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  2984. }
  2985. this.$forceUpdate();
  2986. },
  2987. getGroupStages(domain, index, keepStage) {
  2988. // console.log(domain);
  2989. if(!domain.groupId){
  2990. domain.projectAuditorId = ''
  2991. domain.stages = []
  2992. if(this.user.timeType.reportAuditType >= 1){
  2993. domain.auditUserList = []
  2994. }
  2995. this.$forceUpdate();
  2996. return
  2997. }
  2998. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  2999. res => {
  3000. if (res.code == "ok") {
  3001. if (!keepStage) {
  3002. domain.stage = '';
  3003. }
  3004. domain.stages = res.data;
  3005. this.$forceUpdate();
  3006. }
  3007. },
  3008. error => {
  3009. this.$message({
  3010. message: error,
  3011. type: "error"
  3012. });
  3013. });
  3014. //检查当前的项目是否需要获取分组的负责人
  3015. if (this.user.timeType.reportAuditType >= 1) {
  3016. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  3017. res => {
  3018. if (res.code == "ok") {
  3019. domain.getProjectAuditorList = res.data;
  3020. domain.auditUserList = res.data;
  3021. if (res.data.length==1) {
  3022. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  3023. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  3024. } else if (res.data.length==0) {
  3025. domain.projectAuditorId = null;
  3026. domain.projectAuditorName = null;
  3027. }
  3028. this.$forceUpdate();
  3029. }
  3030. },
  3031. error => {
  3032. this.$message({
  3033. message: error,
  3034. type: "error"
  3035. });
  3036. });
  3037. }
  3038. },
  3039. getProjectProfessions(domain, index) {
  3040. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  3041. res => {
  3042. if (res.code == "ok") {
  3043. this.workForm.domains[index].professionProgress = res.data;
  3044. this.$forceUpdate();
  3045. }
  3046. },
  3047. error => {
  3048. this.$message({
  3049. message: error,
  3050. type: "error"
  3051. });
  3052. });
  3053. },
  3054. //删除自己的日报
  3055. deleteReport() {
  3056. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3057. confirmButtonText: this.$t('btn.determine'),
  3058. cancelButtonText: this.$t('btn.cancel'),
  3059. type: "warning"
  3060. })
  3061. .then(() => {
  3062. this.listLoading = true;
  3063. this.http.post('/report/delete',{
  3064. userId: this.user.id,
  3065. date: this.workForm.createDate
  3066. },
  3067. res => {
  3068. this.listLoading = false;
  3069. if (res.code == "ok") {
  3070. this.$message({
  3071. message: this.$t('message.successfullyDeleted'),
  3072. type: "success"
  3073. });
  3074. this.getReportList();
  3075. this.getDepartment();
  3076. this.dialogVisible = false;
  3077. } else {
  3078. this.$message({
  3079. message: res.msg,
  3080. type: "error"
  3081. });
  3082. }
  3083. },
  3084. error => {
  3085. this.listLoading = false;
  3086. this.$message({
  3087. message: error,
  3088. type: "error"
  3089. });
  3090. }
  3091. );
  3092. })
  3093. .catch(() => {});
  3094. },
  3095. // 管理员删除日报
  3096. guanli(item) {
  3097. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3098. let param = {date: this.date + day, userId: item.id};
  3099. this.$confirm(this.$t('message.Areyousureyouwanttodeletethisdaily'),this.$t('other.prompts'), {
  3100. confirmButtonText: this.$t('btn.determine'),
  3101. cancelButtonText: this.$t('btn.cancel'),
  3102. type: "warning"
  3103. })
  3104. .then(() => {
  3105. this.listLoading = true;
  3106. this.http.post('/report/delete',param,
  3107. res => {
  3108. this.listLoading = false;
  3109. if (res.code == "ok") {
  3110. this.$message({
  3111. message: this.$t('message.successfullyDeleted'),
  3112. type: "success"
  3113. });
  3114. this.getReportList();
  3115. this.getDepartment();
  3116. this.dialogVisible = false;
  3117. } else {
  3118. this.$message({
  3119. message: res.msg,
  3120. type: "error"
  3121. });
  3122. }
  3123. },
  3124. error => {
  3125. this.listLoading = false;
  3126. this.$message({
  3127. message: error,
  3128. type: "error"
  3129. });
  3130. }
  3131. );
  3132. })
  3133. .catch(() => {});
  3134. },
  3135. //提交批量审核数据
  3136. submitBatchApprove() {
  3137. var data = this.$refs.approveTree.getCheckedNodes();
  3138. var ids = '';
  3139. if (data.length == 0) {
  3140. this.$message({
  3141. message: this.$t('message.Pleaseselectthepersontoreview'),
  3142. type: "error"
  3143. });
  3144. return;
  3145. }
  3146. for (var i=0;i<data.length; i++) {
  3147. ids += data[i].id;
  3148. if (i < data.length-1) {
  3149. ids += ',';
  3150. }
  3151. }
  3152. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3153. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  3154. res => {
  3155. if (res.code == "ok") {
  3156. this.$message({
  3157. message: this.$t('message.Reviewsucceeded'),
  3158. type: "success"
  3159. });
  3160. this.getReportList();
  3161. this.getDepartment();
  3162. this.approveDialogVisible = false;
  3163. } else {
  3164. this.$message({
  3165. message: res.msg,
  3166. type: "error"
  3167. });
  3168. }
  3169. },
  3170. error => {
  3171. this.$message({
  3172. message: error,
  3173. type: "error"
  3174. });
  3175. });
  3176. },
  3177. selectAll() {
  3178. if (this.isAllSelect) {
  3179. var keys = [];
  3180. this.reportNames.forEach(b=>{
  3181. keys.push(b.id);
  3182. })
  3183. this.$refs.approveTree.setCheckedKeys(keys);
  3184. } else {
  3185. this.$refs.approveTree.setCheckedKeys([]);
  3186. }
  3187. },
  3188. //批量审核
  3189. batchApprove() {
  3190. this.approveDialogVisible = true;
  3191. this.reportNames = [];
  3192. for (var i=0;i<this.reportList.length; i++) {
  3193. var report = this.reportList[i];
  3194. var hasUnChecked =false;
  3195. var id = '';
  3196. for (var j=0;j<report.data.length; j++) {
  3197. if (report.data[j].state == 0
  3198. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  3199. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  3200. hasUnChecked = true;
  3201. id += report.data[j].id+',';
  3202. }
  3203. }
  3204. if (hasUnChecked) {
  3205. this.reportNames.push({id:id, label: report.name});
  3206. }
  3207. }
  3208. },
  3209. removeEmptyNode(list) {
  3210. for (var i=0;i<list.length;i++) {
  3211. var cnt = 0;
  3212. if (list[i].membCount == 0) {
  3213. list.splice(i, 1);
  3214. i--;
  3215. } else if (list[i].children != null) {
  3216. this.removeEmptyNode(list[i].children);
  3217. }
  3218. }
  3219. },
  3220. calculateMembCount(list) {
  3221. for (var i in list) {
  3222. var cnt = 0;
  3223. if (list[i].children != null) {
  3224. this.calculateMembCount(list[i].children);
  3225. for (var m in list[i].children) {
  3226. cnt += list[i].children[m].membCount;
  3227. }
  3228. }
  3229. if (list[i].isUser == 1) {
  3230. cnt++;
  3231. this.membCount++;
  3232. }
  3233. list[i].membCount = cnt;
  3234. }
  3235. },
  3236. stateChange() {
  3237. this.membCount = 0;
  3238. if (this.selectState == -1) {
  3239. //全部状态
  3240. this.data = this.allData;
  3241. } else {
  3242. //未填报
  3243. var newData = JSON.parse(JSON.stringify(this.allData));
  3244. this.filterState(this.selectState, newData);
  3245. this.data = newData;
  3246. }
  3247. this.calculateMembCount(this.data);
  3248. this.data[0].membCount = this.membCount;//总人数
  3249. },
  3250. //按状态过滤部门人员
  3251. filterState(state, list) {
  3252. for (var i =0;i<list.length; i++) {
  3253. var obj = list[i];
  3254. if (obj.isUser == 1) {
  3255. var match = false;
  3256. if (state == -2) {
  3257. if (obj.state == null) {
  3258. match = true;
  3259. }
  3260. } else {
  3261. if (obj.state == state) {
  3262. match = true;
  3263. }
  3264. }
  3265. if (!match) {
  3266. list.splice(i, 1);
  3267. i--;
  3268. } else {
  3269. }
  3270. } else {
  3271. if (obj.children != null) {
  3272. this.filterState(state, obj.children);
  3273. }
  3274. }
  3275. }
  3276. },
  3277. // 部门列表点击
  3278. handleNodeClick(data) {
  3279. // this.dealList = data
  3280. this.theValues(data.id, this.allData)
  3281. // this.depData = data;
  3282. var list = [];
  3283. if (data.id == -1) {
  3284. this.deptId = null;
  3285. this.targetUid = null;
  3286. list = this.data;
  3287. } else if (data.isUser == 1) {
  3288. this.deptId = null;
  3289. this.targetUid = data.id;
  3290. } else {
  3291. this.deptId = data.id;
  3292. this.targetUid = null;
  3293. list.push(data);
  3294. }
  3295. this.getReportList();
  3296. if (list.length > 0) {
  3297. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  3298. this.fillList = this.getUserMembListFromDeptList(list, 1)
  3299. }
  3300. },
  3301. theValues(id, item) {
  3302. for(var i in item) {
  3303. if(item[i].id == id) {
  3304. this.depData = item[i]
  3305. if(id == '-1') {
  3306. this.translation = '1'
  3307. } else {
  3308. if(item[i].children) {
  3309. this.translation = '2'
  3310. } else {
  3311. this.translation = '3'
  3312. }
  3313. }
  3314. return
  3315. } else {
  3316. if(item[i].children) {
  3317. this.theValues(id, item[i].children)
  3318. }
  3319. }
  3320. }
  3321. },
  3322. //获取可以选择的代填的人员列表
  3323. getSubstitudeUserDeptList() {
  3324. if (this.deptMembData.length == 0) {
  3325. this.http.post("/department/listMyMembs", {},
  3326. res => {
  3327. if (res.code == "ok") {
  3328. let noAllData = JSON.parse(JSON.stringify(res.data));
  3329. if (noAllData.length > 0) {
  3330. // if (noAllData[0].label == '全部人员') {
  3331. if (noAllData[0].label == this.$t('lable.allStaff')) {
  3332. noAllData.splice(0,1);
  3333. }
  3334. }
  3335. this.setUserToDept(noAllData);
  3336. this.deptMembData = noAllData;
  3337. } else {
  3338. this.$message({
  3339. message: res.msg,
  3340. type: "error"
  3341. });
  3342. }
  3343. },
  3344. error => {
  3345. this.$message({
  3346. message: error,
  3347. type: "error"
  3348. });
  3349. });
  3350. }
  3351. },
  3352. // 获取部门列表
  3353. getDepartment() {
  3354. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3355. var param = {date:this.date + day};
  3356. this.http.post("/report/getMembList", param,
  3357. res => {
  3358. if (res.code == "ok") {
  3359. if(res.data.length == 0){
  3360. // this.$message({
  3361. // message: '请联系管理员设置负责部门',
  3362. // type: 'error'
  3363. // })
  3364. return
  3365. }
  3366. this.departmentList = JSON.parse(JSON.stringify(res.data))
  3367. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  3368. // let noAllData = JSON.parse(JSON.stringify(res.data));
  3369. // if (this.user.role > 0) {
  3370. // }
  3371. list.splice(0,0,{
  3372. id: -1,
  3373. label: this.$t('lable.allStaff'),
  3374. })
  3375. this.membCount = 0;
  3376. //设置员工到部门下面
  3377. this.setUserToDept(list);
  3378. this.data = list;
  3379. // console.log('data',this.data);
  3380. this.expandDate = [this.data[1].id]
  3381. this.allData = list;
  3382. // if (noAllData.length > 0) {
  3383. // if (noAllData[0].label == '全部人员') {
  3384. // noAllData.splice(0,1);
  3385. // }
  3386. // }
  3387. // this.setUserToDept(noAllData);
  3388. // this.deptMembData = noAllData;
  3389. this.option = this.changeArr(list1);
  3390. list[0].membCount = this.membCount;
  3391. if (this.depData.id == -1) {
  3392. this.depData.membCount = this.membCount;
  3393. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  3394. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  3395. } else {
  3396. if (this.depData.isUser == null) {
  3397. var dep = this.findTargetDept(this.data, this.depData.id);
  3398. var membDeptList = [];
  3399. membDeptList.push(dep);
  3400. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  3401. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  3402. }
  3403. }
  3404. if (this.depData.isUser == null) {
  3405. if (this.isFill) {
  3406. this.fillMembList = this.fillList;
  3407. } else {
  3408. this.fillMembList = this.unFillList;
  3409. }
  3410. }
  3411. this.leaveAllNum = 0
  3412. for(let i in this.unFillList){
  3413. if(this.unFillList[i].leaveDays >= 1 || this.unFillList[i].leaveTimes >= this.user.timeType.allday){
  3414. this.leaveAllNum += 1
  3415. }
  3416. }
  3417. this.stateChange()
  3418. } else {
  3419. this.$message({
  3420. message: res.msg,
  3421. type: "error"
  3422. });
  3423. }
  3424. },
  3425. error => {
  3426. this.$message({
  3427. message: error,
  3428. type: "error"
  3429. });
  3430. });
  3431. this.getReportFillStatus();
  3432. },
  3433. findTargetDept(list, deptId) {
  3434. var t = null;
  3435. for (var i=0;i<list.length; i++) {
  3436. if (list[i].isUser == null && list[i].id == deptId) {
  3437. t = list[i];
  3438. break;
  3439. }
  3440. }
  3441. if (t == null) {
  3442. for (var i=0;i<list.length; i++) {
  3443. if (list[i].children != null && list[i].children.length > 0) {
  3444. t = this.findTargetDept(list[i].children, deptId);
  3445. if (t != null) {
  3446. break;
  3447. }
  3448. }
  3449. }
  3450. }
  3451. return t;
  3452. },
  3453. getUserMembListFromDeptList(list, isFill) {
  3454. var membList = [];
  3455. for (var i in list) {
  3456. var deptName = list[i].label;
  3457. if (list[i].userList != null) {
  3458. list[i].userList.forEach(element => {
  3459. if (isFill == 0) {
  3460. //获取未填的
  3461. if (element.state == null) {
  3462. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,leaveDays: element.leaveDays, leaveTimes: element.leaveTimes, leaveType: element.leaveType};
  3463. membList.push(obj);
  3464. }
  3465. } else {
  3466. if (element.state != null) {
  3467. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName,state: element.state};
  3468. membList.push(obj);
  3469. }
  3470. }
  3471. });
  3472. }
  3473. if (list[i].children != null) {
  3474. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  3475. }
  3476. }
  3477. return membList;
  3478. },
  3479. setUserToDept(list) {
  3480. for (var i in list) {
  3481. var cnt = 0;
  3482. if (list[i].children != null) {
  3483. this.setUserToDept(list[i].children);
  3484. for (var m in list[i].children) {
  3485. cnt += list[i].children[m].membCount;
  3486. }
  3487. }
  3488. if (list[i].userList != null) {
  3489. if (list[i].children == null) {
  3490. list[i].children = [];
  3491. }
  3492. list[i].userList.forEach(element => {
  3493. var obj = {
  3494. id: element.id,
  3495. label:element.name,
  3496. state:element.state,
  3497. parentId:element.departmentId,
  3498. isUser:1,
  3499. workingTime: element.workingTime,
  3500. leaveDays: element.leaveDays,
  3501. leaveTimes: element.leaveTimes
  3502. };
  3503. list[i].children.push(obj);
  3504. this.membCount++;
  3505. cnt++;
  3506. });
  3507. }
  3508. list[i].membCount = cnt;
  3509. }
  3510. },
  3511. // 修改数组
  3512. changeArr(arr) {
  3513. for (var i = 0; i < arr.length; i++) {
  3514. if(arr[i].id != -1 && arr[i].id != 0) {
  3515. if (arr[i].children != null && arr[i].children.length>0) {
  3516. arr[i].children = this.changeArr(arr[i].children);
  3517. }
  3518. arr[i].id && (arr[i].value = arr[i].id);
  3519. delete arr[i].id;
  3520. }
  3521. }
  3522. for(var i in arr) {
  3523. if(arr[i].id == -1 || arr[i].id == 0) {
  3524. arr.splice(i,1)
  3525. }
  3526. }
  3527. return arr;
  3528. },
  3529. //时间段范围设置改动,监听
  3530. onTimeTypeChange(timeType) {
  3531. this.seleChn(1)
  3532. this.showAddMore = true;
  3533. for(var i in this.workForm.domains) {
  3534. if (this.workForm.domains[i].timeType == 0) {
  3535. this.showAddMore = false;
  3536. break;
  3537. }
  3538. }
  3539. if (this.showAddMore) {
  3540. //检测数量
  3541. if (this.workForm.domains.length == 2) {
  3542. this.showAddMore = false;
  3543. } else {
  3544. this.showAddMore = true;
  3545. }
  3546. }
  3547. },
  3548. getTimeType() {
  3549. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  3550. res => {
  3551. if (res.code == "ok") {
  3552. var t = res.data;
  3553. this.reportTimeType = t;
  3554. if (this.reportTimeType.type > 0) {
  3555. this.showAddMore = true;
  3556. }
  3557. //转化时间格式
  3558. if (t.allday != null) {
  3559. this.timeType.push({value:0, label:this.$t('other.allDay') +' - '+t.allday+this.$t('time.hour'), hours:t.allday});
  3560. }
  3561. if (t.am != null) {
  3562. this.timeType.push({value:1, label:this.$t('other.morning') +' - '+t.am+this.$t('time.hour'), hours: t.am});
  3563. }
  3564. if (t.pm != null) {
  3565. this.timeType.push({value:2, label:this.$t('other.afternoon') +' - '+t.pm+this.$t('time.hour'), hours: t.pm});
  3566. }
  3567. } else {
  3568. this.$message({
  3569. message: res.msg,
  3570. type: "error"
  3571. });
  3572. }
  3573. },
  3574. error => {
  3575. this.listLoading = false;
  3576. this.$message({
  3577. message: error,
  3578. type: "error"
  3579. });
  3580. });
  3581. },
  3582. // 改变月份 -------
  3583. changeMonthOut() {
  3584. this.getAllDate();
  3585. this.getReportList();
  3586. this.getDepartment();
  3587. },
  3588. // 选择日期
  3589. choseDate(i, item) {
  3590. if(this.canClick(i,item) == false && this.user.timeType.fillAhead == 0){
  3591. return
  3592. }
  3593. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  3594. this.choseDay = i;
  3595. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3596. sessionStorage.msg = this.date + day,
  3597. this.getReportList();
  3598. this.getDepartment();
  3599. this.curDate = item.date;
  3600. },
  3601. canClick(i, item){
  3602. let nowDate = new Date()
  3603. let nowDateYear = nowDate.getFullYear()
  3604. let itemYear = parseInt(this.date.split('-')[0])
  3605. let nowDateMonth = nowDate.getMonth() + 1
  3606. let itemMonth = parseInt(this.date.split('-')[1])
  3607. let nowDateDay = nowDate.getDate()
  3608. let itemDay = parseInt(item.showDate.split('.')[1])
  3609. if(nowDateYear < itemYear){
  3610. return false
  3611. }else if(nowDateYear == itemYear){
  3612. if(nowDateMonth < itemMonth){
  3613. return false
  3614. }else if(nowDateMonth == itemMonth){
  3615. if(nowDateDay < itemDay){
  3616. return false
  3617. }
  3618. }
  3619. }
  3620. },
  3621. // 获取日期列表
  3622. getAllDate(e) {
  3623. var dayArry = [];
  3624. var day = this.getCountDays();
  3625. let curMonthDay = null;
  3626. for (var k = 1; k <= day; k++) {
  3627. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + this.$t('weekDay.month') + k+this.$t('weekDay.day');
  3628. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  3629. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  3630. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  3631. if(sessionStorage.msg) {
  3632. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  3633. this.choseDay = k - 1;
  3634. curMonthDay = str;
  3635. }
  3636. } else {
  3637. if (new Date().getDate() == k) {
  3638. this.choseDay = k - 1;
  3639. }
  3640. }
  3641. } else {
  3642. this.choseDay = 0;
  3643. }
  3644. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  3645. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  3646. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  3647. }
  3648. this.allDate = dayArry;
  3649. //不能超过最大日期
  3650. if (this.choseDay > day-1) {
  3651. this.choseDay = day-1;
  3652. }
  3653. if(sessionStorage.from != 1){
  3654. let nowmonth = new Date().getMonth() + 1
  3655. let nowd = new Date().getFullYear() + '-' + (nowmonth < 10 ? '0' + nowmonth : nowmonth)
  3656. let nowdate = new Date().getDate()
  3657. if(nowd == this.date){
  3658. if(e && sessionStorage.msg){
  3659. }else{
  3660. sessionStorage.msg = this.date + '-' + (nowdate < 10 ? '0' + nowdate : nowdate)
  3661. }
  3662. let nowday = new Date(sessionStorage.msg).getDate()
  3663. this.choseDay = nowday - 1
  3664. let monthdate = new Date(sessionStorage.msg)
  3665. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3666. }else{
  3667. if(e && sessionStorage.msg){
  3668. }else{
  3669. sessionStorage.msg = this.date + '-01'
  3670. }
  3671. let monthdate = new Date(sessionStorage.msg)
  3672. this.choseDay = monthdate.getDate() - 1
  3673. this.curDate = (monthdate.getMonth() + 1) + this.$t('weekDay.month') + monthdate.getDate() + this.$t('weekDay.day')
  3674. console.log('choseday',sessionStorage.msg,this.choseDay,monthdate.getDate());
  3675. }
  3676. }else{
  3677. this.choseDay = parseInt(sessionStorage.msg.split('-')[2]) - 1
  3678. }
  3679. //从消息点击跳转过来的,直接加载指定日期
  3680. if (sessionStorage.from == 1 && sessionStorage.msg) {
  3681. this.curDate = sessionStorage.msg;
  3682. sessionStorage.from = 0;
  3683. } else {
  3684. // if (curMonthDay != null) {
  3685. // // this.curDate = curMonthDay;
  3686. // let d = new Date(sessionStorage.msg)
  3687. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3688. // } else {
  3689. // let d = new Date(this.date.replace(/-/g, "/")+'/01')
  3690. // this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3691. // }
  3692. }
  3693. // this.curDate = this.curDate.split('月')[0] + '月' + (this.choseDay + 1) + '日'
  3694. // if(!sessionStorage.msg){
  3695. // let msgday = this.choseDay + 1
  3696. // sessionStorage.msg = this.date + '-' + (msgday < 10 ? '0' + msgday : msgday)
  3697. // }
  3698. this.getReportFillStatus();
  3699. },
  3700. getCountDays() {
  3701. var newstr = this.date.replace(/-/g, "/");
  3702. var curDate = new Date(newstr+'/01');
  3703. var curMonth = curDate.getMonth();
  3704. curDate.setMonth(curMonth + 1);
  3705. curDate.setDate(0);
  3706. return curDate.getDate();
  3707. },
  3708. //获取日报列表
  3709. getReportList() {
  3710. this.listLoading = true;
  3711. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3712. let param = {date: this.date + day};
  3713. if (this.deptId) {
  3714. param.deptId = this.deptId;
  3715. }
  3716. if (this.targetUid) {
  3717. param.userId = this.targetUid;
  3718. }
  3719. this.http.post( this.port.report.list, param,
  3720. res => {
  3721. this.listLoading = false;
  3722. if (res.code == "ok") {
  3723. this.reportList = res.data;
  3724. if(document.querySelector("#day"+this.choseDay)){
  3725. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  3726. }
  3727. } else {
  3728. this.$message({
  3729. message: res.msg,
  3730. type: "error"
  3731. });
  3732. }
  3733. },
  3734. error => {
  3735. this.listLoading = false;
  3736. this.$message({
  3737. message: error,
  3738. type: "error"
  3739. });
  3740. });
  3741. },
  3742. // 处理数据
  3743. // dealWith() {
  3744. // var tianxie = 0
  3745. // var weixtianxie = 0
  3746. // if(this.selectState == -1) {
  3747. // } else {
  3748. // var arr = []
  3749. // for (var i in this.reportList) {
  3750. // arr.push(this.reportList[i].id)
  3751. // }
  3752. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  3753. // }
  3754. // },
  3755. // getDealWith(item, tx, wtx, arr) {
  3756. // for(var i in item) {
  3757. // if(item[i].children) {
  3758. // this.getDealWith(item[i].children, tx, wtx, arr)
  3759. // } else {
  3760. // if(arr.indexOf(item[i].id) != '-1') {
  3761. // tx = +tx + 1
  3762. // }
  3763. // }
  3764. // }
  3765. // },
  3766. //导出员工工时统计
  3767. exportUserTime() {
  3768. this.listLoading = true;
  3769. var param = {};
  3770. if (this.exportParam.dateRange != null) {
  3771. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3772. }
  3773. this.http.post('/department/exportDeptStatistic', param,
  3774. res => {
  3775. this.listLoading = false;
  3776. if (res.code == "ok") {
  3777. location.href = res.data;
  3778. this.exportTimeDialog = false;
  3779. } else {
  3780. this.$message({
  3781. message: res.msg,
  3782. type: "error"
  3783. });
  3784. }
  3785. },
  3786. error => {
  3787. this.listLoading = false;
  3788. this.$message({
  3789. message: error,
  3790. type: "error"
  3791. });
  3792. });
  3793. },
  3794. //导出日报
  3795. exportReport() {
  3796. this.listLoading = true;
  3797. var param = {};
  3798. if (this.exportParam.dateRange != null) {
  3799. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3800. }
  3801. if (this.exportParam.projectId != null) {
  3802. param.projectId = this.exportParam.projectId;
  3803. }
  3804. if (this.exportParam.departmentId != null) {
  3805. param.departmentId = this.exportParam.departmentId[this.exportParam.departmentId.length - 1]
  3806. }
  3807. param.stateKey = this.stateKey
  3808. // param.departmentId = this.user.departmentId
  3809. this.http.post( this.port.report.export, param,
  3810. res => {
  3811. this.listLoading = false;
  3812. if (res.code == "ok") {
  3813. location.href = res.data;
  3814. this.exportDialog = false;
  3815. } else {
  3816. this.$message({
  3817. message: res.msg,
  3818. type: "error"
  3819. });
  3820. }
  3821. },
  3822. error => {
  3823. this.listLoading = false;
  3824. this.$message({
  3825. message: error,
  3826. type: "error"
  3827. });
  3828. });
  3829. },
  3830. //获取项目列表
  3831. getProjectList() {
  3832. this.listLoading = true;
  3833. this.http.post( this.port.project.list, {},
  3834. res => {
  3835. this.listLoading = false;
  3836. if (res.code == "ok") {
  3837. for(var i in res.data) {
  3838. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3839. res.data[i].projectCode = ''
  3840. }
  3841. }
  3842. this.projectList = res.data;
  3843. // console.log("项目列表",this.projectList);
  3844. } else {
  3845. this.$message({
  3846. message: res.msg,
  3847. type: "error"
  3848. });
  3849. }
  3850. },
  3851. error => {
  3852. this.listLoading = false;
  3853. this.$message({
  3854. message: error,
  3855. type: "error"
  3856. });
  3857. });
  3858. },
  3859. // 获取填报日报的项目下拉列表
  3860. getFillProjectList() {
  3861. this.http.post( this.port.project.list, {
  3862. forReport: 1
  3863. },res => {
  3864. if (res.code == "ok") {
  3865. for(var i in res.data) {
  3866. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3867. res.data[i].projectCode = ''
  3868. }
  3869. }
  3870. this.fillProjectList = res.data;
  3871. } else {
  3872. this.$message({
  3873. message: res.msg,
  3874. type: "error"
  3875. });
  3876. }
  3877. },
  3878. error => {
  3879. this.$message({
  3880. message: error,
  3881. type: "error"
  3882. });
  3883. });
  3884. },
  3885. getBasecostItemList() {
  3886. this.http.post('/project-basecost-setting/getReportBasecostList', {
  3887. companyId: this.user.companyId
  3888. },
  3889. res => {
  3890. if (res.code == "ok") {
  3891. this.timeBasecostList = res.data;
  3892. }
  3893. });
  3894. },
  3895. // 获取个人某天的日报 111111
  3896. getReport() {
  3897. this.http.post( this.port.report.getPort, {
  3898. date: this.workForm.createDate
  3899. },
  3900. res => {
  3901. if (res.code == "ok") {
  3902. var quanbu = 0
  3903. this.jsDay = 1
  3904. var zhi = ''
  3905. var slp = res.data.report
  3906. for(var i in slp) {
  3907. var sp = +slp[i].workingTime + 0
  3908. zhi = this.jsDay * sp
  3909. quanbu = +quanbu + zhi
  3910. }
  3911. this.jsTime = quanbu
  3912. var list = res.data;
  3913. this.report = list;
  3914. this.canCancelInDialog = false
  3915. if(list.report.length != 0) {
  3916. var arr = [];
  3917. this.canEdit = false;
  3918. let candelete = true
  3919. for(var i in list.report) {
  3920. var flg = null
  3921. list.report[i].isOvertime == 1 ? flg = true : flg = false
  3922. arr.push({
  3923. id: list.report[i].id,
  3924. projectId: list.report[i].projectId,
  3925. workingTime: list.report[i].workingTime,
  3926. content: list.report[i].content,
  3927. state: list.report[i].state,
  3928. timeType: list.report[i].timeType,
  3929. subProjectList: list.report[i].subProjectList,
  3930. taskList: list.report[i].taskList,
  3931. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  3932. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  3933. taskId: list.report[i].taskId,
  3934. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  3935. startTime: list.report[i].startTime,
  3936. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  3937. endTime: list.report[i].endTime,
  3938. isOvertime: flg,
  3939. progress:list.report[i].progress,
  3940. professionProgress: list.report[i].professionProgressList,
  3941. stages:list.report[i].stages,
  3942. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  3943. pics: list.report[i].pics,
  3944. multiWorktime: list.report[i].multiWorktime,
  3945. worktimeList: list.report[i].worktimeList,
  3946. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  3947. wuduList: list.report[i].degreeList,
  3948. taskGroups:list.report[i].taskGroups,
  3949. customData: list.report[i].customData,//自定义的数值
  3950. auditUserList: list.report[i].auditUserList,
  3951. projectAuditorId: list.report[i].projectAuditorId,
  3952. projectAuditorName: list.report[i].projectAuditorName,
  3953. overtimeHours: list.report[i].overtimeHours,
  3954. customText: list.report[i].customText,
  3955. basecostId: list.report[i].basecostId,
  3956. auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
  3957. auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
  3958. auditorThird: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorThird ? list.report[i].auditorSetting.auditorThird : '',
  3959. ccUserid: list.report[i].auditorSetting && list.report[i].auditorSetting.ccUserid ? list.report[i].auditorSetting.ccUserid : '',
  3960. canEdit: list.report[i].state >= 2 ? true : false
  3961. })
  3962. if (list.report[i].state >= 2) {
  3963. this.canEdit = true;
  3964. }
  3965. if(list.report[i].state < 2){
  3966. candelete = false
  3967. }
  3968. if (list.report[i].state == 0){
  3969. this.canCancelInDialog = true
  3970. }
  3971. }
  3972. this.reportCanDelete = candelete
  3973. this.workForm = {
  3974. createDate: this.workForm.createDate,
  3975. domains: arr,
  3976. userNames:null,
  3977. userId:null,
  3978. time: list.time
  3979. }
  3980. } else {
  3981. this.workForm = {
  3982. createDate: this.workForm.createDate,
  3983. domains: [{
  3984. id: null,
  3985. projectId: "",
  3986. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3987. content: "",
  3988. progress:100,
  3989. state: 2,
  3990. timeType:0,
  3991. multiWorktime: this.reportTimeType.multiWorktime,
  3992. worktimeList:[{}],
  3993. canEdit: true,
  3994. auditorFirst: '',
  3995. auditorSec: '',
  3996. auditorThird: '',
  3997. ccUserid: ''
  3998. }],
  3999. userId:null,
  4000. userNames:null,
  4001. time: this.report.time
  4002. }
  4003. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  4004. this.$set(this.workForm.domains[0],'isOvertime',true)
  4005. if(this.reportTimeType.type != 2){
  4006. this.$set(this.workForm.domains[0],'overtimeHours',this.reportTimeType.allday.toFixed(0))
  4007. }
  4008. }
  4009. if(this.user.timeType.type == 1) {
  4010. var shuzhi = this.user.timeType.allday + ''
  4011. // console.log('执行一次', shuzhi.indexOf('.'))
  4012. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4013. }
  4014. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4015. //默认给第一个,必填字段
  4016. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4017. }
  4018. this.canEdit = true;
  4019. }
  4020. } else {
  4021. this.$message({
  4022. message: res.msg,
  4023. type: "error"
  4024. });
  4025. }
  4026. },
  4027. error => {
  4028. this.$message({
  4029. message: error,
  4030. type: "error"
  4031. });
  4032. });
  4033. },
  4034. guanbi() {
  4035. this.falsss = false
  4036. },
  4037. // 打开日报填写
  4038. fillInReport(i, isBatch) {
  4039. this.isWeekend = false
  4040. this.reportCanDelete = false
  4041. // console.log(this.user.timeType.type, '选择时长')
  4042. if(i != 1) {
  4043. this.falsss = false
  4044. } else {
  4045. this.falsss = true
  4046. }
  4047. if (this.isSubstitude) {
  4048. this.getSubstitudeUserDeptList();
  4049. }
  4050. if(i == -1 || this.isSubstitude) {
  4051. this.isDisable = false;
  4052. } else {
  4053. this.isDisable = true;
  4054. }
  4055. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4056. this.isBatch = isBatch;
  4057. if (this.isBatch == 0 && !this.isSubstitude) {
  4058. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  4059. let weekday = new Date(this.workForm.createDate).getDay()
  4060. if(this.user.companyId == 817){
  4061. if(weekday == 0){
  4062. this.isWeekend = true
  4063. }
  4064. }else{
  4065. if(weekday == 0 || weekday == 6){
  4066. this.isWeekend = true
  4067. }
  4068. }
  4069. this.getReport(i);
  4070. } else {
  4071. // console.log('执行到了这里')
  4072. this.jsTime = 0
  4073. this.jsDay = 0
  4074. this.workForm = {
  4075. createDate: null,//批量填报没有日期
  4076. domains: [{
  4077. id: null,
  4078. projectId: "",
  4079. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  4080. content: "",
  4081. progress:100,
  4082. state: 2,
  4083. timeType:0,
  4084. multiWorktime: this.reportTimeType.multiWorktime,
  4085. worktimeList:[{}],
  4086. canEdit: true
  4087. }],
  4088. }
  4089. if(this.user.timeType.type == 1) {
  4090. var shuzhi = this.user.timeType.allday + ''
  4091. // console.log('执行二次')
  4092. this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
  4093. }
  4094. // console.log(this.workForm)
  4095. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  4096. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  4097. }
  4098. this.canEdit = true;
  4099. }
  4100. this.dialogVisible = true;
  4101. },
  4102. // 按周填报里内容的填写
  4103. tianxies(item, i, names, row) {
  4104. var idd = ''
  4105. var obj = {}
  4106. for(var l in this.projectList) {
  4107. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  4108. }
  4109. obj.projectId = idd
  4110. this.selectProject(obj, 0)
  4111. // console.log(this.workForm.domains[0], '打印出来的')
  4112. this.tianxieDialogVisible = true
  4113. this.scopess = item
  4114. var sss = {}
  4115. sss.projectId = idd;
  4116. sss.con = item.con
  4117. sss.progress = item.progress
  4118. sss.time = item.time
  4119. sss.groupId = item.groupId
  4120. sss.stage = item.stage;
  4121. sss.workingTime = item.workingTime
  4122. sss.projectAuditorId = item.projectAuditorId;
  4123. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4124. //默认选中第一个
  4125. sss.basecostId = this.timeBasecostList[0].id;
  4126. }
  4127. var that = this
  4128. setTimeout(() =>{
  4129. var isFirstEdit = false;
  4130. if(Object.keys(item).length < 5) {
  4131. //首次点开当前的这个cell,初始化数据
  4132. isFirstEdit = true;
  4133. sss.subProjectId = that.workForm.domains[0].subProjectId
  4134. sss.stage = that.workForm.domains[0].stage
  4135. sss.subProjectList = that.workForm.domains[0].subProjectList
  4136. sss.stages = that.workForm.domains[0].stages
  4137. sss.taskGroups = that.workForm.domains[0].taskGroups;
  4138. sss.auditUserList = obj.auditUserList;
  4139. } else {
  4140. sss.subProjectId = item.subProjectId
  4141. sss.stage = item.stage
  4142. sss.subProjectList = item.subProjectList
  4143. sss.stages = item.stages
  4144. sss.taskGroups = item.taskGroups;
  4145. sss.auditUserList = obj.auditUserList;
  4146. sss.degreeId = item.degreeId;
  4147. sss.customData = item.customData;
  4148. }
  4149. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  4150. //只有一个审核人,自动设置上去
  4151. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  4152. }
  4153. sss.wuduList = row[0].wuduList
  4154. // console.log(sss, '数据')
  4155. that.zhoBaoIdx = i
  4156. that.zhoBaoName = names
  4157. that.zhoBao = sss
  4158. that.zhis = row
  4159. if (sss.groupId) {
  4160. //最后一个参数表示是否保留stage的值,不要重置为空
  4161. this.getGroupStages(that.zhoBao, 0, !isFirstEdit)
  4162. }
  4163. that.$forceUpdate();
  4164. },600);
  4165. },
  4166. // 按周填报里内容的填写点击确定
  4167. btnTianxiaes() {
  4168. if (!this.zhoBao.projectAuditorId && this.user.timeType.reportAuditType != 3) {
  4169. this.$message({
  4170. message: this.$t('message.Pleaseselectareviewer'),
  4171. type: "error"
  4172. });
  4173. return
  4174. }
  4175. if(this.user.timeType.reportAuditType == 3){
  4176. let auditTips = ''
  4177. if(!this.zhoBao.auditorFirst){ auditTips += '第一、' }
  4178. if(!this.zhoBao.auditorSec && this.user.timeType.auditLevel > 1){ auditTips += '第二、' }
  4179. if(!this.zhoBao.auditorThird && this.user.timeType.auditLevel > 2){ auditTips += '第三、' }
  4180. if(auditTips){
  4181. auditTips = auditTips.substring(0,auditTips.length - 1)
  4182. this.$message({
  4183. message: '请选择[' + auditTips + ']审核人',
  4184. type: 'warning'
  4185. })
  4186. return
  4187. }
  4188. }
  4189. let errtips = ''
  4190. if(this.user.timeType.customDegreeStatus == 1 && this.zhoBao.wuduList.length != 0 && !this.zhoBao.degreeId) {
  4191. errtips += this.user.timeType.customDegreeName + '、'
  4192. }
  4193. if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
  4194. errtips += this.user.timeType.customDataName + '、'
  4195. }
  4196. if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
  4197. errtips += this.user.timeType.customTextName + '、'
  4198. }
  4199. if(this.user.timeType.workContentState == 1 && !this.zhoBao.con){
  4200. errtips += this.user.companyId==781?this.$t('other.specificcontentandresults')+'、': this.$t('other.workMatters') +'、'
  4201. }
  4202. if(errtips){
  4203. errtips = errtips.substring(0,errtips.length - 1)
  4204. this.$message({
  4205. message: this.$t('other.pleaseYes') + errtips + this.$t('other.tofillin'),
  4206. type: 'warning'
  4207. })
  4208. return
  4209. }
  4210. this.tianxieDialogVisible = false
  4211. var zhong = this.zhoData
  4212. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  4213. this.zhoData = zhong
  4214. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  4215. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  4216. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  4217. },
  4218. // 获取本周
  4219. getCurrentWeek() {
  4220. const currentDate = new Date()
  4221. const week = currentDate.getDay()
  4222. const millisecond = 1000 * 60 * 60 * 24
  4223. const minusDay = week != 0 ? week - 1 : 4
  4224. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  4225. var stat = this.dealdate(monday)
  4226. var end
  4227. if(this.user.timeType.fillAhead == 1){
  4228. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4229. const endDate = new Date(currentDate.getTime() + endDay * millisecond)
  4230. end = this.dealdate(endDate)
  4231. }else{
  4232. end = this.dealdate(currentDate)
  4233. }
  4234. this.zhoRqi = [stat, end]
  4235. // console.log('date',currentDate,this.zhoRqi);
  4236. this.zhoRqis()
  4237. // this.jiazai()
  4238. },
  4239. // 获取上周
  4240. handleGetPrevWeek() {
  4241. const Time = new Date(this.zhoRqi[0])
  4242. let weekNum = Time.getDay()
  4243. weekNum = weekNum == 0 ? 7 : weekNum
  4244. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  4245. let fitstDate = new Date(
  4246. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  4247. )
  4248. let startDate = `${fitstDate.getFullYear()}-${
  4249. fitstDate.getMonth() + 1 < 10
  4250. ? '0' + (fitstDate.getMonth() + 1)
  4251. : fitstDate.getMonth() + 1
  4252. }-${
  4253. fitstDate.getDate() < 10
  4254. ? '0' + fitstDate.getDate()
  4255. : fitstDate.getDate()
  4256. }`
  4257. let endDate = `${lastDate.getFullYear()}-${
  4258. lastDate.getMonth() + 1 < 10
  4259. ? '0' + (lastDate.getMonth() + 1)
  4260. : lastDate.getMonth() + 1
  4261. }-${
  4262. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4263. }`
  4264. var stat = this.dealdate(startDate)
  4265. var ends = this.dealdate(endDate)
  4266. var end = this.dateChange(-2, ends)
  4267. this.zhoRqi = [stat, end]
  4268. this.zhoRqis()
  4269. // this.jiazai()
  4270. },
  4271. // 获取下周
  4272. handleGetNextvWeek() {
  4273. const Time = new Date(this.zhoRqi[1])
  4274. let weekNum = Time.getDay()
  4275. weekNum = weekNum == 0 ? 7 : weekNum
  4276. let fitstDate = new Date(
  4277. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  4278. )
  4279. let lastDate = new Date(
  4280. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  4281. )
  4282. let startDate = `${fitstDate.getFullYear()}-${
  4283. fitstDate.getMonth() + 1 < 10
  4284. ? '0' + (fitstDate.getMonth() + 1)
  4285. : fitstDate.getMonth() + 1
  4286. }-${
  4287. fitstDate.getDate() < 10
  4288. ? '0' + fitstDate.getDate()
  4289. : fitstDate.getDate()
  4290. }`
  4291. let endDate = `${lastDate.getFullYear()}-${
  4292. lastDate.getMonth() + 1 < 10
  4293. ? '0' + (lastDate.getMonth() + 1)
  4294. : lastDate.getMonth() + 1
  4295. }-${
  4296. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  4297. }`
  4298. var stat = this.dealdate(startDate)
  4299. var ends = this.dealdate(endDate)
  4300. var end = this.dateChange(-2, ends)
  4301. this.zhoRqi = [stat, end]
  4302. this.zhoRqis()
  4303. // this.jiazai()
  4304. },
  4305. // 新增日期
  4306. newDates() {
  4307. // console.log(this.zhoRqi, '看卡')
  4308. let edate = new Date(this.zhoRqi[1])
  4309. let nowdate = new Date()
  4310. let nowdate2
  4311. if(this.user.timeType.fillAhead == 1){
  4312. let week = nowdate.getDay()
  4313. const endDay = week > 5 ? 0 : 5 - week
  4314. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4315. nowdate2 = this.dealdate(endDate)
  4316. }else{
  4317. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4318. }
  4319. if(edate >= nowdate2){
  4320. return
  4321. }
  4322. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  4323. var obj = {}
  4324. obj.zhoDataTime = this.zhoRqi[1]
  4325. obj.he = 0
  4326. for(var j in this.projectList) {
  4327. var xinzhi = this.projectList[j].projectName
  4328. obj[xinzhi] = {}
  4329. obj[xinzhi].time = ''
  4330. obj[xinzhi].con = ''
  4331. obj[xinzhi].progress = 0
  4332. obj[xinzhi].workingTime = 0
  4333. }
  4334. this.zhoData.push(obj)
  4335. if(this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1){
  4336. this.getWeeklyCardTime();
  4337. }
  4338. this.getWeeklyWorkTime();
  4339. },
  4340. // 减去时间
  4341. dateChange(num = 1,date = false) {
  4342.   if (!date) {
  4343.     date = new Date();//没有传入值时,默认是当前日期
  4344.     date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  4345.   }
  4346.   date += " 00:00:00";//设置为当天凌晨12点
  4347.   date = Date.parse(new Date(date))/1000;//转换为时间戳
  4348.   date += (86400) * num;//修改后的时间戳
  4349.   var newDate = new Date(parseInt(date) * 1000);//转换为时间
  4350. var nian = newDate.getFullYear()
  4351. var yue = ''
  4352. var ri = ''
  4353. var yues = (newDate.getMonth() + 1)
  4354. var ris = newDate.getDate()
  4355. yues > 9 ? yue = yues : yue = '0' + yues
  4356. ris > 9 ? ri = ris : ri = '0' + ris
  4357. return nian +'-'+yue+'-'+ri
  4358. },
  4359. // 加载动画
  4360. jiazai() {
  4361. this.zhoLoading = true
  4362. var that = this
  4363. setTimeout(() =>{
  4364. that.zhoLoading = false
  4365. },1000);
  4366. },
  4367. // 转时间格式
  4368. dealdate(date) {
  4369. const dt = new Date(date)
  4370. const y = dt.getFullYear()
  4371. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  4372. const d = (dt.getDate() + '').padStart(2, '0')
  4373. return `${y}-${m}-${d}`
  4374. },
  4375. // 按周填报
  4376. fillInReportss() {
  4377. window.addEventListener('scroll', this.handleScroll, true)
  4378. // this.jiazai()
  4379. this.diasZho = true
  4380. this.getCurrentWeek()
  4381. // 项目数量判断 <=5
  4382. if(this.projectList.length < 5){
  4383. this.selProjectList = this.projectList
  4384. this.selConShow = false
  4385. }
  4386. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  4387. //重新获取工时预警类型的预算项
  4388. this.http.post('/project-basecost-setting/getReportBasecostList', {
  4389. companyId: this.user.companyId
  4390. },
  4391. res => {
  4392. if (res.code == "ok") {
  4393. this.timeBasecostList = res.data;
  4394. }
  4395. });
  4396. }
  4397. },
  4398. // 按周填报的项目筛选
  4399. selListFun(){
  4400. this.selProjectList = []
  4401. if(this.selCon.length){
  4402. for (let i = 0; i < this.selCon.length; i++) {
  4403. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  4404. }
  4405. this.selConShow = false
  4406. }else{
  4407. this.$message({
  4408. message:this.$t('defaultText.pleaseSelectTheItemYouWantToFillIn'),
  4409. type:'error'
  4410. })
  4411. }
  4412. },
  4413. getWeeklyCardTime(){ //按周填报获取考勤信息
  4414. let dateStr = []
  4415. for(let i in this.zhoData){
  4416. dateStr.push(this.zhoData[i].zhoDataTime)
  4417. }
  4418. this.http.post('/report/getWeeklyCardTime',{
  4419. dateStr: JSON.stringify(dateStr)
  4420. },res => {
  4421. if(res.code == 'ok'){
  4422. for(let i in res.data){
  4423. let datei = '';
  4424. if (this.user.timeType.showDdCardtime == 1) {
  4425. datei = res.data[i].workDate.split('-');
  4426. } else if (this.user.timeType.showCorpwxCardtime == 1) {
  4427. datei = res.data[i].createDate.split('-');
  4428. }
  4429. for(let m in this.zhoData){
  4430. let datem = new Date(this.zhoData[m].zhoDataTime)
  4431. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4432. let item = {
  4433. startTime: res.data[i].startTime,
  4434. endTime: res.data[i].endTime,
  4435. workHours: res.data[i].workHours
  4436. }
  4437. this.$set(this.zhoData[m],'corpTime',item)
  4438. }
  4439. }
  4440. }
  4441. }else{
  4442. this.$message({
  4443. message: res.msg,
  4444. type: 'error'
  4445. })
  4446. }
  4447. },err => {
  4448. this.$message({
  4449. message: err,
  4450. type: 'error'
  4451. })
  4452. })
  4453. },
  4454. getWeeklyWorkTime(){ //按周填报获取已填工时
  4455. let dateStr = []
  4456. for(let i in this.zhoData){
  4457. dateStr.push(this.zhoData[i].zhoDataTime)
  4458. }
  4459. this.http.post('/report/getWeeklyWorkTime',{
  4460. dateStr: JSON.stringify(dateStr)
  4461. },res => {
  4462. if(res.code == 'ok'){
  4463. for(let n in this.zhoData){
  4464. delete this.zhoData[n].filledTime
  4465. }
  4466. for(let i in res.data){
  4467. let datei = res.data[i].createDate.split('-');
  4468. for(let m in this.zhoData){
  4469. let datem = new Date(this.zhoData[m].zhoDataTime)
  4470. if(datei[0] == datem.getFullYear() && datei[1] == (datem.getMonth() + 1) && datei[2] == datem.getDate()){
  4471. this.$set(this.zhoData[m],'filledTime',res.data[i].workingTime)
  4472. let reportTimes = [];
  4473. if (res.data[i].startTime != null) {
  4474. reportTimes = res.data[i].startTime.split(',')
  4475. }
  4476. this.$set(this.zhoData[m],'reportTimes',reportTimes)
  4477. }
  4478. }
  4479. }
  4480. // console.log('zhodata',this.zhoData);
  4481. }else{
  4482. this.$message({
  4483. message: res.msg,
  4484. type: 'error'
  4485. })
  4486. }
  4487. },err => {
  4488. this.$message({
  4489. message: err,
  4490. type: 'error'
  4491. })
  4492. })
  4493. },
  4494. selListqx(){
  4495. this.diasZho = false
  4496. this.selProjectList = []
  4497. this.selCon = []
  4498. },
  4499. handleScroll() {
  4500. this.changdu = this.projectList.length + 1
  4501. },
  4502. // 自动选择时间点的事件
  4503. zhoTimes(item, i, ims, event) {
  4504. var iss = i
  4505. if(item.time == null) {
  4506. return
  4507. } else {
  4508. var zhi = this.zhoData[iss]
  4509. var he = 0
  4510. for(var i in zhi) {
  4511. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  4512. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  4513. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  4514. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  4515. var leave1=date3%(24*3600*1000)
  4516. var hours=Math.floor(leave1/(3600*1000))
  4517. var leave2=leave1%(3600*1000)
  4518. var minutes=Math.floor(leave2/(60*1000))
  4519. var shi = hours+'.'+ minutes
  4520. he += +shi
  4521. }
  4522. }
  4523. zhi.he = he + 'h'
  4524. }
  4525. },
  4526. // 自动选择事件长度的事件
  4527. zhoXuan(item, i) {
  4528. var iss = i
  4529. if(item.time == null) {
  4530. return
  4531. } else {
  4532. var zhi = this.zhoData[iss]
  4533. var he = 0
  4534. for(var i in zhi) {
  4535. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4536. he += +zhi[i].workingTime
  4537. }
  4538. }
  4539. zhi.he = he + 'h'
  4540. }
  4541. },
  4542. // 按时间比例
  4543. addBli(item, i) {
  4544. var iss = i
  4545. if(item.time == null) {
  4546. return
  4547. } else {
  4548. var zhi = this.zhoData[iss]
  4549. var he = 0
  4550. for(var i in zhi) {
  4551. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  4552. he += +zhi[i].workingTime
  4553. }
  4554. }
  4555. zhi.he = he.toFixed(1) + 'h'
  4556. }
  4557. },
  4558. zhoRqis() {
  4559. let nowdate = new Date()
  4560. let nowdate2
  4561. if(this.user.timeType.fillAhead == 1){
  4562. const millisecond = 1000 * 60 * 60 * 24
  4563. let week = nowdate.getDay()
  4564. const endDay = week == 0 || week == 6 ? 0 : 5 - week
  4565. const endDate = new Date(nowdate.getTime() + endDay * millisecond)
  4566. nowdate2 = this.dealdate(endDate)
  4567. }else{
  4568. nowdate2 = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate())
  4569. }
  4570. let edate = new Date(this.zhoRqi[1])
  4571. if(edate >= nowdate2){
  4572. let emon = nowdate2.getMonth() + 1
  4573. let eday = nowdate2.getDate()
  4574. let edate2 = nowdate2.getFullYear() + '-' + (emon < 10 ? '0' + emon : emon) + '-' + (eday < 10 ? '0' + eday : eday)
  4575. this.zhoRqi[1] = edate2
  4576. }
  4577. this.zhoData = []
  4578. if(this.zhoRqi) {
  4579. var stime = this.zhoRqi[0]
  4580. var etime = this.zhoRqi[1]
  4581. var zhi = this.getdiffdate(stime, etime)
  4582. var arrst = []
  4583. for(var i in zhi) {
  4584. var obj = {}
  4585. obj.zhoDataTime = zhi[i]
  4586. obj.he = 0
  4587. for(var j in this.projectList) {
  4588. var xinzhi = this.projectList[j].projectName
  4589. obj[xinzhi] = {}
  4590. obj[xinzhi].time = ''
  4591. obj[xinzhi].con = ''
  4592. obj[xinzhi].progress = 0
  4593. obj[xinzhi].workingTime = 0
  4594. }
  4595. arrst.push(obj)
  4596. }
  4597. this.zhoData = arrst
  4598. }
  4599. if(this.zhoData.length && (this.user.timeType.showDdCardtime == 1 || this.user.timeType.showCorpwxCardtime == 1)){
  4600. this.getWeeklyCardTime()
  4601. // this.getWeeklyFilledTime()
  4602. }
  4603. if (this.zhoData.length) {
  4604. this.getWeeklyWorkTime();
  4605. }
  4606. },
  4607. zhoZhi(res, i) {
  4608. var zhi = 0
  4609. for(var i in res) {
  4610. if(i != 'zhoDataTime' && i != 'he') {
  4611. zhi += +res[i]
  4612. }
  4613. }
  4614. res.he = zhi
  4615. },
  4616. zhoBtn(i) {
  4617. // this.zhoData.split(i, 1)
  4618. var arr = this.zhoData
  4619. arr.splice(i, 1)
  4620. },
  4621. zhoAddlast(){
  4622. this.selConShow = true
  4623. },
  4624. zhoAddqx(){
  4625. this.diasZho = false
  4626. this.selConShow = true
  4627. this.selProjectList = []
  4628. this.selCon = []
  4629. },
  4630. // 提交按周填报
  4631. zhoAdd() {
  4632. var zhi = this.zhoData
  4633. var ll = 0
  4634. if(this.reportTimeType.type == 2) {
  4635. for(var i in zhi) {
  4636. this.dateAr = []
  4637. var alp = []
  4638. var zhis = zhi[i]
  4639. for(var j in zhis) {
  4640. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  4641. let objs = {}
  4642. objs.s = zhis[j].time[0]
  4643. objs.e = zhis[j].time[1]
  4644. alp.push(objs)
  4645. }
  4646. }
  4647. if(zhis.reportTimes){
  4648. for(let k in zhis.reportTimes){
  4649. let objs = {}
  4650. objs.s = zhis.reportTimes[k].split('-')[0]
  4651. objs.e = zhis.reportTimes[k].split('-')[1]
  4652. alp.push(objs)
  4653. }
  4654. }
  4655. this.dateAr = alp
  4656. if(this.dateAr.length > 0) {
  4657. let trus = this.fns()
  4658. ll += 1
  4659. if(!trus) {
  4660. this.$message({
  4661. message: this.$t('message.Filledtimeperiodsoverlap'),
  4662. type: 'error'
  4663. })
  4664. return false
  4665. }
  4666. }
  4667. }
  4668. if(ll == 0) {
  4669. this.$message({
  4670. message: this.$t('message.Pleasefillinthetime'),
  4671. type: 'error'
  4672. })
  4673. return false
  4674. }
  4675. } else if(this.reportTimeType.type == 1){
  4676. for(var i in zhi) {
  4677. var zhis = zhi[i]
  4678. for(var j in zhis) {
  4679. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  4680. ll += 1
  4681. }
  4682. }
  4683. }
  4684. if(ll == 0) {
  4685. this.$message({
  4686. message: this.$t('message.Pleaseselectatime'),
  4687. type: 'error'
  4688. })
  4689. return false
  4690. }
  4691. let overcorp = ''
  4692. for(let n in zhi){
  4693. if(zhi[n].corpTime && parseInt(zhi[n].he) > zhi[n].corpTime.workHours){
  4694. overcorp += zhi[n].zhoDataTime + ','
  4695. }
  4696. }
  4697. if(overcorp != ''){
  4698. overcorp = overcorp.substring(0,overcorp.length - 1)
  4699. this.$message({
  4700. message: this.$t('weekDay.date')+'[' + overcorp + ']'+this.$t('message.cannotexceedtotal'),
  4701. type: 'error'
  4702. })
  4703. return
  4704. }
  4705. }
  4706. var submits = []
  4707. let formData = new FormData();
  4708. if(this.reportTimeType.multiWorktime == 1){
  4709. for (var i in this.zhoData) {
  4710. var zhoD = this.zhoData[i]
  4711. var flgs = false
  4712. for(var j in zhoD) {
  4713. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4714. flgs = true
  4715. // formData.append("degreeId", "-1");
  4716. formData.append("id", '-1');
  4717. for(var s in this.projectList) {
  4718. if(j == this.projectList[s].projectName) {
  4719. formData.append("projectId", this.projectList[s].id);
  4720. }
  4721. }
  4722. if(this.user.timeType.reportAuditType == 3){
  4723. let audItem = {}
  4724. if(this.user.timeType.auditLevel > 0){
  4725. audItem.auditorFirst = zhoD[j].auditorFirst
  4726. }
  4727. if(this.user.timeType.auditLevel > 1){
  4728. audItem.auditorSec = zhoD[j].auditorSec
  4729. }
  4730. if(this.user.timeType.auditLevel > 2){
  4731. audItem.auditorThird = zhoD[j].auditorThird
  4732. }
  4733. if(zhoD[j].ccUserid){
  4734. audItem.ccUserid = zhoD[j].ccUserid
  4735. }
  4736. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4737. }
  4738. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4739. formData.append("taskId", 0);
  4740. formData.append("reportTimeType", this.reportTimeType.type);
  4741. formData.append("endTime", '');
  4742. formData.append("startTime", '');
  4743. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4744. var lix = []
  4745. var objjs = {}
  4746. objjs.startTime = zhoD[j].time[0]
  4747. objjs.endTime = zhoD[j].time[1]
  4748. if (zhoD[j].con == null || zhoD[j].con == '') {
  4749. zhoD[j].con == '-'
  4750. }
  4751. objjs.content = zhoD[j].con
  4752. lix.push(objjs)
  4753. var zhiZhi = JSON.stringify(lix)
  4754. zhiZhi = zhiZhi.replace(/,/g,"@");
  4755. formData.append("content", zhiZhi)
  4756. formData.append("isOvertime", 0)
  4757. formData.append("professionProgress", "[]")
  4758. if (zhoD[j].groupId) {
  4759. formData.append("groupId",zhoD[j].groupId)
  4760. } else {
  4761. //解决后台groupId数组越界的问题
  4762. formData.append("groupId",0)
  4763. }
  4764. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4765. formData.append("createDate",zhoD.zhoDataTime)
  4766. if (zhoD[j].projectAuditorId) {
  4767. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4768. }
  4769. if(zhoD[j].basecostId) {
  4770. formData.append("basecostId", zhoD[j].basecostId);
  4771. } else {
  4772. formData.append("basecostId", 0);
  4773. }
  4774. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4775. formData.append('degreeId',zhoD[j].degreeId)
  4776. }else{
  4777. formData.append("degreeId", "-1");
  4778. }
  4779. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4780. formData.append('customData',zhoD[j].customData)
  4781. }else if(this.user.timeType.customDataActive){
  4782. formData.append('customData',0)
  4783. }
  4784. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4785. formData.append('customText',zhoD[j].customText)
  4786. }else if(this.user.timeType.customTextActive){
  4787. formData.append('customText','-')
  4788. }
  4789. }
  4790. }
  4791. }
  4792. } else {
  4793. for (var i in this.zhoData) {
  4794. var zhoD = this.zhoData[i]
  4795. var flgs = false
  4796. if(this.reportTimeType.type == 2) {
  4797. for(var j in zhoD) {
  4798. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4799. flgs = true
  4800. // formData.append("degreeId", "-1");
  4801. formData.append("id", '-1');
  4802. for(var s in this.projectList) {
  4803. if(j == this.projectList[s].projectName) {
  4804. formData.append("projectId", this.projectList[s].id);
  4805. }
  4806. }
  4807. if(this.user.timeType.reportAuditType == 3){
  4808. let audItem = {}
  4809. if(this.user.timeType.auditLevel > 0){
  4810. audItem.auditorFirst = zhoD[j].auditorFirst
  4811. }
  4812. if(this.user.timeType.auditLevel > 1){
  4813. audItem.auditorSec = zhoD[j].auditorSec
  4814. }
  4815. if(this.user.timeType.auditLevel > 2){
  4816. audItem.auditorThird = zhoD[j].auditorThird
  4817. }
  4818. if(zhoD[j].ccUserid){
  4819. audItem.ccUserid = zhoD[j].ccUserid
  4820. }
  4821. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4822. }
  4823. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4824. formData.append("taskId", 0);
  4825. formData.append("reportTimeType", this.reportTimeType.type);
  4826. formData.append("endTime", zhoD[j].time[1]);
  4827. formData.append("startTime", zhoD[j].time[0]);
  4828. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4829. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4830. formData.append("isOvertime", 0)
  4831. formData.append("professionProgress", "[]")
  4832. if (zhoD[j].groupId) {
  4833. formData.append("groupId",zhoD[j].groupId)
  4834. }
  4835. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4836. formData.append("createDate",zhoD.zhoDataTime)
  4837. if (zhoD[j].projectAuditorId) {
  4838. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4839. }
  4840. if(zhoD[j].basecostId) {
  4841. formData.append("basecostId", zhoD[j].basecostId);
  4842. } else {
  4843. formData.append("basecostId", 0);
  4844. }
  4845. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4846. formData.append('degreeId',zhoD[j].degreeId)
  4847. }else{
  4848. formData.append("degreeId", "-1");
  4849. }
  4850. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4851. formData.append('customData',zhoD[j].customData)
  4852. }else if(this.user.timeType.customDataActive){
  4853. formData.append('customData',0)
  4854. }
  4855. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4856. formData.append('customText',zhoD[j].customText)
  4857. }else if(this.user.timeType.customTextActive){
  4858. formData.append('customText','-')
  4859. }
  4860. }
  4861. }
  4862. } else {
  4863. for(var j in zhoD) {
  4864. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].workingTime && zhoD[j].workingTime.length > 0 && zhoD[j].workingTime > 0 && zhoD[j].workingTime != null && zhoD[j].workingTime != 'null') {
  4865. flgs = true
  4866. // formData.append("degreeId", "-1");
  4867. formData.append("id", '-1');
  4868. for(var s in this.projectList) {
  4869. if(j == this.projectList[s].projectName) {
  4870. formData.append("projectId", this.projectList[s].id);
  4871. }
  4872. }
  4873. if(this.user.timeType.reportAuditType == 3){
  4874. let audItem = {}
  4875. if(this.user.timeType.auditLevel > 0){
  4876. audItem.auditorFirst = zhoD[j].auditorFirst
  4877. }
  4878. if(this.user.timeType.auditLevel > 1){
  4879. audItem.auditorSec = zhoD[j].auditorSec
  4880. }
  4881. if(this.user.timeType.auditLevel > 2){
  4882. audItem.auditorThird = zhoD[j].auditorThird
  4883. }
  4884. if(zhoD[j].ccUserid){
  4885. audItem.ccUserid = zhoD[j].ccUserid
  4886. }
  4887. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  4888. }
  4889. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  4890. // formData.append("subProjectId", zhoD[j].subProjectId);
  4891. formData.append("taskId", 0);
  4892. formData.append("reportTimeType", this.reportTimeType.type);
  4893. if(this.reportTimeType.type == 1) {
  4894. formData.append("workingTime", zhoD[j].workingTime);
  4895. } else if(this.reportTimeType.type == 2) {
  4896. formData.append("endTime", zhoD[j].time[1]);
  4897. formData.append("startTime", zhoD[j].time[0]);
  4898. } else if(this.reportTimeType.type == 3) {
  4899. formData.append("progress", zhoD[j].progress);
  4900. formData.append("workingTime", zhoD[j].workingTime);
  4901. }
  4902. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4903. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4904. formData.append("isOvertime", 0)
  4905. formData.append("professionProgress", "[]")
  4906. if (zhoD[j].groupId) {
  4907. formData.append("groupId",zhoD[j].groupId)
  4908. }
  4909. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4910. formData.append("createDate",zhoD.zhoDataTime)
  4911. if (zhoD[j].projectAuditorId) {
  4912. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4913. }
  4914. if(zhoD[j].basecostId) {
  4915. formData.append("basecostId", zhoD[j].basecostId);
  4916. } else {
  4917. formData.append("basecostId", 0);
  4918. }
  4919. if(this.user.timeType.customDegreeActive && zhoD[j].degreeId){
  4920. formData.append('degreeId',zhoD[j].degreeId)
  4921. }else{
  4922. formData.append("degreeId", "-1");
  4923. }
  4924. if(this.user.timeType.customDataActive && zhoD[j].customData){
  4925. formData.append('customData',zhoD[j].customData)
  4926. }else if(this.user.timeType.customDataActive){
  4927. formData.append('customData',0)
  4928. }
  4929. if(this.user.timeType.customTextActive && zhoD[j].customText){
  4930. formData.append('customText',zhoD[j].customText)
  4931. }else if(this.user.timeType.customTextActive){
  4932. formData.append('customText','-')
  4933. }
  4934. }
  4935. }
  4936. }
  4937. }
  4938. }
  4939. // 自定义维度
  4940. this.submitingReport = true;
  4941. this.http.uploadFile( this.port.report.editPort, formData,
  4942. res => {
  4943. // this.listLoading = false;
  4944. this.submitingReport = false;
  4945. if (res.code == "ok") {
  4946. this.$message({
  4947. message: this.$t('message.fillinsuccessfully'),
  4948. type: "success"
  4949. });
  4950. this.diasZho = false
  4951. this.selConShow = true
  4952. this.zhoData = []
  4953. this.zhoRqi = ''
  4954. this.getReportList();
  4955. this.getDepartment();
  4956. // 关闭弹窗 并 清空
  4957. this.selProjectList = []
  4958. this.selCon = []
  4959. } else {
  4960. this.$message({
  4961. message: res.msg,
  4962. type: "error"
  4963. });
  4964. }
  4965. },
  4966. error => {
  4967. this.submitingReport = false;
  4968. this.$message({
  4969. message: error,
  4970. type: "error"
  4971. });
  4972. });
  4973. },
  4974. ChangeHourMinutestr (str) {
  4975. if (str !== "0" && str !== "" && str !== null) {
  4976. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  4977. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  4978. } else {
  4979. return "";
  4980. }
  4981. },
  4982. // 得到两个日期中间的日期
  4983. getdiffdate(stime,etime){
  4984. //初始化日期列表,数组
  4985. var diffdate = new Array();
  4986. var i=0;
  4987. //开始日期小于等于结束日期,并循环
  4988. while(stime<=etime){
  4989. diffdate[i] = stime;
  4990. //获取开始日期时间戳
  4991. var stime_ts = new Date(stime).getTime();
  4992. //增加一天时间戳后的日期
  4993. var next_date = stime_ts + (24*60*60*1000);
  4994. //拼接年月日,这里的月份会返回(0-11),所以要+1
  4995. var next_dates_y = new Date(next_date).getFullYear()+'-';
  4996. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4997. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4998. stime = next_dates_y+next_dates_m+next_dates_d;
  4999. //增加数组key
  5000. i++;
  5001. }
  5002. return diffdate;
  5003. },
  5004. // 添加模块
  5005. addDomain(i) {
  5006. var leftProgress = 10;
  5007. if (this.reportTimeType.type == 3) {
  5008. //计算已经待分配工时比例
  5009. let array = this.workForm.domains;
  5010. let totalProgress = 0;
  5011. for (var i=0;i<array.length; i++) {
  5012. totalProgress += array[i].progress;
  5013. }
  5014. if (totalProgress < 100) {
  5015. leftProgress = 100 - totalProgress;
  5016. }
  5017. }
  5018. var addItem = {
  5019. projectId: "",
  5020. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  5021. content: "",
  5022. progress:leftProgress,
  5023. state:2,//2-表示待提交
  5024. multiWorktime: this.reportTimeType.multiWorktime,
  5025. worktimeList:[{}],
  5026. canEdit: true,
  5027. auditorFirst: '',
  5028. auditorSec: '',
  5029. auditorThird: '',
  5030. ccUserid: ''
  5031. // degreeId: '',
  5032. };
  5033. if(this.isWeekend && this.user.timeType.lockWorktime != 1){
  5034. this.$set(addItem,'isOvertime',true)
  5035. if(this.reportTimeType.type == 3){
  5036. this.$set(addItem,'overtimeHours',(leftProgress*this.reportTimeType.allday/100).toFixed(0))
  5037. }
  5038. }
  5039. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  5040. //默认给第一个,必填字段
  5041. addItem.basecostId = this.timeBasecostList[0].id;
  5042. }
  5043. this.workForm.domains.push(addItem);
  5044. document.getElementById('workFormsItemBottom').scrollIntoView()
  5045. this.canEdit = true
  5046. if (this.reportTimeType.type == 0) {
  5047. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  5048. var length = this.workForm.domains.length;
  5049. if (length == 2) {
  5050. this.showAddMore = false;
  5051. }
  5052. }
  5053. this.chuji()
  5054. },
  5055. // 移除模块
  5056. delDomain(i) {
  5057. this.workForm.domains.splice(i,1)
  5058. let iscan = false
  5059. for(let i in this.workForm.domains){
  5060. if(this.workForm.domains[i].canEdit){
  5061. iscan = true
  5062. }
  5063. }
  5064. this.canEdit = iscan
  5065. //检测当前剩下的一个,时间类型是否是全天
  5066. if (this.reportTimeType.type == 0) {
  5067. if (this.workForm.domains[0].timeType == 0) {
  5068. this.showAddMore = false;
  5069. } else {
  5070. this.showAddMore = true;
  5071. }
  5072. }
  5073. if(this.user.timeType.multiWorktime == 1) {
  5074. this.iptChangs()
  5075. } else {
  5076. this.seleChn(0)
  5077. }
  5078. },
  5079. // 改变月份
  5080. changeMonth() {
  5081. this.isWeekend = false
  5082. let date = new Date()
  5083. let nowmon = date.getMonth() + 1
  5084. let nowday = date.getDate()
  5085. let nowdate = date.getFullYear() + '-' + (nowmon < 10 ? '0' + nowmon : nowmon) + '-' + (nowday < 10 ? '0' + nowday : nowday)
  5086. if (this.isBatch == 0) {
  5087. if(this.user.timeType.fillAhead == 0){
  5088. let date_a = new Date(this.workForm.createDate)
  5089. if(date_a.getTime() > date.getTime()){
  5090. this.workForm.createDate = nowdate
  5091. }
  5092. }
  5093. //只有按天填报才能获取当天的日报
  5094. if(!this.isSubstitude){
  5095. let weekday = new Date(this.workForm.createDate).getDay()
  5096. if(this.user.companyId == 817){
  5097. if(weekday == 0){
  5098. this.isWeekend = true
  5099. }
  5100. }else{
  5101. if(weekday == 0 || weekday == 6){
  5102. this.isWeekend = true
  5103. }
  5104. }
  5105. this.getReport()
  5106. }
  5107. }else {
  5108. if(this.user.timeType.fillAhead == 0){
  5109. let date_a = new Date(this.workForm.createDate[1])
  5110. if(date_a.getTime() > date.getTime()){
  5111. this.workForm.createDate[1] = nowdate
  5112. let sdate = new Date(this.workForm.createDate[0])
  5113. let edate = new Date(this.workForm.createDate[1])
  5114. if(sdate > edate){
  5115. this.workForm.createDate[0] = this.workForm.createDate[1]
  5116. }
  5117. }
  5118. }
  5119. }
  5120. },
  5121. // 判断时间段
  5122. fns() {
  5123. for (let k in this.dateAr) {
  5124. if (!this.judege(k)) {
  5125. return false
  5126. }
  5127. }
  5128. return true
  5129. },
  5130. judege(idx){
  5131. for (let k in this.dateAr) {
  5132. if (idx !== k) {
  5133. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  5134. return false
  5135. }
  5136. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  5137. return false
  5138. }
  5139. }
  5140. }
  5141. return true
  5142. },
  5143. // 保存日报111111
  5144. submitReport(isDraft) {
  5145. this.isDraft = isDraft;
  5146. this.$refs.workForm.validate(valid => {
  5147. if (valid) {
  5148. this.dateAr = []
  5149. let alp = []
  5150. if(this.user.timeType.multiWorktime != 1) {
  5151. for(var p in this.workForm.domains) {
  5152. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  5153. let objs = {}
  5154. objs.s = this.workForm.domains[p].startTime
  5155. objs.e = this.workForm.domains[p].endTime
  5156. alp.push(objs)
  5157. }
  5158. }
  5159. this.dateAr = alp
  5160. if(this.dateAr.length > 0) {
  5161. let trus = this.fns()
  5162. if(!trus) {
  5163. this.$message({
  5164. message: this.$t('message.Filledtimeperiodsoverlap'),
  5165. type: "error"
  5166. });
  5167. return
  5168. }
  5169. }
  5170. } else {
  5171. for(var p in this.workForm.domains) {
  5172. var slll = this.workForm.domains[p]
  5173. for(var o in slll.worktimeList) {
  5174. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  5175. let objs = {}
  5176. objs.s = slll.worktimeList[o].startTime
  5177. objs.e = slll.worktimeList[o].endTime
  5178. alp.push(objs)
  5179. }
  5180. }
  5181. }
  5182. this.dateAr = alp
  5183. if(this.dateAr.length > 0) {
  5184. let trus = this.fns()
  5185. if(!trus) {
  5186. this.$message({
  5187. message: this.$t('message.Filledtimeperiodsoverlap'),
  5188. type: "error"
  5189. });
  5190. return
  5191. }
  5192. }
  5193. }
  5194. // return
  5195. //代填的情况,检查人员是否已经选择
  5196. if (this.isSubstitude) {
  5197. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  5198. this.$message({
  5199. message: this.$t('message.pleaseselectthepersontofillin'),
  5200. type: "error"
  5201. });
  5202. return;
  5203. }
  5204. }
  5205. //检查时间,全天和上下午不能同时存在
  5206. if (this.reportTimeType.type == 0) {
  5207. var alldayNum = 0;
  5208. var amNum = 0;
  5209. var pmNum = 0;
  5210. for(var i in this.workForm.domains) {
  5211. if (this.workForm.domains[i].timeType == 0) {
  5212. alldayNum ++;
  5213. } else if (this.workForm.domains[i].timeType == 1) {
  5214. amNum++;
  5215. } else if (this.workForm.domains[i].timeType == 2) {
  5216. pmNum++;
  5217. }
  5218. }
  5219. if (alldayNum > 1) {
  5220. this.$message({
  5221. // message: "工作时间-全天,只能选择一次",
  5222. message: this.$t('screening.workHours') + '-' + this.$t('other.allDay') + ',' + this.$t('message.canonlybeselectedonce'),
  5223. type: "error"
  5224. });
  5225. return;
  5226. }
  5227. if (amNum > 1) {
  5228. this.$message({
  5229. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.canonlybeselectedonce'),
  5230. type: "error"
  5231. });
  5232. return;
  5233. }
  5234. if (pmNum > 1) {
  5235. this.$message({
  5236. message: this.$t('screening.workHours') + '-' + this.$t('other.afternoon') + ',' + this.$t('message.canonlybeselectedonce'),
  5237. type: "error"
  5238. });
  5239. return;
  5240. }
  5241. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  5242. this.$message({
  5243. message: this.$t('screening.workHours') + '-' + this.$t('other.morning') + ',' + this.$t('message.Notatthesametimeaslastafternoon'),
  5244. type: "error"
  5245. });
  5246. return;
  5247. }
  5248. } else if (this.reportTimeType.type == 3) {
  5249. //总百分比不能超过100%
  5250. let total = 0;
  5251. this.workForm.domains.forEach(w=>{total += w.progress});
  5252. if (total > 100) {
  5253. this.$message({
  5254. message: this.$t('message.Thesumofthetimeratioscannotexceed') +"100%",
  5255. type: "error"
  5256. });
  5257. return;
  5258. } else if (total < 100) {
  5259. this.$message({
  5260. message: this.$t('message.cannotbesubmitted'),
  5261. type: "error"
  5262. });
  5263. return;
  5264. }
  5265. }
  5266. this.listLoading = true;
  5267. let formData = new FormData();
  5268. formData.append("draft", this.isDraft);
  5269. var totalTime = 0;
  5270. for (var t=0;t<this.workForm.domains.length; t++) {
  5271. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  5272. }
  5273. if (this.reportTimeType.type == 1 && this.workForm.time) {
  5274. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  5275. this.$message({
  5276. message: this.$t('message.Fillinthesumofworkinghours')+(totalTime)+"h"+this.$t('message.Cannotexceedthetotalworkinghoursofattendance')+"("+this.workForm.time.workHours.toFixed(1)+"h)",
  5277. type: "error"
  5278. });
  5279. return;
  5280. }
  5281. }
  5282. for(var i in this.workForm.domains) {
  5283. if(this.user.timeType.reportAuditType == 3){
  5284. let audItem = {}
  5285. let auditRule = ''
  5286. if(this.workForm.domains[i].id){
  5287. audItem.reportId = this.workForm.domains[i].id
  5288. }
  5289. if(this.user.timeType.auditLevel > 0){
  5290. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第一、' }
  5291. audItem.auditorFirst = this.workForm.domains[i].auditorFirst
  5292. }
  5293. if(this.user.timeType.auditLevel > 1){
  5294. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第二、' }
  5295. audItem.auditorSec = this.workForm.domains[i].auditorSec
  5296. }
  5297. if(this.user.timeType.auditLevel > 2){
  5298. if(!this.workForm.domains[i].auditorFirst){ auditRule += '第三、' }
  5299. audItem.auditorThird = this.workForm.domains[i].auditorThird
  5300. }
  5301. if(this.workForm.domains[i].ccUserid){
  5302. audItem.ccUserid = this.workForm.domains[i].ccUserid
  5303. }
  5304. if(auditRule){
  5305. auditRule = auditRule.substring(0,auditRule.length - 1)
  5306. this.$message({
  5307. message: '请指定[' + auditRule + ']审核人',
  5308. type: 'error'
  5309. })
  5310. return
  5311. }
  5312. formData.append("auditorSettingArray", JSON.stringify(audItem).replace(/,/g,"@"));
  5313. }
  5314. if(this.workForm.domains[i].degreeId) {
  5315. // var sss = this.workForm.domains[i].degreeId.toString()
  5316. formData.append("degreeId", this.workForm.domains[i].degreeId);
  5317. } else {
  5318. formData.append("degreeId", -1);
  5319. }
  5320. if(this.workForm.domains[i].customData) {
  5321. // var sss = this.workForm.domains[i].degreeId.toString()
  5322. formData.append("customData", this.workForm.domains[i].customData);
  5323. } else {
  5324. formData.append("customData", 0);
  5325. }
  5326. if(this.workForm.domains[i].customText) {
  5327. formData.append("customText", this.workForm.domains[i].customText);
  5328. } else {
  5329. formData.append("customText", '-');
  5330. }
  5331. if (this.workForm.domains[i].id) {
  5332. formData.append("id", this.workForm.domains[i].id);
  5333. } else {
  5334. formData.append("id", -1);
  5335. }
  5336. formData.append("projectId", this.workForm.domains[i].projectId);
  5337. if (this.workForm.domains[i].subProjectId) {
  5338. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  5339. } else {
  5340. formData.append("subProjectId", 0);
  5341. }
  5342. if (this.workForm.domains[i].groupId) {
  5343. formData.append("groupId", this.workForm.domains[i].groupId);
  5344. } else {
  5345. formData.append("groupId", 0);
  5346. }
  5347. if (this.workForm.domains[i].taskId) {
  5348. formData.append("taskId", this.workForm.domains[i].taskId);
  5349. } else {
  5350. formData.append("taskId", 0);
  5351. }
  5352. if (this.workForm.domains[i].taskFinish == true) {
  5353. formData.append("taskFinish", 1);
  5354. } else {
  5355. formData.append("taskFinish", 0);
  5356. }
  5357. formData.append("reportTimeType", this.reportTimeType.type);
  5358. if (this.reportTimeType.type == 0) {
  5359. formData.append("timeType", this.workForm.domains[i].timeType);
  5360. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  5361. formData.append("workingTime", workingTime);
  5362. } else if (this.reportTimeType.type == 1){
  5363. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5364. } else if (this.reportTimeType.type == 2) {
  5365. formData.append("endTime", this.workForm.domains[i].endTime);
  5366. formData.append("startTime", this.workForm.domains[i].startTime);
  5367. } else if (this.reportTimeType.type == 3) {
  5368. //按比例分配
  5369. formData.append("progress", this.workForm.domains[i].progress);
  5370. formData.append("workingTime", this.workForm.domains[i].workingTime);
  5371. }
  5372. //处理多个时间事项
  5373. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  5374. if (this.reportTimeType.multiWorktime == 1) {
  5375. //检查时间是否有重叠
  5376. var workList = this.workForm.domains[i].worktimeList;
  5377. for (var j=0;j<workList.length; j++) {
  5378. var curItem = workList[j];
  5379. //检查开始时间是否大于结束时间
  5380. if (curItem.startTime >= curItem.endTime) {
  5381. this.$message({
  5382. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.mistaken')+":"+
  5383. this.$t('message.Endtimemustbegreaterthanstarttime'),
  5384. type: "error"
  5385. });
  5386. return;
  5387. }
  5388. for (var p = j+1;p<workList.length; p++) {
  5389. var jItem = workList[p];
  5390. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  5391. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  5392. this.$message({
  5393. message: this.$t('message.period')+curItem.startTime+'-'+curItem.endTime+this.$t('message.and')+
  5394. jItem.startTime+'-'+jItem.endTime+ this.$t('message.Thereisoverlappleaseedit'),
  5395. type: "error"
  5396. });
  5397. return;
  5398. }
  5399. }
  5400. }
  5401. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  5402. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5403. formData.append("content", m);
  5404. } else {
  5405. if (this.workForm.domains[i].content) {
  5406. formData.append("content", this.workForm.domains[i].content);
  5407. } else {
  5408. formData.append("content", '-');
  5409. }
  5410. }
  5411. if (this.isBatch == 0) {
  5412. formData.append("createDate", this.workForm.createDate);
  5413. } else {
  5414. //批量填报,时间范围
  5415. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  5416. }
  5417. if(this.workForm.domains[i].isOvertime) {
  5418. formData.append("isOvertime", 1);
  5419. } else {
  5420. formData.append("isOvertime", 0);
  5421. }
  5422. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  5423. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  5424. } else {
  5425. formData.append("overtimeHours", 0);
  5426. }
  5427. if(this.workForm.domains[i].basecostId) {
  5428. formData.append("basecostId", this.workForm.domains[i].basecostId);
  5429. } else {
  5430. formData.append("basecostId", 0);
  5431. }
  5432. if (this.workForm.userId != null) {
  5433. var targetUids = '';
  5434. this.workForm.userId.forEach(u=>{
  5435. targetUids += u + '@';
  5436. });
  5437. if (targetUids.length > 0) {
  5438. targetUids = targetUids.substring(0, targetUids.length -1);
  5439. formData.append("targetUids", targetUids);
  5440. }
  5441. }
  5442. //项目专业进度
  5443. if (this.workForm.domains[i].professionProgress) {
  5444. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  5445. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  5446. formData.append("professionProgress", m);
  5447. } else {
  5448. formData.append("professionProgress", "[]");
  5449. }
  5450. if (this.workForm.domains[i].stage) {
  5451. formData.append("stage", this.workForm.domains[i].stage);
  5452. } else {
  5453. formData.append("stage", "-");
  5454. }
  5455. console.log(this.workForm.domains[i].projectAuditorId, '审核人的id')
  5456. if (this.workForm.domains[i].projectAuditorId) {
  5457. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  5458. } else {
  5459. console.log('执行到了这里')
  5460. console.log(this.user.timeType.reportAuditType)
  5461. if (this.user.timeType.reportAuditType == 0) {
  5462. this.$message({
  5463. message: this.$t('message.Pleasespecifyaprojectreviewer'),
  5464. type: "error"
  5465. });
  5466. return;
  5467. } else if(this.user.timeType.reportAuditType != 3){
  5468. //分组负责人先审核, 确定是选择了任务分组
  5469. if (this.workForm.domains[i].taskGroups.length == 0) {
  5470. this.$message({
  5471. message: "["+this.workForm.domains[i].projectName+"]"+this.$t('message.involvedintheproject'),
  5472. type: "error"
  5473. });
  5474. } else if (!this.workForm.domains[i].groupId) {
  5475. // console.log(this.workForm.domains[i]);
  5476. this.$message({
  5477. message: this.$t('defaultText.pleaseChoose') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Taskgroupingfortheproject'),
  5478. type: "error"
  5479. });
  5480. } else {
  5481. this.$message({
  5482. message: this.$t('defaultText.pleaseset') + "["+this.workForm.domains[i].projectName+"]"+this.$t('message.Projectgroupleader'),
  5483. type: "error"
  5484. });
  5485. }
  5486. return;
  5487. }
  5488. }
  5489. }
  5490. this.submitingReport = true;
  5491. this.http.uploadFile( this.port.report.editPort, formData,
  5492. res => {
  5493. this.listLoading = false;
  5494. this.submitingReport = false;
  5495. if (res.code == "ok") {
  5496. this.$message({
  5497. message: this.isDraft==0?this.$t('message.submittedSuccessfully'):this.$t('message.Temporarysuccess'),
  5498. type: "success"
  5499. });
  5500. this.dialogVisible = false;
  5501. this.jsDay = 0
  5502. this.jsTime = 0
  5503. this.getReportList();
  5504. this.getDepartment();
  5505. } else {
  5506. this.$message({
  5507. message: (this.isDraft==0?this.$t('message.SubmissionFailed') + ':':this.$t('message.Stagingfailed') + ':')+res.msg,
  5508. type: "error"
  5509. });
  5510. }
  5511. },
  5512. error => {
  5513. this.listLoading = false;
  5514. this.submitingReport = false;
  5515. this.$message({
  5516. message: error,
  5517. type: "error"
  5518. });
  5519. });
  5520. }
  5521. });
  5522. },
  5523. cli() {
  5524. },
  5525. // 判断是展示那个工时导入
  5526. imports() {
  5527. if(this.user.timeType.syncCorpwxTime == 0) {
  5528. this.importDialog = true
  5529. } else {
  5530. this.importWxDialog = true
  5531. }
  5532. },
  5533. // 跳转
  5534. junpToDeskTop(id) {
  5535. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5536. this.$router.push("/desktop/" + id + "/" + this.date +day);
  5537. },
  5538. // 通过日报
  5539. approve(id, item) {
  5540. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5541. this.approveinData = {
  5542. id: id,
  5543. date: this.date +day,
  5544. reportIds: item.id
  5545. }
  5546. if(this.user.timeType.needEvaluate == 1){
  5547. this.$set(this.approveinData,'evaluate','')
  5548. this.approveinDialog = true
  5549. }else{
  5550. this.logining = true;
  5551. this.approveinfun()
  5552. }
  5553. },
  5554. approveinfun(){
  5555. this.http.post( this.port.report.approve, this.approveinData,
  5556. res => {
  5557. this.logining = false;
  5558. if (res.code == "ok") {
  5559. this.approveinDialog = false
  5560. this.$message({
  5561. message: this.$t('message.Reviewsucceeded'),
  5562. type: "success"
  5563. });
  5564. this.getReportList();
  5565. this.getDepartment();
  5566. } else {
  5567. this.$message({
  5568. message: res.msg,
  5569. type: "error"
  5570. });
  5571. }
  5572. },
  5573. error => {
  5574. this.logining = false;
  5575. this.$message({
  5576. message: error,
  5577. type: "error"
  5578. });
  5579. });
  5580. },
  5581. //撤回日报
  5582. cancel(item,e) {
  5583. console.log('can can need',item);
  5584. this.logining = true;
  5585. var ids = '';
  5586. var data = e ? item : item.data;
  5587. data.forEach(element => {
  5588. if(element.id){
  5589. ids +=(element.id+',');
  5590. }
  5591. });
  5592. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  5593. res => {
  5594. this.logining = false;
  5595. if (res.code == "ok") {
  5596. this.$message({
  5597. message:this.$t('message.Withdrawalsucceeded'),
  5598. type: "success"
  5599. });
  5600. this.getReportList();
  5601. if(e){this.getReport()}
  5602. this.getDepartment();
  5603. } else {
  5604. this.$message({
  5605. message: res.msg,
  5606. type: "error"
  5607. });
  5608. }
  5609. },
  5610. error => {
  5611. this.logining = false;
  5612. this.$message({
  5613. message: error,
  5614. type: "error"
  5615. });
  5616. });
  5617. },
  5618. showDenyDialog(id,i, item) {
  5619. this.denyReasonDialog = true;
  5620. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  5621. var ids = item.id;
  5622. // var data = item.data;
  5623. // data.forEach(element => {
  5624. // ids +=(element.id+',');
  5625. // });
  5626. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  5627. },
  5628. // 未通过日报
  5629. deny() {
  5630. this.logining = true;
  5631. this.http.post( this.port.report.deny, this.denyForm,
  5632. res => {
  5633. this.logining = false;
  5634. if (res.code == "ok") {
  5635. this.$message({
  5636. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  5637. type: "success"
  5638. });
  5639. this.getReportList();
  5640. this.getDepartment();
  5641. this.denyReasonDialog = false;
  5642. } else {
  5643. this.$message({
  5644. message: res.msg,
  5645. type: "error"
  5646. });
  5647. }
  5648. },
  5649. error => {
  5650. this.logining = false;
  5651. this.$message({
  5652. message: error,
  5653. type: "error"
  5654. });
  5655. });
  5656. },
  5657. // 查看工时记录弹窗
  5658. toView() {
  5659. this.toViewDialogVisible = true
  5660. this.toViewloading = true
  5661. this.getToView()
  5662. },
  5663. getToView() {
  5664. this.http.post( '/report-import-log/getList', this.toViewForm,
  5665. res => {
  5666. this.toViewloading = false;
  5667. if (res.code == "ok") {
  5668. // console.log(res.data, '数据数据')
  5669. this.toViewList = res.data.records
  5670. this.toViewForm.total = res.data.total
  5671. } else {
  5672. this.toViewloading = false;
  5673. this.$message({
  5674. message: res.msg,
  5675. type: "error"
  5676. });
  5677. }
  5678. })
  5679. },
  5680. // 触发 selectCat 组件更改他的值
  5681. selectCatCli(obj) {
  5682. // obj.id 是 选中人员的id, obj.idx 是 当前的索引
  5683. this.workForm.domains[obj.idx].projectAuditorId = obj.id
  5684. },
  5685. //分页
  5686. handleCurrentChange(val) {
  5687. this.toViewForm.pageIndex = val;
  5688. this.getToView();
  5689. },
  5690. handleSizeChange(val) {
  5691. this.toViewForm.pageSize = val;
  5692. this.getToView();
  5693. },
  5694. getAllUsersList(){
  5695. this.http.post('/user/getSimpleActiveUserList',{
  5696. },res => {
  5697. if(res.code == 'ok'){
  5698. this.allUsersList = res.data
  5699. }else{
  5700. this.$message({
  5701. message: res.msg,
  5702. type: 'error'
  5703. })
  5704. }
  5705. },err => {
  5706. this.$message({
  5707. message: err,
  5708. type: 'error'
  5709. })
  5710. })
  5711. }
  5712. },
  5713. created() {
  5714. let height = window.innerHeight;
  5715. this.tableHeight = height - 178;
  5716. const that = this;
  5717. window.onresize = function temp() {
  5718. that.tableHeight = window.innerHeight - 178;
  5719. };
  5720. this.toViewForm.companyId = this.user.companyId
  5721. this.initDrag([{
  5722. type: "LR",
  5723. domClass: {
  5724. // 中间分割线的名字
  5725. resize: "line-line",
  5726. // 左侧盒子的名字
  5727. left: "box-left",
  5728. // 右侧盒子的名字
  5729. right: "box-right",
  5730. // 父级的名字
  5731. box: "box-father",
  5732. },
  5733. otherInfo: {
  5734. // 限制左边栏最低宽度
  5735. leftWidth: 120,
  5736. },
  5737. },
  5738. {
  5739. type: "LR",
  5740. domClass: {
  5741. // 中间分割线的名字
  5742. resize: "line-second",
  5743. // 左侧盒子的名字
  5744. left: "left-laowang",
  5745. // 右侧盒子的名字
  5746. right: "box-second-father",
  5747. // 父级的名字
  5748. box: "grand",
  5749. },
  5750. otherInfo: {
  5751. // 限制左边栏最低宽度
  5752. leftWidth: 120,
  5753. },
  5754. },
  5755. ]);
  5756. },
  5757. mounted() {
  5758. var now = new Date();
  5759. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  5760. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  5761. this.exportParam.dateRange = [startStr,t];
  5762. this.getAllDate(1);
  5763. this.getReportList();
  5764. this.getProjectList();
  5765. this.getFillProjectList();
  5766. this.getTimeType();
  5767. this.getDepartment();
  5768. this.scrollFunction()
  5769. this.userssHu();
  5770. if(this.user.timeType.reportAuditType == 3){
  5771. this.getAllUsersList()
  5772. }
  5773. if (this.user.company.packageProject == 1) {
  5774. this.getBasecostItemList();
  5775. }
  5776. if(this.user.timeType.lockWorktime){
  5777. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  5778. }
  5779. }
  5780. };
  5781. </script>
  5782. <style lang="scss" scoped>
  5783. .paginatis {
  5784. padding: 10px 10px;
  5785. background: #f2f2f2;
  5786. }
  5787. .waiting {
  5788. color:orange;
  5789. }
  5790. .filledReportStyle {
  5791. color:#32CD32;
  5792. }
  5793. .RejectStyle {
  5794. color:red;
  5795. }
  5796. .waitSubmitStyle{
  5797. color: #409eff;
  5798. }
  5799. .chooseDate {
  5800. .waiting {
  5801. color: #20a0ff;
  5802. }
  5803. .filledReportStyle {
  5804. color:#20a0ff;
  5805. }
  5806. .RejectStyle {
  5807. color: #20a0ff;
  5808. }
  5809. .waitSubmitStyle{
  5810. color: #20a0ff;
  5811. }
  5812. }
  5813. .allDaily {
  5814. width:100%;
  5815. }
  5816. .report_title {
  5817. padding:10px 0;
  5818. color:#666;
  5819. }
  5820. .clearfix {
  5821. overflow-x: auto;
  5822. white-space: nowrap;
  5823. padding: 15px 0 10px 0;
  5824. // overflow-y: hidden;
  5825. .date_item {
  5826. padding: 0 3px;
  5827. cursor: pointer;
  5828. position: relative;
  5829. }
  5830. .chooseDate {
  5831. position: absolute;
  5832. bottom: -3px;
  5833. width: 37px;
  5834. height: 2px;
  5835. left: 14px;
  5836. background: #20a0ff;
  5837. }
  5838. }
  5839. .one_daily {
  5840. i {
  5841. color: #9ed0ff;
  5842. margin-right: 5px;
  5843. }
  5844. .one_daily_body {
  5845. padding: 10px 0px;
  5846. p {
  5847. margin: 0;
  5848. line-height: 30px;
  5849. }
  5850. }
  5851. ul {
  5852. padding: 0;
  5853. }
  5854. }
  5855. .checkbtn {
  5856. float: right;
  5857. margin-top: -10px;
  5858. }
  5859. .selConStyle{
  5860. margin-top:9rem;
  5861. margin-bottom:11rem;
  5862. .selConStyle_title{
  5863. height: 3rem;
  5864. text-align: center;
  5865. font-size: 17px;
  5866. }
  5867. .el-select{
  5868. margin: 0 15%;
  5869. width: 70%;
  5870. }
  5871. }
  5872. </style>
  5873. <style lang="scss">
  5874. .daily {
  5875. .el-card__body {
  5876. height: 80%;
  5877. overflow-y: auto;
  5878. }
  5879. .el-card__header {
  5880. padding: 0 20px;
  5881. }
  5882. }
  5883. .membListClass{
  5884. .el-dialog__body{
  5885. padding-top: 10px;
  5886. }
  5887. }
  5888. .editReportDialog .el-dialog__footer{
  5889. position: sticky;
  5890. bottom: 0;
  5891. background: #fff;
  5892. height: 70px;
  5893. z-index: 1010;
  5894. }
  5895. .touruxiangmu{
  5896. max-width: 1000px;
  5897. }
  5898. </style>
  5899. <style scoped>
  5900. /* 项目标签的样式 */
  5901. .el-tag + .el-tag {
  5902. margin-left: 10px;
  5903. }
  5904. .button-new-tag {
  5905. margin-left: 10px;
  5906. height: 32px;
  5907. line-height: 30px;
  5908. padding-top: 0;
  5909. padding-bottom: 0;
  5910. }
  5911. .input-new-tag {
  5912. width: 90px;
  5913. margin-left: 10px;
  5914. vertical-align: bottom;
  5915. }
  5916. .selectworktime .el-table__fixed-body-wrapper{
  5917. top: 48px !important;
  5918. }
  5919. .selectworktime_export .selectworktime_export_l{
  5920. width: 65%;
  5921. float: left;
  5922. height: 42px;
  5923. }
  5924. .approvalProcessBox{
  5925. margin-left: 30px;
  5926. font-size: 14px;
  5927. line-height: 16px;
  5928. cursor: pointer;
  5929. }
  5930. .approvalProcessBox i {
  5931. margin-right: 0;
  5932. height: 16px;
  5933. width: 16px;
  5934. display: inline-block;
  5935. transform: scale(1.2);
  5936. position: relative;
  5937. top: 0.5px;
  5938. color: #409eff;
  5939. }
  5940. .approvalProcessBox .approvalProcessClick{
  5941. cursor: pointer;
  5942. color: #409eff;
  5943. font-size: 14px;
  5944. }
  5945. .approvalProcessBox:hover .approvalProcessClick{
  5946. color: #3485fb;
  5947. }
  5948. </style>
  5949. <style lang="scss" scoped>
  5950. // 加班样式
  5951. .overtime {
  5952. display: inline-block;
  5953. margin-left: 20px;
  5954. input {
  5955. display: inline-block;
  5956. margin-top: 5px;
  5957. }
  5958. }
  5959. .plus {
  5960. display: inline-block;
  5961. }
  5962. // .tages {
  5963. // float: right;
  5964. // }
  5965. .overtime {
  5966. display: inline-block;
  5967. margin-left: 30px;
  5968. }
  5969. .bloks {
  5970. display: inline-block;
  5971. width: 380px;
  5972. }
  5973. .zhiss {
  5974. display: flex;
  5975. justify-content: space-around;
  5976. align-items: center;
  5977. }
  5978. .zhoFel {
  5979. display: flex;
  5980. justify-content: space-between;
  5981. align-items: center;
  5982. }
  5983. // 左右滑动样式
  5984. .line {
  5985. width: 30px;
  5986. /* height: 500px; */
  5987. background: #f2f2f2;
  5988. cursor: w-resize;
  5989. }
  5990. .box-father {
  5991. border: 8px solid #000;
  5992. }
  5993. .line-second {
  5994. width: 10px;
  5995. /* background: red; */
  5996. }
  5997. .flex {
  5998. display: flex;
  5999. width: 100%;
  6000. }
  6001. .box-left {
  6002. flex: 0 0 400px;
  6003. /* height: 600px; */
  6004. /* background: blue; */
  6005. }
  6006. .box-right {
  6007. /* height: 600px; */
  6008. /* background: green; */
  6009. flex: 1;
  6010. }
  6011. .box-postion {
  6012. width: 200px;
  6013. /* height: 400px; */
  6014. background: #ccc;
  6015. }
  6016. .custom-tree-node {
  6017. flex: 1;
  6018. display: flex;
  6019. align-items: center;
  6020. justify-content: space-between;
  6021. font-size: 14px;
  6022. padding-right: 8px;
  6023. }
  6024. </style>