Commit 5ed82d9d by xinla

智能表单统计选项回显问题,删除提交数据中固定的省市区JSON数据树

1 parent eb6b80db
...@@ -552,6 +552,10 @@ export default { ...@@ -552,6 +552,10 @@ export default {
if (stylesx[i][q].formCodeId == 0) { if (stylesx[i][q].formCodeId == 0) {
that.readonly = false that.readonly = false
} }
// 删除提交数据中固定的省市区JSON数据树
else if (stylesx[i][q].formCodeId == 9) {
stylesx[i][q].options = []
}
} }
} }
...@@ -1099,6 +1103,10 @@ export default { ...@@ -1099,6 +1103,10 @@ export default {
if (stylesx[i][q].formCodeId == 0) { if (stylesx[i][q].formCodeId == 0) {
that.readonly = false that.readonly = false
} }
// 删除提交数据中固定的省市区JSON数据树
else if (stylesx[i][q].formCodeId == 9) {
stylesx[i][q].options = []
}
} }
} }
let t = 0 let t = 0
......
...@@ -469,6 +469,7 @@ export default { ...@@ -469,6 +469,7 @@ export default {
if (cloneCurItem.formCodeId == 9) { if (cloneCurItem.formCodeId == 9) {
cloneCurItem.defaultValue += '' cloneCurItem.defaultValue += ''
cloneCurItem.options = []
} else { } else {
// let str // let str
// for (let p = 0; p < cloneCurItem.options.length; p++) { // for (let p = 0; p < cloneCurItem.options.length; p++) {
......
...@@ -44,11 +44,11 @@ ...@@ -44,11 +44,11 @@
:key="index"> :key="index">
<template #default="{ row }"> <template #default="{ row }">
<div class="toe"> <div class="toe">
<span v-if="![8, 9, 10].includes(row.answer[index].formCodeId)"> <span v-if="![8, 9, 10, 6].includes(row.answer[index].formCodeId)">
{{ row.answer[index].defaultValue }} {{ row.answer[index].defaultValue }}
</span> </span>
<span v-else-if="row.answer[index].formCodeId == 8"> <span v-else-if="[8, 6].includes(row.answer[index].formCodeId)">
{{ row.answer[index].multiple ? multipleTrans(row.answer[index]) : row.answer[index].defaultValue }} {{ multipleTrans(row.answer[index]) }}
</span> </span>
<span v-else-if="row.answer[index].formCodeId == 9"> <span v-else-if="row.answer[index].formCodeId == 9">
{{ row.answer[index].ssq }} {{ row.answer[index].ssq }}
...@@ -285,14 +285,21 @@ export default { ...@@ -285,14 +285,21 @@ export default {
// that.baseList= res.data; // that.baseList= res.data;
}) })
}, },
// transDefaultValueToView(data) {
// debugger
// data = JSON.parse(JSON.stringify(data))
// let option = data.options.filter((e, index) => data.defaultValue.includes(index + ''))
// return option.map((e) => e.value).join(',')
// },
multipleTrans(data) { multipleTrans(data) {
data = JSON.parse(JSON.stringify(data)) data = JSON.parse(JSON.stringify(data))
data.viewValue = [] data.viewValue = []
if (typeof data.defaultValue === 'string') { data.defaultValue += ''
data.defaultValue = data.defaultValue.split(',') // if (typeof data.defaultValue === 'string') {
data.options = data.options.split(',') data.defaultValue = data.defaultValue.split(',')
data.viewValue = data.options.filter((e, index) => data.defaultValue.includes(index + '')) data.options = data.options.split(',')
} data.viewValue = data.options.filter((e, index) => data.defaultValue.includes(index + ''))
// }
return data.viewValue.join() return data.viewValue.join()
}, },
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!