dialog-end-work.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <dialog-base ref="baseDialog" title="结束报工">
  3. <view class="list-container">
  4. <view class="list-title"><text class="label">合格量</text></view>
  5. <view class="table-item">
  6. <input class="input" v-model="workInfo.qualified" placeholder="请输入合格量" />
  7. </view>
  8. <view class="list-title">
  9. <text class="label">废品量</text>
  10. </view>
  11. <view class="table-item"><input class="input" v-model="workInfo.amount" placeholder="请输入废品量" /></view>
  12. <view class="list-title">
  13. <text class="label">废品原因</text>
  14. </view>
  15. <view class="table-item"><input class="input" v-model="workInfo.reason" placeholder="请输入废品原因" /></view>
  16. <view class="list-title uni-row">
  17. <text class="label">当前序是否完成</text>
  18. <switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" style="transform:scale(0.7)" />
  19. </view>
  20. <view class="list-title"><text class="label">请选择设备:</text></view>
  21. <!-- <scroll-view class="scroll-container" scroll-y> -->
  22. <checkbox-group class="equipment-container uni-row" @change="checkboxChange">
  23. <checkbox v-for="(item,index) in equiments" class="checkbox" style="transform:scale(0.8)" :key="index" :value="item" :checked="item.checked" >
  24. {{item}}
  25. </checkbox>
  26. </checkbox-group>
  27. </view>
  28. <view class="add-btn-container uni-row">
  29. <button type="default" class="btn" @click="handleFinishReporting">结束报工</button>
  30. </view>
  31. </dialog-base>
  32. </template>
  33. <script setup>
  34. import {
  35. ref,
  36. getCurrentInstance
  37. } from 'vue'
  38. const baseDialog = ref(null)
  39. const equiments = ref(['009-21','009-22','009-23','009-24','009-25','009-26','009-27','009-28','009-29','009-26','009-27'])
  40. const workInfo = ref({})
  41. const open = (data) => {
  42. // console.log(dialog.value)
  43. baseDialog.value.open()
  44. }
  45. function switchChange(event) {
  46. if(event.detail.value) {
  47. workInfo.value.status = "2"
  48. }
  49. else {
  50. workInfo.value.status = "1"
  51. }
  52. }
  53. function checkboxChange(event) {
  54. console.log(event.detail.value)
  55. workInfo.value.equiments = event.detail.value
  56. }
  57. function handleFinishReporting(){
  58. console.log(workInfo.value,"123")
  59. }
  60. defineExpose({
  61. open
  62. })
  63. </script>
  64. <style lang="scss">
  65. .dialog-body {
  66. .list-container {
  67. width: 100%;
  68. display: flex;
  69. align-items: flex-start;
  70. padding: 0 4rpx;
  71. .list-title {
  72. margin-top: 24rpx;
  73. .label {
  74. font-size: 32rpx;
  75. }
  76. }
  77. .switch {
  78. margin-top: -8rpx;
  79. align-items: center;
  80. }
  81. .equipment-container {
  82. width: 100%;
  83. height: 120rpx;
  84. flex-wrap: wrap;
  85. justify-content: flex-start;
  86. overflow: auto;
  87. .checkbox {
  88. padding: 12rpx 0;
  89. justify-content: center;
  90. align-items: center;
  91. }
  92. }
  93. .table-item {
  94. margin-top: 24rpx;
  95. .input {
  96. height: 60rpx;
  97. border: 1px solid #808080;
  98. }
  99. }
  100. }
  101. .add-btn-container {
  102. margin-top: 32rpx;
  103. .btn {
  104. flex: 1;
  105. background-color: rgba(255,85,85,1);
  106. color: #FFFFFF;
  107. }
  108. }
  109. }
  110. </style>