list.vue 11 KB

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