refactor(ctr): 优化合同创建页面逻辑

- 添加 active.value 的日志输出,便于调试
- 调整 back 函数,增加日志输出并更新表单步骤
- 简化 resetForm 函数,移除不必要的逻辑
This commit is contained in:
tcy
2025-08-21 16:43:00 +08:00
parent f0577d7d27
commit 9f45f2e3b5

View File

@ -217,6 +217,8 @@ const onUploadSuccess = (data) => {
fileList.value = data fileList.value = data
} }
const back = async (reset) => { const back = async (reset) => {
console.log(active.value);
if (reset) { if (reset) {
await ElMessageBox.confirm('返回上一步将清空目前填写的内容,确定返回?', '提示', { await ElMessageBox.confirm('返回上一步将清空目前填写的内容,确定返回?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -231,6 +233,8 @@ const back = async (reset) => {
} else { } else {
active.value--; active.value--;
} }
console.log(active.value);
form.value.step = active.value; form.value.step = active.value;
}; };
@ -273,10 +277,8 @@ const resetForm = () => {
fileList.value = []; fileList.value = [];
tempFileList.value = []; tempFileList.value = [];
contract_type.value = ''; contract_type.value = '';
active.value = 0;
setTimeout(() => { setTimeout(() => {
localStorage.removeItem("tempContractForm"); localStorage.removeItem("tempContractForm");
}, 0); }, 0);
}; };
const submitForm = async () => { const submitForm = async () => {