Commit 21a8cdd3 by cwq0219

员工-删除

1 parent 6790bacf
...@@ -93,5 +93,15 @@ const updateEmployeeApi = params => { ...@@ -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 { ...@@ -45,7 +45,6 @@ export default {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.id = this.$route.params.id this.id = this.$route.params.id
console.log(this.id)
}, },
methods: { methods: {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button> <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>
</div> </div>
</template> </template>
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import selectPage from './components/selectPage' import selectPage from './components/selectPage'
import glsxCombiForm from './glsx-combi-form' import glsxCombiForm from './glsx-combi-form'
// import { getAllMerchantListApi, getRoleListApi, getMerchantTreeApi } from '@/api/modules/employee'
export default { export default {
name: 'editEmployee', name: 'editEmployee',
data() { data() {
......
<!-- 员工管理 --> <!-- 员工管理 -->
<template> <template>
<div class="config-employee employee-list"> <div class="config-employee employee-list">
<!-- <div class="container"> -->
<div style="margin: 16px 0;"> <div style="margin: 16px 0;">
<el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button> <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">创建员工</el-button>
</div> </div>
<!-- </div> -->
<div class="container"> <div class="container">
<div> <div>
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData"> <glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData">
...@@ -34,7 +32,6 @@ ...@@ -34,7 +32,6 @@
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
// import { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi } from '@/api/modules/employee'
import glsxCombiForm from './glsx-combi-form' import glsxCombiForm from './glsx-combi-form'
import selectPage from './components/selectPage' import selectPage from './components/selectPage'
export default { export default {
...@@ -206,7 +203,6 @@ export default { ...@@ -206,7 +203,6 @@ export default {
} else { } else {
this[formName].forEach((item, index) => { this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) { 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])) 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] !== '全部') { if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {} const temp = {}
...@@ -239,7 +235,6 @@ export default { ...@@ -239,7 +235,6 @@ export default {
}, },
getParams() { getParams() {
var params = utils.deepClone(this.searchForm) var params = utils.deepClone(this.searchForm)
// params.productId.includes('') && (params.productId = [])
const tempParams = this.getSelectInputParams() const tempParams = this.getSelectInputParams()
params = { params = {
...params, ...params,
...@@ -263,7 +258,6 @@ export default { ...@@ -263,7 +258,6 @@ export default {
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
console.log(addOrEdit)
this.$router.push({ this.$router.push({
name: 'Account2EmployeeEditEmployee', name: 'Account2EmployeeEditEmployee',
params: { params: {
...@@ -273,6 +267,27 @@ export default { ...@@ -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() { handleSearch() {
this.$refs.employeeRef.refreshTable() 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!