Commit 21a8cdd3 by cwq0219

员工-删除

1 parent 6790bacf
......@@ -93,5 +93,15 @@ const updateEmployeeApi = params => {
})
}
const deleteEmployeeApi = params => {
params.method = `${defaultPath}staff.deleteStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi, addEmployeeApi, updateEmployeeApi }
export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi, addEmployeeApi, updateEmployeeApi, deleteEmployeeApi }
......@@ -45,7 +45,6 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.id = this.$route.params.id
console.log(this.id)
},
methods: {
......
......@@ -18,7 +18,7 @@
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
......@@ -27,7 +27,6 @@
import { utils } from 'glsx-common'
import selectPage from './components/selectPage'
import glsxCombiForm from './glsx-combi-form'
// import { getAllMerchantListApi, getRoleListApi, getMerchantTreeApi } from '@/api/modules/employee'
export default {
name: 'editEmployee',
data() {
......
<!-- 员工管理 -->
<template>
<div class="config-employee employee-list">
<!-- <div class="container"> -->
<div style="margin: 16px 0;">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button>
</div>
<!-- </div> -->
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
......@@ -34,7 +32,6 @@
<script>
import { utils } from 'glsx-common'
// import { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi } from '@/api/modules/employee'
import glsxCombiForm from './glsx-combi-form'
import selectPage from './components/selectPage'
export default {
......@@ -206,7 +203,6 @@ export default {
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
// this.$set(this[formName][index], 'optionList', _.cloneDeep(this.baseData[item.optionsName]))
this.$set(this[formName][index], 'optionList', utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
......@@ -239,7 +235,6 @@ export default {
},
getParams() {
var params = utils.deepClone(this.searchForm)
// params.productId.includes('') && (params.productId = [])
const tempParams = this.getSelectInputParams()
params = {
...params,
......@@ -263,7 +258,6 @@ export default {
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
console.log(addOrEdit)
this.$router.push({
name: 'Account2EmployeeEditEmployee',
params: {
......@@ -273,6 +267,27 @@ export default {
})
},
handleDelete(row) {
this.$confirm('是否确认删除该员工?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.employee.deleteEmployeeApi({ id: row.id }).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleSearch()
}
})
}
}
})
},
handleSearch() {
this.$refs.employeeRef.refreshTable()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!