兼容格式问题

This commit is contained in:
2025-06-16 08:53:05 +08:00
parent 78833fe7d7
commit cb982796a7
+18 -1
View File
@@ -36,7 +36,9 @@
</el-form-item> </el-form-item>
</template> </template>
</template> </template>
<el-button type="primary" @click="saveData" :disabled="isSubmit">确认</el-button> <el-button type="primary" @click="saveData" :disabled="isSubmit"
>确认</el-button
>
<el-button type="primary" @click="handleDownload(loaderData)" <el-button type="primary" @click="handleDownload(loaderData)"
>下载全部文件</el-button >下载全部文件</el-button
> >
@@ -156,16 +158,20 @@ async function getData() {
FormJson: json_info, FormJson: json_info,
}; };
} }
let fromdata = true;
CeErpOrderFormData.value.content = CeErpOrderFormData.value.content.replace(/\n/g, ' ')
if (CeErpOrderFormData.value && CeErpOrderFormData.value.content) { if (CeErpOrderFormData.value && CeErpOrderFormData.value.content) {
console.log( console.log(
"🚀 ~ getData ~ CeErpOrderFormData.value.content:", "🚀 ~ getData ~ CeErpOrderFormData.value.content:",
CeErpOrderFormData.value.content CeErpOrderFormData.value.content
); );
try {
CeErpOrderFormData.value = { CeErpOrderFormData.value = {
content: JSON.parse(CeErpOrderFormData.value.content), content: JSON.parse(CeErpOrderFormData.value.content),
id: CeErpOrderFormData.value.ID, id: CeErpOrderFormData.value.ID,
tid: CeErpOrderFormData.value.tid, tid: CeErpOrderFormData.value.tid,
}; };
CeErpOrderFormData.value?.content.map((item) => { CeErpOrderFormData.value?.content.map((item) => {
if ( if (
item.type == "upload" && item.type == "upload" &&
@@ -177,6 +183,14 @@ async function getData() {
}); });
} }
}); });
} catch (error) {
console.error("getData ~ error:", error);
fromdata = false;
ElMessage({
message: "数据解析错误",
type: "error",
});
}
} }
product.FormJson = json_info; product.FormJson = json_info;
if (product && product.FormJson != "") { if (product && product.FormJson != "") {
@@ -188,6 +202,7 @@ async function getData() {
} else { } else {
item.content = ""; item.content = "";
} }
if (fromdata) {
if (CeErpOrderFormData.value && CeErpOrderFormData.value.content) { if (CeErpOrderFormData.value && CeErpOrderFormData.value.content) {
CeErpOrderFormData.value.content.map((e) => { CeErpOrderFormData.value.content.map((e) => {
if (e.title === item.title && e.type === item.type) { if (e.title === item.title && e.type === item.type) {
@@ -195,6 +210,8 @@ async function getData() {
} }
}); });
} }
}
if (item.title == "手机号") { if (item.title == "手机号") {
need = false; need = false;
} }