This commit is contained in:
yanran200730
2022-05-24 16:31:10 +08:00
parent e7c61c8293
commit 2b8e4dc41d
19 changed files with 255 additions and 72 deletions

View File

@@ -5,24 +5,28 @@
<span>*选择拍摄人后相册只能上传该拍摄人照片</span>
</div>
<div class="cell-group">
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 0">
<div class="cell-item" hover-class="bg-hover" @click="userList = [], currIndex = 0">
<div class="cell-item__left">
<h2>不限</h2>
</div>
<div class="cell-item__check" :class="[currIndex === 0 ? 'active' : '']"></div>
</div>
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 1">
<div class="cell-item" hover-class="bg-hover" @click="toChoose">
<div class="cell-item__left">
<h2>根据条件选择</h2>
</div>
<div class="cell-item__check" :class="[currIndex === 1 ? 'active' : '']"></div>
</div>
</div>
<div class="form-btn" hover-class="text-hover">保存</div>
<div class="user" v-for="(item, index) in userList" :key="index">
<AiOpenData v-if="item" type="userName" :openid="item"></AiOpenData>
</div>
<div class="form-btn" hover-class="text-hover" @click="save">保存</div>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
name: 'PersonnelSetting',
@@ -30,19 +34,65 @@
data () {
return {
currIndex: 0
currIndex: 0,
userList: [],
ticket: '',
count: 0
}
},
onLoad () {
onLoad (query) {
this.getInfo(query.id)
},
methods: {
...mapActions(['selectPrivilegedContact']),
linkTo (url) {
uni.navigateTo({
url
})
},
save () {
if (this.currIndex === 1 && !this.userList.length) {
return this.$u.toast('请选择人员')
}
uni.$emit('change', {
type: 'personnel',
value: this.userList.length ? this.userList : []
})
uni.navigateBack({
delta: 1
})
},
getInfo (id) {
this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.userList = res.data.albumUserList || []
this.currIndex = (res.data.albumUserList && res.data.albumUserList.length) ? 1 : 0
}
})
},
toChoose () {
this.$loading()
this.currIndex = 1
this.selectPrivilegedContact({
fromDepartmentId: 0,
selectedTickets: this.ticket ? [this.ticket] : [],
selectedOpenUserIds: this.userList
}).then(res => {
uni.hideLoading()
this.userList = res.userList.map(e => e.openUserId) || []
this.ticket = res.selectedTicket || ''
console.log(res)
}).catch(() => {
uni.hideLoading()
})
}
}
}
@@ -150,4 +200,4 @@
}
}
}
</style>
</style>