mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
Add batch deletion judgment prompt
This commit is contained in:
@@ -60,13 +60,14 @@
|
|||||||
style="margin-top: 10px"
|
style="margin-top: 10px"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="user.username" label="用户名" align="center" />
|
<el-table-column type="index" label="序号" width="80" align="center" :index="indexFormat" />
|
||||||
<el-table-column prop="attTime" label="考勤时间" width="250" align="center">
|
<el-table-column prop="user.username" label="名称" align="center" />
|
||||||
|
<el-table-column prop="attTime" label="考勤时间" width="300" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatDate(scope.row.attTime) }}
|
{{ formatDate(scope.row.attTime) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="考勤状态" width="150" align="center">
|
<el-table-column prop="status" label="考勤状态" width="180" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-tag
|
<el-tag
|
||||||
:type="
|
:type="
|
||||||
@@ -233,7 +234,12 @@ export default {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.users = response.data.data
|
this.users = response.data.data
|
||||||
})
|
})
|
||||||
.catch((reportError) => {})
|
.catch((reportError) => {
|
||||||
|
ElMessage({
|
||||||
|
message: '失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 获取所有考勤信息
|
// 获取所有考勤信息
|
||||||
getAttendances() {
|
getAttendances() {
|
||||||
@@ -248,6 +254,10 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((reportError) => {
|
.catch((reportError) => {
|
||||||
this.dataLoading = false
|
this.dataLoading = false
|
||||||
|
ElMessage({
|
||||||
|
message: '失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getAttendancesByTime() {
|
getAttendancesByTime() {
|
||||||
@@ -293,7 +303,9 @@ export default {
|
|||||||
newFormat = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
|
newFormat = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss
|
||||||
return newFormat
|
return newFormat
|
||||||
},
|
},
|
||||||
|
indexFormat(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
// 重置参数
|
// 重置参数
|
||||||
resetParam() {
|
resetParam() {
|
||||||
this.attTime = []
|
this.attTime = []
|
||||||
@@ -323,7 +335,12 @@ export default {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
this.getAttendances()
|
this.getAttendances()
|
||||||
})
|
})
|
||||||
.catch((reportError) => {})
|
.catch((reportError) => {
|
||||||
|
ElMessage({
|
||||||
|
message: '失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 获取更改数据
|
// 获取更改数据
|
||||||
viewUpdate(row) {
|
viewUpdate(row) {
|
||||||
@@ -340,7 +357,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 点击取消
|
// 点击取消
|
||||||
cancel() {
|
cancel() {
|
||||||
this.resetForm()
|
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '取消操作',
|
message: '取消操作',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@@ -372,7 +388,12 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((reportError) => {})
|
.catch((reportError) => {
|
||||||
|
ElMessage({
|
||||||
|
message: '删除失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 批量删除
|
// 批量删除
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
@@ -381,23 +402,36 @@ export default {
|
|||||||
// 批量删除
|
// 批量删除
|
||||||
delBatch() {
|
delBatch() {
|
||||||
const map = this.multipleSelection.map((v) => v.id)
|
const map = this.multipleSelection.map((v) => v.id)
|
||||||
request
|
// eslint-disable-next-line eqeqeq
|
||||||
.post('/attendance/delBatchAttendance', map)
|
if (map != '') {
|
||||||
.then((response) => {
|
request
|
||||||
if (response) {
|
.post('/attendance/delBatchAttendance', map)
|
||||||
ElMessage({
|
.then((response) => {
|
||||||
message: '批量删除成功',
|
if (response) {
|
||||||
type: 'success'
|
ElMessage({
|
||||||
})
|
message: '批量删除成功',
|
||||||
this.getAttendances()
|
type: 'success'
|
||||||
} else {
|
})
|
||||||
|
this.getAttendances()
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
message: '批量删除失败',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((reportError) => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: '批量删除失败',
|
message: '批量删除失败',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
} else {
|
||||||
|
ElMessage({
|
||||||
|
message: '批量删除失败,请至少选择一条数据',
|
||||||
|
type: 'error'
|
||||||
})
|
})
|
||||||
.catch((reportError) => {})
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -41,13 +41,14 @@
|
|||||||
:header-cell-style="{ background: 'aliceblue' }"
|
:header-cell-style="{ background: 'aliceblue' }"
|
||||||
style="margin-top: 10px"
|
style="margin-top: 10px"
|
||||||
>
|
>
|
||||||
<el-table-column prop="user.username" label="用户名" align="center"></el-table-column>
|
<el-table-column type="index" label="序号" width="80" align="center" :index="indexFormat" />
|
||||||
<el-table-column prop="attTime" label="考勤时间" width="250" align="center">
|
<el-table-column prop="user.username" label="名称" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="attTime" label="考勤时间" width="300" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
{{ formatDate(scope.row.attTime) }}
|
{{ formatDate(scope.row.attTime) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="考勤状态" width="150" align="center">
|
<el-table-column prop="status" label="考勤状态" width="200" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-tag
|
<el-tag
|
||||||
:type="
|
:type="
|
||||||
@@ -155,6 +156,9 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
indexFormat(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
getOneAttendancesByTime() {
|
getOneAttendancesByTime() {
|
||||||
this.dataLoading = true
|
this.dataLoading = true
|
||||||
if (this.attTimeB.length !== 0) {
|
if (this.attTimeB.length !== 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user