feat:修改证书增加删除功能
This commit is contained in:
parent
393bbadca9
commit
b9caf8bac2
|
@ -31,4 +31,11 @@ export function updateCandidate(id, data) {
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteCandidate(id) {
|
||||||
|
return request({
|
||||||
|
url: `/crm/candidate/${id}/`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
}
|
}
|
|
@ -8,6 +8,19 @@
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="handleFilter"
|
@keyup.enter.native="handleFilter"
|
||||||
/>
|
/>
|
||||||
|
<el-select
|
||||||
|
v-model = "listQuery.opllevel"
|
||||||
|
placeholder="请选择等级"
|
||||||
|
style="width: 200px; margin-left: 10px"
|
||||||
|
class="filter-item"
|
||||||
|
@change="handleFilter">
|
||||||
|
<el-option
|
||||||
|
v-for="item in typeOption"
|
||||||
|
:key = "item.name"
|
||||||
|
:label = "item.name"
|
||||||
|
:value = "item.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
<el-button
|
<el-button
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -64,7 +77,7 @@
|
||||||
<el-table-column label="工作类别">
|
<el-table-column label="工作类别">
|
||||||
<template slot-scope="scope">{{ scope.row.workscope_name }}</template>
|
<template slot-scope="scope">{{ scope.row.workscope_name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="职业等级">
|
<el-table-column label="职业等级" >
|
||||||
<template slot-scope="scope">{{ getOpllevelName(scope.row.opllevel) }}</template>
|
<template slot-scope="scope">{{ getOpllevelName(scope.row.opllevel) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单位">
|
<el-table-column label="单位">
|
||||||
|
@ -114,6 +127,14 @@
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleEdit(scope)"
|
@click="handleEdit(scope)"
|
||||||
/>
|
/>
|
||||||
|
<el-button
|
||||||
|
v-if="checkPermission(['certificate_update'])"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
plain="true"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -285,7 +306,8 @@ import {
|
||||||
getCandidateList,
|
getCandidateList,
|
||||||
createCandidate,
|
createCandidate,
|
||||||
importCertificate,
|
importCertificate,
|
||||||
updateCandidate
|
updateCandidate,
|
||||||
|
deleteCandidate,
|
||||||
} from '@/api/candidate'
|
} from '@/api/candidate'
|
||||||
import {
|
import {
|
||||||
getWorkScopeAll
|
getWorkScopeAll
|
||||||
|
@ -371,10 +393,8 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getOpllevelName(value) {
|
getOpllevelName(value) {
|
||||||
console.log(value, 'value')
|
|
||||||
const numValue = Number(value)
|
const numValue = Number(value)
|
||||||
const item = this.typeOption.find((item) => item.value === numValue)
|
const item = this.typeOption.find((item) => item.value === numValue)
|
||||||
console.log(item, 'item-name')
|
|
||||||
return item ? item.name : ''
|
return item ? item.name : ''
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
|
@ -401,7 +421,8 @@ export default {
|
||||||
this.listQuery = {
|
this.listQuery = {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
search: ''
|
search: '',
|
||||||
|
opllevel: null,
|
||||||
}
|
}
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
@ -445,6 +466,19 @@ export default {
|
||||||
this.$refs['candidateForm'].clearValidate()
|
this.$refs['candidateForm'].clearValidate()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleDelete(scope) {
|
||||||
|
this.$confirm('确认删除该记录吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteCandidate(scope.row.id).then((response) => {
|
||||||
|
this.$message.success('成功')
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
confirmCandidate(form) {
|
confirmCandidate(form) {
|
||||||
this.$refs[form].validate((valid) => {
|
this.$refs[form].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
Loading…
Reference in New Issue