Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
eaed0e2c
提交
eaed0e2c
authored
2月 24, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(promotion): 批量表格修改计划
同上
上级
087856b2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
45 行增加
和
3 行删除
+45
-3
upload.js
src/api/common/upload.js
+1
-1
plan.js
src/api/promotion/plan.js
+11
-0
request.js
src/utils/request.js
+1
-1
index.vue
src/views/promotion/plan/index.vue
+32
-1
没有找到文件。
src/api/common/upload.js
浏览文件 @
eaed0e2c
...
...
@@ -7,7 +7,7 @@ export const uploadFileToOSSAPI = (fileName, filePath) => {
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
const
authRes
=
await
request
({
baseURL
:
ossAuthURL
,
url
:
''
url
:
'
/
'
})
const
{
accessKeyId
,
securityToken
,
accessKeySecret
,
expiration
,
region
,
web_js_link
}
=
authRes
.
data
;
...
...
src/api/promotion/plan.js
浏览文件 @
eaed0e2c
...
...
@@ -108,4 +108,14 @@ export function getPlanStoreListAPI(queryParams = {}) {
storeCode
:
queryParams
.
storeCode
,
}
})
}
// 表格-修改计划
export
function
updatePlanAPI
(
data
)
{
return
request
({
baseURL
:
VITE_APP_PROMOTION
,
url
:
'/plan/v2/core/put'
,
method
:
'PUT'
,
data
})
}
\ No newline at end of file
src/utils/request.js
浏览文件 @
eaed0e2c
...
...
@@ -31,7 +31,7 @@ service.interceptors.request.use(config => {
// 是否需要防止数据重复提交
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
if
(
getToken
()
&&
!
isToken
)
{
if
(
config
.
baseURL
===
promotionBaseURL
)
{
if
(
config
.
baseURL
===
promotionBaseURL
||
config
.
baseURL
.
startsWith
(
promotionBaseURL
)
)
{
// 促销后台不能带 Bearer 前缀
config
.
headers
[
'Authorization'
]
=
getToken
()
}
else
{
...
...
src/views/promotion/plan/index.vue
浏览文件 @
eaed0e2c
...
...
@@ -142,6 +142,15 @@
@
click=
"handleAdd"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-upload
class=
"upload-demo"
action=
"#"
accept=
".xls,.xlsx"
:http-request=
"uploadChangeFile"
:show-file-list=
"false"
>
<template
#
trigger
>
<el-button
type=
"success"
>
批量修改计划
</el-button>
</
template
>
</el-upload>
<el-upload
class=
"upload-demo"
action=
"#"
accept=
".xls,.xlsx"
...
...
@@ -385,7 +394,7 @@
</template>
<
script
setup
>
import
{
getPlanListAPI
,
uploadFileToOSSAPI
,
addPlanAPI
,
savePlanAPI
,
deletePlanAPI
,
addPlanByRoleAPI
,
getProCityAPI
,
getDealerListAPI
,
getWarZoneListAPI
,
getChargeListAPI
,
addPlanByWebAPI
,
updatePlanByWebAPI
,
getPlanStoreListAPI
}
from
'@/api'
import
{
getPlanListAPI
,
uploadFileToOSSAPI
,
addPlanAPI
,
savePlanAPI
,
deletePlanAPI
,
addPlanByRoleAPI
,
getProCityAPI
,
getDealerListAPI
,
getWarZoneListAPI
,
getChargeListAPI
,
addPlanByWebAPI
,
updatePlanByWebAPI
,
getPlanStoreListAPI
,
updatePlanAPI
}
from
'@/api'
import
{
useDatePickerOptions
}
from
'@/hooks'
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
store
from
'@/store'
...
...
@@ -1071,6 +1080,23 @@ const selPattern = () => {
const
selEmployee
=
()
=>
{
addOrEditPlanRef
.
value
.
clearValidate
(
'employeeNo'
);
}
// 批量表格修改计划
const
uploadChangeFile
=
async
(
file
)
=>
{
// 拼接当前月数为文件夹名
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
updatePlanAPI
({
"excelUrl"
:
excelUrl
,
"employeeNo"
:
store
.
state
.
value
.
user
.
userInfo
.
userName
})
planTableList
.
value
=
res
.
data
.
table
confirmExcelUUID
.
value
=
res
.
data
.
uuid
dialogVisible
.
value
=
true
return
true
}
</
script
>
<
style
scoped
...
...
@@ -1087,6 +1113,11 @@ const selEmployee = () => {
}
}
.upload-demo
{
display
:
inline-block
;
margin
:
0
5px
;
}
/* 门店列表选择后-下面的介绍信息 */
.info_p
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论