标签问题
This commit is contained in:
@@ -61,7 +61,6 @@
|
|||||||
<div @click="getDeptUser">
|
<div @click="getDeptUser">
|
||||||
<span v-if="!form.examines.length" class="color_gray">请选择<u-icon name="arrow-right" color="#CCD0D3"></u-icon></span>
|
<span v-if="!form.examines.length" class="color_gray">请选择<u-icon name="arrow-right" color="#CCD0D3"></u-icon></span>
|
||||||
<span v-else>已选择{{ form.examines.length }}名人员</span>
|
<span v-else>已选择{{ form.examines.length }}名人员</span>
|
||||||
<!-- <AiOpenData type="departmentName" :openid="departmentId"/> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="examineChange">
|
<div class="examineChange">
|
||||||
@@ -176,8 +175,10 @@ export default {
|
|||||||
sendType: '0', // 0:立即发送、1:定时发送
|
sendType: '0', // 0:立即发送、1:定时发送
|
||||||
gender: '', // 性别:0-女、1-男、2-全部
|
gender: '', // 性别:0-女、1-男、2-全部
|
||||||
filterCriteria: '',
|
filterCriteria: '',
|
||||||
filterTags: [], //过滤标签id集合
|
filterTags: '', //过滤标签id集合
|
||||||
excludeFilterTags: [], // 剔除标签集合
|
filterTagsName: '', //过滤标签名称
|
||||||
|
excludeFilterTags: '', // 剔除标签id集合
|
||||||
|
excludeFilterTagsName: '', // 剔除标签名称
|
||||||
addFromTime: '',
|
addFromTime: '',
|
||||||
addEndTime: '',
|
addEndTime: '',
|
||||||
taskEndTime: '', // 任务结束时间
|
taskEndTime: '', // 任务结束时间
|
||||||
@@ -425,17 +426,13 @@ export default {
|
|||||||
|
|
||||||
if(this.type=='Residents' || this.type=='CircleOfFriends') {
|
if(this.type=='Residents' || this.type=='CircleOfFriends') {
|
||||||
this.forms.contents = this.form.contents
|
this.forms.contents = this.form.contents
|
||||||
|
this.forms.taskTitle = this.form.taskTitle
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.form.taskTitle) {
|
if(!this.form.taskTitle) {
|
||||||
return this.$u.toast('请输入任务名称')
|
return this.$u.toast('请输入任务名称')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.type=='Residents' || this.type=='CircleOfFriends') {
|
|
||||||
this.forms.taskTitle = this.form.taskTitle
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.form.sendScope) {
|
if(!this.form.sendScope) {
|
||||||
return this.$u.toast('请选择发送范围')
|
return this.$u.toast('请选择发送范围')
|
||||||
}
|
}
|
||||||
@@ -485,9 +482,6 @@ export default {
|
|||||||
let url = ''
|
let url = ''
|
||||||
if(this.type=='CircleOfFriends' || this.type=='Residents') { //群发朋友圈、居民
|
if(this.type=='CircleOfFriends' || this.type=='Residents') { //群发朋友圈、居民
|
||||||
url = `/app/whchatmomentstask/addOrUpdate`
|
url = `/app/whchatmomentstask/addOrUpdate`
|
||||||
this.forms.filterCriteria = this.girdListIds.toString() || this.deptListIds.toString() || ''
|
|
||||||
this.forms.filterTags = this.ResidentTags.toString() || this.circleTags.toString() || ''
|
|
||||||
this.forms.excludeFilterTags = this.ResidentTagsRemove.toString() || this.circleTagsRemove.toString() || ''
|
|
||||||
this.forms.gender = this.sex
|
this.forms.gender = this.sex
|
||||||
this.forms.addFromTime = this.startTime
|
this.forms.addFromTime = this.startTime
|
||||||
this.forms.addEndTime = this.endTime
|
this.forms.addEndTime = this.endTime
|
||||||
@@ -520,10 +514,10 @@ export default {
|
|||||||
uni.removeStorageSync('girdSelect')
|
uni.removeStorageSync('girdSelect')
|
||||||
uni.removeStorageSync('deptList')
|
uni.removeStorageSync('deptList')
|
||||||
uni.removeStorageSync('sendScope')
|
uni.removeStorageSync('sendScope')
|
||||||
uni.removeStorageSync('ResidentTags')
|
uni.removeStorageSync('ResidentTags') // 居民包含
|
||||||
uni.removeStorageSync('ResidentTagsRemove')
|
uni.removeStorageSync('ResidentTagsRemove') // 居民剔除
|
||||||
uni.removeStorageSync('circleTags')
|
uni.removeStorageSync('circleTags') // 朋友圈包含
|
||||||
uni.removeStorageSync('circleTagsRemove')
|
uni.removeStorageSync('circleTagsRemove') // 朋友圈剔除
|
||||||
uni.removeStorageSync('startTime')
|
uni.removeStorageSync('startTime')
|
||||||
uni.removeStorageSync('endTime')
|
uni.removeStorageSync('endTime')
|
||||||
},
|
},
|
||||||
@@ -597,12 +591,26 @@ export default {
|
|||||||
// 性别
|
// 性别
|
||||||
this.sex = uni.getStorageSync('gender')
|
this.sex = uni.getStorageSync('gender')
|
||||||
// 标签
|
// 标签
|
||||||
if(this.sendType == 'Residents') {
|
if(this.type == 'Residents') {
|
||||||
this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含
|
this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含
|
||||||
this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除
|
this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除
|
||||||
} else if(this.sendType == 'CircleOfFriends') {
|
if(this.ResidentTags.length) {
|
||||||
|
this.forms.filterTags = this.ResidentTags.map(e=> e.id).toString()
|
||||||
|
this.forms.filterTagsName = this.ResidentTags.map(e=> e.name).toString()
|
||||||
|
} else if(this.ResidentTagsRemove) {
|
||||||
|
this.forms.excludeFilterTags = this.ResidentTagsRemove.map(e=> e.id).toString()
|
||||||
|
this.forms.excludeFilterTagsName = this.ResidentTagsRemove.map(e=> e.name).toString()
|
||||||
|
}
|
||||||
|
} else if(this.type == 'CircleOfFriends') {
|
||||||
this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含
|
this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含
|
||||||
this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除
|
this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除
|
||||||
|
if(this.circleTags.length) {
|
||||||
|
this.forms.filterTags = this.circleTags.map(e=> e.id).toString()
|
||||||
|
this.forms.filterTagsName = this.circleTags.map(e=> e.name).toString()
|
||||||
|
} else if(this.circleTagsRemove.length) {
|
||||||
|
this.forms.excludeFilterTags = this.circleTagsRemove.map(e=> e.id).toString()
|
||||||
|
this.forms.excludeFilterTagsName = this.circleTagsRemove.map(e=> e.name).toString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 时间
|
// 时间
|
||||||
this.startTime = uni.getStorageSync('startTime')
|
this.startTime = uni.getStorageSync('startTime')
|
||||||
|
|||||||
@@ -58,7 +58,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions } from "vuex";
|
import { mapActions } from "vuex";
|
||||||
export default {
|
export default {
|
||||||
@@ -117,7 +116,6 @@ export default {
|
|||||||
this.endTime = e.endDate
|
this.endTime = e.endDate
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
console.log(this.deptListArr, 'deptListArr')
|
|
||||||
uni.setStorageSync('gender',this.sex)
|
uni.setStorageSync('gender',this.sex)
|
||||||
uni.setStorageSync('startTime', this.startTime)
|
uni.setStorageSync('startTime', this.startTime)
|
||||||
uni.setStorageSync('endTime', this.endTime)
|
uni.setStorageSync('endTime', this.endTime)
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ export default {
|
|||||||
deptListIds: [],
|
deptListIds: [],
|
||||||
wxGroups: [], // 居民群,居民,朋友圈
|
wxGroups: [], // 居民群,居民,朋友圈
|
||||||
sex: '',
|
sex: '',
|
||||||
circleTags: '',
|
ResidentTags: [],
|
||||||
ResidentTags: '',
|
ResidentTagsRemove: [],
|
||||||
ResidentTagsRemove: '',
|
circleTags: [],
|
||||||
circleTagsRemove: '',
|
circleTagsRemove: [],
|
||||||
startTime: '',
|
startTime: '',
|
||||||
endTime: '',
|
endTime: '',
|
||||||
}
|
}
|
||||||
@@ -95,11 +95,22 @@ export default {
|
|||||||
taskType: this.sendType == 'Residents'? 1:0,
|
taskType: this.sendType == 'Residents'? 1:0,
|
||||||
}
|
}
|
||||||
} else if(this.sendScope == 1 || this.sendScope == 2) {
|
} else if(this.sendScope == 1 || this.sendScope == 2) {
|
||||||
|
let resTags='', cirTags='', resRemove='', cirRemove=''
|
||||||
|
if(this.ResidentTags.length) {
|
||||||
|
resTags = this.ResidentTags?.map(e=> e.id).toString()
|
||||||
|
} else if(this.circleTags.length) {
|
||||||
|
cirTags = this.circleTags?.map(e=> e.id).toString()
|
||||||
|
} else if(this.ResidentTagsRemove.length) {
|
||||||
|
resRemove = this.ResidentTagsRemove?.map(e=> e.id).toString() || ''
|
||||||
|
} else if(this.circleTagsRemove.length) {
|
||||||
|
cirRemove = this.circleTagsRemove?.map(e=> e.id).toString() || ''
|
||||||
|
}
|
||||||
|
|
||||||
formData = {
|
formData = {
|
||||||
filterCriteria: this.girdListIds.toString() || this.deptListIds.toString() || '',
|
filterCriteria: this.girdListIds.toString() || this.deptListIds.toString() || '',
|
||||||
sendScope: this.sendScope,
|
sendScope: this.sendScope,
|
||||||
tags: this.ResidentTags || this.circleTags || '',
|
tags: resTags || cirTags,
|
||||||
excludeTags: this.ResidentTagsRemov || this.circleTagsRemove || '',
|
excludeTags: resRemove || cirRemove,
|
||||||
addFromTime: this.startTime,
|
addFromTime: this.startTime,
|
||||||
addEndTime: this.endTime,
|
addEndTime: this.endTime,
|
||||||
gender: this.sex,
|
gender: this.sex,
|
||||||
@@ -142,11 +153,11 @@ export default {
|
|||||||
this.sex = uni.getStorageSync('gender')
|
this.sex = uni.getStorageSync('gender')
|
||||||
// 标签
|
// 标签
|
||||||
if(this.sendType == 'Residents') {
|
if(this.sendType == 'Residents') {
|
||||||
this.ResidentTags = uni.getStorageSync('ResidentTags').toString() // 居民包含
|
this.ResidentTags = uni.getStorageSync('ResidentTags') // 居民包含
|
||||||
this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove').toString() // 居民剔除
|
this.ResidentTagsRemove = uni.getStorageSync('ResidentTagsRemove') // 居民剔除
|
||||||
} else if(this.sendType == 'CircleOfFriends') {
|
} else if(this.sendType == 'CircleOfFriends') {
|
||||||
this.circleTags = uni.getStorageSync('circleTags').toString() // 朋友圈包含
|
this.circleTags = uni.getStorageSync('circleTags') // 朋友圈包含
|
||||||
this.circleTagsRemove = uni.getStorageSync('circleTagsRemove').toString() // 朋友圈剔除
|
this.circleTagsRemove = uni.getStorageSync('circleTagsRemove') // 朋友圈剔除
|
||||||
}
|
}
|
||||||
// 时间
|
// 时间
|
||||||
this.startTime = uni.getStorageSync('startTime')
|
this.startTime = uni.getStorageSync('startTime')
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
<div class="tags-list" v-for="items in subTags" :key="items.id">
|
<div class="tags-list" v-for="items in subTags" :key="items.id">
|
||||||
<div class="tag_title">{{ items.name }}</div>
|
<div class="tag_title">{{ items.name }}</div>
|
||||||
<div class="item"
|
<div class="item"
|
||||||
v-for="(item, index) in items.tagList"
|
v-for="item in items.tagList"
|
||||||
:class="[checked.includes(item.id) ? 'active' : '']"
|
:class="checked.map(e=>e.id).includes(item.id)? 'active' : ''"
|
||||||
:key="index"
|
:key="item.id"
|
||||||
@click="onClick(item.id)">
|
@click="onClick(item)">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -37,24 +37,15 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onClick(id) {
|
onClick(item) {
|
||||||
const index = this.checked.indexOf(id)
|
const index = this.checked.map(i=>i.id).indexOf(item.id)
|
||||||
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
this.checked.push(id)
|
this.checked.push(item)
|
||||||
} else {
|
} else {
|
||||||
this.checked.splice(index, 1)
|
this.checked.splice(index, 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
// if (!this.checked.length) {
|
|
||||||
// return this.$u.toast('请选择标签')
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const list = this.subTags.filter(v => {
|
|
||||||
// return this.checked.includes(v.id)
|
|
||||||
// })
|
|
||||||
|
|
||||||
if(this.sendType == 'Residents') {
|
if(this.sendType == 'Residents') {
|
||||||
if(this.type == '0') { // 居民包含
|
if(this.type == '0') { // 居民包含
|
||||||
uni.setStorageSync('ResidentTags', this.checked)
|
uni.setStorageSync('ResidentTags', this.checked)
|
||||||
|
|||||||
Reference in New Issue
Block a user