servicePrice.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class="service-price">
  3. <div class="service-form">
  4. <div class="service-form-title">服务报价</div>
  5. <el-form ref="formRef" :model="form" label-width="86px">
  6. <el-form-item label="人工服务" prop="manual" class="input-unit">
  7. <el-input v-if="isEdit" v-model.number="form.manual" placeholder="请输入数字">
  8. <template #append>元/亩</template>
  9. </el-input>
  10. <div v-else class="service-form-value">12<span class="unit">元/亩</span></div>
  11. </el-form-item>
  12. <el-form-item label="无人机服务" prop="drone" class="input-unit">
  13. <el-input v-if="isEdit" v-model.number="form.drone" placeholder="请输入数字">
  14. <template #append>元/亩</template>
  15. </el-input>
  16. <div v-else class="service-form-value">120<span class="unit">元/亩</span></div>
  17. </el-form-item>
  18. </el-form>
  19. </div>
  20. <div class="page-action" v-if="isEdit">
  21. <div class="btn-item cancel" @click="isEdit = false">取消</div>
  22. <div class="btn-right">
  23. <div class="btn-item primary" @click="isEdit = false">保存服务报价</div>
  24. </div>
  25. </div>
  26. <div class="page-action" v-else>
  27. <div class="btn-item primary center-btn" @click="isEdit = true">编辑服务报价</div>
  28. </div>
  29. </div>
  30. </template>
  31. <script setup>
  32. import { ref, reactive } from "vue";
  33. // 表单模型与选项
  34. const formRef = ref();
  35. const form = reactive({
  36. manual: "",
  37. drone: "",
  38. });
  39. const isEdit = ref(false);
  40. </script>
  41. <style lang="scss" scoped>
  42. .service-price {
  43. width: 100%;
  44. height: 100%;
  45. .service-form {
  46. margin: 12px;
  47. padding: 12px 12px 2px 12px;
  48. background: #ffffff;
  49. border-radius: 8px;
  50. .service-form-title {
  51. font-size: 16px;
  52. color: #000000;
  53. margin-bottom: 10px;
  54. }
  55. .service-form-value {
  56. border: 1px solid rgba(24, 24, 24, 0.1);
  57. border-radius: 5px;
  58. padding: 0 10px;
  59. width: 100%;
  60. height: 30px;
  61. line-height: 30px;
  62. .unit {
  63. color: rgba(0, 0, 0, 0.3);
  64. padding-left: 8px;
  65. }
  66. }
  67. ::v-deep {
  68. .el-form-item__label {
  69. color: rgba(0, 0, 0, 0.4);
  70. font-size: 14px;
  71. }
  72. .el-form-item--default {
  73. margin-bottom: 16px;
  74. }
  75. .el-input__wrapper {
  76. box-shadow: none;
  77. }
  78. .el-input-group__append {
  79. padding: 0 10px;
  80. background: none;
  81. box-shadow: none;
  82. color: rgba(0, 0, 0, 0.3);
  83. }
  84. .input-unit {
  85. .el-input {
  86. border: 1px solid rgba(24, 24, 24, 0.3);
  87. border-radius: 5px;
  88. height: 30px;
  89. box-sizing: border-box;
  90. }
  91. .el-input__wrapper {
  92. padding: 0 2px 0 10px;
  93. height: 28px;
  94. line-height: 28px;
  95. min-height: 28px;
  96. }
  97. .el-input__inner {
  98. --el-input-inner-height: 28px;
  99. height: 28px;
  100. line-height: 28px;
  101. min-height: 28px;
  102. color: #000000;
  103. // --el-input-placeholder-color: rgba(33, 153, 248, 0.43);
  104. }
  105. }
  106. }
  107. }
  108. .page-action {
  109. position: fixed;
  110. left: 0;
  111. right: 0;
  112. bottom: 0;
  113. padding: 12px 12px;
  114. background: #fff;
  115. box-shadow: 2px 2px 4.5px rgba(0, 0, 0, 0.4);
  116. display: flex;
  117. justify-content: space-between;
  118. align-items: center;
  119. .btn-item {
  120. height: 40px;
  121. line-height: 41px;
  122. border-radius: 20px;
  123. width: fit-content;
  124. padding: 0 20px;
  125. color: #666666;
  126. font-size: 14px;
  127. &.del {
  128. color: #ff943d;
  129. background: rgba(255, 148, 61, 0.1);
  130. }
  131. &.cancel {
  132. border: 1px solid rgba(153, 153, 153, 0.5);
  133. }
  134. &.primary {
  135. color: #fff;
  136. background: linear-gradient(#76c3ff, #2199f8);
  137. }
  138. }
  139. .center-btn {
  140. margin: 0 auto;
  141. }
  142. .btn-right {
  143. display: flex;
  144. gap: 10px;
  145. }
  146. }
  147. }
  148. </style>