按模版进行产品导入,引用模板下载,更新模板下载接口路径
| | |
| | | }); |
| | | |
| | | const props = defineProps({ |
| | | downloadTemplate: Function, |
| | | // downloadTemplate: Function, |
| | | showTips: Boolean, |
| | | accept: { |
| | | type: String, |
| | |
| | | default: 1, |
| | | }, |
| | | }); |
| | | const emits = defineEmits(["success", "remove"]); |
| | | const emits = defineEmits(["success", "remove", "downloadTemplate"]); |
| | | |
| | | const uploadRef = ref(); |
| | | const fileList = ref([]); |
| | |
| | | type="primary" |
| | | link |
| | | class="reset-margin" |
| | | @click="props.downloadTemplate()" |
| | | @click="emits('downloadTemplate')" |
| | | > |
| | | <span style="font-size: 12px; font-weight: normal">下载模板</span> |
| | | </el-button> |
| | |
| | | <el-dialog v-model="upload.open" :title="upload.title"> |
| | | <FileUpload |
| | | ref="fileUploadRef" |
| | | accept=".xlsx, .xls" |
| | | accept=".xlsx,.xls" |
| | | :headers="upload.headers" |
| | | :action="upload.url + '?updateSupport=' + upload.updateSupport" |
| | | :disabled="upload.isUploading" |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { reactive } from "vue"; |
| | | import { reactive, ref, getCurrentInstance } from "vue"; |
| | | import { getToken } from "@/utils/auth.js"; |
| | | import { FileUpload } from "@/components/Upload"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | defineOptions({ |
| | | name: "产品维护导入", |
| | | }); |
| | |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: import.meta.env.VITE_APP_BASE_API + "/system/supplier/import", |
| | | updateSupport: true, |
| | | }); |
| | | // 点击导入 |
| | | const handleImport = () => { |
| | |
| | | |
| | | // 下载模板 |
| | | const downloadTemplate = () =>{ |
| | | proxy.download("/basic/customer/downloadTemplate", {}, "产品导入模板.xlsx"); |
| | | proxy.download("/basic/product/downloadTemplate", {}, "产品导入模板.xlsx"); |
| | | } |
| | | |
| | | const submitFileForm = () => { |