list.vue 9.4 KB

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