list.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. <template>
  2. <view>
  3. <view v-if="datalist.length>0">
  4. <!-- 预约 -->
  5. <block v-if="type=='order'">
  6. <view class="ylist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
  7. <image :src="ysta" class="ystaimg" v-if="ite.visitType==3"></image>
  8. <image :src="ystb" class="ystaimg" v-if="ite.visitType==2"></image>
  9. <view class="ytop flexc">
  10. <view class="tit">{{ite.visitName.charAt(0)}}</view>
  11. <view class="cent">
  12. <view class="ctit">{{ite.visitName}}提交的预约来访申请</view>
  13. <view class="ctime">提交时间:{{ite.createTime}}</view>
  14. </view>
  15. <view class="right" v-if="ite.visitType==1">
  16. <image :src="ybga"></image>
  17. <view>待审核</view>
  18. </view>
  19. </view>
  20. <view class="ybox">
  21. <view class="yblist mw50"><text>预约日期</text>{{ite.visitDate}}</view>
  22. <view class="yblist mw50"><text>预约时间</text>{{ite.visitTime}}</view>
  23. <view class="yblist mw50"><text>手机号码</text>{{ite.visitPhone}}</view>
  24. <view class="yblist mw50"><text>人 数</text>{{ite.visitNum}}</view>
  25. <view class="yblist mw50"><text>来访地点</text>{{kaType(ite.appointmentSite,adrlist)}}</view>
  26. <view class="yblist mw50"><text>来访事由</text>{{ite.visitReason}}</view>
  27. </view>
  28. <view class="ybtn">
  29. <view class="ybtns btn1" @click.stop="getDelFn(ite.reservatId)">删除</view>
  30. <view class="flex1"></view>
  31. <block v-if="ite.visitType==1">
  32. <view class="ybtns btn2" @click.stop="gettypeFn(2,ite.reservatId)">拒绝</view>
  33. <view class="ybtns btn3" @click.stop="gettypeFn(3,ite.reservatId)">同意</view>
  34. </block>
  35. </view>
  36. </view>
  37. </block>
  38. <!-- 视频 -->
  39. <block v-if="type=='video'">
  40. <view class="ylist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
  41. <image :src="ysta" class="ystaimg" v-if="ite.visitType==3"></image>
  42. <image :src="ystb" class="ystaimg" v-if="ite.visitType==2"></image>
  43. <view class="ytop flexc">
  44. <view class="tit">{{ite.visitName.charAt(0)}}</view>
  45. <view class="cent">
  46. <view class="ctit">{{ite.visitName}}提交的预约来访申请</view>
  47. <view class="ctime">提交时间:{{ite.createTime}}</view>
  48. </view>
  49. <view class="right" v-if="ite.visitType==1">
  50. <image :src="ybg"></image>
  51. <view>待审核</view>
  52. </view>
  53. </view>
  54. <view class="ybox">
  55. <view class="yblist mw50"><text>预约日期</text>{{ite.visitDate}}</view>
  56. <view class="yblist mw50"><text>预约时间</text>{{ite.visitTime}}</view>
  57. <view class="yblist mw50"><text>手机号码</text>{{ite.visitPhone}}</view>
  58. <view class="yblist mw50"><text>人 数</text>{{ite.visitNum}}</view>
  59. <view class="yblist mw50"><text>来访地点</text>{{kaType(ite.appointmentSite,adrlist)}}</view>
  60. <view class="yblist mw50"><text>来访事由</text>{{ite.visitReason}}</view>
  61. </view>
  62. <view class="ybtn">
  63. <view class="ybtns btn1" @click.stop="getDelFn(ite.reservatId)">删除</view>
  64. <view class="flex1"></view>
  65. <block v-if="ite.visitType==1">
  66. <view class="ybtns btn2" @click.stop="gettypeFn(2,ite.reservatId)">拒绝</view>
  67. <view class="ybtns btn3" @click.stop="gettypeFn(3,ite.reservatId)">同意</view>
  68. </block>
  69. </view>
  70. </view>
  71. </block>
  72. <!-- 打卡记录 -->
  73. <block v-if="type=='record'">
  74. <view class="ylist rlist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
  75. <view class="rtop mb15 flexcj">
  76. <view class="rlistl flexc">
  77. <image :src="time"></image>
  78. <view>07-18 / 星期四</view>
  79. </view>
  80. <view class="right" v-if="ite.visitType==1">
  81. <image :src="ybga"></image>
  82. <view>缺卡</view>
  83. <!-- <view>迟到</view> -->
  84. </view>
  85. </view>
  86. <view class="rbox flexcj">
  87. <view class="rboxa">
  88. <image :src="bgaimg" class="rbg"></image>
  89. <view class="rboxb">
  90. <view class="tit">上班08:30</view>
  91. <view class="time flexc">
  92. <image :src="chose"></image>
  93. 08:21已打卡
  94. </view>
  95. </view>
  96. </view>
  97. <view class="rboxa">
  98. <image :src="bgbimg" class="rbg"></image>
  99. <view class="rboxb">
  100. <view class="tit">下班17:30</view>
  101. <view class="time flexc">
  102. <image :src="close"></image>
  103. 缺卡
  104. <!-- 未打卡 -->
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </block>
  111. <!-- 打卡列表 -->
  112. <block v-if="type=='clock'">
  113. <view class="ylist rlist" style="padding-top: 12rpx;" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
  114. <view class="ytop flexc">
  115. <view class="tit">{{ite.visitName.charAt(0)}}</view>
  116. <view class="cent">
  117. <view class="ctit">{{ite.visitName}}的打卡记录</view>
  118. <view class="ctime">最新打卡:{{ite.createTime}}</view>
  119. </view>
  120. <view class="rights" v-if="ite.visitType==1">
  121. <image :src="ybga"></image>
  122. <view>缺卡</view>
  123. <!-- <view>迟到</view> -->
  124. </view>
  125. </view>
  126. <view class="ybox">
  127. <view class="yblist mw50 line"><text>上班打卡</text>08:31已打卡
  128. <view class="tip">迟到</view>
  129. </view>
  130. <view class="yblist mw50"><text>下班打卡</text>17:31已打卡
  131. </view>
  132. </view>
  133. </view>
  134. </block>
  135. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  136. </view>
  137. <block v-else>
  138. <no-data></no-data>
  139. </block>
  140. </view>
  141. </template>
  142. <script>
  143. import { selectDictValue } from '@/utils/common.js';
  144. import noData from "@/components/nodata/nodata.vue"
  145. export default {
  146. props:{
  147. datalist: {
  148. type: Array,
  149. default () {
  150. return []
  151. }
  152. },
  153. adrlist:{
  154. type: Array,
  155. default () {
  156. return []
  157. }
  158. },
  159. wtdt:{
  160. type: String,
  161. default () {
  162. return ''
  163. }
  164. },
  165. type:{
  166. type: [String,Number],
  167. default () {
  168. return ''
  169. }
  170. },
  171. },
  172. components:{
  173. noData
  174. },
  175. data(){
  176. return{
  177. time:require("@/static/images/home/time.png"),
  178. chose:require("@/static/images/home/chose.png"),
  179. close:require("@/static/images/home/close.png"),
  180. bgaimg:require("@/static/images/home/hbgg.png"),
  181. bgbimg:require("@/static/images/home/hbgh.png"),
  182. ybg:require("@/static/images/order/staff/ybg.png"),
  183. ybga:require("@/static/images/order/staff/ybga.png"),
  184. ysta:require("@/static/images/order/staff/ysta.png"),
  185. ystb:require("@/static/images/order/staff/ystb.png"),
  186. }
  187. },
  188. onLoad: function() {
  189. },
  190. methods:{
  191. kaType(data, list) {
  192. return selectDictValue(list, data);
  193. },
  194. getDelFn(id){
  195. var that=this;
  196. uni.showModal({
  197. title: '确认删除',
  198. content: "是否确认删除该预约",
  199. cancelText: '取消',
  200. confirmText: '确认',
  201. success: function(res) {
  202. if (res.confirm) {
  203. that.$emit("getDelFn",id)
  204. } else if (res.cancel) {
  205. // console.log('用户点击取消');
  206. }
  207. }
  208. });
  209. },
  210. gettypeFn(type,id){
  211. var that=this;
  212. var str="拒绝"
  213. if(type==3){
  214. str='同意'
  215. }
  216. uni.showModal({
  217. title: '确认'+str,
  218. content: "是否确认"+str+"该预约",
  219. cancelText: '取消',
  220. confirmText: '确认',
  221. success: function(res) {
  222. if (res.confirm) {
  223. var newobj={
  224. type:type,
  225. id:id
  226. }
  227. that.$emit("gettypeFn",newobj)
  228. } else if (res.cancel) {
  229. // console.log('用户点击取消');
  230. }
  231. }
  232. });
  233. },
  234. getDetail(e){
  235. this.$emit('getDetail',e)
  236. },
  237. typeFn(data){
  238. if(data){
  239. var newArr=[]
  240. var astr=data.split('-')
  241. astr.forEach(ite=>{
  242. var a=ite.substring(0,5);
  243. newArr.push(a)
  244. })
  245. return newArr.join('-')
  246. }else{
  247. return ''
  248. }
  249. },
  250. },
  251. }
  252. </script>
  253. <style lang="scss" scoped>
  254. // 预约
  255. .ylist{background: #FFFFFF;border-radius: 14rpx;margin-bottom: 30rpx;position: relative;
  256. .ystaimg{width: 140rpx;height: 140rpx;top: 22rpx;right: 22rpx;position: absolute;}
  257. .ytop{padding: 16rpx 0 24rpx 16rpx;
  258. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  259. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  260. .cent{
  261. flex: 1;
  262. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  263. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  264. }
  265. .right{position: relative;flex: 0 0 auto;margin-left: 10rpx;
  266. image{width: 144rpx;height: 56rpx;}
  267. view{font-weight: 800;font-size: 22rpx;color: #FFFFFF;position: absolute;left: 0;top: 0;right: 0;bottom: 0;text-align: center;padding-left: 20rpx;box-sizing: border-box;line-height: 56rpx;}
  268. }
  269. .rights{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  270. image{width: 100%;height: 100%;}
  271. view{font-weight: 500;font-size: 20rpx;
  272. color: #FFFFFF;position: absolute;left: 0;top: 0;right: 0;bottom: 0;text-align: center;padding-left: 20rpx;box-sizing: border-box;line-height: 38rpx;}
  273. }
  274. }
  275. .ybox{padding: 0rpx 24rpx 24rpx 16rpx;display: flex;flex-wrap: wrap;
  276. .yblist{display: flex;font-size: 24rpx;font-weight: 500;color: #161616;padding: 6rpx 0 6rpx 8rpx;line-height: 40rpx;position: relative;
  277. text{font-weight: normal;color: #aaa;flex: 0 0 auto;width: 100rpx;text-align-last: justify;margin-right: 12rpx;}
  278. .tip{border-radius: 12rpx;font-weight: 500;font-size: 16rpx;color: #F87C29;border: 2rpx solid #F87C29;height: 28rpx;box-sizing: border-box;
  279. display: flex;align-items: center;padding: 0 8rpx;margin-left: 12rpx;flex: 0 0 auto;margin-top: 6rpx;
  280. }
  281. &.line{
  282. &::after{
  283. position: absolute;content: '';width: 2rpx;height: 30rpx;background: #CDCDCD;right: 0;top: 9rpx;
  284. }
  285. }
  286. }
  287. }
  288. .ybtn{border-top: 2rpx solid #DADADA;padding: 20rpx 18rpx;display: flex;align-items: center;
  289. .ybtns{width: 130rpx;border-radius: 6rpx;height: 52rpx;font-weight: 500;font-size: 26rpx;display: flex;align-items: center;justify-content: center;box-sizing: border-box;flex: 0 0 auto;
  290. &.btn1{border: 2rpx solid #FC3838;color: #FC3838;}
  291. &.btn2{border: 2rpx solid #666666;color: #666666;}
  292. &.btn3{background-color: #0391FD;color: #ffffff;margin-left: 22rpx;}
  293. }
  294. }
  295. // 记录
  296. &.rlist{padding-top:28rpx;
  297. .rtop{position: relative;padding-left: 22rpx;
  298. .rlistl{flex: 1;
  299. image{width: 30rpx;height: 30rpx;margin-right: 18rpx;}
  300. view{font-weight: bold;font-size: 28rpx;color: #161616;}
  301. }
  302. .right{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  303. image{width: 100%;height: 100%;}
  304. view{font-weight: 500;font-size: 20rpx;
  305. color: #FFFFFF;position: absolute;left: 0;top: 0;right: 0;bottom: 0;text-align: center;padding-left: 20rpx;box-sizing: border-box;line-height: 38rpx;}
  306. }
  307. }
  308. .ytop{padding-bottom: 18rpx;}
  309. .ybox{padding-bottom: 14rpx;}
  310. .rbox{padding: 0 22rpx 8rpx 22rpx;
  311. .rboxa{width: 306rpx;height: 104rpx;position: relative;margin-bottom: 20rpx;
  312. .rbg{width: 100%;height: 100%;}
  313. .rboxb{box-sizing: border-box;padding:14rpx 0 16rpx 28rpx;
  314. position: absolute;left: 0;top: 0;right: 0;bottom: 0;
  315. .tit{font-weight: 500;font-size: 26rpx;color: #161616;margin-bottom: 10rpx;}
  316. .time{font-weight: 500;font-size: 22rpx;color: #666666;
  317. image{width: 18rpx;height: 18rpx;margin-right: 14rpx;flex: 0 0 auto;}
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. </style>