Commit 8d4699ae by 张立顺

feat 权限管理

1 parent 6ab393a1
...@@ -201,6 +201,14 @@ export const routerName = { ...@@ -201,6 +201,14 @@ export const routerName = {
type: "default", type: "default",
label: "绩效扣减", label: "绩效扣减",
handle: "handleDeduction" handle: "handleDeduction"
},
{
authId: "9120513",
parentId: "91205",
category: "Button",
type: "default",
label: "权限管理",
handle: "handlePermission"
} }
], ],
component: _import("residentManage/inStoreManage/inStoreControlList") component: _import("residentManage/inStoreManage/inStoreControlList")
......
<!-- 权限管理 -->
<template>
<d2-dialog title="权限管理" :is-visible="isShow" class="accountDailog" @closeDialog="handleClose" width="850px"
@confirmDialog="handleAddConfirm">
<div class="content">
<el-form ref="form" :model="form" :rules="rules" label-suffix=":" label-width="140px">
<el-form-item label="选择员工" prop="staffIds">
<el-select multiple collapse-tags v-model="form.staffIds" value-key="id" filterable remote reserve-keyword
placeholder="请选择员工(多选)" style="width: 350px" :remote-method="remoteMethod" @change="changeOpt"
:loading="loading">
<el-option v-for="(item, index) in options" :key="item.id" :label="item.staffName" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商户类型" prop="smsCode">
<!-- <el-input placeholder="请填写验证码" v-model="form.smsCode" size="small" style="width: 220px;" /> -->
<el-checkbox-group v-model="form.checkList">
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
<el-checkbox label="复选框 A"></el-checkbox>
<el-checkbox label="复选框 B"></el-checkbox>
<el-checkbox label="复选框 C"></el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</div>
</d2-dialog>
</template>
<script>
import { getResidentListApi } from "@api/resident"
import { yseMerchantModifyMerchantRef } from '@api/publicAccount'
import { deepClone } from '@/common/util'
import { merchantClassifyList } from '@/common/constants'
export default {
name: 'PermissionDialog',
data() {
return {
merchantClassifyList,
userInfo: this.$store.state.d2admin.user.info,
form: {
tableData: [],
checkList: [],
staffIds: []
},
// tableData: [],
subShopMerchantList: [],
timeout: null,
loading: false,
options: [],
// 短信模块
isSend: false,
rules: {
smsCode: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
staffIds: [{ required: true, message: '请选择员工', trigger: 'blur' }]
},
isShowOkbtn: true,
num: 0
}
},
props: {
permissionVisible: {
type: Boolean,
default: true
},
subShopMerchantInfo: {
type: Object,
default: null
}
},
computed: {
isShow: {
get() {
return this.permissionVisible
},
set(val) {
this.$emit('update:permissionVisible', false)
}
}
},
created() {
this.getResidentList()
},
mounted() {
},
methods: {
getResidentList() {
getResidentListApi({
pageSize: 10,
currentPage: 1
}).then(res => {
console.log(res)
this.options = res.list
}).catch((err) => {
console.log(err)
})
},
// 短信模块-end
getInfo(subShopMerchantInfo) {
// yseMerchantGetDetail({
// yseUserCode: yseUserCode
// }).then(res => {
// console.log(res, 'res')
this.subShopMerchantList = subShopMerchantInfo.yseMerchantRefs || []
if (this.subShopMerchantList.length > 0) {
this.form.tableData = deepClone(this.subShopMerchantList)
this.options = deepClone(this.subShopMerchantList)
}
},
handleAddConfirm() {
this.$refs.editSubordinateMerchantFrom.validate(valid => {
if (valid) {
if (!this.form.tableData.length) return this.$message.warning('请选择关联商户')
this.$refs.form.validate(valid2 => {
if (valid2) {
var params = {
smsCode: this.form.smsCode,
yseMerchantId: this.subShopMerchantInfo.id,
yseMerchantRefs: this.form.tableData
}
yseMerchantModifyMerchantRef(params).then(res => {
this.notice.okTips('操作成功')
this.handleClose()
})
}
})
}
})
},
handleAddMerchant() {
this.options = []
this.form.tableData.push({
// merchantName: '',
merchantId: ''
})
},
handleDelMerchant(index) {
this.form.tableData.splice(index, 1)
},
remoteMethod(queryString) {
if (queryString) {
this.loading = true
setTimeout(() => {
this.loading = false
var params = { currentPage: 1, pageSize: 100, staffName: queryString, }
getResidentListApi(params).then(res => {
const list = this.form.staffIds || []
const options = [...list, ...res.list || []]
// // 对数据对象去重过滤
this.options = Array.from(new Map(
options.map(item => [item.id, item]) // [key, value],key 是 merchantId,value 是整个对象
).values())
// this.options = res.list
})
}, 200)
} else {
// console.log()
this.options = deepClone(this.form.staffIds)
}
},
setDisabled(val) {
const info = this.form.tableData.find(item => item.merchantId == val)
if (info) {
return true
} else {
return false
}
},
changeOpt(val) {
// const info = this.options.find(item => item.merchantId == val)
// console.log(info)
// this.form.tableData = this.form.tableData.map(item => {
// if (item.merchantId == info.merchantId) {
// const id = deepClone(item.id)
// delete info.id
// item = deepClone(info)
// if (id) {
// item.id = id
// }
// }
// return item
// })
// console.log(this.form.tableData)
},
handleClose(flag) {
// this.$emit('dialogClose', flag)
this.isShow = false
}
}
}
</script>
<style scoped lang="scss">
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.add-btn {
width: 100%;
display: flex;
margin-top: 15px;
}
.accountDailog .el-dialog {
margin-top: 20vh !important;
min-width: 1000px;
}
.accountDailog .el-select-dropdown__item {
width: 395px !important;
}
.inputCol {
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 20px;
line-height: 80px;
::v-deep.el-form-item__content {
margin-left: 0 !important;
}
}
.yseUserCode {
height: 40px;
background: #f6f9ff;
line-height: 40px;
padding-left: 16px;
font-family: PingFangSC-Medium;
font-weight: 500;
}
.tips {
margin: 10px 0 5px;
font-size: 12px;
color: #666666;
}
</style>
...@@ -3,13 +3,8 @@ ...@@ -3,13 +3,8 @@
<div> <div>
<d2-container> <d2-container>
<div class="header" slot="header" style="padding: 10px 20px"> <div class="header" slot="header" style="padding: 10px 20px">
<d2-search <d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth"
ref="showSearch" :form-data="showFormData" />
class="show-search"
:search-form="searchForm"
:label-width="labelWidth"
:form-data="showFormData"
/>
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary"> <el-button @click="handleSearch" size="small" type="primary">
查询 查询
...@@ -19,15 +14,17 @@ ...@@ -19,15 +14,17 @@
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<span slot="left"> <span slot="left" class="left">
<auth-button category="Button" :show-btn-ids="['9120506']" /> <auth-button category="Button" :show-btn-ids="['9120506']" />
<span class="tips_text"
>仅展示「深圳嘀加」服务商的驻店员工,以及「广联数科」商户下员工</span </span>
> <span style="display: inline-block; margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9120513']" />
</span> </span>
<span style="display: inline-block; margin-right: 10px"> <span style="display: inline-block; margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9120512']" /> <auth-button category="Button" :show-btn-ids="['9120512']" />
</span> </span>
<span style="display: inline-block; margin-right: 10px"> <span style="display: inline-block; margin-right: 10px">
<auth-button category="Button" :show-btn-ids="['9120511']" /> <auth-button category="Button" :show-btn-ids="['9120511']" />
</span> </span>
...@@ -42,58 +39,33 @@ ...@@ -42,58 +39,33 @@
</span> </span>
<auth-button category="Button" :show-btn-ids="['9120507']" /> <auth-button category="Button" :show-btn-ids="['9120507']" />
</d2-table-header> </d2-table-header>
<d2-table <span class="tips_text">仅展示「深圳嘀加」服务商的驻店员工,以及「广联数科」商户下员工</span>
ref="recordTable" <d2-table ref="recordTable" class="inStoreTable" :get-list-api="getListApi" :search-form="searchFormSearch"
class="inStoreTable" :table-params="tableParams" :before-search-fn="beforeSearchFn">
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<!-- <auth-button :data="scope.scope" /> --> <!-- <auth-button :data="scope.scope" /> -->
<auth-button <auth-button :data="scope.scope" :show-btn-ids="['9120505', '9120508']" />
:data="scope.scope"
:show-btn-ids="['9120505', '9120508']"
/>
</div> </div>
</d2-table> </d2-table>
</div> </div>
</d2-container> </d2-container>
<!-- 设备登录历史 --> <!-- 设备登录历史 -->
<login-history-dialog <login-history-dialog :login-history-visible="loginHistoryVisible" v-if="loginHistoryVisible"
:login-history-visible="loginHistoryVisible" @dialogClose="loginDialogClose" />
v-if="loginHistoryVisible"
@dialogClose="loginDialogClose"
/>
<!-- 门店标签 --> <!-- 门店标签 -->
<flag-dialog <flag-dialog :flag-visible="flagVisible" :info="recordInfo" v-if="flagVisible" @dialogClose="flagDialogClose" />
:flag-visible="flagVisible"
:info="recordInfo"
v-if="flagVisible"
@dialogClose="flagDialogClose"
/>
<!-- 创建员工 --> <!-- 创建员工 -->
<creat-staff-dialog <creat-staff-dialog :creat-staff-visible="creatStaffVisible" v-if="creatStaffVisible"
:creat-staff-visible="creatStaffVisible" @dialogClose="creatStaffDialogClose" />
v-if="creatStaffVisible"
@dialogClose="creatStaffDialogClose"
/>
<!-- 工资导入导出 --> <!-- 工资导入导出 -->
<export-performance-dialog <export-performance-dialog :export-performance-visible="exportVisible" v-if="exportVisible"
:export-performance-visible="exportVisible" @handleDownloadTemplate="handleDownloadTemplate" @dialogClose="exportDialogClose" @handleExport="handleExport"
v-if="exportVisible" @handleImport="handleImport" />
@handleDownloadTemplate="handleDownloadTemplate"
@dialogClose="exportDialogClose"
@handleExport="handleExport"
@handleImport="handleImport"
/>
<!-- 绩效工资扣减规则 --> <!-- 绩效工资扣减规则 -->
<performance-deduction-dialog <performance-deduction-dialog :deduction-visible="deductionVisible" v-if="deductionVisible"
:deduction-visible="deductionVisible" @dialogClose="handleDeductionCloseDialog"></performance-deduction-dialog>
v-if="deductionVisible" <!-- 新增权限 -->
@dialogClose="handleDeductionCloseDialog" <PermissionDialog :permissionVisible.sync="permissionVisible"></PermissionDialog>
></performance-deduction-dialog>
</div> </div>
</template> </template>
...@@ -104,6 +76,7 @@ import { staffLevelList, staffSceneLabelList } from "@/common/constants.js" ...@@ -104,6 +76,7 @@ import { staffLevelList, staffSceneLabelList } from "@/common/constants.js"
import flagDialog from "./components/flagDialog" import flagDialog from "./components/flagDialog"
import loginHistoryDialog from "./components/loginHistoryDialog" import loginHistoryDialog from "./components/loginHistoryDialog"
import creatStaffDialog from "./components/creatStaffDialog" import creatStaffDialog from "./components/creatStaffDialog"
import PermissionDialog from "./components/PermissionDialog"
import exportPerformanceDialog from "./components/exportPerformanceDialog" import exportPerformanceDialog from "./components/exportPerformanceDialog"
import { getResidentListApi, importStaffSalaryApi } from "@api/resident" import { getResidentListApi, importStaffSalaryApi } from "@api/resident"
import { filterStr } from "./util.js" import { filterStr } from "./util.js"
...@@ -117,12 +90,14 @@ export default { ...@@ -117,12 +90,14 @@ export default {
creatStaffDialog, creatStaffDialog,
exportPerformanceDialog, exportPerformanceDialog,
DeductionDialog, DeductionDialog,
PerformanceDeductionDialog PerformanceDeductionDialog,
PermissionDialog
}, },
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
labelWidth: "110px", labelWidth: "110px",
permissionVisible: false,
searchForm: { searchForm: {
staffName: "", staffName: "",
staffPhone: "", staffPhone: "",
...@@ -656,10 +631,15 @@ export default { ...@@ -656,10 +631,15 @@ export default {
title: "考勤/工资申诉" title: "考勤/工资申诉"
}) })
}, },
//绩效扣减 // 绩效扣减
handleDeduction() { handleDeduction() {
this.deductionVisible = !this.deductionVisible this.deductionVisible = !this.deductionVisible
}, },
// 员工新增权限
handlePermission() {
// this.deductionVisible = !this.deductionVisible
this.permissionVisible = true
},
handleDeductionCloseDialog() { handleDeductionCloseDialog() {
this.deductionVisible = !this.deductionVisible this.deductionVisible = !this.deductionVisible
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true)
...@@ -669,15 +649,24 @@ export default { ...@@ -669,15 +649,24 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.tips_text { .tips_text {
margin-left: 10px; // margin-left: 10px;
color: #999; color: #999;
font-size: 12px;
} }
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
margin: 0 2px; margin: 0 2px;
} }
.left {
// display: inline-block;
// min-height: 100px;
// display: flex;
// flex-direction: column;
}
.leftSpan { .leftSpan {
display: inline-block; display: inline-block;
box-sizing: border-box; box-sizing: border-box;
...@@ -689,6 +678,7 @@ export default { ...@@ -689,6 +678,7 @@ export default {
color: #5850ff; color: #5850ff;
cursor: pointer; cursor: pointer;
} }
.inStoreTable { .inStoreTable {
::v-deep .el-table--medium td .el-button--text { ::v-deep .el-table--medium td .el-button--text {
padding: 5px 0; padding: 5px 0;
......
<!-- 商户关联 --> <!-- 商户关联 -->
<template> <template>
<d2-dialog title="商户关联" <d2-dialog title="商户关联" :is-visible="subordinateMerchantVisible" class="accountDailog" @closeDialog="handleClose"
:is-visible="subordinateMerchantVisible" width="850px" @confirmDialog="handleAddConfirm">
class="accountDailog" <div class="yseUserCode">虚账编码: {{ subShopMerchantInfo.yseUserCode }} <span style="margin-left: 50px;">支付渠道: {{
@closeDialog="handleClose"
width="850px"
@confirmDialog="handleAddConfirm">
<div class="yseUserCode">虚账编码: {{ subShopMerchantInfo.yseUserCode }} <span
style="margin-left: 50px;">支付渠道: {{
subShopMerchantInfo.paymentChannelName subShopMerchantInfo.paymentChannelName
}}</span></div> }}</span></div>
<div class="content"> <div class="content">
<el-form ref="editSubordinateMerchantFrom" <el-form ref="editSubordinateMerchantFrom" class="editSubordinateMerchantFrom " :model="form" label-width="150px"
class="editSubordinateMerchantFrom "
:model="form"
label-width="150px"
v-loading="$store.state.d2admin.loading.value"> v-loading="$store.state.d2admin.loading.value">
<el-table :data="form.tableData" <el-table :data="form.tableData" border>
border> <el-table-column type="index" label="序号" :index="index => index + 1" width="50" align="center" />
<el-table-column type="index" <el-table-column label="商户名称" width="400" align="center">
label="序号"
:index="index => index + 1"
width="50"
align="center" />
<el-table-column label="商户名称"
width="400"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="inputCol"> <div class="inputCol">
<el-form-item :prop="'tableData.' + scope.$index + '.merchantId'" <el-form-item :prop="'tableData.' + scope.$index + '.merchantId'"
:rules="[{ required: true, message: '请选择商户', trigger: 'change' }]"> :rules="[{ required: true, message: '请选择商户', trigger: 'change' }]">
<el-select v-model="scope.row.merchantId" <el-select v-model="scope.row.merchantId" filterable remote reserve-keyword placeholder="请输入关键字"
filterable style="width: 350px" :remote-method="remoteMethod" @change="changeOpt" :loading="loading">
remote <el-option v-for="(item, index) in options" :key="index" :label="item.merchantName"
reserve-keyword :value="item.merchantId" :disabled="setDisabled(item.merchantId)">
placeholder="请输入关键字"
style="width: 350px"
:remote-method="remoteMethod"
@change="changeOpt"
:loading="loading">
<el-option v-for="(item, index) in options"
:key="index"
:label="item.merchantName"
:value="item.merchantId"
:disabled="setDisabled(item.merchantId)">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商户号" <el-table-column label="商户号" align="center" prop="merchantId" width="138" />
align="center" <el-table-column label="商户分类" align="center" prop="merchantId" width="138">
prop="merchantId"
width="138" />
<el-table-column label="商户分类"
align="center"
prop="merchantId"
width="138">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- {{ scope.row.merchantType }} --> <!-- {{ scope.row.merchantType }} -->
{{ scope.row.merchantType ? merchantClassifyList.find(item => item.confId == {{scope.row.merchantType ? merchantClassifyList.find(item => item.confId ==
scope.row.merchantType).confLabel : '' }} scope.row.merchantType).confLabel : ''}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center">
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" style="color: red;" @click="handleDelMerchant(scope.$index)">删除</el-button>
style="color: red;"
@click="handleDelMerchant(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="add-btn"> <div class="add-btn">
<el-button type="primary" <el-button type="primary" @click="handleAddMerchant">添加一行</el-button>
@click="handleAddMerchant">添加一行</el-button>
</div> </div>
</el-form> </el-form>
<div class="tips">说明:关联商户完成后,生效后对应商户的分润金额将自动清分至关联的虚拟对公账户; 若商户的关联虚账发生变化,商户需重新做分账测试,请谨慎操作。</div> <div class="tips">说明:关联商户完成后,生效后对应商户的分润金额将自动清分至关联的虚拟对公账户; 若商户的关联虚账发生变化,商户需重新做分账测试,请谨慎操作。</div>
<el-form ref="form" <el-form ref="form" :model="form" :rules="rules" label-suffix=":" label-width="140px">
:model="form"
:rules="rules"
label-suffix=":"
label-width="140px">
<el-form-item label="管理员手机号验证"> <el-form-item label="管理员手机号验证">
{{ adminInfo.name }} {{ adminInfo.phone }} {{ adminInfo.name }} {{ adminInfo.phone }}
<el-button size="small" <el-button size="small" @click="handleSend" :disabled="isSend">
@click="handleSend"
:disabled="isSend">
{{ isSend ? sendMsg + '秒后,重试' : '发送验证短信' }} {{ isSend ? sendMsg + '秒后,重试' : '发送验证短信' }}
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item label="验证码" <el-form-item label="验证码" prop="smsCode">
prop="smsCode"> <el-input placeholder="请填写验证码" v-model="form.smsCode" size="small" style="width: 220px;" />
<el-input placeholder="请填写验证码"
v-model="form.smsCode"
size="small"
style="width: 220px;" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -210,18 +165,6 @@ export default { ...@@ -210,18 +165,6 @@ export default {
yseMerchantId: this.subShopMerchantInfo.id, yseMerchantId: this.subShopMerchantInfo.id,
yseMerchantRefs: this.form.tableData yseMerchantRefs: this.form.tableData
} }
// params.merchantId = this.subShopMerchantInfo.merchantId
// params.merchantName = this.subShopMerchantInfo.merchantName
// // params.smsCode =
// const list = []
// let info
// this.form.tableData.forEach(item => {
// info = deepClone(item)
// info.merchantId = info.merchantId
// info.merchantName = info.merchantName
// list.push(info)
// })
// params.list = list
yseMerchantModifyMerchantRef(params).then(res => { yseMerchantModifyMerchantRef(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
this.handleClose(true) this.handleClose(true)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!