dialog-turnoverApplication.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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="btn uni-row">
  6. <view :class="{ 'middle-btn': true, 'active': isLeftTurnoverType }"
  7. @click="selectTurnoverType('leftType')"><text class="label">车间内周转</text></view>
  8. <view :class="{ 'middle-btn': true, 'active': isRightTurnoverType }"
  9. @click="selectTurnoverType('rightType')"><text class="label">车间外周转</text></view>
  10. </view>
  11. <view class="list-title">
  12. <text class="label">请选择周转位置</text>
  13. </view>
  14. <view class="list-container">
  15. <view class="btn uni-row">
  16. <view :class="{ 'middle-btn': true, 'active': isLeftTurnoverDoor }"
  17. @click="selectTurnoverDoor('leftDoor')"><text class="label">A门</text></view>
  18. <view :class="{ 'middle-btn': true, 'active': isRightTurnoverDoor }"
  19. @click="selectTurnoverDoor('rightDoor')"><text class="label">B门</text></view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="add-btn-container uni-row">
  24. <button type="default" class="btn" >确认</button>
  25. </view>
  26. </dialog-base>
  27. </template>
  28. <script setup>
  29. import {
  30. ref,
  31. getCurrentInstance
  32. } from 'vue'
  33. const baseDialog = ref(null)
  34. const isLeftTurnoverType = ref(false)
  35. const isRightTurnoverType = ref(false)
  36. const isLeftTurnoverDoor = ref(false)
  37. const isRightTurnoverDoor = ref(false)
  38. const selectTurnoverType = (data) => {
  39. if (data === 'leftType') {
  40. isLeftTurnoverType.value = !isLeftTurnoverType.value;
  41. isRightTurnoverType.value = false; // 右边按钮恢复为非活动状态
  42. } else if (data === 'rightType') {
  43. isRightTurnoverType.value = !isRightTurnoverType.value;
  44. isLeftTurnoverType.value = false; // 左边按钮恢复为非活动状态
  45. }
  46. }
  47. const selectTurnoverDoor = (data) => {
  48. if (data === 'leftDoor') {
  49. isLeftTurnoverDoor.value = !isLeftTurnoverDoor.value;
  50. isRightTurnoverDoor.value = false; // 右边按钮恢复为非活动状态
  51. } else if (data === 'rightDoor') {
  52. isRightTurnoverDoor.value = !isRightTurnoverDoor.value;
  53. isLeftTurnoverDoor.value = false; // 左边按钮恢复为非活动状态
  54. }
  55. }
  56. const open = (data) => {
  57. // console.log(dialog.value)
  58. baseDialog.value.open()
  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. .btn {
  78. justify-content: space-between;
  79. margin-top: 24rpx;
  80. .middle-btn {
  81. margin-right: 32rpx;
  82. align-items: center;
  83. justify-content: center;
  84. padding-left: 0;
  85. height: 80rpx;
  86. width: 240rpx;
  87. border-radius: 8rpx;
  88. background-color: #FFFFFF;
  89. border: 1px solid #999999;
  90. background-color: #FFFFFF;
  91. }
  92. .label {
  93. font-size: 24rpx;
  94. color: #000000;
  95. }
  96. .active {
  97. border-color: #1684fc;
  98. background-color: rgb(236, 245, 255);
  99. .label {
  100. color: #1684fc;
  101. }
  102. }
  103. }
  104. }
  105. .add-btn-container {
  106. margin-top: 32rpx;
  107. .btn {
  108. flex: 1;
  109. background-color: rgb(255, 121, 1);
  110. color: #FFFFFF;
  111. }
  112. }
  113. }
  114. </style>