Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
ef2a623a
提交
ef2a623a
authored
2月 24, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(promotion/plan): 促销计划使用
同上
上级
0e47e704
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
195 行增加
和
45 行删除
+195
-45
plan.js
src/api/promotion/plan.js
+27
-0
task.js
src/api/promotion/task.js
+1
-1
variables.module.scss
src/assets/styles/variables.module.scss
+5
-1
index.vue
src/views/promotion/plan/index.vue
+162
-43
没有找到文件。
src/api/promotion/plan.js
浏览文件 @
ef2a623a
...
...
@@ -71,6 +71,9 @@ export function getDealerListAPI(queryParams) {
return
request
({
baseURL
:
VITE_APP_PROMOTION
,
url
:
'/user/dealer/query/list'
,
params
:
{
dealerName
:
queryParams
.
dealerName
,
}
})
}
...
...
@@ -83,3 +86,26 @@ export function addPlanByWebAPI(data) {
data
})
}
// web 页面修改单条活动计划
export
function
updatePlanByWebAPI
(
data
)
{
return
request
({
baseURL
:
VITE_APP_PROMOTION
,
url
:
'/plan/v2/core/update'
,
method
:
'PUT'
,
data
})
}
// 查询门店列表
export
function
getPlanStoreListAPI
(
queryParams
=
{})
{
return
request
({
baseURL
:
VITE_APP_PROMOTION
,
url
:
'/user/clientele/query/store/list'
,
method
:
'POST'
,
data
:
{
storeNameVague
:
queryParams
.
storeName
,
storeCode
:
queryParams
.
storeCode
,
}
})
}
\ No newline at end of file
src/api/promotion/task.js
浏览文件 @
ef2a623a
...
...
@@ -19,7 +19,7 @@ export const getWarZoneListAPI = () => {
export
const
getChargeListAPI
=
()
=>
{
return
request
({
baseURL
:
VITE_APP_PROMOTION
,
url
:
'/user/employee/query/
enroll/
list'
,
url
:
'/user/employee/query/list'
,
method
:
'POST'
,
data
:
{
"waiqin365OrgId"
:
''
,
...
...
src/assets/styles/variables.module.scss
浏览文件 @
ef2a623a
...
...
@@ -38,6 +38,8 @@ $--color-warning: #E6A23C;
$--color-danger
:
#F56C6C
;
$--color-info
:
#909399
;
:export
{
menuText
:
$menuText
;
menuActiveText
:
$menuActiveText
;
...
...
@@ -85,6 +87,8 @@ html {
--el-gray-1
:
rgba
(
0
,
0
,
0
,
0
.45
);
--el-gray-2
:
#666666
;
--el-gray-3
:
rgb
(
235
,
235
,
235
);
// 表格变量
--el-timeout-row
:
rgb
(
235
,
235
,
235
);
/* 主页背景 */
.app-main
{
...
...
@@ -97,7 +101,7 @@ html.dark {
--el-gray-1
:
white
;
--el-gray-2
:
white
;
--el-gray-3
:
#1d1e1f
;
--el-timeout-row
:
rgb
(
58
,
58
,
58
);
/* 默认通用 */
--el-bg-color
:
#141414
;
...
...
src/views/promotion/plan/index.vue
浏览文件 @
ef2a623a
...
...
@@ -78,9 +78,11 @@
<el-form-item
label=
"经销商"
prop=
"zone"
>
<el-select
v-model=
"queryParams.zoneId"
placeholder=
"
请选择
经销商"
placeholder=
"
搜索
经销商"
@
change=
"getPlanList"
filterable
remote
:remote-method=
"remoteMethod"
clearable
>
<el-option
v-for=
"item in zoneList"
:key=
"item.value"
...
...
@@ -94,6 +96,7 @@
placeholder=
"请选择战区"
filterable
clearable
:disabled=
"cityManagerPrivilege"
@
change=
"getPlanList"
>
<el-option
v-for=
"item in warZoneList"
:key=
"item.value"
...
...
@@ -132,13 +135,11 @@
plain
icon=
"Delete"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
@
click=
"handleDelete"
>
删除
</el-button>
<el-button
type=
"success"
plain
icon=
"Plus"
@
click=
"handleAdd"
v-hasPermi=
"['system:user:remove']"
>
新增
</el-button>
@
click=
"handleAdd"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-upload
class=
"upload-demo"
...
...
@@ -147,7 +148,7 @@
:http-request=
"uploadFile"
:show-file-list=
"false"
>
<template
#
trigger
>
<el-button
type=
"primary"
>
上传计划
</el-button>
<el-button
type=
"primary"
>
{{
cityManagerPrivilege
?
'城市经理'
:
'职能角色'
}}
-
上传计划
</el-button>
</
template
>
</el-upload>
</el-col>
...
...
@@ -171,7 +172,9 @@
:width=
"item.width"
:formatter=
"formatter"
:fixed=
"item.fixed"
/>
<el-table-column
label=
"操作"
width=
"150"
>
<el-table-column
label=
"操作"
width=
"150"
fixed=
"right"
>
<
template
#
default=
"scope"
>
<el-button
type=
"success"
link
...
...
@@ -238,11 +241,32 @@
inline
>
<el-row>
<el-col
:span=
"10"
>
<!-- 门店
编码
-->
<el-form-item
label=
"门店
编码
"
<!-- 门店
列表
-->
<el-form-item
label=
"门店
列表
"
prop=
"storeCode"
>
<el-input
v-model=
"addOrEditPlanForm.storeCode"
placeholder=
"请输入门店编码"
/>
<el-select
v-model=
"addOrEditPlanForm.storeCode"
placeholder=
"请选择门店"
filterable
clearable
style=
"width: 95%"
@
change=
"selStoreInfo"
remote
:remote-method=
"remoteStoreMethod"
:disabled=
"addOrEditPlanForm.id"
>
<el-option
v-for=
"item in storeList"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
<p
class=
"info_p"
:class=
"{ info_error: isInfoError }"
>
{{ selecteStoreInfo }}
</p>
<div>
<a
class=
"link"
v-show=
"isInfoError"
target=
"_blank"
href=
"https://cloud.region2.qince.com/sysapp/react/web/main.html#/home"
>
跳转勤策系统
</a>
</div>
</el-form-item>
</el-col>
<el-col
:span=
"10"
>
...
...
@@ -273,7 +297,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"10"
v-if=
"!cityManagerPrivilege"
>
<el-col
:span=
"10"
>
<!-- 归属人 -->
<el-form-item
label=
"归属人"
prop=
"employeeNo"
>
...
...
@@ -281,11 +305,12 @@
placeholder=
"请选择归属人"
filterable
clearable
style=
"width: 95%"
>
style=
"width: 95%"
:disabled=
"cityManagerPrivilege"
>
<el-option
v-for=
"item in managerList"
:key=
"item.
value
"
:key=
"item.
employeeNo
"
:label=
"item.label"
:value=
"item.
value
"
/>
:value=
"item.
employeeNo
"
/>
</el-select>
</el-form-item>
</el-col>
...
...
@@ -297,7 +322,7 @@
prop=
"clockInTime"
>
<el-time-picker
v-model=
"addOrEditPlanForm.clockInTime"
placeholder=
"选择时间"
format=
"HH:mm
:ss
"
format=
"HH:mm"
style=
"width: 95%"
/>
</el-form-item>
</el-col>
...
...
@@ -307,7 +332,7 @@
prop=
"clockOutTime"
>
<el-time-picker
v-model=
"addOrEditPlanForm.clockOutTime"
placeholder=
"选择时间"
format=
"HH:mm
:ss
"
format=
"HH:mm"
style=
"width: 95%"
:disabled=
"!addOrEditPlanForm.clockInTime"
:disabled-hours=
"disabledHours"
...
...
@@ -339,11 +364,13 @@
</el-form>
<
template
#
footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"default"
>
<el-button
type=
"default"
@
click=
"addOrEditPlanVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleAddOrEditPlan"
>
@
click=
"handleAddOrEditPlan"
:disabled=
"isInfoError"
>
确定保存
</el-button>
</div>
...
...
@@ -354,12 +381,12 @@
</template>
<
script
setup
>
import
{
getPlanListAPI
,
uploadFileToOSSAPI
,
addPlanAPI
,
savePlanAPI
,
deletePlanAPI
,
addPlanByRoleAPI
,
getProCityAPI
,
getDealerListAPI
,
getWarZoneListAPI
,
getChargeListAPI
,
addPlanByWebAPI
}
from
'@/api'
import
{
getPlanListAPI
,
uploadFileToOSSAPI
,
addPlanAPI
,
savePlanAPI
,
deletePlanAPI
,
addPlanByRoleAPI
,
getProCityAPI
,
getDealerListAPI
,
getWarZoneListAPI
,
getChargeListAPI
,
addPlanByWebAPI
,
updatePlanByWebAPI
,
getPlanStoreListAPI
}
from
'@/api'
import
{
useDatePickerOptions
}
from
'@/hooks'
import
{
v4
as
uuidv4
}
from
'uuid'
;
import
store
from
'@/store'
import
{
parseTime
}
from
'@/utils'
import
{
ElMessage
}
from
'element-plus'
;
import
{
ElMessage
,
ElMessageBox
}
from
'element-plus'
;
// 城市经理状态为 true
const
cityManagerPrivilege
=
computed
(()
=>
{
...
...
@@ -406,7 +433,7 @@ getProCity()
// 查询经销商列表
const
zoneList
=
ref
([])
const
getDealerList
=
async
()
=>
{
const
{
data
}
=
await
getDealerListAPI
()
const
{
data
}
=
await
getDealerListAPI
(
queryParams
)
zoneList
.
value
=
data
.
map
(
item
=>
{
return
{
label
:
item
.
dealerName
,
...
...
@@ -414,6 +441,11 @@ const getDealerList = async () => {
}
})
}
// 经销商远程搜索
const
remoteMethod
=
(
query
)
=>
{
queryParams
.
dealerName
=
query
getDealerList
()
}
getDealerList
()
// 查询战区列表
const
warZoneList
=
ref
([])
...
...
@@ -427,14 +459,17 @@ const getWarZoneList = async () => {
})
}
getWarZoneList
()
// 查询
负责
人列表
// 查询
归属
人列表
const
managerList
=
ref
([])
const
getChargeList
=
async
()
=>
{
const
{
data
}
=
await
getChargeListAPI
()
managerList
.
value
=
data
.
map
(
item
=>
{
return
{
label
:
item
.
empName
,
value
:
item
.
empCode
,
label
:
item
.
name
,
value
:
item
.
id
,
employeeNo
:
item
.
employeeNo
,
deptQcName
:
item
.
deptQcName
,
deptQcId
:
item
.
deptQcId
}
})
}
...
...
@@ -447,11 +482,13 @@ const regionChange = (val) => {
queryParams
.
cityId
=
undefined
}
else
if
(
val
===
'省'
)
{
queryParams
.
cityId
=
undefined
}
else
if
(
val
===
'省-市'
)
{
cityList
.
value
=
[]
getProCity
()
}
getPlanList
()
}
// 等待被删除的数据
const
deleteList
=
ref
([])
...
...
@@ -470,7 +507,7 @@ const columns = ref([
label
:
'活动 ID'
,
prop
:
'id'
,
width
:
90
,
fixed
:
true
//
fixed: true
},
{
label
:
'归属人'
,
...
...
@@ -481,8 +518,7 @@ const columns = ref([
{
label
:
'归属人工号'
,
prop
:
'employeeNo'
,
width
:
140
,
fixed
:
true
width
:
140
},
{
label
:
'经销商 ID'
,
...
...
@@ -584,6 +620,14 @@ const getPlanList = async () => {
// 后台省市不要 id,自己查个名字给后台
queryParams
.
province
=
provinceList
.
value
.
find
(
item
=>
item
.
value
===
queryParams
.
provinceId
)?.
label
queryParams
.
city
=
cityList
.
value
.
find
(
item
=>
item
.
value
===
queryParams
.
cityId
)?.
label
// 城市经理查自己,职能角色查所有(需要的是促销系统 id)
if
(
cityManagerPrivilege
.
value
)
{
// 城市经理
await
getChargeList
()
queryParams
.
employeeId
=
managerList
.
value
.
find
(
item
=>
item
.
employeeNo
===
store
.
state
.
value
.
user
.
userInfo
.
userName
)?.
value
// 先从归属人查询当前登录用户的战区 ID
queryParams
.
warzoneId
=
managerList
.
value
.
find
(
item
=>
item
.
employeeNo
===
store
.
state
.
value
.
user
.
userInfo
.
userName
)?.
deptQcId
}
const
res
=
await
getPlanListAPI
(
queryParams
)
tableList
.
value
=
res
.
data
.
records
total
.
value
=
res
.
data
.
totalRecord
...
...
@@ -591,7 +635,7 @@ const getPlanList = async () => {
getPlanList
()
const
formatter
=
(
row
,
col
,
value
)
=>
{
if
(
col
.
property
===
'planStatus'
)
{
return
value
==
0
?
'
执行中'
:
'取消
'
return
value
==
0
?
'
未执行'
:
'执行
'
}
else
if
(
col
.
property
===
'modifyTime'
||
col
.
property
===
'date'
||
col
.
property
===
'clockInTime'
||
col
.
property
===
'clockOutTime'
)
{
return
parseTime
(
value
)
}
else
{
...
...
@@ -603,7 +647,8 @@ const checkPlanExpire = (row) => {
const
date
=
new
Date
()
const
targetDate
=
new
Date
(
`
${
date
.
getFullYear
()}
-
${
date
.
getMonth
()
+
1
}
-
${
date
.
getDate
()}
10:00:00`
)
const
rowDate
=
new
Date
(
row
.
date
)
if
(
rowDate
<
targetDate
)
{
if
(
rowDate
<
targetDate
||
row
.
planStatus
===
1
)
{
// 过期/已经开始不可以操作
return
false
}
else
{
return
true
...
...
@@ -678,7 +723,7 @@ const confirmPlanBtn = async () => {
// 新增/编辑计划
const
addOrEditPlanVisible
=
ref
(
false
)
const
addOrEditPlanForm
=
re
active
({
const
addOrEditPlanForm
=
re
f
({
})
// 新增/编辑计划-表单验证(所有都是必填项
...
...
@@ -744,7 +789,7 @@ const addOrEditPlanFormRules = reactive({
const
disabledDateFn
=
(
time
)
=>
{
// 判断日期不在某个区间的就禁用
// 职能角色今日到次月最后一天
if
(
store
.
state
.
value
.
user
.
userInfo
.
privilegeId
===
1
)
{
if
(
store
.
state
.
value
.
user
.
userInfo
.
privilegeId
===
2
)
{
const
now
=
new
Date
();
const
start
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
now
.
getDate
());
const
end
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
()
+
2
,
0
);
...
...
@@ -785,32 +830,39 @@ const makeRange = (start, end) => {
}
const
disabledHours
=
(
h
)
=>
{
// 根据上班时间选择的结果,禁用小时
const
date
=
new
Date
(
addOrEditPlanForm
.
clockInTime
)
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
return
makeRange
(
0
,
date
.
getHours
()
-
1
);
}
const
disabledMinutes
=
(
h
,
m
)
=>
{
const
date
=
new
Date
(
addOrEditPlanForm
.
clockInTime
)
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
return
makeRange
(
0
,
date
.
getMinutes
()
-
1
);
}
const
disabledSeconds
=
(
h
,
m
,
s
)
=>
{
const
date
=
new
Date
(
addOrEditPlanForm
.
clockInTime
)
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
return
makeRange
(
0
,
date
.
getSeconds
()
-
1
);
}
// 编辑计划
const
editFn
=
(
row
)
=>
{
addOrEditPlanForm
.
value
=
{
...
row
}
console
.
log
(
'编辑'
,
addOrEditPlanForm
.
value
)
addOrEditPlanVisible
.
value
=
true
}
// 保存新增/编辑计划
const
handleAddOrEditPlan
=
async
()
=>
{
addOrEditPlanForm
.
operNo
=
store
.
state
.
value
.
user
.
userInfo
.
userName
addOrEditPlanForm
.
operName
=
store
.
state
.
value
.
user
.
userInfo
.
nickName
addOrEditPlanForm
.
operId
=
store
.
state
.
value
.
user
.
userInfo
.
userId
await
addPlanByWebAPI
(
addOrEditPlanForm
)
addOrEditPlanForm
.
value
.
operNo
=
store
.
state
.
value
.
user
.
userInfo
.
userName
addOrEditPlanForm
.
value
.
operName
=
store
.
state
.
value
.
user
.
userInfo
.
nickName
addOrEditPlanForm
.
value
.
operId
=
store
.
state
.
value
.
user
.
userInfo
.
userId
if
(
addOrEditPlanForm
.
value
.
id
)
{
await
updatePlanByWebAPI
(
addOrEditPlanForm
.
value
)
}
else
{
await
addPlanByWebAPI
(
addOrEditPlanForm
.
value
)
}
ElMessage
.
success
(
'保存成功'
)
addOrEditPlanVisible
.
value
=
false
getPlanList
()
}
// 删除计划
...
...
@@ -819,13 +871,64 @@ const deletePlane = (row) => {
handleDelete
()
}
const
handleDelete
=
async
()
=>
{
// 弹出确认框
await
ElMessageBox
.
confirm
(
'确认删除吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
await
deletePlanAPI
({
i
ds
:
deleteList
.
value
.
map
(
o
=>
o
.
id
),
planI
ds
:
deleteList
.
value
.
map
(
o
=>
o
.
id
),
employeeNo
:
store
.
state
.
value
.
user
.
userInfo
.
userName
})
ElMessage
.
success
(
'删除成功'
)
getPlanList
()
}
// 获取门店列表
const
storeList
=
ref
([])
const
allStoreList
=
ref
([])
const
selecteStoreInfo
=
ref
(
''
)
const
isInfoError
=
ref
(
false
)
const
getStoreList
=
async
()
=>
{
const
{
data
}
=
await
getPlanStoreListAPI
({
storeName
:
addOrEditPlanForm
.
value
.
storeName
})
allStoreList
.
value
=
data
storeList
.
value
=
data
.
map
(
item
=>
{
return
{
label
:
item
.
storeName
,
value
:
item
.
storeCode
}
})
}
getStoreList
()
// 选择门店
const
selStoreInfo
=
(
storeCode
)
=>
{
// 从门店列表找到选中的对象
const
storeInfo
=
allStoreList
.
value
.
find
(
item
=>
item
.
storeCode
===
storeCode
)
// 判断门店是否包含必要的三个信息(因为勤测那边的数据一致性不好,所以需要判断)
if
(
storeInfo
)
{
if
(
!
storeInfo
.
dealersName
||
!
storeInfo
.
dealerId
||
!
storeInfo
.
lineName
)
{
isInfoError
.
value
=
true
// 门店系统名称、经销商不可为空,请到勤策中修改;
selecteStoreInfo
.
value
=
"门店系统名称、经销商不可为空,请到勤策中修改:"
}
else
{
isInfoError
.
value
=
false
// 门店系统名称、经销商不可为空,请到勤策中修改;
selecteStoreInfo
.
value
=
storeInfo
.
storeAddr
+
"-"
+
storeInfo
.
storeCode
}
}
else
{
isInfoError
.
value
=
false
// 门店系统名称、经销商不可为空,请到勤策中修改;
selecteStoreInfo
.
value
=
''
}
}
// 门店搜索
const
remoteStoreMethod
=
(
query
)
=>
{
addOrEditPlanForm
.
value
.
storeName
=
query
getStoreList
()
}
</
script
>
<
style
scoped
...
...
@@ -838,8 +941,23 @@ const handleDelete = async () => {
/* 灰色过期行颜色 */
::v-deep
(
.timeout-row
)
{
--el-table-tr-bg-color
:
rgb
(
215
,
215
,
215
);
--el-table-tr-bg-color
:
var
(
--
el-timeout-row
);
}
}
/* 门店列表选择后-下面的介绍信息 */
.info_p
{
margin
:
0
;
font-size
:
12px
;
color
:
gray
;
}
.info_error
{
color
:
rgb
(
167
,
0
,
0
);
}
.link
{
color
:
#409eff
;
}
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论