Commit 178215c7 by 李伟康

fix(dailyNewspaper): 修复值判断逻辑和条件渲染问题

- 统一使用严格相等运算符 !== 替代 != 进行空值检查
- 在StoreDailyReport详情页添加v-if条件渲染避免空数组显示
- 修复StoreDailyReport编辑页数据赋值时的空值判断逻辑
1 parent b0457862
......@@ -68,7 +68,7 @@ export default {
},
methods: {
formatValue (value) {
return value != null && value !== undefined && value !== '' ? value : '-'
return value !== null && value !== undefined && value !== '' ? value : '-'
},
formatData (data) {
try {
......
......@@ -121,7 +121,7 @@ export default {
this.$set(this.list[index].children, c_index, utils.deepClone(data))
},
formatValue (value) {
return value != null && value != '' ? value : '-'
return value !== null && value !=='' && value !== undefined ? value : '-'
}
}
}
......
......@@ -117,7 +117,7 @@ export default {
return prevItem && prevItem.type === 'group';
},
formatValue (value) {
return value != null && value !== undefined && value !== '' ? value : '-'
return value !== null && value !== undefined && value !== '' ? value : '-'
},
formatData (list) {
this.list = utils.deepClone(list)
......
......@@ -11,6 +11,7 @@
<view
class="list-box"
:key="`subform-${index}`"
v-if="item.children && item.children.length"
>
<view class="list-title">{{ item.label }}</view>
<Table
......
......@@ -243,7 +243,7 @@ export default {
reportDate
})
let index = list.findIndex(i => i.key == 'F2-24')
this.$set(this.list[index], 'value', res)
if(this.list[index].value == null || this.list[index].value == '' || this.list[index].value == undefined) this.$set(this.list[index], 'value', res)
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!