bottomOperate.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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: 'sampleJob'
  74. },
  75. ],
  76. 3: [
  77. {
  78. name: '报工',
  79. type: 'inspection'
  80. },
  81. ]
  82. }
  83. }
  84. },
  85. methods: {
  86. open() {
  87. this.isOperate = !this.isOperate
  88. },
  89. operate(type) {
  90. this.$emit('operate', type)
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .bottom_box {
  97. background: #fff;
  98. }
  99. .nav_box {
  100. width: 750rpx;
  101. height: 40rpx;
  102. background: $theme-color;
  103. .open_icon {
  104. width: 48rpx;
  105. height: 48rpx;
  106. }
  107. .open_icon_reversal {
  108. transform: scaleY(-1);
  109. /* 垂直翻转 */
  110. }
  111. }
  112. .operate_list {
  113. margin: 0 32rpx;
  114. .list {
  115. border-radius: 8rpx;
  116. border: 1rpx solid $theme-color;
  117. background: #F0F8F2;
  118. height: 64rpx;
  119. padding: 0rpx 16rpx;
  120. margin-top: 16rpx;
  121. }
  122. .round {
  123. width: 32rpx;
  124. height: 32rpx;
  125. line-height: 32rpx;
  126. text-align: center;
  127. border-radius: 50%;
  128. background: $theme-color;
  129. font-size: 24rpx;
  130. font-style: normal;
  131. font-weight: 400;
  132. color: #fff;
  133. }
  134. .name {
  135. font-family: PingFang HK;
  136. font-size: 24rpx;
  137. font-style: normal;
  138. font-weight: 600;
  139. color: $theme-color;
  140. }
  141. .arrow_right {
  142. width: 32rpx;
  143. height: 32rpx;
  144. }
  145. }
  146. .btn_box {
  147. display: flex;
  148. padding: 16rpx 32rpx;
  149. align-items: flex-start;
  150. gap: 16rpx;
  151. align-self: stretch;
  152. .btn {
  153. width: 160rpx;
  154. height: 64rpx;
  155. line-height: 64rpx;
  156. background: $theme-color;
  157. text-align: center;
  158. border-radius: 8rpx;
  159. color: #fff;
  160. font-family: PingFang HK;
  161. font-size: 24rpx;
  162. font-style: normal;
  163. font-weight: 600;
  164. }
  165. }
  166. </style>