bottomOperate.vue 3.0 KB

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