|
|
@@ -97,6 +97,7 @@ const resetLoading = ref(false)
|
|
|
const showQrCodeDialog = ref(false)
|
|
|
const currentQrCodeUrl = ref('')
|
|
|
const currentQrCodeNumber = ref('')
|
|
|
+const currentMaintenanceCode = ref('')
|
|
|
const qrCodeImage = ref('')
|
|
|
|
|
|
// 获取二维码类型配置(使用枚举)
|
|
|
@@ -422,10 +423,14 @@ const handleResetMaintenanceCode = async () => {
|
|
|
}
|
|
|
|
|
|
// 展示二维码
|
|
|
-const showQrCode = async (qrCode) => {
|
|
|
+const showQrCode = async (qrCodeData) => {
|
|
|
try {
|
|
|
- // 保存二维码编号
|
|
|
+ // 保存二维码编号和维护码
|
|
|
+ const qrCode = typeof qrCodeData === 'string' ? qrCodeData : qrCodeData.qrCode
|
|
|
+ const maintenanceCode = typeof qrCodeData === 'string' ? 'unknown' : (qrCodeData.maintenanceCode || 'unknown')
|
|
|
+
|
|
|
currentQrCodeNumber.value = qrCode
|
|
|
+ currentMaintenanceCode.value = maintenanceCode
|
|
|
|
|
|
// 生成二维码 URL
|
|
|
currentQrCodeUrl.value = QRCodeUtil.generateQrCodeUrl(qrCode)
|
|
|
@@ -446,8 +451,8 @@ const showQrCode = async (qrCode) => {
|
|
|
|
|
|
// 下载当前二维码
|
|
|
const downloadCurrentQrCode = () => {
|
|
|
- if (qrCodeImage.value && currentQrCodeNumber.value) {
|
|
|
- QRCodeUtil.downloadQrCode(qrCodeImage.value, `${currentQrCodeNumber.value}`)
|
|
|
+ if (qrCodeImage.value && currentQrCodeNumber.value && currentMaintenanceCode.value) {
|
|
|
+ QRCodeUtil.downloadQrCode(qrCodeImage.value, `${currentQrCodeNumber.value}_${currentMaintenanceCode.value}`)
|
|
|
toast.add({
|
|
|
severity: 'success',
|
|
|
summary: '成功',
|
|
|
@@ -543,7 +548,7 @@ onMounted(() => {
|
|
|
<Button icon="pi pi-eye" severity="info" size="small" text rounded v-tooltip.top="'查看详情'"
|
|
|
@click="viewDetail(slotProps.data)" />
|
|
|
<Button icon="pi pi-qrcode" severity="success" size="small" text rounded v-tooltip.top="'展示二维码'"
|
|
|
- @click="showQrCode(slotProps.data.qrCode)" />
|
|
|
+ @click="showQrCode(slotProps.data)" />
|
|
|
<Button icon="pi pi-chart-line" label="扫描记录" size="small" text style="white-space: nowrap"
|
|
|
@click="viewScanRecords(slotProps.data)" />
|
|
|
<Button icon="pi pi-key" label="重置维护码" severity="warn" size="small" text style="white-space: nowrap"
|