提交 24000b84 authored 作者: lidongxu's avatar lidongxu

feat(plan): 计划 excel 的 url 上传

同上
上级 81d8ea72
......@@ -51,6 +51,7 @@ export function updateUser(data) {
})
}
// 删除用户
export function delUser(userId) {
return request({
......@@ -148,4 +149,4 @@ export function deptTreeSelectList() {
url: '/system/user/deptTree',
method: 'get'
})
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@
</template>
<script setup>
import { getPlanListAPI, uploadFileToOSSAPI } from '@/api'
import { getPlanListAPI, uploadFileToOSSAPI, addPlanAPI } from '@/api'
import { useDatePickerOptions } from '@/hooks'
import { v4 as uuidv4 } from 'uuid';
import store from '@/store'
......@@ -96,8 +96,7 @@ const columns = ref([
{
label: '经销商',
prop: 'dealerName',
width: 220,
fixed: true
width: 220
},
{
label: '系统名称',
......@@ -150,17 +149,25 @@ const getPlanList = async () => {
}
getPlanList()
const formatter = (row, col, value) => {
return value
if (col.property === 'planStatus') {
return value == 0 ? '执行中' : '取消'
} else {
return value
}
}
// 上传计划
const uploadFile = async (file) => {
console.log(store.state)
const excelUrl = await uploadFileToOSSAPI(`planExcel/${store.state.value.user.name}/${uuidv4()}-` + file.file.name, file.file)
// const res = await addPlanAPI({
// "excelUrl": excelUrl,
// "employeeNo": store.state.value.user.userInfo.userName
// })
// 拼接当前月数为文件夹名
const date = new Date()
const month = date.getMonth() + 1
const excelUrl = await uploadFileToOSSAPI(`planExcel/${date.getFullYear()}-${month}/${store.state.value.user.userInfo.userName}/${uuidv4()}.xlsx`, file.file)
const res = await addPlanAPI({
"excelUrl": excelUrl,
"employeeNo": store.state.value.user.userInfo.userName
})
console.log(res)
dialogVisible.value = true
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论