Popu.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="assign-container">
  3. <u-popup :show="popShow" @close="close">
  4. <view class="container-list">
  5. <view
  6. class="list-item"
  7. v-for="(item, index) in statusList"
  8. :key="index"
  9. @click="chooseItem(item)"
  10. >
  11. {{ item.label }}
  12. </view>
  13. <view class="list-item cancel" @click="close"> 取消 </view>
  14. </view>
  15. </u-popup>
  16. </view>
  17. </template>
  18. <script>
  19. import { post, get, postJ } from '@/utils/api.js'
  20. export default {
  21. data () {
  22. return {
  23. popShow: false,
  24. statusList: [
  25. { value: 'START', label: '启动' },
  26. { value: 'RUN', label: '运行' },
  27. { value: 'STOP', label: '停机' },
  28. { value: 'IDLE', label: '空闲' },
  29. { value: 'TOBE_MATERIAL', label: '待料' },
  30. { value: 'FAULT', label: '故障' },
  31. { value: 'REPAIR', label: '检修' }
  32. ]
  33. }
  34. },
  35. created () {},
  36. methods: {
  37. //工单id
  38. open (id) {
  39. this.popShow = true
  40. },
  41. close () {
  42. this.popShow = false
  43. },
  44. chooseItem (item) {
  45. this.$emit('change', item)
  46. this.popShow = false
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .assign-container {
  53. max-height: 70vh;
  54. background: #e7e7e7;
  55. .container-list {
  56. .list-item {
  57. width: 100%;
  58. text-align: center;
  59. line-height: 90rpx;
  60. height: 90rpx;
  61. border-bottom: 1rpx solid #e7e7e7;
  62. &.cancel {
  63. background-color: rgba(242, 242, 242, 1);
  64. }
  65. }
  66. }
  67. }
  68. </style>