员工管理
This commit is contained in:
parent
676e322c12
commit
212e2d5cca
10
fuintAdmin/src/api/staff/duty.js
Normal file
10
fuintAdmin/src/api/staff/duty.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询角色列表
|
||||
export function listDuty(query) {
|
||||
return request({
|
||||
url: '/business/member/duty/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -9,15 +9,15 @@ export function listStaff(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典类型详细
|
||||
// 查询员工详细
|
||||
export function getStaff(id) {
|
||||
return request({
|
||||
url: '/business/member/staff' + id,
|
||||
url: '/business/member/staff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增字典类型
|
||||
// 新增员工
|
||||
export function addStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff',
|
||||
@ -26,7 +26,7 @@ export function addStaff(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典类型
|
||||
// 修改员工
|
||||
export function updateStaff(data) {
|
||||
return request({
|
||||
url: '/business/member/staff',
|
||||
@ -35,10 +35,10 @@ export function updateStaff(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 删除字典类型
|
||||
// 删除员工
|
||||
export function delStaff(id) {
|
||||
return request({
|
||||
url: '/business/member/staff' + id,
|
||||
url: '/business/member/staff/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
@ -63,26 +63,24 @@
|
||||
|
||||
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
|
||||
<el-table-column label="ID" align="center" prop="id" width="80" />
|
||||
<el-table-column label="类别" align="center" prop="category">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.category">
|
||||
<span>{{ getName(categoryOptions, scope.row.category) }}</span>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" align="center" prop="realName" />
|
||||
<el-table-column label="手机号" align="center" prop="mobile" />
|
||||
<el-table-column label="关联会员ID" align="center" prop="userId" />
|
||||
<el-table-column label="所属店铺" align="center" prop="storeName">
|
||||
<el-table-column label="手机号" align="center" prop="mobile" width="110"/>
|
||||
<el-table-column label="核销权限" align="center" prop="writeOff">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.storeId">
|
||||
<span>{{ getName(storeOptions, scope.row.storeId) }}</span>
|
||||
</span>
|
||||
<span v-else>无</span>
|
||||
<dict-tag :options="dict.type.write_off" :value="scope.row.write_off"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="storeName">
|
||||
<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 label="退款权限" align="center" prop="refund">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ywqx" :value="scope.row.refund"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核状态" align="center" prop="storeName">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.auditedStatus"
|
||||
@ -92,12 +90,32 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime">
|
||||
<el-table-column label="员工状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="公众号" align="center" prop="official">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.official" :value="scope.row.official"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="一键加油" align="center" prop="isRefuel">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.display" :value="scope.row.isRefuel"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="模板通知" align="center" prop="notice">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.notice" :value="scope.row.notice"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime">
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||
</template>
|
||||
@ -132,7 +150,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" class="common-dialog" width="700px" 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-row>
|
||||
<el-col :span="24">
|
||||
@ -150,31 +168,277 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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.dutyId"
|
||||
:label="item.dutyName"
|
||||
:value="item.dutyId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="所属店铺" prop="storeId">
|
||||
<el-select v-model="form.storeId" placeholder="请选择所属店铺">
|
||||
<el-option :key="0" label="全部店铺" :value="0"></el-option>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="登录密码" prop="password">
|
||||
<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
|
||||
v-for="item in storeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="item.status !== 'A'"
|
||||
></el-option>
|
||||
v-for="dict in dict.type.ywqx"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="退款密码" prop="refundPassword">
|
||||
<el-input v-model="form.applypassword" placeholder="请输入登录密码" maxlength="30"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="10" style="display: flex;margin-bottom: 20px">
|
||||
<template>
|
||||
<span style="margin-right: 10px">核销权限</span>
|
||||
<el-checkbox-group v-model="writeOff" @change="getCheckbox">
|
||||
<el-checkbox
|
||||
v-for="dict in dict.type.write_off"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</template>
|
||||
</el-col>
|
||||
<el-col :span="14" style="display: flex">
|
||||
<span style="margin-right: 10px">特殊权限</span>
|
||||
<el-checkbox-group v-model="specialPrem">
|
||||
<el-checkbox
|
||||
v-for="dict in dict.type.special_prem"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="一键加油" prop="isRefuel">
|
||||
<el-select v-model="form.isRefuel">
|
||||
<el-option
|
||||
v-for="dict in dict.type.display"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="POS加油员" prop="pos">
|
||||
<el-select v-model="form.pos">
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交易统计" prop="transaction">
|
||||
<el-select v-model="form.transaction">
|
||||
<el-option
|
||||
v-for="dict in dict.type.transaction"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="收款通知" prop="notice">
|
||||
<el-select v-model="form.notice">
|
||||
<el-option
|
||||
v-for="dict in dict.type.notice"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="指定油枪" prop="oilGunId" v-if="form.notice == zdyx">
|
||||
<el-select v-model="form.oilGunId">
|
||||
<el-option
|
||||
v-for="dict in dict.type.notice"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="时间范围" prop="timeFrame">
|
||||
<el-select v-model="form.timeFrame" placeholder="请选择角色">
|
||||
<el-option
|
||||
v-for="dict in dict.type.time_frame"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交班模式" prop="handoverMode">
|
||||
<el-select v-model="form.handoverMode" placeholder="请选择所属店铺">
|
||||
<el-option
|
||||
v-for="dict in dict.type.handover"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交班权限" prop="handoverPrem">
|
||||
<el-select v-model="form.handoverPrem" placeholder="请选择所属店铺">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ywqx"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交班退出" prop="handoverOut">
|
||||
<el-select v-model="form.handoverOut">
|
||||
<el-option
|
||||
v-for="dict in dict.type.handover_quit"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交班记录" prop="record">
|
||||
<el-select v-model="form.record">
|
||||
<el-option
|
||||
v-for="dict in dict.type.jbjl"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="交班商户号" prop="merchantStatus">
|
||||
<el-select v-model="form.merchantStatus">
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="员工筛选" prop="screen">
|
||||
<el-select v-model="form.screen">
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="POS权限" prop="posPrem">
|
||||
<el-select
|
||||
v-model="form.posPrem"
|
||||
multiple
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="请选择文章标签">
|
||||
<el-option
|
||||
v-for="item in posOptions"
|
||||
: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="appletPrem">
|
||||
<el-select
|
||||
v-model="form.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="status">
|
||||
<el-select v-model="form.status">
|
||||
<el-option
|
||||
v-for="dict in dict.type.zhzt"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -186,16 +450,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.auditedStatus">
|
||||
<el-radio key="A" label="A" value="A">启用</el-radio>
|
||||
<el-radio key="N" label="N" value="N">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -207,12 +461,14 @@
|
||||
|
||||
<script>
|
||||
import { getStaffList, getStaffInfo, updateStaffStatus, deleteStaff, saveStaff } from "@/api/staff";
|
||||
import { searchStore } from "@/api/store";
|
||||
import {getName} from "../../utils/fuint";
|
||||
import {listStaff} from "@/api/staff/staff";
|
||||
import {addStaff, delStaff, getStaff, listStaff, updateStaff} from "@/api/staff/staff";
|
||||
import {listDuty} from "@/api/staff/duty";
|
||||
|
||||
export default {
|
||||
name: "StaffList",
|
||||
dicts: ['ywqx','write_off','special_prem','display','zhzt','transaction','time_frame','handover','handover_quit',
|
||||
'jbjl','official','notice','special_prem'],
|
||||
data() {
|
||||
return {
|
||||
// 标题
|
||||
@ -227,6 +483,11 @@ export default {
|
||||
showSearch: true,
|
||||
categoryOptions: [],
|
||||
storeOptions: [],
|
||||
role:[],
|
||||
posOptions:[],
|
||||
appletOptions:[],
|
||||
writeOff:[],
|
||||
specialPrem:[],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 表格数据
|
||||
@ -238,7 +499,12 @@ export default {
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'createTime', order: 'descending'},
|
||||
// 表单参数
|
||||
form: { id: '', category: '0', realName: '', auditedStatus: 'A', mobile: '', storeId: '' },
|
||||
form: {
|
||||
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'',
|
||||
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'', record:'',
|
||||
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
|
||||
transaction:'qbjy', writeOff:[],specialPrem:[], official:'', status:'qy',pos:'jy'
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
page: 1,
|
||||
@ -257,24 +523,71 @@ export default {
|
||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' }
|
||||
],
|
||||
storeId: [
|
||||
{ required: true, message: "请选择所属店铺", trigger: "blur" }
|
||||
role: [
|
||||
{ required: true, message: "请选择员工角色", trigger: "blur" }
|
||||
],
|
||||
isRefuel: [
|
||||
{ required: true, message: "请选择加油状态", trigger: "blur" }
|
||||
],
|
||||
pos: [
|
||||
{ required: true, message: "请选择员状态", trigger: "blur" }
|
||||
],
|
||||
transaction: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
notice: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
timeFrame: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
handoverMode: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
handoverPrem: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
handoverOut: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
record: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
merchantStatus: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
screen: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "请选择", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getDuty();
|
||||
// this.getStoreList();
|
||||
},
|
||||
methods: {
|
||||
getCheckbox(){
|
||||
console.log(this.writeOff)
|
||||
},
|
||||
// 页面跳转
|
||||
toTarget(url) {
|
||||
this.$router.push( { path: url } );
|
||||
},
|
||||
getName,
|
||||
// 查询列表
|
||||
getList() {
|
||||
// this.loading = true;
|
||||
listStaff().then(response => {
|
||||
this.list = response.data.records;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
response.data.records.forEach(item=>{
|
||||
this.categoryOptions.push(item.category)
|
||||
})
|
||||
}
|
||||
);
|
||||
// getStaffList(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
||||
@ -285,6 +598,12 @@ export default {
|
||||
// }
|
||||
// );
|
||||
},
|
||||
// 查询角色
|
||||
getDuty(){
|
||||
listDuty().then(response => {
|
||||
this.role = response.data
|
||||
})
|
||||
},
|
||||
// 店铺列表
|
||||
getStoreList() {
|
||||
listStaff().then(response => {
|
||||
@ -339,10 +658,10 @@ export default {
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: "",
|
||||
name: "",
|
||||
category: '0',
|
||||
auditedStatus: "A",
|
||||
id:'', category:'', userId:'', mobile:'', realName:'', wechat:'', merchantId:'', storeId:'', auditedStatus:'A',
|
||||
auditedTime:'', description:'', isRefuel:'yc', handoverMode:'dqmdtyjb', handoverPrem:'yqx', handoverOut:'', record:'',
|
||||
merchantStatus:'qy',screen:'qy', posPrem:'', appletPrem:'', notice:'jy', oilGunId:'', timeFrame:'bx', refund:'yqx',
|
||||
transaction:'qbjy', writeOff:'',specialPrem:'', official:'', status:'qy',pos:'jy'
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -356,13 +675,14 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (!this.form.id) {
|
||||
saveStaff(this.form).then(response => {
|
||||
console.log(this.form)
|
||||
addStaff(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
saveStaff(this.form).then(response => {
|
||||
updateStaff(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -373,11 +693,11 @@ export default {
|
||||
},
|
||||
// 修改按钮操作
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
const id = row.id || this.ids;
|
||||
getStaffInfo(id).then(response => {
|
||||
this.form = response.data.staffInfo;
|
||||
this.form.category = response.data.staffInfo.category + '';
|
||||
getStaff(id).then(response => {
|
||||
this.form = response.data;
|
||||
// this.form.category = response.data.staffInfo.category + '';
|
||||
this.open = true;
|
||||
this.title = "编辑员工信息";
|
||||
});
|
||||
@ -386,7 +706,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const name = row.realName || this.id;
|
||||
this.$modal.confirm('是否确认删除"' + name + '"的数据项?').then(function() {
|
||||
return deleteStaff(row.id);
|
||||
return delStaff(row.id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
@ -396,3 +716,21 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container{
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: #f6f8f9;
|
||||
}
|
||||
.pagin-box{
|
||||
background: white;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
}
|
||||
.baoguo{
|
||||
background: white;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
|
324
fuintAdmin/src/views/staff/model/addStaff.vue
Normal file
324
fuintAdmin/src/views/staff/model/addStaff.vue
Normal file
@ -0,0 +1,324 @@
|
||||
<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>
|
@ -47,9 +47,9 @@ public class LJStaffController extends BaseController {
|
||||
* 批量删除员工信息
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/id")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseObject remove(@PathVariable Integer id){
|
||||
mtStaffService.removeById(id);
|
||||
mtStaffService.deleteStaffById(id);
|
||||
return getSuccessResult("操作成功");
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.fuint.business.member.controller;
|
||||
|
||||
import com.fuint.business.member.entity.LJDuty;
|
||||
import com.fuint.business.member.service.ILJDutyService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/business/member/duty")
|
||||
public class LjDutyController extends BaseController {
|
||||
@Autowired
|
||||
private ILJDutyService dutyService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public ResponseObject list(){
|
||||
List<LJDuty> list = dutyService.selectDutyList();
|
||||
return getSuccessResult(list);
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ package com.fuint.business.member.entity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
@ -21,7 +22,7 @@ import java.util.Date;
|
||||
@Setter
|
||||
@TableName("t_duty")
|
||||
@ApiModel(value = "TDuty对象", description = "角色表")
|
||||
public class LJDuty implements Serializable {
|
||||
public class LJDuty extends BaseEntity implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -43,16 +44,4 @@ public class LJDuty implements Serializable {
|
||||
|
||||
@ApiModelProperty("角色类型")
|
||||
private String dutyType;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("创建用户")
|
||||
private Date createUser;
|
||||
|
||||
@ApiModelProperty("修改用户")
|
||||
private Date updateUser;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.fuint.business.member.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fuint.framework.entity.BaseEntity;
|
||||
@ -51,7 +52,6 @@ public class LJStaff extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("店铺ID")
|
||||
private Integer storeId;
|
||||
|
||||
|
||||
@ApiModelProperty("审核状态,A:审核通过;U:未审核;D:无效; ")
|
||||
private String auditedStatus;
|
||||
|
||||
@ -72,7 +72,7 @@ public class LJStaff extends BaseEntity implements Serializable {
|
||||
private String handoverPrem;
|
||||
|
||||
@ApiModelProperty("交班退出:交班退出;交班不退出")
|
||||
private String out;
|
||||
private String handoverOut;
|
||||
|
||||
@ApiModelProperty("交班记录,全部记录;名下记录;禁用权限")
|
||||
private String record;
|
||||
@ -112,4 +112,10 @@ public class LJStaff extends BaseEntity implements Serializable {
|
||||
|
||||
@ApiModelProperty("公众号,1:未关注,2:已关注")
|
||||
private String official;
|
||||
|
||||
@ApiModelProperty("员工状态:启用;禁用")
|
||||
private String status;
|
||||
|
||||
@ApiModelProperty("POS加油员,启用;禁用")
|
||||
private String pos;
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
package com.fuint.business.member.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fuint.business.member.entity.LJDuty;
|
||||
|
||||
public interface LJDutyMapper extends BaseMapper<LJDuty> {
|
||||
}
|
@ -20,8 +20,7 @@
|
||||
<result property="isRefuel" column="is_refuel" />
|
||||
<result property="handoverMode" column="handover_mode" />
|
||||
<result property="handoverPrem" column="handover_prem" />
|
||||
<result property="handoverPrem" column="handover_prem" />
|
||||
<result property="out" column="out" />
|
||||
<result property="handoverOut" column="handover_out" />
|
||||
<result property="record" column="record" />
|
||||
<result property="merchantStatus" column="merchant_status" />
|
||||
<result property="screen" column="screen" />
|
||||
@ -35,13 +34,15 @@
|
||||
<result property="writeOff" column="write_off" />
|
||||
<result property="specialPrem" column="special_prem" />
|
||||
<result property="official" column="official" />
|
||||
<result property="status" column="status" />
|
||||
<result property="pos" column="pos" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMtStaff">
|
||||
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,
|
||||
`out`, record, merchant_status, screen, pos_prem, applet_prem, notice, oil_gun_id, time_frame, refund, transaction,
|
||||
write_off, special_prem, official from mt_staff
|
||||
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
|
||||
</sql>
|
||||
<!--根据条件分页查询用户信息-->
|
||||
<select id="selectLJStaffList" resultMap="LJStaffResult">
|
||||
|
@ -0,0 +1,14 @@
|
||||
package com.fuint.business.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.member.entity.LJDuty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ILJDutyService extends IService<LJDuty> {
|
||||
/**
|
||||
* 查询角色信息
|
||||
* @return
|
||||
*/
|
||||
public List<LJDuty> selectDutyList();
|
||||
}
|
@ -29,6 +29,12 @@ public interface ILJStaffService extends IService<LJStaff> {
|
||||
*/
|
||||
public void deleteStaffByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 根据id删除员工信息
|
||||
* @param id
|
||||
*/
|
||||
public void deleteStaffById(Integer id);
|
||||
|
||||
/**
|
||||
* 增加员工信息
|
||||
* @param staff
|
||||
@ -36,5 +42,10 @@ public interface ILJStaffService extends IService<LJStaff> {
|
||||
*/
|
||||
public int insertStaff(LJStaff staff);
|
||||
|
||||
/**
|
||||
* 修改员工信息
|
||||
* @param staff
|
||||
* @return
|
||||
*/
|
||||
public int updateStaff(LJStaff staff);
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.fuint.business.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.member.entity.LJDuty;
|
||||
import com.fuint.business.member.mapper.LJDutyMapper;
|
||||
import com.fuint.business.member.service.ILJDutyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, LJDuty> implements ILJDutyService {
|
||||
@Override
|
||||
public List<LJDuty> selectDutyList() {
|
||||
return baseMapper.selectList(null);
|
||||
}
|
||||
}
|
@ -47,6 +47,15 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除员工信息
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void deleteStaffById(Integer id) {
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户信息
|
||||
* @param staff
|
||||
|
@ -1,14 +1,12 @@
|
||||
package com.fuint.common.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.common.dto.AccountDto;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.service.AccountService;
|
||||
import com.fuint.common.service.StaffService;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.framework.annoation.OperationServiceLog;
|
||||
import com.fuint.framework.exception.BusinessCheckException;
|
||||
import com.fuint.framework.exception.BusinessRuntimeException;
|
||||
@ -16,8 +14,6 @@ import com.fuint.framework.pagination.PaginationRequest;
|
||||
import com.fuint.framework.pagination.PaginationResponse;
|
||||
import com.fuint.repository.mapper.*;
|
||||
import com.fuint.repository.model.*;
|
||||
import com.fuint.system.dept.entity.SysDept;
|
||||
import com.fuint.system.dept.service.ISysDeptService;
|
||||
import com.fuint.utils.Digests;
|
||||
import com.fuint.utils.Encodes;
|
||||
import com.github.pagehelper.Page;
|
||||
@ -25,7 +21,6 @@ import com.github.pagehelper.PageHelper;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -62,10 +57,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
* 员工接口
|
||||
*/
|
||||
@Autowired
|
||||
@Lazy
|
||||
private StaffService staffService;
|
||||
@Autowired
|
||||
private ISysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 分页查询账号列表
|
||||
@ -129,13 +121,6 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
return paginationResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<TAccount> listAccount(com.baomidou.mybatisplus.extension.plugins.pagination.Page page, TAccount accountInfo) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
SysDept sysDept = deptService.selectDeptById(nowAccountInfo.getDeptId());
|
||||
return baseMapper.listAccount(page, accountInfo,sysDept.getAncestors());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AccountInfo getAccountByName(String userName) {
|
||||
Map<String, Object> param = new HashMap();
|
||||
@ -151,7 +136,6 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
accountInfo.setStaffId(account.getStaffId());
|
||||
accountInfo.setStoreId(account.getStoreId());
|
||||
accountInfo.setMerchantId(account.getMerchantId());
|
||||
accountInfo.setDeptId(account.getDeptId());
|
||||
if (account.getMerchantId() != null && account.getMerchantId() > 0) {
|
||||
MtMerchant mtMerchant = mtMerchantMapper.selectById(account.getMerchantId());
|
||||
if (mtMerchant != null) {
|
||||
@ -194,8 +178,8 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
account.setStaffId(tAccount.getStaffId());
|
||||
account.setMerchantId(tAccount.getMerchantId());
|
||||
account.setStoreId(tAccount.getStoreId());
|
||||
account.setCreateTime(new Date());
|
||||
account.setUpdateTime(new Date());
|
||||
account.setCreateDate(new Date());
|
||||
account.setModifyDate(new Date());
|
||||
account.setStoreId(tAccount.getStoreId());
|
||||
account.setStaffId(tAccount.getStaffId());
|
||||
account.setPassword(tAccount.getPassword());
|
||||
@ -244,7 +228,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
if (oldAccount == null) {
|
||||
throw new BusinessCheckException("账户不存在.");
|
||||
}
|
||||
tAccount.setUpdateTime(new Date());
|
||||
tAccount.setModifyDate(new Date());
|
||||
if (duties != null && duties.size() > 0) {
|
||||
if (tAccount.getAcctId() != null && tAccount.getAcctId() > 0) {
|
||||
tAccountDutyMapper.deleteDutiesByAccountId(tAccount.getAcctId());
|
||||
@ -299,7 +283,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
public void deleteAccount(Long userId) {
|
||||
TAccount tAccount = tAccountMapper.selectById(userId);
|
||||
tAccount.setAccountStatus(-1);
|
||||
tAccount.setUpdateTime(new Date());
|
||||
tAccount.setModifyDate(new Date());
|
||||
tAccountMapper.updateById(tAccount);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,8 @@ public class DictUtils
|
||||
Object arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(arrayCache))
|
||||
{
|
||||
return JSONArray.parseArray(JSONArray.toJSONString(arrayCache),SysDictData.class);
|
||||
List<SysDictData> res = JSONArray.parseArray(JSONArray.toJSONString(arrayCache),SysDictData.class);
|
||||
return res;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import lombok.Setter;
|
||||
@Setter
|
||||
@TableName("t_account")
|
||||
@ApiModel(value = "TAccount对象", description = "后台管理员表")
|
||||
public class TAccount extends BaseEntity implements Serializable {
|
||||
public class TAccount implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ -46,6 +46,12 @@ public class TAccount extends BaseEntity implements Serializable {
|
||||
@ApiModelProperty("0 未激活 1已激活")
|
||||
private Integer isActive;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createDate;
|
||||
|
||||
@ApiModelProperty("修改时间")
|
||||
private Date modifyDate;
|
||||
|
||||
@ApiModelProperty("随机码")
|
||||
private String salt;
|
||||
|
||||
@ -69,8 +75,10 @@ public class TAccount extends BaseEntity implements Serializable {
|
||||
|
||||
@ApiModelProperty("账户头像地址")
|
||||
private String avatar;
|
||||
//机构主键
|
||||
private Long deptId;
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("创建用户")
|
||||
private String createUser;
|
||||
|
||||
@ApiModelProperty("修改用户")
|
||||
private String updateUser;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user