bottomOperate.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="bottom_box">
  3. <view class="nav_box rx-cc" @click="open">
  4. <image class="open_icon" :class="{open_icon_reversal : isOperate}" src="~@/static/pda/open.svg"></image>
  5. </view>
  6. <view class="operate_list" v-show="isOperate">
  7. <view v-for="(item, index) in btnList[btnState]" :key="index" class="list rx-bc" @click="operate(item.type)">
  8. <view class="round">{{index + 1}}</view>
  9. <view class="name">{{item.name}}</view>
  10. <image class="arrow_right" src="~@/static/pda/arrow_right.svg"></image>
  11. </view>
  12. </view>
  13. <view class="btn_box">
  14. <view class="btn">暂停</view>
  15. <view class="btn">终止</view>
  16. <view class="btn">转派</view>
  17. <view class="btn">工单交接</view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. state: String | Number,
  25. },
  26. watch: {
  27. btns: {
  28. immediate: true,
  29. deep: true,
  30. handler(newVal) {
  31. this.btnsList = []
  32. this.btnsList = newVal
  33. }
  34. },
  35. state: {
  36. immediate: true,
  37. deep: true,
  38. handler(newVal) {
  39. this.btnState = newVal
  40. }
  41. }
  42. },
  43. data() {
  44. return {
  45. isOperate: false,
  46. btnsList: [],
  47. btnState: 1,
  48. btnList: {
  49. 1: [{
  50. name: '领料',
  51. type: 'picking'
  52. },
  53. {
  54. name: '投料',
  55. type: 'feeding'
  56. },
  57. {
  58. name: '报工',
  59. type: 'jobBooking'
  60. },
  61. {
  62. name: '更换周转车',
  63. type: 'turnover'
  64. }
  65. ],
  66. 2: [
  67. {
  68. name: '取样',
  69. type: 'sample'
  70. },
  71. {
  72. name: '报工',
  73. type: 'jobBooking'
  74. },
  75. ]
  76. }
  77. }
  78. },
  79. methods: {
  80. open() {
  81. this.isOperate = !this.isOperate
  82. },
  83. operate(type) {
  84. this.$emit('operate', type)
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .bottom_box {
  91. background: #fff;
  92. }
  93. .nav_box {
  94. width: 750rpx;
  95. height: 40rpx;
  96. background: $theme-color;
  97. .open_icon {
  98. width: 48rpx;
  99. height: 48rpx;
  100. }
  101. .open_icon_reversal {
  102. transform: scaleY(-1);
  103. /* 垂直翻转 */
  104. }
  105. }
  106. .operate_list {
  107. margin: 0 32rpx;
  108. .list {
  109. border-radius: 8rpx;
  110. border: 1rpx solid $theme-color;
  111. background: #F0F8F2;
  112. height: 64rpx;
  113. padding: 0rpx 16rpx;
  114. margin-top: 16rpx;
  115. }
  116. .round {
  117. width: 32rpx;
  118. height: 32rpx;
  119. line-height: 32rpx;
  120. text-align: center;
  121. border-radius: 50%;
  122. background: $theme-color;
  123. font-size: 24rpx;
  124. font-style: normal;
  125. font-weight: 400;
  126. color: #fff;
  127. }
  128. .name {
  129. font-family: PingFang HK;
  130. font-size: 24rpx;
  131. font-style: normal;
  132. font-weight: 600;
  133. color: $theme-color;
  134. }
  135. .arrow_right {
  136. width: 32rpx;
  137. height: 32rpx;
  138. }
  139. }
  140. .btn_box {
  141. display: flex;
  142. padding: 16rpx 32rpx;
  143. align-items: flex-start;
  144. gap: 16rpx;
  145. align-self: stretch;
  146. .btn {
  147. width: 160rpx;
  148. height: 64rpx;
  149. line-height: 64rpx;
  150. background: $theme-color;
  151. text-align: center;
  152. border-radius: 8rpx;
  153. color: #fff;
  154. font-family: PingFang HK;
  155. font-size: 24rpx;
  156. font-style: normal;
  157. font-weight: 600;
  158. }
  159. }
  160. </style>