v1.9 修复admin 员工无法删除和性别全是女的bug

This commit is contained in:
wuxw 2025-09-23 10:33:13 +08:00
parent 6ca6117a64
commit a1cba8c1d1
3 changed files with 11 additions and 14 deletions

View File

@ -21,24 +21,21 @@ import { deleteStaff } from '@/api/staff/staffApi'
export default { export default {
name: 'DeleteStaff', name: 'DeleteStaff',
props: {
visible: {
type: Boolean,
default: false
},
staffInfo: {
type: Object,
default: () => ({})
}
},
data() { data() {
return { return {
loading: false loading: false,
staffInfo: {},
visible: false
} }
}, },
methods: { methods: {
handleClose() { handleClose() {
this.$emit('update:visible', false) this.$emit('update:visible', false)
this.visible = false
},
open(staffInfo) {
this.staffInfo = staffInfo
this.visible = true
}, },
async deleteStaff() { async deleteStaff() {
try { try {

View File

@ -41,7 +41,7 @@
<el-table-column prop="address" :label="$t('staff.address')" align="center" /> <el-table-column prop="address" :label="$t('staff.address')" align="center" />
<el-table-column :label="$t('staff.gender')" align="center"> <el-table-column :label="$t('staff.gender')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.sex === 0 ? $t('staff.male') : $t('staff.female') }} {{ scope.row.sex == 0 ? $t('staff.male') : $t('staff.female') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('staff.operations')" align="center" width="300"> <el-table-column :label="$t('staff.operations')" align="center" width="300">

View File

@ -87,7 +87,7 @@
<edit-staff ref="editStaff" :staff-info="currentStaff" @success="handleSuccess" /> <edit-staff ref="editStaff" :staff-info="currentStaff" @success="handleSuccess" />
<delete-staff :visible.sync="deleteStaffVisible" :staff-info="currentStaff" @success="handleSuccess" /> <delete-staff ref="deleteStaff" @success="handleSuccess" />
</div> </div>
</template> </template>
@ -186,7 +186,7 @@ export default {
}, },
openDeleteStaff(staff) { openDeleteStaff(staff) {
this.currentStaff = { ...staff } this.currentStaff = { ...staff }
this.deleteStaffVisible = true this.$refs.deleteStaff.open(staff)
}, },
_moreCondition() { _moreCondition() {
this.staffInfo.moreCondition = !this.staffInfo.moreCondition this.staffInfo.moreCondition = !this.staffInfo.moreCondition