list.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <view v-if="datalist.length>0">
  4. <!-- 预约 -->
  5. <block v-if="type==1">
  6. <view class="ylist" v-for="(ite,idx) in datalist" :key='idx' @click="getDetail(ite.reservatId)">
  7. </view>
  8. </block>
  9. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  10. </view>
  11. <block v-else>
  12. <no-data></no-data>
  13. </block>
  14. </view>
  15. </template>
  16. <script>
  17. import { selectDictValue } from '@/utils/common.js';
  18. import noData from "@/components/nodata/nodata.vue"
  19. export default {
  20. props:{
  21. datalist: {
  22. type: Array,
  23. default () {
  24. return []
  25. }
  26. },
  27. adrlist:{
  28. type: Array,
  29. default () {
  30. return []
  31. }
  32. },
  33. wtdt:{
  34. type: String,
  35. default () {
  36. return ''
  37. }
  38. },
  39. type:{
  40. type: [String,Number],
  41. default () {
  42. return ''
  43. }
  44. },
  45. },
  46. components:{
  47. noData
  48. },
  49. data(){
  50. return{
  51. }
  52. },
  53. onLoad: function() {
  54. },
  55. methods:{
  56. kaType(data, list) {
  57. return selectDictValue(list, data);
  58. },
  59. getDelFn(id){
  60. var that=this;
  61. uni.showModal({
  62. title: '确认删除',
  63. content: "是否确认删除该预约",
  64. cancelText: '取消',
  65. confirmText: '确认',
  66. success: function(res) {
  67. if (res.confirm) {
  68. that.$emit("getDelFn",id)
  69. } else if (res.cancel) {
  70. // console.log('用户点击取消');
  71. }
  72. }
  73. });
  74. },
  75. gettypeFn(type,id){
  76. var that=this;
  77. var str="拒绝"
  78. if(type==3){
  79. str='同意'
  80. }
  81. uni.showModal({
  82. title: '确认'+str,
  83. content: "是否确认"+str+"该预约",
  84. cancelText: '取消',
  85. confirmText: '确认',
  86. success: function(res) {
  87. if (res.confirm) {
  88. var newobj={
  89. type:type,
  90. id:id
  91. }
  92. that.$emit("gettypeFn",newobj)
  93. } else if (res.cancel) {
  94. // console.log('用户点击取消');
  95. }
  96. }
  97. });
  98. },
  99. getDetail(e){
  100. this.$emit('getDetail',e)
  101. },
  102. typeFn(data){
  103. if(data){
  104. var newArr=[]
  105. var astr=data.split('-')
  106. astr.forEach(ite=>{
  107. var a=ite.substring(0,5);
  108. newArr.push(a)
  109. })
  110. return newArr.join('-')
  111. }else{
  112. return ''
  113. }
  114. },
  115. },
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. // 预约
  120. .ylist{background: #FFFFFF;border-radius: 14rpx;margin-bottom: 30rpx;position: relative;
  121. }
  122. </style>