Browse Source

修复bug

ZaiZai 1 year ago
parent
commit
6fe713e646
1 changed files with 19 additions and 23 deletions
  1. 19 23
      src/views/project/admin/create.vue

+ 19 - 23
src/views/project/admin/create.vue

@@ -388,7 +388,6 @@ const cancelClick = () => {
 const formRef = ref(null)
 const formRef = ref(null)
 const creatLoading = ref(false)
 const creatLoading = ref(false)
 const createClick = async () => {
 const createClick = async () => {
-    const form = formInfo.value
     let list = []
     let list = []
     yearOptions.value.forEach((ele) => {
     yearOptions.value.forEach((ele) => {
         let yearForm = ele.yearForm
         let yearForm = ele.yearForm
@@ -405,27 +404,24 @@ const createClick = async () => {
     //判断状态
     //判断状态
     creatLoading.value = false
     creatLoading.value = false
     if (!error && code === 200) {
     if (!error && code === 200) {
-        window?.$message?.success(msg)
-        console.log(form.id, 'form.id')
-        if (isNullES(form.id)) {
-            baseForm.value = {}
-            yearOptions.value = [{
-                value: '',
-                label: '',
-                yearForm: {
-                    yearlyInvest: '',
-                    oneInvest: '',
-                    twoInvest: '',
-                    threeInvest: '',
-                    fourInvest: '',
-                    yearlyTarget: '',
-                    onePlan: '',
-                    twoPlan: '',
-                    threePlan: '',
-                    fourPlan: '',
-                },
-            }]
-        }
+        window.$message.success(msg)
+        baseForm.value = {}
+        yearOptions.value = [{
+            value: '',
+            label: '',
+            yearForm: {
+                yearlyInvest: '',
+                oneInvest: '',
+                twoInvest: '',
+                threeInvest: '',
+                fourInvest: '',
+                yearlyTarget: '',
+                onePlan: '',
+                twoPlan: '',
+                threePlan: '',
+                fourPlan: '',
+            },
+        }]
     } else {
     } else {
         window.$message.error(msg ?? '操作失败')
         window.$message.error(msg ?? '操作失败')
     }
     }
@@ -449,7 +445,7 @@ const saveClick = async () => {
     //判断状态
     //判断状态
     creatLoading.value = false
     creatLoading.value = false
     if (!error && code === 200) {
     if (!error && code === 200) {
-        window?.$message?.success(msg)
+        window.$message.success(msg)
         cancelClick()
         cancelClick()
     } else {
     } else {
         window.$message.error(msg ?? '操作失败')
         window.$message.error(msg ?? '操作失败')