bottomOperate.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. 4: [{
  84. name: '领料',
  85. type: 'picking'
  86. },
  87. {
  88. name: '投料',
  89. type: 'feeding'
  90. },
  91. {
  92. name: '报工',
  93. type: 'jobBooking'
  94. },
  95. ],
  96. 5: [{
  97. name: '入库',
  98. type: 'warehousing'
  99. },
  100. ],
  101. }
  102. }
  103. },
  104. created() {
  105. this.getTwoTree()
  106. },
  107. methods: {
  108. getTwoTree() {
  109. getTwoTreeByPid(12).then(res => {
  110. let _arr = res.map(m => {
  111. m.type = 'inspection'
  112. return m
  113. })
  114. this.btnList[3] = []
  115. this.btnList[3] = [
  116. ..._arr,
  117. {
  118. name: '报工',
  119. type: 'inspectionJob'
  120. }
  121. ]
  122. })
  123. },
  124. open() {
  125. this.isOperate = !this.isOperate
  126. },
  127. operate(type, item) {
  128. this.$emit('operate', type, item)
  129. },
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .bottom_box {
  135. background: #fff;
  136. }
  137. .nav_box {
  138. width: 750rpx;
  139. height: 40rpx;
  140. background: $theme-color;
  141. .open_icon {
  142. width: 48rpx;
  143. height: 48rpx;
  144. }
  145. .open_icon_reversal {
  146. transform: scaleY(-1);
  147. /* 垂直翻转 */
  148. }
  149. }
  150. .operate_list {
  151. margin: 0 32rpx;
  152. .list {
  153. border-radius: 8rpx;
  154. border: 1rpx solid $theme-color;
  155. background: #F0F8F2;
  156. height: 64rpx;
  157. padding: 0rpx 16rpx;
  158. margin-top: 16rpx;
  159. }
  160. .round {
  161. width: 32rpx;
  162. height: 32rpx;
  163. line-height: 32rpx;
  164. text-align: center;
  165. border-radius: 50%;
  166. background: $theme-color;
  167. font-size: 24rpx;
  168. font-style: normal;
  169. font-weight: 400;
  170. color: #fff;
  171. }
  172. .name {
  173. font-family: PingFang HK;
  174. font-size: 24rpx;
  175. font-style: normal;
  176. font-weight: 600;
  177. color: $theme-color;
  178. }
  179. .arrow_right {
  180. width: 32rpx;
  181. height: 32rpx;
  182. }
  183. }
  184. .btn_box {
  185. display: flex;
  186. padding: 16rpx 32rpx;
  187. align-items: flex-start;
  188. gap: 16rpx;
  189. align-self: stretch;
  190. .btn {
  191. width: 160rpx;
  192. height: 64rpx;
  193. line-height: 64rpx;
  194. background: $theme-color;
  195. text-align: center;
  196. border-radius: 8rpx;
  197. color: #fff;
  198. font-family: PingFang HK;
  199. font-size: 24rpx;
  200. font-style: normal;
  201. font-weight: 600;
  202. }
  203. }
  204. </style>