dialog-processInspection.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <dialog-base ref="baseDialog" title="请选择序检批次">
  3. <view>
  4. <uni-section title="批次" type="line">
  5. <uni-data-select v-model="selectedLot" :localdata="lotList" :clear="false"
  6. @change="handleLotChange"></uni-data-select>
  7. </uni-section>
  8. </view>
  9. <view class="add-btn-container uni-row">
  10. <button type="primary" class="btn" @click="handleStart">确定</button>
  11. </view>
  12. </dialog-base>
  13. </template>
  14. <script setup>
  15. import {
  16. ref
  17. } from 'vue'
  18. import {
  19. onLoad
  20. } from '@dcloudio/uni-app'
  21. import {
  22. store
  23. } from '@/store/index.js'
  24. const baseDialog = ref(null)
  25. const selectedLot = ref("")
  26. const lotList = ref([])
  27. const emit = defineEmits(['handleSelectProcessInspection'])
  28. // onLoad(() => {
  29. // })
  30. function open(data) {
  31. lotList.value = data.map(v => ({
  32. text: v.lotCode,
  33. value: v.lotCode,
  34. }))
  35. baseDialog.value.open();
  36. }
  37. function handleLotChange() {
  38. console.log("选中", selectedLot.value);
  39. }
  40. function handleStart() {
  41. emit('handleSelectProcessInspection', selectedLot.value);
  42. close()
  43. }
  44. function close() {
  45. baseDialog.value.close()
  46. }
  47. defineExpose({
  48. open
  49. })
  50. </script>
  51. <style lang="scss">
  52. .dialog-body {
  53. .equipment-container {
  54. height: 300rpx;
  55. overflow: auto;
  56. flex-wrap: wrap;
  57. justify-content: flex-start;
  58. margin: 24rpx 0 0 7%;
  59. .item {
  60. width: 236rpx;
  61. height: 60rpx;
  62. text-align: center;
  63. line-height: 60rpx;
  64. border-radius: 6rpx;
  65. margin: 16rpx;
  66. flex: 0 0 40%;
  67. border: 1px solid #000000;
  68. }
  69. .selected {
  70. background-color: #1684fc;
  71. color: #FFF;
  72. }
  73. }
  74. .add-btn-container {
  75. margin-top: 32rpx;
  76. .btn {
  77. flex: 1;
  78. }
  79. }
  80. .switch {
  81. font-size: 26rpx;
  82. align-items: center;
  83. justify-content: space-between;
  84. margin: 16rpx;
  85. }
  86. .userList {
  87. border: 1rpx solid #1684fc;
  88. border-radius: 8rpx;
  89. max-height: 300rpx;
  90. overflow: auto;
  91. width: 100%;
  92. .showUser {
  93. justify-content: flex-start;
  94. flex-wrap: wrap;
  95. .user {
  96. border: 1rpx solid #999;
  97. border-radius: 8rpx;
  98. width: 150rpx;
  99. height: 50rpx;
  100. text-align: center;
  101. line-height: 50rpx;
  102. margin: 10rpx;
  103. overflow: auto;
  104. }
  105. }
  106. }
  107. .selectedUserList {
  108. width: 100%;
  109. justify-content: flex-start;
  110. flex-wrap: wrap;
  111. .selectedUser {
  112. border: 1rpx solid #999;
  113. border-radius: 8rpx;
  114. width: 150rpx;
  115. height: 50rpx;
  116. text-align: center;
  117. line-height: 50rpx;
  118. margin: 20rpx 20rpx 0 0;
  119. justify-content: space-around;
  120. }
  121. }
  122. }
  123. </style>