list.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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.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 { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  99. import { selectDictValue } from '@/utils/common.js';
  100. import noData from "@/components/nodata/nodata.vue"
  101. export default {
  102. props:{
  103. datalist: {
  104. type: Array,
  105. default () {
  106. return []
  107. }
  108. },
  109. adrlist:{
  110. type: Array,
  111. default () {
  112. return []
  113. }
  114. },
  115. wtdt:{
  116. type: String,
  117. default () {
  118. return ''
  119. }
  120. },
  121. type:{
  122. type: [String,Number],
  123. default () {
  124. return ''
  125. }
  126. },
  127. },
  128. components:{
  129. noData
  130. },
  131. data(){
  132. return{
  133. time:require("@/static/images/home/time.png"),
  134. chose:require("@/static/images/home/chose.png"),
  135. close:require("@/static/images/home/close.png"),
  136. bgaimg:require("@/static/images/home/hbgg.png"),
  137. bgbimg:require("@/static/images/home/hbgh.png"),
  138. ybg:require("@/static/images/order/staff/ybg.png"),
  139. ybga:require("@/static/images/order/staff/ybga.png"),
  140. ysta:require("@/static/images/order/staff/ysta.png"),
  141. ystb:require("@/static/images/order/staff/ystb.png"),
  142. }
  143. },
  144. onLoad: function() {
  145. },
  146. methods:{
  147. checkPermi, checkRole,
  148. kaType(data, list) {
  149. return selectDictValue(list, data);
  150. },
  151. getDelFn(id){
  152. var that=this;
  153. uni.showModal({
  154. title: '确认删除',
  155. content: "是否确认删除该预约",
  156. cancelText: '取消',
  157. confirmText: '确认',
  158. success: function(res) {
  159. if (res.confirm) {
  160. that.$emit("getDelFn",id)
  161. } else if (res.cancel) {
  162. // console.log('用户点击取消');
  163. }
  164. }
  165. });
  166. },
  167. gettypeFn(type,id){
  168. var that=this;
  169. var str="拒绝"
  170. if(type==3){
  171. str='同意'
  172. }
  173. uni.showModal({
  174. title: '确认'+str,
  175. content: "是否确认"+str+"该预约",
  176. cancelText: '取消',
  177. confirmText: '确认',
  178. success: function(res) {
  179. if (res.confirm) {
  180. var newobj={
  181. type:type,
  182. id:id
  183. }
  184. that.$emit("gettypeFn",newobj)
  185. } else if (res.cancel) {
  186. // console.log('用户点击取消');
  187. }
  188. }
  189. });
  190. },
  191. getDetail(e){
  192. this.$emit('getDetail',e)
  193. },
  194. typeFn(data){
  195. if(data){
  196. var newArr=[]
  197. var astr=data.split('-')
  198. astr.forEach(ite=>{
  199. var a=ite.substring(0,5);
  200. newArr.push(a)
  201. })
  202. return newArr.join('-')
  203. }else{
  204. return ''
  205. }
  206. },
  207. },
  208. }
  209. </script>
  210. <style lang="scss" scoped>
  211. // 预约
  212. .ylist{background: #FFFFFF;border-radius: 14rpx;margin-bottom: 30rpx;position: relative;
  213. .ystaimg{width: 140rpx;height: 140rpx;top: 22rpx;right: 22rpx;position: absolute;}
  214. .ytop{padding: 16rpx 0 24rpx 16rpx;
  215. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  216. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  217. .cent{
  218. flex: 1;
  219. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  220. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  221. }
  222. .right{position: relative;flex: 0 0 auto;margin-left: 10rpx;
  223. image{width: 144rpx;height: 56rpx;}
  224. 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;}
  225. }
  226. .rights{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  227. image{width: 100%;height: 100%;}
  228. view{font-weight: 500;font-size: 20rpx;
  229. 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;}
  230. }
  231. }
  232. .ytit{font-weight: bold;font-size: 28rpx;color: #161616;flex: 1;}
  233. .ybox{padding: 0rpx 24rpx 24rpx 16rpx;display: flex;flex-wrap: wrap;
  234. .yblist{display: flex;font-size: 24rpx;font-weight: 500;color: #161616;padding: 6rpx 0 6rpx 8rpx;line-height: 40rpx;position: relative;
  235. text{font-weight: normal;color: #aaa;flex: 0 0 auto;width: 100rpx;text-align-last: justify;margin-right: 12rpx;}
  236. .tip{border-radius: 12rpx;font-weight: 500;font-size: 16rpx;color: #F87C29;border: 2rpx solid #F87C29;height: 28rpx;box-sizing: border-box;
  237. display: flex;align-items: center;padding: 0 8rpx;margin-left: 12rpx;flex: 0 0 auto;margin-top: 6rpx;
  238. }
  239. &.line{
  240. &::after{
  241. position: absolute;content: '';width: 2rpx;height: 30rpx;background: #CDCDCD;right: 0;top: 9rpx;
  242. }
  243. }
  244. }
  245. .listsm{padding: 28rpx 10rpx 2rpx 0;width: 100%;border-top: 2rpx solid #DADADA;
  246. .tit{margin-right: 8rpx;flex: 0 0 auto;min-width:110rpx;text-align-last: justify;margin-right: 20rpx;color: #aaa;}
  247. .line{margin-right: 8rpx;color: #aaaaaa;flex: 0 0 auto;}
  248. .txt{font-size: 26rpx;color: #161616;margin-bottom: 16rpx;display: flex;padding-left: 10rpx;}
  249. .flexcw{
  250. display: flex;align-items: center;flex-wrap: wrap;
  251. .txt{min-width: 50%;}
  252. }
  253. }
  254. }
  255. .ybtn{border-top: 2rpx solid #DADADA;padding: 20rpx 18rpx;display: flex;align-items: center;
  256. .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;
  257. &.btn1{border: 2rpx solid #FC3838;color: #FC3838;}
  258. &.btn2{border: 2rpx solid #666666;color: #666666;}
  259. &.btn3{background-color: #0391FD;color: #ffffff;margin-left: 22rpx;}
  260. }
  261. }
  262. // 记录
  263. &.rlist{padding-top:28rpx;
  264. .rtop{position: relative;padding-left: 22rpx;
  265. .rlistl{flex: 1;
  266. image{width: 30rpx;height: 30rpx;margin-right: 18rpx;}
  267. view{font-weight: bold;font-size: 28rpx;color: #161616;}
  268. }
  269. .right{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. .ytop{padding-bottom: 18rpx;}
  276. .ybox{padding-bottom: 14rpx;}
  277. .rbox{padding: 0 22rpx 8rpx 22rpx;
  278. .rboxa{width: 306rpx;height: 104rpx;position: relative;margin-bottom: 20rpx;
  279. .rbg{width: 100%;height: 100%;}
  280. .rboxb{box-sizing: border-box;padding:14rpx 0 16rpx 28rpx;
  281. position: absolute;left: 0;top: 0;right: 0;bottom: 0;
  282. .tit{font-weight: 500;font-size: 26rpx;color: #161616;margin-bottom: 10rpx;}
  283. .time{font-weight: 500;font-size: 22rpx;color: #666666;
  284. image{width: 18rpx;height: 18rpx;margin-right: 14rpx;flex: 0 0 auto;}
  285. }
  286. }
  287. }
  288. }
  289. }
  290. }
  291. </style>