更新
This commit is contained in:
@@ -0,0 +1,87 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
// list
|
||||||
|
enterpriseUserQueryByPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oil-user/oilCustomerCompanyRelation/enterpriseUserQueryByPage',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 公司
|
||||||
|
companyGetByPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oil-user/oilCompanyInfo/getLikeByName',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 权限
|
||||||
|
getByRoleType() {
|
||||||
|
return request({
|
||||||
|
// 此处参数传空 获取所有权限
|
||||||
|
url: `/oil-user/sysRole/getByRoleType/XOIL_COMS/`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 新增
|
||||||
|
enterpriseUserSave(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oil-user/oilCustomerCompanyRelation/enterpriseUserSave',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 修改
|
||||||
|
userPermissionUpdate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oil-user/oilCustomerCompanyRelation/userPermissionUpdate',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 详情
|
||||||
|
getByUserId(id) {
|
||||||
|
return request({
|
||||||
|
url: `/oil-user/oilCustomerCompanyRelation/getByUserId/${id}`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 油站渠道
|
||||||
|
getSiteChannelList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oil-site/oilSiteChannel/getSiteChannelList',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 权限
|
||||||
|
getSiteCloudRoles() {
|
||||||
|
return request({
|
||||||
|
url: '/oil-user/sysRole/getSiteCloudRoles',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
saveCustomerRelationSite(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oil-user/oilCustomerChannelRelation/saveCustomerRelationSite',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 司机
|
// list
|
||||||
customerRelationSite(data) {
|
customerRelationSite(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oil-user/oilCustomerChannelRelation/customerRelationSite',
|
url: '/oil-user/oilCustomerChannelRelation/customerRelationSite',
|
||||||
|
|||||||
33
pages.json
33
pages.json
@@ -426,14 +426,6 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
|
||||||
}, {
|
|
||||||
"path": "yunSite/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "星油云站用户信息",
|
|
||||||
"navigationStyle": "custom",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "customer/detail",
|
"path": "customer/detail",
|
||||||
@@ -444,6 +436,31 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "customer/components/company",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "请选择公司",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "customer/components/auth",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "请选择权限",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
},{
|
||||||
|
"path": "yunSite/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "星油云站用户信息",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "yunSite/detail",
|
"path": "yunSite/detail",
|
||||||
|
|||||||
166
userManagement/customer/components/auth.vue
Normal file
166
userManagement/customer/components/auth.vue
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="company_body">
|
||||||
|
<!--<view class="header_seach_seach">
|
||||||
|
<uni-easyinput @confirm="seachFn"
|
||||||
|
style="height: 100%; flex: 1; margin: 0 auto; background-color: #FFFFFF; border-radius:12rpx ;"
|
||||||
|
prefixIcon="search" v-model="getData.params.siteName" placeholder="油站名称" >
|
||||||
|
</uni-easyinput>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<view class="company_list">
|
||||||
|
<view @tap="seleFn(item)" v-for="(item,index) in authList" class="company_list_item">
|
||||||
|
<image src="../../../static/selegs.png" style="width: 73rpx; height: 73rpx;"></image>
|
||||||
|
<view class="company_list_item_text">{{item.roleName}}</view>
|
||||||
|
<view style="flex-grow: 1; text-align: end;text-align: -webkit-right;">
|
||||||
|
<view class="checkboxs">
|
||||||
|
<view v-if="item.isChecked" class="checkboxss"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import serve from '@/api/userManagement/customer.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
sysRoleList: [],
|
||||||
|
timer: null,
|
||||||
|
authList: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if (options.item) {
|
||||||
|
this.sysRoleList = JSON.parse(decodeURI(options.item))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getAuthList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
seleFn(item) {
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
this.$set(item, 'isChecked', !item.isChecked)
|
||||||
|
uni.$emit('customerAuth', item)
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
|
seachFn() {
|
||||||
|
this.getDriversList()
|
||||||
|
},
|
||||||
|
|
||||||
|
getAuthList() {
|
||||||
|
serve.getByRoleType().then(res => {
|
||||||
|
if (res.code !== 20000) return
|
||||||
|
let data = res.data.map(item => {
|
||||||
|
item['isChecked'] = false
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
data.forEach(item => {
|
||||||
|
this.sysRoleList.forEach(secItem => {
|
||||||
|
if (secItem.id === item.id) {
|
||||||
|
item['isChecked'] = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.authList = data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.companytip {
|
||||||
|
width: 88rpx;
|
||||||
|
height: 38rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkboxss {
|
||||||
|
width: 80%;
|
||||||
|
height: 80%;
|
||||||
|
background-color: #2866FF;
|
||||||
|
border-radius: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkboxs {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
border-radius: 50px;
|
||||||
|
border: 1px solid #BBBBBB;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox__inner {
|
||||||
|
border-radius: 50px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-data-checklist {
|
||||||
|
flex: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-data-checklist .checklist-group .checklist-box {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-data-checklist {
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_list_item_text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
margin-left: 23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_list_item {
|
||||||
|
min-height: 92rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0px 3px 9px 0px rgba(88, 88, 88, 0.2);
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 9rpx 21rpx;
|
||||||
|
margin-top: 19rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_list {
|
||||||
|
width: 100vw;
|
||||||
|
padding: 0 31rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_body {
|
||||||
|
background-color: #2866FF;
|
||||||
|
padding: 25rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-easyinput__content {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-easyinput {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header_seach_seach {
|
||||||
|
display: flex;
|
||||||
|
height: 80rpx;
|
||||||
|
background-color: #2866FF;
|
||||||
|
padding: 0 31rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
183
userManagement/customer/components/company.vue
Normal file
183
userManagement/customer/components/company.vue
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="company_body">
|
||||||
|
<view class="header_seach_seach">
|
||||||
|
<uni-easyinput @confirm="seachFn"
|
||||||
|
style="height: 100%; flex: 1; margin: 0 auto; background-color: #FFFFFF; border-radius:12rpx ;"
|
||||||
|
prefixIcon="search" v-model="getData.name" placeholder="请输入公司名称进行查询">
|
||||||
|
</uni-easyinput>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="company_list">
|
||||||
|
<view @tap="seleFn(item)" v-for="(item,index) in companyList" class="company_list_item">
|
||||||
|
<image src="../../../static/selegs.png" style="width: 73rpx; height: 73rpx;"></image>
|
||||||
|
<view class="company_list_item_text">{{item.name}}</view>
|
||||||
|
<view style="flex-grow: 1; text-align: end;text-align: -webkit-right;">
|
||||||
|
<view class="checkboxs">
|
||||||
|
<view v-if="item.isChecked" class="checkboxss"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import serve from '@/api/userManagement/customer.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
oilCompanyInfoList: [],
|
||||||
|
siteId: '',
|
||||||
|
timer: null,
|
||||||
|
companyList: [],
|
||||||
|
getData: {
|
||||||
|
name: ''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if (options.item) {
|
||||||
|
let item = JSON.parse(decodeURI(options.item))
|
||||||
|
this.siteId = item.siteId
|
||||||
|
this.oilCompanyInfoList = item
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
// this.getDriversList()
|
||||||
|
},
|
||||||
|
// onReachBottom() {
|
||||||
|
// // this.getData.currentPage += 1
|
||||||
|
// this.getDriversList()
|
||||||
|
// },
|
||||||
|
methods: {
|
||||||
|
seleFn(item) {
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
this.$set(item, 'isChecked', !item.isChecked)
|
||||||
|
uni.$emit('customerCompany', item)
|
||||||
|
this.timer = setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
|
seachFn() {
|
||||||
|
if (!this.getData.name) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '搜索条件不可为空',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.getDriversList()
|
||||||
|
},
|
||||||
|
getDriversList() {
|
||||||
|
|
||||||
|
serve.companyGetByPage(this.getData).then(res => {
|
||||||
|
if (res.code !== 20000) return
|
||||||
|
let data = res.data.map(item => {
|
||||||
|
item['isChecked'] = false
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
data.forEach(item => {
|
||||||
|
this.oilCompanyInfoList.forEach(secItem => {
|
||||||
|
if (secItem.id === item.id) {
|
||||||
|
item['isChecked'] = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.companyList = data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.companytip {
|
||||||
|
width: 88rpx;
|
||||||
|
height: 38rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-size: 24rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkboxss {
|
||||||
|
width: 80%;
|
||||||
|
height: 80%;
|
||||||
|
background-color: #2866FF;
|
||||||
|
border-radius: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkboxs {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
border-radius: 50px;
|
||||||
|
border: 1px solid #BBBBBB;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox__inner {
|
||||||
|
border-radius: 50px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-data-checklist {
|
||||||
|
flex: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-data-checklist .checklist-group .checklist-box {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-data-checklist {
|
||||||
|
width: max-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_list_item_text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #000000;
|
||||||
|
margin-left: 23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_list_item {
|
||||||
|
min-height: 92rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0px 3px 9px 0px rgba(88, 88, 88, 0.2);
|
||||||
|
border-radius: 8rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 9rpx 21rpx;
|
||||||
|
margin-top: 19rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_list {
|
||||||
|
width: 100vw;
|
||||||
|
padding: 0 31rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.company_body {
|
||||||
|
background-color: #2866FF;
|
||||||
|
padding: 25rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-easyinput__content {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-easyinput {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header_seach_seach {
|
||||||
|
display: flex;
|
||||||
|
height: 80rpx;
|
||||||
|
background-color: #2866FF;
|
||||||
|
padding: 0 31rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -8,26 +8,35 @@
|
|||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item>
|
<uni-list-item>
|
||||||
<view class="list_header" slot="header">
|
<view class="list_header" slot="header">
|
||||||
|
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;"
|
||||||
|
mode="widthFix"></image>
|
||||||
用户手机号
|
用户手机号
|
||||||
</view>
|
</view>
|
||||||
<view style="padding-right: 16px !important;" slot="body" class="list_right">
|
<view slot="body" class="list_right">
|
||||||
<input v-model="postData.userName" placeholder="请输入昵称" class="list_right_input" />
|
<input v-model="postData.phone" :disabled="!isAdd" placeholder="请输入用户手机号"
|
||||||
|
class="list_right_input" />
|
||||||
</view>
|
</view>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
<uni-list-item>
|
<uni-list-item>
|
||||||
<view class="list_header" slot="header">
|
<view class="list_header" slot="header">
|
||||||
|
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;"
|
||||||
|
mode="widthFix"></image>
|
||||||
用户姓名
|
用户姓名
|
||||||
</view>
|
</view>
|
||||||
<view style="padding-right: 16px !important;" slot="body" class="list_right">
|
<view slot="body" class="list_right">
|
||||||
<input v-model="postData.userName" placeholder="请输入昵称" class="list_right_input" />
|
<input v-model="postData.userName" :disabled="!wantUpdate" placeholder="请输入用户姓名"
|
||||||
|
class="list_right_input" />
|
||||||
</view>
|
</view>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
<uni-list-item>
|
<uni-list-item>
|
||||||
<view class="list_header" slot="header">
|
<view class="list_header" slot="header">
|
||||||
|
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;"
|
||||||
|
mode="widthFix"></image>
|
||||||
用户密码
|
用户密码
|
||||||
</view>
|
</view>
|
||||||
<view style="padding-right: 16px !important;" slot="body" class="list_right">
|
<view slot="body" class="list_right">
|
||||||
<input v-model="postData.userName" placeholder="请输入昵称" class="list_right_input" />
|
<input v-model="postData.password" password :disabled="!wantUpdate" placeholder="请输入密码"
|
||||||
|
class="list_right_input" />
|
||||||
</view>
|
</view>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
@@ -36,38 +45,176 @@
|
|||||||
<view class="card_title_text">用户权限信息</view>
|
<view class="card_title_text">用户权限信息</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item>
|
<uni-list-item direction="column"
|
||||||
|
@tap="jump('/userManagement/customer/components/company',postData.oilCompanyInfoList)">
|
||||||
<view class="list_header" slot="header">
|
<view class="list_header" slot="header">
|
||||||
选择企业
|
所属公司
|
||||||
</view>
|
</view>
|
||||||
<view style="padding-right: 16px !important;" slot="body" class="list_right">
|
<view slot="body" class="list-frame">
|
||||||
<input v-model="postData.userName" placeholder="请输入昵称" class="list_right_input" />
|
<view>
|
||||||
|
<text class="label" v-for="(item,index) in postData.oilCompanyInfoList"
|
||||||
|
:key="index">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="!postData.oilCompanyInfoList.length" class="tips">选择所属公司</view>
|
||||||
|
<uni-icons v-show="wantUpdate" color="#999" type="right" size="15"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
<uni-list-item direction="column" >
|
<uni-list-item direction="column"
|
||||||
|
@tap="jump('/userManagement/customer/components/auth',postData.sysUserRoleList)">
|
||||||
<view class="list_header" slot="header">
|
<view class="list_header" slot="header">
|
||||||
|
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;"
|
||||||
|
mode="widthFix"></image>
|
||||||
所属权限
|
所属权限
|
||||||
</view>
|
</view>
|
||||||
<view slot="body" >
|
<view slot="body" class="list-frame">
|
||||||
<view class="label-list">
|
<view>
|
||||||
<text class="label">星油云站超级管理员</text>
|
<text class="label" v-for="(item,index) in postData.sysUserRoleList"
|
||||||
|
:key="index">{{item.roleName}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="!postData.sysUserRoleList.length" class="tips">选择所属权限</view>
|
||||||
|
<uni-icons v-show="wantUpdate || !postData.sysUserRoleList.length" color="#999" type="right"
|
||||||
|
size="15"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
</view>
|
</view>
|
||||||
<view class="button-group">
|
<view class="button-group">
|
||||||
<view class="button red">修改</view>
|
<view v-if="!wantUpdate" class="button red" @tap="update">修改</view>
|
||||||
<view class="button blue">保存</view>
|
<view v-else class="button blue" @tap="submit">保存</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import tool from '@/utils/tool'
|
||||||
|
|
||||||
|
import serve from '@/api/userManagement/customer.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
postData: {}
|
isAdd: false,
|
||||||
|
wantUpdate: false,
|
||||||
|
postData: {
|
||||||
|
phone: '',
|
||||||
|
userName: '',
|
||||||
|
password:'',
|
||||||
|
sysUserRoleList: [],
|
||||||
|
oilCompanyInfoList: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if (options.item) {
|
||||||
|
this.postData = JSON.parse(decodeURI(options.item))
|
||||||
|
this.getByUserId()
|
||||||
|
} else this.isAdd = this.wantUpdate = true
|
||||||
|
|
||||||
|
uni.$on('customerCompany', (item) => {
|
||||||
|
if (!item.isChecked) {
|
||||||
|
let index = this.postData.oilCompanyInfoList.findIndex(secItem => secItem.id == item.id)
|
||||||
|
if (index !== -1) {
|
||||||
|
this.postData.oilCompanyInfoList.splice(index, 1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.postData.oilCompanyInfoList.push(item)
|
||||||
|
})
|
||||||
|
|
||||||
|
uni.$on('customerAuth', (item) => {
|
||||||
|
if (!item.isChecked) {
|
||||||
|
let index = this.postData.sysUserRoleList.findIndex(secItem => secItem.id == item.id)
|
||||||
|
if (index !== -1) {
|
||||||
|
this.postData.sysUserRoleList.splice(index, 1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.postData.sysUserRoleList.push(item)
|
||||||
|
console.log('this.postData.sysUserRoleList', this.postData.sysUserRoleList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getByUserId() {
|
||||||
|
serve.getByUserId(this.postData.id).then(res => {
|
||||||
|
this.$set(this.postData, 'sysUserRoleList', res.data.sysUserRoleList)
|
||||||
|
this.$set(this.postData, 'oilCompanyInfoList', res.data.oilCompanyInfoList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
let needCheckMap = {
|
||||||
|
userName: {
|
||||||
|
tacitly: '',
|
||||||
|
WrongText: '请输入用户姓名'
|
||||||
|
},
|
||||||
|
phone: {
|
||||||
|
custom: /^[1][3,4,5,7,8,9][0-9]{9}$/,
|
||||||
|
WrongText: '请输入正确手机号码'
|
||||||
|
},
|
||||||
|
oilCompanyInfoList: {
|
||||||
|
minLength: 1,
|
||||||
|
WrongText: '请选择所属公司'
|
||||||
|
},
|
||||||
|
sysUserRoleList: {
|
||||||
|
minLength: 1,
|
||||||
|
WrongText: '请选择所属权限'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.isAdd) {
|
||||||
|
needCheckMap['password'] = {
|
||||||
|
tacitly: '',
|
||||||
|
WrongText: '请输入用户密码'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let check = tool.checkFn(this.postData, [], needCheckMap)
|
||||||
|
|
||||||
|
if (!check.result) {
|
||||||
|
uni.showToast({
|
||||||
|
title: check.WrongText,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let roleIds = this.postData.sysUserRoleList.reduce((pre, cur) => {
|
||||||
|
pre.push(cur.id)
|
||||||
|
return pre
|
||||||
|
}, [])
|
||||||
|
this.postData.roleIds = roleIds
|
||||||
|
|
||||||
|
let companyIds = this.postData.oilCompanyInfoList.reduce((pre, cur) => {
|
||||||
|
pre.push(cur.id)
|
||||||
|
return pre
|
||||||
|
}, [])
|
||||||
|
this.postData.companyIds = companyIds
|
||||||
|
this.postData.userId = this.postData.id
|
||||||
|
|
||||||
|
this.judgeQuery().then(res => {
|
||||||
|
if (res.code === 20000) {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
judgeQuery() {
|
||||||
|
if (this.isAdd) return serve.enterpriseUserSave(this.postData)
|
||||||
|
else return serve.userPermissionUpdate(this.postData)
|
||||||
|
},
|
||||||
|
update() {
|
||||||
|
this.wantUpdate = true
|
||||||
|
},
|
||||||
|
jump(path, item, banJump = true) {
|
||||||
|
if (!banJump) return
|
||||||
|
if (!this.wantUpdate) return
|
||||||
|
let url = item ? `${path}?item=${encodeURI(JSON.stringify(item))}` : path
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,10 +284,43 @@
|
|||||||
padding-left: 90rpx;
|
padding-left: 90rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.label-list {
|
|
||||||
|
.list-frame {
|
||||||
margin-top: 25rpx;
|
margin-top: 25rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&.site {
|
||||||
|
margin: 0;
|
||||||
|
flex: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
uni-icons {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-51%);
|
||||||
|
right: -30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
&.rel2rpx {
|
||||||
|
position: 'relative';
|
||||||
|
top: 2rpx
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.single-label {
|
||||||
|
color: #999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
|
margin: 3rpx 1rpx;
|
||||||
|
display: inline-block;
|
||||||
padding: 10rpx 15rpx;
|
padding: 10rpx 15rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
@@ -148,7 +328,7 @@
|
|||||||
border-radius: 5rpx;
|
border-radius: 5rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
.button-group {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -163,12 +343,15 @@
|
|||||||
line-height: 100rpx;
|
line-height: 100rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
&:nth-of-type(2) {
|
|
||||||
margin-top: 50rpx;
|
// &:nth-of-type(2) {
|
||||||
}
|
// margin-top: 50rpx;
|
||||||
&.red{
|
// }
|
||||||
|
|
||||||
|
&.red {
|
||||||
background: #EA0000;
|
background: #EA0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.blue {
|
&.blue {
|
||||||
background: #2866FF;
|
background: #2866FF;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,252 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<view @click="ejectOpen=false" style="height: 100vh;display: flex;flex-direction: column;">
|
||||||
|
<view class="header">
|
||||||
|
<view :style="{height:styles.top+'px'}"></view>
|
||||||
|
<uni-nav-bar @clickLeft='jump(-1)' :border="false" color='white' backgroundColor="rgba(0,0,0,0)"
|
||||||
|
left-icon="back" title="用户信息" />
|
||||||
|
<view class="seach">
|
||||||
|
<uni-easyinput style="flex:1" :candidate='candidate' :ejectOpen='ejectOpen' @ejectFn='ejectFn'
|
||||||
|
:letfText='letfText' confirmType='search' @confirm='seachFn'
|
||||||
|
placeholder-style="color:#bbbbbb;font-weight: 100;" v-model="seachValue"
|
||||||
|
:placeholder="letfText=='企业'?'企业名,企业ID':'司机姓名,司机手机号'" @iconClick="onClick">
|
||||||
|
</uni-easyinput>
|
||||||
|
<button @tap="jump('/userManagement/customer/detail')" class="header_seach_butten">
|
||||||
|
<uni-icons type="plusempty" size="20" color="#bbbbbb"></uni-icons>
|
||||||
|
<view>新增</view>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view style="flex:1;overflow: hidden;">
|
||||||
|
<view v-if="!tableList.length"
|
||||||
|
style="width: 100vw; height: 100%; display: flex;align-items: center;justify-content: center;">
|
||||||
|
<image src="@/static/qx.png" style="width: 500rpx; height: 355rpx;"></image>
|
||||||
|
</view>
|
||||||
|
<scroll-view style="height: 100%;" scroll-y="true" @scrolltolower='scrolltolower'>
|
||||||
|
<view class="container">
|
||||||
|
<view v-for="(item,index) in tableList" class="form_body">
|
||||||
|
<view @tap="jump('/userManagement/customer/detail',item)" class="form_body_item">
|
||||||
|
<view class="form_body_item_body">
|
||||||
|
<view class="form-item_body_left" style="">
|
||||||
|
<image :src="item.headPhoto?item.headPhoto: '../../static/tx.png'"
|
||||||
|
style="width: 100rpx; height: 100rpx;border-radius: 50%;"></image>
|
||||||
|
<view class="form_body_item_body_container">
|
||||||
|
<view :style="{color:item.customerName ?'':'#999999'}">
|
||||||
|
{{item.userName ||'暂无' }}
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
{{item.phone || '暂无'}}
|
||||||
|
<view class="copy" v-if="item.phone" @tap.stop="copy(item.phone)"></view>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="form-item_body_left_bottom_text" style="">
|
||||||
|
{{item.siteName ||'暂无'}}
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="form_body_item_footer">
|
||||||
|
<view>{{item.id}}</view>
|
||||||
|
<view>{{item.createTime}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import serve from '@/api/userManagement/customer.js'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
seachValue: '',
|
||||||
|
letfText: '司机',
|
||||||
|
ejectOpen: false,
|
||||||
|
candidate: ['司机', '企业'],
|
||||||
|
|
||||||
|
styles: {},
|
||||||
|
paramter: {
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sorted: {
|
||||||
|
createTime: 'desc'
|
||||||
|
},
|
||||||
|
params: {}
|
||||||
|
},
|
||||||
|
tableList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.styles = uni.getMenuButtonBoundingClientRect()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.seachFn()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
ejectFn(e) {
|
||||||
|
this.letfText = e
|
||||||
|
this.tableList = []
|
||||||
|
this.getByPage()
|
||||||
|
},
|
||||||
|
seachFn() {
|
||||||
|
this.tableList = []
|
||||||
|
this.paramter.currentPage = 1
|
||||||
|
this.getByPage()
|
||||||
|
},
|
||||||
|
getByPage() {
|
||||||
|
if (this.letfText == '企业') {
|
||||||
|
this.paramter.params = {
|
||||||
|
companyIdOrName: this.seachValue
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.paramter.params = {
|
||||||
|
userNameOrPhone : this.seachValue,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.siteHandle()
|
||||||
|
},
|
||||||
|
siteHandle() {
|
||||||
|
serve.enterpriseUserQueryByPage(this.paramter).then(res => {
|
||||||
|
if (!res.data.list.length) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '没有数据了哦~',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.tableList = this.tableList.concat(res.data.list);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 触底加载
|
||||||
|
scrolltolower() {
|
||||||
|
this.paramter.currentPage += 1
|
||||||
|
this.getByPage()
|
||||||
|
},
|
||||||
|
handlerNumber(number) {
|
||||||
|
if (number == 0) return number
|
||||||
|
if (!number) {
|
||||||
|
return '--'
|
||||||
|
}
|
||||||
|
return +number.toFixed(2)
|
||||||
|
},
|
||||||
|
|
||||||
|
jump(path, item) {
|
||||||
|
if (path === -1) {
|
||||||
|
return uni.navigateBack()
|
||||||
|
}
|
||||||
|
let url = item ? `${path}?item=${encodeURI(JSON.stringify(item))}` : path
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClick() {
|
||||||
|
this.ejectOpen = !this.ejectOpen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
</style>
|
.uni-easyinput__content {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 403rpx;
|
||||||
|
background: url('https://xoi-support.oss-cn-hangzhou.aliyuncs.com/星油admin小程序/sjbj.png') center/100% no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .seach {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 60rpx;
|
||||||
|
padding: 0 50rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uni-easyinput__content {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header_seach_butten {
|
||||||
|
font-size: 24rpx !important;
|
||||||
|
display: flex !important;
|
||||||
|
align-items: center !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
flex-shrink: 1;
|
||||||
|
margin-left: 9rpx !important;
|
||||||
|
background: #FFFFFF !important;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
padding: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_body {
|
||||||
|
/* width: 100vw; */
|
||||||
|
padding: 0 10px;
|
||||||
|
margin-top: 40rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
&:nth-of-type(1) {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_body_item {
|
||||||
|
height: 217rpx;
|
||||||
|
background: #FFFFFF;
|
||||||
|
box-shadow: 0px 3px 9px 0px rgba(88, 88, 88, 0.2);
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .form-item_body_right {
|
||||||
|
flex-grow: 1;
|
||||||
|
text-align: end;
|
||||||
|
color: #999999;
|
||||||
|
font-size: 24rpx;
|
||||||
|
height: max-content;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.form_body_item_body {
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
border-bottom: 1px solid #F0F0F0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_body_item_body_container {
|
||||||
|
margin-left: 24rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item_body_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item_body_left_bottom_text {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form_body_item_footer {
|
||||||
|
display: flex;
|
||||||
|
color: #BBBBBB;
|
||||||
|
font-size: 22rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
/* margin-top: 15rpx; */
|
||||||
|
align-items: center;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="company_body">
|
<view class="company_body">
|
||||||
<!-- <view class="header_seach_seach">
|
<!--<view class="header_seach_seach">
|
||||||
<uni-easyinput @confirm="seachFn"
|
<uni-easyinput @confirm="seachFn"
|
||||||
style="height: 100%; flex: 1; margin: 0 auto; background-color: #FFFFFF; border-radius:12rpx ;"
|
style="height: 100%; flex: 1; margin: 0 auto; background-color: #FFFFFF; border-radius:12rpx ;"
|
||||||
prefixIcon="search" v-model="getData.params.siteName" placeholder="油站名称" >
|
prefixIcon="search" v-model="getData.params.siteName" placeholder="油站名称" >
|
||||||
@@ -30,13 +30,6 @@
|
|||||||
sysRoleList: [],
|
sysRoleList: [],
|
||||||
timer: null,
|
timer: null,
|
||||||
authList: [],
|
authList: [],
|
||||||
// getData: {
|
|
||||||
// pageSize: 15,
|
|
||||||
// currentPage: 1,
|
|
||||||
// params: {
|
|
||||||
// siteName: ""
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@@ -47,37 +40,25 @@
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.getAuthList()
|
this.getAuthList()
|
||||||
},
|
},
|
||||||
// onReachBottom() {
|
|
||||||
// this.getData.currentPage += 1
|
|
||||||
// this.getAuthList()
|
|
||||||
// },
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
seleFn(item) {
|
seleFn(item) {
|
||||||
clearTimeout(this.timer)
|
clearTimeout(this.timer)
|
||||||
|
|
||||||
this.$set(item, 'isChecked', !item.isChecked)
|
this.$set(item, 'isChecked', !item.isChecked)
|
||||||
|
|
||||||
uni.$emit('yunSiteAuth', item)
|
uni.$emit('yunSiteAuth', item)
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 200)
|
}, 200)
|
||||||
},
|
},
|
||||||
seachFn() {
|
seachFn() {
|
||||||
// this.getData.currentPage = 1
|
|
||||||
this.getDriversList()
|
this.getDriversList()
|
||||||
},
|
},
|
||||||
getAuthList() {
|
getAuthList() {
|
||||||
|
|
||||||
serve.getSiteCloudRoles().then(res => {
|
serve.getSiteCloudRoles().then(res => {
|
||||||
if (res.code !== 20000) return
|
if (res.code !== 20000) return
|
||||||
|
|
||||||
let data = res.data.map(item => {
|
let data = res.data.map(item => {
|
||||||
item['isChecked'] = false
|
item['isChecked'] = false
|
||||||
return item
|
return item
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
this.sysRoleList.forEach(secItem => {
|
this.sysRoleList.forEach(secItem => {
|
||||||
if (secItem.id === item.id) {
|
if (secItem.id === item.id) {
|
||||||
@@ -85,10 +66,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// if (this.getData.currentPage !== 1) {
|
|
||||||
// this.authList = this.authList.concat(data);
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
this.authList = data
|
this.authList = data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,20 +43,10 @@
|
|||||||
// // this.oilCompanyInfoList = JSON.parse(decodeURI(options.item))
|
// // this.oilCompanyInfoList = JSON.parse(decodeURI(options.item))
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
onShow() {
|
|
||||||
// this.getDriversList()
|
|
||||||
},
|
|
||||||
// onReachBottom() {
|
|
||||||
// // this.getData.currentPage += 1
|
|
||||||
// this.getDriversList()
|
|
||||||
// },
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
seleFn(item) {
|
seleFn(item) {
|
||||||
clearTimeout(this.timer)
|
clearTimeout(this.timer)
|
||||||
|
|
||||||
this.$set(item,'isChecked',!item.isChecked)
|
this.$set(item,'isChecked',!item.isChecked)
|
||||||
|
|
||||||
uni.$emit('yunSiteServiceStation', item)
|
uni.$emit('yunSiteServiceStation', item)
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
@@ -70,31 +60,15 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// this.getData.currentPage = 1
|
|
||||||
this.getDriversList()
|
this.getDriversList()
|
||||||
},
|
},
|
||||||
getDriversList() {
|
getDriversList() {
|
||||||
|
|
||||||
serve.getSiteChannelList(this.getData).then(res => {
|
serve.getSiteChannelList(this.getData).then(res => {
|
||||||
if (res.code !== 20000) return
|
if (res.code !== 20000) return
|
||||||
|
|
||||||
let data = res.data.map(item => {
|
let data = res.data.map(item => {
|
||||||
item['isChecked'] = false
|
item['isChecked'] = false
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
|
|
||||||
// data.forEach(item => {
|
|
||||||
// this.oilCompanyInfoList.forEach(secItem =>{
|
|
||||||
// if(secItem.id === item.id) {
|
|
||||||
// item['isChecked'] = true
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
|
|
||||||
// if (this.getData.currentPage !== 1) {
|
|
||||||
// this.stationList = this.stationList.concat(data);
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
this.stationList = data
|
this.stationList = data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -98,7 +98,6 @@
|
|||||||
siteName: '',
|
siteName: '',
|
||||||
customerName: '',
|
customerName: '',
|
||||||
sysRoleList: [],
|
sysRoleList: [],
|
||||||
// oilSiteInfoList: [],
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -113,19 +112,9 @@
|
|||||||
uni.$on('yunSiteServiceStation', (item) => {
|
uni.$on('yunSiteServiceStation', (item) => {
|
||||||
this.postData.channelId = item.id
|
this.postData.channelId = item.id
|
||||||
this.postData.siteName = item.otherSiteName
|
this.postData.siteName = item.otherSiteName
|
||||||
// item['name'] = item.siteName
|
|
||||||
// if (!item.isChecked) {
|
|
||||||
// let index = this.postData.oilSiteInfoList.findIndex(secItem => secItem.id == item.id)
|
|
||||||
// if (index !== -1) {
|
|
||||||
// this.postData.oilSiteInfoList.splice(index, 1)
|
|
||||||
// }
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// this.postData.oilSiteInfoList.push(item)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
uni.$on('yunSiteAuth', (item) => {
|
uni.$on('yunSiteAuth', (item) => {
|
||||||
// console.log('item',item)
|
|
||||||
if (!item.isChecked) {
|
if (!item.isChecked) {
|
||||||
let index = this.postData.sysRoleList.findIndex(secItem => secItem.id == item.id)
|
let index = this.postData.sysRoleList.findIndex(secItem => secItem.id == item.id)
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
@@ -134,10 +123,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.postData.sysRoleList.push(item)
|
this.postData.sysRoleList.push(item)
|
||||||
console.log('this.postData.sysRoleList',this.postData.sysRoleList)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submit() {
|
submit() {
|
||||||
@@ -159,10 +145,8 @@
|
|||||||
WrongText:'请选择所属权限'
|
WrongText:'请选择所属权限'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
let check = tool.checkFn(this.postData,[],needCheckMap)
|
||||||
let check = tool.checkFn(this.postData,[],needCheckMap)
|
|
||||||
|
|
||||||
if(!check.result){
|
if(!check.result){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:check.WrongText,
|
title:check.WrongText,
|
||||||
@@ -170,17 +154,12 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(this.postData.sysRoleList.length)
|
|
||||||
|
|
||||||
let ids = this.postData.sysRoleList.reduce((pre, cur) => {
|
let ids = this.postData.sysRoleList.reduce((pre, cur) => {
|
||||||
pre.push(cur.id)
|
pre.push(cur.id)
|
||||||
return pre
|
return pre
|
||||||
}, [])
|
}, [])
|
||||||
this.postData.roleIds = ids
|
this.postData.roleIds = ids
|
||||||
|
|
||||||
this.judgeQuery().then(res => {
|
this.judgeQuery().then(res => {
|
||||||
|
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@@ -189,7 +168,6 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1500)
|
}, 1500)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<uni-easyinput style="flex:1" :candidate='candidate' :ejectOpen='ejectOpen' @ejectFn='ejectFn'
|
<uni-easyinput style="flex:1" :candidate='candidate' :ejectOpen='ejectOpen' @ejectFn='ejectFn'
|
||||||
:letfText='letfText' confirmType='search' @confirm='seachFn'
|
:letfText='letfText' confirmType='search' @confirm='seachFn'
|
||||||
placeholder-style="color:#bbbbbb;font-weight: 100;" v-model="seachValue"
|
placeholder-style="color:#bbbbbb;font-weight: 100;" v-model="seachValue"
|
||||||
:placeholder="letfText=='企业'?'企业名,企业ID':'司机姓名,司机手机号'" @iconClick="onClick">
|
:placeholder="letfText=='油站'?'油站名,油站ID':'司机姓名,司机手机号'" @iconClick="onClick">
|
||||||
</uni-easyinput>
|
</uni-easyinput>
|
||||||
<button @tap="jump('/userManagement/yunSite/detail')" class="header_seach_butten">
|
<button @tap="jump('/userManagement/yunSite/detail')" class="header_seach_butten">
|
||||||
<uni-icons type="plusempty" size="20" color="#bbbbbb"></uni-icons>
|
<uni-icons type="plusempty" size="20" color="#bbbbbb"></uni-icons>
|
||||||
@@ -134,11 +134,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
jump(path, item) {
|
jump(path, item) {
|
||||||
|
|
||||||
if (path === -1) {
|
if (path === -1) {
|
||||||
return uni.navigateBack()
|
return uni.navigateBack()
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = item ? `${path}?item=${encodeURI(JSON.stringify(item))}` : path
|
let url = item ? `${path}?item=${encodeURI(JSON.stringify(item))}` : path
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
|
|||||||
Reference in New Issue
Block a user