list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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="flexcj mb8">
  118. <view class="txt" style="margin-bottom: 0;"><text class="tit">参会人数</text><text>{{ite.conferenceNumber}}人</text></view>
  119. <view class="delbtn" v-if="checkPermi(['system:order:remove'])" @click.stop="getDelFn(ite.conferenceRoomOrderId)">
  120. <image :src="delimg"></image>取消预约
  121. </view>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. </block>
  127. <!-- 就餐记录 -->
  128. <block v-if="type=='eatlist'">
  129. <view class="ylist rlist" style="padding-top: 12rpx;" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.orderFoodId)">
  130. <view class="ytop flexc">
  131. <view class="ytit">{{ite.orderFoodUser}}</view>
  132. </view>
  133. <view class="ybox">
  134. <view class="listsm">
  135. <view class="txt"><text class="tit">就餐时间</text><text class="lh17">{{ite.orderFoodTime}}</text></view>
  136. <view class="flexcj mb8">
  137. <view class="txt" style="margin-bottom: 0;"><text class="tit">就餐类型</text><text>{{kaType(ite.orderFoodType,jclxlist)}}</text></view>
  138. <view class="delbtn" v-if="checkPermi(['system:food:remove'])" @click.stop="getDelFn(ite.orderFoodId)">
  139. <image :src="delimg"></image>取消预约
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </block>
  146. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  147. </view>
  148. <block v-else>
  149. <no-data></no-data>
  150. </block>
  151. </view>
  152. </template>
  153. <script>
  154. import { selectDictValue } from '@/utils/common.js';
  155. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  156. import noData from "@/components/nodata/nodata.vue"
  157. export default {
  158. props:{
  159. datalist: {
  160. type: Array,
  161. default () {
  162. return []
  163. }
  164. },
  165. adrlist:{
  166. type: Array,
  167. default () {
  168. return []
  169. }
  170. },
  171. fklist:{
  172. type:Array,
  173. default () {
  174. return []
  175. }
  176. },
  177. jclxlist:{
  178. type: Array,
  179. default () {
  180. return []
  181. }
  182. },
  183. mjlist:{
  184. type:Array,
  185. default () {
  186. return []
  187. }
  188. },
  189. wtdt:{
  190. type: String,
  191. default () {
  192. return ''
  193. }
  194. },
  195. type:{
  196. type: [String,Number],
  197. default () {
  198. return ''
  199. }
  200. },
  201. },
  202. components:{
  203. noData
  204. },
  205. data(){
  206. return{
  207. time:require("@/static/images/home/time.png"),
  208. chose:require("@/static/images/home/chose.png"),
  209. close:require("@/static/images/home/close.png"),
  210. bgaimg:require("@/static/images/home/hbgg.png"),
  211. bgbimg:require("@/static/images/home/hbgh.png"),
  212. ybg:require("@/static/images/order/staff/ybg.png"),
  213. ybga:require("@/static/images/order/staff/ybga.png"),
  214. ysta:require("@/static/images/order/staff/ysta.png"),
  215. ystb:require("@/static/images/order/staff/ystb.png"),
  216. delimg:require("@/work/static/yuy/del.png")
  217. }
  218. },
  219. onLoad: function() {
  220. },
  221. methods:{
  222. checkPermi, checkRole,
  223. kaType(data, list) {
  224. return selectDictValue(list, data);
  225. },
  226. statusFormats(ite,list,type){//多选匹配
  227. if(ite){
  228. var actions = [];
  229. list.forEach(s => {
  230. if(ite.indexOf(s.dictValue)>-1){
  231. actions.push(s.dictLabel);
  232. }
  233. })
  234. return actions.join(',')
  235. }else{
  236. return ''
  237. }
  238. },
  239. getDelFn(id){
  240. var that=this;
  241. uni.showModal({
  242. title: '确认删除',
  243. content: "是否确认删除该预约",
  244. cancelText: '取消',
  245. confirmText: '确认',
  246. success: function(res) {
  247. if (res.confirm) {
  248. that.$emit("getDelFn",id)
  249. } else if (res.cancel) {
  250. // console.log('用户点击取消');
  251. }
  252. }
  253. });
  254. },
  255. gettypeFn(type,id){
  256. var that=this;
  257. var str="拒绝"
  258. if(type==3){
  259. str='同意'
  260. }
  261. uni.showModal({
  262. title: '确认'+str,
  263. content: "是否确认"+str+"该预约",
  264. cancelText: '取消',
  265. confirmText: '确认',
  266. success: function(res) {
  267. if (res.confirm) {
  268. var newobj={
  269. type:type,
  270. id:id
  271. }
  272. that.$emit("gettypeFn",newobj)
  273. } else if (res.cancel) {
  274. // console.log('用户点击取消');
  275. }
  276. }
  277. });
  278. },
  279. getDetail(e){
  280. this.$emit('getDetail',e)
  281. },
  282. typeFn(data){
  283. if(data){
  284. var newArr=[]
  285. var astr=data.split('-')
  286. astr.forEach(ite=>{
  287. var a=ite.substring(0,5);
  288. newArr.push(a)
  289. })
  290. return newArr.join('-')
  291. }else{
  292. return ''
  293. }
  294. },
  295. },
  296. }
  297. </script>
  298. <style lang="scss" scoped>
  299. // 预约
  300. .ylist{background: #FFFFFF;border-radius: 14rpx;margin-bottom: 30rpx;position: relative;
  301. .ystaimg{width: 140rpx;height: 140rpx;top: 22rpx;right: 22rpx;position: absolute;}
  302. .ytop{padding: 16rpx 0 24rpx 16rpx;
  303. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  304. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  305. .cent{
  306. flex: 1;
  307. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  308. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  309. }
  310. .right{position: relative;flex: 0 0 auto;margin-left: 10rpx;
  311. image{width: 144rpx;height: 56rpx;}
  312. 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;}
  313. }
  314. .rights{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  315. image{width: 100%;height: 100%;}
  316. view{font-weight: 500;font-size: 20rpx;
  317. 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;}
  318. }
  319. }
  320. .ytit{font-weight: bold;font-size: 28rpx;color: #161616;flex: 1;}
  321. .ybox{padding: 0rpx 24rpx 24rpx 16rpx;display: flex;flex-wrap: wrap;
  322. .yblist{display: flex;font-size: 24rpx;font-weight: 500;color: #161616;padding: 6rpx 0 6rpx 8rpx;line-height: 40rpx;position: relative;
  323. text{font-weight: normal;color: #aaa;flex: 0 0 auto;width: 100rpx;text-align-last: justify;margin-right: 12rpx;}
  324. .tip{border-radius: 12rpx;font-weight: 500;font-size: 16rpx;color: #F87C29;border: 2rpx solid #F87C29;height: 28rpx;box-sizing: border-box;
  325. display: flex;align-items: center;padding: 0 8rpx;margin-left: 12rpx;flex: 0 0 auto;margin-top: 6rpx;
  326. }
  327. &.line{
  328. &::after{
  329. position: absolute;content: '';width: 2rpx;height: 30rpx;background: #CDCDCD;right: 0;top: 9rpx;
  330. }
  331. }
  332. }
  333. .listsm{padding: 28rpx 10rpx 2rpx 0;width: 100%;border-top: 2rpx solid #DADADA;
  334. .tit{margin-right: 8rpx;flex: 0 0 auto;min-width:110rpx;text-align-last: justify;margin-right: 20rpx;color: #aaa;}
  335. .line{margin-right: 8rpx;color: #aaaaaa;flex: 0 0 auto;}
  336. .txt{font-size: 26rpx;color: #161616;margin-bottom: 16rpx;display: flex;padding-left: 10rpx;}
  337. .flexcw{
  338. display: flex;align-items: center;flex-wrap: wrap;
  339. .txt{min-width: 50%;}
  340. }
  341. }
  342. }
  343. .ybtn{border-top: 2rpx solid #DADADA;padding: 20rpx 18rpx;display: flex;align-items: center;
  344. .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;
  345. &.btn1{border: 2rpx solid #FC3838;color: #FC3838;}
  346. &.btn2{border: 2rpx solid #666666;color: #666666;}
  347. &.btn3{background-color: #0391FD;color: #ffffff;margin-left: 22rpx;}
  348. }
  349. }
  350. // 记录
  351. &.rlist{padding-top:28rpx;
  352. .rtop{position: relative;padding-left: 22rpx;
  353. .rlistl{flex: 1;
  354. image{width: 30rpx;height: 30rpx;margin-right: 18rpx;}
  355. view{font-weight: bold;font-size: 28rpx;color: #161616;}
  356. }
  357. .right{position: relative;width: 96rpx;height: 38rpx;right: 0;top: 0;
  358. image{width: 100%;height: 100%;}
  359. view{font-weight: 500;font-size: 20rpx;
  360. 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;}
  361. }
  362. }
  363. .ytop{padding-bottom: 18rpx;}
  364. .ybox{padding-bottom: 14rpx;}
  365. .rbox{padding: 0 22rpx 8rpx 22rpx;
  366. .rboxa{width: 306rpx;height: 104rpx;position: relative;margin-bottom: 20rpx;
  367. .rbg{width: 100%;height: 100%;}
  368. .rboxb{box-sizing: border-box;padding:14rpx 0 16rpx 28rpx;
  369. position: absolute;left: 0;top: 0;right: 0;bottom: 0;
  370. .tit{font-weight: 500;font-size: 26rpx;color: #161616;margin-bottom: 10rpx;}
  371. .time{font-weight: 500;font-size: 22rpx;color: #666666;
  372. image{width: 18rpx;height: 18rpx;margin-right: 14rpx;flex: 0 0 auto;}
  373. }
  374. }
  375. }
  376. }
  377. }
  378. .delbtn{font-weight: 500;font-size: 22rpx;color: #FF6969;display: flex;align-items: center;flex: 0 0 auto;
  379. image{width: 28rpx;height: 26rpx;margin-right: 8rpx;}
  380. }
  381. }
  382. </style>