From 7500f4efbcbb2ec7bef19402c4ef0f1f373348c7 Mon Sep 17 00:00:00 2001 From: Admin <978517621@qq.com> Date: 星期二, 02 八月 2022 16:57:09 +0800 Subject: [PATCH] 接口 --- src/views/system/personShiftManage/durationManage/index.vue | 51 ++++++++++++++++++++++++++++++++++----------------- 1 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/views/system/personShiftManage/durationManage/index.vue b/src/views/system/personShiftManage/durationManage/index.vue index 7e12b60..5d3d46f 100644 --- a/src/views/system/personShiftManage/durationManage/index.vue +++ b/src/views/system/personShiftManage/durationManage/index.vue @@ -16,7 +16,7 @@ <el-col :span="12" class="mainCardBtn"> <el-button type="primary" :icon="Plus" size="default" @click="dialogAddRecord = true">新建</el-button> <!-- <el-button type="warning" :icon="Edit" size="default" plain>修改</el-button>--> - <el-button type="danger" :icon="Delete" size="default" plain @click="deleteWorkTimePeriods">删除</el-button> + <el-button type="danger" :icon="Delete" size="default" plain @click="deleteBatchBtn">删除</el-button> </el-col> <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData()" /> </el-row> @@ -88,6 +88,15 @@ </span> </template> </el-dialog> + <el-dialog v-model="deleteSetDialog" title="提示" width="30%" center> + <span>您确定要删除这些记录吗?</span> + <template #footer> + <span class="dialog-footer"> + <el-button @click="deleteSetDialog = false" size="default">取消</el-button> + <el-button type="primary" @click="conFirmDeleteBatch" size="default">确认</el-button> + </span> + </template> + </el-dialog> </div> </template> @@ -101,6 +110,7 @@ import { ElTable } from 'element-plus'; import { FormInstance, FormRules, ElMessage } from 'element-plus'; import { workingHoursApi } from '/@/api/basicDateManage/personShiftManage/workingHours'; +import {workingHoursSetApi} from "/@/api/basicDateManage/personShiftManage/workingHoursSet"; // 定义接口来定义对象的类型 interface stateType { @@ -110,6 +120,7 @@ dialogDetails: boolean; dialogAddRecord: boolean; deleteDialog: boolean; + deleteSetDialog: boolean; pageIndex: number; pageSize: number; searchWord: string; @@ -149,6 +160,7 @@ dialogDetails: false, dialogAddRecord: false, deleteDialog: false, + deleteSetDialog: false, addRecord: { id: null, name: '', @@ -330,22 +342,9 @@ }; // 批量删除 - const deleteWorkTimePeriods = async () => { + const deleteBatchBtn = async () => { if (state.deleteArr.length > 0) { - console.log(state.deleteArr); - let res = await workingHoursApi().deleteBatchWorkTimePeriod({ ids: state.deleteArr }); - if (res.data.code === '200') { - ElMessage({ - type: 'success', - message: res.data.msg - }); - getListByPage(); - } else { - ElMessage({ - type: 'warning', - message: res.data.msg - }); - } + state.deleteSetDialog = true } else { ElMessage({ type: 'warning', @@ -353,6 +352,23 @@ }); } }; + const conFirmDeleteBatch = async () => { + let res = await workingHoursApi().deleteBatchWorkTimePeriod({ ids: state.deleteArr }); + if (res.data.code === '200') { + state.deleteSetDialog = false + ElMessage({ + type: 'success', + message: res.data.msg + }); + getListByPage() + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + state.deleteSetDialog = false + } + } const handleSizeChange = (val: number) => { state.pageSize = val; @@ -441,11 +457,12 @@ Plus, toggleSelection, handleSelectionChange, - deleteWorkTimePeriods, + conFirmDeleteBatch, searchRecord, clearSearch, viewRecord, deleteRecord, + deleteBatchBtn, conFirmDelete, getWorkTimePeriod, getListByPage, -- Gitblit v1.9.2