按部门选人
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from "vuex";
|
||||
export default {
|
||||
name: "scopedSelect",
|
||||
data() {
|
||||
@@ -58,12 +59,36 @@ export default {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
sex: "0",
|
||||
userList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['selectEnterpriseContact']),
|
||||
// 选人
|
||||
selectUser() {
|
||||
uni.navigateTo({url: `./selectGridMember`})
|
||||
if(this.type == "1") { // 部门
|
||||
this.getDeptUser()
|
||||
} else if(this.type == "2") { // 网格
|
||||
uni.navigateTo({url: `./selectGridMember`})
|
||||
}
|
||||
},
|
||||
|
||||
getDeptUser() {
|
||||
this.selectEnterpriseContact({
|
||||
fromDepartmentId: 0,
|
||||
mode: "multi",
|
||||
type: ["user"],
|
||||
// selectedDepartmentIds: this.departList?.map(e => e.id)
|
||||
selectedUserIds: this.userList?.map(e => e.id)
|
||||
}).then((res)=>{
|
||||
console.log(res);
|
||||
// if(res?.departmentList) {
|
||||
// this.departmentId = res.departmentList[0].id
|
||||
// }
|
||||
}
|
||||
).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
},
|
||||
|
||||
toTagsList(e) {
|
||||
@@ -86,7 +111,7 @@ export default {
|
||||
},
|
||||
onLoad(o) {
|
||||
this.type = o.type;
|
||||
document.title = this.type == 0? '按部门选择':'按网格选择'
|
||||
document.title = this.type == 1? '按部门选择':'按网格选择'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,28 +28,32 @@ export default {
|
||||
return {
|
||||
value: '',
|
||||
checkList: [
|
||||
{ name: '全部居民群', checked: true },
|
||||
{ name: '按部门选择', checked: false },
|
||||
{ name: '按网格选择', checked: false }
|
||||
{ name: '全部居民群', checked: true, value: '0'},
|
||||
{ name: '按部门选择', checked: false, value: '1'},
|
||||
{ name: '按网格选择', checked: false, value: '2' }
|
||||
],
|
||||
showContent: false,
|
||||
type: '',
|
||||
deptSelect: [],
|
||||
girdSelect: [],
|
||||
sendScope: '0',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkBtn(e) {
|
||||
this.checkList.forEach(v=> v.checked = false)
|
||||
e.checked = true
|
||||
if(e.name == '按部门选择' || e.name == '按网格选择') {
|
||||
uni.navigateTo({url: `./scopedSelect?type=0`})
|
||||
} else {
|
||||
uni.navigateTo({url: `./scopedSelect?type=1`})
|
||||
if(e.value == '1' || e.value == '2') {
|
||||
uni.navigateTo({url: `./scopedSelect?type=${e.value}`})
|
||||
}
|
||||
this.sendScope = e.value
|
||||
},
|
||||
submit() {
|
||||
uni.navigateBack()
|
||||
uni.navigateBack({
|
||||
success: () => {
|
||||
uni.$emit("checkedScope",{ sendScope: this.sendScope });
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(o) {
|
||||
|
||||
Reference in New Issue
Block a user