dj-tabbar.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="d-flex w-100 tabbar">
  3. <view class="flex-1 d-flex a-center j-center" v-show="!commitInfo.name" @click="submit">主保养人</view>
  4. <view class="flex-1 d-flex a-center j-center flex-column" v-show="commitInfo.name" @click="submit">
  5. <view class="u-m-b-8">保养人:{{ commitInfo.name }}</view>
  6. <view>日期: {{ commitInfo.time | slice_time }}</view>
  7. </view>
  8. <view class="flex-1 d-flex a-center j-center" v-show="!squadInfo.name" @click="Squad">跟线人员</view>
  9. <view class="flex-1 d-flex a-center j-center flex-column" v-show="squadInfo.name" @click="Squad">
  10. <view class="u-m-b-8">跟线人:{{ squadInfo.name }}</view>
  11. <view>日期: {{ squadInfo.time | slice_time }}</view>
  12. </view>
  13. <view class="flex-1 d-flex a-center j-center" v-show="!supervisorInfo.name" @click="Supervisor">班长确认</view>
  14. <view class="flex-1 d-flex a-center j-center flex-column" v-show="supervisorInfo.name" @click="Supervisor">
  15. <view class="u-m-b-8">班长:{{ supervisorInfo.name }}</view>
  16. <view>日期: {{ supervisorInfo.time | slice_time}}</view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. // 是否需要提交 0不要 1要
  24. // needCommit: {
  25. // type: Number,
  26. // default: 0
  27. // },
  28. // // 是否需要班组长确认 0不要 1要
  29. // needSquad: {
  30. // type: Number,
  31. // default: 0
  32. // },
  33. // // 是是否需要领导确认 0不要 1要
  34. // needSupervisor: {
  35. // type: Number,
  36. // default: 0
  37. // },
  38. // 主保养人
  39. commitInfo: {
  40. type: Object,
  41. default: function() {
  42. return {}
  43. }
  44. },
  45. // 根线人员信息
  46. squadInfo: {
  47. type: Object,
  48. default: function() {
  49. return {}
  50. }
  51. },
  52. // 班长确认信息
  53. supervisorInfo: {
  54. type: Object,
  55. default: function() {
  56. return {}
  57. }
  58. }
  59. },
  60. methods: {
  61. submit() {
  62. console.log(this.noTap());
  63. if(!this.noTap()) return uni.showToast({
  64. title: '班长已确认,不能操作',
  65. duration: 2000,
  66. icon: 'none',
  67. position: 'top'
  68. });
  69. this.$emit('submit')
  70. },
  71. Squad() {
  72. if(!this.noTap()) return uni.showToast({
  73. title: '班长已确认,不能操作',
  74. duration: 2000,
  75. icon: 'none',
  76. position: 'top'
  77. });
  78. this.$emit('Squad')
  79. },
  80. Supervisor() {
  81. if(!this.noTap()) return uni.showToast({
  82. title: '班长已确认,不能操作',
  83. duration: 2000,
  84. icon: 'none',
  85. position: 'top'
  86. });
  87. this.$emit('Supervisor')
  88. },
  89. // 班长确认了就不能点击了
  90. noTap(){
  91. return this.supervisorInfo.name ? false : true
  92. }
  93. },
  94. filters: {
  95. slice_time(time) {
  96. if(!time) return
  97. return time.slice(0,10)
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. .tabbar {
  104. height: 55px;
  105. background: $dj-white-color;
  106. border-top: 5px solid #F1F2F6;
  107. color: $dj-primary-color;
  108. }
  109. .tabbar>view+view {
  110. border-left: 1px solid #DCDCDC;
  111. }
  112. </style>