二维码生成独立页面

This commit is contained in:
砂糖
2025-07-30 10:53:06 +08:00
parent cb6fd3f57e
commit 347f400578
9 changed files with 137 additions and 122 deletions

View File

@@ -25,16 +25,7 @@
<script>
import { listRawMaterial } from "@/api/wms/rawMaterial";
function debounce(fn, delay) {
let timer = null;
return function (...args) {
if (timer) clearTimeout(timer);
timer = setTimeout(() => {
fn.apply(this, args);
}, delay);
};
}
import { mapGetters } from "vuex";
export default {
name: "RawMaterialSelect",
@@ -62,18 +53,13 @@ export default {
}
},
mounted() {
this.fetchOptions("");
this.options = this.rawMaterialList;
console.log(this.options, this.rawMaterialList);
},
computed: {
...mapGetters(['rawMaterialList'])
},
methods: {
fetchOptions() {
this.loading = true;
listRawMaterial({ pageNum: 1, pageSize: 9999 }).then(res => {
this.options = res.rows || [];
this.loading = false;
}).catch(() => {
this.loading = false;
});
},
async onChange(val) {
const rawMaterial = this.options.find(p => p.rawMaterialId === val);
this.$emit('change', rawMaterial);