Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
33ee5838
提交
33ee5838
authored
6月 10, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
差异文件
Please enter a commit message to explain why this merge is necessary,
上级
5c715218
cfc60b00
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
48 行增加
和
28 行删除
+48
-28
plan.js
src/api/promotion/plan.js
+2
-5
index.js
src/hooks/promotion/index.js
+16
-4
index.vue
src/mobile/views/promotion/plan/editing/index.vue
+13
-6
index.vue
src/mobile/views/promotion/plan/index/index.vue
+3
-3
effectivePlan.vue
src/views/promotion/plan/effectivePlan.vue
+14
-10
没有找到文件。
src/api/promotion/plan.js
浏览文件 @
33ee5838
...
...
@@ -84,15 +84,12 @@ export function updatePlanByWebAPI(data) {
}
// 查询门店列表
export
function
getPlanStoreListAPI
(
queryParams
=
{}
)
{
export
function
getPlanStoreListAPI
(
data
)
{
return
request
({
baseURL
:
VITE_APP_PROMOTION
,
url
:
'/user/clientele/query/store/list'
,
method
:
'POST'
,
data
:
{
storeNameVague
:
queryParams
.
storeName
,
storeCode
:
queryParams
.
storeCode
,
}
data
})
}
...
...
src/hooks/promotion/index.js
浏览文件 @
33ee5838
import
{
parseTime
}
from
'@/utils'
/**
* 判断计划是否可
编辑
/删除
* 判断计划是否可
变更
/删除
* @param {*} row 计划信息对象
* @returns boolean true 可
编辑/删除,false 不可编辑
/删除
* @returns boolean true 可
变更/删除,false 不可变更
/删除
*/
export
const
checkPlanExpire
=
(
row
)
=>
{
// 1. 计划已经开始,不可
编辑
/删除
// 2. 计划未开始,但是上班时间已经 1 小时后,不可
编辑
/删除
// 1. 计划已经开始,不可
变更
/删除
// 2. 计划未开始,但是上班时间已经 1 小时后,不可
变更
/删除
const
date
=
new
Date
()
const
rowDate
=
new
Date
(
row
.
clockInTime
)
rowDate
.
setHours
(
rowDate
.
getHours
()
+
1
)
return
!
(
rowDate
<
date
||
row
.
planStatus
===
1
)
}
/**
* 判断计划是否可变更(单独判断按钮禁用状态)
* 活动日期小于等于今日日期,则禁用变更按钮
* @param {*} row 计划信息对象
* @returns boolean true 可变更,false 不可变更
*/
export
const
checkPlanChangeExpire
=
(
row
)
=>
{
const
date
=
new
Date
()
const
rowDate
=
new
Date
(
row
.
activityDate
)
return
!
(
rowDate
<=
date
)
}
/**
* 判断任务是否可删除
* @param {*} row 计划信息对象
...
...
src/mobile/views/promotion/plan/editing/index.vue
浏览文件 @
33ee5838
...
...
@@ -12,7 +12,6 @@
<van-cell-group
inset
>
<van-field
v-model=
"form.storeName"
is-link
:disabled=
"!!planId"
label=
"选择门店"
required
:rules=
"[
{ required: true, message: '请选择门店' }]"
...
...
@@ -24,8 +23,7 @@
readonly
:value=
"form.storeName"
name=
"storeName"
placeholder=
"点击选择门店"
:disabled=
"!!planId"
>
placeholder=
"点击选择门店"
>
<p
v-if=
"form.storeName && !planId"
>
{{
form
.
storeAddr
}}
-
{{
form
.
storeCode
}}
</p>
</div>
</
template
>
...
...
@@ -33,7 +31,6 @@
<van-field
:modelValue=
"parseTime(form.date, '{y}-{m}-{d}')"
is-link
readonly
:disabled=
"!!planId"
name=
"date"
label=
"活动日期"
placeholder=
"点击选择时间"
...
...
@@ -177,6 +174,7 @@ const route = useRoute()
const
clickBack
=
()
=>
{
router
.
back
()
}
const
editDealerId
=
ref
(
null
)
// 变更计划的经销商 ID
const
planId
=
route
.
params
.
planId
const
init
=
async
()
=>
{
...
...
@@ -188,6 +186,8 @@ const init = async () => {
form
.
inTime
=
parseTime
(
res
.
data
.
planInfo
.
clockInTime
,
"{h}:{i}"
)
form
.
outTime
=
parseTime
(
res
.
data
.
planInfo
.
clockOutTime
,
"{h}:{i}"
)
minTime
.
value
=
form
.
inTime
+
":00"
editDealerId
.
value
=
res
.
data
.
planInfo
.
dealerId
}
if
(
planId
)
{
init
()
...
...
@@ -241,7 +241,8 @@ const selStoreName = async () => {
// 获取门店列表
const
getStoreList
=
async
(
storeName
)
=>
{
const
res
=
await
getPlanStoreListAPI
({
storeName
storeNameVague
:
storeName
,
dealerId
:
editDealerId
.
value
})
columns
.
value
=
res
.
data
.
map
(
item
=>
({
text
:
item
.
storeName
,
...
...
@@ -268,7 +269,12 @@ const planMinDate = computed(() => {
date
.
setDate
(
1
)
return
date
}
else
{
return
new
Date
()
// 如果是变更计划,则选择明天以后的日期
const
date
=
new
Date
()
if
(
planId
)
{
date
.
setDate
(
date
.
getDate
()
+
1
)
}
return
date
}
})
...
...
@@ -352,6 +358,7 @@ const reset = () => {
form
.
outTime
=
''
form
.
salary
=
0
form
.
incidentals
=
0
editDealerId
.
value
=
null
}
// Picker 选择器
...
...
src/mobile/views/promotion/plan/index/index.vue
浏览文件 @
33ee5838
...
...
@@ -42,7 +42,7 @@
v
-
if
=
"!showSelect && !query.isDeleted"
>
<
van
-
button
square
type
=
"success"
text
=
"
编辑
"
text
=
"
变更
"
@
click
=
"editPlan(item)"
/>
<
van
-
button
square
type
=
"danger"
...
...
@@ -194,10 +194,10 @@ const querySearch = () => {
getPlanList
()
}
//
编辑
计划
//
变更
计划
const
editPlan
=
(
row
)
=>
{
if
(
!
checkPlanExpire
(
row
))
{
return
proxy
.
$modal
.
msgWarning
(
'无法
编辑
,已执行或之前计划'
)
return
proxy
.
$modal
.
msgWarning
(
'无法
变更
,已执行或之前计划'
)
}
router
.
push
(
`/m/promotion_plan_editing/${row.id
}
`
)
}
...
...
src/views/promotion/plan/effectivePlan.vue
浏览文件 @
33ee5838
...
...
@@ -82,7 +82,7 @@
link
:disabled=
"!selectableFn(scope.row)"
@
click=
"editFn(scope.row)"
>
编辑
变更
</el-button>
<el-button
type=
"danger"
link
...
...
@@ -152,8 +152,7 @@
clearable
@
change=
"selStoreInfo"
remote
:remote-method=
"remoteStoreMethod"
:disabled=
"!!addOrEditPlanForm.id"
>
:remote-method=
"remoteStoreMethod"
>
<el-option
v-for=
"item in storeList"
:key=
"item.value"
:label=
"item.label"
...
...
@@ -177,9 +176,7 @@
<el-date-picker
v-model=
"addOrEditPlanForm.date"
:clearable=
"false"
start-placeholder=
"活动日期"
value-format=
"YYYY-MM-DDTHH:mm:ss"
:disabled-date=
"disabledDateFn"
:disabled=
"!!addOrEditPlanForm.id"
/>
:disabled-date=
"disabledDateFn"
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -409,23 +406,28 @@ const uploadChangeFile = async (file) => {
}
// 单条
const
editFn
=
(
row
)
=>
{
proxy
.
resetForm
(
"addOrEditPlanRef"
);
console
.
log
(
new
Date
(
row
.
date
))
addOrEditPlanForm
.
value
=
{
...
row
,
inTime
:
parseTime
(
row
.
clockInTime
,
"{h}:{i}:{s}"
),
outTime
:
parseTime
(
row
.
clockOutTime
,
"{h}:{i}:{s}"
)
}
editDealerId
.
value
=
row
.
dealerId
addOrEditPlanVisible
.
value
=
true
}
/*************** 新增/修改计划弹框 ***************/
// 新增/
编辑
计划表单弹框
// 新增/
变更
计划表单弹框
const
addOrEditPlanVisible
=
ref
(
false
)
const
addOrEditPlanForm
=
ref
({})
const
activityModeList
=
ref
(
PROMOTION_ACTIVITY_MODE_LIST
)
// 活动模式
const
editDealerId
=
ref
(
null
)
// 经销商 ID
// 重置表单
const
resetAddOrEditPlanForm
=
()
=>
{
addOrEditPlanForm
.
value
=
{}
selecteStoreInfo
.
value
=
''
editDealerId
.
value
=
null
isInfoError
.
value
=
false
}
// 表单验证(所有都是必填项)
...
...
@@ -494,7 +496,8 @@ const selecteStoreInfo = ref('')
const
isInfoError
=
ref
(
false
)
const
getStoreList
=
async
()
=>
{
const
{
data
}
=
await
getPlanStoreListAPI
({
storeName
:
addOrEditPlanForm
.
value
.
storeName
storeNameVague
:
addOrEditPlanForm
.
value
.
storeName
,
dealerId
:
editDealerId
.
value
})
allStoreList
.
value
=
data
storeList
.
value
=
data
.
map
(
item
=>
{
...
...
@@ -545,7 +548,8 @@ const disabledDateFn = (time) => {
}
else
{
// 职能角色能添加当月今天往后和下个月一整个月
const
now
=
new
Date
();
const
thisMonthStart
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
now
.
getDate
());
// 变更计划时,只能选择明天以后的
const
thisMonthStart
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
addOrEditPlanForm
.
value
.
id
?
now
.
getDate
()
+
1
:
now
.
getDate
());
const
nextMonthEnd
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
()
+
2
,
0
);
return
time
.
getTime
()
<
thisMonthStart
.
getTime
()
||
time
.
getTime
()
>
nextMonthEnd
.
getTime
();
}
...
...
@@ -587,7 +591,7 @@ const selEmployee = () => {
}
// 保存新增/
编辑
计划
// 保存新增/
变更
计划
const
handleAddOrEditPlan
=
async
()
=>
{
// 表单校验
await
proxy
.
$refs
.
addOrEditPlanRef
.
validate
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论