bottomOperate.vue 3.5 KB

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