diff --git a/src/axios.js b/src/axios.js index 2adf1480..0304be4a 100644 --- a/src/axios.js +++ b/src/axios.js @@ -10,7 +10,7 @@ import router from '@/router/'; // Vue路由 import { serialize } from 'utils/util'; // 序列化工具函数,通常用于处理请求参数 import { getToken } from 'utils/auth'; // 用于获取存储的Token import { isURL } from 'utils/validate'; // 验证字符串是否为URL的函数 -import { ElMessage } from 'element-plus'; // Element-Plus中的消息提示组件 +import { ElMessage,ElMessageBox } from 'element-plus'; // Element-Plus中的消息提示组件 import website from '@/config/website'; // 站点配置文件,可以配置一些通用信息如clientId、clientSecret import NProgress from 'nprogress'; // 页面顶部进度条 import 'nprogress/nprogress.css'; // 进度条样式 @@ -19,6 +19,7 @@ import { baseUrl } from '@/config/env'; // API基础URL import crypto from '@/utils/crypto'; // 加密工具,可能用于加密Token等 import {ref} from 'vue'; let msg = ref(''); // 错误信息 +let isAlertShowing = false; // 新增的标志变量 // 存储待取消的HTTP请求的键值对,用于取消重复的请求 const pendingRequests = new Map(); @@ -135,7 +136,19 @@ axios.interceptors.response.use( if (statusWhiteList.includes(status)) return Promise.reject(res); // 如果状态码为401,则表示用户未认证,需跳转到登录页 - if (status === 401) store.dispatch('FedLogOut').then(() => router.push({ path: '/login' })); + if (status === 401 && !isAlertShowing){ + isAlertShowing = true; // 设置为 true 表示弹窗正在显示 + ElMessageBox.alert('长时间未操作,登录已过期,请重新登录', '提示', { + confirmButtonText: '确定', + showClose: false, // 不显示关闭按钮 + closeOnPressEscape: false, // 禁止通过 ESC 键关闭 + closeOnClickModal: false, // 禁止点击遮罩关闭 + callback: (action) => { + isAlertShowing = false; // 恢复为 false 表示弹窗已经关闭 + store.dispatch('FedLogOut').then(() => router.push({ path: '/login' })); + }, + }); + } // 如果response的状态码不是200,则显示消息提示,并返回Promise的reject状态 if (status !== 200 && status !== '0' && status !== '1') { diff --git a/src/views/aftersales/aftersalesWorkOrder.vue b/src/views/aftersales/aftersalesWorkOrder.vue index 2a551e29..223787cf 100644 --- a/src/views/aftersales/aftersalesWorkOrder.vue +++ b/src/views/aftersales/aftersalesWorkOrder.vue @@ -4911,7 +4911,7 @@ const AssignSubmission = () => { :deep(.el_tabs) { width: 100%; display: flex; - flex-direction: column; + flex-direction: column-reverse; justify-content: space-between; .el-tabs__content { padding: 0; diff --git a/src/views/aftersales/aftersalesWorkOrderend.vue b/src/views/aftersales/aftersalesWorkOrderend.vue index c38b7fcc..3bd09256 100644 --- a/src/views/aftersales/aftersalesWorkOrderend.vue +++ b/src/views/aftersales/aftersalesWorkOrderend.vue @@ -10,7 +10,7 @@
- + - + @@ -371,7 +371,7 @@ v-model="item.paymentUnit" placeholder="请输入支付单位" clearable - :disabled="$route.query.RouterState == 'end'" + :disabled="!PermissionButton.Submission_results" /> @@ -382,7 +382,7 @@ value-format="YYYY-MM-DD HH:mm:ss" placeholder="理赔支付时间" size="default" - :disabled="$route.query.RouterState == 'end'" + :disabled="!PermissionButton.Submission_results" /> @@ -391,7 +391,7 @@ placeholder="请选择支付方式" style="width: 100%" clearable - :disabled="$route.query.RouterState == 'end'" + :disabled="!PermissionButton.Submission_results" > diff --git a/src/views/distribution/deliverylist/distributionDeliveryList.vue b/src/views/distribution/deliverylist/distributionDeliveryList.vue index 84b386db..faba5ed0 100644 --- a/src/views/distribution/deliverylist/distributionDeliveryList.vue +++ b/src/views/distribution/deliverylist/distributionDeliveryList.vue @@ -1009,9 +1009,17 @@ export default { this.title = '查看'; this.view = true; this.box = true; - getDetail(row.id).then(res => { + if(row.id){ + getDetail(row.id).then(res => { this.form = res.data.data; }); + }else{ + ElMessage({ + message: '数据错误,刷新页面重新尝试', + type: 'warning', + }) + } + }, handleViewBlank(row) { this.$router.push({ diff --git a/src/views/distribution/deliverylist/distributionDeliveryListedt.vue b/src/views/distribution/deliverylist/distributionDeliveryListedt.vue index 66af09bb..e077e04b 100644 --- a/src/views/distribution/deliverylist/distributionDeliveryListedt.vue +++ b/src/views/distribution/deliverylist/distributionDeliveryListedt.vue @@ -5393,6 +5393,13 @@ export default { this.loading = true; //开启加载 this.deliveryId = this.$route.query.id; + if(!this.deliveryId){ + ElMessage({ + message: '遇到异常,请刷新页面重试', + type: 'warning', + }) + return + } const res = await getDetail(this.deliveryId); const { code, data } = res.data; diff --git a/src/views/distribution/deliverylist/distributionDeliveryListmar.vue b/src/views/distribution/deliverylist/distributionDeliveryListmar.vue index 0874202e..9b28a1b5 100644 --- a/src/views/distribution/deliverylist/distributionDeliveryListmar.vue +++ b/src/views/distribution/deliverylist/distributionDeliveryListmar.vue @@ -697,9 +697,18 @@ export default { this.title = '查看'; this.view = true; this.box = true; - getDetail(row.id).then(res => { + if(row.id){ + getDetail(row.id).then(res => { this.form = res.data.data; }); + }else{ + ElMessage({ + message: '数据错误,刷新页面重新尝试', + type: 'warning', + }) + + } + }, // handleViewBlank (row) { // this.$router.push({ diff --git a/src/views/distribution/stockup/distributionStockupDiscuss.vue b/src/views/distribution/stockup/distributionStockupDiscuss.vue index adf79fb3..e7550a97 100644 --- a/src/views/distribution/stockup/distributionStockupDiscuss.vue +++ b/src/views/distribution/stockup/distributionStockupDiscuss.vue @@ -738,7 +738,7 @@ export default { this.forkliftData = fo; }); await this.getStorageArea(); - await this.getTeam(); + // await this.getTeam(); }, //查询班组 async getTeam() { @@ -800,7 +800,7 @@ export default { this.num = '3'; this.dialogFormCustomer = true; this.getFork(); - this.getTeam(); + // this.getTeam(); } else { this.$message.warning('已指派,请勿重复指派!!!'); } @@ -943,7 +943,7 @@ export default { this.num = '2'; this.formOne.id = row.row.id; this.getFork(); - this.getTeam(); + // this.getTeam(); }, handleView(row) { // this.title = '查看' diff --git a/src/views/distribution/stockup/distributionStockupSelf.vue b/src/views/distribution/stockup/distributionStockupSelf.vue index 3605fe0c..ca6a6ed6 100644 --- a/src/views/distribution/stockup/distributionStockupSelf.vue +++ b/src/views/distribution/stockup/distributionStockupSelf.vue @@ -734,7 +734,7 @@ export default { this.forkliftData = fo; }); await this.getStorageArea(); - await this.getTeam(); + // await this.getTeam(); }, //查询班组 async getTeam() { @@ -962,7 +962,7 @@ export default { this.num = '2'; this.formOne.id = row.row.id; this.getFork(); - this.getTeam(); + // this.getTeam(); }, handleView(row) { this.$router.push({