From 2a91e4961dcbbb1f70b9a95bc263b0b48bb257bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=AD=94=E4=BB=99?= <13068499+willowhh@user.noreply.gitee.com> Date: Tue, 13 May 2025 10:46:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=BD=E5=8A=A0=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orderPurchase/index.vue | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/views/orderPurchaseManagement/orderPurchase/index.vue b/src/views/orderPurchaseManagement/orderPurchase/index.vue index ff0b6f3..a230941 100644 --- a/src/views/orderPurchaseManagement/orderPurchase/index.vue +++ b/src/views/orderPurchaseManagement/orderPurchase/index.vue @@ -48,6 +48,10 @@ {{ $t('btn.import') }} + + + 追加导入 + @@ -360,6 +364,7 @@ ref="uploadRef" action="/mes/orderManagement/OrderPurchase/importData" accept=".xlsx, .xls" + :data="{value: uploadValue}" :before-upload="beforeUpload" :http-request="uploadFile" :auto-upload="false" @@ -389,6 +394,7 @@ import { downloadTemplate // 添加下载模板API } from '@/api/orderPurchaseManagement/orderpurchase.js' +var value = false; const { proxy } = getCurrentInstance() import dayjs from 'dayjs' const queryParams = reactive({ @@ -486,7 +492,7 @@ const dataList = ref([]) const queryRef = ref() const loading = ref(false) const showSearch = ref(true) - +const uploadValue = ref(false) const state = reactive({ form: {}, rules: { @@ -646,11 +652,23 @@ const beforeUpload = (file) => { } const uploadRef = ref(null) const submitUpload = () => { + console.log(uploadRef.value ); + if(value){ + uploadValue.value=true; + value=false; + } uploadRef.value.submit() } const uploadFile = (options) => { - importOrderPurchase(formData.value) + console.log(options.file); + console.log(uploadValue.value); + const forData = new FormData(); + forData.append('file', options.file); + forData.append('value', uploadValue.value) + + + importOrderPurchase(forData) .then((response) => { if (response.code === 200) { importOpen.value = false @@ -663,6 +681,7 @@ const uploadFile = (options) => { } ) getList() + uploadValue.value=false; } }) .catch((error) => { @@ -678,6 +697,10 @@ function handleDownloadTemplate() { }) } +function addImportDialog(){ + importOpen.value = true + value =true; +} handleQuery()