Commit 0606c3d8a6e1990dd53d4ab9651ecef04b4bb859
1 parent
887fa33a
v1.9 优化营业报表页面查询条件 无法输入bug
Showing
1 changed file
with
12 additions
and
2 deletions
src/components/report/commonReportTable.vue
| ... | ... | @@ -7,8 +7,12 @@ |
| 7 | 7 | </div> |
| 8 | 8 | <el-row :gutter="20"> |
| 9 | 9 | <el-col v-for="(conditionItem, conditionIndex) in item.conditions" :key="conditionIndex" :span="6"> |
| 10 | - <el-input v-model.trim="conditionItem.value" :type="conditionItem.type" | |
| 11 | - :placeholder="conditionItem.holdpace" clearable /> | |
| 10 | + <div class="el-input"> | |
| 11 | + <input class="el-input__inner" | |
| 12 | + v-model.trim="conditionItem.value" | |
| 13 | + :type="conditionItem.type" | |
| 14 | + :placeholder="conditionItem.holdpace" /> | |
| 15 | + </div> | |
| 12 | 16 | </el-col> |
| 13 | 17 | <el-col :span="6"> |
| 14 | 18 | <el-button type="primary" @click="_queryReportTableMethod(item)"> |
| ... | ... | @@ -157,6 +161,12 @@ export default { |
| 157 | 161 | } |
| 158 | 162 | const { data } = await listReportCustomComponentCondition(params) |
| 159 | 163 | component.conditions = data |
| 164 | + // 确保每个条件项都包含响应式的 value 字段,避免 v-model 绑定后不显示 | |
| 165 | + component.conditions.forEach(cond => { | |
| 166 | + if (!Object.prototype.hasOwnProperty.call(cond, 'value')) { | |
| 167 | + this.$set(cond, 'value', '') | |
| 168 | + } | |
| 169 | + }) | |
| 160 | 170 | } catch (error) { |
| 161 | 171 | console.error('Failed to load conditions:', error) |
| 162 | 172 | } | ... | ... |