Commit 50455cc8 by wangzhihui

```

feat(residentManage): 添加考勤薪资验证和搜索功能优化

- 在toReply组件中引入dayjs用于日期处理
- 增加确认实际出勤天数的验证逻辑,确保不超过当月最大天数
- 更新搜索表单添加salaryStaffPhone字段
- 优化工资绩效搜索的联动逻辑
- 调整搜索参数传递方式,合并staffPhone和salaryStaffPhone字段
```
1 parent d7f58018
...@@ -26,6 +26,7 @@ import { ...@@ -26,6 +26,7 @@ import {
} from "@/api/salaryManagement.js" } from "@/api/salaryManagement.js"
import detailComp from "../../../salaryPerformance/components/detailComp.vue" import detailComp from "../../../salaryPerformance/components/detailComp.vue"
import { Util, deepClone, getStatusItem } from "@/common/util" import { Util, deepClone, getStatusItem } from "@/common/util"
import dayjs from "dayjs"
export default { export default {
name: "approvalView", name: "approvalView",
components: { components: {
...@@ -216,7 +217,7 @@ export default { ...@@ -216,7 +217,7 @@ export default {
this.$message.error("请输入确认实际出勤天数") this.$message.error("请输入确认实际出勤天数")
return false return false
} }
// 新增:确认实际出勤天数需为整数 // 新增:确认实际出勤天数需为整数,且不得超过当月最大天数
if (this.detailInfo.appealType == 1) { if (this.detailInfo.appealType == 1) {
const v = this.detailInfo.confirmActualAttendanceDays const v = this.detailInfo.confirmActualAttendanceDays
const s = String(v).trim() const s = String(v).trim()
...@@ -224,6 +225,20 @@ export default { ...@@ -224,6 +225,20 @@ export default {
this.$message.error("确认实际出勤天数需为整数") this.$message.error("确认实际出勤天数需为整数")
return false return false
} }
// 依据记录月份计算当月最大天数,优先取 appealMonth / evaluationMonth / salaryMonth
const monthStr =
this.detailInfo.appealMonth ||
this.detailInfo.evaluationMonth ||
this.detailInfo.salaryMonth
const maxDays = monthStr
? dayjs(monthStr, "YYYY-MM").daysInMonth()
: dayjs().daysInMonth()
if (Number(s) > maxDays) {
this.$message.error(
`确认实际出勤天数不能大于当月最大天数(${maxDays}天)`
)
return false
}
this.detailInfo.confirmActualAttendanceDays = Number(s) this.detailInfo.confirmActualAttendanceDays = Number(s)
} }
......
...@@ -164,7 +164,8 @@ export default { ...@@ -164,7 +164,8 @@ export default {
jobType: "", jobType: "",
workingStatus: "", workingStatus: "",
createdSource: "", createdSource: "",
directLeaderPhones: [] directLeaderPhones: [],
salaryStaffPhone: ""
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
...@@ -252,13 +253,16 @@ export default { ...@@ -252,13 +253,16 @@ export default {
}, },
{ {
label: "工资绩效", label: "工资绩效",
name: "staffPhone", name: "salaryStaffPhone",
type: "select", type: "select",
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: "staffPhone", optionId: "staffPhone",
optionLabel: "staffName", optionLabel: "staffName",
optionsName: "commissionList" optionsName: "commissionList",
changeAttr: (value) => {
this.searchForm.staffPhone = value
}
} }
], ],
getListApi: getResidentListApi, getListApi: getResidentListApi,
...@@ -443,6 +447,21 @@ export default { ...@@ -443,6 +447,21 @@ export default {
this.handleSearch() this.handleSearch()
this.setUpdateRefesh("false") this.setUpdateRefesh("false")
} }
},
"searchForm.staffPhone"(val) {
// if (val == "") {
// this.searchForm.salaryStaffPhone = ""
// return
// }
if (val == this.searchForm.salaryStaffPhone) return
let item = this.baseData.commissionList.find(
(item) => item.staffPhone == val
)
if (item) {
this.searchForm.salaryStaffPhone = item.staffPhone
} else {
this.searchForm.salaryStaffPhone = ""
}
} }
}, },
computed: { computed: {
...@@ -510,6 +529,10 @@ export default { ...@@ -510,6 +529,10 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
this.searchFormSearch.staffPhone =
this.searchFormSearch.staffPhone ||
this.searchFormSearch.salaryStaffPhone
delete this.searchFormSearch.salaryStaffPhone
resolve() resolve()
}) })
}, },
...@@ -543,6 +566,7 @@ export default { ...@@ -543,6 +566,7 @@ export default {
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
staffName: "", staffName: "",
salaryStaffPhone: "",
staffPhone: "", staffPhone: "",
staffSceneLabel: "", staffSceneLabel: "",
merchantName: "", merchantName: "",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!