30338
This commit is contained in:
@@ -214,6 +214,7 @@ export default {
|
|||||||
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
|
this.$http.post("/app/pushmessage/addOrUpdate", params).then(res => {
|
||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
this.$u.toast('发送成功')
|
this.$u.toast('发送成功')
|
||||||
|
uni.setStorageSync('selectDeptUser', [])
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|||||||
@@ -54,19 +54,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
console.log(this.$route.query.selected)
|
// console.log(this.$route.query.selected)
|
||||||
// this.selected = [this.$route.query.selected].flat().filter(e => !!e)?.map(id => ({id, kind: /^\d{1,5}}$/.test(id) ? 'dept' : 'user'})) || []
|
// this.selected = [this.$route.query.selected].flat().filter(e => !!e)?.map(id => ({id, kind: /^\d{1,5}}$/.test(id) ? 'dept' : 'user'})) || []
|
||||||
|
this.selected = uni.getStorageSync('selectDeptUser') || []
|
||||||
|
console.log(this.selected)
|
||||||
this.getAllDepts()
|
this.getAllDepts()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isSelected(id) {
|
isSelected(id, corpId) {
|
||||||
return !!this.selected.find(e => e.id == id)
|
return !!this.selected.find(e => e.id == id && e.corpId == corpId)
|
||||||
},
|
},
|
||||||
getAllDepts() {
|
getAllDepts() {
|
||||||
this.$http.post('/app/wxcp/wxdepartment/listAllByCorp').then((res) => {
|
this.$http.post('/app/wxcp/wxdepartment/listAllByCorp').then((res) => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
let parents = res.data.map(e => e.parentid)
|
let parents = res.data.map(e => e.parentid)
|
||||||
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id), isChecked: this.isSelected(e.id)}))
|
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id), isChecked: this.isSelected(e.id, e.corpId)}))
|
||||||
this.deptInit()
|
this.deptInit()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -114,16 +116,11 @@ export default {
|
|||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// uni.navigateBack({
|
|
||||||
// success: () => {
|
|
||||||
// uni.$emit("pagePicker:custom", [this.selected].flat())
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// uni.$emit("selectDept", [this.selected].flat())
|
|
||||||
console.log([this.selected].flat())
|
console.log([this.selected].flat())
|
||||||
if(![this.selected].flat().length) {
|
if(![this.selected].flat().length) {
|
||||||
return this.$u.toast('请选择部门或人员')
|
return this.$u.toast('请选择部门或人员')
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.$emit("pagePicker:custom", [this.selected].flat())
|
uni.$emit("pagePicker:custom", [this.selected].flat())
|
||||||
uni.setStorageSync('selectDeptUser', [this.selected].flat())
|
uni.setStorageSync('selectDeptUser', [this.selected].flat())
|
||||||
uni.navigateTo({url: `./selectTag`})
|
uni.navigateTo({url: `./selectTag`})
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="selectTag">
|
<section class="selectTag">
|
||||||
<p class="title">已选择组织</p>
|
<p class="title">已选择</p>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div class="item" v-for="(item, index) in deptList" :key="index" v-if="!item.parentid">
|
<div class="item" v-for="(item, index) in deptList" :key="index">
|
||||||
<div class="name-flex">
|
<div class="name-flex">
|
||||||
<div class="name">{{ item.name }}</div>
|
<div class="name">{{ item.name }}</div>
|
||||||
<div class="btn" @click="chooseTag(index)">添加标签</div>
|
<div class="btn" @click="chooseTag(index)" v-if="!item.parentid">添加标签</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tag-list" v-if="item.tagList && item.tagList.length">
|
<div class="tag-list" v-if="item.tagList && item.tagList.length">
|
||||||
<span v-for="(items, indexs) in item.tagList" :key="indexs">{{items.name}}</span>
|
<span v-for="(items, indexs) in item.tagList" :key="indexs">{{items.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<AiEmpty description="暂未选择组织" v-if="noDept"/>
|
<div class="item" v-for="(item, index) in userList" :key="index">
|
||||||
|
<div class="name-flex">
|
||||||
|
<div class="name">{{ item.name }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bg-144"></div>
|
<div class="bg-144"></div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|||||||
Reference in New Issue
Block a user