员工管理

This commit is contained in:
许允枞 2024-10-29 15:15:21 +08:00
parent 74cc28d805
commit 572eb56d16

View File

@ -29,8 +29,6 @@
<view class="top-ail"> <view class="top-ail">
<view class="jsy" v-if="!goodsList||goodsList.length == 0"> <view class="jsy" v-if="!goodsList||goodsList.length == 0">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image> <image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view> </view>
@ -46,10 +44,10 @@
<image :src="item.avatar" mode="aspectFill"></image> <image :src="item.avatar" mode="aspectFill"></image>
</view> </view>
<view class="s-right"> <view class="s-right">
<view class="s-title">{{item.workName}}</view> <view class="s-title">{{ item.nickname }}</view>
<view class="s-hui">电话{{item.workPhone}}</view> <view class="s-hui">电话{{ item.mobile }}</view>
</view> </view>
<view class="bottom-box" @click="gettel(item.workPhone)"> <view class="bottom-box" @click="gettel(item.mobile)">
<uni-icons type="phone-filled" color="#0D2E8D" size="18"></uni-icons> <uni-icons type="phone-filled" color="#0D2E8D" size="18"></uni-icons>
<text>电话</text> <text>电话</text>
<!-- @click="getdelete(item.id)" --> <!-- @click="getdelete(item.id)" -->
@ -105,6 +103,7 @@
<script> <script>
import config from '@/config' import config from '@/config'
import request from '../../utils/request'; import request from '../../utils/request';
export default { export default {
data() { data() {
return { return {
@ -138,6 +137,8 @@
postid: '', postid: '',
gwindex: 0, gwindex: 0,
gwid: 0, gwid: 0,
roleId:undefined,
addRoleId:undefined
} }
}, },
onLoad() { onLoad() {
@ -167,7 +168,7 @@
this.gettab() this.gettab()
// this.baseUrl = this.$baseUrl // this.baseUrl = this.$baseUrl
this.partnerId = uni.getStorageSync('partnerId') this.partnerId = uni.getStorageSync('partnerId')
this.getindex() // this.getindex()
}, },
methods: { methods: {
gettel(num) { gettel(num) {
@ -181,16 +182,25 @@
}, },
async gettab() { async gettab() {
let res = await request({ let res = await request({
url: '/partnerOwn/partner/inspectionPostInfo', url: '/system/role/pageByQuery',
method: 'get', method: 'get',
params: {
servicePackageId:'jiance'
}
}) })
console.log(res); console.log('获取所有角色', res);
this.tabList = res.data this.tabList = [{
this.renList = res.data.slice(1) name: '全部',
id: undefined
}]
this.tabList.push(...res.data)
this.roleId = this.tabList[0].id
this.renList = res.data
this.getindex()
}, },
gettap(index, id) { gettap(index, id) {
this.tapindex = index this.tapindex = index
this.postid = id this.roleId = id
this.goodsList = [] this.goodsList = []
this.getindex() this.getindex()
@ -207,15 +217,14 @@
async getindex() { async getindex() {
let data = { let data = {
partnerId: this.partnerId, nickname: this.workName,
workName: this.workName, roleId: this.roleId,
postId: this.postid, pageNo: this.pageNum, //
pageNum: this.pageNum, //
pageSize: this.pageSize, // pageSize: this.pageSize, //
} }
let res = await request({ let res = await request({
url: '/partnerOwn/partner/getWorkList', url: '/system/role/selectListByRoleId',
method: 'get', method: 'get',
params: data params: data
}) })
@ -266,16 +275,13 @@
}) })
return return
} else { } else {
this.workids = this.workids.join(",") // this.workids = this.workids.join(",")
}
let data = {
partnerId: this.partnerId,
workIdStr: this.workids
} }
let res = await request({ let res = await request({
url: '/partnerOwn/partner/delWorker', url: '/system/user/deleteUserByIds',
method: 'post', method: 'delete',
params: data data: this.workids
}) })
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
@ -299,19 +305,32 @@
return return
} }
let data = { let data = {
partnerId: this.partnerId, nickname: this.realName,
realName: this.realName, mobile: this.phoneNum,
phoneNum: this.phoneNum, username: this.phoneNum,
postId: this.gwid, status:0,
userType:'01',
roleId:this.gwid,
password:'123456'
} }
let res = await request({ let res = await request({
url: '/partnerOwn/partner/addWorker', url: '/system/user/create',
method: 'post', method: 'post',
params: data data: data
}) })
// //
if (res.code == 200) { if (res.code == 200) {
let roleIds = []
roleIds.push(this.gwid)
let resp = await request({
url: '/system/permission/assign-user-role',
method: 'post',
data: {
userId: res.data,
roleIds: roleIds
}
})
uni.showToast({ uni.showToast({
title: "添加成功" title: "添加成功"
}) })
@ -319,7 +338,8 @@
this.getindex() this.getindex()
} }
}, },
open() {}, open() {
},
close() { close() {
this.show = false this.show = false
@ -572,8 +592,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 1px solid #DAE1F8; border-bottom: 1px solid #DAE1F8;;
;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: 5px; padding-bottom: 5px;
margin: 10px; margin: 10px;