list.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. <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 w50"><text>预约日期</text>{{ite.visitDate}}</view>
  22. <view class="yblist w50"><text>预约时间</text>{{ite.visitTime}}</view>
  23. <view class="yblist w50"><text>手机号码</text>{{ite.visitPhone}}</view>
  24. <view class="yblist w50"><text>人 数</text>{{ite.visitNum}}</view>
  25. <view class="yblist w50"><text>来访地点</text>{{kaType(ite.appointmentSite,adrlist)}}</view>
  26. <view class="yblist w50"><text>来访事由</text>{{ite.visitReason}}</view>
  27. </view>
  28. <view class="ybtn">
  29. <view class="ybtns btn1" @click.stop="getDelFn(ite.reservatId)">删除</view>
  30. <view class="flex1"></view>
  31. <block v-if="ite.visitType==1">
  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. <view class="shax" v-if="wtdt">{{wtdt}}</view>
  39. </view>
  40. <block v-else>
  41. <no-data></no-data>
  42. </block>
  43. </view>
  44. </template>
  45. <script>
  46. import { selectDictValue } from '@/utils/common.js';
  47. import noData from "@/components/nodata/nodata.vue"
  48. export default {
  49. props:{
  50. datalist: {
  51. type: Array,
  52. default () {
  53. return []
  54. }
  55. },
  56. adrlist:{
  57. type: Array,
  58. default () {
  59. return []
  60. }
  61. },
  62. wtdt:{
  63. type: String,
  64. default () {
  65. return ''
  66. }
  67. },
  68. type:{
  69. type: [String,Number],
  70. default () {
  71. return ''
  72. }
  73. },
  74. },
  75. components:{
  76. noData
  77. },
  78. data(){
  79. return{
  80. ybga:require("@/static/images/order/staff/ybg.png"),
  81. ysta:require("@/static/images/order/staff/ysta.png"),
  82. ystb:require("@/static/images/order/staff/ystb.png"),
  83. }
  84. },
  85. onLoad: function() {
  86. },
  87. methods:{
  88. kaType(data, list) {
  89. return selectDictValue(list, data);
  90. },
  91. getDelFn(id){
  92. var that=this;
  93. uni.showModal({
  94. title: '确认删除',
  95. content: "是否确认删除该预约",
  96. cancelText: '取消',
  97. confirmText: '确认',
  98. success: function(res) {
  99. if (res.confirm) {
  100. that.$emit("getDelFn",id)
  101. } else if (res.cancel) {
  102. // console.log('用户点击取消');
  103. }
  104. }
  105. });
  106. },
  107. gettypeFn(type,id){
  108. var that=this;
  109. var str="拒绝"
  110. if(type==3){
  111. str='同意'
  112. }
  113. uni.showModal({
  114. title: '确认'+str,
  115. content: "是否确认"+str+"该预约",
  116. cancelText: '取消',
  117. confirmText: '确认',
  118. success: function(res) {
  119. if (res.confirm) {
  120. var newobj={
  121. type:type,
  122. id:id
  123. }
  124. that.$emit("gettypeFn",newobj)
  125. } else if (res.cancel) {
  126. // console.log('用户点击取消');
  127. }
  128. }
  129. });
  130. },
  131. getDetail(e){
  132. this.$emit('getDetail',e)
  133. },
  134. typeFn(data){
  135. if(data){
  136. var newArr=[]
  137. var astr=data.split('-')
  138. astr.forEach(ite=>{
  139. var a=ite.substring(0,5);
  140. newArr.push(a)
  141. })
  142. return newArr.join('-')
  143. }else{
  144. return ''
  145. }
  146. },
  147. },
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. // 预约
  152. .ylist{background: #FFFFFF;border-radius: 14rpx;margin-bottom: 30rpx;position: relative;
  153. .ystaimg{width: 140rpx;height: 140rpx;top: 22rpx;right: 22rpx;position: absolute;}
  154. .ytop{padding: 16rpx 0 24rpx 16rpx;
  155. .tit{width: 62rpx;height: 62rpx;background: #0391FD;border-radius: 6rpx;font-weight: 500;
  156. font-size: 34rpx;color: #FFFFFF;margin-right: 18rpx;text-align: center;line-height: 62rpx;flex: 0 0 auto;}
  157. .cent{
  158. flex: 1;
  159. .ctit{font-weight: bold;font-size: 28rpx;color: #161616;margin-bottom: 6rpx;}
  160. .ctime{font-weight: 500;font-size: 18rpx;color: #666666;}
  161. }
  162. .right{position: relative;flex: 0 0 auto;margin-left: 10rpx;
  163. image{width: 144rpx;height: 56rpx;}
  164. 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;}
  165. }
  166. }
  167. .ybox{padding: 0rpx 24rpx 24rpx;display: flex;flex-wrap: wrap;
  168. .yblist{display: flex;font-size: 24rpx;font-weight: 500;color: #161616;width: 100%;padding: 6rpx 0;line-height: 40rpx;
  169. text{font-weight: normal;color: #aaa;flex: 0 0 auto;width: 100rpx;text-align-last: justify;margin-right: 12rpx;}
  170. }
  171. }
  172. .ybtn{border-top: 2rpx solid #DADADA;padding: 20rpx 18rpx;display: flex;align-items: center;
  173. .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;
  174. &.btn1{border: 2rpx solid #FC3838;color: #FC3838;}
  175. &.btn2{border: 2rpx solid #666666;color: #666666;}
  176. &.btn3{background-color: #0391FD;color: #ffffff;margin-left: 22rpx;}
  177. }
  178. }
  179. }
  180. </style>