From a955beacb8b928e02b2109a71a09f6ff32cc72a4 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期六, 18 四月 2026 13:12:54 +0800
Subject: [PATCH] 移除产品二维码相关功能的代码和样式
---
src/views/basicData/product/index.vue | 137 +++++++++++++++++++++++----------------------
1 files changed, 71 insertions(+), 66 deletions(-)
diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index d4186c1..ac157df 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -171,7 +171,7 @@
</template>
</el-dialog>
<!-- 浜岀淮鐮佸璇濇 -->
- <el-dialog v-model="qrCodeDialog"
+ <!-- <el-dialog v-model="qrCodeDialog"
title="浜у搧浜岀淮鐮�"
width="400px">
<div class="qrcode-container">
@@ -192,15 +192,16 @@
:disabled="!qrCodeUrl">淇濆瓨涓哄浘鐗�</el-button>
</div>
</template>
- </el-dialog>
+ </el-dialog> -->
</div>
</template>
<script setup>
import { ref, getCurrentInstance, toRefs, reactive } from "vue";
import { ElMessageBox } from "element-plus";
- import QRCode from "qrcode";
- import { saveAs } from "file-saver";
+ // 浜у搧浜岀淮鐮�
+ // import QRCode from "qrcode";
+ // import { saveAs } from "file-saver";
import {
addOrEditProduct,
addOrEditProductModel,
@@ -217,9 +218,10 @@
const productDia = ref(false);
const modelDia = ref(false);
- const qrCodeDialog = ref(false);
- const qrCodeUrl = ref("");
- const currentProductId = ref("");
+ // 浜у搧浜岀淮鐮�
+ // const qrCodeDialog = ref(false);
+ // const qrCodeUrl = ref("");
+ // const currentProductId = ref("");
const modelOperationType = ref("");
const search = ref("");
const currentId = ref("");
@@ -255,13 +257,14 @@
openModelDia("edit", row);
},
},
- {
- name: "鐢熸垚浜岀淮鐮�",
- type: "text",
- clickFun: row => {
- generateQrcode(row);
- },
- },
+ // 浜у搧浜岀淮鐮�
+ // {
+ // name: "鐢熸垚浜岀淮鐮�",
+ // type: "text",
+ // clickFun: row => {
+ // generateQrcode(row);
+ // },
+ // },
],
},
]);
@@ -520,61 +523,62 @@
// 娌″尮閰嶅埌杩斿洖false
return false;
};
- const qrCodeName = ref("");
+ // 浜у搧浜岀淮鐮�
+ // const qrCodeName = ref("");
- // 鐢熸垚浜岀淮鐮�
- const generateQrcode = async row => {
- try {
- currentProductId.value = row.id;
- qrCodeName.value = fatherName.value + "-" + row.model;
- // 浣跨敤row.id鐢熸垚浜岀淮鐮�
- const qrCodeData = JSON.stringify({
- id: row.id,
- productName: fatherName.value,
- model: row.model,
- unit: row.unit,
- });
- // 鐢熸垚浜岀淮鐮乁RL
- qrCodeUrl.value = await QRCode.toDataURL(qrCodeData, {
- width: 300,
- margin: 1,
- });
- // 鎵撳紑浜岀淮鐮佸璇濇
- qrCodeDialog.value = true;
- } catch (error) {
- console.error("鐢熸垚浜岀淮鐮佸け璐�:", error);
- proxy.$modal.msgError("鐢熸垚浜岀淮鐮佸け璐�");
- }
- };
+ // // 鐢熸垚浜岀淮鐮�
+ // const generateQrcode = async row => {
+ // try {
+ // currentProductId.value = row.id;
+ // qrCodeName.value = fatherName.value + "-" + row.model;
+ // // 浣跨敤row.id鐢熸垚浜岀淮鐮�
+ // const qrCodeData = JSON.stringify({
+ // id: row.id,
+ // productName: fatherName.value,
+ // model: row.model,
+ // unit: row.unit,
+ // });
+ // // 鐢熸垚浜岀淮鐮乁RL
+ // qrCodeUrl.value = await QRCode.toDataURL(qrCodeData, {
+ // width: 300,
+ // margin: 1,
+ // });
+ // // 鎵撳紑浜岀淮鐮佸璇濇
+ // qrCodeDialog.value = true;
+ // } catch (error) {
+ // console.error("鐢熸垚浜岀淮鐮佸け璐�:", error);
+ // proxy.$modal.msgError("鐢熸垚浜岀淮鐮佸け璐�");
+ // }
+ // };
- // 淇濆瓨浜岀淮鐮佷负鍥剧墖
- const saveQrCodeAsImage = () => {
- if (!qrCodeUrl.value) return;
+ // // 淇濆瓨浜岀淮鐮佷负鍥剧墖
+ // const saveQrCodeAsImage = () => {
+ // if (!qrCodeUrl.value) return;
- try {
- // 浠嶥ata URL鍒涘缓Blob
- const blob = dataURLToBlob(qrCodeUrl.value);
- // 浣跨敤file-saver淇濆瓨鍥剧墖
- saveAs(blob, `${qrCodeName.value}.png`);
- proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
- } catch (error) {
- console.error("淇濆瓨鍥剧墖澶辫触:", error);
- proxy.$modal.msgError("淇濆瓨鍥剧墖澶辫触");
- }
- };
+ // try {
+ // // 浠嶥ata URL鍒涘缓Blob
+ // const blob = dataURLToBlob(qrCodeUrl.value);
+ // // 浣跨敤file-saver淇濆瓨鍥剧墖
+ // saveAs(blob, `${qrCodeName.value}.png`);
+ // proxy.$modal.msgSuccess("淇濆瓨鎴愬姛");
+ // } catch (error) {
+ // console.error("淇濆瓨鍥剧墖澶辫触:", error);
+ // proxy.$modal.msgError("淇濆瓨鍥剧墖澶辫触");
+ // }
+ // };
- // 灏咲ata URL杞崲涓築lob
- const dataURLToBlob = dataURL => {
- const arr = dataURL.split(",");
- const mime = arr[0].match(/:(.*?);/)[1];
- const bstr = atob(arr[1]);
- let n = bstr.length;
- const u8arr = new Uint8Array(n);
- while (n--) {
- u8arr[n] = bstr.charCodeAt(n);
- }
- return new Blob([u8arr], { type: mime });
- };
+ // // 灏咲ata URL杞崲涓築lob
+ // const dataURLToBlob = dataURL => {
+ // const arr = dataURL.split(",");
+ // const mime = arr[0].match(/:(.*?);/)[1];
+ // const bstr = atob(arr[1]);
+ // let n = bstr.length;
+ // const u8arr = new Uint8Array(n);
+ // while (n--) {
+ // u8arr[n] = bstr.charCodeAt(n);
+ // }
+ // return new Blob([u8arr], { type: mime });
+ // };
getProductTreeList();
</script>
@@ -645,7 +649,7 @@
background: #909399;
}
- /* 浜岀淮鐮佹牱寮� */
+ /* 浜у搧浜岀淮鐮�
.qrcode-container {
display: flex;
justify-content: center;
@@ -663,4 +667,5 @@
font-size: 16px;
color: #606266;
}
+ */
</style>
--
Gitblit v1.9.3