考勤机管理接口调试

This commit is contained in:
BianLzhaoMin 2025-12-02 13:12:10 +08:00
parent a05ea7ebc9
commit 0a8e5e5f8c
3 changed files with 52 additions and 6 deletions

View File

@ -108,10 +108,10 @@ export function getTaskHistoryListAPI(params) {
}
// 批量删除任务
export function batchDeleteTaskAPI(ids) {
export function batchDeleteTaskAPI(data) {
return request({
url: '/system/attMacManage/delHisTaskById',
url: '/bmw/kqManager/delHisTaskById',
method: 'post',
data: { ids },
data,
})
}

View File

@ -7,10 +7,22 @@
:columnsList="columnsList"
:request-api="requestApi"
:showOperation="false"
:isSelectShow="false"
:isSelectShow="true"
:sendParams="sendParams"
ref="tableRef"
@selection-change="handleSelectionChange"
>
<template slot="btn">
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
:disabled="selectedData.length === 0"
@click="handleBatchDelete"
>
批量删除
</el-button>
</template>
<template slot="transStatus" slot-scope="{ data }">
<el-tag
size="mini"
@ -58,7 +70,10 @@
<script>
import TableModel from '@/components/TableModel'
import { getTaskHistoryListAPI } from '@/api/system/attMacManage.js'
import {
getTaskHistoryListAPI,
batchDeleteTaskAPI,
} from '@/api/system/attMacManage.js'
export default {
name: 'TaskHistoryList',
@ -155,6 +170,7 @@ export default {
t_props: 'msg',
},
],
selectedData: [],
}
},
computed: {
@ -189,6 +205,36 @@ export default {
this.$refs.tableRef.getTableList()
}
},
handleSelectionChange(val) {
this.selectedData = val
},
handleBatchDelete() {
if (this.selectedData.length === 0) {
this.$modal.msgWarning('请选择要删除的数据')
return
}
this.$modal
.confirm(
'确定要删除选中的 ' +
this.selectedData.length +
' 条数据吗?',
)
.then(() => {
const ids = this.selectedData.map((item) => item.taskId)
batchDeleteTaskAPI({
taskId: ids.join(','),
})
.then((res) => {
if (res.code === 200) {
this.$modal.msgSuccess('批量删除成功')
this.$refs.tableRef.getTableList()
}
})
.catch(() => {})
})
.catch(() => {})
},
},
}
</script>

View File

@ -7,7 +7,7 @@
:columnsList="columnsList"
:request-api="requestApi"
:showOperation="false"
:isSelectShow="false"
:isSelectShow="true"
:sendParams="sendParams"
ref="tableRef"
@selection-change="handleSelectionChange"