This commit is contained in:
牛子源 2025-05-17 09:36:59 +08:00
parent 6819587701
commit 970f012d69
2 changed files with 20 additions and 2 deletions

View File

@ -14,7 +14,7 @@
<template #footer>
<div class="bottom">
<div class="default-btn" @click="isShow=false">上传数据</div>
<div class="default-btn" @click="uploadCateIds" style="margin-left: 24px">下载模板</div>
<div class="default-btn" @click="toExcel" style="margin-left: 24px">下载模板</div>
<div class="default-btn" @click="isShow=false" style="margin-left: 24px">取消</div>
</div>
</template>
@ -25,6 +25,7 @@
import Mask from "@/components/common/Mask.vue";
import {defineModel, onMounted, ref} from "vue";
import {post} from "@/utils/request.ts";
import {loadConfig} from "@/utils/config.ts";
const isShow = defineModel()
const props = {multiple: true}
@ -43,6 +44,23 @@ const typeList = {
}
const cateIds = ref<number[]>([]);
const allCateList = ref<CateOption[]>([]);
const toExcel=()=>{
let cateIdsVal=cateIds.value
let cateIdList=[]
for(let i=0;i<cateIdsVal.length;i++){
let item:any=cateIdsVal[i];
if(item.length>1){
cateIdList.push(item[1])
}
}
post("inventory/order/toExcel",{cateIdList:cateIdList}).then((token:any)=>{
loadConfig().then((res: any) => {
window.open(res.base_url+"file/download/"+token)
})
})
}
const getAllCate = () => {
post("goods/cate/getAllList", null).then((res: any) => {
const options = [];

View File

@ -143,7 +143,7 @@ import Mask from "@/components/common/Mask.vue";
import EditOrder from "@/components/inventory/purchase/EditOrder.vue";
import {Plus, Refresh, Search, SemiSelect} from "@element-plus/icons-vue";
import {formatDateArray, getEndOfDay} from "@/utils/dateUtils.ts";
import UpLoad from "@/components/inventory/Upload.vue";
import UpLoad from "@/components/inventory/purchase/Upload.vue";
let tableData = ref([])
let is_edit = ref(false)