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

350 lines
9.5 KiB
Vue
Raw Normal View History

2022-07-12 18:10:42 +08:00
<template>
2022-07-15 16:43:41 +08:00
<div class="AppCooperationPropaganda">
2022-07-13 14:35:20 +08:00
<AiTopFixed>
<div class="search">
<div class="searchBox">
2022-07-25 18:02:40 +08:00
<u-search placeholder="请输入任务名称" v-model="taskTitle" clearabled @search="searchBtn" @clear="taskTitle='',getList()" :show-action="false"></u-search>
2022-07-13 14:35:20 +08:00
</div>
2022-07-15 10:44:31 +08:00
<div class="filterBtn" @click="filterShow = true"><img src="./images/shaixuan.png" alt="">筛选</div>
2022-07-13 14:35:20 +08:00
</div>
</AiTopFixed>
2022-07-15 13:52:11 +08:00
<div class="resident_list" v-if="list.length">
2022-07-15 14:48:27 +08:00
<div class="card" @click="toDetail(item)" v-for="(item,index) in list" :key="index">
2022-07-13 14:35:20 +08:00
<div class="card_title">
2022-07-15 13:52:11 +08:00
<div class="card_left">{{ item.taskTitle }}</div>
<div class="card_right"><span :class="item.status==0? 'status0': item.status==1? 'status1': item.status==2? 'status2':
item.status == 3? 'status3':item.status==4? 'status4': 'status5'"></span>{{ $dict.getLabel('mstStatus', item.status) }}</div>
2022-07-13 14:35:20 +08:00
</div>
2022-07-28 10:01:49 +08:00
<div>群发时间<span>{{ item.choiceTime }}</span></div>
2022-07-20 17:00:46 +08:00
<div>共需<span class="num">{{ item.groupOwnerCount || 0 }}</span>名成员完成群发目前已完成<span class="num">{{ item.completionRate || 0 }}%</span></div>
<div>
创建部门
2022-08-01 10:23:58 +08:00
<span v-if="item.createUserDept">/<AiOpenData type="departmentName" :openid="item.createUserDept" style="display: inline-block" /></span>
<!-- <span v-if="item.createUserSecondDept"><AiOpenData type="departmentName" :openid="item.createUserSecondDept" style="display: inline-block" /></span> -->
2022-07-20 17:00:46 +08:00
</div>
2022-07-13 14:35:20 +08:00
</div>
</div>
2022-07-15 13:52:11 +08:00
<AiEmpty description="暂无数据" v-if="!list.length"/>
2022-07-15 10:44:31 +08:00
<u-popup v-model="filterShow" mode="bottom" border-radius="14">
<div class="popup">
<div class="tips"></div>
<div class="title">
<div
class="cancel"
@click.stop="(filterShow = false), (timeSelect = 0)"
>
取消
</div>
<p>筛选条件</p>
<div class="confirm" @click.stop="selectConfirm">确定</div>
</div>
<scroll-view class="select-content" scroll-y="true">
<div class="type-list">
<div class="type-title">创建人</div>
2022-07-25 18:02:40 +08:00
<AiPagePicker type="custom" :selected.sync="userIdList" nodeKey="createUserId" :ops="{url:`./selectUser`,label: 'id'}">
2022-07-20 17:00:46 +08:00
<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>
2022-07-15 10:44:31 +08:00
</div>
<div class="type-list">
<div class="type-title">群发时间</div>
<div class="item">
<div>开始时间</div>
<div style="display: flex;">
<u-input v-model="startTime" disabled placeholder="请选择开始时间" @click="showStart = true" />
<u-icon name="arrow-right"></u-icon>
</div>
</div>
<div class="item">
<div>结束时间</div>
<div style="display: flex;">
<u-input v-model="endTime" disabled placeholder="请选择开始时间" @click="showEnd = true" />
<u-icon name="arrow-right"></u-icon>
</div>
</div>
</div>
</scroll-view>
<u-picker mode="time" v-model="showStart" @confirm="confirmStart"></u-picker>
<u-picker mode="time" v-model="showEnd" @confirm="confirmEnd"></u-picker>
<div class="popBtn">
<div @click="reset">重置</div>
<div @click="selectConfirm">确认</div>
</div>
</div>
</u-popup>
2022-07-13 14:35:20 +08:00
</div>
2022-07-12 18:10:42 +08:00
</template>
<script>
export default {
2022-07-15 16:43:41 +08:00
name: 'AppCooperationPropaganda',
appName: '协同宣发',
2022-07-12 18:10:42 +08:00
data() {
return {
current: 1,
2022-07-14 15:40:57 +08:00
name: '',
list: [],
2022-07-15 10:44:31 +08:00
filterShow: false,
startTime: '',
endTime: '',
2022-07-15 13:52:11 +08:00
start: "",
end: "",
2022-07-15 10:44:31 +08:00
showStart: false,
showEnd: false,
2022-07-15 13:52:11 +08:00
taskTitle: '',
2022-07-25 18:02:40 +08:00
createUserId: '',
2022-07-20 17:00:46 +08:00
userList: [],
userIdList: []
2022-07-12 18:10:42 +08:00
}
},
2022-07-13 16:59:58 +08:00
methods: {
2022-07-15 14:48:27 +08:00
toDetail(item) {
2022-07-15 16:43:41 +08:00
uni.navigateTo({url: `./cooperationDetail?id=${item.id}&time=${item.createTime}`})
2022-07-14 15:40:57 +08:00
},
2022-07-15 13:52:11 +08:00
searchBtn() {
this.current = 1
this.list = [],
this.getList()
},
2022-07-14 15:40:57 +08:00
getList() {
this.$http.post(`/app/appmasssendingtask/list`, null, {
params: {
current: this.current,
2022-07-15 13:52:11 +08:00
taskTitle: this.taskTitle,
startTime: this.start,
endTime: this.end,
2022-07-25 18:02:40 +08:00
createUserId: this.createUserId,
2022-07-14 15:40:57 +08:00
}
}).then(res=> {
if(res?.data) {
2022-07-28 08:51:57 +08:00
this.list = this.current == 1? res.data.records : [...this.list,...res.data.records]
2022-07-14 15:40:57 +08:00
}
})
2022-07-15 10:44:31 +08:00
},
2022-07-15 10:44:31 +08:00
reset() {
2022-07-25 18:02:40 +08:00
this.start = '',
this.end = '',
2022-07-15 10:44:31 +08:00
this.startTime = '',
2022-07-25 18:02:40 +08:00
this.endTime = ''
2022-07-20 17:00:46 +08:00
this.userIdList = []
2022-07-26 10:32:07 +08:00
this.createUserId = ''
2022-07-27 11:04:00 +08:00
uni.setStorageSync('userSelect', [])
2022-07-15 10:44:31 +08:00
},
2022-07-25 09:11:26 +08:00
2022-07-15 13:52:11 +08:00
selectConfirm() {
2022-07-22 17:40:34 +08:00
if(this.userIdList.length) {
2022-07-25 18:02:40 +08:00
this.createUserId = this.userIdList?.[0].userId
2022-07-22 17:40:34 +08:00
}
2022-07-15 13:52:11 +08:00
this.start = this.startTime,
this.end = this.endTime
let startTmp = this.start.split("-");
let endTmp = this.end.split("-");
let stT = new Date(startTmp[0], startTmp[1], startTmp[2]);
let edT = new Date(endTmp[0], endTmp[1], endTmp[2]);
2022-07-26 13:48:13 +08:00
if (stT.getTime() > edT.getTime()) {
this.$u.toast("开始日期不能大于结束日期!");
this.filterShow = true
return
}
2022-07-15 13:52:11 +08:00
this.filterShow = false
2022-07-25 18:02:40 +08:00
this.current = 1
this.list = []
2022-07-15 13:52:11 +08:00
this.getList()
},
2022-07-15 10:44:31 +08:00
confirmStart(val) {
this.startTime = val.year + '-' + val.month + '-' + val.day
},
confirmEnd(val) {
this.endTime = val.year + '-' + val.month + '-' + val.day
},
2022-07-13 16:59:58 +08:00
},
2022-07-13 14:35:20 +08:00
onShow() {
2022-08-01 10:11:58 +08:00
document.title = '协同宣发'
2022-07-25 18:02:40 +08:00
this.$dict.load(['mstStatus']).then(() => {
2022-07-27 14:58:36 +08:00
this.list = []
this.current = 1
2022-07-15 13:52:11 +08:00
this.getList()
})
2022-07-13 14:35:20 +08:00
},
2022-07-12 18:10:42 +08:00
onReachBottom() {
this.current ++
2022-07-15 10:44:31 +08:00
this.getList()
2022-07-12 18:10:42 +08:00
},
}
</script>
<style lang="scss" scoped>
2022-07-15 16:43:41 +08:00
.AppCooperationPropaganda {
2022-07-13 14:35:20 +08:00
.search {
display: flex;
height: 80px;
align-items: center;
justify-content: space-between;
.searchBox {
width: 562px;
}
.filterBtn {
2022-07-14 15:40:57 +08:00
img {
width: 28px;
height: 28px;
}
2022-07-13 14:35:20 +08:00
}
}
.resident_list {
padding: 24px 32px 20px 32px;
box-sizing: border-box;
.card {
background: #FFF;
border-radius: 16px;
padding: 30px;
2022-07-14 15:40:57 +08:00
margin-bottom: 24px;
2022-07-13 14:35:20 +08:00
& > div {
padding: 10px 0;
}
.num {
color: #3AA0FF;
}
.card_title {
display: flex;
justify-content: space-between;
.card_left {
font-size: 32px;
color: #000000;
font-weight: 600;
}
.card_right {
span {
display: inline-block;
width: 16px;
height: 16px;
2022-07-15 13:52:11 +08:00
// background: #3399FF;
2022-07-13 14:35:20 +08:00
border-radius: 50%;
margin-right: 10px;
}
2022-07-15 13:52:11 +08:00
.status0 {
2022-07-27 15:39:14 +08:00
background: #FFA938;
2022-07-15 13:52:11 +08:00
}
.status1 {
2022-07-27 15:39:14 +08:00
background: #FF6758;
2022-07-15 13:52:11 +08:00
}
.status2 {
background: #3399FF;
}
.status3 {
2022-07-27 15:39:14 +08:00
background: #FF6758;
2022-07-15 13:52:11 +08:00
}
.status4 {
2022-07-27 15:39:14 +08:00
background: #3399FF;
2022-07-15 13:52:11 +08:00
}
.status5 {
2022-07-27 15:39:14 +08:00
background: #1CCEB0;
2022-07-15 13:52:11 +08:00
}
.status6 {
2022-07-27 15:39:14 +08:00
background: #666666;
2022-07-15 13:52:11 +08:00
}
2022-07-13 14:35:20 +08:00
}
}
}
}
2022-07-15 10:44:31 +08:00
.popup {
box-sizing: border-box;
// height: 800px;
.tips {
width: 80px;
height: 6px;
background: #dddddd;
border-radius: 4px;
padding: 0 32px;
box-sizing: border-box;
margin: 32px auto 8px auto;
}
.title {
height: 48px;
line-height: 48px;
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #222;
padding: 0 32px;
box-sizing: border-box;
padding-bottom: 32px;
.cancel {
display: inline-block;
width: 200px;
color: #aaa;
}
.confirm {
display: inline-block;
width: 200px;
text-align: right;
color: #333;
}
p {
display: inline-block;
width: calc(100% - 400px);
text-align: center;
font-size: 28px;
}
}
.select-content {
height: calc(100% - 100px);
overflow-y: scroll;
}
.type-list {
padding: 0 32px;
box-sizing: border-box;
margin-bottom: 32px;
.type-title {
line-height: 108px;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
}
.item {
display: flex;
justify-content: space-between;
& > div:last-child {
::v-deep .uni-input-input,
::v-deep .uni-input-placeholder {
text-align: right;
}
}
}
.active {
background: #1365dd;
color: #fff;
}
2022-07-20 17:00:46 +08:00
.user {
display: flex;
justify-content: space-between;
}
2022-07-15 10:44:31 +08:00
}
.popBtn {
display: flex;
height: 98px;
line-height: 98px;
div {
width: 50%;
border: 2px solid #3399ff;
text-align: center;
}
div:first-child {
color: #3399ff;
}
div:last-child {
color: #fff;
background: #3399ff;
}
}
}
2022-07-15 13:52:11 +08:00
2022-07-13 14:35:20 +08:00
}
2022-07-12 18:10:42 +08:00
</style>