dialog-lot.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <dialog-base ref="baseDialog" title="添加新批次">
  3. <view class="list-title"><text class="label">批次号:{{form['batchNumber']}}</text></view>
  4. <view class="list-container">
  5. <view class="list-container-item uni-row">
  6. <text class="label">产品描述</text>
  7. <text class="label value">{{form['productDescription']}}</text>
  8. </view>
  9. <view class="list-container-item uni-row">
  10. <text class="label">关联箱号</text>
  11. <text class="label value">{{form['carrierName']}}</text>
  12. </view>
  13. <view class="list-container-item uni-row">
  14. <text class="label">当前工序</text>
  15. <text class="label value">{{form['totalWorkingHours']}}</text>
  16. </view>
  17. <view class="list-container-item uni-row" style="border-bottom: 1px solid #999999;">
  18. <text class="label">投产数量</text>
  19. <text class="label value">{{form['qualifiedQuantity']}}</text>
  20. </view>
  21. </view>
  22. <!-- <view class="list-title"><text class="label">请选择设备:</text></view>
  23. <view class="equipment-container uni-row ">
  24. <view v-for="(item, index) in equiments" :class="{'item':true,'selected': selectedButton === item}" :key="index" @click="selectButton(item)"><text class="label" >{{item}}</text></view>
  25. </view> -->
  26. <!-- </scroll-view> -->
  27. <view class="add-btn-container uni-row">
  28. <button type="primary" class="btn" @click="handleConfirm">确认</button>
  29. </view>
  30. </dialog-base>
  31. </template>
  32. <script setup>
  33. import {
  34. ref,
  35. getCurrentInstance
  36. } from 'vue'
  37. const baseDialog = ref(null)
  38. const selectedButton = ref(null)
  39. const form = ref({})
  40. const emit = defineEmits(['submit'])
  41. // const equiments = ref(['009-21','009-22','009-23','009-24','009-25','009-26','009-27','009-28','009-29'])
  42. // const selectButton = (data) => {
  43. // selectedButton.value = data;
  44. // }
  45. const open = (data) => {
  46. // console.log(dialog.value)
  47. form.value = data
  48. baseDialog.value.open()
  49. }
  50. const close = () => {
  51. baseDialog.value.close()
  52. }
  53. defineExpose({
  54. open
  55. })
  56. function handleScanCode(){
  57. uni.scanCode({
  58. onlyFromCamera: true,
  59. success: function (res) {
  60. }
  61. });
  62. }
  63. function handleConfirm(){
  64. emit('submit');
  65. close();
  66. }
  67. </script>
  68. <style lang="scss">
  69. .dialog-body {
  70. .list-title {
  71. margin: 40rpx 0 20rpx 0;
  72. .label {
  73. font-size: 32rpx;
  74. font-weight: bold;
  75. }
  76. }
  77. .list-container {
  78. width: 100%;
  79. display: flex;
  80. align-items: flex-start;
  81. padding: 0 4rpx;
  82. .list-container-item {
  83. width: 100%;
  84. border: 1px solid #999999;
  85. border-bottom: none;
  86. padding: 12rpx 8rpx;
  87. .label {
  88. font-size: 28rpx;
  89. color: gray;
  90. width: 144rpx;
  91. &.value {
  92. flex: 1;
  93. }
  94. }
  95. }
  96. }
  97. .add-btn-container {
  98. margin-top: 32rpx;
  99. .btn {
  100. flex: 1;
  101. }
  102. }
  103. }
  104. </style>