新增耗材入库-ai批量入库

This commit is contained in:
gyq
2025-11-28 18:02:17 +08:00
parent 89f9283163
commit abcec9f62b
9 changed files with 494 additions and 58 deletions

View File

@@ -1,17 +1,8 @@
<!-- 单图上传组件 -->
<template>
<el-upload
v-model="modelValue"
class="single-upload"
list-type="picture-card"
:show-file-list="false"
:accept="props.accept"
:before-upload="handleBeforeUpload"
:http-request="handleUpload"
:on-success="onSuccess"
:on-error="onError"
multiple
>
<el-upload v-model="modelValue" class="single-upload" list-type="picture-card" :show-file-list="false"
:accept="props.accept" :before-upload="handleBeforeUpload" :http-request="handleUpload" :on-success="onSuccess"
:on-error="onError" multiple :before-remove="emits('clear')">
<template #default>
<el-image v-if="modelValue" :src="modelValue" />
<el-icon v-if="modelValue" class="single-upload__delete-btn" @click.stop="handleDelete">
@@ -120,6 +111,7 @@ function handleBeforeUpload(file: UploadRawFile) {
*/
function handleUpload(options: UploadRequestOptions) {
return new Promise((resolve, reject) => {
emits("upload", options);
const file = options.file;
const formData = new FormData();
@@ -147,7 +139,7 @@ function handleDelete() {
modelValue.value = "";
}
const emits = defineEmits(["onSuccess"]);
const emits = defineEmits(["onSuccess", 'upload', 'clear']);
/**
* 上传成功回调
*