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

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

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