list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  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" 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. <block v-if="type=='visitor'">
  40. <view class="ylist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.recordId)">
  41. <view class="ytop flexc">
  42. <view class="tit" v-if="ite.recordName">{{ite.recordName.charAt(0)}}</view>
  43. <view class="cent">
  44. <view class="ctit">{{ite.recordName}}</view>
  45. </view>
  46. </view>
  47. <view class="ybox">
  48. <view class="yblist mw50"><text>出入时间</text>{{ite.recordDateTime}}</view>
  49. <view class="yblist mw50"><text>人员类型</text>{{kaType(ite.recordType,fklist)}}</view>
  50. <view class="yblist mw50"><text>手机号码</text>{{ite.recordPhone}}</view>
  51. <view class="yblist mw50"><text>记录来源</text>{{kaType(ite.recordSource,adrlist)}}</view>
  52. </view>
  53. <view class="ybtn">
  54. <view class="ybtns btn1" v-if="checkPermi(['system:record:remove'])" @click.stop="getDelFn(ite.recordId)">删除</view>
  55. </view>
  56. </view>
  57. </block>
  58. <!-- 人员信息权限 -->
  59. <block v-if="type=='limit'">
  60. <view class="ylist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.personneId)">
  61. <view class="ytop flexc">
  62. <view class="tit" v-if="ite.personneName">{{ite.personneName.charAt(0)}}</view>
  63. <view class="cent">
  64. <view class="ctit">{{ite.personneName}}</view>
  65. </view>
  66. </view>
  67. <view class="ybox">
  68. <view class="yblist mw50"><text>手机号码</text>{{ite.personnePhone}}</view>
  69. <view class="yblist mw50"><text>部门名称</text>{{ite.deptName}}</view>
  70. <view class="yblist mw50"><text>门禁</text>{{statusFormats(ite.guard,mjlist)}}</view>
  71. <view class="yblist mw50"><text>状态</text>{{ite.isEnable=='0'?'启用':'禁用'}}</view>
  72. </view>
  73. <view class="ybtn">
  74. <view class="ybtns btn1" v-if="checkPermi(['system:management:remove'])" @click.stop="getDelFn(ite.personneId)">删除</view>
  75. </view>
  76. </view>
  77. </block>
  78. <!-- 打卡列表 -->
  79. <block v-if="type=='clock'">
  80. <view class="ylist rlist" style="padding-top: 12rpx;" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite)">
  81. <view class="ytop flexc">
  82. <view class="tit" v-if="ite.userName">{{ite.userName.charAt(0)}}</view>
  83. <view class="cent">
  84. <view class="ctit">{{ite.userName}}的打卡记录</view>
  85. <view class="ctime">最新打卡:{{ite.recordTime}}</view>
  86. </view>
  87. <view class="rights" v-if="ite.type=='N'">
  88. <image :src="ybga"></image>
  89. <view>缺卡</view>
  90. <!-- <view>迟到</view> -->
  91. </view>
  92. </view>
  93. <view class="ybox">
  94. <view class="yblist mw50 line"><text>上班打卡</text>{{ite.workingTime}}
  95. <!-- <view class="tip">迟到</view> -->
  96. </view>
  97. <view class="yblist mw50"><text>下班打卡</text>{{ite.dutyTime}}
  98. </view>
  99. </view>
  100. </view>
  101. </block>
  102. <!-- 会议记录 -->
  103. <block v-if="type=='meetlist'">
  104. <view class="ylist rlist" style="padding-top: 12rpx;" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.conferenceRoomOrderId)">
  105. <view class="ytop flexc">
  106. <view class="ytit">{{ite.conferenceName}}</view>
  107. <!-- <view class="rights" v-if="ite.visitType==1">
  108. <image :src="ybga"></image>
  109. <view>已结束</view>
  110. <view>迟到</view>
  111. </view> -->
  112. </view>
  113. <view class="ybox">
  114. <view class="listsm">
  115. <view class="txt"><text class="tit">会议时间</text><text class="lh17">{{ite.startTime}} 至 {{ite.endTime}}</text></view>
  116. <view class="txt"><text class="tit">会议室</text><text>{{ite.conferenceRoomName}}</text></view>
  117. <view class="txt"><text class="tit">参会人数</text><text>{{ite.conferenceNumber}}人</text></view>
  118. <view class="txt"><text class="tit">会议要求</text><text>{{ite.remark}}</text></view>
  119. <view class="flexcj mb8">
  120. <view class="txt" style="margin-bottom: 0;"><text class="tit">席卡需求</text><text>{{ite.useXk=='Y'?'需要':'暂不'}}</text></view>
  121. <view class="delbtn" v-if="checkPermi(['system:order:remove'])" @click.stop="getDelFn(ite.conferenceRoomOrderId)">
  122. <image :src="delimg"></image>取消预约
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </block>
  129. <!-- 就餐记录 -->
  130. <block v-if="type=='eatlist'">
  131. <view class="ylist rlist" style="padding-top: 12rpx;" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.orderFoodId)">
  132. <view class="ytop flexc">
  133. <view class="ytit">{{ite.orderFoodUser}}</view>
  134. </view>
  135. <view class="ybox">
  136. <view class="listsm">
  137. <view class="txt"><text class="tit">就餐时间</text><text class="lh17">{{ite.orderFoodTime}}</text></view>
  138. <view class="flexcj mb8">
  139. <view class="txt" style="margin-bottom: 0;"><text class="tit">就餐类型</text><text>{{kaType(ite.orderFoodType,jclxlist)}}</text></view>
  140. <view class="delbtn" v-if="checkPermi(['system:food:remove'])" @click.stop="getDelFn(ite.orderFoodId)">
  141. <image :src="delimg"></image>取消预约
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. </block>
  148. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  149. </view>
  150. <block v-else>
  151. <no-data></no-data>
  152. </block>
  153. </view>
  154. </template>
  155. <script>
  156. import { selectDictValue } from '@/utils/common.js';
  157. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  158. import noData from "@/components/nodata/nodata.vue"
  159. export default {
  160. props:{
  161. datalist: {
  162. type: Array,
  163. default () {
  164. return []
  165. }
  166. },
  167. adrlist:{
  168. type: Array,
  169. default () {
  170. return []
  171. }
  172. },
  173. fklist:{
  174. type:Array,
  175. default () {
  176. return []
  177. }
  178. },
  179. jclxlist:{
  180. type: Array,
  181. default () {
  182. return []
  183. }
  184. },
  185. mjlist:{
  186. type:Array,
  187. default () {
  188. return []
  189. }
  190. },
  191. wtdt:{
  192. type: String,
  193. default () {
  194. return ''
  195. }
  196. },
  197. type:{
  198. type: [String,Number],
  199. default () {
  200. return ''
  201. }
  202. },
  203. },
  204. components:{
  205. noData
  206. },
  207. data(){
  208. return{
  209. time:require("@/static/images/home/time.png"),
  210. chose:require("@/static/images/home/chose.png"),
  211. close:require("@/static/images/home/close.png"),
  212. bgaimg:require("@/static/images/home/hbgg.png"),
  213. bgbimg:require("@/static/images/home/hbgh.png"),
  214. ybg:require("@/static/images/order/staff/ybg.png"),
  215. ybga:require("@/static/images/order/staff/ybga.png"),
  216. ysta:require("@/static/images/order/staff/ysta.png"),
  217. ystb:require("@/static/images/order/staff/ystb.png"),
  218. delimg:require("@/work/static/yuy/del.png")
  219. }
  220. },
  221. onLoad: function() {
  222. },
  223. methods:{
  224. checkPermi, checkRole,
  225. kaType(data, list) {
  226. return selectDictValue(list, data);
  227. },
  228. statusFormats(ite,list,type){//多选匹配
  229. if(ite){
  230. var actions = [];
  231. list.forEach(s => {
  232. if(ite.indexOf(s.dictValue)>-1){
  233. actions.push(s.dictLabel);
  234. }
  235. })
  236. return actions.join(',')
  237. }else{
  238. return ''
  239. }
  240. },
  241. getDelFn(id){
  242. var that=this;
  243. uni.showModal({
  244. title: '确认删除',
  245. content: "是否确认删除该预约",
  246. cancelText: '取消',
  247. confirmText: '确认',
  248. success: function(res) {
  249. if (res.confirm) {
  250. that.$emit("getDelFn",id)
  251. } else if (res.cancel) {
  252. // console.log('用户点击取消');
  253. }
  254. }
  255. });
  256. },
  257. gettypeFn(type,id){
  258. var that=this;
  259. var str="拒绝"
  260. if(type==3){
  261. str='同意'
  262. }
  263. uni.showModal({
  264. title: '确认'+str,
  265. content: "是否确认"+str+"该预约",
  266. cancelText: '取消',
  267. confirmText: '确认',
  268. success: function(res) {
  269. if (res.confirm) {
  270. var newobj={
  271. type:type,
  272. id:id
  273. }
  274. that.$emit("gettypeFn",newobj)
  275. } else if (res.cancel) {
  276. // console.log('用户点击取消');
  277. }
  278. }
  279. });
  280. },
  281. getDetail(e){
  282. this.$emit('getDetail',e)
  283. },
  284. typeFn(data){
  285. if(data){
  286. var newArr=[]
  287. var astr=data.split('-')
  288. astr.forEach(ite=>{
  289. var a=ite.substring(0,5);
  290. newArr.push(a)
  291. })
  292. return newArr.join('-')
  293. }else{
  294. return ''
  295. }
  296. },
  297. },
  298. }
  299. </script>
  300. <style lang="scss" scoped>
  301. // 预约
  302. .ylist{background: #FFFFFF;border-radius: 14rpx;margin-bottom: 30rpx;position: relative;
  303. .ystaimg{width: 140rpx;height: 140rpx;top: 22rpx;right: 22rpx;position: absolute;}
  304. .ytop{padding: 16rpx 0 24rpx 16rpx;
  305. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  306. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  307. .cent{
  308. flex: 1;
  309. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  310. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  311. }
  312. .right{position: relative;flex: 0 0 auto;margin-left: 10rpx;
  313. image{width: 144rpx;height: 56rpx;}
  314. 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;}
  315. }
  316. .rights{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  317. image{width: 100%;height: 100%;}
  318. view{font-weight: 500;font-size: 20rpx;
  319. 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;}
  320. }
  321. }
  322. .ytit{font-weight: bold;font-size: 28rpx;color: #161616;flex: 1;}
  323. .ybox{padding: 0rpx 24rpx 24rpx 16rpx;display: flex;flex-wrap: wrap;
  324. .yblist{display: flex;font-size: 24rpx;font-weight: 500;color: #161616;padding: 6rpx 0 6rpx 8rpx;line-height: 40rpx;position: relative;
  325. text{font-weight: normal;color: #aaa;flex: 0 0 auto;width: 100rpx;text-align-last: justify;margin-right: 12rpx;}
  326. .tip{border-radius: 12rpx;font-weight: 500;font-size: 16rpx;color: #F87C29;border: 2rpx solid #F87C29;height: 28rpx;box-sizing: border-box;
  327. display: flex;align-items: center;padding: 0 8rpx;margin-left: 12rpx;flex: 0 0 auto;margin-top: 6rpx;
  328. }
  329. &.line{
  330. &::after{
  331. position: absolute;content: '';width: 2rpx;height: 30rpx;background: #CDCDCD;right: 0;top: 9rpx;
  332. }
  333. }
  334. }
  335. .listsm{padding: 28rpx 10rpx 2rpx 0;width: 100%;border-top: 2rpx solid #DADADA;
  336. .tit{margin-right: 8rpx;flex: 0 0 auto;min-width:110rpx;text-align-last: justify;margin-right: 20rpx;color: #aaa;}
  337. .line{margin-right: 8rpx;color: #aaaaaa;flex: 0 0 auto;}
  338. .txt{font-size: 26rpx;color: #161616;margin-bottom: 16rpx;display: flex;padding-left: 10rpx;}
  339. .flexcw{
  340. display: flex;align-items: center;flex-wrap: wrap;
  341. .txt{min-width: 50%;}
  342. }
  343. }
  344. }
  345. .ybtn{border-top: 2rpx solid #DADADA;padding: 20rpx 18rpx;display: flex;align-items: center;
  346. .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;
  347. &.btn1{border: 2rpx solid #FC3838;color: #FC3838;}
  348. &.btn2{border: 2rpx solid #666666;color: #666666;}
  349. &.btn3{background-color: #0391FD;color: #ffffff;margin-left: 22rpx;}
  350. }
  351. }
  352. // 记录
  353. &.rlist{padding-top:28rpx;
  354. .rtop{position: relative;padding-left: 22rpx;
  355. .rlistl{flex: 1;
  356. image{width: 30rpx;height: 30rpx;margin-right: 18rpx;}
  357. view{font-weight: bold;font-size: 28rpx;color: #161616;}
  358. }
  359. .right{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  360. image{width: 100%;height: 100%;}
  361. view{font-weight: 500;font-size: 20rpx;
  362. 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;}
  363. }
  364. }
  365. .ytop{padding-bottom: 18rpx;}
  366. .ybox{padding-bottom: 14rpx;}
  367. .rbox{padding: 0 22rpx 8rpx 22rpx;
  368. .rboxa{width: 306rpx;height: 104rpx;position: relative;margin-bottom: 20rpx;
  369. .rbg{width: 100%;height: 100%;}
  370. .rboxb{box-sizing: border-box;padding:14rpx 0 16rpx 28rpx;
  371. position: absolute;left: 0;top: 0;right: 0;bottom: 0;
  372. .tit{font-weight: 500;font-size: 26rpx;color: #161616;margin-bottom: 10rpx;}
  373. .time{font-weight: 500;font-size: 22rpx;color: #666666;
  374. image{width: 18rpx;height: 18rpx;margin-right: 14rpx;flex: 0 0 auto;}
  375. }
  376. }
  377. }
  378. }
  379. }
  380. .delbtn{font-weight: 500;font-size: 22rpx;color: #FF6969;display: flex;align-items: center;flex: 0 0 auto;
  381. image{width: 28rpx;height: 26rpx;margin-right: 8rpx;}
  382. }
  383. }
  384. </style>