选择创建人

This commit is contained in:
shijingjing
2022-07-20 17:00:46 +08:00
parent dfc81b1746
commit d3755fcf91
9 changed files with 263 additions and 8 deletions

View File

@@ -16,8 +16,12 @@
item.status == 3? 'status3':item.status==4? 'status4': 'status5'"></span>{{ $dict.getLabel('mstStatus', item.status) }}</div> item.status == 3? 'status3':item.status==4? 'status4': 'status5'"></span>{{ $dict.getLabel('mstStatus', item.status) }}</div>
</div> </div>
<div>创建时间<span>{{ item.createTime }}</span></div> <div>创建时间<span>{{ item.createTime }}</span></div>
<div>共需<span class="num">{{ item.groupOwnerCount }}</span>名成员完成群发目前已完成<span class="num">{{ item.completionRate || 0 }}%</span></div> <div>共需<span class="num">{{ item.groupOwnerCount || 0 }}</span>名成员完成群发目前已完成<span class="num">{{ item.completionRate || 0 }}%</span></div>
<div>创建部门<span>{{ item.createUserDept }}</span></div> <div>
创建部门
<span v-if="item.createUserId">/<AiOpenData type="departmentName" :openid="item.createUserId" style="display: inline-block" /></span>
<span v-if="item.createUserSecondDept">/<AiOpenData type="departmentName" :openid="item.createUserSecondDept" style="display: inline-block" /></span>
</div>
</div> </div>
</div> </div>
<AiEmpty description="暂无数据" v-if="!list.length"/> <AiEmpty description="暂无数据" v-if="!list.length"/>
@@ -37,7 +41,11 @@
<scroll-view class="select-content" scroll-y="true"> <scroll-view class="select-content" scroll-y="true">
<div class="type-list"> <div class="type-list">
<div class="type-title">创建人</div> <div class="type-title">创建人</div>
<AiPagePicker class="select" type="sysUser" :selected.sync="createUserId">选择人员</AiPagePicker> <AiPagePicker type="custom" :selected.sync="userIdList" nodeKey="userId" :ops="{url:`./selectUser`,label: 'id'}">
<span class="label" v-if="userIdList.length">已选择</span>
<span v-else style="color:#999;">请选择</span>
<u-icon name="arrow-right" color="#999" size="24" style="margin-left:8px;"/>
</AiPagePicker>
</div> </div>
<div class="type-list"> <div class="type-list">
<div class="type-title">群发时间</div> <div class="type-title">群发时间</div>
@@ -85,7 +93,9 @@ export default {
showStart: false, showStart: false,
showEnd: false, showEnd: false,
taskTitle: '', taskTitle: '',
createUserId: [], userId: '',
userList: [],
userIdList: []
} }
}, },
methods: { methods: {
@@ -102,7 +112,7 @@ export default {
params: { params: {
current: this.current, current: this.current,
taskTitle: this.taskTitle, taskTitle: this.taskTitle,
createUserId: this.createUserId, createUserId: this.userId,
startTime: this.start, startTime: this.start,
endTime: this.end, endTime: this.end,
} }
@@ -110,15 +120,17 @@ export default {
if(res?.data) { if(res?.data) {
this.list = this.current == 1? res.data.records : [...res.data.records, ...this.list] this.list = this.current == 1? res.data.records : [...res.data.records, ...this.list]
} }
// console.log(res);
}) })
}, },
reset() { reset() {
this.startTime = '', this.startTime = '',
this.endTime = '' this.endTime = '',
this.userIdList = []
// uni.clearStorageSync('selected')
}, },
selectConfirm() { selectConfirm() {
this.userId = this.userIdList?.[0].userId,
this.start = this.startTime, this.start = this.startTime,
this.end = this.endTime this.end = this.endTime
let startTmp = this.start.split("-"); let startTmp = this.start.split("-");
@@ -141,6 +153,7 @@ export default {
}, },
}, },
onShow() { onShow() {
this.getList()
document.title = '群发居民群' document.title = '群发居民群'
this.$dict.load('mstStatus').then(() => { this.$dict.load('mstStatus').then(() => {
this.getList() this.getList()
@@ -298,6 +311,10 @@ export default {
background: #1365dd; background: #1365dd;
color: #fff; color: #fff;
} }
.user {
display: flex;
justify-content: space-between;
}
} }
.popBtn { .popBtn {
display: flex; display: flex;

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 373 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,239 @@
<template>
<section class="selectUser">
<div class="header-middle">
<div class="userCards" v-for="e in userList" :key="e.id">
<div class="imges">
<div class="imgselect" :class="{checked:e.isChecked}" @click.stop="itemCheck(e)" />
<img src="./images/tx@2x.png" alt="" class="avatras"/>
</div>
<div class="rights fill">
<div class="applicationNames">
<AiOpenData type="userName" :openid="e.id"/>
</div>
</div>
</div>
<AiEmpty description="暂无数据" v-if="!hasData"/>
</div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</section>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: "selectUser",
appName: "选择创建人",
data() {
return {
selected: [],
userList: [],
}
},
computed: {
...mapState(['user']),
hasData() {
return this.userList?.length > 0
}
},
onLoad() {
this.selected = uni.getStorageSync('userSelect') || []
this.getDeptsAndUsersByParent()
},
methods: {
isSelected(id) {
return !!this.selected.find(e => e.id == id)
},
getDeptsAndUsersByParent() {
this.userList = []
this.$http.post(`/app/appmasssendingtask/list`, null, {
params: {}
}).then(res => {
if (res?.data) {
this.userList = res.data.records.map(e => ({userId: e.createUserId, isChecked: this.isSelected(e.id)}))
console.log(this.userList, '123456');
}
})
},
itemCheck(row) {
row.isChecked = !row.isChecked
if (row.isChecked) {
this.selected[0] = row
}
console.log(this.selected, '胡很顾及到凤凰国际');
// else {
// let index = this.selected.findIndex(e => e.id == row.id)
// this.selected.splice(index, 1)
// }
this.$forceUpdate()
},
submit() {
if(!this.selected.length) {
return this.$u.toast('请选择创建人')
}
uni.$emit("pagePicker:custom", this.selected)
uni.setStorageSync('userSelect', this.selected)
uni.navigateBack()
},
}
}
</script>
<style lang="scss" scoped>
.selectUser {
height: 100%;
background: #fff;
.header-top {
background: #fff;
padding: 20px 32px;
}
.header-middle {
padding-bottom: 140px;
.hint {
padding: 28px 20px 28px 32px;
line-height: 56px;
box-shadow: 0 1px 0 0 #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.empty-div {
height: 16px;
background: #f5f5f5;
}
.imges {
display: flex;
align-items: center;
.imgselect {
width: 48px;
height: 48px;
vertical-align: middle;
background-image: url("./images/xz.png");
background-position: center;
background-size: 100% 100%;
&.checked {
background-image: url("./images/xzh.png");
}
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
width: calc(100% - 160px);
display: flex;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
.applicationNames {
flex: 1;
min-width: 0;
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.imgs {
flex-shrink: 0;
width: 40px;
height: 40px;
margin-right: 20px;
}
}
}
.userCards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
.rights {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
padding-right: 40px;
height: inherit;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.idNumbers {
color: #666;
}
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin: 20px 34px 0 0;
float: right;
}
}
.color-3F8DF5 {
color: #3F8DF5;
}
.mar-h4 {
margin: 0 4px;
}
}
</style>

View File

@@ -144,7 +144,6 @@
<AiOpenData type="departmentName" :openid="departmentId"/> <AiOpenData type="departmentName" :openid="departmentId"/>
</div> </div>
<div v-if="!departmentId">请选择部门</div> <div v-if="!departmentId">请选择部门</div>
<!-- <input type="text" placeholder="请选择部门" :value="department" disabled /> -->
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</div> </div>
</div> </div>