daily.vue 248 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077
  1. <template>
  2. <section v-loading="zhoLoading">
  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:fixed;top:70px;background:#fff;left:250px;"> -->
  8. <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: 43px;">
  9. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  10. style="width:190px;"
  11. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
  12. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  13. <!-- <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="tiaoshi"></el-button> -->
  14. </div>
  15. <div slot="header" class="clearfix" id="clearfix" style="padding-left: 255px;">
  16. <!-- <div class="jjk" style="display:inline-block;position:fixed;top:70px;background:#fff;left:250px;">
  17. <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM"
  18. style="width:190px;"
  19. @change="changeMonthOut" :clearable="false" type="month" placeholder="选择月份"></el-date-picker>
  20. <el-button style="margin-left:10px;" icon="iconfont firerock-icongongshitongji" size="mini" @click="showWorkTime"></el-button>
  21. </div> -->
  22. <span v-for="(item,index) in allDate" :id="'day'+index" :class="index==choseDay?'chooseDate date_item':'date_item'"
  23. @click="choseDate(index, item)" :key="index" :style="'padding:0 6px;display: inline-block;width: 46px;text-align: center;' + (canClick(index,item) == false ? 'color:#c0c0c0;cursor:not-allowed;' : '') ">
  24. <div :style="'display:inline-block;text-align: center;'+(item.state == null?'':'')" >
  25. <div style="text-align:center;position:relative;"><span>{{item.showDate}}</span>
  26. <br>
  27. <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
  28. <i v-if="item.state != null" class="iconfont firerock-icondot" :class="statusStyle[item.state]" style="position:absolute;top:-1px;right:-18px"></i>
  29. </div>
  30. </div>
  31. </span>
  32. </div>
  33. </div>
  34. <div style="display:flex;">
  35. <div v-if="permissions.reportsCompany || user.manageDeptId != 0" >
  36. <div style="width:190px;">
  37. <el-select v-model="selectState" size="small" @change="stateChange" >
  38. <el-option value="-1" label="全部状态" >全部状态</el-option>
  39. <el-option value="-2" label="未填报">未填报</el-option>
  40. <el-option value="1" label="已通过">已通过</el-option>
  41. <el-option value="0" label="待审核">待审核</el-option>
  42. <el-option value="2" label="不通过">不通过</el-option>
  43. <el-option value="3" label="待提交">待提交</el-option>
  44. </el-select></div>
  45. <div>
  46. <el-tree :data="data" @node-click="handleNodeClick" >
  47. <span class="custom-tree-node" slot-scope="{ node, data}">
  48. <span>{{ node.label }}</span>
  49. <span v-if="data.membCount != null && data.isUser == null">({{data.membCount}})</span>
  50. <div style="width:0%;float:right;">
  51. <span v-if="data.isUser == 1 && data.state == null" style="color:red;">
  52. 未填报
  53. </span>
  54. <span v-if="data.isUser == 1 && data.state == 0" style="color:orange;">
  55. 待审核
  56. </span>
  57. <span v-if="data.isUser == 1 && data.state == 1" style="color:green;">
  58. 已通过
  59. </span>
  60. <span v-if="data.isUser == 1 && data.state == 2" style="color:red;">
  61. 未通过
  62. </span>
  63. <span v-if="data.isUser == 1 && data.state == 3" style="color:red;">
  64. 待提交
  65. </span>
  66. </div>
  67. </span>
  68. </el-tree>
  69. </div>
  70. </div>
  71. <div :style="'height:'+tableHeight+'px;width:0.5px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
  72. <div class="allDaily" style="float:left;flex-grow:1">
  73. <!--系统管理员和部门负责人 -->
  74. <div class="report_title" >
  75. <span>工作日报 </span>
  76. <span v-if="permissions.reportsCompany||user.manageDeptId != 0">| {{depData != null ?depData.label:""}}
  77. <span v-if="targetUid == null">
  78. - 已填写
  79. <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
  80. 未填写<el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length | numbers}}</span></el-link>人
  81. </span>
  82. </span>
  83. <span style="float:right;">
  84. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
  85. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">按周填报</el-link>
  86. <el-link type="primary" v-if="permissions.reportsFillOut" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
  87. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
  88. <el-link type="primary" v-if="permissions.importReport || user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="imports()">工时导入</el-link>
  89. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="showExportDialog">导出日报</el-link>
  90. <!--部门负责人给个导出工时的功能 -->
  91. <el-link type="primary" v-if="user.manageDeptId != 0" style="margin-right:10px;" :underline="false" @click="showExportTimeDialog">导出工时统计</el-link>
  92. </span>
  93. </div>
  94. <!--普通员工,含项目经理 -->
  95. <!-- <div class="report_title" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0"><span>日报列表</span>
  96. <span style="float:right;" v-if="(user.role==0||user.role==3||user.role==5) && user.manageDeptId == 0">
  97. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>
  98. <el-link v-if="reportTimeType.type != 0" type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReportss()">按周填报</el-link>
  99. <el-link type="primary" v-if="user.leader" style="margin-right:10px;" :underline="false" @click="isSubstitude=true; fillInReport(-1,0)">代填日报</el-link>
  100. <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,1)">批量填报</el-link>
  101. </span> -->
  102. <!-- </div> -->
  103. <div :style="'height:'+(tableHeight-50)+'px;overflow:scroll;padding-top:10px;'">
  104. <div class="one_daily" v-for="(item1,index1) in reportList" :key="index1">
  105. <i class="fa fa-circle"></i>{{item1.name}}
  106. <span style="margin-left:30px;">
  107. <span style="margin-right:20px;">
  108. <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
  109. 工作总时长:
  110. <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
  111. <span >{{item1.reportTime}}</span>h
  112. </span>
  113. </span>
  114. <div class="checkbtn" style="padding-right:20px;">
  115. <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">编辑日报</el-button>
  116. <el-button v-if="permissions.reportsDeleteAll && item1.state != 1" size="small" @click="guanli(item1)" style="float: right;">删除</el-button>
  117. </div>
  118. <div class="one_daily_body">
  119. <el-timeline>
  120. <el-timeline-item v-for="(item2,index2) in item1.data" :key="index2">
  121. <el-card shadow="never">
  122. <p>项目:<b>{{item2.project}}</b><span v-if="item2.subProjectName != null"> / {{item2.subProjectName}}</span>
  123. <span v-if="user.company.packageEngineering == 0">
  124. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">[
  125. <span v-if="item2.isDeptAudit==0">
  126. <span v-if="item2.projectAuditState==0">
  127. 待项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核
  128. </span>
  129. <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
  130. 项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核通过
  131. </span>
  132. </span>
  133. <span v-else-if="item2.isDeptAudit==1">
  134. {{('待'+item2.auditDeptName+'审核')}}
  135. </span>
  136. ]</span>
  137. <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">[ 导入待审核 ]</span>
  138. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
  139. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
  140. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 待提交 ]</span>
  141. </span>
  142. <!-- <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> -->
  143. <span v-if="user.company.packageEngineering == 1">
  144. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">[ 导入待审核 ]</span>
  145. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">[ 待专业审核 ]</span>
  146. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">[ 待部门审核 ]</span>
  147. <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">[ 待项目审核人<span v-if="item2.projectAuditorName != null">({{item2.projectAuditorName}})</span>审核 ]</span>
  148. <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">[ 已通过 ]</span>
  149. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">[ 已驳回 ] 原因:{{item2.rejectReason}}</span>
  150. <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">[ 待提交 ]</span>
  151. </span>
  152. <!--每个项目上单独审核 -->
  153. <span style="float:right;">
  154. <el-button v-if="(permissions.projectReportReview || user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="primary" :loading="logining"
  155. size="small" @click="approve(item1.id, item2)">通过</el-button>
  156. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 0 && item2.isDeptAudit==0 && item2.projectAuditState==0" type="danger" :loading="logining"
  157. size="small" @click="showDenyDialog(item1.id,0, item2)">驳回</el-button>
  158. <el-button v-if="(permissions.projectReportReview ||user.id == item2.projectAuditorId) && item2.state == 1" type="normal" :loading="logining" size="small"
  159. @click="showDenyDialog(item1.id,1, item2)">撤销</el-button>
  160. <!--自己可以撤回待审核状态的报告 -->
  161. <el-button v-if="user.id == item1.id && (item2.state == 0 || item2.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">撤回</el-button>
  162. </span>
  163. </p>
  164. <!--任务分组和阶段 -->
  165. <p v-if="item2.groupId != 0">任务分组:{{item2.groupName}} <span v-if="item2.stage != null && item2.stage != '-'" style="margin-left:10px;">投入阶段:{{item2.stage}}</span></p>
  166. <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
  167. <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
  168. <!-- 自定义日报文本 -->
  169. <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
  170. <p v-if="user.company.packageEngineering == 1">
  171. 专业进度:
  172. <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
  173. <el-tooltip v-if="progressItem.auditState == 0" content="待审核" effect="light" placement="top">
  174. <i class="iconfont firerock-icondaibandengdaishenhe"></i>
  175. </el-tooltip>
  176. <el-tooltip v-if="progressItem.auditState == 1" content="已通过" effect="light" placement="top">
  177. <i class="iconfont firerock-iconshenhetongguo"></i>
  178. </el-tooltip>
  179. <el-tooltip v-if="progressItem.auditState == 2" content="不通过" effect="light" placement="top">
  180. <i class="iconfont firerock-iconshenhebohui"></i>
  181. </el-tooltip>
  182. </span>
  183. </p>
  184. <p v-if="item2.taskId != null">任务:{{item2.taskName}}
  185. </p>
  186. <div v-if="item2.multiWorktime==0">
  187. <p style="display: inline-block;">时长:
  188. <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
  189. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
  190. {{item2.time.toFixed(1)}}h
  191. <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>
  192. </p>
  193. <p>事项:<span v-html="item2.content"></span></p>
  194. </div>
  195. <div v-if="item2.multiWorktime==1" >
  196. <p>项目时长:{{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>
  197. <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
  198. style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
  199. <p style="display: inline-block;">时长:
  200. <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
  201. {{timeItem.time.toFixed(1)}}h
  202. </p>
  203. <p>事项:<span v-html="timeItem.content"></span></p>
  204. </div>
  205. </div>
  206. <!--照片的显示 -->
  207. <p v-if="item2.pics != null && item2.pics.length > 0">
  208. <el-image v-for="(pic, index) in item2.pics" :key="index"
  209. style="width: 100px; height: 100px; margin-right:10px;"
  210. :src="pic"
  211. :preview-src-list="item2.pics">
  212. </el-image>
  213. </p>
  214. </el-card>
  215. </el-timeline-item>
  216. </el-timeline>
  217. </div>
  218. </div>
  219. <!-- 简陋的无报告提示 -->
  220. <div v-if="reportList.length==0" style="width:100%;font-size:17px;text-align:center;color:#aaa;">{{curDate}}暂无报告</div>
  221. </div>
  222. </div>
  223. </div>
  224. </el-card>
  225. </div>
  226. <!-- 填写日报的dialog -->
  227. <el-dialog :title="isBatch==0?'填写日报':'批量填报'" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()">
  228. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
  229. <el-form-item label="选择人员" v-if="isSubstitude">
  230. <el-input @focus="showChooseMembTree" v-model="workForm.userNames"
  231. placeholder="请选择代填人员" ></el-input>
  232. </el-form-item>
  233. <el-form-item label="工作日期" prop="createDate">
  234. <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  235. :style="'width:'+(isBatch==0?'200':'280')+'px;'" :type="isBatch==0?'date':'daterange'"
  236. @change="changeMonth()" @blur="iptBlur(reportTimeType.type)" :clearable="false" placeholder="选择工作日期" :disabled="isDisable"></el-date-picker>
  237. <div v-if="falsss" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
  238. <div v-if="isBatch!=0" style="display: inline-block;">总{{jsDay}} 天, 共{{jsTime}} 小时</div>
  239. <span v-if="reportTimeType.type == 3" style="margin-left:30px;">{{isBatch==0?'总':'每日'}}时长:</span>
  240. <el-input-number :disabled="!canEdit" v-if="reportTimeType.type == 3" style="margin-left:10px;" @change="changeAllTime"
  241. v-model="reportTimeType.allday" :precision="1" :step="0.5" :max="12" :min="0.5"></el-input-number>
  242. <span v-if="reportTimeType.type == 3">小时</span>
  243. <span v-if="workForm.time">考勤打卡: {{workForm.time.startTime}}-{{workForm.time.endTime}}, {{workForm.time.workHours}}小时</span>
  244. <span v-if="user.timeType.syncDingding==1&&!workForm.time">暂无考勤记录</span>
  245. </el-form-item>
  246. <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
  247. <div v-if="reportTimeType.multiWorktime==0">
  248. <el-form-item v-if="reportTimeType.type != 3" :label="reportTimeType.type ==2?'工作时间':'工作时长'" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  249. :rules="{ required: true, message: '请选择工作时长', trigger: 'blur' }">
  250. <el-select v-model="domain.timeType" style="width:200px;"
  251. v-if="reportTimeType.type == 0"
  252. placeholder="请选择工作时长"
  253. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  254. @change="onTimeTypeChange(domain.timeType)">
  255. <el-option
  256. v-for="item in timeType"
  257. :key="item.value"
  258. :label="item.label"
  259. :value="item.value">
  260. </el-option>
  261. </el-select>
  262. <!-- 数字时长选择 -->
  263. <el-select v-model="domain.workingTime" style="width:200px;"
  264. v-if="reportTimeType.type == 1"
  265. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  266. :placeholder="'请选择工作时长' + domain.workingTime"
  267. @change="seleChn(0,domain)">
  268. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  269. </el-select>
  270. <span v-if="reportTimeType.type == 1">小时</span>
  271. <span v-if="reportTimeType.type == 2">
  272. <!--时间范围选择 -->
  273. <el-time-picker
  274. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  275. v-model="domain.startTime"
  276. placeholder="起始时间"
  277. style="width:120px;"
  278. format="HH:mm"
  279. value-format="HH:mm"
  280. :picker-options="{
  281. start: '08:00',
  282. end: '23:30'
  283. }"
  284. @change="iptChang()">
  285. </el-time-picker> - <el-time-picker
  286. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  287. v-model="domain.endTime"
  288. placeholder="结束时间"
  289. style="width:120px;"
  290. format="HH:mm"
  291. value-format="HH:mm"
  292. :picker-options="{
  293. start: '08:00',
  294. end: '23:30',
  295. minTime: domain.startTime
  296. }"
  297. @change="iptChang()">
  298. </el-time-picker>
  299. </span>
  300. <div class="overtime" v-if="user.timeType.fillOvertime">
  301. <el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">含加班</el-checkbox>
  302. <el-input :disabled="!canEdit || domain.isOvertime==null || domain.isOvertime==0" 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">小时</span>
  303. </div>
  304. </el-form-item>
  305. <el-form-item :label="user.companyId==781?'工作任务':'投入项目'" :prop="'domains.' + index + '.projectId'"
  306. :rules="{ required: true, message: user.companyId==781?'请选择工作任务':'请选择投入项目', trigger: ['change','blur'] }">
  307. <el-select v-model="domain.projectId" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" style="width:200px;" clearable="true" filterable="true"
  308. @change="selectProject(domain, index)"
  309. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  310. <!-- <el-option v-for="item in projectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName" :value="item.id"></el-option> -->
  311. <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  312. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  313. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  314. </el-option>
  315. </el-select>
  316. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  317. style="margin-left:45px;">子项目</span>
  318. <!--子项目 -->
  319. <el-select v-model="domain.subProjectId" placeholder="请选择子项目" style="width:200px;margin-left:10px;" clearable="true"
  320. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  321. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  322. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  323. </el-select>
  324. <el-link v-if="index >= 1&&canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  325. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  326. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  327. </el-link>
  328. <el-link type="primary" v-if="canEdit"
  329. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link>
  330. </el-form-item>
  331. <el-form-item :label="user.companyId==781?'描述':'项目描述'" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  332. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  333. </el-form-item>
  334. <!--如果设置了工时成本预警的预算成本项-->
  335. <el-form-item label="预算来源" v-if="timeBasecostList &&timeBasecostList.length>0">
  336. <el-select v-model="domain.basecostId" :disabled="!canEdit" @change="$forceUpdate()">
  337. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  338. </el-select>
  339. </el-form-item>
  340. <el-form-item label="任务分组" v-if="user.company.packageProject == 1">
  341. <!-- 任务分组 -->
  342. <el-select v-model="domain.groupId" placeholder="请选择任务分组" style="width:200px;" clearable="true"
  343. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  344. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  345. </el-select>
  346. <!-- 项目的阶段 -->
  347. <span v-if="domain.stages != null && domain.stages.length> 0"
  348. style="margin-left:30px;">投入阶段</span>
  349. <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
  350. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  351. @change="changeStages(domain, index)"
  352. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  353. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  354. </el-select>
  355. </el-form-item>
  356. <el-form-item :label="user.companyId==781?'审核人':'项目审核人'">
  357. <el-select v-model="domain.projectAuditorId" :disabled="!canEdit" @change="$forceUpdate()">
  358. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
  359. </el-select>
  360. </el-form-item>
  361. <!-- 相关维度 -->
  362. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
  363. <el-select v-model="domain.degreeId" clearable placeholder="请选择" :disabled="!canEdit">
  364. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  365. </el-option>
  366. </el-select>
  367. </el-form-item>
  368. <!-- 相关数值 -->
  369. <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1">
  370. <el-input-number :id="'numberData_'+index" :disabled="!canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
  371. </el-form-item>
  372. <!-- 自定义文本 -->
  373. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1">
  374. <el-input :disabled="!canEdit" v-model="domain.customText" style="width:500px;" maxlength="25" show-word-limit></el-input>
  375. </el-form-item>
  376. <el-form-item v-if="reportTimeType.type == 3" label="用时占比" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
  377. :rules="{ required: true, message: '请设置用时占比', trigger: 'blur' }">
  378. <div style="width:300px;">
  379. <el-col span="14"><el-slider :disabled="!canEdit" v-model="domain.progress" :min="10" :show-tooltip="false" :step="10" style="width:180px;" @input="domain.workingTime = (reportTimeType.allday*domain.progress/100).toFixed(1)" @change="seleChn(0)"></el-slider></el-col>
  380. <el-col span="10"><span style="margin-left:10px;float:right;"><span style="margin-right:10px;">{{domain.progress}}%</span>{{domain.workingTime}}小时</span></el-col>
  381. </div>
  382. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">加班</el-checkbox>
  383. <el-input :disabled="!canEdit || domain.isOvertime==null || domain.isOvertime==0" 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">小时</span>
  384. </div>
  385. </el-form-item>
  386. <!--工程专业版本模式下, 各个专业的进度填报 -->
  387. <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  388. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  389. <span>{{item.professionName}}</span> / 进度:
  390. <el-input size="mini" style="width:60px;" v-model="item.progress"
  391. @keyup.native="onProgressChange"
  392. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  393. </span>
  394. </el-form-item>
  395. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  396. <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  397. <el-select v-model="domain.taskId" placeholder="请选择" style="width:75%;margin-right:7%" filterable="true"
  398. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  399. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  400. </el-select>
  401. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">已完成</el-checkbox>
  402. </el-form-item>
  403. <el-form-item :label="user.companyId==781?'具体内容与结果':'工作事项'" :prop="'domains.' + index + '.content'" >
  404. <el-input v-model="domain.content" type="textarea" :rows="4" placeholder="请填写" clearable
  405. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
  406. </el-form-item>
  407. </div>
  408. <!--多个工作事项填报的情况 -->
  409. <div v-if="reportTimeType.multiWorktime==1">
  410. <el-form-item label="投入项目" :prop="'domains.' + index + '.projectId'"
  411. :rules="{ required: true, message: '请选择投入项目', trigger: ['change','blur'] }">
  412. <el-select v-model="domain.projectId" placeholder="请选择项目" style="width:200px;" clearable="true" filterable="true"
  413. @change="selectProject(domain, index)"
  414. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  415. <el-option v-for="item in fillProjectList" :disabled="item.status>=2" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
  416. <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
  417. <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
  418. </el-option>
  419. </el-select>
  420. <span v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  421. style="margin-left:45px;">子项目</span>
  422. <!--子项目 -->
  423. <el-select v-model="domain.subProjectId" placeholder="请选择子项目" style="width:200px;margin-left:10px;" clearable="true"
  424. v-if="domain.subProjectList != null && domain.subProjectList.length> 0 && domain.projectId != ''"
  425. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="updateSubProject">
  426. <el-option v-for="item in domain.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  427. </el-select>
  428. <el-link v-if="index >= 1&&canEdit" type="primary" :underline="false" @click="delDomain(index)" style="float:right;margin-right:10px;"
  429. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  430. <i class="fa fa-trash" style="color: red;;font-size:18px;"></i>
  431. </el-link>
  432. <div class="overtime" v-if="user.timeType.fillOvertime"><el-checkbox :disabled="!canEdit" v-model="domain.isOvertime">含加班</el-checkbox>
  433. <el-input :disabled="!canEdit || domain.isOvertime==null || domain.isOvertime==0" 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">小时</span>
  434. </div>
  435. <el-link type="primary" v-if="canEdit"
  436. :underline="false" style="margin-left:10px;" @click="copyProject(index)">复制</el-link>
  437. </el-form-item>
  438. <el-form-item :label="user.companyId==781?'描述':'项目描述'" v-if="user.company.packageProject==0&&domain.projectId&&projectList.filter(p=>p.id == domain.projectId)[0].projectDesc">
  439. <span>{{projectList.filter(p=>p.id == domain.projectId)[0].projectDesc}}</span>
  440. </el-form-item>
  441. <!--如果设置了工时成本预警的预算成本项-->
  442. <el-form-item label="预算来源" v-if="timeBasecostList &&timeBasecostList.length>0">
  443. <el-select v-model="domain.basecostId" :disabled="!canEdit" @change="$forceUpdate()">
  444. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  445. </el-select>
  446. </el-form-item>
  447. <el-form-item label="任务分组" v-if="user.company.packageProject == 1">
  448. <!-- 任务分组 -->
  449. <el-select v-model="domain.groupId" placeholder="请选择任务分组" style="width:200px;" clearable="true"
  450. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)" @change="getGroupStages(domain, index)">
  451. <el-option v-for="item in domain.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  452. </el-select>
  453. <!-- 项目的阶段 -->
  454. <span v-if="domain.stages != null && domain.stages.length> 0"
  455. style="margin-left:30px;">投入阶段</span>
  456. <el-select v-model="domain.stage" placeholder="请选择" style="width:200px;margin-left:10px;"
  457. clearable="true" v-if="domain.stages != null && domain.stages.length> 0"
  458. @change="changeStages(domain, index)"
  459. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  460. <el-option v-for="item in domain.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  461. </el-select>
  462. </el-form-item>
  463. <el-form-item label="项目审核人" >
  464. <el-select v-model="domain.projectAuditorId" :disabled="!canEdit" @change="$forceUpdate()">
  465. <el-option v-for="item in domain.auditUserList" :label="item.auditorName" :value="item.auditorId" :key="item.id"></el-option>
  466. </el-select>
  467. </el-form-item>
  468. <!--工程专业版本模式下, 各个专业的进度填报 -->
  469. <el-form-item label="专业进度" :prop="'domains.' + index + '.professionProgress'" v-if="user.company.packageEngineering==1">
  470. <span v-for="item in domain.professionProgress" :key="item.professionId" style="margin-right:10px;">
  471. <span>{{item.professionName}}</span> / 进度:
  472. <el-input size="mini" style="width:60px;" v-model="item.progress"
  473. @keyup.native="onProgressChange"
  474. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>%
  475. </span>
  476. </el-form-item>
  477. <!-- 相关维度 -->
  478. <el-form-item :label="yonghuUser.customDegreeName" v-if="domain.projectId && yonghuUser.customDegreeActive == 1">
  479. <el-select v-model="domain.degreeId" clearable placeholder="请选择">
  480. <el-option v-for="item in domain.wuduList" :key="item.value" :label="item.name" :value="item.id">
  481. </el-option>
  482. </el-select>
  483. </el-form-item>
  484. <!-- 相关数值 -->
  485. <el-form-item :label="yonghuUser.customDataName" v-if="domain.projectId && yonghuUser.customDataActive == 1">
  486. <el-input-number :id="'numberData_'+index" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)"></el-input-number>
  487. </el-form-item>
  488. <!-- 自定义文本 -->
  489. <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1">
  490. <el-input :disabled="!canEdit" v-model="domain.customText" style="width:500px;" maxlength="25" show-word-limit></el-input>
  491. </el-form-item>
  492. <!--项目管理专业版模式下,项目下的近期执行的任务 -->
  493. <el-form-item label="相关任务" :prop="'domains.' + index + '.taskId'" v-if="user.company.packageProject==1" >
  494. <el-select v-model="domain.taskId" placeholder="请选择" style="width:75%;margin-right:7%" filterable="true"
  495. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)">
  496. <el-option v-for="item in domain.taskList" :key="item.taskId" :label="item.taskName" :value="item.taskId"></el-option>
  497. </el-select>
  498. <el-checkbox v-model="domain.taskFinish" v-if="domain.taskId != undefined">已完成</el-checkbox>
  499. </el-form-item>
  500. <div v-for="(timeItem,tIndex) in domain.worktimeList" :key="tIndex"
  501. style="border: 0.5px #ddd solid;padding:5px;margin-bottom:15px;position:relative;">
  502. <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>
  503. <el-form-item label="工作时间" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.'+timeFields[reportTimeType.type]"
  504. :rules="{ required: true, message: '请选择工作时间', trigger: 'blur' }">
  505. <span v-if="reportTimeType.type == 2">
  506. <!-- <span> -->
  507. <!--时间范围选择 -->
  508. <el-time-picker
  509. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  510. v-model="timeItem.startTime"
  511. placeholder="起始时间"
  512. style="width:120px;"
  513. format="HH:mm"
  514. value-format="HH:mm"
  515. :picker-options="{
  516. start: '00:00',
  517. end: '23:59',
  518. }"
  519. @change="iptChangs()">
  520. </el-time-picker> - <el-time-picker
  521. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  522. v-model="timeItem.endTime"
  523. placeholder="结束时间"
  524. style="width:120px;"
  525. format="HH:mm"
  526. value-format="HH:mm"
  527. :picker-options="{
  528. start: '00:00',
  529. end: '23:59',
  530. minTime: timeItem.startTime
  531. }"
  532. @change="iptChangs()">
  533. </el-time-picker>
  534. </span>
  535. </el-form-item>
  536. <el-form-item label="工作事项" :prop="'domains.' + index + '.worktimeList.'+tIndex+'.content'"
  537. :rules="{ required: true, message: '填写工作事项', trigger: 'blur' }">
  538. <el-input v-model="timeItem.content" type="textarea" :rows="2" placeholder="请填写工作事项" clearable
  539. :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"
  540. ></el-input>
  541. </el-form-item>
  542. </div>
  543. <el-link size="small" @click="addNewWorktime(index, domain)" style="margin-left:15px;margin-top:5px;margin-bottom:5px;">添加工时</el-link>
  544. </div>
  545. <!--照片的显示 -->
  546. <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;">
  547. <el-image v-for="(pic, index) in domain.pics" :key="index"
  548. style="width: 100px; height: 100px; margin-right:10px;"
  549. :src="pic"
  550. :preview-src-list="domain.pics">
  551. </el-image>
  552. </p>
  553. <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
  554. </div>
  555. <el-link v-if="showAddMore" :disabled="!canEdit" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px">添加更多</el-link>
  556. </el-form>
  557. <span slot="footer" class="dialog-footer">
  558. <!-- <el-button @click="cancelReport" v-if="workForm.domains[0].id != null && workForm.domains[0].state == 0">撤回</el-button> -->
  559. <el-button @click="deleteReport" v-if="workForm.domains[0].id != null && canEdit">删除</el-button>
  560. <el-button @click="dialogVisible = false">取消</el-button>
  561. <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">暂存</el-button>
  562. <el-button type="primary" @click="submitReport(0)" :loading="submitingReport"
  563. :disabled="workForm.domains.length==0?true:(canEdit?false:true)" >提交</el-button>
  564. </span>
  565. </el-dialog>
  566. <!-- 按周填报 -->
  567. <el-dialog title="按周填报" :visible.sync="diasZho" width="60%" :close-on-click-modal="false" @closed="guanbi(),zhoAddqx()">
  568. <el-form ref="workForm" :model="workForm" :rules="workRules" label-width="100px" v-if="!selConShow">
  569. <el-form-item label="工作日期" prop="createDate">
  570. <el-date-picker v-model="zhoRqi" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="zhoRqis()" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="margin-right: 18px"></el-date-picker>
  571. <el-button @click="handleGetPrevWeek()">上周</el-button>
  572. <el-button @click="getCurrentWeek()">本周</el-button>
  573. <el-button @click="handleGetNextvWeek()">下周</el-button>
  574. <el-button @click="newDates()">新增日期</el-button>
  575. </el-form-item>
  576. <el-table :data="zhoData" style="width: 100%" v-loading="zhoLoading">
  577. <el-table-column fixed="left" prop="zhoDataTime" label="日期" width="160">
  578. <template slot-scope="scope">
  579. {{scope.row.zhoDataTime}}({{scope.row.zhoDataTime | zhoData}})
  580. </template>
  581. </el-table-column>
  582. <!-- <el-table-column align="center" v-for="(item, index) in projectList" :key="item.id" :label="item.projectName" width="200"> -->
  583. <el-table-column align="center" v-for="item in selProjectList" :key="item.id" :label="item.projectName" width="200">
  584. <template slot-scope="scope">
  585. <div v-if="reportTimeType.multiWorktime == 0" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  586. <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>
  587. <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>
  588. <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>
  589. <el-button v-else type="text" >请填写</el-button>
  590. </div>
  591. <div v-if="reportTimeType.multiWorktime == 1" slot="reference" @click="tianxies(scope.row[item.projectName], scope.$index, item.projectName, workForm.domains)">
  592. <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>
  593. <el-button v-else type="text" >请填写</el-button>
  594. </div>
  595. </template>
  596. </el-table-column>
  597. <el-table-column fixed="right" prop="he" label="合计(h)" width="120">
  598. <template slot-scope="scope">
  599. <div class="zhiss">
  600. <p>{{scope.row.he}}</p>
  601. <el-button size="mini" icon="el-icon-delete" circle @click="zhoBtn(scope.$index)"></el-button>
  602. </div>
  603. </template>
  604. </el-table-column>
  605. </el-table>
  606. </el-form>
  607. <!-- 按周填报项目筛选 -->
  608. <div v-if="selConShow" class="selConStyle">
  609. <div class="selConStyle_title">请选择要填报的项目</div>
  610. <el-select v-model="selCon" multiple placeholder="请选择" filterable>
  611. <el-option
  612. v-for="item in fillProjectList"
  613. :disabled="item.status>=2"
  614. :key="item.id"
  615. :label="item.projectName"
  616. :value="item.id">
  617. </el-option>
  618. </el-select>
  619. </div>
  620. <span slot="footer" class="dialog-footer" v-if="selConShow">
  621. <el-button @click="selListqx()">取 消</el-button>
  622. <el-button type="primary" @click="selListFun()">下一步</el-button>
  623. <!-- :loading="submitingReport" -->
  624. </span>
  625. <span slot="footer" class="dialog-footer" v-if="!selConShow">
  626. <el-button @click="zhoAddlast()" style="float:left;" class="el-icon-back">选择项目</el-button>
  627. <el-button @click="zhoAddqx()">取 消</el-button>
  628. <el-button type="primary" @click="zhoAdd()" :loading="submitingReport">提 交</el-button>
  629. </span>
  630. </el-dialog>
  631. <!-- 选择时间 -->
  632. <el-dialog title="时间选择" :visible.sync="btnZho" width="30%" :before-close="handleClose">
  633. <span>这是一段信息</span>
  634. <span slot="footer" class="dialog-footer">
  635. <el-button @click="btnZho = false">取 消</el-button>
  636. <el-button type="primary" @click="btnZho = false">确 定</el-button>
  637. </span>
  638. </el-dialog>
  639. <!-- 按周填报弹窗 -->
  640. <el-dialog title="请填写" :visible.sync="tianxieDialogVisible" width="30%" :before-close="handleClose">
  641. <div>
  642. <div class="zhoFel" v-if="zhoBao.subProjectList != null && zhoBao.subProjectList.length > 0">
  643. <p>子项目</p>
  644. <el-select v-model="zhoBao.subProjectId" placeholder="请选择" clearable="true" style="width: 355px">
  645. <el-option v-for="item in zhoBao.subProjectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  646. </el-select>
  647. </div>
  648. <!--如果设置了工时成本预警的预算成本项-->
  649. <div class="zhoFel" v-if="timeBasecostList &&timeBasecostList.length>0">
  650. <p>预算来源</p>
  651. <el-select v-model="zhoBao.basecostId" style="width: 355px">
  652. <el-option v-for="item in timeBasecostList" :label="item.name" :value="item.id" :key="item.id"></el-option>
  653. </el-select>
  654. </div>
  655. <!-- 任务分组 -->
  656. <div class="zhoFel" v-if="user.company.packageProject == 1">
  657. <p>任务分组</p>
  658. <el-select v-model="zhoBao.groupId" placeholder="请选择任务分组" clearable="true" style="width: 355px"
  659. @change="getGroupStages(zhoBao, 0)">
  660. <el-option v-for="item in zhoBao.taskGroups" :key="item.id" :label="item.name" :value="item.id"></el-option>
  661. </el-select>
  662. </div>
  663. <div class="zhoFel" v-if="user.company.packageProject == 1 && zhoBao.stages != null && zhoBao.stages.length> 0">
  664. <p>投入阶段</p>
  665. <el-select v-model="zhoBao.stage" placeholder="请选择" style="width: 355px" clearable="true" >
  666. <el-option v-for="item in zhoBao.stages" :key="item.id" :label="item.stagesName" :value="item.stagesName"></el-option>
  667. </el-select>
  668. </div>
  669. <div class="zhoFel" v-if="zhoBao.auditUserList != null && zhoBao.auditUserList.length > 0">
  670. <p>审核人</p>
  671. <el-select v-model="zhoBao.projectAuditorId" placeholder="请选择" clearable="true" style="width: 355px">
  672. <el-option v-for="item in zhoBao.auditUserList" :key="item.id" :label="item.auditorName" :value="item.auditorId"></el-option>
  673. </el-select>
  674. </div>
  675. <div class="zhoFel" v-if="reportTimeType.type == 2">
  676. <p>选择时间</p>
  677. <el-time-picker style="width: 355px" is-range v-model="zhoBao.time" format="HH:mm" value-format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
  678. </div>
  679. <div class="zhoFel" v-if="reportTimeType.type == 1">
  680. <p>选择时长</p>
  681. <el-select clearable v-model="zhoBao.workingTime" style="width: 355px;" placeholder="请选择工作时长">
  682. <el-option v-for="item in timeRange" :key="item" :value="item.toFixed(1)">{{item.toFixed(1)}}</el-option>
  683. </el-select>
  684. </div>
  685. <div class="zhoFel" v-if="reportTimeType.type == 3">
  686. <p>用时占比</p>
  687. <div style="width:355px;display: flex;align-items: center;">
  688. <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>
  689. <el-col span="10"><span style="float:right;"><span style="margin-right:10px;">{{zhoBao.progress || 0}}%</span>{{zhoBao.workingTime | amounts}}小时</span></el-col>
  690. </div>
  691. </div>
  692. <div class="zhoFel">
  693. <p>工作事项</p>
  694. <el-input type="textarea" v-model="zhoBao.con" placeholder="请输入工作事项" style="width: 355px" clearable></el-input>
  695. </div>
  696. </div>
  697. <span slot="footer" class="dialog-footer">
  698. <el-button @click="tianxieDialogVisible = false">取 消</el-button>
  699. <el-button type="primary" @click="btnTianxiaes()">确 定</el-button>
  700. </span>
  701. </el-dialog>
  702. <!-- 批量日报审核 -->
  703. <el-dialog title="批量项目报告审核" :visible.sync="approveDialogVisible" width="500px" >
  704. <el-checkbox v-model="isAllSelect" label="全选" style="margin-left:24px;" @change="selectAll" v-if="reportNames.length > 0"></el-checkbox>
  705. <el-tree ref="approveTree" node-key="id" :data="reportNames" show-checkbox="true" @check-change="handleCheckChange" >
  706. </el-tree>
  707. <div style="margin-left:30px;color:#999;" v-if="user.company.packageEngineering==1">仅能看到自己负责的待项目审核的日报填写人员</div>
  708. <span slot="footer" class="dialog-footer">
  709. <el-button @click="approveDialogVisible = false">取消</el-button>
  710. <el-button type="primary" @click="submitBatchApprove" :disabled="batchShowData.length == 0">审核通过</el-button>
  711. </span>
  712. </el-dialog>
  713. <!--导出报表条件选择 -->
  714. <el-dialog title="日报导出" v-if="exportDialog" :visible.sync="exportDialog" customClass="customWidth" width="500px">
  715. <el-form ref="form3" :model="exportParam" >
  716. <el-form-item prop="projectId" label="选择项目">
  717. <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable filterable style="width:350px;">
  718. <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
  719. </el-select>
  720. </el-form-item>
  721. <el-form-item prop="projectId" label="日期范围">
  722. <el-date-picker
  723. v-model="exportParam.dateRange" :editable="false"
  724. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  725. :clearable="true"
  726. range-separator="至"
  727. type="daterange"
  728. start-placeholder="开始日期"
  729. end-placeholder="结束日期"
  730. ></el-date-picker>
  731. </el-form-item>
  732. <el-form-item prop="stateKey" label="是否包含">
  733. <el-select v-model="stateKey" placeholder="请选择" filterable style="width:350px;">
  734. <el-option label="不包含未审核" value="0"></el-option>
  735. <el-option label="包含未审核" value="1"></el-option>
  736. </el-select>
  737. </el-form-item>
  738. </el-form>
  739. <div slot="footer" class="dialog-footer">
  740. <el-button type="primary" @click="exportReport" style="width:100%;" >导出</el-button>
  741. </div>
  742. </el-dialog>
  743. <!--导出报表条件选择 -->
  744. <el-dialog title="工时统计导出" v-if="exportTimeDialog" :visible.sync="exportTimeDialog" customClass="customWidth" width="500px">
  745. <el-form ref="form3" :model="exportParam" >
  746. <el-form-item prop="range" label="日期范围">
  747. <el-date-picker
  748. v-model="exportParam.dateRange" :editable="false"
  749. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  750. :clearable="true"
  751. range-separator="至"
  752. type="daterange"
  753. start-placeholder="开始日期"
  754. end-placeholder="结束日期"
  755. ></el-date-picker>
  756. </el-form-item>
  757. </el-form>
  758. <div slot="footer" class="dialog-footer">
  759. <el-button type="primary" @click="exportUserTime" style="width:100%;" >导出</el-button>
  760. </div>
  761. </el-dialog>
  762. <!--人员列表 -->
  763. <el-dialog :title="(isFill?'已填':'未填')+'人员列表'" v-if="membListVisible" :visible.sync="membListVisible" width="500px">
  764. <el-table :show-header="false" :data="fillMembList" highlight-current-row :height="400" style="width: 100%;">
  765. <el-table-column type="index" width="60">
  766. <template slot-scope="scope" >
  767. {{scope.$index+1}}
  768. </template>
  769. </el-table-column>
  770. <el-table-column prop="label" label="姓名" ></el-table-column>
  771. <el-table-column prop="deptName" label="部门" >
  772. </el-table-column>
  773. </el-table>
  774. <div slot="footer" class="dialog-footer">
  775. <el-button type="primary" @click="weixinNotify" v-if="!isFill" :disabled="fillMembList == 0">微信催填</el-button>
  776. <el-button type="default" @click="exportMemb" :disabled="fillMembList == 0">导出</el-button>
  777. </div>
  778. </el-dialog>
  779. <!-- 按部门选择人员 -->
  780. <el-dialog title="选择需要代填报的人员" v-if="chooseParticipVisible" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  781. <el-input style="width:100%" v-model="deptMembDataText" placeholder="请输入姓名搜索"></el-input>
  782. <div class="tree" style="height:400px">
  783. <el-scrollbar style="height:100%">
  784. <el-tree :data="deptMembData" show-checkbox :props="defaultProps" node-key="id"
  785. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="workForm.userId"
  786. highlight-current :filter-node-method="filterNode"></el-tree>
  787. </el-scrollbar>
  788. </div>
  789. <div>已选中&nbsp;{{chosenMembCount}}&nbsp;人</div>
  790. <div slot="footer" class="dialog-footer">
  791. <el-button @click="chooseParticipVisible = false" >取消</el-button>
  792. <el-button type="primary" @click="chooseParticip()" >确定</el-button>
  793. </div>
  794. </el-dialog>
  795. <el-dialog
  796. v-if="monthWorkTimeDialog"
  797. :visible.sync="monthWorkTimeDialog"
  798. :close-on-click-modal="false"
  799. customClass="customWidth selectworktime"
  800. width="63%"
  801. title=""
  802. >
  803. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  804. <el-tabs v-model="activeName" @tab-click="handleClick">
  805. <el-tab-pane label="已填工时情况" name="first">
  806. <div class="selectworktime_export" style="margin-top:10px;">
  807. <div class="selectworktime_export_l">
  808. <el-date-picker
  809. class="selecteworktime_datapick"
  810. v-model="WorktimeDatepickValue"
  811. value-format="yyyy-MM-dd"
  812. type="daterange"
  813. align="right"
  814. unlink-panels
  815. range-separator="至"
  816. start-placeholder="开始日期"
  817. end-placeholder="结束日期"
  818. :default-time="['12:00:00', '12:00:00']"
  819. size="small"
  820. popper-class="selecteorktime_datapick_popper"
  821. @change="showMonthWorkTime()"
  822. >
  823. </el-date-picker>
  824. <el-button size="small" @click="getDoubleLastWeek(1)">上上周</el-button>
  825. <el-button size="small" @click="getLastWeek(1)">上周</el-button>
  826. <el-button size="small" @click="getThisWeek(1)">本周</el-button>
  827. <!-- 222 -->
  828. </div>
  829. <div>
  830. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  831. <el-button slot="append" @click="searchScreen(0)" icon="el-icon-search"></el-button>
  832. </el-input>
  833. </div>
  834. <el-link
  835. type="primary"
  836. style="float: right; vertical-align: middle;height:32px"
  837. @click="exportMembWorkHours()"
  838. >导出数据</el-link
  839. >
  840. </div>
  841. <el-table ref="hasworkTbl"
  842. :data="monthWorkDataS"
  843. v-el-table-infinite-scroll="listScroll"
  844. border
  845. :height="500"
  846. highlight-current-row
  847. style="width: 100%"
  848. v-loading="tbload"
  849. :lazy="true"
  850. >
  851. <el-table-column width="75" type="index" fixed="left" label="序号">
  852. <template slot-scope="scope">
  853. {{ scope.$index + 1 }}
  854. </template>
  855. </el-table-column>
  856. <el-table-column width="105" prop="name" fixed="left" label="姓名">
  857. <template slot-scope="scope">
  858. <span :style="scope.row.worktimeList.length==0?'color:red':''">{{scope.row.name}}</span>
  859. </template>
  860. </el-table-column>
  861. <el-table-column prop="departmentName" fixed="left" label="部门">
  862. </el-table-column>
  863. <el-table-column
  864. min-width="105"
  865. v-for="(item, index) in pickDateArray"
  866. :key="index"
  867. :label="item.label"
  868. align="center"
  869. >
  870. <template slot-scope="scope">
  871. <div
  872. style="color: red"
  873. v-if="
  874. scope.row.worktimeList.filter(
  875. (w) =>
  876. w.createDate==item.date
  877. ).length > 0 &&
  878. scope.row.worktimeList.filter(
  879. (w) =>w.createDate==item.date
  880. )[0].workingTime < reportTimeType.allday
  881. "
  882. >
  883. {{
  884. scope.row.worktimeList.filter(
  885. (w) =>w.createDate==item.date
  886. )[0].workingTime
  887. }}
  888. </div>
  889. <div
  890. style="color: #20a0ff"
  891. v-if="
  892. scope.row.worktimeList.filter(
  893. (w) =>w.createDate==item.date
  894. ).length > 0 &&
  895. scope.row.worktimeList.filter(
  896. (w) =>w.createDate==item.date
  897. )[0].workingTime > reportTimeType.allday
  898. "
  899. >
  900. {{
  901. scope.row.worktimeList.filter(
  902. (w) =>w.createDate==item.date
  903. )[0].workingTime
  904. }}
  905. </div>
  906. <div
  907. v-if="
  908. scope.row.worktimeList.filter(
  909. (w) =>w.createDate==item.date
  910. ).length > 0 &&
  911. scope.row.worktimeList.filter(
  912. (w) =>w.createDate==item.date
  913. )[0].workingTime == reportTimeType.allday
  914. "
  915. >
  916. {{
  917. scope.row.worktimeList.filter(
  918. (w) =>w.createDate==item.date
  919. )[0].workingTime
  920. }}
  921. </div>
  922. <div
  923. v-if="
  924. scope.row.worktimeList.filter(
  925. (w) =>w.createDate==item.date
  926. ).length == 0
  927. "
  928. >
  929. 0
  930. </div>
  931. <div
  932. v-if="
  933. scope.row.worktimeList.filter(
  934. (w) =>w.createDate==item.date
  935. ).length > 0 &&
  936. typeof scope.row.worktimeList.filter(
  937. (w) =>w.createDate==item.date
  938. )[0].workingTime == 'string'
  939. "
  940. >
  941. {{
  942. scope.row.worktimeList.filter(
  943. (w) =>w.createDate==item.date
  944. )[0].workingTime
  945. }}
  946. </div>
  947. </template>
  948. </el-table-column>
  949. </el-table>
  950. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
  951. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" title="无更多数据" type="warning" center show-icon></el-alert>
  952. <!-- <div slot="title" class="dialog-title selectworktime_title">
  953. <label style="font-size: 16px">员工每日已填报工时数</label>
  954. <el-link
  955. type="primary"
  956. style="float: right; margin-right: 60px"
  957. @click="exportMembWorkHours()"
  958. >导出已填报数据</el-link
  959. > -->
  960. <!-- <el-button >导出</el-button> -->
  961. <!-- </div> -->
  962. </el-tab-pane>
  963. <el-tab-pane label="未填人员列表" name="second" >
  964. <div class="selectworktime_export" style="margin-top:10px">
  965. <div class="selectworktime_export_l">
  966. <el-date-picker
  967. class="selecteworktime_datapick"
  968. v-model="WorktimeDatepickValue"
  969. value-format="yyyy-MM-dd"
  970. type="daterange"
  971. align="right"
  972. unlink-panels
  973. range-separator="至"
  974. start-placeholder="开始日期"
  975. end-placeholder="结束日期"
  976. :default-time="['12:00:00', '12:00:00']"
  977. size="small"
  978. popper-class="selecteorktime_datapick_popper"
  979. @change="showMonthNotWorkTime()"
  980. >
  981. </el-date-picker>
  982. <el-button size="small" @click="getDoubleLastWeek()">上上周</el-button>
  983. <el-button size="small" @click="getLastWeek()">上周</el-button>
  984. <el-button size="small" @click="getThisWeek()">本周</el-button>
  985. </div>
  986. <div>
  987. <el-input style="float:left;width:22%" v-model="searchKeyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  988. <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
  989. </el-input>
  990. </div>
  991. <el-link
  992. type="primary"
  993. style="float: right; vertical-align: middle;height:32px"
  994. @click="exportMembNotWorkHours()"
  995. >导出数据</el-link
  996. >
  997. </div>
  998. <el-table
  999. ref="hasworkTbl2"
  1000. :data="monthNotWorkDateS"
  1001. v-el-table-infinite-scroll="notListScroll"
  1002. border
  1003. :height="500"
  1004. highlight-current-row
  1005. style="width: 100%"
  1006. v-loading="tbload"
  1007. lazy
  1008. >
  1009. <el-table-column min-width="300" label="部门" prop="department">
  1010. </el-table-column>
  1011. <el-table-column min-width="300" prop="name" label="姓名" >
  1012. </el-table-column>
  1013. <el-table-column
  1014. min-width="300"
  1015. label="未填日期"
  1016. align="center"
  1017. prop="createDate"
  1018. >
  1019. </el-table-column>
  1020. </el-table>
  1021. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isFlag" title="加载中..." type="success" center :closable="false" show-icon></el-alert>
  1022. <el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" title="无更多数据" type="success" center show-icon></el-alert>
  1023. </el-tab-pane>
  1024. </el-tabs>
  1025. </el-dialog>
  1026. <!--驳回弹出框 -->
  1027. <el-dialog title="请输入原因" v-if="denyReasonDialog" :visible.sync="denyReasonDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
  1028. <div>
  1029. <el-input type="textarea" v-model="denyForm.reason" rows="2" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'" />
  1030. </div>
  1031. <div slot="footer" class="dialog-footer">
  1032. <el-button @click="denyReasonDialog = false" >取消</el-button>
  1033. <el-button type="primary" @click="deny()" >确定</el-button>
  1034. </div>
  1035. </el-dialog>
  1036. <!--批量导入日报 -->
  1037. <el-dialog title="工时批量导入" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  1038. <p>1. 下载
  1039. <el-link type="primary" style="margin-left:5px;" :underline="false" href="./upload/员工工时统计模板2.xlsx" download="员工工时导入模板.xlsx">员工工时统计模板.xlsx</el-link>
  1040. </p>
  1041. <p>2. 填写excel模板,请确保模板中的项目和人员已添加到系统中。</p>
  1042. <p style="display: flex;justify-content: center;">
  1043. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  1044. <el-button type="primary" :underline="false" :loading="importingData">开始导入</el-button>
  1045. </el-upload>
  1046. </p>
  1047. <div style="display: flex;justify-content: end;padding-bottom: 1em;">
  1048. <el-link type="primary" @click="toView()">查看工时导入记录</el-link>
  1049. </div>
  1050. </el-dialog>
  1051. <!-- 工时导入记录弹窗 -->
  1052. <el-dialog title="工时导入记录" v-loading="toViewloading" :visible.sync="toViewDialogVisible" width="400" :before-close="handleClose">
  1053. <div style="height: 452px">
  1054. <el-table :data="toViewList" stripe style="width: 100%;" height="400">
  1055. <el-table-column prop="indate" label="导入时间"> </el-table-column>
  1056. <el-table-column prop="userName" label="操作人"> </el-table-column>
  1057. <el-table-column prop="datel" label="文件">
  1058. <template slot-scope="scope">
  1059. <div>
  1060. <el-link type="primary" @click="addUpload(scope.row)">{{scope.row.fileName}}</el-link>
  1061. <!-- <el-link type="primary" :href="'http://localhost:10086/upload/'+ scope.row.serverName">{{scope.row.fileName}}</el-link> -->
  1062. </div>
  1063. </template>
  1064. </el-table-column>
  1065. </el-table>
  1066. <el-col :span="24" class="paginatis">
  1067. <el-pagination
  1068. @size-change="handleSizeChange"
  1069. @current-change="handleCurrentChange"
  1070. :page-sizes="[20 , 50 , 80 , 100]"
  1071. :page-size="20"
  1072. layout="total, sizes, prev, pager, next"
  1073. :total="toViewForm.total"
  1074. style="float:right;"
  1075. ></el-pagination>
  1076. </el-col>
  1077. </div>
  1078. </el-dialog>
  1079. <!--基于企业微信考勤数据的工时导入 -->
  1080. <el-dialog title="工时批量导入" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
  1081. <el-steps :active="active" finish-status="success" style="margin-left:50px;">
  1082. <el-step title="选择要导入工时的日期范围">
  1083. </el-step>
  1084. <el-step title="下载带考勤数据的模板"></el-step>
  1085. <el-step title="填写模板,上传数据"></el-step>
  1086. </el-steps>
  1087. <div v-if="active==0" style="padding:30px;height:360px;">
  1088. <div style="margin-top:50px;margin-left:280px;">
  1089. <el-date-picker
  1090. v-model="importWxParam.date" :editable="false"
  1091. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1092. :clearable="true"
  1093. range-separator="至"
  1094. type="daterange"
  1095. start-placeholder="开始日期"
  1096. end-placeholder="结束日期"
  1097. @change="loadCheckInData"
  1098. ></el-date-picker>
  1099. </div>
  1100. </div>
  1101. <div v-if="active==1" style="padding:10px;">
  1102. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="395"
  1103. style="width: 100%;margin-top:5px;" >
  1104. <el-table-column prop="hasPassed" label="审核状态" width="100px">
  1105. <template slot-scope="scope">
  1106. <span v-if="scope.row.hasPassed" style="color:green; margin-left:10px;">已审</span>
  1107. <span v-if="!scope.row.hasPassed" style="color:red; margin-left:10px;">未审</span>
  1108. </template>
  1109. </el-table-column>
  1110. <el-table-column prop="createDate" label="工作日期" >
  1111. </el-table-column>
  1112. <el-table-column prop="weekDayTxt" label="星期" ></el-table-column>
  1113. <el-table-column prop="username" label="员工姓名" ></el-table-column>
  1114. <el-table-column prop="startTime" label="上班时间" ></el-table-column>
  1115. <el-table-column prop="endTime" label="下班时间" ></el-table-column>
  1116. <el-table-column prop="workHours" label="实际工作时长" align="right">
  1117. <template slot-scope="scope">
  1118. {{scope.row.workHours.toFixed(1)}}h
  1119. </template>
  1120. </el-table-column>
  1121. </el-table>
  1122. </div>
  1123. <div v-if="active==2" >
  1124. <p style="display: flex;justify-content: center;height:390px;">
  1125. <el-upload style="margin-top:100px;" ref="upload" action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
  1126. <el-button type="primary" :underline="false" :loading="importingData">选择文件并上传</el-button>
  1127. </el-upload>
  1128. </p>
  1129. </div>
  1130. <div slot="title">
  1131. <span style="font-size:16px;">工时批量导入</span>
  1132. <el-link v-if="active==0" style="float:right;margin-right:100px;" type="primary" @click="toView()">查看工时导入记录</el-link>
  1133. </div>
  1134. <span slot="footer">
  1135. <el-link v-show="active==1" style="margin-right:300px;margin-top:10px;"
  1136. type="primary" @click="downloadCheckInExcel">下载员工工时统计模板.xlsx</el-link>
  1137. <el-button @click="pre" v-if="active!=0">上一步</el-button>
  1138. <el-button @click="next" :disabled="importWxParam.date==null" v-if="active<2">下一步</el-button>
  1139. </span>
  1140. </el-dialog>
  1141. <!--基于企业微信考勤数据的工时导入 -->
  1142. <el-dialog title="工时批量代填" v-if="batchSubFillDialog" :visible.sync="batchSubFillDialog" customClass="customWidth" width="90%">
  1143. <div>
  1144. <span>选择日期范围:</span><el-date-picker
  1145. v-model="importWxParam.date" :editable="false"
  1146. format="yyyy-MM-dd" value-format="yyyy-MM-dd"
  1147. :clearable="true"
  1148. range-separator="至"
  1149. type="daterange"
  1150. start-placeholder="开始日期"
  1151. end-placeholder="结束日期"
  1152. @change="loadCheckInData"
  1153. ></el-date-picker>
  1154. <el-button style="float:right;" type="primary" @click="submitBatchSubFillData">提交</el-button>
  1155. </div>
  1156. <el-table border :data="checkinList" highlight-current-row v-loading="checkinLoading" :height="520"
  1157. :key="timeStamp"
  1158. style="width: 100%;margin-top:5px;" ref="tab">
  1159. <el-table-column prop="createDate" label="工作日期" width="100px" fixed="left"></el-table-column>
  1160. <el-table-column prop="username" label="员工姓名" width="80px" fixed="left"></el-table-column>
  1161. <el-table-column prop="startTime" label="上班时间" width="80px" fixed="left"></el-table-column>
  1162. <el-table-column prop="endTime" label="下班时间" width="80px" fixed="left"></el-table-column>
  1163. <el-table-column prop="workHours" label="工作时长" width="80px" align="right" fixed="left">
  1164. <template slot-scope="scope">
  1165. {{scope.row.workHours.toFixed(1)}}h
  1166. </template>
  1167. </el-table-column>
  1168. <!--项目名称列表 -->
  1169. <el-table-column v-for="(item, index) in projectColumns" :key="index" :label="item" min-width="150px">
  1170. <template slot-scope="scope">
  1171. <el-input v-model="scope.row[item]" style="width:60px;" @input="triggerTotalTime(scope.$index)"></el-input>&nbsp;h
  1172. </template>
  1173. </el-table-column>
  1174. <el-table-column prop="totalFillTime" label="总工时" fixed="right">
  1175. <template slot-scope="scope">
  1176. {{scope.row.totalFillTime==null?0.0:scope.row.totalFillTime}}&nbsp;h
  1177. </template>
  1178. </el-table-column>
  1179. </el-table>
  1180. </el-dialog>
  1181. <!--基于企业微信考勤数据的工时导入 -->
  1182. <el-dialog title="工时导入结果" v-if="showImportResult" :visible.sync="showImportResult" customClass="customWidth" width="500px">
  1183. <div>
  1184. <span>{{importResultMsg}}</span>
  1185. </div>
  1186. <span slot="footer" class="dialog-footer">
  1187. <el-button type="primary" @click="showImportResult=false">确定</el-button>
  1188. </span>
  1189. </el-dialog>
  1190. </section>
  1191. </template>
  1192. <script>
  1193. import util from "../../common/js/util";
  1194. export default {
  1195. data() {
  1196. return {
  1197. alalal: '8.0',
  1198. timeBasecostList:null,
  1199. tbload: false,
  1200. exportTimeDialog: false,
  1201. searchKeyword: '',
  1202. monthWorkDataS: [],
  1203. monthNotWorkDateS: [],
  1204. pickDateArray:[],
  1205. WorktimeDatepickValue: [],
  1206. activeName:"first",
  1207. submitingReport: false,
  1208. importResultMsg:null,
  1209. showImportResult:false,
  1210. importingData: false,
  1211. isDraft: 0,
  1212. timeStamp: 0,
  1213. projectColumns:[],
  1214. checkinLoading:false,
  1215. importWxParam:{date:null,},
  1216. active:0,
  1217. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  1218. importWxDialog:false,
  1219. importDialog:false,
  1220. denyForm:null,
  1221. denyReasonDialog:false,
  1222. monthWorkTimeDialog: false,
  1223. isSubstitude:false,
  1224. isFill:false,
  1225. unFillList:[],
  1226. fillList:[],
  1227. fillMembList:[],
  1228. membListVisible: false,
  1229. isBatch:0,//是否是批量填报
  1230. weekDay : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  1231. statusStyle:["waiting", "filledReportStyle", "RejectStyle", ""],
  1232. fillStatusList: [],
  1233. exportParam:{projectId: null, dateRange:[]},
  1234. exportDialog:false,
  1235. timeFields:['timeType', 'workingTime', 'startTime', 'progress'],
  1236. subProjectList:[],
  1237. canEdit: true,
  1238. 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],
  1239. selectTime:null,
  1240. reportTimeType:{},
  1241. curDate:'',
  1242. isAllSelect: false,
  1243. approveDialogVisible:false,
  1244. deptId:null,
  1245. targetUid: null,
  1246. membCount:0,
  1247. selectState:"-1",
  1248. user: JSON.parse(sessionStorage.getItem("user")),
  1249. showAddMore:false,
  1250. allDate: [],
  1251. typeList:['全天','上午','下午'],
  1252. date: sessionStorage.msg?sessionStorage.msg.split('-')[0]+"-"+sessionStorage.msg.split('-')[1]:util.formatDate.format(new Date(new Date()), "yyyy-MM"),
  1253. choseDay: 0,
  1254. tableHeight: 0,
  1255. listLoading: false,
  1256. projectList: [], //项目列表
  1257. fillProjectList: [],
  1258. reportList: [], //日报列表
  1259. reportNames:[], //批量审批列表
  1260. selCon:[], //筛选条件
  1261. selProjectList:[], //筛选后项目列表
  1262. selConShow: true,
  1263. dialogVisible: false, //项目弹窗
  1264. report: '',
  1265. workForm: {
  1266. createDate: sessionStorage.msg?sessionStorage.msg:util.formatDate.format(new Date(new Date()), "yyyy-MM-dd"),
  1267. domains: [{
  1268. id: null,
  1269. projectId: "",
  1270. workingTime: "",
  1271. timeType:0,
  1272. content: "",
  1273. state: 2,
  1274. multiWorktime:0,
  1275. worktimeList:[],
  1276. degreeId: null,
  1277. }],
  1278. },
  1279. workRules: {
  1280. createDate: [{ required: true, message: "请选择工作日期", trigger: "change" }],
  1281. },
  1282. chooseParticipVisible: false,
  1283. logining: false,
  1284. isDisable: false,
  1285. timeType:[],
  1286. deptMembData: [
  1287. ],
  1288. //部门人员树状结构
  1289. data: [
  1290. {
  1291. id: -1,
  1292. label: '全部人员',
  1293. membCount:0
  1294. },
  1295. {
  1296. id: 0,
  1297. label: '未分配',
  1298. }
  1299. ],
  1300. allData:{},
  1301. batchShowData:{},
  1302. option: [],
  1303. depData: {
  1304. id: -1,
  1305. label: '全部人员',
  1306. },
  1307. defaultProps: {
  1308. children: 'children',
  1309. label: 'label'
  1310. },
  1311. isNew: false,
  1312. selected: false,
  1313. valuet: new Date(),
  1314. domObj: null,
  1315. participator:[],
  1316. chosenMembCount:0,
  1317. jsDay: 0,
  1318. jsTime: 0,
  1319. falsss: false,
  1320. weidu: [],
  1321. weiduList: [],
  1322. yonghuUser: [],
  1323. dateAr: [],
  1324. batchSubFillDialog: false,
  1325. isSubstiS: false,
  1326. diasZho: false,
  1327. zhoData: [],
  1328. zhoRqi: [],
  1329. btnZho: false,
  1330. zhoLoading: false,
  1331. changdu: 6,
  1332. tianxieDialogVisible: false,
  1333. scopess: {},
  1334. zhoBao: {
  1335. time: '',
  1336. workingTime: '',
  1337. progress: '',
  1338. con: '',
  1339. subProjectId: '',
  1340. stage: '',
  1341. subProjectList: [],
  1342. stages: [],
  1343. },
  1344. zhoBaoIdx: '',
  1345. zhoBaoName: '',
  1346. zhis: {},
  1347. dealList: [],
  1348. toViewDialogVisible: false,
  1349. toViewList: [],
  1350. toViewloading: true,
  1351. toViewForm: {
  1352. pageIndex: '1',
  1353. pageSize: '20',
  1354. total: 0,
  1355. },
  1356. toViewloadings: false,
  1357. tabPositionss: 'top',
  1358. monthTotal: 0,
  1359. monthTotalPage: 0,
  1360. monthTotalLages: 20,
  1361. monthWorkData: [],
  1362. monthNotWorkDate: [],
  1363. monthWorkDataS1: [],
  1364. monthnotTotal: 0,
  1365. monthnotTotalPage: 0,
  1366. monthnotTotalLages: 20,
  1367. monthNotWorkDateS1: [],
  1368. deptMembDataText: '',
  1369. isFlag: false,
  1370. isMore: false,
  1371. stateKey: '0'
  1372. };
  1373. },
  1374. watch: {
  1375. deptMembDataText(val) {
  1376. this.$refs.chooseMembTree.filter(val);
  1377. }
  1378. },
  1379. filters: {
  1380. // 过滤
  1381. amounts(value) {
  1382. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
  1383. return 0
  1384. }
  1385. var zhi = +value + 0
  1386. return zhi.toFixed(1)
  1387. },
  1388. // zhoData
  1389. zhoData(value) {
  1390. var dateArray = value.split("-");
  1391. var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  1392. return "周" + "日一二三四五六".charAt(date.getDay());
  1393. },
  1394. // 过滤数字
  1395. numbers(value) {
  1396. if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null' || value <= 0) {
  1397. return 0
  1398. }
  1399. return value
  1400. },
  1401. },
  1402. methods: {
  1403. filterNode(value, data) {
  1404. // console.log(value, data, '搜索')
  1405. if (!value) return true;
  1406. return data.label.indexOf(value) !== -1;
  1407. },
  1408. triggerCalculateOT(index) {
  1409. var str = this.workForm.domains[index].overtimeHours + ''
  1410. if(str.indexOf('.') != '-1') {
  1411. var s = str.split('.')[0]
  1412. var st = str.split('.')[1]
  1413. var sts = st.split('')
  1414. this.workForm.domains[index].overtimeHours = s + '.' + sts[0]
  1415. }
  1416. },
  1417. searchScreen(e){
  1418. if(e){
  1419. this.monthNotWorkDateS1 = []
  1420. for (let i = 0; i < this.monthNotWorkDate.length; i++) {
  1421. if(this.monthNotWorkDate[i].name.indexOf(this.searchKeyword) != -1){
  1422. this.monthNotWorkDateS1.push(this.monthNotWorkDate[i])
  1423. }
  1424. }
  1425. if (this.monthNotWorkDateS1.length > 50) {
  1426. this.monthNotWorkDateS = this.monthNotWorkDateS1.slice(0,50);
  1427. }else{
  1428. this.monthNotWorkDateS = this.monthNotWorkDateS1
  1429. }
  1430. // if (this.monthNotWorkDateS1.length > 0) {
  1431. // setTimeout(() => {
  1432. // this.tableListenernot()
  1433. // }, 1000);
  1434. // }
  1435. }else{
  1436. this.monthWorkDataS1 = []
  1437. for (let i = 0; i < this.monthWorkData.length; i++) {
  1438. if(this.monthWorkData[i].name.indexOf(this.searchKeyword) != -1){
  1439. this.monthWorkDataS1.push(this.monthWorkData[i])
  1440. }
  1441. }
  1442. if (this.monthWorkDataS1.length > 50) {
  1443. this.monthWorkDataS = this.monthWorkDataS1.slice(0,50);
  1444. }else{
  1445. this.monthWorkDataS = this.monthWorkDataS1
  1446. }
  1447. // if (this.monthWorkDataS1.length > 0) {
  1448. // setTimeout(() => {
  1449. // this.tableListener()
  1450. // }, 1000);
  1451. // }
  1452. }
  1453. },
  1454. addUpload(data) {
  1455. // var zhi = data.fileName.split('.')[0]
  1456. // var sss = zhi + '.xlsx'
  1457. // console.log(sss, data)
  1458. // return
  1459. var filePath = '/upload/' + data.serverName;
  1460. const a = document.createElement('a'); // 创建a标签
  1461. a.setAttribute('download', data.fileName);// download属性
  1462. a.setAttribute('href', filePath);// href链接
  1463. a.click(); //自执行点击事件
  1464. a.remove();
  1465. },
  1466. restrictNumber(targetId) {
  1467. let inpu = document.getElementById(targetId).getElementsByTagName('input')[0];
  1468. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  1469. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  1470. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  1471. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  1472. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  1473. inpu.value = parseFloat(inpu.value);
  1474. }
  1475. },
  1476. //获取项目下的任务分组
  1477. getTaskGroups(domain, index) {
  1478. domain.groupId=null;
  1479. this.http.post('/task-group/listMyJoinGroup',{
  1480. projectId: domain.projectId
  1481. },
  1482. res => {
  1483. if (res.code == "ok") {
  1484. this.workForm.domains[index].taskGroups = res.data;
  1485. this.$forceUpdate();
  1486. }
  1487. },
  1488. error => {
  1489. this.$message({
  1490. message: error,
  1491. type: "error"
  1492. });
  1493. }
  1494. );
  1495. },
  1496. //下载带企业微信考勤数据的工时统计模板
  1497. downloadCheckInExcel() {
  1498. this.http.post('/user-corpwx-time/exportCheckInExcel',{
  1499. startDate: this.importWxParam.date[0],
  1500. endDate: this.importWxParam.date[1],
  1501. },
  1502. res => {
  1503. if (res.code == "ok") {
  1504. var filePath = res.data;
  1505. const a = document.createElement('a'); // 创建a标签
  1506. var data = filePath.split("/");
  1507. a.setAttribute('download', data[data.length-1]);// download属性
  1508. a.setAttribute('href', filePath);// href链接
  1509. a.click(); //自执行点击事件
  1510. a.remove();
  1511. } else {
  1512. this.$message({
  1513. message: res.msg,
  1514. type: "error"
  1515. });
  1516. }
  1517. },
  1518. error => {
  1519. this.checkinLoading = false;
  1520. this.$message({
  1521. message: error,
  1522. type: "error"
  1523. });
  1524. }
  1525. );
  1526. },
  1527. pre() {
  1528. if (this.active == 0) return;
  1529. this.active--;
  1530. },
  1531. next() {
  1532. this.active++;
  1533. },
  1534. triggerTotalTime(index) {
  1535. var item = this.checkinList[index];
  1536. var total = 0.0;
  1537. for (var i=0;i<this.projectColumns.length; i++) {
  1538. var key = this.projectColumns[i];
  1539. if (item[key] != null && item[key] != '') {
  1540. total += parseFloat(item[key]);
  1541. }
  1542. }
  1543. item.totalFillTime = total;
  1544. },
  1545. //提交批量代填的数据
  1546. submitBatchSubFillData() {
  1547. var data = JSON.stringify(this.checkinList);
  1548. this.http.post('/user-corpwx-time/submitProjectTime',{
  1549. json: data,
  1550. projectColumns: JSON.stringify(this.projectColumns)
  1551. },
  1552. res => {
  1553. if (res.code == "ok") {
  1554. this.$message({message:'提交成功', type:'success'});
  1555. this.importWxDialog = false;
  1556. }
  1557. },
  1558. error => {
  1559. this.checkinLoading = false;
  1560. this.$message({
  1561. message: error,
  1562. type: "error"
  1563. });
  1564. }
  1565. );
  1566. },
  1567. loadCheckInData() {
  1568. if (this.importWxParam.date == null) {
  1569. this.checkinList = [];
  1570. return;
  1571. }
  1572. this.checkinLoading = true;
  1573. this.http.post('/user-corpwx-time/getMyDeptMembsData',{
  1574. startDate: this.importWxParam.date[0],
  1575. endDate: this.importWxParam.date[1],
  1576. },
  1577. res => {
  1578. if (res.code == "ok") {
  1579. this.checkinLoading = false;
  1580. this.checkinList = res.data.list;
  1581. this.projectColumns = res.data.projects;
  1582. // 自定义表格会导致表格错乱,需重新计算表格
  1583. this.$nextTick(()=>{
  1584. this.$refs.tab.doLayout()
  1585. })
  1586. }
  1587. },
  1588. error => {
  1589. this.checkinLoading = false;
  1590. this.$message({
  1591. message: error,
  1592. type: "error"
  1593. });
  1594. }
  1595. );
  1596. },
  1597. batchImportWxData(item) {
  1598. //首先判断文件类型
  1599. let str = item.file.name.split(".");
  1600. let format = str[str.length - 1];
  1601. if (format != "xls" && format != "xlsx") {
  1602. this.$message({
  1603. message: "请选择.xls或.xlsx文件",
  1604. type: "error"
  1605. });
  1606. } else {
  1607. this.importingData = true;
  1608. let formData = new FormData();
  1609. formData.append("file", item.file);
  1610. formData.append("companyId", this.user.companyId);
  1611. formData.append("withCheckIn", 1);
  1612. this.http.uploadFile('/report/importData', formData,
  1613. res => {
  1614. this.$refs.upload.clearFiles();
  1615. this.showImportResult = true;
  1616. this.importingData = false;
  1617. if (res.code == "ok") {
  1618. //换成弹出框,以免有人等了半天回来啥也没看到
  1619. this.importResultMsg = "导入成功:成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");
  1620. this.getReportList();
  1621. this.importWxDialog = false;
  1622. } else {
  1623. this.importResultMsg = "导入失败:"+res.msg;
  1624. }
  1625. },
  1626. error => {
  1627. this.$refs.upload.clearFiles();
  1628. this.listLoading = false;
  1629. this.$message({
  1630. message: error,
  1631. type: "error"
  1632. });
  1633. });
  1634. }
  1635. },
  1636. batchImportData(item) {
  1637. //首先判断文件类型
  1638. let str = item.file.name.split(".");
  1639. let format = str[str.length - 1];
  1640. if (format != "xls" && format != "xlsx") {
  1641. this.$message({
  1642. message: "请选择.xls或.xlsx文件",
  1643. type: "error"
  1644. });
  1645. } else {
  1646. this.importingData = true;
  1647. let formData = new FormData();
  1648. formData.append("file", item.file);
  1649. formData.append("companyId", this.user.companyId);
  1650. this.http.uploadFile('/report/importData', formData,
  1651. res => {
  1652. this.$refs.upload.clearFiles();
  1653. this.importingData = false;
  1654. this.showImportResult = true;
  1655. if (res.code == "ok") {
  1656. //换成弹出框,以免有人等了半天回来啥也没看到
  1657. this.importResultMsg = "成功导入"+res.data+"条工时数据。"+(res.msg?res.msg:"");;
  1658. this.getReportList();
  1659. this.importWXDialog = false;
  1660. } else {
  1661. this.importResultMsg = "导入失败:"+res.msg;
  1662. }
  1663. },
  1664. error => {
  1665. this.$refs.upload.clearFiles();
  1666. this.importingData = false;
  1667. this.$message({
  1668. message: error,
  1669. type: "error"
  1670. });
  1671. });
  1672. }
  1673. },
  1674. userssHu() {
  1675. this.http.post('/time-type/getCompanyTimeSetting',{
  1676. companyId: this.user.companyId
  1677. },
  1678. res => {
  1679. if (res.code == "ok") {
  1680. // console.log("维度",res.data);
  1681. this.yonghuUser = res.data
  1682. }
  1683. },
  1684. error => {
  1685. this.$message({
  1686. message: error,
  1687. type: "error"
  1688. });
  1689. }
  1690. );
  1691. },
  1692. iptBlur(i) {
  1693. if(this.isBatch == 0) {
  1694. return
  1695. }
  1696. var stat = this.workForm.createDate[0]
  1697. var end = this.workForm.createDate[1]
  1698. // this.jsDay = 10
  1699. this.http.post('/report/getWorkDays',{
  1700. startDate: stat,
  1701. endDate: end
  1702. },
  1703. res => {
  1704. if (res.code == "ok") {
  1705. this.jsDay = res.data
  1706. this.chuji(i)
  1707. }
  1708. },
  1709. error => {
  1710. this.$message({
  1711. message: error,
  1712. type: "error"
  1713. });
  1714. }
  1715. );
  1716. var sl = this.workForm.domains
  1717. this.chuji(i)
  1718. },
  1719. chuji(i) {
  1720. if(i == 0) {
  1721. this.seleChn(1)
  1722. } else if(i == 1) {
  1723. this.seleChn(0)
  1724. } else if(i == 2) {
  1725. if(this.workForm.domains[0].multiWorktime > 0) {
  1726. this.iptChangs()
  1727. } else {
  1728. this.iptChang()
  1729. }
  1730. } else if(i == 3) {
  1731. this.seleChn(0)
  1732. }
  1733. },
  1734. seleChn(e,domain) {
  1735. if(e == 1) {
  1736. for(var i in this.workForm.domains) {
  1737. if(this.workForm.domains[i].timeType == 0) {
  1738. this.workForm.domains[i].workingTime = 8
  1739. } else {
  1740. this.workForm.domains[i].workingTime = 4
  1741. }
  1742. }
  1743. }
  1744. var quanbu = 0
  1745. var spl = this.workForm.domains
  1746. var zhi = ''
  1747. for(var i in spl) {
  1748. var sp = +spl[i].workingTime + 0
  1749. zhi = this.jsDay * sp
  1750. quanbu = +quanbu + zhi
  1751. }
  1752. this.jsTime = quanbu
  1753. let worktime = this.jsTime
  1754. if(this.isBatch != 0){
  1755. worktime = this.jsTime / this.jsDay
  1756. }
  1757. if(this.user.timeType.fillOvertime && domain){
  1758. for(let di in spl){
  1759. this.$set(spl[di],'isOvertime',false)
  1760. this.$set(spl[di],'overtimeHours',null)
  1761. }
  1762. if(worktime*1 > this.user.timeType.allday){
  1763. this.$set(domain,'isOvertime',true)
  1764. this.$set(domain,'overtimeHours',worktime - this.user.timeType.allday)
  1765. // domain.overtimeHours = domain.workingTime - this.user.timeType.allday
  1766. }else {
  1767. this.$set(domain,'isOvertime',false)
  1768. this.$set(domain,'overtimeHours',null)
  1769. }
  1770. }
  1771. // console.log('domain',quanbu);
  1772. },
  1773. iptChang() {
  1774. var sl = this.workForm.domains
  1775. var quanbu = 0
  1776. var zhi = ''
  1777. for(var i in sl) {
  1778. if(sl[i].startTime && sl[i].endTime) {
  1779. var date2 = '2021/12/12 ' + sl[i].endTime +':00'
  1780. var date1 = '2021/12/12 ' + sl[i].startTime +':00'
  1781. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  1782. var leave1=date3%(24*3600*1000)
  1783. var hours=Math.floor(leave1/(3600*1000))
  1784. var leave2=leave1%(3600*1000)
  1785. var minutes=Math.floor(leave2/(60*1000))
  1786. var shi = hours+'.'+ minutes
  1787. var sll = +shi + 0
  1788. zhi = this.jsDay * sll
  1789. quanbu = +quanbu + zhi
  1790. }
  1791. }
  1792. this.jsTime = quanbu
  1793. },
  1794. iptChangs() {
  1795. var sl = this.workForm.domains
  1796. var quanbu = 0
  1797. var zhi = ''
  1798. for(var i in sl) {
  1799. for(var j in sl[i].worktimeList){
  1800. if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
  1801. var date2 = '2021/12/12 ' + sl[i].worktimeList[j].endTime +':00'
  1802. var date1 = '2021/12/12 ' + sl[i].worktimeList[j].startTime +':00'
  1803. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  1804. var leave1=date3%(24*3600*1000)
  1805. var hours=Math.floor(leave1/(3600*1000))
  1806. var leave2=leave1%(3600*1000)
  1807. var minutes=Math.floor(leave2/(60*1000))
  1808. var shi = hours+'.'+ minutes
  1809. var sll = +shi + 0
  1810. zhi = this.jsDay * sll
  1811. quanbu = +quanbu + zhi
  1812. }
  1813. }
  1814. }
  1815. this.jsTime = quanbu
  1816. },
  1817. removeTimeItem(item, index) {
  1818. item.worktimeList.splice(index, 1);
  1819. this.iptChangs()
  1820. },
  1821. //添加工时
  1822. addNewWorktime(index, item) {
  1823. if(item.worktimeList == null ) {
  1824. item.worktimeList = []
  1825. }
  1826. item.worktimeList.push({});
  1827. },
  1828. //复制项目
  1829. copyProject(index) {
  1830. var leftProgress = 10;
  1831. if (this.reportTimeType.type == 3) {
  1832. //计算已经待分配工时比例
  1833. let array = this.workForm.domains;
  1834. let totalProgress = 0;
  1835. for (var i=0;i<array.length; i++) {
  1836. totalProgress += array[i].progress;
  1837. }
  1838. if (totalProgress < 100) {
  1839. leftProgress = 100 - totalProgress;
  1840. }
  1841. }
  1842. var newIndex = index+1;
  1843. var itemDomain = {
  1844. projectId: this.workForm.domains[index].projectId,
  1845. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  1846. content: "",
  1847. progress:leftProgress,
  1848. state:2,//2-表示待提交
  1849. };
  1850. this.workForm.domains.splice(newIndex, 0,itemDomain);
  1851. if (this.reportTimeType.type == 0) {
  1852. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  1853. var length = this.workForm.domains.length;
  1854. if (length == 2) {
  1855. this.showAddMore = false;
  1856. }
  1857. }
  1858. this.selectProject(itemDomain, newIndex);
  1859. },
  1860. showWorkTime(){
  1861. this.monthWorkTimeDialog = true;
  1862. this.searchKeyword = ''
  1863. this.WorktimeDatepickValue = this.istoMonth()
  1864. if(this.WorktimeDatepickValue.length == 0){
  1865. let newdate = new Date();
  1866. let nowdate = newdate.toLocaleDateString();
  1867. let getauto = this.getAutoWeekDate(nowdate)
  1868. let nowwd = [getauto[0],getauto[6]]
  1869. this.WorktimeDatepickValue = nowwd
  1870. }
  1871. this.showMonthWorkTime()
  1872. },
  1873. handleClick(t,e){
  1874. // console.log("tabname",t.name);
  1875. if (t.name == "first") {
  1876. this.showMonthWorkTime()
  1877. }else{
  1878. this.showMonthNotWorkTime()
  1879. }
  1880. },
  1881. //导出员工每日填报工时数
  1882. exportMembWorkHours() {
  1883. // console.log("exportMembWorkHours",this.WorktimeDatepickValue);
  1884. this.http.post(
  1885. "/report/exportUserDailyWorkTime",
  1886. {
  1887. // month: this.date,
  1888. startDate: this.WorktimeDatepickValue[0],
  1889. endDate: this.WorktimeDatepickValue[1],
  1890. },
  1891. (res) => {
  1892. if (res.code == "ok") {
  1893. let url = res.data;
  1894. // console.log(res);
  1895. this.downloadByA("人员每日工时统计.xls", url);
  1896. }
  1897. },
  1898. (error) => {
  1899. this.$message({
  1900. message: error,
  1901. type: "error",
  1902. });
  1903. }
  1904. );
  1905. },
  1906. exportMembNotWorkHours() {
  1907. this.http.post(
  1908. "/report/exportNoReportUserList",
  1909. {
  1910. // month: this.date,
  1911. startDate: this.WorktimeDatepickValue[0],
  1912. endDate: this.WorktimeDatepickValue[1],
  1913. },
  1914. (res) => {
  1915. if (res.code == "ok") {
  1916. let url = res.data;
  1917. // console.log(res.data);
  1918. this.downloadByA("人员每日工时统计.xls", url);
  1919. // console.log(url);
  1920. }
  1921. },
  1922. (error) => {
  1923. this.$message({
  1924. message: error,
  1925. type: "error",
  1926. });
  1927. }
  1928. );
  1929. },
  1930. downloadByA(name, url) {
  1931. // console.log(name,url);
  1932. const a = document.createElement("a"); // 创建a标签
  1933. a.setAttribute("download", name); // download属性
  1934. a.setAttribute("href", url); // href链接
  1935. a.click(); // 自执行点击事件
  1936. a.remove();
  1937. },
  1938. // 是否本月判断
  1939. istoMonth(){
  1940. let todate = new Date()
  1941. let tomonth = todate.getMonth() + 1
  1942. let adate = todate.getFullYear() + '-' + (tomonth < 10 ? '0' + tomonth : tomonth)
  1943. if(this.date == adate){
  1944. return []
  1945. }else{
  1946. let sedate = new Date(this.date)
  1947. let semonth = sedate.getMonth() + 1
  1948. let seday = new Date(sedate.getFullYear(), semonth, 0).getDate()
  1949. let sedates1 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-01'
  1950. let sedates2 = sedate.getFullYear() + '-' + (semonth < 10 ? '0' + semonth : semonth) + '-' + seday
  1951. return [sedates1, sedates2]
  1952. }
  1953. },
  1954. showMonthWorkTime() {
  1955. this.monthTotalPage = 0,
  1956. this.tbload = true
  1957. this.http.post(
  1958. "/report/getUserDailyWorkTime",
  1959. // "/report/getNoReportUserList",
  1960. {
  1961. // month: this.date,
  1962. startDate: this.WorktimeDatepickValue[0],
  1963. endDate: this.WorktimeDatepickValue[1],
  1964. },
  1965. (res) => {
  1966. if (res.code == "ok") {
  1967. this.tbload = false;
  1968. this.pickDateArray = res.data.days;
  1969. // console.log('dataarray',res.data.days);
  1970. this.monthWorkData = res.data.list;
  1971. // this.monthWorkDataS = this.monthWorkData
  1972. // this.monthWorkDataS1 = res.data.list
  1973. this.monthTotal = res.data.list.length
  1974. if (this.monthWorkData.length > 50) {
  1975. this.monthWorkDataS = this.monthWorkData.slice(0,50);
  1976. }else{
  1977. this.monthWorkDataS = this.monthWorkData
  1978. }
  1979. this.searchScreen(0)
  1980. // this.monthWorkDataS = infoList
  1981. // 判断
  1982. // if (this.monthWorkDataS1.length > 0) {
  1983. // setTimeout(() => {
  1984. // this.tableListener()
  1985. // }, 1000);
  1986. // }
  1987. this.$nextTick(function(){
  1988. this.$refs.hasworkTbl.doLayout();
  1989. });
  1990. // this.$forceUpdate()
  1991. }
  1992. },
  1993. (error) => {
  1994. this.tbload = false
  1995. this.$message({
  1996. message: error,
  1997. type: "error",
  1998. });
  1999. }
  2000. );
  2001. },
  2002. // tableListener(){
  2003. // let that = this;
  2004. // let dom = that.$refs.hasworkTbl.bodyWrapper;
  2005. // // 添加scroll监听事件
  2006. // dom.addEventListener("scroll", function () {
  2007. // const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2008. // if (scrollDistance < 2) {
  2009. // if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
  2010. // that.monthTotalPage++; //当前页数自增
  2011. // console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
  2012. // var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
  2013. // var infoList = arrList.splice(
  2014. // that.monthTotalPage * that.monthTotalLages,
  2015. // that.monthTotalLages
  2016. // );
  2017. // // 数据添加
  2018. // that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
  2019. // }
  2020. // }
  2021. // })
  2022. // },
  2023. showMonthNotWorkTime() {
  2024. this.monthTotalPage = 0,
  2025. this.tbload = true
  2026. this.http.post(
  2027. "/report/getNoReportUserList",
  2028. {
  2029. startDate: this.WorktimeDatepickValue[0],
  2030. endDate: this.WorktimeDatepickValue[1],
  2031. },
  2032. (res) => {
  2033. if (res.code == "ok") {
  2034. this.tbload = false
  2035. this.monthNotWorkDate = res.data;
  2036. // this.monthNotWorkDateS1 = res.data
  2037. this.monthnotTotal = res.data.length
  2038. // 2222111
  2039. if (this.monthNotWorkDate.length > 50) {
  2040. this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
  2041. } else {
  2042. this.monthNotWorkDateS = this.monthNotWorkDate
  2043. }
  2044. this.searchScreen(1)
  2045. // 判断
  2046. // if (this.monthnotworkDateS1.length > 0) {
  2047. // setTimeout(() => {
  2048. // this.tableListenernot()
  2049. // }, 1000);
  2050. // }
  2051. this.$nextTick(function(){
  2052. this.$refs.hasworkTbl2.doLayout();
  2053. });
  2054. }
  2055. },
  2056. (error) => {
  2057. this.tbload = false
  2058. this.$message({
  2059. message: error,
  2060. type: "error",
  2061. });
  2062. }
  2063. );
  2064. },
  2065. // tableListenernot(){
  2066. // let that = this;
  2067. // let dom = that.$refs.hasworkTbl2.bodyWrapper;
  2068. // dom.addEventListener("scroll", function () {
  2069. // // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
  2070. // const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
  2071. // if (scrollDistance2 < 2) {
  2072. // if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
  2073. // that.monthnotTotalPage++; //当前页数自增
  2074. // var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
  2075. // var infoList = arrList.splice(
  2076. // that.monthnotTotalPage * that.monthnotTotalLages,
  2077. // that.monthnotTotalLages
  2078. // );
  2079. // that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
  2080. // }
  2081. // }
  2082. // })
  2083. // },
  2084. listScroll(){
  2085. if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
  2086. this.isMore = true
  2087. setTimeout(()=>{
  2088. this.isMore = false
  2089. },1000)
  2090. }else {
  2091. this.isFlag = true
  2092. let datalist = this.monthWorkDataS1.slice(0,this.monthWorkDataS.length + 50)
  2093. this.monthWorkDataS = datalist
  2094. setTimeout(()=>{
  2095. this.isFlag = false
  2096. },300)
  2097. }
  2098. },
  2099. notListScroll(){
  2100. if(this.monthNotWorkDateS.length == this.monthNotWorkDateS1.length){
  2101. this.isMore = true
  2102. setTimeout(()=>{
  2103. this.isMore = false
  2104. },1000)
  2105. }else {
  2106. this.isFlag = true
  2107. let datalist = this.monthNotWorkDateS1.slice(0,this.monthNotWorkDateS.length + 50)
  2108. this.monthNotWorkDateS = datalist
  2109. // console.log('length',this.monthNotWorkDateS.length)
  2110. setTimeout(()=>{
  2111. this.isFlag = false
  2112. },300)
  2113. }
  2114. },
  2115. // 获取默认这zhou日期参数 222
  2116. getLastWeek(e){
  2117. let newdate = new Date()
  2118. let lastdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 7))
  2119. let lastwd = [this.getAutoWeekDate(lastdate)[0],this.getAutoWeekDate(lastdate)[6]]
  2120. if(e){
  2121. this.WorktimeDatepickValue = lastwd
  2122. this.showMonthWorkTime()
  2123. }else{
  2124. this.WorktimeDatepickValue = lastwd
  2125. this.showMonthNotWorkTime()
  2126. }
  2127. },
  2128. getThisWeek(e){
  2129. let newdate = new Date();
  2130. let nowdate = newdate.toLocaleDateString();
  2131. let nowwd = [this.getAutoWeekDate(nowdate)[0],this.getAutoWeekDate(nowdate)[6]]
  2132. if(e){
  2133. this.WorktimeDatepickValue = nowwd
  2134. this.showMonthWorkTime()
  2135. }else{
  2136. this.WorktimeDatepickValue = nowwd
  2137. this.showMonthNotWorkTime()
  2138. }
  2139. },
  2140. getDoubleLastWeek(e){
  2141. let newdate = new Date()
  2142. let nextdate = newdate.toLocaleDateString(newdate.setDate(newdate.getDate() - 14))
  2143. let nextwd = [this.getAutoWeekDate(nextdate)[0],this.getAutoWeekDate(nextdate)[6]]
  2144. if(e){
  2145. this.WorktimeDatepickValue = nextwd
  2146. this.showMonthWorkTime()
  2147. }else{
  2148. this.WorktimeDatepickValue = nextwd
  2149. this.showMonthNotWorkTime()
  2150. }
  2151. },
  2152. alreadyAllDate(stime,etime){
  2153. let diffdate = new Array();
  2154. let i=0;
  2155. while(stime<=etime){
  2156. let dateArray = stime.split("-");
  2157. let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
  2158. let stimewk = "周" + "日一二三四五六".charAt(date.getDay());
  2159. let timedate = (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]) + "日"
  2160. 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])
  2161. diffdate[i] = {date:timedate,showDate:timeshowdate,weekDay:stimewk};
  2162. let stime_ts = new Date(stime).getTime();
  2163. let next_date = stime_ts + (24*60*60*1000);
  2164. let next_dates_y = new Date(next_date).getFullYear()+'-';
  2165. let next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  2166. let next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  2167. stime = next_dates_y+next_dates_m+next_dates_d;
  2168. i++;
  2169. }
  2170. return diffdate
  2171. },
  2172. getAutoWeekDate(e) {
  2173. let dateString = e;
  2174. let dateStringReg = /^\d{4}[/-]\d{1,2}[/-]\d{1,2}$/;
  2175. if (dateString.match(dateStringReg)) {
  2176. let presentDate = new Date(dateString),
  2177. today = presentDate.getDay() !== 0 ? presentDate.getDay() : 7;
  2178. return Array.from(new Array(7), function (val, index) {
  2179. let formatDate = new Date(
  2180. presentDate.getTime() - (today - index - 1) * 24 * 60 * 60 * 1000
  2181. );
  2182. return (
  2183. formatDate.getFullYear() +
  2184. "-" +
  2185. ((formatDate.getMonth() + 1) < 10 ? "0" + (formatDate.getMonth() + 1) : (formatDate.getMonth() + 1)) +
  2186. "-" +
  2187. (formatDate.getDate() < 10 ? "0" + formatDate.getDate() : formatDate.getDate())
  2188. );
  2189. });
  2190. } else {
  2191. throw new Error(
  2192. 'dateString should be like "yyyy-mm-dd" or "yyyy/mm/dd"'
  2193. );
  2194. }
  2195. },
  2196. onProgressChange() {
  2197. this.$forceUpdate();
  2198. },
  2199. showChooseMembTree() {
  2200. this.chosenMembCount = this.participator.length;
  2201. this.chooseParticipVisible = true;
  2202. },
  2203. onTreeItemChange() {
  2204. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2205. var list = chosenList.filter(item=>item.isUser == 1);
  2206. this.chosenMembCount = list.length;
  2207. },
  2208. findUserInTree() {
  2209. if (this.filterName == '') {
  2210. this.deptMembData = this.allMembData;
  2211. } else {
  2212. var list = this.findRecursively(this.filterName, this.allMembData);
  2213. this.deptMembData = list;
  2214. }
  2215. },
  2216. findRecursively(username, list) {
  2217. var filterList = [];
  2218. for (var i=0;i<list.length; i++) {
  2219. if (list[i].isUser == 1) {
  2220. if (list[i].label.indexOf(username) >= 0) {
  2221. //匹配上了
  2222. filterList.push(list[i]);
  2223. }
  2224. } else if (list[i].children != null && list[i].children.length > 0) {
  2225. var subList = this.findRecursively(username, list[i].children);
  2226. if (subList.length > 0) {
  2227. subList.forEach(s=>filterList.push(s));
  2228. }
  2229. }
  2230. }
  2231. return filterList;
  2232. },
  2233. //确定选择参与人
  2234. chooseParticip() {
  2235. this.chooseParticipVisible = false;
  2236. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  2237. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  2238. this.workForm.userNames = '';
  2239. this.workForm.userId = [];
  2240. this.participator = [];
  2241. for (var i=0;i<this.chosenMembList.length; i++) {
  2242. this.workForm.userId.push(this.chosenMembList[i].id);
  2243. this.workForm.userNames += this.chosenMembList[i].label+',';
  2244. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  2245. this.participator.push(item);
  2246. }
  2247. if (this.workForm.userNames.length > 0) {
  2248. this.workForm.userNames = this.workForm.userNames.substring(0, this.workForm.userNames.length-1);
  2249. }
  2250. },
  2251. //微信通知人员填写
  2252. weixinNotify() {
  2253. if (this.fillMembList.length == 0) return;
  2254. var ids = '';
  2255. this.fillMembList.forEach(f=>{
  2256. ids += f.id+',';
  2257. })
  2258. this.http.post('/user/pushFillReport',{
  2259. ids: ids, date: this.curDate
  2260. },
  2261. res => {
  2262. if (res.code == "ok") {
  2263. this.$message({
  2264. message: '已发送成功',
  2265. type: "success"
  2266. });
  2267. }
  2268. },
  2269. error => {
  2270. this.$message({
  2271. message: error,
  2272. type: "error"
  2273. });
  2274. }
  2275. );
  2276. },
  2277. //导出人员列表
  2278. exportMemb() {
  2279. if (this.fillMembList.length == 0) return;
  2280. var ids = '';
  2281. this.fillMembList.forEach(f=>{
  2282. ids += f.id+',';
  2283. })
  2284. this.http.post('/user/exportMembList',{
  2285. ids: ids,isFill: this.isFill, date: this.curDate
  2286. },
  2287. res => {
  2288. if (res.code == "ok") {
  2289. var aTag = document.createElement('a');
  2290. aTag.download = this.curDate+(this.isFill?"已填":"未填")+"人员列表.xls";
  2291. aTag.href = res.data;
  2292. aTag.click();
  2293. }
  2294. },
  2295. error => {
  2296. this.$message({
  2297. message: error,
  2298. type: "error"
  2299. });
  2300. }
  2301. );
  2302. },
  2303. showMembList(fill) {
  2304. this.membListVisible = true;
  2305. if (fill == 0) {
  2306. this.fillMembList = this.unFillList;
  2307. this.isFill = false;
  2308. } else {
  2309. this.fillMembList = this.fillList;
  2310. this.isFill = true;
  2311. }
  2312. },
  2313. //获取自己填写的日报状态
  2314. getReportFillStatus() {
  2315. this.http.post('/report/getReportFillStatus',{
  2316. startDate: this.date+"-01", endDate: this.date+"-31", userId: this.user.id
  2317. },
  2318. res => {
  2319. if (res.code == "ok") {
  2320. this.fillStatusList = res.data;
  2321. this.allDate.forEach(d=>{
  2322. var fillInfo = null;
  2323. d.state = null;
  2324. this.fillStatusList.forEach(s=>{
  2325. var d1 = s.createDate.split('-')[2];
  2326. var d2 = d.date.split('月')[1].split('日')[0];
  2327. if (d1.indexOf('0') == 0) {
  2328. d1 = d1.substring(1,d1.length);
  2329. }
  2330. if (d1 == d2) {
  2331. d.state = s.state;
  2332. }
  2333. })
  2334. })
  2335. this.$forceUpdate();
  2336. }
  2337. },
  2338. error => {
  2339. this.$message({
  2340. message: error,
  2341. type: "error"
  2342. });
  2343. }
  2344. );
  2345. },
  2346. scrollFunction () {
  2347. this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div
  2348. if (this.domObj.attachEvent) { // IE
  2349. this.domObj.attachEvent('onmousewheel', this.mouseScroll)
  2350. } else if (this.domObj.addEventListener) {
  2351. this.domObj.addEventListener('DOMMouseScroll', this.mouseScroll, false)
  2352. }
  2353. this.domObj.onmousewheel = this.domObj.onmousewheel = this.mouseScroll
  2354. },
  2355. mouseScroll(event) { // google 浏览器下
  2356. let detail = event.wheelDelta || event.detail
  2357. let moveForwardStep = -1
  2358. let moveBackStep = 1
  2359. let step = 0
  2360. step = detail > 0 ? moveForwardStep * 100 : moveBackStep * 100
  2361. event.preventDefault() // 阻止浏览器默认事件
  2362. this.domObj.scrollLeft = this.domObj.scrollLeft + step
  2363. },
  2364. // //左右滚动
  2365. // wheel(e){
  2366. // var a = document.getElementById("dateScroll");
  2367. // var scroll_width = 80; //滚动一下的距离
  2368. // var e = e || window.event, v;
  2369. // e.wheelDelta ? v=e.wheelDelta : v=e.detail;
  2370. // if(v>3||-v>3) v=-v;
  2371. // v>0 ? a.scrollLeft+=scroll_width : a.scrollLeft-=scroll_width;
  2372. // e.preventDefault(); //阻止浏览器的默认滚动
  2373. // },
  2374. showExportDialog() {
  2375. this.exportDialog = true;
  2376. },
  2377. showExportTimeDialog() {
  2378. this.exportTimeDialog = true;
  2379. },
  2380. changeAllTime() {
  2381. //总时长发生改变,自动按比例计算
  2382. this.workForm.domains.forEach(d=>{
  2383. d.workingTime = (d.progress*this.reportTimeType.allday/100).toFixed(1);
  2384. });
  2385. },
  2386. // 是否加班的单机事件
  2387. check() {
  2388. this.selected = !this.selected
  2389. this.isNew = this.selected
  2390. },
  2391. updateSubProject() {
  2392. this.$forceUpdate();
  2393. },
  2394. //项目选中了, 加载子项目
  2395. selectProject(domain, index) {
  2396. if(domain.projectId == ""){
  2397. return
  2398. }
  2399. this.http.post('/sub-project/list',{
  2400. projectId: domain.projectId
  2401. },
  2402. res => {
  2403. //清空之前选中的子项目
  2404. // this.workForm.domains[index].subProjectId = 0;
  2405. if (res.code == "ok") {
  2406. this.workForm.domains[index].subProjectList = res.data;
  2407. this.workForm.domains[index].subProjectId = null;
  2408. this.$forceUpdate();
  2409. }
  2410. },
  2411. error => {
  2412. this.$message({
  2413. message: error,
  2414. type: "error"
  2415. });
  2416. }
  2417. );
  2418. //项目相关的近期任务
  2419. if (this.user.company.packageProject == 1) {
  2420. this.http.post('/task/getRecentTask',{
  2421. projectId: domain.projectId,
  2422. isSubstitude:this.isSubstitude?1:0
  2423. },
  2424. res => {
  2425. if (res.code == "ok") {
  2426. this.workForm.domains[index].allTaskList = res.data;
  2427. this.workForm.domains[index].taskList = res.data;
  2428. this.$forceUpdate();
  2429. }
  2430. },
  2431. error => {
  2432. this.$message({
  2433. message: error,
  2434. type: "error"
  2435. });
  2436. }
  2437. );
  2438. }
  2439. //获取项目相关专业
  2440. if (this.user.company.packageEngineering == 1) {
  2441. this.getProjectProfessions(domain, index);
  2442. }
  2443. // 获取项目相关的维度
  2444. this.dimension(domain, index);
  2445. //获取项目下的任务分组
  2446. this.getTaskGroups(domain, index);
  2447. //获取项目审核人
  2448. var curProject = this.projectList.filter(p=>p.id == domain.projectId)[0];
  2449. if (curProject.taskGpIncharge == 0) {
  2450. this.getProjectAuditorList(domain, index);
  2451. } else {
  2452. //按分组的负责人来审核
  2453. domain.projectAuditorId = null;
  2454. domain.projectAuditorName = null;
  2455. domain.auditUserList = null;
  2456. }
  2457. // // this.$set(this.workForm.domains[index], "taskGpIncharge", curProject.taskGpIncharge);
  2458. domain.taskGpIncharge = curProject.taskGpIncharge;
  2459. // this.$forceUpdate();
  2460. },
  2461. //获取项目审核人
  2462. getProjectAuditorList(domainItem, index) {
  2463. if(domainItem.projectId == '') {
  2464. return
  2465. }
  2466. domainItem.projectAuditorId = null;
  2467. domainItem.projectAuditorName = null;
  2468. this.http.post('/project-auditor/getList',{
  2469. projectId: domainItem.projectId,
  2470. },
  2471. res => {
  2472. if (res.code == "ok") {
  2473. domainItem.auditUserList = res.data;
  2474. if (res.data.length==1) {
  2475. domainItem.projectAuditorId = domainItem.auditUserList[0].auditorId;
  2476. domainItem.projectAuditorName = domainItem.auditUserList[0].auditorName;
  2477. }
  2478. this.$forceUpdate();
  2479. }
  2480. },
  2481. error => {
  2482. this.$message({
  2483. message: error,
  2484. type: "error"
  2485. });
  2486. }
  2487. );
  2488. },
  2489. // 获取维度数据
  2490. dimension(domain, index) {
  2491. if(domain.projectId == '') {
  2492. return
  2493. }
  2494. this.http.post('/project/getDegreeList',{
  2495. projectId: domain.projectId,
  2496. },
  2497. res => {
  2498. if (res.code == "ok") {
  2499. // console.log("维度数据",res.data);
  2500. this.workForm.domains[index].wuduList = res.data
  2501. // this.workForm = this.workForm
  2502. this.$forceUpdate()
  2503. }
  2504. },
  2505. error => {
  2506. this.$message({
  2507. message: error,
  2508. type: "error"
  2509. });
  2510. }
  2511. );
  2512. },
  2513. //切换任务阶段
  2514. changeStages(domain, index) {
  2515. if (domain.stage == null || domain.stage == '') {
  2516. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList;
  2517. } else {
  2518. this.workForm.domains[index].taskList = this.workForm.domains[index].allTaskList.filter(t=>t.stagesName == domain.stage);
  2519. }
  2520. this.$forceUpdate();
  2521. },
  2522. getGroupStages(domain, index) {
  2523. this.http.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId},
  2524. res => {
  2525. if (res.code == "ok") {
  2526. domain.stage = '';
  2527. domain.stages = res.data;
  2528. this.$forceUpdate();
  2529. }
  2530. },
  2531. error => {
  2532. this.$message({
  2533. message: error,
  2534. type: "error"
  2535. });
  2536. });
  2537. //检查当前的项目是否需要获取分组的负责人
  2538. var curProject = this.projectList.filter(p=>p.id == domain.projectId)[0];
  2539. if (curProject.taskGpIncharge == 1) {
  2540. this.http.post("/task-group/getGroupIncharger", {groupId: domain.groupId},
  2541. res => {
  2542. if (res.code == "ok") {
  2543. domain.getProjectAuditorList = res.data;
  2544. domain.auditUserList = res.data;
  2545. if (res.data.length==1) {
  2546. domain.projectAuditorId = domain.auditUserList[0].auditorId;
  2547. domain.projectAuditorName = domain.auditUserList[0].auditorName;
  2548. }
  2549. this.$forceUpdate();
  2550. }
  2551. },
  2552. error => {
  2553. this.$message({
  2554. message: error,
  2555. type: "error"
  2556. });
  2557. });
  2558. }
  2559. },
  2560. getProjectProfessions(domain, index) {
  2561. this.http.post("/project-profession/getMyProfession", {projectId: domain.projectId},
  2562. res => {
  2563. if (res.code == "ok") {
  2564. this.workForm.domains[index].professionProgress = res.data;
  2565. this.$forceUpdate();
  2566. }
  2567. },
  2568. error => {
  2569. this.$message({
  2570. message: error,
  2571. type: "error"
  2572. });
  2573. });
  2574. },
  2575. //删除自己的日报
  2576. deleteReport() {
  2577. this.$confirm("确定要删除该日报吗?","提示", {
  2578. confirmButtonText: "确定",
  2579. cancelButtonText: "取消",
  2580. type: "warning"
  2581. })
  2582. .then(() => {
  2583. this.listLoading = true;
  2584. this.http.post('/report/delete',{
  2585. userId: this.user.id,
  2586. date: this.workForm.createDate
  2587. },
  2588. res => {
  2589. this.listLoading = false;
  2590. if (res.code == "ok") {
  2591. this.$message({
  2592. message: "删除成功",
  2593. type: "success"
  2594. });
  2595. this.getReportList();
  2596. this.getDepartment();
  2597. this.dialogVisible = false;
  2598. } else {
  2599. this.$message({
  2600. message: res.msg,
  2601. type: "error"
  2602. });
  2603. }
  2604. },
  2605. error => {
  2606. this.listLoading = false;
  2607. this.$message({
  2608. message: error,
  2609. type: "error"
  2610. });
  2611. }
  2612. );
  2613. })
  2614. .catch(() => {});
  2615. },
  2616. // 管理员删除日报
  2617. guanli(item) {
  2618. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2619. let param = {date: this.date + day, userId: item.id};
  2620. this.$confirm("确定要删除该日报吗?","提示", {
  2621. confirmButtonText: "确定",
  2622. cancelButtonText: "取消",
  2623. type: "warning"
  2624. })
  2625. .then(() => {
  2626. this.listLoading = true;
  2627. this.http.post('/report/delete',param,
  2628. res => {
  2629. this.listLoading = false;
  2630. if (res.code == "ok") {
  2631. this.$message({
  2632. message: "删除成功",
  2633. type: "success"
  2634. });
  2635. this.getReportList();
  2636. this.getDepartment();
  2637. this.dialogVisible = false;
  2638. } else {
  2639. this.$message({
  2640. message: res.msg,
  2641. type: "error"
  2642. });
  2643. }
  2644. },
  2645. error => {
  2646. this.listLoading = false;
  2647. this.$message({
  2648. message: error,
  2649. type: "error"
  2650. });
  2651. }
  2652. );
  2653. })
  2654. .catch(() => {});
  2655. },
  2656. //提交批量审核数据
  2657. submitBatchApprove() {
  2658. var data = this.$refs.approveTree.getCheckedNodes();
  2659. var ids = '';
  2660. if (data.length == 0) {
  2661. this.$message({
  2662. message: '请选择要审核的人员',
  2663. type: "error"
  2664. });
  2665. return;
  2666. }
  2667. for (var i=0;i<data.length; i++) {
  2668. ids += data[i].id;
  2669. if (i < data.length-1) {
  2670. ids += ',';
  2671. }
  2672. }
  2673. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2674. this.http.post("/report/batchApproveReport", {ids:ids, date:this.date + day},
  2675. res => {
  2676. if (res.code == "ok") {
  2677. this.$message({
  2678. message: '审核成功',
  2679. type: "success"
  2680. });
  2681. this.getReportList();
  2682. this.getDepartment();
  2683. this.approveDialogVisible = false;
  2684. } else {
  2685. this.$message({
  2686. message: res.msg,
  2687. type: "error"
  2688. });
  2689. }
  2690. },
  2691. error => {
  2692. this.$message({
  2693. message: error,
  2694. type: "error"
  2695. });
  2696. });
  2697. },
  2698. selectAll() {
  2699. if (this.isAllSelect) {
  2700. var keys = [];
  2701. this.reportNames.forEach(b=>{
  2702. keys.push(b.id);
  2703. })
  2704. this.$refs.approveTree.setCheckedKeys(keys);
  2705. } else {
  2706. this.$refs.approveTree.setCheckedKeys([]);
  2707. }
  2708. },
  2709. //批量审核
  2710. batchApprove() {
  2711. this.approveDialogVisible = true;
  2712. this.reportNames = [];
  2713. for (var i=0;i<this.reportList.length; i++) {
  2714. var report = this.reportList[i];
  2715. var hasUnChecked =false;
  2716. var id = '';
  2717. for (var j=0;j<report.data.length; j++) {
  2718. if (report.data[j].state == 0
  2719. && (this.user.company.packageEngineering==0 || (this.user.company.packageEngineering==1 && report.data[j].departmentAuditState == 1))
  2720. && (permissions.projectReportReview || report.data[j].projectAuditorId == this.user.id)) {
  2721. hasUnChecked = true;
  2722. id += report.data[j].id+',';
  2723. }
  2724. }
  2725. if (hasUnChecked) {
  2726. this.reportNames.push({id:id, label: report.name});
  2727. }
  2728. }
  2729. },
  2730. removeEmptyNode(list) {
  2731. for (var i=0;i<list.length;i++) {
  2732. var cnt = 0;
  2733. if (list[i].membCount == 0) {
  2734. list.splice(i, 1);
  2735. i--;
  2736. } else if (list[i].children != null) {
  2737. this.removeEmptyNode(list[i].children);
  2738. }
  2739. }
  2740. },
  2741. calculateMembCount(list) {
  2742. for (var i in list) {
  2743. var cnt = 0;
  2744. if (list[i].children != null) {
  2745. this.calculateMembCount(list[i].children);
  2746. for (var m in list[i].children) {
  2747. cnt += list[i].children[m].membCount;
  2748. }
  2749. }
  2750. if (list[i].isUser == 1) {
  2751. cnt++;
  2752. this.membCount++;
  2753. }
  2754. list[i].membCount = cnt;
  2755. }
  2756. },
  2757. stateChange() {
  2758. this.membCount = 0;
  2759. if (this.selectState == -1) {
  2760. //全部状态
  2761. this.data = this.allData;
  2762. } else {
  2763. //未填报
  2764. var newData = JSON.parse(JSON.stringify(this.allData));
  2765. this.filterState(this.selectState, newData);
  2766. this.data = newData;
  2767. }
  2768. this.calculateMembCount(this.data);
  2769. this.data[0].membCount = this.membCount;//总人数
  2770. },
  2771. //按状态过滤部门人员
  2772. filterState(state, list) {
  2773. for (var i =0;i<list.length; i++) {
  2774. var obj = list[i];
  2775. if (obj.isUser == 1) {
  2776. var match = false;
  2777. if (state == -2) {
  2778. if (obj.state == null) {
  2779. match = true;
  2780. }
  2781. } else {
  2782. if (obj.state == state) {
  2783. match = true;
  2784. }
  2785. }
  2786. if (!match) {
  2787. list.splice(i, 1);
  2788. i--;
  2789. } else {
  2790. }
  2791. } else {
  2792. if (obj.children != null) {
  2793. this.filterState(state, obj.children);
  2794. }
  2795. }
  2796. }
  2797. },
  2798. // 部门列表点击
  2799. handleNodeClick(data) {
  2800. // this.dealList = data
  2801. this.theValues(data.id, this.allData)
  2802. // this.depData = data;
  2803. var list = [];
  2804. if (data.id == -1) {
  2805. this.deptId = null;
  2806. this.targetUid = null;
  2807. list = this.data;
  2808. } else if (data.isUser == 1) {
  2809. this.deptId = null;
  2810. this.targetUid = data.id;
  2811. } else {
  2812. this.deptId = data.id;
  2813. this.targetUid = null;
  2814. list.push(data);
  2815. }
  2816. this.getReportList();
  2817. if (list.length > 0) {
  2818. this.unFillList = this.getUserMembListFromDeptList(list, 0);
  2819. this.fillList = this.getUserMembListFromDeptList(list, 1)
  2820. }
  2821. // console.log(this.depData.isUser)
  2822. // console.log(this.depData.membCount)
  2823. // console.log(this.depData)
  2824. },
  2825. theValues(id, item) {
  2826. for(var i in item) {
  2827. if(item[i].id == id) {
  2828. this.depData = item[i]
  2829. return
  2830. } else {
  2831. if(item[i].children) {
  2832. this.theValues(id, item[i].children)
  2833. }
  2834. }
  2835. }
  2836. },
  2837. //获取可以选择的代填的人员列表
  2838. getSubstitudeUserDeptList() {
  2839. if (this.deptMembData.length == 0) {
  2840. this.http.post("/department/listMyMembs", {},
  2841. res => {
  2842. if (res.code == "ok") {
  2843. let noAllData = JSON.parse(JSON.stringify(res.data));
  2844. if (noAllData.length > 0) {
  2845. if (noAllData[0].label == '全部人员') {
  2846. noAllData.splice(0,1);
  2847. }
  2848. }
  2849. this.setUserToDept(noAllData);
  2850. this.deptMembData = noAllData;
  2851. } else {
  2852. this.$message({
  2853. message: res.msg,
  2854. type: "error"
  2855. });
  2856. }
  2857. },
  2858. error => {
  2859. this.$message({
  2860. message: error,
  2861. type: "error"
  2862. });
  2863. });
  2864. }
  2865. },
  2866. // 获取部门列表
  2867. getDepartment() {
  2868. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  2869. var param = {date:this.date + day};
  2870. if (this.user.manageDeptId != 0 && !this.permissions.reportsCompany) {
  2871. param.manageDeptId = this.user.manageDeptId;
  2872. }
  2873. this.http.post("/report/getMembList", param,
  2874. res => {
  2875. if (res.code == "ok") {
  2876. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  2877. // let noAllData = JSON.parse(JSON.stringify(res.data));
  2878. // if (this.user.role > 0) {
  2879. // }
  2880. list.splice(0,0,{
  2881. id: -1,
  2882. label: '全部人员',
  2883. })
  2884. this.membCount = 0;
  2885. //设置员工到部门下面
  2886. this.setUserToDept(list);
  2887. this.data = list;
  2888. this.allData = list;
  2889. // if (noAllData.length > 0) {
  2890. // if (noAllData[0].label == '全部人员') {
  2891. // noAllData.splice(0,1);
  2892. // }
  2893. // }
  2894. // this.setUserToDept(noAllData);
  2895. // this.deptMembData = noAllData;
  2896. this.option = this.changeArr(list1);
  2897. list[0].membCount = this.membCount;
  2898. if (this.depData.id == -1) {
  2899. this.depData.membCount = this.membCount;
  2900. this.unFillList = this.getUserMembListFromDeptList(this.data, 0);
  2901. this.fillList = this.getUserMembListFromDeptList(this.data, 1);
  2902. } else {
  2903. if (this.depData.isUser == null) {
  2904. var dep = this.findTargetDept(this.data, this.depData.id);
  2905. var membDeptList = [];
  2906. membDeptList.push(dep);
  2907. this.unFillList = this.getUserMembListFromDeptList(membDeptList, 0);
  2908. this.fillList = this.getUserMembListFromDeptList(membDeptList, 1);
  2909. }
  2910. }
  2911. if (this.depData.isUser == null) {
  2912. if (this.isFill) {
  2913. this.fillMembList = this.fillList;
  2914. } else {
  2915. this.fillMembList = this.unFillList;
  2916. }
  2917. }
  2918. this.stateChange()
  2919. } else {
  2920. this.$message({
  2921. message: res.msg,
  2922. type: "error"
  2923. });
  2924. }
  2925. },
  2926. error => {
  2927. this.$message({
  2928. message: error,
  2929. type: "error"
  2930. });
  2931. });
  2932. this.getReportFillStatus();
  2933. },
  2934. findTargetDept(list, deptId) {
  2935. var t = null;
  2936. for (var i=0;i<list.length; i++) {
  2937. if (list[i].isUser == null && list[i].id == deptId) {
  2938. t = list[i];
  2939. break;
  2940. }
  2941. }
  2942. if (t == null) {
  2943. for (var i=0;i<list.length; i++) {
  2944. if (list[i].children != null && list[i].children.length > 0) {
  2945. t = this.findTargetDept(list[i].children, deptId);
  2946. if (t != null) {
  2947. break;
  2948. }
  2949. }
  2950. }
  2951. }
  2952. return t;
  2953. },
  2954. getUserMembListFromDeptList(list, isFill) {
  2955. var membList = [];
  2956. for (var i in list) {
  2957. var deptName = list[i].label;
  2958. if (list[i].userList != null) {
  2959. list[i].userList.forEach(element => {
  2960. if (isFill == 0) {
  2961. //获取未填的
  2962. if (element.state == null) {
  2963. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
  2964. membList.push(obj);
  2965. }
  2966. } else {
  2967. if (element.state != null) {
  2968. var obj = {id: element.id, label:element.name, deptId:element.departmentId, deptName: deptName};
  2969. membList.push(obj);
  2970. }
  2971. }
  2972. });
  2973. }
  2974. if (list[i].children != null) {
  2975. membList = membList.concat(this.getUserMembListFromDeptList(list[i].children, isFill));
  2976. }
  2977. }
  2978. return membList;
  2979. },
  2980. setUserToDept(list) {
  2981. for (var i in list) {
  2982. var cnt = 0;
  2983. if (list[i].children != null) {
  2984. this.setUserToDept(list[i].children);
  2985. for (var m in list[i].children) {
  2986. cnt += list[i].children[m].membCount;
  2987. }
  2988. }
  2989. if (list[i].userList != null) {
  2990. if (list[i].children == null) {
  2991. list[i].children = [];
  2992. }
  2993. list[i].userList.forEach(element => {
  2994. var obj = {id: element.id, label:element.name, state:element.state, parentId:element.departmentId, isUser:1};
  2995. list[i].children.push(obj);
  2996. this.membCount++;
  2997. cnt++;
  2998. });
  2999. }
  3000. list[i].membCount = cnt;
  3001. }
  3002. },
  3003. // 修改数组
  3004. changeArr(arr) {
  3005. for (var i = 0; i < arr.length; i++) {
  3006. if(arr[i].id != -1 && arr[i].id != 0) {
  3007. if (arr[i].children != null && arr[i].children.length>0) {
  3008. arr[i].children = this.changeArr(arr[i].children);
  3009. }
  3010. arr[i].id && (arr[i].value = arr[i].id);
  3011. delete arr[i].id;
  3012. }
  3013. }
  3014. for(var i in arr) {
  3015. if(arr[i].id == -1 || arr[i].id == 0) {
  3016. arr.splice(i,1)
  3017. }
  3018. }
  3019. return arr;
  3020. },
  3021. //时间段范围设置改动,监听
  3022. onTimeTypeChange(timeType) {
  3023. this.seleChn(1)
  3024. this.showAddMore = true;
  3025. for(var i in this.workForm.domains) {
  3026. if (this.workForm.domains[i].timeType == 0) {
  3027. this.showAddMore = false;
  3028. break;
  3029. }
  3030. }
  3031. if (this.showAddMore) {
  3032. //检测数量
  3033. if (this.workForm.domains.length == 2) {
  3034. this.showAddMore = false;
  3035. } else {
  3036. this.showAddMore = true;
  3037. }
  3038. }
  3039. },
  3040. getTimeType() {
  3041. this.http.post('/time-type/getCompanyTimeSetting', { companyId: this.user.companyId},
  3042. res => {
  3043. if (res.code == "ok") {
  3044. var t = res.data;
  3045. this.reportTimeType = t;
  3046. if (this.reportTimeType.type > 0) {
  3047. this.showAddMore = true;
  3048. }
  3049. //转化时间格式
  3050. if (t.allday != null) {
  3051. this.timeType.push({value:0, label:'全天 - '+t.allday+'小时', hours:t.allday});
  3052. }
  3053. if (t.am != null) {
  3054. this.timeType.push({value:1, label:'上午 - '+t.am+'小时', hours: t.am});
  3055. }
  3056. if (t.pm != null) {
  3057. this.timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
  3058. }
  3059. } else {
  3060. this.$message({
  3061. message: res.msg,
  3062. type: "error"
  3063. });
  3064. }
  3065. },
  3066. error => {
  3067. this.listLoading = false;
  3068. this.$message({
  3069. message: error,
  3070. type: "error"
  3071. });
  3072. });
  3073. },
  3074. // 改变月份 -------
  3075. changeMonthOut() {
  3076. this.getAllDate();
  3077. this.getReportList();
  3078. this.getDepartment();
  3079. },
  3080. // 选择日期
  3081. choseDate(i, item) {
  3082. if(this.canClick(i,item) == false){
  3083. return
  3084. }
  3085. // console.log(nowDateYear,nowDateMonth,nowDateDay,'..',itemYear,itemMonth,itemDay);
  3086. this.choseDay = i;
  3087. let day = (this.choseDay +1)> 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3088. sessionStorage.msg = this.date + day,
  3089. this.getReportList();
  3090. this.getDepartment();
  3091. this.curDate = item.date;
  3092. },
  3093. canClick(i, item){
  3094. let nowDate = new Date()
  3095. let nowDateYear = nowDate.getFullYear()
  3096. let itemYear = parseInt(this.date.split('-')[0])
  3097. let nowDateMonth = nowDate.getMonth() + 1
  3098. let itemMonth = parseInt(this.date.split('-')[1])
  3099. let nowDateDay = nowDate.getDate()
  3100. let itemDay = parseInt(item.showDate.split('.')[1])
  3101. if(nowDateYear < itemYear){
  3102. return false
  3103. }else if(nowDateYear == itemYear){
  3104. if(nowDateMonth < itemMonth){
  3105. return false
  3106. }else if(nowDateMonth == itemMonth){
  3107. if(nowDateDay < itemDay){
  3108. return false
  3109. }
  3110. }
  3111. }
  3112. },
  3113. // 获取日期列表
  3114. getAllDate() {
  3115. var dayArry = [];
  3116. var day = this.getCountDays();
  3117. let curMonthDay = null;
  3118. for (var k = 1; k <= day; k++) {
  3119. var str = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1 + "月" + k+'日';
  3120. var showStr = new Date(this.date.replace(/-/g, "/")+'/01').getMonth() + 1+'.'+k;
  3121. if ( new Date(this.date.replace(/-/g, "/")+'/01').getFullYear() == new Date(new Date()).getFullYear() &&
  3122. new Date(this.date.replace(/-/g, "/")+'/01').getMonth() == new Date(new Date()).getMonth()) {
  3123. if(sessionStorage.msg) {
  3124. if(parseInt(sessionStorage.msg.split("-")[2]) == k) {
  3125. this.choseDay = k - 1;
  3126. curMonthDay = str;
  3127. }
  3128. } else {
  3129. if (new Date().getDate() == k) {
  3130. this.choseDay = k - 1;
  3131. }
  3132. }
  3133. } else {
  3134. this.choseDay = 0;
  3135. }
  3136. var curDateStr = (this.date +'-'+ (k<10?('0'+k):k));
  3137. var curDateTime = util.formatDate.parse(curDateStr, 'yyyy-MM-dd');
  3138. dayArry.push({date:str, weekDay:this.weekDay[curDateTime.getDay()], showDate:showStr});
  3139. }
  3140. this.allDate = dayArry;
  3141. //不能超过最大日期
  3142. if (this.choseDay > day-1) {
  3143. this.choseDay = day-1;
  3144. }
  3145. //从消息点击跳转过来的,直接加载指定日期
  3146. if (sessionStorage.from == 1 && sessionStorage.msg) {
  3147. this.curDate = sessionStorage.msg;
  3148. sessionStorage.from = 0;
  3149. } else {
  3150. if (curMonthDay != null) {
  3151. this.curDate = curMonthDay;
  3152. } else {
  3153. var d = new Date(this.date.replace(/-/g, "/")+'/01')
  3154. this.curDate = (d.getMonth()+1)+'月'+d.getDate()+'日';
  3155. }
  3156. }
  3157. this.getReportFillStatus();
  3158. },
  3159. getCountDays() {
  3160. var newstr = this.date.replace(/-/g, "/");
  3161. var curDate = new Date(newstr+'/01');
  3162. var curMonth = curDate.getMonth();
  3163. curDate.setMonth(curMonth + 1);
  3164. curDate.setDate(0);
  3165. return curDate.getDate();
  3166. },
  3167. //获取日报列表
  3168. getReportList() {
  3169. this.listLoading = true;
  3170. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3171. let param = {date: this.date + day};
  3172. if (this.deptId != null) {
  3173. param.deptId = this.deptId;
  3174. }
  3175. if (this.targetUid != null) {
  3176. param.userId = this.targetUid;
  3177. }
  3178. this.http.post( this.port.report.list, param,
  3179. res => {
  3180. this.listLoading = false;
  3181. if (res.code == "ok") {
  3182. this.reportList = res.data;
  3183. document.querySelector("#day"+this.choseDay).scrollIntoView(true);
  3184. // this.dealWith()
  3185. } else {
  3186. this.$message({
  3187. message: res.msg,
  3188. type: "error"
  3189. });
  3190. }
  3191. },
  3192. error => {
  3193. this.listLoading = false;
  3194. this.$message({
  3195. message: error,
  3196. type: "error"
  3197. });
  3198. });
  3199. },
  3200. // 处理数据
  3201. // dealWith() {
  3202. // var tianxie = 0
  3203. // var weixtianxie = 0
  3204. // if(this.selectState == -1) {
  3205. // } else {
  3206. // var arr = []
  3207. // for (var i in this.reportList) {
  3208. // arr.push(this.reportList[i].id)
  3209. // }
  3210. // this.getDealWith(this.dealList.children, tianxie, weixtianxie, arr)
  3211. // }
  3212. // },
  3213. // getDealWith(item, tx, wtx, arr) {
  3214. // // console.log(item,12345)
  3215. // for(var i in item) {
  3216. // if(item[i].children) {
  3217. // this.getDealWith(item[i].children, tx, wtx, arr)
  3218. // } else {
  3219. // console.log(arr.indexOf(item[i].id))
  3220. // console.log(arr)
  3221. // console.log(item[i].id)
  3222. // if(arr.indexOf(item[i].id) != '-1') {
  3223. // tx = +tx + 1
  3224. // }
  3225. // }
  3226. // }
  3227. // console.log(tx, '看看值')
  3228. // },
  3229. //导出员工工时统计
  3230. exportUserTime() {
  3231. this.listLoading = true;
  3232. var param = {};
  3233. if (this.exportParam.dateRange != null) {
  3234. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3235. }
  3236. this.http.post('/department/exportDeptStatistic', param,
  3237. res => {
  3238. this.listLoading = false;
  3239. if (res.code == "ok") {
  3240. location.href = res.data;
  3241. this.exportTimeDialog = false;
  3242. } else {
  3243. this.$message({
  3244. message: res.msg,
  3245. type: "error"
  3246. });
  3247. }
  3248. },
  3249. error => {
  3250. this.listLoading = false;
  3251. this.$message({
  3252. message: error,
  3253. type: "error"
  3254. });
  3255. });
  3256. },
  3257. //导出日报
  3258. exportReport() {
  3259. this.listLoading = true;
  3260. var param = {};
  3261. if (this.exportParam.dateRange != null) {
  3262. param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
  3263. }
  3264. if (this.exportParam.projectId != null) {
  3265. param.projectId = this.exportParam.projectId;
  3266. }
  3267. param.stateKey = this.stateKey
  3268. this.http.post( this.port.report.export, param,
  3269. res => {
  3270. this.listLoading = false;
  3271. if (res.code == "ok") {
  3272. location.href = res.data;
  3273. this.exportDialog = false;
  3274. } else {
  3275. this.$message({
  3276. message: res.msg,
  3277. type: "error"
  3278. });
  3279. }
  3280. },
  3281. error => {
  3282. this.listLoading = false;
  3283. this.$message({
  3284. message: error,
  3285. type: "error"
  3286. });
  3287. });
  3288. },
  3289. //获取项目列表
  3290. getProjectList() {
  3291. this.listLoading = true;
  3292. this.http.post( this.port.project.list, {},
  3293. res => {
  3294. this.listLoading = false;
  3295. if (res.code == "ok") {
  3296. for(var i in res.data) {
  3297. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3298. res.data[i].projectCode = ''
  3299. }
  3300. }
  3301. this.projectList = res.data;
  3302. // console.log("项目列表",this.projectList);
  3303. } else {
  3304. this.$message({
  3305. message: res.msg,
  3306. type: "error"
  3307. });
  3308. }
  3309. },
  3310. error => {
  3311. this.listLoading = false;
  3312. this.$message({
  3313. message: error,
  3314. type: "error"
  3315. });
  3316. });
  3317. },
  3318. // 获取填报日报的项目下拉列表
  3319. getFillProjectList() {
  3320. this.http.post( this.port.project.list, {
  3321. forReport: 1
  3322. },res => {
  3323. if (res.code == "ok") {
  3324. for(var i in res.data) {
  3325. if(res.data[i].projectCode == null || res.data[i].projectCode == 'null') {
  3326. res.data[i].projectCode = ''
  3327. }
  3328. }
  3329. this.fillProjectList = res.data;
  3330. } else {
  3331. this.$message({
  3332. message: res.msg,
  3333. type: "error"
  3334. });
  3335. }
  3336. },
  3337. error => {
  3338. this.$message({
  3339. message: error,
  3340. type: "error"
  3341. });
  3342. });
  3343. },
  3344. getBasecostItemList() {
  3345. this.http.post('/project-basecost-setting/getReportBasecostList', {
  3346. companyId: this.user.companyId
  3347. },
  3348. res => {
  3349. if (res.code == "ok") {
  3350. this.timeBasecostList = res.data;
  3351. }
  3352. });
  3353. },
  3354. // 获取个人某天的日报
  3355. getReport() {
  3356. this.http.post( this.port.report.getPort, {
  3357. date: this.workForm.createDate
  3358. },
  3359. res => {
  3360. if (res.code == "ok") {
  3361. var quanbu = 0
  3362. this.jsDay = 1
  3363. var zhi = ''
  3364. var slp = res.data.report
  3365. for(var i in slp) {
  3366. var sp = +slp[i].workingTime + 0
  3367. zhi = this.jsDay * sp
  3368. quanbu = +quanbu + zhi
  3369. }
  3370. this.jsTime = quanbu
  3371. var list = res.data;
  3372. this.report = list;
  3373. if(list.report.length != 0) {
  3374. var arr = [];
  3375. this.canEdit = false;
  3376. for(var i in list.report) {
  3377. var flg = null
  3378. list.report[i].isOvertime == 1 ? flg = true : flg = false
  3379. arr.push({
  3380. id: list.report[i].id,
  3381. projectId: list.report[i].projectId,
  3382. workingTime: list.report[i].workingTime,
  3383. content: list.report[i].content,
  3384. state: list.report[i].state,
  3385. timeType: list.report[i].timeType,
  3386. subProjectList: list.report[i].subProjectList,
  3387. taskList: list.report[i].taskList,
  3388. subProjectId: list.report[i].subProjectId == 0?null:list.report[i].subProjectId,
  3389. groupId: list.report[i].groupId == 0?null:list.report[i].groupId,
  3390. taskId: list.report[i].taskId,
  3391. // startTime: `Fri May 16 2021 ${list.report[i].startTime}:12 GMT+0800 (中国标准时间)`,
  3392. startTime: list.report[i].startTime,
  3393. // endTime: `Fri May 16 2021 ${list.report[i].endTime}:12 GMT+0800 (中国标准时间)`,
  3394. endTime: list.report[i].endTime,
  3395. isOvertime: flg,
  3396. progress:list.report[i].progress,
  3397. professionProgress: list.report[i].professionProgressList,
  3398. stages:list.report[i].stages,
  3399. stage:list.report[i].stage == '-'?null:list.report[i].stage,
  3400. pics: list.report[i].pics,
  3401. multiWorktime: list.report[i].multiWorktime,
  3402. worktimeList: list.report[i].worktimeList,
  3403. degreeId: list.report[i].degreeId==-1?null:list.report[i].degreeId,
  3404. wuduList: list.report[i].degreeList,
  3405. taskGroups:list.report[i].taskGroups,
  3406. customData: list.report[i].customData,//自定义的数值
  3407. auditUserList: list.report[i].auditUserList,
  3408. projectAuditorId: list.report[i].projectAuditorId,
  3409. projectAuditorName: list.report[i].projectAuditorName,
  3410. overtimeHours: list.report[i].overtimeHours,
  3411. customText: list.report[i].customText,
  3412. basecostId: list.report[i].basecostId,
  3413. })
  3414. if (list.report[i].state >= 2) {
  3415. this.canEdit = true;
  3416. }
  3417. }
  3418. this.workForm = {
  3419. createDate: this.workForm.createDate,
  3420. domains: arr,
  3421. userNames:null,
  3422. userId:null,
  3423. time: list.time
  3424. }
  3425. } else {
  3426. this.workForm = {
  3427. createDate: this.workForm.createDate,
  3428. domains: [{
  3429. id: null,
  3430. projectId: "",
  3431. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3432. content: "",
  3433. progress:100,
  3434. state: 2,
  3435. timeType:0,
  3436. multiWorktime: this.reportTimeType.multiWorktime,
  3437. worktimeList:[{}],
  3438. taskGpIncharge:1,
  3439. }],
  3440. userId:null,
  3441. userNames:null,
  3442. time: this.report.time
  3443. }
  3444. if(this.user.timeType.type == 1) {
  3445. this.workForm.domains[0].workingTime = this.user.timeType.allday+'.0'
  3446. }
  3447. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  3448. //默认给第一个,必填字段
  3449. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  3450. }
  3451. this.canEdit = true;
  3452. }
  3453. } else {
  3454. this.$message({
  3455. message: res.msg,
  3456. type: "error"
  3457. });
  3458. }
  3459. },
  3460. error => {
  3461. this.$message({
  3462. message: error,
  3463. type: "error"
  3464. });
  3465. });
  3466. },
  3467. guanbi() {
  3468. this.falsss = false
  3469. },
  3470. // wuduLists(id) {
  3471. // this.http.post('/project/getDegreeList',{
  3472. // projectId: id,
  3473. // },
  3474. // res => {
  3475. // if (res.code == "ok") {
  3476. // return res.data
  3477. // }
  3478. // },
  3479. // error => {
  3480. // this.$message({
  3481. // message: error,
  3482. // type: "error"
  3483. // });
  3484. // }
  3485. // );
  3486. // },
  3487. // 打开日报填写
  3488. fillInReport(i, isBatch) {
  3489. // console.log(this.user.timeType.type, '选择时长')
  3490. if(i != 1) {
  3491. this.falsss = false
  3492. } else {
  3493. this.falsss = true
  3494. }
  3495. if (this.isSubstitude) {
  3496. this.getSubstitudeUserDeptList();
  3497. }
  3498. if(i == -1 || this.isSubstitude) {
  3499. this.isDisable = false;
  3500. } else {
  3501. this.isDisable = true;
  3502. }
  3503. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  3504. this.isBatch = isBatch;
  3505. if (this.isBatch == 0 && !this.isSubstitude) {
  3506. this.workForm.createDate = this.date + day; // 获取个人某天的日报
  3507. this.getReport(i);
  3508. } else {
  3509. // console.log('执行到了这里')
  3510. this.jsTime = 0
  3511. this.jsDay = 0
  3512. this.workForm = {
  3513. createDate: null,//批量填报没有日期
  3514. domains: [{
  3515. id: null,
  3516. projectId: "",
  3517. workingTime: this.reportTimeType.type==3?(this.reportTimeType.allday).toFixed(1):"",
  3518. content: "",
  3519. progress:100,
  3520. state: 2,
  3521. timeType:0,
  3522. multiWorktime: this.reportTimeType.multiWorktime,
  3523. worktimeList:[{}],
  3524. }],
  3525. }
  3526. if(this.user.timeType.type == 1) {
  3527. this.workForm.domains[0].workingTime = this.user.timeType.allday+'.0'
  3528. }
  3529. // console.log(this.workForm)
  3530. if (this.timeBasecostList&&this.timeBasecostList.length>0) {
  3531. this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
  3532. }
  3533. this.canEdit = true;
  3534. }
  3535. this.dialogVisible = true;
  3536. },
  3537. // 按周填报里内容的填写
  3538. tianxies(item, i, names, row) {
  3539. // console.log(item, i, names, row[0], '你好')
  3540. var idd = ''
  3541. var obj = {}
  3542. for(var l in this.projectList) {
  3543. if(this.projectList[l].projectName == names) idd = this.projectList[l].id
  3544. }
  3545. obj.projectId = idd
  3546. this.selectProject(obj, 0)
  3547. // console.log(this.workForm.domains[0], '打印出来的')
  3548. this.tianxieDialogVisible = true
  3549. this.scopess = item
  3550. var sss = {}
  3551. sss.projectId = idd;
  3552. sss.con = item.con
  3553. sss.progress = item.progress
  3554. sss.time = item.time
  3555. sss.workingTime = item.workingTime
  3556. sss.projectAuditorId = item.projectAuditorId;
  3557. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  3558. //默认选中第一个
  3559. sss.basecostId = this.timeBasecostList[0].id;
  3560. }
  3561. var that = this
  3562. setTimeout(() =>{
  3563. if(Object.keys(item).length < 5) {
  3564. // console.log(456)
  3565. sss.subProjectId = that.workForm.domains[0].subProjectId
  3566. sss.stage = that.workForm.domains[0].stage
  3567. sss.subProjectList = that.workForm.domains[0].subProjectList
  3568. sss.stages = that.workForm.domains[0].stages
  3569. sss.taskGroups = that.workForm.domains[0].taskGroups;
  3570. sss.auditUserList = obj.auditUserList;
  3571. } else {
  3572. sss.subProjectId = item.subProjectId
  3573. sss.stage = item.stage
  3574. sss.subProjectList = item.subProjectList
  3575. sss.stages = item.stages
  3576. sss.taskGroups = item.taskGroups;
  3577. sss.auditUserList = obj.auditUserList;
  3578. }
  3579. if (sss.auditUserList != null && sss.auditUserList.length==1) {
  3580. //只有一个审核人,自动设置上去
  3581. sss.projectAuditorId = sss.auditUserList[0].auditorId;
  3582. }
  3583. // console.log(sss, '数据')
  3584. that.zhoBaoIdx = i
  3585. that.zhoBaoName = names
  3586. that.zhoBao = sss
  3587. that.zhis = row
  3588. that.$forceUpdate();
  3589. },500);
  3590. // if(Object.keys(sss).length <= 4) {
  3591. // sss.subProjectId = this.workForm.domains[0].subProjectId
  3592. // sss.stage = this.workForm.domains[0].stage
  3593. // sss.subProjectList = this.workForm.domains[0].subProjectList
  3594. // sss.stages = this.workForm.domains[0].stages
  3595. // } else {
  3596. // sss.subProjectId = item.subProjectId
  3597. // sss.stage = item.stage
  3598. // sss.subProjectList = item.subProjectList
  3599. // sss.stages = item.stages
  3600. // }
  3601. // console.log(sss, '数据')
  3602. // this.zhoBaoIdx = i
  3603. // this.zhoBaoName = names
  3604. // this.zhoBao = sss
  3605. // this.zhis = row
  3606. // this.selectProject(row[0], i)
  3607. },
  3608. // 按周填报里内容的填写点击确定
  3609. btnTianxiaes() {
  3610. if (this.zhoBao.projectAuditorId) {
  3611. this.tianxieDialogVisible = false
  3612. var zhong = this.zhoData
  3613. zhong[this.zhoBaoIdx][this.zhoBaoName] = this.zhoBao
  3614. this.zhoData = zhong
  3615. if(this.reportTimeType.type == 1) this.zhoXuan(this.zhoBao, this.zhoBaoIdx)
  3616. if(this.reportTimeType.type == 2) this.zhoTimes(this.zhoBao, this.zhoBaoIdx)
  3617. if(this.reportTimeType.type == 3) this.addBli(this.zhoBao, this.zhoBaoIdx)
  3618. } else {
  3619. this.$message({
  3620. message: '请选择审核人',
  3621. type: "error"
  3622. });
  3623. }
  3624. },
  3625. // 获取本周
  3626. getCurrentWeek() {
  3627. const currentDate = new Date()
  3628. const week = currentDate.getDay()
  3629. const millisecond = 1000 * 60 * 60 * 24
  3630. const minusDay = week != 0 ? week - 1 : 4
  3631. const monday = new Date(currentDate.getTime() - minusDay * millisecond)
  3632. const sunday = new Date(monday.getTime() + 4 * millisecond)
  3633. var stat = this.dealdate(monday)
  3634. var end = this.dealdate(sunday)
  3635. this.zhoRqi = [stat, end]
  3636. this.zhoRqis()
  3637. this.jiazai()
  3638. },
  3639. // 获取上周
  3640. handleGetPrevWeek() {
  3641. const Time = new Date(this.zhoRqi[0])
  3642. let weekNum = Time.getDay()
  3643. weekNum = weekNum == 0 ? 7 : weekNum
  3644. let lastDate = new Date(Time.getTime() - weekNum * 24 * 60 * 60 * 1000)
  3645. let fitstDate = new Date(
  3646. Time.getTime() - (weekNum + 6) * 24 * 60 * 60 * 1000
  3647. )
  3648. let startDate = `${fitstDate.getFullYear()}-${
  3649. fitstDate.getMonth() + 1 < 10
  3650. ? '0' + (fitstDate.getMonth() + 1)
  3651. : fitstDate.getMonth() + 1
  3652. }-${
  3653. fitstDate.getDate() < 10
  3654. ? '0' + fitstDate.getDate()
  3655. : fitstDate.getDate()
  3656. }`
  3657. let endDate = `${lastDate.getFullYear()}-${
  3658. lastDate.getMonth() + 1 < 10
  3659. ? '0' + (lastDate.getMonth() + 1)
  3660. : lastDate.getMonth() + 1
  3661. }-${
  3662. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  3663. }`
  3664. var stat = this.dealdate(startDate)
  3665. var ends = this.dealdate(endDate)
  3666. var end = this.dateChange(-2, ends)
  3667. this.zhoRqi = [stat, end]
  3668. this.zhoRqis()
  3669. this.jiazai()
  3670. },
  3671. // 获取下周
  3672. handleGetNextvWeek() {
  3673. const Time = new Date(this.zhoRqi[1])
  3674. let weekNum = Time.getDay()
  3675. weekNum = weekNum == 0 ? 7 : weekNum
  3676. let fitstDate = new Date(
  3677. Time.getTime() + (7 - weekNum + 1) * 24 * 60 * 60 * 1000
  3678. )
  3679. let lastDate = new Date(
  3680. Time.getTime() + (7 - weekNum + 7) * 24 * 60 * 60 * 1000
  3681. )
  3682. let startDate = `${fitstDate.getFullYear()}-${
  3683. fitstDate.getMonth() + 1 < 10
  3684. ? '0' + (fitstDate.getMonth() + 1)
  3685. : fitstDate.getMonth() + 1
  3686. }-${
  3687. fitstDate.getDate() < 10
  3688. ? '0' + fitstDate.getDate()
  3689. : fitstDate.getDate()
  3690. }`
  3691. let endDate = `${lastDate.getFullYear()}-${
  3692. lastDate.getMonth() + 1 < 10
  3693. ? '0' + (lastDate.getMonth() + 1)
  3694. : lastDate.getMonth() + 1
  3695. }-${
  3696. lastDate.getDate() < 10 ? '0' + lastDate.getDate() : lastDate.getDate()
  3697. }`
  3698. var stat = this.dealdate(startDate)
  3699. var ends = this.dealdate(endDate)
  3700. var end = this.dateChange(-2, ends)
  3701. this.zhoRqi = [stat, end]
  3702. this.zhoRqis()
  3703. this.jiazai()
  3704. },
  3705. // 新增日期
  3706. newDates() {
  3707. // console.log(this.zhoRqi, '看卡')
  3708. this.zhoRqi[1] = this.dateChange(1, this.zhoRqi[1])
  3709. // console.log(this.zhoRqi[1])
  3710. var obj = {}
  3711. obj.zhoDataTime = this.zhoRqi[1]
  3712. obj.he = 0
  3713. for(var j in this.projectList) {
  3714. var xinzhi = this.projectList[j].projectName
  3715. obj[xinzhi] = {}
  3716. obj[xinzhi].time = ''
  3717. obj[xinzhi].con = ''
  3718. obj[xinzhi].progress = 0
  3719. obj[xinzhi].workingTime = 0
  3720. }
  3721. this.zhoData.push(obj)
  3722. },
  3723. // 减去时间
  3724. dateChange(num = 1,date = false) {
  3725.   if (!date) {
  3726.     date = new Date();//没有传入值时,默认是当前日期
  3727.     date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
  3728.   }
  3729.   date += " 00:00:00";//设置为当天凌晨12点
  3730.   date = Date.parse(new Date(date))/1000;//转换为时间戳
  3731.   date += (86400) * num;//修改后的时间戳
  3732.   var newDate = new Date(parseInt(date) * 1000);//转换为时间
  3733. var nian = newDate.getFullYear()
  3734. var yue = ''
  3735. var ri = ''
  3736. var yues = (newDate.getMonth() + 1)
  3737. var ris = newDate.getDate()
  3738. yues > 9 ? yue = yues : yue = '0' + yues
  3739. ris > 9 ? ri = ris : ri = '0' + ris
  3740. return nian +'-'+yue+'-'+ri
  3741. },
  3742. // 加载动画
  3743. jiazai() {
  3744. this.zhoLoading = true
  3745. var that = this
  3746. setTimeout(() =>{
  3747. that.zhoLoading = false
  3748. },1000);
  3749. },
  3750. // 转时间格式
  3751. dealdate(date) {
  3752. const dt = new Date(date)
  3753. const y = dt.getFullYear()
  3754. const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  3755. const d = (dt.getDate() + '').padStart(2, '0')
  3756. return `${y}-${m}-${d}`
  3757. },
  3758. // 按周填报
  3759. fillInReportss() {
  3760. window.addEventListener('scroll', this.handleScroll, true)
  3761. this.jiazai()
  3762. this.diasZho = true
  3763. this.getCurrentWeek()
  3764. // 项目数量判断 <=5
  3765. if(this.projectList.length < 5){
  3766. this.selProjectList = this.projectList
  3767. this.selConShow = false
  3768. }
  3769. if (!this.timeBasecostList || this.timeBasecostList.length == 0) {
  3770. //重新获取工时预警类型的预算项
  3771. this.http.post('/project-basecost-setting/getReportBasecostList', {
  3772. companyId: this.user.companyId
  3773. },
  3774. res => {
  3775. if (res.code == "ok") {
  3776. this.timeBasecostList = res.data;
  3777. }
  3778. });
  3779. }
  3780. },
  3781. // 按周填报的项目筛选
  3782. selListFun(){
  3783. this.selProjectList = []
  3784. if(this.selCon.length){
  3785. for (let i = 0; i < this.selCon.length; i++) {
  3786. this.selProjectList.push(this.projectList.find(item => item.id == this.selCon[i]))
  3787. }
  3788. // console.log("已筛选列表",this.selProjectList);
  3789. this.selConShow = false
  3790. }else{
  3791. this.$message({
  3792. message:'请选择要填报的项目',
  3793. type:'error'
  3794. })
  3795. }
  3796. },
  3797. selListqx(){
  3798. this.diasZho = false
  3799. this.selProjectList = []
  3800. this.selCon = []
  3801. },
  3802. handleScroll() {
  3803. this.changdu = this.projectList.length + 1
  3804. },
  3805. // 自动选择时间点的事件
  3806. zhoTimes(item, i, ims, event) {
  3807. var iss = i
  3808. if(item.time == null) {
  3809. return
  3810. } else {
  3811. var zhi = this.zhoData[iss]
  3812. var he = 0
  3813. for(var i in zhi) {
  3814. if(zhi[i].time && zhi[i].time.length > 0 && i != 'zhoDataTime' && i != 'he') {
  3815. var date2 = '2021/12/12 ' + zhi[i].time[1] +':00'
  3816. var date1 = '2021/12/12 ' + zhi[i].time[0] +':00'
  3817. var date3 = new Date(date2).getTime() - new Date(date1).getTime();
  3818. var leave1=date3%(24*3600*1000)
  3819. var hours=Math.floor(leave1/(3600*1000))
  3820. var leave2=leave1%(3600*1000)
  3821. var minutes=Math.floor(leave2/(60*1000))
  3822. var shi = hours+'.'+ minutes
  3823. he += +shi
  3824. }
  3825. }
  3826. zhi.he = he + 'h'
  3827. }
  3828. },
  3829. // 自动选择事件长度的事件
  3830. zhoXuan(item, i) {
  3831. var iss = i
  3832. if(item.time == null) {
  3833. return
  3834. } else {
  3835. var zhi = this.zhoData[iss]
  3836. var he = 0
  3837. for(var i in zhi) {
  3838. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  3839. he += +zhi[i].workingTime
  3840. }
  3841. }
  3842. zhi.he = he + 'h'
  3843. }
  3844. },
  3845. // 按时间比例
  3846. addBli(item, i) {
  3847. var iss = i
  3848. if(item.time == null) {
  3849. return
  3850. } else {
  3851. var zhi = this.zhoData[iss]
  3852. var he = 0
  3853. for(var i in zhi) {
  3854. if(i != 'zhoDataTime' && i != 'he' && zhi[i].workingTime && zhi[i].workingTime.length > 0) {
  3855. he += +zhi[i].workingTime
  3856. }
  3857. }
  3858. zhi.he = he.toFixed(1) + 'h'
  3859. }
  3860. },
  3861. zhoRqis() {
  3862. this.zhoData = []
  3863. if(this.zhoRqi) {
  3864. var stime = this.zhoRqi[0]
  3865. var etime = this.zhoRqi[1]
  3866. var zhi = this.getdiffdate(stime, etime)
  3867. var arrst = []
  3868. for(var i in zhi) {
  3869. var obj = {}
  3870. obj.zhoDataTime = zhi[i]
  3871. obj.he = 0
  3872. for(var j in this.projectList) {
  3873. var xinzhi = this.projectList[j].projectName
  3874. obj[xinzhi] = {}
  3875. obj[xinzhi].time = ''
  3876. obj[xinzhi].con = ''
  3877. obj[xinzhi].progress = 0
  3878. obj[xinzhi].workingTime = 0
  3879. }
  3880. arrst.push(obj)
  3881. }
  3882. this.zhoData = arrst
  3883. }
  3884. },
  3885. zhoZhi(res, i) {
  3886. var zhi = 0
  3887. for(var i in res) {
  3888. if(i != 'zhoDataTime' && i != 'he') {
  3889. zhi += +res[i]
  3890. }
  3891. }
  3892. res.he = zhi
  3893. },
  3894. zhoBtn(i) {
  3895. // this.zhoData.split(i, 1)
  3896. var arr = this.zhoData
  3897. arr.splice(i, 1)
  3898. },
  3899. zhoAddlast(){
  3900. this.selConShow = true
  3901. },
  3902. zhoAddqx(){
  3903. this.diasZho = false
  3904. this.selConShow = true
  3905. this.selProjectList = []
  3906. this.selCon = []
  3907. },
  3908. // 提交按周填报
  3909. zhoAdd() {
  3910. var zhi = this.zhoData
  3911. var ll = 0
  3912. // console.log(this.reportTimeType.type)
  3913. // console.log(this.reportTimeType.multiWorktime)
  3914. if(this.reportTimeType.type == 2) {
  3915. for(var i in zhi) {
  3916. this.dateAr = []
  3917. var alp = []
  3918. var zhis = zhi[i]
  3919. for(var j in zhis) {
  3920. if(j != 'zhoDataTime' && j != 'he' && zhis[j].time != null && zhis[j].time != 'null' && zhis[j].time != '') {
  3921. let objs = {}
  3922. objs.s = zhis[j].time[0]
  3923. objs.e = zhis[j].time[1]
  3924. alp.push(objs)
  3925. }
  3926. }
  3927. this.dateAr = alp
  3928. if(this.dateAr.length > 0) {
  3929. let trus = this.fns()
  3930. ll += 1
  3931. if(!trus) {
  3932. this.$message({
  3933. message: '填写的时间段重叠',
  3934. type: 'error'
  3935. })
  3936. return false
  3937. }
  3938. }
  3939. }
  3940. if(ll == 0) {
  3941. this.$message({
  3942. message: '请填写时间',
  3943. type: 'error'
  3944. })
  3945. return false
  3946. }
  3947. } else if(this.reportTimeType.type == 1){
  3948. for(var i in zhi) {
  3949. var zhis = zhi[i]
  3950. for(var j in zhis) {
  3951. if(j != 'zhoDataTime' && j != 'he' && zhis[j].workingTime != null && zhis[j].workingTime != 'null' && zhis[j].workingTime != '') {
  3952. ll += 1
  3953. }
  3954. }
  3955. }
  3956. if(ll == 0) {
  3957. this.$message({
  3958. message: '请选择时间',
  3959. type: 'error'
  3960. })
  3961. return false
  3962. }
  3963. }
  3964. var submits = []
  3965. let formData = new FormData();
  3966. if(this.reportTimeType.multiWorktime == 1){
  3967. for (var i in this.zhoData) {
  3968. var zhoD = this.zhoData[i]
  3969. var flgs = false
  3970. for(var j in zhoD) {
  3971. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  3972. flgs = true
  3973. formData.append("degreeId", "-1");
  3974. formData.append("id", '-1');
  3975. for(var s in this.projectList) {
  3976. if(j == this.projectList[s].projectName) {
  3977. formData.append("projectId", this.projectList[s].id);
  3978. }
  3979. }
  3980. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  3981. formData.append("taskId", 0);
  3982. formData.append("reportTimeType", this.reportTimeType.type);
  3983. formData.append("endTime", '');
  3984. formData.append("startTime", '');
  3985. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  3986. var lix = []
  3987. var objjs = {}
  3988. objjs.startTime = zhoD[j].time[0]
  3989. objjs.endTime = zhoD[j].time[1]
  3990. if (zhoD[j].con == null || zhoD[j].con == '') {
  3991. zhoD[j].con == '-'
  3992. }
  3993. objjs.content = zhoD[j].con
  3994. lix.push(objjs)
  3995. var zhiZhi = JSON.stringify(lix)
  3996. zhiZhi = zhiZhi.replace(/,/g,"@");
  3997. formData.append("content", zhiZhi)
  3998. formData.append("isOvertime", 0)
  3999. formData.append("professionProgress", "[]")
  4000. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4001. formData.append("createDate",zhoD.zhoDataTime)
  4002. if (zhoD[j].projectAuditorId) {
  4003. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4004. }
  4005. if(zhoD[j].basecostId) {
  4006. formData.append("basecostId", zhoD[j].basecostId);
  4007. } else {
  4008. formData.append("basecostId", 0);
  4009. }
  4010. }
  4011. }
  4012. }
  4013. } else {
  4014. for (var i in this.zhoData) {
  4015. var zhoD = this.zhoData[i]
  4016. var flgs = false
  4017. if(this.reportTimeType.type == 2) {
  4018. for(var j in zhoD) {
  4019. if(j != 'zhoDataTime' && j != 'he' && zhoD[j].time && zhoD[j].time.length > 0 && zhoD[j].time != null && zhoD[j].time != 'null') {
  4020. flgs = true
  4021. formData.append("degreeId", "-1");
  4022. formData.append("id", '-1');
  4023. for(var s in this.projectList) {
  4024. if(j == this.projectList[s].projectName) {
  4025. formData.append("projectId", this.projectList[s].id);
  4026. }
  4027. }
  4028. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0');
  4029. formData.append("taskId", 0);
  4030. formData.append("reportTimeType", this.reportTimeType.type);
  4031. formData.append("endTime", zhoD[j].time[1]);
  4032. formData.append("startTime", zhoD[j].time[0]);
  4033. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4034. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4035. formData.append("isOvertime", 0)
  4036. formData.append("professionProgress", "[]")
  4037. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4038. formData.append("createDate",zhoD.zhoDataTime)
  4039. if (zhoD[j].projectAuditorId) {
  4040. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4041. }
  4042. if(zhoD[j].basecostId) {
  4043. formData.append("basecostId", zhoD[j].basecostId);
  4044. } else {
  4045. formData.append("basecostId", 0);
  4046. }
  4047. }
  4048. }
  4049. } else {
  4050. for(var j in zhoD) {
  4051. 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') {
  4052. flgs = true
  4053. formData.append("degreeId", "-1");
  4054. formData.append("id", '-1');
  4055. for(var s in this.projectList) {
  4056. if(j == this.projectList[s].projectName) {
  4057. formData.append("projectId", this.projectList[s].id);
  4058. }
  4059. }
  4060. zhoD[j].subProjectId ? formData.append("subProjectId", zhoD[j].subProjectId) : formData.append("subProjectId", '0')
  4061. // formData.append("subProjectId", zhoD[j].subProjectId);
  4062. formData.append("taskId", 0);
  4063. formData.append("reportTimeType", this.reportTimeType.type);
  4064. if(this.reportTimeType.type == 1) {
  4065. formData.append("workingTime", zhoD[j].workingTime);
  4066. } else if(this.reportTimeType.type == 2) {
  4067. formData.append("endTime", zhoD[j].time[1]);
  4068. formData.append("startTime", zhoD[j].time[0]);
  4069. } else if(this.reportTimeType.type == 3) {
  4070. formData.append("progress", zhoD[j].progress);
  4071. formData.append("workingTime", zhoD[j].workingTime);
  4072. }
  4073. formData.append("multiWorktime", this.reportTimeType.multiWorktime);
  4074. zhoD[j].con == '' || zhoD[j].con == null ? formData.append("content", '-') : formData.append("content", zhoD[j].con)
  4075. formData.append("isOvertime", 0)
  4076. formData.append("professionProgress", "[]")
  4077. zhoD[j].stage ? formData.append("stage", zhoD[j].stage) : formData.append("stage", '');
  4078. formData.append("createDate",zhoD.zhoDataTime)
  4079. if (zhoD[j].projectAuditorId) {
  4080. formData.append("projectAuditorId",zhoD[j].projectAuditorId)
  4081. }
  4082. if(zhoD[j].basecostId) {
  4083. formData.append("basecostId", zhoD[j].basecostId);
  4084. } else {
  4085. formData.append("basecostId", 0);
  4086. }
  4087. }
  4088. }
  4089. }
  4090. }
  4091. }
  4092. this.http.uploadFile( this.port.report.editPort, formData,
  4093. res => {
  4094. // this.listLoading = false;
  4095. if (res.code == "ok") {
  4096. this.$message({
  4097. message: "填报成功",
  4098. type: "success"
  4099. });
  4100. this.diasZho = false
  4101. this.selConShow = true
  4102. this.zhoData = []
  4103. this.zhoRqi = ''
  4104. this.getReportList();
  4105. this.getDepartment();
  4106. // 关闭弹窗 并 清空
  4107. this.selProjectList = []
  4108. this.selCon = []
  4109. } else {
  4110. this.$message({
  4111. message: res.msg,
  4112. type: "error"
  4113. });
  4114. }
  4115. },
  4116. error => {
  4117. this.listLoading = false;
  4118. this.$message({
  4119. message: error,
  4120. type: "error"
  4121. });
  4122. });
  4123. },
  4124. ChangeHourMinutestr (str) {
  4125. if (str !== "0" && str !== "" && str !== null) {
  4126. return ((Math.floor(str / 60)).toString().length < 2 ? "0" + (Math.floor(str / 60)).toString() :
  4127. (Math.floor(str / 60)).toString()) + ":" + ((str % 60).toString().length < 2 ? "0" + (str % 60).toString() : (str % 60).toString());
  4128. } else {
  4129. return "";
  4130. }
  4131. },
  4132. // 得到两个日期中间的日期
  4133. getdiffdate(stime,etime){
  4134. //初始化日期列表,数组
  4135. var diffdate = new Array();
  4136. var i=0;
  4137. //开始日期小于等于结束日期,并循环
  4138. while(stime<=etime){
  4139. diffdate[i] = stime;
  4140. //获取开始日期时间戳
  4141. var stime_ts = new Date(stime).getTime();
  4142. //增加一天时间戳后的日期
  4143. var next_date = stime_ts + (24*60*60*1000);
  4144. //拼接年月日,这里的月份会返回(0-11),所以要+1
  4145. var next_dates_y = new Date(next_date).getFullYear()+'-';
  4146. var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
  4147. var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
  4148. stime = next_dates_y+next_dates_m+next_dates_d;
  4149. //增加数组key
  4150. i++;
  4151. }
  4152. return diffdate;
  4153. },
  4154. // 添加模块
  4155. addDomain(i) {
  4156. var leftProgress = 10;
  4157. if (this.reportTimeType.type == 3) {
  4158. //计算已经待分配工时比例
  4159. let array = this.workForm.domains;
  4160. let totalProgress = 0;
  4161. for (var i=0;i<array.length; i++) {
  4162. totalProgress += array[i].progress;
  4163. }
  4164. if (totalProgress < 100) {
  4165. leftProgress = 100 - totalProgress;
  4166. }
  4167. }
  4168. var addItem = {
  4169. projectId: "",
  4170. workingTime: this.reportTimeType.type == 3?(leftProgress*this.reportTimeType.allday/100).toFixed(1):"",
  4171. content: "",
  4172. progress:leftProgress,
  4173. state:2,//2-表示待提交
  4174. multiWorktime: this.reportTimeType.multiWorktime,
  4175. worktimeList:[{}],
  4176. // degreeId: '',
  4177. };
  4178. if (this.timeBasecostList && this.timeBasecostList.length > 0) {
  4179. //默认给第一个,必填字段
  4180. addItem.basecostId = this.timeBasecostList[0].id;
  4181. }
  4182. this.workForm.domains.push(addItem);
  4183. if (this.reportTimeType.type == 0) {
  4184. //全天上下午模式下,检测时间段数量,达到2个,不能再加了
  4185. var length = this.workForm.domains.length;
  4186. if (length == 2) {
  4187. this.showAddMore = false;
  4188. }
  4189. }
  4190. this.chuji()
  4191. },
  4192. // 移除模块
  4193. delDomain(i) {
  4194. this.workForm.domains.splice(i,1)
  4195. //检测当前剩下的一个,时间类型是否是全天
  4196. if (this.reportTimeType.type == 0) {
  4197. if (this.workForm.domains[0].timeType == 0) {
  4198. this.showAddMore = false;
  4199. } else {
  4200. this.showAddMore = true;
  4201. }
  4202. }
  4203. if(this.user.timeType.multiWorktime == 1) {
  4204. this.iptChangs()
  4205. } else {
  4206. this.seleChn(0)
  4207. }
  4208. },
  4209. // 改变月份
  4210. changeMonth() {
  4211. if (this.isBatch == 0 && !this.isSubstitude) {
  4212. //只有按天填报才能获取当天的日报
  4213. this.getReport()
  4214. }
  4215. },
  4216. // 判断时间段
  4217. fns() {
  4218. for (let k in this.dateAr) {
  4219. if (!this.judege(k)) {
  4220. return false
  4221. }
  4222. }
  4223. return true
  4224. },
  4225. judege(idx){
  4226. for (let k in this.dateAr) {
  4227. if (idx !== k) {
  4228. if (this.dateAr[k].s <= this.dateAr[idx].s && this.dateAr[k].e > this.dateAr[idx].s) {
  4229. return false
  4230. }
  4231. if (this.dateAr[k].s < this.dateAr[idx].e && this.dateAr[k].e >= this.dateAr[idx].e) {
  4232. return false
  4233. }
  4234. }
  4235. }
  4236. return true
  4237. },
  4238. // 保存日报
  4239. submitReport(isDraft) {
  4240. this.isDraft = isDraft;
  4241. this.$refs.workForm.validate(valid => {
  4242. if (valid) {
  4243. this.dateAr = []
  4244. let alp = []
  4245. if(this.user.timeType.multiWorktime != 1) {
  4246. for(var p in this.workForm.domains) {
  4247. if(this.workForm.domains[p].startTime || this.workForm.domains[p].endTime) {
  4248. let objs = {}
  4249. objs.s = this.workForm.domains[p].startTime
  4250. objs.e = this.workForm.domains[p].endTime
  4251. alp.push(objs)
  4252. }
  4253. }
  4254. this.dateAr = alp
  4255. if(this.dateAr.length > 0) {
  4256. let trus = this.fns()
  4257. if(!trus) {
  4258. this.$message({
  4259. message: '填写的时间段重叠',
  4260. type: "error"
  4261. });
  4262. return
  4263. }
  4264. }
  4265. } else {
  4266. for(var p in this.workForm.domains) {
  4267. var slll = this.workForm.domains[p]
  4268. for(var o in slll.worktimeList) {
  4269. if(slll.worktimeList[o].startTime || slll.worktimeList[o].endTime) {
  4270. let objs = {}
  4271. objs.s = slll.worktimeList[o].startTime
  4272. objs.e = slll.worktimeList[o].endTime
  4273. alp.push(objs)
  4274. }
  4275. }
  4276. }
  4277. this.dateAr = alp
  4278. if(this.dateAr.length > 0) {
  4279. let trus = this.fns()
  4280. if(!trus) {
  4281. this.$message({
  4282. message: '填写的时间段重叠',
  4283. type: "error"
  4284. });
  4285. return
  4286. }
  4287. }
  4288. }
  4289. // return
  4290. //代填的情况,检查人员是否已经选择
  4291. if (this.isSubstitude) {
  4292. if (this.workForm.userNames == null || this.workForm.userNames.length == 0) {
  4293. this.$message({
  4294. message: "请选择代填的人员",
  4295. type: "error"
  4296. });
  4297. return;
  4298. }
  4299. }
  4300. //检查时间,全天和上下午不能同时存在
  4301. if (this.reportTimeType.type == 0) {
  4302. var alldayNum = 0;
  4303. var amNum = 0;
  4304. var pmNum = 0;
  4305. for(var i in this.workForm.domains) {
  4306. if (this.workForm.domains[i].timeType == 0) {
  4307. alldayNum ++;
  4308. } else if (this.workForm.domains[i].timeType == 1) {
  4309. amNum++;
  4310. } else if (this.workForm.domains[i].timeType == 2) {
  4311. pmNum++;
  4312. }
  4313. }
  4314. if (alldayNum > 1) {
  4315. this.$message({
  4316. message: "工作时间-全天,只能选择一次",
  4317. type: "error"
  4318. });
  4319. return;
  4320. }
  4321. if (amNum > 1) {
  4322. this.$message({
  4323. message: "工作时间-上午,只能选择一次",
  4324. type: "error"
  4325. });
  4326. return;
  4327. }
  4328. if (pmNum > 1) {
  4329. this.$message({
  4330. message: "工作时间-下午,只能选择一次",
  4331. type: "error"
  4332. });
  4333. return;
  4334. }
  4335. if (alldayNum == 1 && (amNum > 0 || pmNum > 0)) {
  4336. this.$message({
  4337. message: "工作时间-全天,不能和上下午同时存在",
  4338. type: "error"
  4339. });
  4340. return;
  4341. }
  4342. } else if (this.reportTimeType.type == 3) {
  4343. //总百分比不能超过100%
  4344. let total = 0;
  4345. this.workForm.domains.forEach(w=>{total += w.progress});
  4346. if (total > 100) {
  4347. this.$message({
  4348. message: "用时比例之和不能超过100%",
  4349. type: "error"
  4350. });
  4351. return;
  4352. } else if (total < 100) {
  4353. this.$message({
  4354. message: "工时尚未完全分配,无法提交",
  4355. type: "error"
  4356. });
  4357. return;
  4358. }
  4359. }
  4360. this.listLoading = true;
  4361. let formData = new FormData();
  4362. formData.append("draft", this.isDraft);
  4363. //检查workingTime合计
  4364. if (this.reportTimeType.type == 1 && this.workForm.time) {
  4365. var totalTime = 0;
  4366. for (var t=0;t<this.workForm.domains.length; t++) {
  4367. totalTime += parseFloat(this.workForm.domains[t].workingTime);
  4368. }
  4369. if (this.workForm.time.workHours && totalTime > parseFloat(this.workForm.time.workHours)) {
  4370. this.$message({
  4371. message: "填报工时之和"+(totalTime)+"h不能超过考勤总工时("+this.workForm.time.workHours.toFixed(1)+"h)",
  4372. type: "error"
  4373. });
  4374. return;
  4375. }
  4376. }
  4377. for(var i in this.workForm.domains) {
  4378. if(this.workForm.domains[i].degreeId) {
  4379. // var sss = this.workForm.domains[i].degreeId.toString()
  4380. formData.append("degreeId", this.workForm.domains[i].degreeId);
  4381. } else {
  4382. formData.append("degreeId", -1);
  4383. }
  4384. if(this.workForm.domains[i].customData) {
  4385. // var sss = this.workForm.domains[i].degreeId.toString()
  4386. formData.append("customData", this.workForm.domains[i].customData);
  4387. } else {
  4388. formData.append("customData", 0);
  4389. }
  4390. if(this.workForm.domains[i].customText) {
  4391. formData.append("customText", this.workForm.domains[i].customText);
  4392. } else {
  4393. formData.append("customText", '-');
  4394. }
  4395. if (this.workForm.domains[i].id) {
  4396. formData.append("id", this.workForm.domains[i].id);
  4397. } else {
  4398. formData.append("id", -1);
  4399. }
  4400. formData.append("projectId", this.workForm.domains[i].projectId);
  4401. if (this.workForm.domains[i].subProjectId) {
  4402. formData.append("subProjectId", this.workForm.domains[i].subProjectId);
  4403. } else {
  4404. formData.append("subProjectId", 0);
  4405. }
  4406. if (this.workForm.domains[i].groupId) {
  4407. formData.append("groupId", this.workForm.domains[i].groupId);
  4408. } else {
  4409. formData.append("groupId", 0);
  4410. }
  4411. if (this.workForm.domains[i].taskId) {
  4412. formData.append("taskId", this.workForm.domains[i].taskId);
  4413. } else {
  4414. formData.append("taskId", 0);
  4415. }
  4416. if (this.workForm.domains[i].taskFinish == true) {
  4417. formData.append("taskFinish", 1);
  4418. } else {
  4419. formData.append("taskFinish", 0);
  4420. }
  4421. formData.append("reportTimeType", this.reportTimeType.type);
  4422. if (this.reportTimeType.type == 0) {
  4423. formData.append("timeType", this.workForm.domains[i].timeType);
  4424. var workingTime = this.timeType.filter(t=>t.value == this.workForm.domains[i].timeType)[0].hours;
  4425. formData.append("workingTime", workingTime);
  4426. } else if (this.reportTimeType.type == 1){
  4427. formData.append("workingTime", this.workForm.domains[i].workingTime);
  4428. } else if (this.reportTimeType.type == 2) {
  4429. formData.append("endTime", this.workForm.domains[i].endTime);
  4430. formData.append("startTime", this.workForm.domains[i].startTime);
  4431. } else if (this.reportTimeType.type == 3) {
  4432. //按比例分配
  4433. formData.append("progress", this.workForm.domains[i].progress);
  4434. formData.append("workingTime", this.workForm.domains[i].workingTime);
  4435. }
  4436. //处理多个时间事项
  4437. formData.append("multiWorktime", this.workForm.domains[i].multiWorktime);
  4438. if (this.reportTimeType.multiWorktime == 1) {
  4439. //检查时间是否有重叠
  4440. var workList = this.workForm.domains[i].worktimeList;
  4441. for (var j=0;j<workList.length; j++) {
  4442. var curItem = workList[j];
  4443. //检查开始时间是否大于结束时间
  4444. if (curItem.startTime >= curItem.endTime) {
  4445. this.$message({
  4446. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"有误:"+
  4447. "结束时间必须大于开始时间",
  4448. type: "error"
  4449. });
  4450. return;
  4451. }
  4452. for (var p = j+1;p<workList.length; p++) {
  4453. var jItem = workList[p];
  4454. if ((jItem.startTime>=curItem.startTime&&jItem.startTime < curItem.endTime)
  4455. || (jItem.endTime>curItem.startTime&&jItem.endTime <= curItem.endTime)) {
  4456. this.$message({
  4457. message: "时间段"+curItem.startTime+'-'+curItem.endTime+"与"+
  4458. jItem.startTime+'-'+jItem.endTime+ "存在重叠,请修改。",
  4459. type: "error"
  4460. });
  4461. return;
  4462. }
  4463. }
  4464. }
  4465. let m = JSON.stringify(this.workForm.domains[i].worktimeList);
  4466. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  4467. formData.append("content", m);
  4468. } else {
  4469. if (this.workForm.domains[i].content) {
  4470. formData.append("content", this.workForm.domains[i].content);
  4471. } else {
  4472. formData.append("content", '-');
  4473. }
  4474. }
  4475. if (this.isBatch == 0) {
  4476. formData.append("createDate", this.workForm.createDate);
  4477. } else {
  4478. //批量填报,时间范围
  4479. formData.append("createDate", this.workForm.createDate[0]+'@'+this.workForm.createDate[1]);
  4480. }
  4481. if(this.workForm.domains[i].isOvertime) {
  4482. formData.append("isOvertime", 1);
  4483. } else {
  4484. formData.append("isOvertime", 0);
  4485. }
  4486. if(this.workForm.domains[i].overtimeHours && this.workForm.domains[i].isOvertime == 1) {
  4487. formData.append("overtimeHours", this.workForm.domains[i].overtimeHours);
  4488. } else {
  4489. formData.append("overtimeHours", 0);
  4490. }
  4491. if(this.workForm.domains[i].basecostId) {
  4492. formData.append("basecostId", this.workForm.domains[i].basecostId);
  4493. } else {
  4494. formData.append("basecostId", 0);
  4495. }
  4496. if (this.workForm.userId != null) {
  4497. var targetUids = '';
  4498. this.workForm.userId.forEach(u=>{
  4499. targetUids += u + '@';
  4500. });
  4501. if (targetUids.length > 0) {
  4502. targetUids = targetUids.substring(0, targetUids.length -1);
  4503. formData.append("targetUids", targetUids);
  4504. }
  4505. }
  4506. //项目专业进度
  4507. if (this.workForm.domains[i].professionProgress) {
  4508. var m = JSON.stringify(this.workForm.domains[i].professionProgress);
  4509. m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
  4510. formData.append("professionProgress", m);
  4511. } else {
  4512. formData.append("professionProgress", "[]");
  4513. }
  4514. if (this.workForm.domains[i].stage) {
  4515. formData.append("stage", this.workForm.domains[i].stage);
  4516. } else {
  4517. formData.append("stage", "-");
  4518. }
  4519. if (this.workForm.domains[i].projectAuditorId) {
  4520. formData.append("projectAuditorId", this.workForm.domains[i].projectAuditorId);
  4521. } else {
  4522. if (this.workForm.domains[i].taskGpIncharge == 0) {
  4523. this.$message({
  4524. message: "请指定项目审核人",
  4525. type: "error"
  4526. });
  4527. } else if (this.workForm.domains[i].taskGroups.length == 0) {
  4528. this.$message({
  4529. message: "您在["+this.workForm.domains[i].projectName+"]项目上尚无参与的任务分组",
  4530. type: "error"
  4531. });
  4532. }
  4533. return;
  4534. }
  4535. }
  4536. this.submitingReport = true;
  4537. this.http.uploadFile( this.port.report.editPort, formData,
  4538. res => {
  4539. this.listLoading = false;
  4540. this.submitingReport = false;
  4541. if (res.code == "ok") {
  4542. this.$message({
  4543. message: this.isDraft==0?"提交成功":"暂存成功",
  4544. type: "success"
  4545. });
  4546. this.dialogVisible = false;
  4547. this.jsDay = 0
  4548. this.jsTime = 0
  4549. this.getReportList();
  4550. this.getDepartment();
  4551. } else {
  4552. this.$message({
  4553. message: (this.isDraft==0?'提交失败:':'暂存失败:')+res.msg,
  4554. type: "error"
  4555. });
  4556. }
  4557. },
  4558. error => {
  4559. this.listLoading = false;
  4560. this.submitingReport = false;
  4561. this.$message({
  4562. message: error,
  4563. type: "error"
  4564. });
  4565. });
  4566. }
  4567. });
  4568. },
  4569. cli() {
  4570. },
  4571. // 判断是展示那个工时导入
  4572. imports() {
  4573. if(this.user.timeType.syncCorpwxTime == 0) {
  4574. this.importDialog = true
  4575. } else {
  4576. this.importWxDialog = true
  4577. }
  4578. },
  4579. // 跳转
  4580. junpToDeskTop(id) {
  4581. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4582. this.$router.push("/desktop/" + id + "/" + this.date +day);
  4583. },
  4584. // 通过日报
  4585. approve(id, item) {
  4586. this.logining = true;
  4587. let day = (this.choseDay + 1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4588. var ids = item.id;
  4589. // var data = item.data;
  4590. // data.forEach(element => {
  4591. // ids +=(element.id+',');
  4592. // });
  4593. this.http.post( this.port.report.approve, {id: id , date: this.date +day, reportIds: ids},
  4594. res => {
  4595. this.logining = false;
  4596. if (res.code == "ok") {
  4597. this.$message({
  4598. message: "审核成功",
  4599. type: "success"
  4600. });
  4601. this.getReportList();
  4602. this.getDepartment();
  4603. } else {
  4604. this.$message({
  4605. message: res.msg,
  4606. type: "error"
  4607. });
  4608. }
  4609. },
  4610. error => {
  4611. this.logining = false;
  4612. this.$message({
  4613. message: error,
  4614. type: "error"
  4615. });
  4616. });
  4617. },
  4618. //撤回日报
  4619. cancel(item) {
  4620. this.logining = true;
  4621. var ids = '';
  4622. var data = item.data;
  4623. data.forEach(element => {
  4624. ids +=(element.id+',');
  4625. });
  4626. this.http.post(this.port.report.cancelReport, {userId: this.user.id, reportIds: ids},
  4627. res => {
  4628. this.logining = false;
  4629. if (res.code == "ok") {
  4630. this.$message({
  4631. message:"撤回成功",
  4632. type: "success"
  4633. });
  4634. this.getReportList();
  4635. this.getDepartment();
  4636. } else {
  4637. this.$message({
  4638. message: res.msg,
  4639. type: "error"
  4640. });
  4641. }
  4642. },
  4643. error => {
  4644. this.logining = false;
  4645. this.$message({
  4646. message: error,
  4647. type: "error"
  4648. });
  4649. });
  4650. },
  4651. showDenyDialog(id,i, item) {
  4652. this.denyReasonDialog = true;
  4653. let day = (this.choseDay+1) > 9 ? "-" + (this.choseDay + 1) : "-0" + (this.choseDay + 1);
  4654. var ids = item.id;
  4655. // var data = item.data;
  4656. // data.forEach(element => {
  4657. // ids +=(element.id+',');
  4658. // });
  4659. this.denyForm = {id: id ,i:i, date: this.date +day, reportIds: ids, reason:null};
  4660. },
  4661. // 未通过日报
  4662. deny() {
  4663. this.logining = true;
  4664. this.http.post( this.port.report.deny, this.denyForm,
  4665. res => {
  4666. this.logining = false;
  4667. if (res.code == "ok") {
  4668. this.$message({
  4669. message: this.denyForm.i==0?"驳回成功":"撤销成功",
  4670. type: "success"
  4671. });
  4672. this.getReportList();
  4673. this.getDepartment();
  4674. this.denyReasonDialog = false;
  4675. } else {
  4676. this.$message({
  4677. message: res.msg,
  4678. type: "error"
  4679. });
  4680. }
  4681. },
  4682. error => {
  4683. this.logining = false;
  4684. this.$message({
  4685. message: error,
  4686. type: "error"
  4687. });
  4688. });
  4689. },
  4690. // 查看工时记录弹窗
  4691. toView() {
  4692. this.toViewDialogVisible = true
  4693. this.toViewloading = true
  4694. this.getToView()
  4695. },
  4696. getToView() {
  4697. this.http.post( '/report-import-log/getList', this.toViewForm,
  4698. res => {
  4699. this.toViewloading = false;
  4700. if (res.code == "ok") {
  4701. // console.log(res.data, '数据数据')
  4702. this.toViewList = res.data.records
  4703. this.toViewForm.total = res.data.total
  4704. } else {
  4705. this.toViewloading = false;
  4706. this.$message({
  4707. message: res.msg,
  4708. type: "error"
  4709. });
  4710. }
  4711. })
  4712. },
  4713. //分页
  4714. handleCurrentChange(val) {
  4715. this.toViewForm.pageIndex = val;
  4716. this.getToView();
  4717. },
  4718. handleSizeChange(val) {
  4719. this.toViewForm.pageSize = val;
  4720. this.getToView();
  4721. },
  4722. },
  4723. created() {
  4724. let height = window.innerHeight;
  4725. this.tableHeight = height - 178;
  4726. const that = this;
  4727. window.onresize = function temp() {
  4728. that.tableHeight = window.innerHeight - 178;
  4729. };
  4730. this.toViewForm.companyId = this.user.companyId
  4731. },
  4732. mounted() {
  4733. var now = new Date();
  4734. var t = util.formatDate.format(now, 'yyyy-MM-dd');
  4735. var startStr = util.formatDate.format(new Date(), 'yyyy-MM') + "-01";
  4736. this.exportParam.dateRange = [startStr,t];
  4737. this.getAllDate();
  4738. this.getReportList();
  4739. this.getProjectList();
  4740. this.getFillProjectList();
  4741. this.getTimeType();
  4742. this.getDepartment();
  4743. this.scrollFunction()
  4744. this.userssHu();
  4745. if (this.user.company.packageProject == 1) {
  4746. this.getBasecostItemList();
  4747. }
  4748. if(this.user.timeType.lockWorktime){
  4749. this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
  4750. }
  4751. }
  4752. };
  4753. </script>
  4754. <style lang="scss" scoped>
  4755. .paginatis {
  4756. padding: 10px 10px;
  4757. background: #f2f2f2;
  4758. }
  4759. .waiting {
  4760. color:orange;
  4761. }
  4762. .filledReportStyle {
  4763. color:#32CD32;
  4764. }
  4765. .RejectStyle {
  4766. color:red;
  4767. }
  4768. .allDaily {
  4769. width:82%;
  4770. }
  4771. .report_title {
  4772. padding:10px 0;
  4773. color:#666;
  4774. }
  4775. .clearfix {
  4776. overflow-x: auto;
  4777. white-space: nowrap;
  4778. padding: 15px 0 10px 0;
  4779. // overflow-y: hidden;
  4780. .date_item {
  4781. padding: 0 3px;
  4782. cursor: pointer;
  4783. }
  4784. .chooseDate {
  4785. color: #20a0ff;
  4786. }
  4787. }
  4788. .one_daily {
  4789. i {
  4790. color: #9ed0ff;
  4791. margin-right: 5px;
  4792. }
  4793. .one_daily_body {
  4794. padding: 10px 0px;
  4795. p {
  4796. margin: 0;
  4797. line-height: 30px;
  4798. }
  4799. }
  4800. ul {
  4801. padding: 0;
  4802. }
  4803. }
  4804. .checkbtn {
  4805. float: right;
  4806. margin-top: -10px;
  4807. }
  4808. .selConStyle{
  4809. margin-top:9rem;
  4810. margin-bottom:11rem;
  4811. .selConStyle_title{
  4812. height: 3rem;
  4813. text-align: center;
  4814. font-size: 17px;
  4815. }
  4816. .el-select{
  4817. margin: 0 15%;
  4818. width: 70%;
  4819. }
  4820. }
  4821. </style>
  4822. <style lang="scss">
  4823. .daily {
  4824. .el-card__body {
  4825. height: 80%;
  4826. overflow-y: auto;
  4827. }
  4828. .el-card__header {
  4829. padding: 0 20px;
  4830. }
  4831. }
  4832. </style>
  4833. <style scoped>
  4834. /* 项目标签的样式 */
  4835. .el-tag + .el-tag {
  4836. margin-left: 10px;
  4837. }
  4838. .button-new-tag {
  4839. margin-left: 10px;
  4840. height: 32px;
  4841. line-height: 30px;
  4842. padding-top: 0;
  4843. padding-bottom: 0;
  4844. }
  4845. .input-new-tag {
  4846. width: 90px;
  4847. margin-left: 10px;
  4848. vertical-align: bottom;
  4849. }
  4850. .selectworktime .el-table__fixed-body-wrapper{
  4851. top: 48px !important;
  4852. }
  4853. .selectworktime_export .selectworktime_export_l{
  4854. width: 65%;
  4855. float: left;
  4856. height: 42px;
  4857. }
  4858. </style>
  4859. <style lang="scss" scoped>
  4860. // 加班样式
  4861. .overtime {
  4862. display: inline-block;
  4863. margin-left: 20px;
  4864. input {
  4865. display: inline-block;
  4866. margin-top: 5px;
  4867. }
  4868. }
  4869. .plus {
  4870. display: inline-block;
  4871. }
  4872. // .tages {
  4873. // float: right;
  4874. // }
  4875. .overtime {
  4876. display: inline-block;
  4877. margin-left: 30px;
  4878. }
  4879. .bloks {
  4880. display: inline-block;
  4881. width: 380px;
  4882. }
  4883. .zhiss {
  4884. display: flex;
  4885. justify-content: space-around;
  4886. align-items: center;
  4887. }
  4888. .zhoFel {
  4889. display: flex;
  4890. justify-content: space-between;
  4891. align-items: center;
  4892. }
  4893. </style>