From 8a2978af6cbc48b2a69a8a0472044978873eaf85 Mon Sep 17 00:00:00 2001 From: fengerli <528575642@qq.com> Date: Wed, 9 Jul 2025 13:39:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentManagement/deviceType/index.vue | 1 + .../equipmentManagement/devices/index.vue | 37 ++++++++++--------- src/views/login.vue | 4 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/views/equipmentManagement/deviceType/index.vue b/src/views/equipmentManagement/deviceType/index.vue index 5174679..cc86a4b 100644 --- a/src/views/equipmentManagement/deviceType/index.vue +++ b/src/views/equipmentManagement/deviceType/index.vue @@ -297,6 +297,7 @@ const submitForm = () => { const closeDialog = () => { dialog.visible = false; resetForm(); + loadingIng.value = false; }; /** diff --git a/src/views/equipmentManagement/devices/index.vue b/src/views/equipmentManagement/devices/index.vue index d875a7f..9d16bcc 100644 --- a/src/views/equipmentManagement/devices/index.vue +++ b/src/views/equipmentManagement/devices/index.vue @@ -125,10 +125,10 @@ placement="top"> - - - 解绑 + + + @@ -490,6 +490,7 @@ const handleUpdate = async (row?: deviceForm) => { } }; // 设备类型触发事件 +let isProcessing = false; // 添加处理锁 const handleDeviceTypeChange = async (deviceTypeId: string | number) => { // 重置规则和显示状态 rules.value.deviceMac = []; @@ -509,6 +510,8 @@ const handleDeviceTypeChange = async (deviceTypeId: string | number) => { } return; } + if (isProcessing) return; + isProcessing = true; // 新增或编辑时没有值,根据设备类型获取通讯方式 try { userFormRef.value?.clearValidate(['deviceMac', 'deviceImei']); @@ -519,22 +522,19 @@ const handleDeviceTypeChange = async (deviceTypeId: string | number) => { if (res.code === 0 && res.data) { communicationModeInfo.value = res.data; // 根据通讯方式确定显示哪个字段 - if (res.data.communicationMode === '1') { // 蓝牙设备 - 显示MAC + if (res.data.communicationMode == '1') { // 蓝牙设备 - 显示MAC showMacField.value = true; showImeiField.value = false; - rules.value.deviceMac = [{ required: true, message: '请输入设备MAC', trigger: 'blur' }]; form.value.deviceImei = ''; // 清空IMEI - } else if (res.data.communicationMode === '0') { // 4G设备 - 显示IMEI + } else if (res.data.communicationMode == '0') { // 4G设备 - 显示IMEI showMacField.value = false; showImeiField.value = true; - rules.value.deviceImei = [{ required: true, message: '请输入设备IMEI', trigger: 'blur' }]; form.value.deviceMac = ''; // 清空MAC } - } else { - proxy?.$modal.msgError(res.msg || '获取通讯方式失败'); } } catch (error) { - proxy?.$modal.msgError('获取通讯方式失败'); + } finally { + isProcessing = false; } }; @@ -605,7 +605,6 @@ const submitForm = async () => { } }); if (res.code == 0) { - proxy?.$modal.msgSuccess('操作成功'); dialog.visible = false; loadingIng.value = false; @@ -664,10 +663,12 @@ const getAllCustomerAll = () => { // 分配客户 const assignRow = ref() const handleAssign = (row: any) => { + console.log(row, 'eeeeee'); + getAllCustomerAll() assignDialogVisible.value = true assignRow.value = row - assignCustomerId.value = row.customerId + assignCustomerId.value == !row.customerName ? row.customerId : '' } const handleAssignConfirm = () => { if (!assignCustomerId.value) { @@ -690,8 +691,8 @@ const handleAssignConfirm = () => { } else { loadingIng.value = false; } - }).catch(()=>{ - loadingIng.value = false; + }).catch(() => { + loadingIng.value = false; }) }; const importUpload = ref() @@ -759,7 +760,7 @@ const handleBatchAssignConfirm = () => { return proxy?.$modal.msgError('请选择客户') } // 提取选中设备的 ID 数组 - const selectedIds = ids.value.map((item:any) => item.id) + const selectedIds = ids.value.map((item: any) => item.id) // 构造请求数据 const data = { customerId: batchAssignCustomerId.value, // 目标客户ID @@ -771,8 +772,8 @@ const handleBatchAssignConfirm = () => { getList(); return proxy?.$modal.msgSuccess(`分配成功`) } - }).catch(()=>{ - + }).catch(() => { + }) }; diff --git a/src/views/login.vue b/src/views/login.vue index bb3e083..2943f0a 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -35,8 +35,8 @@ - {{ proxy.$t('login.login') }} - {{ proxy.$t('login.logging') }} + 登录 + 登录
{{ proxy.$t('login.switchRegisterPage') }}