2. 仅支持 Excel 格式(.xlsx),单次最多导入 1000 条
3. 列格式请设置为文本格式,避免长数字被转为科学计数法
4. 重要:列顺序固定,不可调整。系统按位置读取,不识别列名
-5. 必填列:虚拟号(第1列)
+5. 必填列:虚拟号(第1列)
6. 可选列:设备名称、设备型号、设备类型、IMEI、制造商、最大SIM槽数(默认4,有效范围1-4)、卡1~卡4 @@ -443,77 +443,16 @@ // 下载模板 const downloadTemplate = async () => { try { - // 动态导入 xlsx 库 - const XLSX = await import('xlsx') - - // 创建示例数据(按固定列顺序) - const templateData = [ - { - 虚拟号: '862639070731999', - 设备名称: '智能水表01', - 设备型号: 'WM-2000', - 设备类型: '智能水表', - IMEI: '860123456789012', - 制造商: '华为', - 最大SIM槽数: 4, - '卡1 ICCID': '89860123456789012345', - '卡2 ICCID': '', - '卡3 ICCID': '', - '卡4 ICCID': '' - }, - { - 虚拟号: '862639070750932', - 设备名称: 'GPS定位器01', - 设备型号: 'GPS-3000', - 设备类型: '定位设备', - IMEI: '860123456789013', - 制造商: '小米', - 最大SIM槽数: 2, - '卡1 ICCID': '89860123456789012346', - '卡2 ICCID': '89860123456789012347', - '卡3 ICCID': '', - '卡4 ICCID': '' - } - ] - - // 创建工作簿 - const wb = XLSX.utils.book_new() - const ws = XLSX.utils.json_to_sheet(templateData) - - // 设置列宽 - ws['!cols'] = [ - { wch: 20 }, // 虚拟号 - { wch: 15 }, // 设备名称 - { wch: 15 }, // 设备型号 - { wch: 15 }, // 设备类型 - { wch: 18 }, // IMEI - { wch: 12 }, // 制造商 - { wch: 15 }, // 最大SIM槽数 - { wch: 25 }, // 卡1 ICCID - { wch: 25 }, // 卡2 ICCID - { wch: 25 }, // 卡3 ICCID - { wch: 25 } // 卡4 ICCID - ] - - // 将所有单元格设置为文本格式 - const range = XLSX.utils.decode_range(ws['!ref'] || 'A1') - for (let R = range.s.r; R <= range.e.r; ++R) { - for (let C = range.s.c; C <= range.e.c; ++C) { - const cellAddress = XLSX.utils.encode_cell({ r: R, c: C }) - if (!ws[cellAddress]) continue - ws[cellAddress].t = 's' // 设置为字符串类型 - } - } - - // 添加工作表到工作簿 - XLSX.utils.book_append_sheet(wb, ws, '设备导入模板') - - // 导出文件 - XLSX.writeFile(wb, '设备导入模板.xlsx') - + const link = document.createElement('a') + link.href = new URL('@/template/设备导入模板.xlsx', import.meta.url).href + link.download = '设备导入模板.xlsx' + document.body.appendChild(link) + link.click() + document.body.removeChild(link) ElMessage.success('设备导入模板下载成功') } catch (error) { console.error('下载模板失败:', error) + ElMessage.error('下载模板失败') } } diff --git a/src/views/asset-management/task-management/iot-card-task/index.vue b/src/views/asset-management/task-management/iot-card-task/index.vue index b364654..e7f90a9 100644 --- a/src/views/asset-management/task-management/iot-card-task/index.vue +++ b/src/views/asset-management/task-management/iot-card-task/index.vue @@ -105,10 +105,8 @@
1. 请先下载 Excel 模板文件,按照模板格式填写IoT卡信息
2. 仅支持 Excel 格式(.xlsx),单次最多导入 1000 条
3. 列格式请设置为文本格式,避免长数字被转为科学计数法
-4. 必填字段:ICCID、MSISDN(手机号)、virtual_no(虚拟号)
-5. Excel 文件必须包含 virtual_no 列,否则整批导入将失败
-6. virtual_no 为空将导入失败
-7. 必须选择运营商
+4. 必填字段:ICCID、MSISDN
+5. 必须选择运营商
@@ -642,58 +640,16 @@ // 下载模板 const downloadTemplate = async () => { try { - // 动态导入 xlsx 库 - const XLSX = await import('xlsx') - - // 创建示例数据(按固定列顺序:ICCID、MSISDN、虚拟号) - const templateData = [ - { - ICCID: '89860123456789012345', - 'MSISDN(接入号)': '13800138000', - 虚拟号: 'V001' - }, - { - ICCID: '89860123456789012346', - 'MSISDN(接入号)': '13800138001', - 虚拟号: 'V002' - }, - { - ICCID: '89860123456789012347', - 'MSISDN(接入号)': '13800138002', - 虚拟号: 'V003' - } - ] - - // 创建工作簿 - const wb = XLSX.utils.book_new() - const ws = XLSX.utils.json_to_sheet(templateData) - - // 设置列宽 - ws['!cols'] = [ - { wch: 25 }, // ICCID - { wch: 20 }, // MSISDN(接入号) - { wch: 15 } // 虚拟号 - ] - - // 将所有单元格设置为文本格式,防止科学计数法 - const range = XLSX.utils.decode_range(ws['!ref'] || 'A1') - for (let R = range.s.r; R <= range.e.r; ++R) { - for (let C = range.s.c; C <= range.e.c; ++C) { - const cellAddress = XLSX.utils.encode_cell({ r: R, c: C }) - if (!ws[cellAddress]) continue - ws[cellAddress].t = 's' // 设置为字符串类型 - } - } - - // 添加工作表到工作簿 - XLSX.utils.book_append_sheet(wb, ws, 'IoT卡导入模板') - - // 导出文件 - XLSX.writeFile(wb, 'IoT卡导入模板.xlsx') - + const link = document.createElement('a') + link.href = new URL('@/template/IoT卡导入模板.xlsx', import.meta.url).href + link.download = 'IoT卡导入模板.xlsx' + document.body.appendChild(link) + link.click() + document.body.removeChild(link) ElMessage.success('IoT卡导入模板下载成功') } catch (error) { console.error('下载模板失败:', error) + ElMessage.error('下载模板失败') } } diff --git a/src/views/common/account-list.vue b/src/views/common/account-list.vue index 628fad2..d370510 100644 --- a/src/views/common/account-list.vue +++ b/src/views/common/account-list.vue @@ -582,7 +582,8 @@ try { const params: any = { page: 1, - page_size: 20 + page_size: 20, + role_type: 1 } if (keyword) { params.role_name = keyword @@ -607,23 +608,9 @@ }, 300) } - // 计算属性:过滤后的可分配角色(根据账号类型过滤) + // 计算属性:过滤后的可分配角色 const filteredAvailableRoles = computed(() => { - let roles = allRoles.value - - // 根据账号类型过滤角色 - if (currentAccountType.value === 3) { - // 代理账号:只显示客户角色 - roles = roles.filter((role) => role.role_type === 2) - } else if (currentAccountType.value === 2) { - // 平台用户:只显示平台角色 - roles = roles.filter((role) => role.role_type === 1) - } else if (currentAccountType.value === 4) { - // 企业账号:只显示客户角色 - roles = roles.filter((role) => role.role_type === 2) - } - - return roles + return allRoles.value }) // 计算属性:过滤后的已分配角色 diff --git a/src/views/finance/agent-recharge/detail.vue b/src/views/finance/agent-recharge/detail.vue index f932d50..c4d7018 100644 --- a/src/views/finance/agent-recharge/detail.vue +++ b/src/views/finance/agent-recharge/detail.vue @@ -94,9 +94,7 @@ title: '订单信息', fields: [ { label: '充值单号', prop: 'recharge_no' }, - { label: '充值记录ID', prop: 'id' }, { label: '店铺名称', prop: 'shop_name' }, - { label: '店铺ID', prop: 'shop_id' }, { label: '充值金额', formatter: (_, data) => formatCurrency(data.amount) @@ -122,15 +120,6 @@ prop: 'payment_channel', formatter: (value) => value || '-' }, - { - label: '支付配置ID', - prop: 'payment_config_id', - formatter: (value) => value || '-' - }, - { - label: '代理钱包ID', - prop: 'agent_wallet_id' - }, { label: '第三方支付流水号', prop: 'payment_transaction_id', diff --git a/src/views/finance/refund/detail.vue b/src/views/finance/refund/detail.vue index af0cda4..9858a0b 100644 --- a/src/views/finance/refund/detail.vue +++ b/src/views/finance/refund/detail.vue @@ -14,12 +14,6 @@