Commit 178215c7 by 李伟康

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

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