|
|
|
|
@ -102,10 +102,7 @@
|
|
|
|
|
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" |
|
|
|
|
v-perms="['police:import']" |
|
|
|
|
> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
<el-button type="primary"> |
|
|
|
|
<template #icon> |
|
|
|
|
<icon name="el-icon-Upload" /> |
|
|
|
|
</template> |
|
|
|
|
@ -260,13 +257,12 @@
|
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
link |
|
|
|
|
@click="handleDel(row)" |
|
|
|
|
@click="handleShowDel(row)" |
|
|
|
|
v-perms="['police:del']" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
<div class="flex end mt-8"> |
|
|
|
|
@ -481,17 +477,45 @@
|
|
|
|
|
</footer> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="删除" v-model="delDialog"> |
|
|
|
|
<el-form> |
|
|
|
|
<el-form-item title="删除原因"> |
|
|
|
|
<el-select> |
|
|
|
|
<el-option></el-option> |
|
|
|
|
<el-dialog :title="delTitle" v-model="delDialog" width="500"> |
|
|
|
|
<el-form :label-width="120" :model="delFormData" ref="delFormRef"> |
|
|
|
|
<el-form-item |
|
|
|
|
label="删除原因" |
|
|
|
|
prop="option" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入姓名', |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<el-select v-model="delFormData.option" clearable> |
|
|
|
|
<el-option :value="`调离`">调离</el-option> |
|
|
|
|
<el-option :value="`退休`">退休</el-option> |
|
|
|
|
<el-option :value="`离职`">离职</el-option> |
|
|
|
|
<el-option :value="`其他`">其他</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item title="其他原因"> |
|
|
|
|
<el-input /> |
|
|
|
|
<el-form-item |
|
|
|
|
label="其他原因" |
|
|
|
|
prop="delReason" |
|
|
|
|
:rules="{ |
|
|
|
|
required: true, |
|
|
|
|
message: '请输入姓名', |
|
|
|
|
}" |
|
|
|
|
v-if="delFormData.option === `其他`" |
|
|
|
|
> |
|
|
|
|
<el-input |
|
|
|
|
v-model="delFormData.delReason" |
|
|
|
|
type="textarea" |
|
|
|
|
placeholder="其他原因请详细描述" |
|
|
|
|
clearable |
|
|
|
|
:autosize="{ minRows: 3 }" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<footer class="flex end"> |
|
|
|
|
<el-button @click="show = false">取消</el-button> |
|
|
|
|
<el-button type="primary" @click="handleDel">确定</el-button> |
|
|
|
|
</footer> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
<script setup> |
|
|
|
|
@ -630,22 +654,6 @@ function getWorkYear(employmentDate) {
|
|
|
|
|
return moment().diff(moment(employmentDate), "month") + "个月"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function handleDel(row) { |
|
|
|
|
const result = await feedback.prompt(`删除原因`, `确定要删除 ${row.name} ?`, { |
|
|
|
|
inputType: 'textarea', |
|
|
|
|
inputPlaceholder: '请输入', |
|
|
|
|
inputErrorMessage: '请输入删除原因', |
|
|
|
|
inputValidator: (val) => { |
|
|
|
|
return val ? true: false; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
await delPolice(row.id, { |
|
|
|
|
reason: result.value |
|
|
|
|
}); |
|
|
|
|
feedback.msgSuccess("操作成功"); |
|
|
|
|
getList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
import { ElLoading } from "element-plus"; |
|
|
|
|
let importLoading; |
|
|
|
|
function beforeUpload() { |
|
|
|
|
@ -656,21 +664,46 @@ function beforeUpload() {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
function handleSuccess(result) { |
|
|
|
|
console.log('handleSuccess', result) |
|
|
|
|
console.log("handleSuccess", result); |
|
|
|
|
importLoading.close(); |
|
|
|
|
if (result.code !== 200) { |
|
|
|
|
feedback.msgError(result.message); |
|
|
|
|
return |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
getList() |
|
|
|
|
getList(); |
|
|
|
|
} |
|
|
|
|
function handleError(result) { |
|
|
|
|
console.log(result) |
|
|
|
|
console.log(result); |
|
|
|
|
importLoading.close(); |
|
|
|
|
feedback.msgError(result.message || "上传失败!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const delDialog = ref(false) |
|
|
|
|
const delDialog = ref(false); |
|
|
|
|
const delFormData = ref({}); |
|
|
|
|
const delTitle = ref(""); |
|
|
|
|
|
|
|
|
|
function handleShowDel(row) { |
|
|
|
|
delDialog.value = true; |
|
|
|
|
delTitle.value = `确定要删除 ${row.name} ?`; |
|
|
|
|
delFormData.value.id = row.id; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const delFormRef = ref(); |
|
|
|
|
|
|
|
|
|
async function handleDel(row) { |
|
|
|
|
await delFormRef.value.validate(); |
|
|
|
|
let reason = delFormData.value.option |
|
|
|
|
if (delFormData.value.option === '其他') { |
|
|
|
|
reason = delFormData.value.delReason |
|
|
|
|
} |
|
|
|
|
await delPolice(delFormData.value.id, { |
|
|
|
|
reason: delFormData.value.delReason, |
|
|
|
|
}); |
|
|
|
|
feedback.msgSuccess("操作成功"); |
|
|
|
|
delDialog.value = false; |
|
|
|
|
delFormData.value = {} |
|
|
|
|
getList(); |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
<style lang="scss" scoped> |
|
|
|
|
</style> |