员工管理

This commit is contained in:
cun-nan 2023-10-12 15:49:06 +08:00
parent 7906645557
commit 326a5834be
11 changed files with 190 additions and 427 deletions

View File

@ -8,3 +8,11 @@ export function listDuty(query) {
params: query params: query
}) })
} }
// 查询角色详细
export function getDuty(id) {
return request({
url: '/business/member/duty/' + id,
method: 'get'
})
}

View File

@ -2,16 +2,16 @@
<div class="app-container"> <div class="app-container">
<el-card > <el-card >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="员工类别" prop="category"> <!-- <el-form-item label="员工类别" prop="category">-->
<el-select v-model="queryParams.category" clearable placeholder="请选择员工类别"> <!-- <el-select v-model="queryParams.category" clearable placeholder="请选择员工类别">-->
<el-option <!-- <el-option-->
v-for="item in categoryOptions" <!-- v-for="item in categoryOptions"-->
:key="item.key" <!-- :key="item.key"-->
:label="item.name" <!-- :label="item.name"-->
:value="item.key" <!-- :value="item.key"-->
></el-option> <!-- ></el-option>-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="姓名" prop="name"> <el-form-item label="姓名" prop="name">
<el-input <el-input
v-model="queryParams.realName" v-model="queryParams.realName"
@ -32,18 +32,22 @@
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="auditedStatus"> <el-form-item label="状态" prop="auditedStatus">
<el-select <el-select
v-model="queryParams.auditedStatus" v-model="queryParams.status"
placeholder="状态" placeholder="状态"
clearable clearable
style="width: 240px" style="width: 240px"
> >
<el-option key="A" label="启用" value="A"/> <el-option
<el-option key="N" label="禁用" value="N"/> v-for="dict in dict.type.zhzt"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <!-- <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>-->
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -66,14 +70,10 @@
<el-table-column label="姓名" align="center" prop="realName" /> <el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="手机号" align="center" prop="mobile" width="110"/> <el-table-column label="手机号" align="center" prop="mobile" width="110"/>
<el-table-column label="核销权限" align="center" prop="writeOff"> <el-table-column label="核销权限" align="center" prop="writeOff">
<template slot-scope="scope">
<dict-tag :options="dict.type.write_off" :value="scope.row.write_off"/>
</template>
</el-table-column> </el-table-column>
<el-table-column label="特殊权限" align="center" prop="specialPrem"> <el-table-column label="特殊权限" align="center" prop="specialPrem">
<template slot-scope="scope">
<dict-tag :options="dict.type.special_prem" :value="scope.row.special_prem"/>
</template>
</el-table-column> </el-table-column>
<el-table-column label="退款权限" align="center" prop="refund"> <el-table-column label="退款权限" align="center" prop="refund">
<template slot-scope="scope"> <template slot-scope="scope">
@ -152,21 +152,21 @@
<!-- 添加或修改对话框 --> <!-- 添加或修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row> <!-- <el-row>-->
<el-col :span="24"> <!-- <el-col :span="24">-->
<el-form-item label="员工类别" prop="category"> <!-- <el-form-item label="员工类别" prop="category">-->
<el-select v-model="form.category" placeholder="请选择员工类别"> <!-- <el-select v-model="form.category" placeholder="请选择员工类别">-->
<el-option key="0" label="请选择员工类别" value="0"></el-option> <!-- <el-option key="0" label="请选择员工类别" value="0"></el-option>-->
<el-option <!-- <el-option-->
v-for="item in categoryOptions" <!-- v-for="item in categoryOptions"-->
:key="item.key" <!-- :key="item.key"-->
:label="item.name" <!-- :label="item.name"-->
:value="item.key" <!-- :value="item.key"-->
></el-option> <!-- ></el-option>-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="姓名" prop="realName"> <el-form-item label="姓名" prop="realName">
@ -182,10 +182,10 @@
<el-form-item label="角色组" prop="role"> <el-form-item label="角色组" prop="role">
<el-select v-model="form.role" placeholder="请选择角色"> <el-select v-model="form.role" placeholder="请选择角色">
<el-option <el-option
v-for="item in role" v-for="dict in dict.type.role"
:key="item.dutyId" :key="dict.value"
:label="item.dutyName" :label="dict.label"
:value="item.dutyId" :value="dict.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -219,7 +219,7 @@
<el-col :span="10" style="display: flex;margin-bottom: 20px"> <el-col :span="10" style="display: flex;margin-bottom: 20px">
<template> <template>
<span style="margin-right: 10px">核销权限</span> <span style="margin-right: 10px">核销权限</span>
<el-checkbox-group v-model="writeOff" @change="getCheckbox"> <el-checkbox-group v-model="writeOff" ref="" @change="getCheckbox">
<el-checkbox <el-checkbox
v-for="dict in dict.type.write_off" v-for="dict in dict.type.write_off"
:key="dict.value" :key="dict.value"
@ -231,7 +231,7 @@
</el-col> </el-col>
<el-col :span="14" style="display: flex"> <el-col :span="14" style="display: flex">
<span style="margin-right: 10px">特殊权限</span> <span style="margin-right: 10px">特殊权限</span>
<el-checkbox-group v-model="specialPrem"> <el-checkbox-group v-model="specialPrem" @change="getCheckbox">
<el-checkbox <el-checkbox
v-for="dict in dict.type.special_prem" v-for="dict in dict.type.special_prem"
:key="dict.value" :key="dict.value"
@ -293,7 +293,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="指定油枪" prop="oilGunId" v-if="form.notice == zdyx"> <el-form-item label="指定油枪" prop="oilGunId" v-show="form.notice == 'zdyx'">
<el-select v-model="form.oilGunId"> <el-select v-model="form.oilGunId">
<el-option <el-option
v-for="dict in dict.type.notice" v-for="dict in dict.type.notice"
@ -306,7 +306,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="时间范围" prop="timeFrame"> <el-form-item label="时间范围" prop="timeFrame">
<el-select v-model="form.timeFrame" placeholder="请选择角色"> <el-select v-model="form.timeFrame">
<el-option <el-option
v-for="dict in dict.type.time_frame" v-for="dict in dict.type.time_frame"
:key="dict.value" :key="dict.value"
@ -320,7 +320,7 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="交班模式" prop="handoverMode"> <el-form-item label="交班模式" prop="handoverMode">
<el-select v-model="form.handoverMode" placeholder="请选择所属店铺"> <el-select v-model="form.handoverMode">
<el-option <el-option
v-for="dict in dict.type.handover" v-for="dict in dict.type.handover"
:key="dict.value" :key="dict.value"
@ -396,38 +396,26 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="POS权限" prop="posPrem"> <el-form-item label="POS权限" prop="posPrem">
<el-select <div class="block">
v-model="form.posPrem" <el-cascader
multiple v-model="posPrem"
filterable :options="posOptions"
allow-create :props="props"
default-first-option @change="handleNodeClick1"
placeholder="请选择文章标签"> clearable></el-cascader>
<el-option </div>
v-for="item in posOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="小程序权限" prop="appletPrem"> <el-form-item label="小程序权限" prop="appletPrem">
<el-select <div class="block">
v-model="form.appletPrem" <el-cascader
multiple v-model="appletPrem"
filterable :options="appletOptions"
allow-create :props="props"
default-first-option @change="handleNodeClick2"
placeholder="请选择文章标签"> clearable></el-cascader>
<el-option </div>
v-for="item in appletOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -463,12 +451,14 @@
import { getStaffList, getStaffInfo, updateStaffStatus, deleteStaff, saveStaff } from "@/api/staff"; import { getStaffList, getStaffInfo, updateStaffStatus, deleteStaff, saveStaff } from "@/api/staff";
import {getName} from "../../utils/fuint"; import {getName} from "../../utils/fuint";
import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "@/api/staff/staff"; import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "@/api/staff/staff";
import {listDuty} from "@/api/staff/duty"; import {getDuty, listDuty} from "@/api/staff/duty";
import {listType} from "@/api/dict/type";
import {listData} from "@/api/system/dict/data";
export default { export default {
name: "StaffList", name: "StaffList",
dicts: ['ywqx','write_off','special_prem','display','zhzt','transaction','time_frame','handover','handover_quit', dicts: ['ywqx','write_off','special_prem','display','zhzt','transaction','time_frame','handover','handover_quit',
'jbjl','official','notice','special_prem'], 'jbjl','official','notice','special_prem','role'],
data() { data() {
return { return {
// //
@ -483,11 +473,28 @@ export default {
showSearch: true, showSearch: true,
categoryOptions: [], categoryOptions: [],
storeOptions: [], storeOptions: [],
role:[], // role:[],
posOptions:[], posPrem:'',
appletOptions:[], posOptions:[
{value: '首页权限',label: '首页权限',children:[{value: '禁用普通收款权限', label: '禁用普通收款权限' },]},
{value: '会员储值',label: '会员储值'},
{value: '会员实体卡',label: '会员实体卡'},
{value: '会员积分',label: '会员积分'},
{value: '加油金变动',label: '加油金变动'},
{value: '会员卡券',label: '会员卡券'},
{value: '会员成长值',label: '会员成长值'},
],
props: { multiple: true },
appletPrem:'',
appletOptions:[
{value: '首页权限',label: '首页权限',children:[{value: '女装', label: '女装' },]},
{value: '会员储值',label: '会员储值'},
{value: '会员实体卡',label: '会员实体卡'},
],
writeOff:[], writeOff:[],
write:[],
specialPrem:[], specialPrem:[],
special:[],
// //
total: 0, total: 0,
// //
@ -501,9 +508,9 @@ export default {
// //
form: { form: {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'', id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'', record:'', auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'jy', oilGunId:'', timeFrame:'bx', refund:'yqx', merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:[],specialPrem:[], official:'', status:'qy',pos:'jy' transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''
}, },
// //
queryParams: { queryParams: {
@ -511,7 +518,7 @@ export default {
pageSize: 10, pageSize: 10,
realName: '', realName: '',
mobile: '', mobile: '',
auditedStatus: '' status: ''
}, },
// //
rules: { rules: {
@ -567,12 +574,19 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getDuty(); // this.getDuty();
// this.getStoreList(); // this.getStoreList();
}, },
methods: { methods: {
handleNodeClick1(data) {
this.form.posPrem = JSON.stringify(data);
},
handleNodeClick2(data) {
this.form.appletPrem = JSON.stringify(data);
},
getCheckbox(){ getCheckbox(){
console.log(this.writeOff) this.form.writeOff = this.writeOff.toString();
this.form.specialPrem = this.specialPrem.toString();
}, },
// //
toTarget(url) { toTarget(url) {
@ -581,13 +595,14 @@ export default {
getName, getName,
// //
getList() { getList() {
// this.loading = true; this.loading = true;
listStaff().then(response => { listStaff(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.data.records; this.list = response.data.records;
this.total = response.data.total; this.total = response.data.total;
response.data.records.forEach(item=>{ // response.data.records.forEach(item=>{
this.categoryOptions.push(item.category) // this.categoryOptions.push(item.category)
}) // })
this.loading = false;
} }
); );
// getStaffList(this.addDateRange(this.queryParams, this.dateRange)).then( response => { // getStaffList(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
@ -598,7 +613,7 @@ export default {
// } // }
// ); // );
}, },
// //
getDuty(){ getDuty(){
listDuty().then(response => { listDuty().then(response => {
this.role = response.data this.role = response.data
@ -631,7 +646,8 @@ export default {
handleStatusChange(row) { handleStatusChange(row) {
let text = row.auditedStatus == "A" ? "启用" : "禁用"; let text = row.auditedStatus == "A" ? "启用" : "禁用";
this.$modal.confirm('确认要' + text + '"' + row.realName + '"吗?').then(function() { this.$modal.confirm('确认要' + text + '"' + row.realName + '"吗?').then(function() {
return updateStaffStatus(row.id, row.auditedStatus); // return updateStaffStatus(row.id, row.auditedStatus);
return updateStaff({id:row.id, auditedStatus:row.auditedStatus})
}).then(() => { }).then(() => {
this.$modal.msgSuccess(text + "成功"); this.$modal.msgSuccess(text + "成功");
}).catch(function() { }).catch(function() {
@ -657,11 +673,14 @@ export default {
}, },
// //
reset() { reset() {
this.posPrem = '';
this.appletPrem = '';
this.writeOff = []
this.form = { this.form = {
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'A', id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'A',
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'', record:'', auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'jbtc', record:'qbjl',
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'jy', oilGunId:'', timeFrame:'bx', refund:'yqx', merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'advice_jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy' transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy',role:''
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -675,7 +694,8 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (!this.form.id) { if (!this.form.id) {
console.log(this.form) this.form.posPrem = JSON.parse(this.form.posPrem);
this.form.appletPrem = JSON.parse(this.form.appletPrem);
addStaff(this.form).then(response => { addStaff(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -693,6 +713,7 @@ export default {
}, },
// //
handleUpdate(row) { handleUpdate(row) {
this.reset();
this.open = true; this.open = true;
const id = row.id || this.ids; const id = row.id || this.ids;
getStaff(id).then(response => { getStaff(id).then(response => {
@ -700,6 +721,10 @@ export default {
// this.form.category = response.data.staffInfo.category + ''; // this.form.category = response.data.staffInfo.category + '';
this.open = true; this.open = true;
this.title = "编辑员工信息"; this.title = "编辑员工信息";
this.writeOff = this.form.writeOff.split(",");
this.specialPrem = this.form.specialPrem.split(",");
this.posPrem = JSON.parse(this.form.posPrem);
this.appletPrem = JSON.parse(this.form.appletPrem);
}); });
}, },
// //

View File

@ -1,324 +0,0 @@
<template>
<div>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="员工类别" prop="category">
<el-select v-model="form.category" placeholder="请选择员工类别">
<el-option key="0" label="请选择员工类别" value="0"></el-option>
<el-option
v-for="item in categoryOptions"
:key="item.key"
:label="item.name"
:value="item.key"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="姓名" prop="realName">
<el-input v-model="form.realName" placeholder="请输入姓名" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入联系人电话" maxlength="30"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="角色组" prop="role">
<el-select v-model="form.role" placeholder="请选择角色">
<el-option
v-for="item in role"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="登录密码" prop="mobile">
<el-input v-model="form.password" placeholder="请输入登录密码" maxlength="30"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退款权限" prop="refund">
<el-select v-model="form.refund" placeholder="请选择权限">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退款密码" prop="mobile">
<el-input v-model="form.applypassword" placeholder="请输入登录密码" maxlength="30"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="10">
核销权限
<el-checkbox-group v-model="writeOff">
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
</el-checkbox-group>
</el-col>
<el-col :span="14">
特殊权限
<el-checkbox-group v-model="specialPrem">
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>Y
<el-checkbox label="复选框 C"></el-checkbox>Y
</el-checkbox-group>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="一键加油" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="POS加油员" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="交易统计" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="收款通知" prop="role">
<el-select v-model="form.role" placeholder="请选择角色">
<el-option
v-for="item in role"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="时间范围" prop="role">
<el-select v-model="form.role" placeholder="请选择角色">
<el-option
v-for="item in role"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="交班模式" prop="storeId">
<el-select v-model="form.storeId" placeholder="请选择所属店铺">
<el-option :key="0" label="全部店铺" :value="0"></el-option>
<el-option
v-for="item in storeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
:disabled="item.status !== 'A'"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="交班权限" prop="storeId">
<el-select v-model="form.storeId" placeholder="请选择所属店铺">
<el-option :key="0" label="全部店铺" :value="0"></el-option>
<el-option
v-for="item in storeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
:disabled="item.status !== 'A'"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="交班退出" prop="storeId">
<el-select v-model="form.storeId" placeholder="请选择所属店铺">
<el-option :key="0" label="全部店铺" :value="0"></el-option>
<el-option
v-for="item in storeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
:disabled="item.status !== 'A'"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="交班记录" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="交班商户号" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="员工筛选" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="POS权限" prop="refund">
<el-select
v-model="posPrem"
multiple
filterable
allow-create
default-first-option
placeholder="请选择文章标签">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="小程序权限" prop="refund">
<el-select
v-model="appletPrem"
multiple
filterable
allow-create
default-first-option
placeholder="请选择文章标签">
<el-option
v-for="item in appletOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="账户状态" prop="refund">
<el-select v-model="form.refund">
<el-option :key="0" label="无权限" :value="'myqx'"></el-option>
<el-option :key="0" label="有权限" :value="'yqx'"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注信息">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</div>
</template>
<script>
export default {
data(){
return{
form:[],
categoryOptions: [],
storeOptions: [],
role:[],
writeOff:[],
specialPrem:[],
posPrem:'',
posOptions:[],
appletPrem:'',
appletOptions:[],
//
rules: {
realName: [
{ required: true, message: "姓名不能为空", trigger: "blur" },
{ min: 2, max: 30, message: '姓名长度必须介于 2 和 20 之间', trigger: 'blur' }
],
mobile: [
{ required: true, message: "手机号不能为空", trigger: "blur" },
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' }
],
storeId: [
{ required: true, message: "请选择所属店铺", trigger: "blur" }
]
}
}
},
methods:{
//
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (!this.form.id) {
// saveStaff(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
} else {
// saveStaff(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
}
}
});
},
cancel(){
this.$router.back(-1);
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -4,8 +4,10 @@ import com.fuint.business.member.entity.LJDuty;
import com.fuint.business.member.service.ILJDutyService; import com.fuint.business.member.service.ILJDutyService;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -17,9 +19,24 @@ public class LjDutyController extends BaseController {
@Autowired @Autowired
private ILJDutyService dutyService; private ILJDutyService dutyService;
/**
* 查询角色信息
* @return
*/
@GetMapping("/list") @GetMapping("/list")
public ResponseObject list(){ public ResponseObject list(){
List<LJDuty> list = dutyService.selectDutyList(); List<LJDuty> list = dutyService.selectDutyList();
return getSuccessResult(list); return getSuccessResult(list);
} }
/**
* 根据id查询角色信息
* @param id
* @return
*/
@GetMapping("/{id}")
public ResponseObject dutyInfo(@PathVariable Integer id){
LJDuty duty = dutyService.selectDutyById(id);
return getSuccessResult(duty);
}
} }

View File

@ -118,4 +118,7 @@ public class LJStaff extends BaseEntity implements Serializable {
@ApiModelProperty("POS加油员启用禁用") @ApiModelProperty("POS加油员启用禁用")
private String pos; private String pos;
@ApiModelProperty("角色id")
private String role;
} }

View File

@ -36,24 +36,29 @@
<result property="official" column="official" /> <result property="official" column="official" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="pos" column="pos" /> <result property="pos" column="pos" />
<result property="role" column="role" />
</resultMap> </resultMap>
<sql id="selectMtStaff"> <sql id="selectMtStaff">
select id, merchant_id, store_id, user_id, category, mobile, real_name, wechat, create_time, update_time, select id, merchant_id, store_id, user_id, category, mobile, real_name, wechat, create_time, update_time,
audited_status, audited_time, description, create_by, update_by, is_refuel, handover_mode, handover_prem, audited_status, audited_time, description, create_by, update_by, is_refuel, handover_mode, handover_prem,
handover_out, record, merchant_status, screen, pos_prem, applet_prem, notice, oil_gun_id, time_frame, refund, handover_out, record, merchant_status, screen, pos_prem, applet_prem, notice, oil_gun_id, time_frame, refund,
transaction, write_off, special_prem, official,status,pos from mt_staff transaction, write_off, special_prem, official,status,pos,role from mt_staff
</sql> </sql>
<!--根据条件分页查询用户信息--> <!--根据条件分页查询用户信息-->
<select id="selectLJStaffList" resultMap="LJStaffResult"> <select id="selectLJStaffList" resultMap="LJStaffResult">
<include refid="selectMtStaff"></include> <include refid="selectMtStaff"></include>
<where> <where>
store_id = #{staff.storeId}
<if test="staff.realName != null and staff.realName != ''"> <if test="staff.realName != null and staff.realName != ''">
and real_name like concat('%', #{staff.realName}, '%') and real_name like concat('%', #{staff.realName}, '%')
</if> </if>
<if test="staff.mobile != null and staff.mobile != ''"> <if test="staff.mobile != null and staff.mobile != ''">
and mobile like concat('%', #{staff.mobile}, '%') and mobile like concat('%', #{staff.mobile}, '%')
</if> </if>
<if test="staff.status != null and staff.status != ''">
and status = #{staff.status}
</if>
</where> </where>
</select> </select>
<!--根据id查询员工信息--> <!--根据id查询员工信息-->
@ -62,9 +67,9 @@
where id = #{id} where id = #{id}
</select> </select>
<!--根据id查询员工信息--> <!--根据id查询员工信息-->
<select id="deleteStaffById"> <delete id="deleteStaffById">
delete from mt_staff where id = #{id} delete from mt_staff where id = #{id}
</select> </delete>
<!--增加员工信息--> <!--增加员工信息-->
<insert id="insertStaff"> <insert id="insertStaff">
insert into mt_staff( insert into mt_staff(
@ -140,11 +145,11 @@
update mt_staff p set p.AUDITED_STATUS = #{status}, p.UPDATE_TIME = #{updateTime} where p.ID = #{id} update mt_staff p set p.AUDITED_STATUS = #{status}, p.UPDATE_TIME = #{updateTime} where p.ID = #{id}
</update> </update>
<select id="queryStaffByMobile" resultType="com.fuint.repository.model.MtStaff"> <select id="queryStaffByMobile" resultType="com.fuint.business.member.entity.LJStaff">
select * from mt_staff t where t.MOBILE = #{mobile} and t.AUDITED_STATUS != 'D' select * from mt_staff t where t.MOBILE = #{mobile} and t.AUDITED_STATUS != 'D'
</select> </select>
<select id="queryStaffByUserId" resultType="com.fuint.repository.model.MtStaff"> <select id="queryStaffByUserId" resultType="com.fuint.business.member.entity.LJStaff">
select * from mt_staff t where t.USER_ID = #{userId} and t.AUDITED_STATUS != 'D' select * from mt_staff t where t.USER_ID = #{userId} and t.AUDITED_STATUS != 'D'
</select> </select>
</mapper> </mapper>

View File

@ -11,4 +11,11 @@ public interface ILJDutyService extends IService<LJDuty> {
* @return * @return
*/ */
public List<LJDuty> selectDutyList(); public List<LJDuty> selectDutyList();
/**
* 根据id查询角色信息
* @param id
* @return
*/
public LJDuty selectDutyById(int id);
} }

View File

@ -10,8 +10,22 @@ import java.util.List;
@Service @Service
public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, LJDuty> implements ILJDutyService { public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, LJDuty> implements ILJDutyService {
/**
* 查询角色信息
* @return
*/
@Override @Override
public List<LJDuty> selectDutyList() { public List<LJDuty> selectDutyList() {
return baseMapper.selectList(null); return baseMapper.selectList(null);
} }
/**
* 根据id查询角色信息
* @param id
* @return
*/
@Override
public LJDuty selectDutyById(int id) {
return baseMapper.selectById(id);
}
} }

View File

@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fuint.business.member.entity.LJStaff; import com.fuint.business.member.entity.LJStaff;
import com.fuint.business.member.mapper.LJStaffMapper; import com.fuint.business.member.mapper.LJStaffMapper;
import com.fuint.business.member.service.ILJStaffService; import com.fuint.business.member.service.ILJStaffService;
import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil;
import jdk.nashorn.internal.parser.Token;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date; import java.util.Date;
@ -23,6 +26,9 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/ */
@Override @Override
public IPage<LJStaff> selectStaffList(Page page, LJStaff staff) { public IPage<LJStaff> selectStaffList(Page page, LJStaff staff) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
staff.setStoreId(storeId);
return baseMapper.selectLJStaffList(page,staff); return baseMapper.selectLJStaffList(page,staff);
} }
@ -63,7 +69,9 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
*/ */
@Override @Override
public int insertStaff(LJStaff staff) { public int insertStaff(LJStaff staff) {
staff.setCreateTime(new Date()); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
staff.setStoreId(storeId);
int row = baseMapper.insert(staff); int row = baseMapper.insert(staff);
return row; return row;
} }

View File

@ -138,9 +138,9 @@ public class BackendAccountController extends BaseController {
accountDto.setAccountKey(tAccount.getAccountKey()); accountDto.setAccountKey(tAccount.getAccountKey());
accountDto.setAccountName(tAccount.getAccountName()); accountDto.setAccountName(tAccount.getAccountName());
accountDto.setAccountStatus(tAccount.getAccountStatus()); accountDto.setAccountStatus(tAccount.getAccountStatus());
accountDto.setCreateDate(tAccount.getCreateTime()); // accountDto.setCreateDate(tAccount.getCreateTime());
accountDto.setRealName(tAccount.getRealName()); accountDto.setRealName(tAccount.getRealName());
accountDto.setModifyDate(tAccount.getUpdateTime()); // accountDto.setModifyDate(tAccount.getUpdateTime());
accountDto.setStaffId(tAccount.getStaffId()); accountDto.setStaffId(tAccount.getStaffId());
accountDto.setMerchantId(tAccount.getMerchantId()); accountDto.setMerchantId(tAccount.getMerchantId());
if (tAccount.getStoreId() > 0) { if (tAccount.getStoreId() > 0) {