Commit 0fe0c1fb by 胡悦

修改员工

1 parent cbc2282a
......@@ -127,7 +127,7 @@ img {
}
.el-checkbox:last-of-type {
margin-right: 8px;
margin-right: 0px;
}
::-webkit-scrollbar {
......
......@@ -12,17 +12,14 @@
<div class="table-header">
<div class="header-text">员工列表</div>
<div class="table-btn">
<el-popover placement="bottom-end" width="150" trigger="click">
<el-button type="text">批量分配角色</el-button>
<el-button type="text">批量启用</el-button>
<el-button slot="reference" :size="size" class="m-r-md" type="primary" plain mode="el-button">批量操作</el-button>
</el-popover>
<el-button @click="handleExport" :size="size" type="primary" plain mode="el-button">导出</el-button>
<GLButton @click="handleExport" fn="导出" :size="size" type="primary" plain mode="el-button">导出</GLButton>
<el-button :size="size" plain @click="batch(1)">批量分配角色</el-button>
<el-button :size="size" plain @click="batch(2)">批量启用</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @paginationlisteners="paginationlisteners">
<div slot="optionBtns" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
......@@ -45,10 +42,27 @@
</GLTable>
<!-- 表格区域 end -->
</div>
<GLDialog :visible="roleVisible" :width="'720px'" @close="handleClose" title="批量分配账号角色" :showClose="true">
<el-form :model="roleForm" :rules="roleFormRules" ref="roleForm" label-width="200px">
<el-form-item label="角色权限:" prop="roleAuth">
<el-select style="width: 415px;" :size="size" v-model="roleForm.roleAuth" placeholder="请选择角色权限">
<el-option v-for="item in baseData.roleList" :key="item.id" :label="item.roleName" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleAssign">确定</el-button>
</div>
</GLDialog>
</div>
</template>
<script>
const handleObj = {
1: '角色',
2: '启用'
}
import { utils } from 'glsx-common'
export default {
name: 'index',
......@@ -131,6 +145,8 @@ export default {
tableParams: {
listName: 'data',
tableOption: false,
mutiSelectName: 'employeeList',
mutiSelectUniqueKey: 'id',
otherOptions: {
label: '启用开关'
},
......@@ -255,11 +271,16 @@ export default {
allMerchantList: [],
roleList: [],
staffStatusList: []
},
roleVisible: false,
roleForm: {},
roleFormRules: {
roleAuth: [{required: true, message: '请选择角色权限', trigger: 'change'}]
}
}
},
mounted() {
console.log(this.$refs.employeeRef)
this.userInfo = this.$globalState.session
// 门店
if (this.userInfo.accountLevel == 4) {
......@@ -349,6 +370,7 @@ export default {
// this.$refs.employeeRef.setTableHeightFun()
// }
this.$refs.employeeRef.data.length ? (this.$refs.employeeRef.tableHeightValues = '') : this.$refs.employeeRef.setTableHeightFun()
this.$refs.employeeRef.$refs.employeeListMutiTable.clearSelection()
},
handleDetail(row) {
this.$router.push('/employee/detailEmployee/' + row.id)
......@@ -431,6 +453,58 @@ export default {
document.body.appendChild(a)
a.click()
})
},
batch(type) {
console.log(handleObj[type]);
const name = handleObj[type]
const selectArr = this.$refs.employeeRef.mutiSelectArr[this.tableParams.mutiSelectName]
if (!selectArr.length) {
return this.$message.error('您未选中需要批量操作的员工。')
}
if (name == '角色') {
const hasRole = selectArr.some(item => item.statusName == '启用')
if (hasRole) {
this.$confirm(`您选中的员工中包含已设置 “角色” 账号。请去除选中已设置 “角色” 员工账号。`, '', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
})
} else {
this.roleVisible = true
}
} else if (name == '启用') {
this.$confirm(`是否将选中的账号批量进行启用?`, '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log('点击了确定')
this.$refs.employeeRef.refreshTable(false)
}).catch(() => {
console.log('点击了取消')
})
}
},
// 批量分配角色,确定按钮
handleAssign() {
console.log(this.roleForm)
this.$refs.roleForm.validate((valid) => {
if (valid) {
this.roleVisible = false
setTimeout(() => {
this.roleForm = {}
this.$refs.employeeRef.refreshTable(false)
})
}
})
},
handleClose() {
this.roleVisible = false
},
// 表格分页穿透事件
paginationlisteners(val) {
console.log(val)
}
}
}
......
......@@ -15,7 +15,7 @@
<div class="header-text">跟进专员列表</div>
<div class="table-btn">
<GLButton fn="新增" size="small" type="primary" plain @click="openDrawer">跟进专员</GLButton>
<!-- <el-button size="small" type="primary" plain @click="openDrawer">跟进专员</el-button> -->
<el-button size="small" type="primary" plain @click="openDrawer">跟进专员</el-button>
</div>
</div>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!