handover.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="container">
  3. <view class="search-user flex-y-center ">
  4. <view class="search-content flex-y-center">
  5. <icon type="search" size="18" />
  6. <input confirm-type="search" v-model="seTval" @confirm="confirm" @input="getSearch" class="flex-grow-1"
  7. type="text" placeholder-style="font-size:26rpx" placeholder="请输入名称|真实姓名|员工工号" />
  8. <view class="flex-center" style="margin-left: 10rpx;" @click.stop="onDel" v-if="seTval">
  9. <icon type="clear" size="18" />
  10. </view>
  11. </view>
  12. <view class="search-btn" @click="search">
  13. 搜索
  14. </view>
  15. </view>
  16. <view class="box-pack-between headerScreen flex-y-center ">
  17. <view class="flex-y-center flex-grow-1 ft26 header-text">
  18. <view style="width: 50%;" class="flex-grow-1 flex-center " data-text="1" :class="act_index==1?'act':''"
  19. @click="onTopBtnTap(1)">
  20. <view class="text-1" style="width: auto; max-width: 300rpx;">
  21. {{level_text}}
  22. </view>
  23. <view class="d3"></view>
  24. </view>
  25. <view style="width: 50%;" class="flex-grow-1 flex-center text-1" data-text="2"
  26. :class="act_index==2?'act':''" @click="onTopBtnTap(2)">
  27. <view class="text-1" style="width: auto; max-width: 300rpx;">
  28. {{type_text}}
  29. </view>
  30. <view class="d3"></view>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="header-hg200"></view>
  35. <uni-popup-top ref="popup" type="top" :top="top" :maskClass="maskClass">
  36. <view class="showpay">
  37. <block v-if='act_index==1'>
  38. <view class="box-li" :class="store_id==0?'active':''" @click="Onlevel(0,'全部')" data-text='全部'>全部
  39. </view>
  40. <scroll-view scroll-y="true" style="height: 400rpx;">
  41. <view class="box-li" v-for="(item,index) of tableTypeList" :key='index'
  42. :class="item.id==store_id?'active':''" @click="Onlevel(item.id,item.title)">
  43. {{item.title}}
  44. </view>
  45. </scroll-view>
  46. </block>
  47. <block v-if='act_index==2'>
  48. <view class="box-li" :class="status==2?'active':''" @click="onStatus(2,'全部')" data-text='全部'>全部
  49. </view>
  50. <view class="box-li" :class="status==1?'active':''" @click="onStatus(1,'已签到')" data-text='已签到'>已签到
  51. </view>
  52. <view class="box-li" :class="status==0?'active':''" @click="onStatus(0,'未签到')" data-text='未签到'>未签到
  53. </view>
  54. </block>
  55. </view>
  56. </uni-popup-top>
  57. <no-none v-if='list.length<=0'></no-none>
  58. <view class="list" v-else>
  59. <view class="item" style="border: none;" v-for="(item,index) in list" :key="index">
  60. <view class="box-pack-between">
  61. <view class="name box-pack-between flex-grow-1">
  62. <text>{{item.nickname}}</text>
  63. <view class="flex-center ft28" style="padding-right: 20rpx;color: #247EFF;">{{item.status}}
  64. </view>
  65. </view>
  66. </view>
  67. <view class="content">
  68. <view class="flex flex-y-center">
  69. <view class="cell flex flex-y-center">
  70. <view class="title">签到时间:</view>
  71. <view class="desc">{{item.open_time}}</view>
  72. </view>
  73. </view>
  74. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  75. <view class="cell flex flex-y-center " style="width:100%">
  76. <view class="title">签退时间:</view>
  77. <view class="desc">{{item.end_time}}</view>
  78. </view>
  79. </view>
  80. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  81. <view class="cell flex flex-y-center " style="width:100%">
  82. <view class="title">名字:</view>
  83. <view class="desc">{{item.name}}</view>
  84. </view>
  85. </view>
  86. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  87. <view class="cell flex flex-y-center " style="width:100%">
  88. <view class="title">员工号:</view>
  89. <view class="desc">{{item.number}}</view>
  90. </view>
  91. </view>
  92. <view class="flex flex-y-center" style="margin-top: 16rpx;">
  93. <view class="cell flex flex-y-center " style="width:100%">
  94. <view class="title">交班状态:</view>
  95. <view class="desc">{{item.status}}</view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. import uniPopupTop from '@/components/zx-uni-popup/uni-popup-top.vue'
  105. export default {
  106. components: {
  107. uniPopupTop
  108. },
  109. data() {
  110. return {
  111. act_index: 1,
  112. type_text: '签到状态',
  113. level_text: '门店',
  114. store_id: "",
  115. admin_id: '',
  116. list: [],
  117. page: 1,
  118. is_bottom: false,
  119. keywords: "",
  120. status: 2,
  121. type: 2,
  122. tableTypeList: [],
  123. top: "200rpx",
  124. maskClass: {
  125. 'position': 'fixed',
  126. 'bottom': 0,
  127. 'top': "100rpx",
  128. 'left': 0,
  129. 'right': 0,
  130. 'backgroundColor': 'rgba(0, 0, 0, 0.4)'
  131. },
  132. }
  133. },
  134. onLoad(e) {
  135. this.type = e.type || 2;
  136. this.store_id = uni.getStorageSync("store_id");
  137. this.admin_id = uni.getStorageSync("admin_id");
  138. this.shop_store_index();
  139. },
  140. onShow() {
  141. this.getData(1)
  142. },
  143. onReachBottom() {
  144. if (!this.is_bottom) {
  145. this.getData(this.page + 1)
  146. }
  147. },
  148. methods: {
  149. shop_store_index() {
  150. let storeinfo = uni.getStorageSync("storeinfo");
  151. this.request({
  152. url: 'Smdcshop/shop_store_index',
  153. data: {
  154. admin_id: this.admin_id,
  155. }
  156. }).then(res => {
  157. if (res.code == 200) {
  158. if (res.data.length > 0) {
  159. this.tableTypeList = res.data;
  160. } else {
  161. this.tableTypeList = [{
  162. title: storeinfo.title,
  163. id: storeinfo.id,
  164. }];
  165. }
  166. }
  167. })
  168. },
  169. onStatus(e, text) {
  170. this.status = e;
  171. this.type_text = text;
  172. this.list = [];
  173. this.getData(1);
  174. this.$refs.popup.close();
  175. },
  176. Onlevel(e, text) {
  177. this.store_id = e;
  178. this.level_text = text;
  179. this.list = [];
  180. this.getData(1);
  181. this.$refs.popup.close();
  182. },
  183. getSearch(e) {
  184. if (!e.detail.value) {
  185. this.page = 1;
  186. this.list = [];
  187. this.keywords = "";
  188. this.getData(1);
  189. }
  190. this.keywords = e.detail.value;
  191. },
  192. onDel() {
  193. this.seTval = '';
  194. this.page = 1;
  195. this.list = [];
  196. this.keywords = "";
  197. this.getData(1);
  198. },
  199. confirm(e) {
  200. this.page = 1;
  201. this.list = [];
  202. this.keywords = e.detail.value;
  203. this.getData(1);
  204. },
  205. search(e) {
  206. this.page = 1;
  207. this.list = [];
  208. this.getData(1);
  209. },
  210. onTopBtnTap(e) {
  211. this.act_index = e;
  212. this.$refs.popup.open();
  213. },
  214. getData(page) {
  215. if (page == 1) {
  216. this.list = []
  217. this.page = 1
  218. this.is_bottom = false
  219. }
  220. this.request({
  221. url: 'Smdcshop/handover_index',
  222. data: {
  223. page,
  224. limit: 10,
  225. status: this.status,
  226. serch: this.keywords,
  227. admin_id: this.admin_id,
  228. store_id: this.store_id,
  229. }
  230. }).then(res => {
  231. if (res.code == 200 && res.data.length) {
  232. this.list = this.list.concat(res.data)
  233. this.page = page
  234. } else {
  235. this.is_bottom = true
  236. }
  237. })
  238. }
  239. }
  240. }
  241. </script>
  242. <style>
  243. @import url("./static/css/common.css");
  244. page {
  245. background-color: #F4F5F7;
  246. }
  247. .list {
  248. padding: 30rpx 25rpx;
  249. }
  250. .list .item {
  251. border-radius: 8rpx;
  252. overflow: hidden;
  253. padding-left: 30rpx;
  254. border-left: 8rpx solid #247EFF;
  255. background-color: #fff;
  256. margin-bottom: 30rpx;
  257. }
  258. .list .item .name {
  259. height: 80rpx;
  260. border-bottom: 1rpx solid #f5f5f5;
  261. font-size: 30rpx;
  262. line-height: 80rpx;
  263. font-weight: bold;
  264. }
  265. .list .item .content {
  266. padding: 20rpx 0 24rpx;
  267. }
  268. .list .item .content .cell {
  269. /* flex: none; */
  270. /* width: 50%; */
  271. box-sizing: border-box;
  272. padding-right: 30rpx;
  273. font-size: 26rpx;
  274. line-height: 37rpx;
  275. color: #666;
  276. }
  277. .list .item .content .cell .title {
  278. color: #99A0AD;
  279. }
  280. .headerScreen {
  281. height: 100rpx;
  282. position: fixed;
  283. top: 100rpx;
  284. width: 100%;
  285. z-index: 999;
  286. background: #fff;
  287. border-bottom: 1rpx solid #F1F1F1;
  288. }
  289. .header-hg200 {
  290. height: 210rpx;
  291. }
  292. .header-text {
  293. text-align: center;
  294. }
  295. .d3 {
  296. width: 0;
  297. height: 0;
  298. border-width: 12rpx;
  299. border-style: solid;
  300. border-color: #000 transparent transparent transparent;
  301. margin-top: 14rpx;
  302. margin-left: 6rpx;
  303. }
  304. .showpay {
  305. width: 100%;
  306. z-index: 10;
  307. background: #FFFFFF;
  308. }
  309. .search-user {
  310. z-index: 999;
  311. position: fixed;
  312. left: 0;
  313. width: 100%;
  314. height: 100rpx;
  315. background: #FFFFFF;
  316. margin-left: 15rpx;
  317. }
  318. .search-user .search-content {
  319. width: 83%;
  320. height: 70rpx;
  321. background: #F1F1F1;
  322. border-radius: 100rpx;
  323. padding: 0 20rpx;
  324. }
  325. .search-user .search-content icon {
  326. margin-right: 10rpx;
  327. }
  328. .search-user .search-btn {
  329. margin-left: 20rpx;
  330. font-size: 28rpx;
  331. }
  332. .box-li {
  333. background-color: #fff;
  334. text-align: center;
  335. border-bottom: 1rpx solid #f1f1f1;
  336. height: 80rpx;
  337. line-height: 80rpx;
  338. font-size: 26rpx;
  339. }
  340. page .active {
  341. color: #007AFF;
  342. }
  343. </style>