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()