Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-boutique-work-wechat
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 086d8b7b
authored
Jan 20, 2026
by
Lin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 修改申诉表单
1 parent
2f3a387e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
173 additions
and
24 deletions
packageEquity/pages/salaryAppeal/components/appealSelector/appealSelector.js
packageEquity/pages/salaryAppeal/components/appealSelector/appealSelector.wxml
packageEquity/pages/salaryAppeal/components/staffSelector/staffSelector.sass
packageEquity/pages/salaryAppeal/constantData.js
packageEquity/pages/salaryAppeal/salaryAppeal.js
packageEquity/pages/salaryAppeal/components/appealSelector/appealSelector.js
View file @
086d8b7
...
@@ -18,7 +18,7 @@ Component({
...
@@ -18,7 +18,7 @@ Component({
},
},
data
:
{
data
:
{
appeal
Days
:
''
,
appeal
Num
:
''
,
imageList
:
[],
imageList
:
[],
remarks
:
''
,
remarks
:
''
,
otherIssues
:
''
,
otherIssues
:
''
,
...
@@ -34,8 +34,22 @@ Component({
...
@@ -34,8 +34,22 @@ Component({
this
.
triggerEvent
(
'close'
)
this
.
triggerEvent
(
'close'
)
},
},
onAppealDaysInput
(
e
)
{
onAppealNumInput
(
e
)
{
this
.
setData
({
appealDays
:
e
.
detail
.
value
.
replace
(
/
[^\d]
/g
,
''
).
substring
(
0
,
3
)
})
const
{
appealType
}
=
this
.
properties
let
value
=
e
.
detail
.
value
if
(
appealType
===
'recording'
)
{
// daily 类型:只允许整数,最多3位
value
=
value
.
replace
(
/
[^\d]
/g
,
''
).
substring
(
0
,
5
)
}
else
{
// 其他类型:支持小数点后两位,格式:最多3位整数.最多2位小数
value
=
value
.
replace
(
/
[^\d
.
]
/g
,
''
)
// 只保留数字和小数点
// 限制格式:最多3位整数,可选的小数点和最多2位小数
const
match
=
value
.
match
(
/^
(\d{0,3})(\.?)(\d{0,2})
/
)
value
=
match
?
match
[
0
]
:
''
}
this
.
setData
({
appealNum
:
value
})
},
},
onRemarksInput
(
e
)
{
onRemarksInput
(
e
)
{
...
@@ -243,18 +257,33 @@ Component({
...
@@ -243,18 +257,33 @@ Component({
},
},
onConfirm
()
{
onConfirm
()
{
const
{
appealDays
,
imageList
,
remarks
,
otherIssues
,
actualDays
}
=
this
.
data
const
{
appealNum
,
imageList
,
remarks
,
otherIssues
,
actualDays
}
=
this
.
data
const
{
appealLabel
,
unit
,
maxValue
}
=
this
.
properties
const
{
appealLabel
,
unit
,
maxValue
,
appealType
}
=
this
.
properties
if
(
!
appealDays
||
appealDays
.
trim
()
===
''
)
{
// 验证输入是否为空
if
(
!
appealNum
||
appealNum
.
trim
()
===
''
)
{
wx
.
showToast
({
title
:
`请输入
${
appealLabel
}
`
,
icon
:
'none'
})
wx
.
showToast
({
title
:
`请输入
${
appealLabel
}
`
,
icon
:
'none'
})
return
return
}
}
const
num
=
parseInt
(
appealDays
,
10
)
// 解析数值(daily 类型为整数,其他类型支持小数)
const
num
=
appealType
===
'daily'
?
parseInt
(
appealNum
,
10
)
:
parseFloat
(
appealNum
)
// 验证数值有效性
if
(
isNaN
(
num
)
||
num
<
0
||
num
>
maxValue
)
{
if
(
isNaN
(
num
)
||
num
<
0
||
num
>
maxValue
)
{
wx
.
showToast
({
title
:
`请输入正确的
${
unit
}
(0-
${
maxValue
}
)`
,
icon
:
'none'
})
wx
.
showToast
({
title
:
`请输入正确的
${
unit
}
(0-
${
maxValue
}
)`
,
icon
:
'none'
})
return
return
}
}
// 非 daily 类型额外验证:小数位数不超过2位
if
(
appealType
!==
'daily'
&&
appealNum
.
includes
(
'.'
))
{
const
decimalPart
=
appealNum
.
split
(
'.'
)[
1
]
if
(
decimalPart
&&
decimalPart
.
length
>
2
)
{
wx
.
showToast
({
title
:
`小数点后最多保留两位`
,
icon
:
'none'
})
return
}
}
// 只返回已完成上传的图片(status === 'done' 或没有 status 字段的)
// 只返回已完成上传的图片(status === 'done' 或没有 status 字段的)
const
doneImageList
=
imageList
const
doneImageList
=
imageList
.
filter
(
item
=>
!
item
.
status
||
item
.
status
===
'done'
)
.
filter
(
item
=>
!
item
.
status
||
item
.
status
===
'done'
)
...
@@ -263,7 +292,7 @@ Component({
...
@@ -263,7 +292,7 @@ Component({
this
.
triggerEvent
(
'confirm'
,
{
this
.
triggerEvent
(
'confirm'
,
{
actualDays
:
Number
(
actualDays
)
||
0
,
actualDays
:
Number
(
actualDays
)
||
0
,
appeal
Days
:
num
,
appeal
Num
:
num
,
imageList
:
doneImageList
,
imageList
:
doneImageList
,
remarks
:
remarks
.
trim
(),
remarks
:
remarks
.
trim
(),
otherIssues
:
otherIssues
.
trim
()
otherIssues
:
otherIssues
.
trim
()
...
@@ -273,7 +302,7 @@ Component({
...
@@ -273,7 +302,7 @@ Component({
resetForm
()
{
resetForm
()
{
this
.
setData
({
this
.
setData
({
appeal
Days
:
''
,
appeal
Num
:
''
,
imageList
:
[],
imageList
:
[],
remarks
:
''
,
remarks
:
''
,
otherIssues
:
''
,
otherIssues
:
''
,
...
...
packageEquity/pages/salaryAppeal/components/appealSelector/appealSelector.wxml
View file @
086d8b7
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<view class="form-item form-item-row">
<view class="form-item form-item-row">
<view class="form-label">{{ appealLabel }}</view>
<view class="form-label">{{ appealLabel }}</view>
<view class="form-input-wrapper">
<view class="form-input-wrapper">
<input type="digit" class="form-input" placeholder="{{ appealType === '
daily' ? '输入正确条数' : '输入正确数字' }}" value="{{ appealDays }}" bindinput="onAppealDaysInput" maxlength="3
" />
<input type="digit" class="form-input" placeholder="{{ appealType === '
recording' ? '输入正确条数' : '输入正确数字' }}" value="{{ appealNum }}" bindinput="onAppealNumInput
" />
<text class="form-unit">{{ unit }}</text>
<text class="form-unit">{{ unit }}</text>
</view>
</view>
</view>
</view>
...
...
packageEquity/pages/salaryAppeal/components/staffSelector/staffSelector.sass
View file @
086d8b7
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
padding
:
var
(
--
fontSize24
)
;
padding
:
var
(
--
fontSize24
)
0
;
border-bottom
:
var
(
--
fontSize2
)
solid
#eee
;
border-bottom
:
var
(
--
fontSize2
)
solid
#eee
;
font-size
:
var
(
--
fontSize28
)
;
font-size
:
var
(
--
fontSize28
)
;
}
}
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
}
}
.option-item.checked
.option-name
{
.option-item.checked
.option-name
{
color
:
#
1989fa
;
color
:
#
347BFF
;
}
}
.option-check
{
.option-check
{
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
}
}
.option-check.checked
{
.option-check.checked
{
color
:
#
1989fa
;
color
:
#
347BFF
;
}
}
.check-icon
{
.check-icon
{
...
...
packageEquity/pages/salaryAppeal/constantData.js
0 → 100644
View file @
086d8b7
/**
* 工资申诉常量数据映射
* 将API返回的数据映射到 salaryItems 数据结构
*/
// 工资项基础配置
const
SALARY_ITEM_CONFIG
=
[
{
id
:
'attendance'
,
title
:
'实际出勤天数'
,
centerLeft
:
'根据打卡数据产生'
,
btnText
:
'申诉考勤'
,
unit
:
'天'
,
defaultValue
:
0
},
{
id
:
'daily'
,
title
:
'日报完成天数'
,
centerLeft
:
'填写驻店日报天数'
,
btnText
:
'去补日报'
,
unit
:
'天'
,
defaultValue
:
0
,
hasMissingDates
:
true
},
{
id
:
'recording'
,
title
:
'平板录音总数'
,
centerLeft
:
'触客总数为'
,
btnText
:
'申诉平板'
,
unit
:
'条'
,
defaultValue
:
0
}
]
// API字段映射配置
const
API_FIELD_MAP
=
{
attendance
:
{
value
:
'actualAttendanceDays'
,
deduction
:
'attendanceDeductionAmount'
,
appealable
:
'attendanceAppealable'
},
daily
:
{
value
:
'dailyReportDays'
,
deduction
:
'dailyReportDeductionAmount'
,
appealable
:
'dailyReportable'
,
missingDates
:
'missingDailyReportDates'
},
recording
:
{
value
:
'padRecordNum'
,
deduction
:
'padDeductionAmount'
,
appealable
:
'padAppealable'
}
}
/**
* 格式化扣款金额显示
*/
const
formatDeductionAmount
=
(
amount
)
=>
{
if
(
!
amount
||
amount
===
0
)
return
''
return
amount
>
0
?
`-
${
amount
}
元`
:
`
${
amount
}
元`
}
/**
* 格式化缺失日期显示
*/
const
formatMissingDates
=
(
dates
)
=>
{
if
(
!
dates
||
!
Array
.
isArray
(
dates
)
||
dates
.
length
===
0
)
return
''
return
dates
.
map
(
date
=>
{
if
(
date
.
includes
(
'-'
))
{
const
day
=
date
.
split
(
'-'
)[
2
]
return
day
.
replace
(
/^0+/
,
''
)
}
return
date
}).
join
(
'、'
)
+
'号'
}
/**
* 格式化数值显示
*/
const
formatValue
=
(
value
,
unit
,
defaultValue
=
0
)
=>
{
const
num
=
value
!==
undefined
&&
value
!==
null
?
value
:
defaultValue
return
`
${
num
}${
unit
}
`
}
/**
* 创建单个工资项数据
*/
const
createSalaryItem
=
(
config
,
apiData
)
=>
{
const
fieldMap
=
API_FIELD_MAP
[
config
.
id
]
const
value
=
apiData
[
fieldMap
.
value
]
const
deductionAmount
=
apiData
[
fieldMap
.
deduction
]
const
appealable
=
apiData
[
fieldMap
.
appealable
]
||
false
const
missingDates
=
config
.
hasMissingDates
?
apiData
[
fieldMap
.
missingDates
]
:
null
return
{
id
:
config
.
id
,
title
:
config
.
title
,
value
:
formatValue
(
value
,
config
.
unit
,
config
.
defaultValue
),
centerLeft
:
config
.
centerLeft
,
centerLeftNum
:
''
,
centerRight
:
deductionAmount
?
'扣款'
:
''
,
centerRightPrice
:
formatDeductionAmount
(
deductionAmount
),
bottomText
:
missingDates
&&
missingDates
.
length
>
0
?
'缺失天数为'
:
''
,
bottomDays
:
config
.
hasMissingDates
?
formatMissingDates
(
missingDates
)
:
''
,
btnText
:
appealable
?
config
.
btnText
:
''
,
btnType
:
config
.
id
,
appealable
}
}
/**
* 将API数据映射到工资项数据结构
* @param {Object} apiData - API返回的数据对象
* @returns {Array} salaryItems 数组
*/
export
function
mapApiDataToSalaryItems
(
apiData
=
{})
{
return
SALARY_ITEM_CONFIG
.
map
(
config
=>
createSalaryItem
(
config
,
apiData
))
}
/**
* 默认的工资项数据结构(用于初始化或兜底)
*/
export
const
defaultSalaryItems
=
mapApiDataToSalaryItems
({})
packageEquity/pages/salaryAppeal/salaryAppeal.js
View file @
086d8b7
// packageEquity/pages/salaryAppeal/salaryAppeal.js
// packageEquity/pages/salaryAppeal/salaryAppeal.js
import
{
getSummaryInfo
}
from
'./api'
Page
({
Page
({
/**
/**
...
@@ -31,26 +32,22 @@ Page({
...
@@ -31,26 +32,22 @@ Page({
title
:
'实际出勤天数'
,
title
:
'实际出勤天数'
,
value
:
'26天'
,
value
:
'26天'
,
centerLeft
:
'根据打卡数据产生'
,
centerLeft
:
'根据打卡数据产生'
,
centerLeftNum
:
'11条'
,
centerRight
:
'扣款'
,
centerRightPrice
:
'-100元'
,
bottomText
:
''
,
bottomDays
:
''
,
btnText
:
'申诉考勤'
,
btnText
:
'申诉考勤'
,
btnType
:
'attendance'
btnType
:
'attendance'
,
btnAble
:
true
},
},
{
{
id
:
'daily'
,
id
:
'daily'
,
title
:
'日报完成天数'
,
title
:
'日报完成天数'
,
value
:
'26天'
,
value
:
'26天'
,
centerLeft
:
'填写驻店日报天数'
,
centerLeft
:
'填写驻店日报天数'
,
centerLeftNum
:
'11条'
,
centerRight
:
'扣款'
,
centerRight
:
'扣款'
,
centerRightPrice
:
'-100元'
,
centerRightPrice
:
'-100元'
,
bottomText
:
'缺失天数为'
,
bottomText
:
'缺失天数为'
,
bottomDays
:
'12、13、17号'
,
bottomDays
:
'12、13、17号'
,
btnText
:
'去补日报'
,
btnText
:
'去补日报'
,
btnType
:
'daily'
btnType
:
'daily'
,
btnAble
:
true
},
},
{
{
id
:
'recording'
,
id
:
'recording'
,
...
@@ -60,10 +57,9 @@ Page({
...
@@ -60,10 +57,9 @@ Page({
centerLeftNum
:
'11条'
,
centerLeftNum
:
'11条'
,
centerRight
:
'扣款'
,
centerRight
:
'扣款'
,
centerRightPrice
:
'-100元'
,
centerRightPrice
:
'-100元'
,
bottomText
:
''
,
bottomDays
:
''
,
btnText
:
'申诉平板'
,
btnText
:
'申诉平板'
,
btnType
:
'recording'
btnType
:
'recording'
,
btnAble
:
true
}
}
],
],
orderList
:
[
orderList
:
[
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment