limit.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" left-icon="left" title="人员权限" :background-color="backgroundColor"
  5. :border="false" statusBar='true' fixed="true" @clickLeft='getBack'>
  6. </uni-nav-bar>
  7. <view class="plr16" :style="'background:'+backgroundColor">
  8. <!-- 搜索 -->
  9. <view class="lbtab flexc">
  10. <image :src="licoimg" class="limg" @click='getResetFn'></image>
  11. <view class="search flexc mb4">
  12. <image :src="serimg"></image>
  13. <input placeholder="请输入人员姓名进行搜索" confirm-type="search" placeholder-style="color:#B9DCF7" v-model="title" @confirm="getConfirm"/>
  14. </view>
  15. <!-- <view class="lbtabs flexc">
  16. <picker class="pickbox" range-key='dictLabel' :range="jclxlist" @change="bindTimeChangea">
  17. <view class="pickboxa">
  18. <view class="tit overtwo" >{{jclx||'就餐类型'}}</view>
  19. <image :src="wupimg" class="hupimg"></image>
  20. </view>
  21. </picker>
  22. </view>
  23. <view @click="getDetailDay" class="daybtn flexc">
  24. <image :src="dayimg"></image>
  25. 预约记录</view> -->
  26. </view>
  27. </view>
  28. </view>
  29. <image :src="navbg" class="navbg"></image>
  30. <view class="zxmain">
  31. <!-- 列表 -->
  32. <y-list type='limit' :datalist="list" :wtdt="wtdt" @getDetail='getDetail' :mjlist="mjlist" @getDelFn="getDelFn"></y-list>
  33. <view class="yyfbtn flexcc" v-if="checkPermi(['system:management:add'])" @click="getAddFn">添加人员</view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  39. import yList from "@/work/components/yuyue/list.vue"
  40. import {getManagementList,getManagementDel} from "@/api/mine/work.js"
  41. import {getDictionaryFn} from "@/api/mine/register.js"
  42. export default {
  43. components: {yList},
  44. data() {
  45. return {
  46. wupimg:require("@/work/static/record/wup.png"),
  47. serimg:require("@/work/static/record/search.png"),
  48. licoimg:require("@/work/static/record/lico.png"),
  49. navbg:require("@/static/images/navbg.png"),
  50. dayimg:require("@/work/static/yuy/day.png"),
  51. backgroundColor: "transparent",
  52. datainfo:{},
  53. nvaHeight: 44,
  54. marTop: 0, //距离顶部的距离
  55. stubarHeight: 0, //
  56. title:'',
  57. mjlist:[],
  58. list:[],
  59. pageSize: 10,
  60. pageNum: 1,
  61. reachflag: false,
  62. wtdt:'',
  63. jclx:'',
  64. orderFoodType:'',//就餐类型
  65. userId:this.$store.state.user.userId,
  66. }
  67. },
  68. onPageScroll(e) {
  69. var scrollTop = Number(e.scrollTop);
  70. if (scrollTop > 0) {
  71. this.backgroundColor = '#0491FD'
  72. } else {
  73. this.backgroundColor = 'transparent'
  74. }
  75. },
  76. onUnload() {
  77. uni.$off('refreshlimitlist')
  78. },
  79. onLoad: function() {
  80. uni.$on('refreshlimitlist',(e) => {
  81. this.getConfirm()
  82. })
  83. this.init()
  84. this.getDataFn()
  85. uni.getSystemInfo({
  86. success: (e) => {
  87. this.stubarHeight = Number(e.statusBarHeight);
  88. this.nvaHeight = Number(e.statusBarHeight) + 44;
  89. }
  90. })
  91. },
  92. onShow() {},
  93. // 上拉触底加载更多触发事件
  94. onReachBottom() {
  95. if (this.reachflag) {
  96. this.pageNum++
  97. this.getDataFn()
  98. }
  99. },
  100. methods: {
  101. checkPermi,
  102. checkRole,
  103. getConfirm(){
  104. this.pageNum=1;
  105. this.list=[];
  106. this.reachflag=true;
  107. this.getDataFn()
  108. },
  109. getResetFn(){
  110. // 重置
  111. this.jclx='';
  112. this.orderFoodType='';
  113. this.title="";
  114. this.getConfirm()
  115. },
  116. getBack() {
  117. uni.navigateBack({
  118. delta: 1
  119. })
  120. },
  121. getDetail(id){
  122. var obj={
  123. id:id,
  124. type:'edit'
  125. }
  126. this.$tab.navigateTo('/work/pages/yyorder/limitdetail?data='+encodeURIComponent(JSON.stringify(obj)))
  127. },
  128. getDetailDay(){
  129. this.$tab.navigateTo('/work/pages/yyorder/eatlistday')
  130. },
  131. getAddFn(){
  132. this.$tab.navigateTo('/work/pages/yyorder/limitdetail')
  133. },
  134. bindTimeChangea(e){
  135. var val=e.detail.value;
  136. this.jclx=this.jclxlist[val].dictLabel;
  137. this.orderFoodType=this.jclxlist[val].dictValue;
  138. this.getConfirm()
  139. },
  140. init() {
  141. // 门禁
  142. getDictionaryFn('menj').then(res=>{
  143. if(res.code==200){
  144. this.mjlist = res.data.map(v => {
  145. return {
  146. dictLabel: v.dictLabel,
  147. dictValue: v.dictValue
  148. }
  149. })
  150. }
  151. })
  152. },
  153. getDelFn(id){
  154. var that=this;
  155. getManagementDel(id).then(res=>{
  156. if(res.code==200){
  157. this.$toast('删除成功')
  158. setTimeout(function(){
  159. that.getConfirm()
  160. },1200)
  161. }
  162. })
  163. },
  164. getDataFn() {
  165. var params = {
  166. pageSize: this.pageSize,
  167. pageNum: this.pageNum,
  168. }
  169. if(this.title){
  170. params.personneName=this.title
  171. }
  172. getManagementList(params).then(res => {
  173. if (res.code == 200) {
  174. if (res.rows.length < this.pageSize) {
  175. this.reachflag = false
  176. this.wtdt = '到底了~';
  177. } else {
  178. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  179. 1)
  180. if (num < res.total) {
  181. this.reachflag = true
  182. this.wtdt = '上拉加载更多'
  183. } else {
  184. this.reachflag = false
  185. this.wtdt = '到底了~';
  186. }
  187. }
  188. if (this.pageNum == 1) {
  189. this.list = res.rows;
  190. } else {
  191. this.list = this.list.concat(res.rows)
  192. }
  193. } else {
  194. this.$toast(res.msg)
  195. }
  196. })
  197. },
  198. },
  199. }
  200. </script>
  201. <style>
  202. /* page {
  203. background: #ffffff;
  204. } */
  205. </style>
  206. <style lang="scss" scoped>
  207. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  208. .navbg{width: 100%;height: 692rpx;}
  209. .zxmain{position: relative;padding: 96rpx 32rpx 100rpx;box-sizing: border-box;}
  210. .search{padding: 0 52rpx;box-sizing: border-box;
  211. width: 100%;height: 76rpx;background: rgba(40, 139, 214, 0.5);border-radius: 38rpx;
  212. image{width: 24rpx;height: 24rpx;margin-right: 22rpx;flex: 0 0 auto;}
  213. input{flex: 1;font-weight: 500;font-size: 22rpx;color: #FFFFFF;}
  214. }
  215. .daybtn{font-weight: 500;font-size: 26rpx;color: #FFFFFF;flex: 0 0 auto;
  216. image{width: 30rpx;height: 30rpx;margin-right: 8rpx;}
  217. }
  218. .lbtab{padding-left:18rpx;
  219. .limg{width: 24rpx;height: 24rpx;margin-right: 16rpx;flex:0 0 auto;}
  220. .lbtabs{overflow: auto;flex-wrap: nowrap;flex:1;
  221. .pickbox{text-align: right;font-weight: 500;font-size: 28rpx;color: #161616;min-height:88rpx;margin: 0 10rpx;
  222. .pickboxa{justify-content: center;
  223. min-height: 88rpx;display: flex;align-items: center;
  224. }
  225. .tit{font-weight: 500;font-size: 26rpx;color: #FFFFFF;}
  226. .hupimg{width: 16rpx;height: 10rpx;margin-left: 26rpx;flex: 0 0 auto;}
  227. }
  228. }
  229. }
  230. </style>