更新
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="company_body">
|
||||
<!-- <view class="header_seach_seach">
|
||||
<!--<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="油站名称" >
|
||||
@@ -30,13 +30,6 @@
|
||||
sysRoleList: [],
|
||||
timer: null,
|
||||
authList: [],
|
||||
// getData: {
|
||||
// pageSize: 15,
|
||||
// currentPage: 1,
|
||||
// params: {
|
||||
// siteName: ""
|
||||
// },
|
||||
// },
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -47,37 +40,25 @@
|
||||
onShow() {
|
||||
this.getAuthList()
|
||||
},
|
||||
// onReachBottom() {
|
||||
// this.getData.currentPage += 1
|
||||
// this.getAuthList()
|
||||
// },
|
||||
methods: {
|
||||
|
||||
seleFn(item) {
|
||||
clearTimeout(this.timer)
|
||||
|
||||
this.$set(item, 'isChecked', !item.isChecked)
|
||||
|
||||
uni.$emit('yunSiteAuth', item)
|
||||
this.timer = setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 200)
|
||||
},
|
||||
seachFn() {
|
||||
// this.getData.currentPage = 1
|
||||
this.getDriversList()
|
||||
},
|
||||
getAuthList() {
|
||||
|
||||
serve.getSiteCloudRoles().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) {
|
||||
@@ -85,10 +66,6 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
// if (this.getData.currentPage !== 1) {
|
||||
// this.authList = this.authList.concat(data);
|
||||
// return
|
||||
// }
|
||||
this.authList = data
|
||||
})
|
||||
},
|
||||
|
||||
@@ -43,20 +43,10 @@
|
||||
// // this.oilCompanyInfoList = JSON.parse(decodeURI(options.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('yunSiteServiceStation', item)
|
||||
this.timer = setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
@@ -70,31 +60,15 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
// this.getData.currentPage = 1
|
||||
this.getDriversList()
|
||||
},
|
||||
getDriversList() {
|
||||
|
||||
getDriversList() {
|
||||
serve.getSiteChannelList(this.getData).then(res => {
|
||||
if (res.code !== 20000) return
|
||||
|
||||
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
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
|
||||
// if (this.getData.currentPage !== 1) {
|
||||
// this.stationList = this.stationList.concat(data);
|
||||
// return
|
||||
// }
|
||||
})
|
||||
this.stationList = data
|
||||
})
|
||||
},
|
||||
|
||||
@@ -98,7 +98,6 @@
|
||||
siteName: '',
|
||||
customerName: '',
|
||||
sysRoleList: [],
|
||||
// oilSiteInfoList: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -113,19 +112,9 @@
|
||||
uni.$on('yunSiteServiceStation', (item) => {
|
||||
this.postData.channelId = item.id
|
||||
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) => {
|
||||
// console.log('item',item)
|
||||
if (!item.isChecked) {
|
||||
let index = this.postData.sysRoleList.findIndex(secItem => secItem.id == item.id)
|
||||
if (index !== -1) {
|
||||
@@ -134,10 +123,7 @@
|
||||
return
|
||||
}
|
||||
this.postData.sysRoleList.push(item)
|
||||
console.log('this.postData.sysRoleList',this.postData.sysRoleList)
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
@@ -159,10 +145,8 @@
|
||||
WrongText:'请选择所属权限'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let check = tool.checkFn(this.postData,[],needCheckMap)
|
||||
|
||||
}
|
||||
let check = tool.checkFn(this.postData,[],needCheckMap)
|
||||
if(!check.result){
|
||||
uni.showToast({
|
||||
title:check.WrongText,
|
||||
@@ -170,17 +154,12 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// if(this.postData.sysRoleList.length)
|
||||
|
||||
let ids = this.postData.sysRoleList.reduce((pre, cur) => {
|
||||
pre.push(cur.id)
|
||||
return pre
|
||||
}, [])
|
||||
this.postData.roleIds = ids
|
||||
|
||||
this.judgeQuery().then(res => {
|
||||
|
||||
if (res.code === 20000) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
@@ -189,7 +168,6 @@
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1500)
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<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">
|
||||
:placeholder="letfText=='油站'?'油站名,油站ID':'司机姓名,司机手机号'" @iconClick="onClick">
|
||||
</uni-easyinput>
|
||||
<button @tap="jump('/userManagement/yunSite/detail')" class="header_seach_butten">
|
||||
<uni-icons type="plusempty" size="20" color="#bbbbbb"></uni-icons>
|
||||
@@ -134,11 +134,9 @@
|
||||
},
|
||||
|
||||
jump(path, item) {
|
||||
|
||||
if (path === -1) {
|
||||
return uni.navigateBack()
|
||||
}
|
||||
|
||||
let url = item ? `${path}?item=${encodeURI(JSON.stringify(item))}` : path
|
||||
uni.navigateTo({
|
||||
url
|
||||
|
||||
Reference in New Issue
Block a user