按部门选人

This commit is contained in:
shijingjing
2022-09-02 14:14:55 +08:00
parent 2551827d99
commit da6c0dd07d
3 changed files with 102 additions and 15 deletions

View File

@@ -8,7 +8,11 @@
<div class="send_scope">
<div><span class="color_red">*</span><span class="title">发送范围</span></div>
<div @click="toSleectScoped">
<span>请选择</span><span><u-icon name="arrow-right" color="#CCD0D3"></u-icon></span>
<span>
<span v-if="!form.sendScope">请选择</span>
<span v-if="form.sendScope">已选择</span>
<u-icon name="arrow-right" color="#CCD0D3"></u-icon>
</span>
</div>
</div>
@@ -18,7 +22,7 @@
<div style="color: #3399FF;" @click="preview">预览</div>
</div>
<div class="content_text">
<u-input v-model="content" type="textarea" height="372" :auto-height="true" placeholder="请输入政策、活动、节日问候等内容" />
<u-input v-model="content" type="textarea" height="372" :auto-height="true" placeholder="请输入政策、活动、节日问候等内容" maxlength="1300"/>
</div>
<div class="content_fodder">
<!-- <div style="color: #8E8F91;">添加素材</div> -->
@@ -70,8 +74,10 @@
<div class="file_content" v-for="item in files" :key="item.id">
<img class="text_left" src="https://cdn.cunwuyun.cn/dvcp/announce/avatar.png" />
<img :src="item.url" alt="" v-if="getExtension(item.name) == '.jpg' || getExtension(item.name) == '.jepg'">
<div class="text_right file_right" v-else>
<img class="only_pic" :src="item.url" alt="" v-if="getExtension(item.name) == '.jpg' || getExtension(item.name) == '.jpeg'">
<video controls class="only_video" :src="item.url" v-if="getExtension(item.name) == '.mp4'"></video>
<div class="text_right file_right"
v-if="getExtension(item.name) != '.jpg' && getExtension(item.name) != '.jpeg' && getExtension(item.name) != '.mp4'">
<div class="cont_left">
<h4>{{ item.name }}</h4>
<p>{{ item.fileSizeStr }}</p>
@@ -113,6 +119,7 @@ export default {
choiceTime: '', // 定时发送时间
sendScope: '', // 0全部居民群、1按部门选择、2按网格选择
sendType: '0', // 0立即发送、1定时发送
wxGroups: [],
},
enableExamine: false,
isTimedTask: false,
@@ -129,7 +136,8 @@ export default {
minute: true,
second: true,
timestamp: false,
}
},
flag: false,
}
},
methods: {
@@ -177,6 +185,43 @@ export default {
},
confirm() {
if(this.flag) return
this.form.contents = [
{
content: this.content,
msgType: '0'
},
...this.files
]
if(!this.form.contents.length) {
return this.$u.toast("请输入发送内容")
}
// if(!this.enableExamine) {
// if(!this.form.examines.length) {
// return this.$u.toast("请选择审批人")
// } else {
// this.form.enableExamine = '1'
// }
// }
if(!this.isTimedTask) {
if(!this.form.choiceTime.length) {
return this.$u.toast("请选择发送时间")
}
}
this.$http.post(`/app/appmasssendingtask/addOrUpdate`, { ...this.form }).then(res=>{
this.flag = false
if(res?.code ==0) {
// uni.navigateBack()
this.$u.toast("新增成功")
}
})
},
@@ -198,10 +243,14 @@ export default {
}
},
onShow() {
},
onLoad(o) {
this.type = o.index;
document.title = this.type==0? "群发居民群": this.type==1? "群发居民": "群发朋友圈"
uni.$on('checkedScope', res => {
this.form.sendScope = res.sendScope
})
}
}
</script>
@@ -324,6 +373,15 @@ export default {
width: 84px;
height: 84px;
}
.only_pic {
max-width: 206px;
max-height: 200px;
}
.only_video {
max-width: 284px;
max-height: 160px;
}
.text_right {
width: calc(100% - 116px);
background: #FFF;