Commit fb9d539b by 李伟康

fix(dailyNewspaper): 修复多选框取值逻辑并调整调试代码

1. 修正多选框组件的取值逻辑,直接取i[i.key]而非原有的判断type后的拼接
2. 移除onSelect方法中多余的console.log调试输出
3. 修复月度待办计数查询的key匹配错误,从F2-24改为F2-102
4. 优化月度待办计数赋值的代码可读性,新增中间变量item
5. 调整inject配置的空格格式
6. 恢复模板数据长度非空时调用getMonthlyPendingCount的逻辑
1 parent 86069986
......@@ -78,7 +78,7 @@ import DailyPopup from '../components/DailyPopup/index.vue'
export default {
name: 'StoreDailyReport',
components: { Table, Nothing, Footer, EditForm, FormItem, DailyPopup },
inject: ['userInfo', 'sceneType','dailyReportRecordId'],
inject: ['userInfo', 'sceneType', 'dailyReportRecordId'],
props: {
templateData: {
type: Array,
......@@ -108,7 +108,7 @@ export default {
this.list = utils.deepClone(val)
setTimeout(() => {
this.loadComplete = true
// if (val.length) this.getMonthlyPendingCount()
if (val.length) this.getMonthlyPendingCount()
}, 200)
},
immediate: true,
......@@ -251,13 +251,14 @@ export default {
sceneType,
reportDate
})
let index = list.findIndex(i => i.key == 'F2-24')
let index = list.findIndex(i => i.key == 'F2-102')
if (index == -1) return
if (this.list[index].value == null || this.list[index].value == '' || this.list[index].value == undefined) {
if (res) this.$set(this.list[index], 'value', res.pendingCount)
let item = list[index]
if (item.value == null || item.value == '' || item.value == undefined) {
if (res) this.$set(item, 'value', res.pendingCount)
}
},
save(){
save() {
this.$emit('checkReportDetail', this.list)
}
}
......
......@@ -156,7 +156,11 @@ export default {
keys.map(key => {
let i = data.find(i => i.key == key)
if (data[key]) value.push(data[key])
if (i) value.push(i.type == 'multipleSelect' ? i[i.key] : i.value || null)
if (i) value.push(i[i.key] || null)
if (key == 'F2-107-3') {
console.log(value)
}
})
let show = func(...value)
item.show = show
......@@ -175,9 +179,7 @@ export default {
this.$set(this.data[index], 'value', val)
},
onSelect(item, index) {
console.log(item, index)
let { key } = this.data[index]
console.log(this.data[index])
this.$set(this.data[index], key, item.value)
this.$set(this.data[index], 'value', item.label)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!