Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
4b922a3a
提交
4b922a3a
authored
2月 24, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(promotion/plan): 新增编辑时,检验所有表单
修复下班时间小时选下一个小时以后,分钟选不了 0 等
上级
b273c54f
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
48 行增加
和
18 行删除
+48
-18
request.js
src/utils/request.js
+2
-2
index.vue
src/views/promotion/plan/index.vue
+46
-16
没有找到文件。
src/utils/request.js
浏览文件 @
4b922a3a
...
@@ -13,7 +13,7 @@ let downloadLoadingInstance;
...
@@ -13,7 +13,7 @@ let downloadLoadingInstance;
export
let
isRelogin
=
{
show
:
false
};
export
let
isRelogin
=
{
show
:
false
};
// 促销系统后台 baseURL
// 促销系统后台 baseURL
export
const
promotionBaseURL
=
import
.
meta
.
env
.
VITE_APP_PROMOTION
_BASE_API
export
const
promotionBaseURL
=
import
.
meta
.
env
.
VITE_APP_PROMOTION
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
axios
.
defaults
.
headers
[
'Content-Type'
]
=
'application/json;charset=utf-8'
// 创建axios实例
// 创建axios实例
...
@@ -31,7 +31,7 @@ service.interceptors.request.use(config => {
...
@@ -31,7 +31,7 @@ service.interceptors.request.use(config => {
// 是否需要防止数据重复提交
// 是否需要防止数据重复提交
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
const
isRepeatSubmit
=
(
config
.
headers
||
{}).
repeatSubmit
===
false
if
(
getToken
()
&&
!
isToken
)
{
if
(
getToken
()
&&
!
isToken
)
{
if
(
config
.
url
.
indexOf
(
promotionBaseURL
)
>=
0
)
{
if
(
config
.
baseURL
===
promotionBaseURL
)
{
// 促销后台不能带 Bearer 前缀
// 促销后台不能带 Bearer 前缀
config
.
headers
[
'Authorization'
]
=
getToken
()
config
.
headers
[
'Authorization'
]
=
getToken
()
}
else
{
}
else
{
...
...
src/views/promotion/plan/index.vue
浏览文件 @
4b922a3a
...
@@ -234,13 +234,14 @@
...
@@ -234,13 +234,14 @@
<el-dialog
:title=
"(addOrEditPlanForm.id ? '修改' : '新增') + '计划'"
<el-dialog
:title=
"(addOrEditPlanForm.id ? '修改' : '新增') + '计划'"
v-model=
"addOrEditPlanVisible"
v-model=
"addOrEditPlanVisible"
width=
"60%"
>
width=
"60%"
>
<!--
日期
表单 -->
<!-- 表单 -->
<el-form
:model=
"addOrEditPlanForm"
<el-form
:model=
"addOrEditPlanForm"
label-width=
"150px"
label-width=
"150px"
:rules=
"addOrEditPlanFormRules"
:rules=
"addOrEditPlanFormRules"
ref=
"addOrEditPlanRef"
inline
>
inline
>
<el-row>
<el-row>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 门店列表 -->
<!-- 门店列表 -->
<el-form-item
label=
"门店列表"
<el-form-item
label=
"门店列表"
prop=
"storeCode"
>
prop=
"storeCode"
>
...
@@ -265,11 +266,11 @@
...
@@ -265,11 +266,11 @@
<a
class=
"link"
<a
class=
"link"
v-show=
"isInfoError"
v-show=
"isInfoError"
target=
"_blank"
target=
"_blank"
href=
"https://cloud.region2.qince.com/sysapp/react/web/main.html#/home"
>
跳转勤策系统
</a>
href=
"https://cloud.region2.qince.com/sysapp/react/web/main.html#/home"
>
跳转勤策系统
</a>
</div>
</div>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 活动日期 -->
<!-- 活动日期 -->
<el-form-item
label=
"活动日期"
<el-form-item
label=
"活动日期"
prop=
"date"
>
prop=
"date"
>
...
@@ -282,14 +283,15 @@
...
@@ -282,14 +283,15 @@
</el-row>
</el-row>
<el-row>
<el-row>
<!-- 活动模式 -->
<!-- 活动模式 -->
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<el-form-item
label=
"活动模式"
<el-form-item
label=
"活动模式"
prop=
"pattern"
>
prop=
"pattern"
>
<el-select
v-model=
"addOrEditPlanForm.pattern"
<el-select
v-model=
"addOrEditPlanForm.pattern"
placeholder=
"请选择活动模式"
placeholder=
"请选择活动模式"
filterable
filterable
clearable
clearable
style=
"width: 95%"
>
style=
"width: 95%"
@
change=
"selPattern"
>
<el-option
v-for=
"item in activityModeList"
<el-option
v-for=
"item in activityModeList"
:key=
"item.value"
:key=
"item.value"
:label=
"item.label"
:label=
"item.label"
...
@@ -297,7 +299,7 @@
...
@@ -297,7 +299,7 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 归属人 -->
<!-- 归属人 -->
<el-form-item
label=
"归属人"
<el-form-item
label=
"归属人"
prop=
"employeeNo"
>
prop=
"employeeNo"
>
...
@@ -306,7 +308,8 @@
...
@@ -306,7 +308,8 @@
filterable
filterable
clearable
clearable
style=
"width: 95%"
style=
"width: 95%"
:disabled=
"cityManagerPrivilege"
>
:disabled=
"cityManagerPrivilege"
@
change=
"selEmployee"
>
<el-option
v-for=
"item in managerList"
<el-option
v-for=
"item in managerList"
:key=
"item.employeeNo"
:key=
"item.employeeNo"
:label=
"item.label"
:label=
"item.label"
...
@@ -316,7 +319,7 @@
...
@@ -316,7 +319,7 @@
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 上班打卡时间 -->
<!-- 上班打卡时间 -->
<el-form-item
label=
"上班打卡时间"
<el-form-item
label=
"上班打卡时间"
prop=
"clockInTime"
>
prop=
"clockInTime"
>
...
@@ -326,7 +329,7 @@
...
@@ -326,7 +329,7 @@
style=
"width: 95%"
/>
style=
"width: 95%"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 下班打卡时间 -->
<!-- 下班打卡时间 -->
<el-form-item
label=
"下班打卡时间"
<el-form-item
label=
"下班打卡时间"
prop=
"clockOutTime"
>
prop=
"clockOutTime"
>
...
@@ -342,7 +345,7 @@
...
@@ -342,7 +345,7 @@
</el-col>
</el-col>
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 工资 -->
<!-- 工资 -->
<el-form-item
label=
"工资"
<el-form-item
label=
"工资"
prop=
"salary"
>
prop=
"salary"
>
...
@@ -351,7 +354,7 @@
...
@@ -351,7 +354,7 @@
placeholder=
"请输入工资"
/>
placeholder=
"请输入工资"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"1
0
"
>
<el-col
:span=
"1
2
"
>
<!-- 杂费 -->
<!-- 杂费 -->
<el-form-item
label=
"杂费"
<el-form-item
label=
"杂费"
prop=
"incidentals"
>
prop=
"incidentals"
>
...
@@ -422,6 +425,8 @@ const getProCity = async () => {
...
@@ -422,6 +425,8 @@ const getProCity = async () => {
value
:
item
.
num
value
:
item
.
num
}))
}))
}
else
{
}
else
{
queryParams
.
cityId
=
undefined
cityList
.
value
=
[]
provinceList
.
value
=
data
.
map
(
item
=>
({
provinceList
.
value
=
data
.
map
(
item
=>
({
label
:
item
.
name
,
label
:
item
.
name
,
value
:
item
.
num
value
:
item
.
num
...
@@ -430,6 +435,7 @@ const getProCity = async () => {
...
@@ -430,6 +435,7 @@ const getProCity = async () => {
getPlanList
()
getPlanList
()
}
}
getProCity
()
getProCity
()
// 查询经销商列表
// 查询经销商列表
const
zoneList
=
ref
([])
const
zoneList
=
ref
([])
const
getDealerList
=
async
()
=>
{
const
getDealerList
=
async
()
=>
{
...
@@ -692,7 +698,7 @@ const planTableList = ref([])
...
@@ -692,7 +698,7 @@ const planTableList = ref([])
const
dialogVisible
=
ref
(
false
)
const
dialogVisible
=
ref
(
false
)
const
confirmExcelUUID
=
ref
(
''
)
const
confirmExcelUUID
=
ref
(
''
)
const
confirmTableColumns
=
[
const
confirmTableColumns
=
[
{
{
label
:
'活动 ID'
,
label
:
'活动 ID'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
90
,
width
:
90
,
...
@@ -824,7 +830,8 @@ const formatterConfirm = (row, col, value) => {
...
@@ -824,7 +830,8 @@ const formatterConfirm = (row, col, value) => {
return
value
return
value
}
}
}
}
// 确认计划-保存表格到计划库
const
addOrEditPlanRef
=
ref
(
null
)
// 表格上传计划确认保存
const
confirmPlanBtn
=
async
()
=>
{
const
confirmPlanBtn
=
async
()
=>
{
await
savePlanAPI
(
confirmExcelUUID
.
value
)
await
savePlanAPI
(
confirmExcelUUID
.
value
)
ElMessage
.
success
(
'保存成功'
)
ElMessage
.
success
(
'保存成功'
)
...
@@ -835,8 +842,13 @@ const confirmPlanBtn = async () => {
...
@@ -835,8 +842,13 @@ const confirmPlanBtn = async () => {
// 新增/编辑计划
// 新增/编辑计划
const
addOrEditPlanVisible
=
ref
(
false
)
const
addOrEditPlanVisible
=
ref
(
false
)
const
addOrEditPlanForm
=
ref
({
const
addOrEditPlanForm
=
ref
({
})
})
// 重置表单
const
resetAddOrEditPlanForm
=
()
=>
{
addOrEditPlanForm
.
value
=
{}
selecteStoreInfo
.
value
=
''
isInfoError
.
value
=
false
}
// 新增/编辑计划-表单验证(所有都是必填项
// 新增/编辑计划-表单验证(所有都是必填项
const
addOrEditPlanFormRules
=
reactive
({
const
addOrEditPlanFormRules
=
reactive
({
storeCode
:
[
storeCode
:
[
...
@@ -915,6 +927,7 @@ const disabledDateFn = (time) => {
...
@@ -915,6 +927,7 @@ const disabledDateFn = (time) => {
}
}
}
}
const
handleAdd
=
()
=>
{
const
handleAdd
=
()
=>
{
resetAddOrEditPlanForm
()
addOrEditPlanVisible
.
value
=
true
addOrEditPlanVisible
.
value
=
true
}
}
const
activityModeList
=
ref
([
const
activityModeList
=
ref
([
...
@@ -945,8 +958,14 @@ const disabledHours = (h) => {
...
@@ -945,8 +958,14 @@ const disabledHours = (h) => {
return
makeRange
(
0
,
date
.
getHours
()
-
1
);
return
makeRange
(
0
,
date
.
getHours
()
-
1
);
}
}
const
disabledMinutes
=
(
h
,
m
)
=>
{
const
disabledMinutes
=
(
h
,
m
)
=>
{
// 如果小时大于上班打卡时间小时,则不限制分钟
const
inDate
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
if
(
h
>
inDate
.
getHours
())
{
return
makeRange
(
0
,
-
1
);
}
else
{
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
return
makeRange
(
0
,
date
.
getMinutes
()
-
1
);
return
makeRange
(
0
,
date
.
getMinutes
()
-
1
);
}
}
}
const
disabledSeconds
=
(
h
,
m
,
s
)
=>
{
const
disabledSeconds
=
(
h
,
m
,
s
)
=>
{
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
const
date
=
new
Date
(
addOrEditPlanForm
.
value
.
clockInTime
)
...
@@ -956,12 +975,13 @@ const disabledSeconds = (h, m, s) => {
...
@@ -956,12 +975,13 @@ const disabledSeconds = (h, m, s) => {
// 编辑计划
// 编辑计划
const
editFn
=
(
row
)
=>
{
const
editFn
=
(
row
)
=>
{
addOrEditPlanForm
.
value
=
{
...
row
}
addOrEditPlanForm
.
value
=
{
...
row
}
console
.
log
(
'编辑'
,
addOrEditPlanForm
.
value
)
addOrEditPlanVisible
.
value
=
true
addOrEditPlanVisible
.
value
=
true
}
}
// 保存新增/编辑计划
// 保存新增/编辑计划
const
handleAddOrEditPlan
=
async
()
=>
{
const
handleAddOrEditPlan
=
async
()
=>
{
// 表单校验
await
addOrEditPlanRef
.
value
.
validate
()
addOrEditPlanForm
.
value
.
operNo
=
store
.
state
.
value
.
user
.
userInfo
.
userName
addOrEditPlanForm
.
value
.
operNo
=
store
.
state
.
value
.
user
.
userInfo
.
userName
addOrEditPlanForm
.
value
.
operName
=
store
.
state
.
value
.
user
.
userInfo
.
nickName
addOrEditPlanForm
.
value
.
operName
=
store
.
state
.
value
.
user
.
userInfo
.
nickName
addOrEditPlanForm
.
value
.
operId
=
store
.
state
.
value
.
user
.
userInfo
.
userId
addOrEditPlanForm
.
value
.
operId
=
store
.
state
.
value
.
user
.
userInfo
.
userId
...
@@ -1034,12 +1054,22 @@ const selStoreInfo = (storeCode) => {
...
@@ -1034,12 +1054,22 @@ const selStoreInfo = (storeCode) => {
// 门店系统名称、经销商不可为空,请到勤策中修改;
// 门店系统名称、经销商不可为空,请到勤策中修改;
selecteStoreInfo
.
value
=
''
selecteStoreInfo
.
value
=
''
}
}
// 清除表单验证提示
addOrEditPlanRef
.
value
.
clearValidate
(
'storeCode'
);
}
}
// 门店搜索
// 门店搜索
const
remoteStoreMethod
=
(
query
)
=>
{
const
remoteStoreMethod
=
(
query
)
=>
{
addOrEditPlanForm
.
value
.
storeName
=
query
addOrEditPlanForm
.
value
.
storeName
=
query
getStoreList
()
getStoreList
()
}
}
// 新增计划表单-选完以后去掉错误提示
const
selPattern
=
()
=>
{
addOrEditPlanRef
.
value
.
clearValidate
(
'pattern'
);
}
const
selEmployee
=
()
=>
{
addOrEditPlanRef
.
value
.
clearValidate
(
'employeeNo'
);
}
</
script
>
</
script
>
<
style
scoped
<
style
scoped
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论