Files
dvcp_v2_wxcp_app/src/project/saas/AppCooperationPropaganda/scopedSelect.vue

187 lines
4.3 KiB
Vue
Raw Normal View History

2022-08-31 17:05:17 +08:00
<template>
<div class="scopedSelect">
<div class="item">
<div>添加人</div>
<div @click="selectUser">
2022-09-02 17:47:01 +08:00
<span v-if="selectedUser.length">已选择{{ selectedUser.length }}名成员</span>
<span class="color_gray" v-else>请选择</span>
2022-08-31 17:05:17 +08:00
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
<div class="item">
<div>包含标签</div>
2022-09-01 10:56:40 +08:00
<div @click="toTagsList(0)">
2022-09-02 17:47:01 +08:00
<span class="color_gray">请选择</span>
2022-08-31 17:05:17 +08:00
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
<div class="item">
<div>剔除标签</div>
2022-09-01 10:56:40 +08:00
<div @click="toTagsList(1)">
2022-09-02 17:47:01 +08:00
<span class="color_gray">请选择</span>
2022-08-31 17:05:17 +08:00
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
<div class="item">
<div>添加时间</div>
<div @click="showCalendar = true">
2022-09-02 17:47:01 +08:00
<span v-if="!startTime.length && !endTime.length" class="color_gray">请选择</span>
2022-08-31 17:05:17 +08:00
<span v-if="startTime.length && endTime.length">{{ startTime }} - {{ endTime }}</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</div>
</div>
2022-09-01 16:27:19 +08:00
<div class="items">
<div>性别</div>
<div class="sex">
<span :class="sex == 0? 'active':''" @click="sex = 0">全部</span>
<span :class="sex == 1? 'active':''" @click="sex = 1"></span>
<span :class="sex == 2? 'active':''" @click="sex = 2"></span>
</div>
</div>
2022-08-31 17:05:17 +08:00
<u-calendar v-model="showCalendar" mode="range" @change="selectDate"></u-calendar>
2022-09-02 15:54:19 +08:00
<AiConsole></AiConsole>
2022-08-31 17:05:17 +08:00
<div class="btn">
<div class="submitBtn" @click="submit">确定</div>
</div>
</div>
</template>
<script>
2022-09-02 14:14:55 +08:00
import { mapActions } from "vuex";
2022-08-31 17:05:17 +08:00
export default {
name: "scopedSelect",
data() {
return {
type: "",
showCalendar: false,
startTime: '',
2022-09-01 16:27:19 +08:00
endTime: '',
sex: "0",
2022-09-02 14:14:55 +08:00
userList: [],
2022-09-02 14:47:43 +08:00
userListIds: [],
2022-09-02 17:47:01 +08:00
selectedUser: []
2022-08-31 17:05:17 +08:00
}
},
methods: {
2022-09-02 14:14:55 +08:00
...mapActions(['selectEnterpriseContact']),
2022-08-31 17:05:17 +08:00
// 选人
2022-09-02 10:59:05 +08:00
selectUser() {
2022-09-02 14:14:55 +08:00
if(this.type == "1") { // 部门
this.getDeptUser()
} else if(this.type == "2") { // 网格
uni.navigateTo({url: `./selectGridMember`})
}
},
getDeptUser() {
this.selectEnterpriseContact({
fromDepartmentId: 0,
mode: "multi",
type: ["user"],
selectedUserIds: this.userList?.map(e => e.id)
}).then((res)=>{
2022-09-02 14:47:43 +08:00
if(res?.userList) {
this.userListIds = res.userList.map(e => e.id)
}
2022-09-02 14:14:55 +08:00
}
).catch((err) => {
console.log(err);
})
2022-09-02 10:59:05 +08:00
},
2022-08-31 17:05:17 +08:00
2022-09-01 10:56:40 +08:00
toTagsList(e) {
uni.navigateTo({url: `./tagsList?type=${e}`})
},
2022-08-31 17:05:17 +08:00
// 选包含标签
2022-09-01 10:56:40 +08:00
// selectTags() {},
2022-08-31 17:05:17 +08:00
// 选剔除标签
2022-09-01 10:56:40 +08:00
// deleteTags() {},
2022-08-31 17:05:17 +08:00
// 选时间范围
selectDate(e) {
console.log(e);
this.startTime = e.startDate
this.endTime = e.endDate
},
submit() {}
},
onLoad(o) {
this.type = o.type;
2022-09-02 14:14:55 +08:00
document.title = this.type == 1? '按部门选择':'按网格选择'
2022-09-02 17:47:01 +08:00
uni.$on("pagePicker:custom", res => {
// console.log(res)
this.selectedUser = res
})
2022-08-31 17:05:17 +08:00
}
}
</script>
<style lang="scss" scoped>
.scopedSelect {
.item {
padding: 32px;
box-sizing: border-box;
background: #FFF;
display: flex;
justify-content: space-between;
box-shadow: inset 0px -1px 0px 0px #DDDDDD;
margin-bottom: 8px;
}
2022-09-01 16:27:19 +08:00
.items {
padding: 32px;
box-sizing: border-box;
background: #FFF;
.sex {
margin-top: 32px;
span {
display: inline-block;
width: 30%;
border: 2px solid #CCCCCC;
text-align: center;
padding: 20px 0;
box-sizing: border-box;
margin-right: 16px;
border-radius: 8px;
}
.active {
background: #1365DD;
color: #FFF;
}
}
}
2022-08-31 17:05:17 +08:00
2022-09-02 17:47:01 +08:00
.color_gray {
color: #CCD0D3;
}
2022-08-31 17:05:17 +08:00
.btn {
position: fixed;
bottom: 0;
left: 0;
background: #FFF;
display: flex;
width: 100%;
height: 128px;
padding: 24px 32px;
box-sizing: border-box;
.submitBtn {
flex: 1;
height: 80px;
line-height: 80px;
text-align: center;
border-radius: 8px;
border: 2px solid #CCCCCC;
background: #1365DD;
color: #FFF;
}
}
}
</style>