Zimo 1 giorno fa
parent
commit
dbe4dae7c9
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      pages/recordFilling/detail.vue

+ 6 - 4
pages/recordFilling/detail.vue

@@ -611,7 +611,7 @@ onLoad(async option => {
       wellNamePair: {},
     };
 
-    taskOptions.value = Object.keys(daily.wellNamePair).map(key => ({
+    taskOptions.value = Object.keys(daily.wellNamePair ?? {}).map(key => ({
       text: daily.wellNamePair[key],
       value: Number(key),
     }));
@@ -638,6 +638,7 @@ onLoad(async option => {
   console.log("🚀 ~ params.value:", params.value);
   // 处理是否可编辑 {0: '待填写', 1: '已完成', 2: '填写中', 3: '忽略'}
   isView.value = params.value?.orderStatus % 2 == 0;
+
   console.log("🚀 ~ isView.value:", isView.value);
 });
 const paging = ref(null);
@@ -1390,10 +1391,11 @@ const isSubmitting = ref(false); // 添加提交状态
 const formRef = ref(null);
 
 const onSubmit = async () => {
-  if (!formRef.value) return;
   try {
-    for (const item of formRef.value) {
-      await item.validate();
+    if (formRef.value) {
+      for (const item of formRef.value) {
+        await item.validate();
+      }
     }
   } catch (error) {
     return;