员工管理

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

View File

@ -21,7 +21,7 @@
</view> -->
<scroll-view scroll-x="true" class="box-bottom">
<view class="tap-box" v-for="(item,index) in tabList" :key="index" @click="gettap(index,item.id)">
<view :class="{'lan' : tapindex == index}">{{item.name}}</view>
<view :class="{'lan' : tapindex == index}">{{ item.name }}</view>
<view class="gang" v-if="tapindex == index"></view>
</view>
</scroll-view>
@ -29,8 +29,6 @@
<view class="top-ail">
<view class="jsy" v-if="!goodsList||goodsList.length == 0">
<image src="http://www.nuoyunr.com/lananRsc/detection/qs.png" mode=""></image>
</view>
@ -40,16 +38,16 @@
<view class="a-box" v-for="(item,index) in goodsList" :key="index">
<view class="t-box">
<label>
<checkbox :value="item.id" color="#FFCC33" style="transform:scale(0.7)" />
<checkbox :value="item.id" color="#FFCC33" style="transform:scale(0.7)"/>
</label>
<view class="s-img">
<image :src="item.avatar" mode="aspectFill"></image>
</view>
<view class="s-right">
<view class="s-title">{{item.workName}}</view>
<view class="s-hui">电话{{item.workPhone}}</view>
<view class="s-title">{{ item.nickname }}</view>
<view class="s-hui">电话{{ item.mobile }}</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>
<text>电话</text>
<!-- @click="getdelete(item.id)" -->
@ -89,7 +87,7 @@
<view class="warp-flax">
<view class="flasxbox" :class="{ 'gwcss' : gwindex == index }" v-for="(item,index) in renList"
:key="index" @click="xgang(index,item.id)">
<text>{{item.name}}</text>
<text>{{ item.name }}</text>
</view>
</view>
@ -103,9 +101,10 @@
</template>
<script>
import config from '@/config'
import request from '../../utils/request';
export default {
import config from '@/config'
import request from '../../utils/request';
export default {
data() {
return {
msg: '3',
@ -138,6 +137,8 @@
postid: '',
gwindex: 0,
gwid: 0,
roleId:undefined,
addRoleId:undefined
}
},
onLoad() {
@ -167,7 +168,7 @@
this.gettab()
// this.baseUrl = this.$baseUrl
this.partnerId = uni.getStorageSync('partnerId')
this.getindex()
// this.getindex()
},
methods: {
gettel(num) {
@ -181,16 +182,25 @@
},
async gettab() {
let res = await request({
url: '/partnerOwn/partner/inspectionPostInfo',
url: '/system/role/pageByQuery',
method: 'get',
params: {
servicePackageId:'jiance'
}
})
console.log(res);
this.tabList = res.data
this.renList = res.data.slice(1)
console.log('获取所有角色', res);
this.tabList = [{
name: '全部',
id: undefined
}]
this.tabList.push(...res.data)
this.roleId = this.tabList[0].id
this.renList = res.data
this.getindex()
},
gettap(index, id) {
this.tapindex = index
this.postid = id
this.roleId = id
this.goodsList = []
this.getindex()
@ -207,15 +217,14 @@
async getindex() {
let data = {
partnerId: this.partnerId,
workName: this.workName,
postId: this.postid,
pageNum: this.pageNum, //
nickname: this.workName,
roleId: this.roleId,
pageNo: this.pageNum, //
pageSize: this.pageSize, //
}
let res = await request({
url: '/partnerOwn/partner/getWorkList',
url: '/system/role/selectListByRoleId',
method: 'get',
params: data
})
@ -266,16 +275,13 @@
})
return
} else {
this.workids = this.workids.join(",")
}
let data = {
partnerId: this.partnerId,
workIdStr: this.workids
// this.workids = this.workids.join(",")
}
let res = await request({
url: '/partnerOwn/partner/delWorker',
method: 'post',
params: data
url: '/system/user/deleteUserByIds',
method: 'delete',
data: this.workids
})
if (res.code == 200) {
uni.showToast({
@ -299,19 +305,32 @@
return
}
let data = {
partnerId: this.partnerId,
realName: this.realName,
phoneNum: this.phoneNum,
postId: this.gwid,
nickname: this.realName,
mobile: this.phoneNum,
username: this.phoneNum,
status:0,
userType:'01',
roleId:this.gwid,
password:'123456'
}
let res = await request({
url: '/partnerOwn/partner/addWorker',
url: '/system/user/create',
method: 'post',
params: data
data: data
})
//
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({
title: "添加成功"
})
@ -319,7 +338,8 @@
this.getindex()
}
},
open() {},
open() {
},
close() {
this.show = false
@ -329,24 +349,24 @@
uni.navigateBack()
}
}
}
}
</script>
<style scoped lang="scss">
.content {
.content {
box-sizing: border-box;
width: 100%;
height: calc(100vh);
background: white;
}
}
.warp-flax {
.warp-flax {
width: 100%;
display: flex;
flex-wrap: wrap;
}
}
.flasxbox {
.flasxbox {
border-radius: 6px;
box-sizing: border-box;
padding: 5px 10px;
@ -356,9 +376,9 @@
justify-content: center;
margin-right: 5px;
margin-top: 5px;
}
}
.gwcss {
.gwcss {
border-radius: 6px;
box-sizing: border-box;
padding: 5px 10px;
@ -369,9 +389,9 @@
margin-right: 5px;
margin-top: 5px;
color: #0D2E8D;
}
}
.top-heder {
.top-heder {
width: 100%;
height: 46px;
background: white;
@ -380,13 +400,13 @@
align-items: center;
box-sizing: border-box;
padding: 5px 15px;
}
}
.t-left {
.t-left {
width: 10%;
}
}
.t-input {
.t-input {
width: 75%;
height: 36px;
background: #F0F0F0;
@ -396,42 +416,42 @@
display: flex;
align-items: center;
}
}
.top-ail {
.top-ail {
width: 100%;
box-sizing: border-box;
padding: 15px;
background-color: #F4F4F4;
padding-bottom: 45px;
}
}
.sou {
.sou {
width: 10%;
margin-left: 5px;
}
}
.mub {
.mub {
background-color: #F4F4F4;
height: calc(100vh);
}
}
.dix {
.dix {
display: flex;
align-items: center;
}
}
.top-tap {
.top-tap {
width: 100%;
height: 44px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tap-box {
.tap-box {
width: 20%;
height: 100%;
text-align: center;
@ -440,38 +460,38 @@
color: #606266;
box-sizing: border-box;
}
}
.gang {
.gang {
width: 30px;
height: 4px;
background: #0D2E8D;
border-radius: 4px;
margin: 4px auto;
}
}
.a-box {
.a-box {
width: 100%;
border-radius: 8px;
background-color: white;
box-sizing: border-box;
padding: 15px;
margin-bottom: 10px;
}
}
.t-box {
.t-box {
width: 100%;
box-sizing: border-box;
// padding-bottom: 15px;
display: flex;
// border-bottom: 1px solid #EEEEEE;
}
}
.s-huix {
.s-huix {
width: 20%;
}
}
.s-img {
.s-img {
width: 50px;
height: 50px;
border-radius: 50%;
@ -483,32 +503,32 @@
width: 100%;
height: 100%;
}
}
}
.s-right {
.s-right {
width: 65%;
}
}
.s-title {
.s-title {
font-size: 18px;
font-weight: bold;
color: #333333;
}
}
.s-hui {
.s-hui {
font-size: 15px;
font-weight: 400;
color: #999999;
margin: 2px auto;
}
}
.s-ju {
.s-ju {
font-size: 18px;
font-weight: bold;
color: #FF571A;
}
}
.d-bottom {
.d-bottom {
position: fixed;
bottom: 0px;
width: 50%;
@ -520,9 +540,9 @@
justify-content: center;
background: #0D2E8D;
color: white;
}
}
.s-bottom {
.s-bottom {
position: fixed;
bottom: 0px;
right: 0px;
@ -535,9 +555,9 @@
justify-content: center;
background: crimson;
color: white;
}
}
.bottom-box {
.bottom-box {
width: 66px;
height: 31px;
background: #DAE1F8;
@ -549,37 +569,36 @@
font-weight: 400;
color: #0D2E8D;
margin-left: 5px;
}
}
.lan {
.lan {
color: #0D2E8D !important;
}
}
.jsy {
.jsy {
width: 100%;
margin-top: 20px;
text-align: center;
color: #0D2E8D !important;
}
}
.pop-box {
.pop-box {
width: 100%;
box-sizing: border-box;
padding: 15px;
}
}
.on-input {
.on-input {
width: 100%;
display: flex;
align-items: center;
border-bottom: 1px solid #DAE1F8;
;
border-bottom: 1px solid #DAE1F8;;
box-sizing: border-box;
padding-bottom: 5px;
margin: 10px;
}
}
.tjiao {
.tjiao {
width: 40%;
height: 30px;
margin: 5px auto;
@ -589,9 +608,9 @@
background: #0D2E8D;
color: white;
border-radius: 50px;
}
}
.c-tap {
.c-tap {
width: 100%;
height: 40px;
box-sizing: border-box;
@ -599,31 +618,31 @@
display: flex;
background-color: white;
align-items: center;
}
}
.tap-box {
.tap-box {
width: 20%;
display: inline-block;
text-align: center;
}
}
.gang {
.gang {
height: 4px;
background: #0D2E8D;
width: 80%;
margin: 0px auto;
}
}
.lan {
.lan {
color: #0D2E8D;
}
}
.box-bottom {
.box-bottom {
width: 100%;
height: 30px;
box-sizing: border-box;
white-space: nowrap;
}
}
</style>