瀏覽代碼

fix: 农场基本信息

lxf 4 天之前
父節點
當前提交
b05221c433
共有 3 個文件被更改,包括 16 次插入4 次删除
  1. 1 1
      src/plugins/axios.js
  2. 1 1
      src/plugins/permission.js
  3. 14 2
      src/views/old_mini/home/subPages/prescriptionPage.vue

+ 1 - 1
src/plugins/axios.js

@@ -115,7 +115,7 @@ const install = (app, { router, store, opt }) => {
                     case 401: {
                         message = "未授权,请登录";
                         router.replace({
-                            name: "Login",
+                            name: "dev_login",
                         });
                         break;
                     }

+ 1 - 1
src/plugins/permission.js

@@ -59,7 +59,7 @@ export default {
             } else {
                 let token = sessionStorage.getItem("token");
                 if (!token || !/\S/.test(token)) {
-                    next({ name: "Login" });
+                    next({ name: "dev_login" });
                 } else {
                     NProgress.start();
                     if (to.name === "DiscoverIndex") {

+ 14 - 2
src/views/old_mini/home/subPages/prescriptionPage.vue

@@ -140,7 +140,7 @@
         <!-- 按钮 -->
         <div class="custom-bottom-fixed-btns">
             <!-- <div class="bottom-btn secondary-btn" @click="handlePage">跳过</div> -->
-            <div class="bottom-btn primary-btn" @click.stop="submit" @touchstart.stop @touchend.stop>确认信息</div>
+            <el-button class="bottom-btn primary-btn" :loading="loading" @click.stop="submit" @touchstart.stop @touchend.stop>确认信息</el-button>
         </div>
     </div>
 
@@ -330,6 +330,7 @@ onBeforeUnmount(() => {
 
 onDeactivated(() => {
     saveDraft();
+    loading.value = false;
 });
 
 const formNameObj = ref({
@@ -599,6 +600,9 @@ const showSuccessPopup = ref(false);
 const handleSuccessConfirm = () => {
     router.push('/agri_record');
 }
+
+
+const loading = ref(false);
 async function submit() {
     try {
         // 正式提交
@@ -626,8 +630,11 @@ async function submit() {
             }
         }
 
+        loading.value = true;
+
         const apiCall = route.query.subjectId ? VE_API.basic_farm.saveBasicFarmInfo(paramsData) : VE_API.basic_farm.saveBasicFarmInfoByExpertV3(paramsData);
         apiCall.then((res) => {
+            loading.value = false;
             if (res.code === 0) {
                 // showSuccessPopup.value = true;
                 if (route.query.subjectId) {
@@ -646,6 +653,7 @@ async function submit() {
             }
         })
     } catch (error) {
+        loading.value = false;
         console.error('提交失败:', error);
         ElMessage.error('提交失败,请重试');
         return false;
@@ -1049,7 +1057,7 @@ const handlePeriodConfirm = async () => {
                                 border-radius: 6px;
                                 // padding: 13px 21px;
                                 height: 40px;
-                                width: 107px;
+                                width: 104px;
                                 display: flex;
                                 align-items: center;
                                 justify-content: center;
@@ -1371,6 +1379,10 @@ const handlePeriodConfirm = async () => {
     pointer-events: auto; // 确保可以接收点击事件
 
     .bottom-btn {
+        
+        height: 40px;
+        padding: 0 30px;
+        line-height: 40px;
         cursor: pointer;
         user-select: none; // 防止文本选择
         touch-action: manipulation; // 优化移动端触摸响应