Commit 6411b0c4 by xinla

修复 流失提醒条件查询重置问题

1 parent 2f0feba3
<script> <script>
import { getListNew, exportCustomer, lossRemind, getLossRemindStatus } from '@/api/customer' import { getListNew, exportCustomer, lossRemind, getLossRemindStatus } from '@/api/customer'
// import { getList as getListTag } from '@/api/customer/tag'
// import { getList as getListOrganization } from '@/api/organization'
import SelectTag from '@/components/SelectTag' import SelectTag from '@/components/SelectTag'
...@@ -33,17 +31,9 @@ export default { ...@@ -33,17 +31,9 @@ export default {
weTags: [], weTags: [],
}, },
list: [], // 客户列表 list: [], // 客户列表
listOrganization: [], // 组织架构列表
multipleSelection: [], // 多选数组 multipleSelection: [], // 多选数组
dialogVisible: false, // 选择标签弹窗显隐 dialogVisible: false, // 选择标签弹窗显隐
dialogVisibleSelectUser: false, // 选择添加人弹窗显隐 dialogVisibleSelectUser: false, // 选择添加人弹窗显隐
selectedGroup: '', // 选择的标签分组
selectedTag: [], // 选择的标签
removeTag: [], // 可移除的标签
tagDialogType: {
title: '', // 选择标签弹窗标题
type: '', // 弹窗类型
},
isNotice: '0', isNotice: '0',
} }
}, },
...@@ -51,8 +41,6 @@ export default { ...@@ -51,8 +41,6 @@ export default {
computed: {}, computed: {},
created() { created() {
this.getList() this.getList()
// this.getListTag()
// this.getListOrganization()
this.getLossRemindStatus() this.getLossRemindStatus()
this.$store.setBusininessDesc( this.$store.setBusininessDesc(
...@@ -64,7 +52,6 @@ export default { ...@@ -64,7 +52,6 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
getList(page) { getList(page) {
// console.log(this.dateRange);
if (this.dateRange) { if (this.dateRange) {
this.query.beginTime = this.dateRange[0] this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1] this.query.endTime = this.dateRange[1]
...@@ -72,6 +59,9 @@ export default { ...@@ -72,6 +59,9 @@ export default {
this.query.beginTime = '' this.query.beginTime = ''
this.query.endTime = '' this.query.endTime = ''
} }
this.query.userIds = this.queryUser.map((d) => d.userId)?.join(',')
this.query.tagIds = this.queryTag.map((d) => d.tagId)?.join(',')
page && (this.query.pageNum = page) page && (this.query.pageNum = page)
this.loading = true this.loading = true
getListNew(this.query) getListNew(this.query)
...@@ -85,34 +75,11 @@ export default { ...@@ -85,34 +75,11 @@ export default {
this.loading = false this.loading = false
}) })
}, },
// getListTag() {
// getListTag().then(({ rows }) => {
// this.listTagOneArray = []
// rows.forEach((element) => {
// element.weTags.forEach((d) => {
// this.listTagOneArray.push(d)
// })
// })
// })
// },
// getListOrganization() {
// getListOrganization().then(({ rows }) => {
// this.listOrganization = Object.freeze(rows)
// })
// },
getLossRemindStatus() { getLossRemindStatus() {
getLossRemindStatus().then(({ data }) => { getLossRemindStatus().then(({ data }) => {
this.isNotice = data this.isNotice = data
}) })
}, },
showTagDialog() {
this.selectedTag = this.queryTag
this.tagDialogType = {
title: '选择标签',
type: '1',
}
this.dialogVisible = true
},
// /** 导出按钮操作 */ // /** 导出按钮操作 */
// exportCustomer() { // exportCustomer() {
// const queryParams = this.query // const queryParams = this.query
...@@ -129,18 +96,6 @@ export default { ...@@ -129,18 +96,6 @@ export default {
// }) // })
// .catch(function() {}) // .catch(function() {})
// }, // },
selectedUser(list) {
this.queryUser = list
this.query.userIds = list.map((d) => d.userId) + ''
},
submitSelectTag(selected) {
if (this.tagDialogType.type === '1') {
this.query.tagIds = selected.map((d) => d.tagId) + ''
// debugger;
this.queryTag = selected
this.dialogVisible = false
}
},
resetForm() { resetForm() {
this.dateRange = [] this.dateRange = []
this.queryTag = [] this.queryTag = []
...@@ -148,10 +103,6 @@ export default { ...@@ -148,10 +103,6 @@ export default {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.getList(1) this.getList(1)
}, },
// 多选框选中数据
handleSelectionChange(selection) {
this.multipleSelection = selection
},
// 流失提醒开关事件 // 流失提醒开关事件
remindSwitch(val) { remindSwitch(val) {
lossRemind(val).then(() => { lossRemind(val).then(() => {
...@@ -189,7 +140,7 @@ export default { ...@@ -189,7 +140,7 @@ export default {
align="right"></el-date-picker> align="right"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="标签"> <el-form-item label="标签">
<div class="tag-input" @click="showTagDialog"> <div class="tag-input" @click="dialogVisible = true">
<span class="tag-place" v-if="!queryTag.length">请选择</span> <span class="tag-place" v-if="!queryTag.length">请选择</span>
<template v-else> <template v-else>
<el-tag type="info" v-for="(unit, unique) in queryTag" :key="unique">{{ unit.name }}</el-tag> <el-tag type="info" v-for="(unit, unique) in queryTag" :key="unique">{{ unit.name }}</el-tag>
...@@ -226,13 +177,7 @@ export default { ...@@ -226,13 +177,7 @@ export default {
<!-- v-hasPermi="['customerManage/customer:makeTag']" --> <!-- v-hasPermi="['customerManage/customer:makeTag']" -->
</div> </div>
<el-table <el-table v-loading="loading" ref="multipleTable" :data="list" tooltip-effect="dark">
v-loading="loading"
ref="multipleTable"
:data="list"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" align="center" width="55"></el-table-column> --> <!-- <el-table-column type="selection" align="center" width="55"></el-table-column> -->
<el-table-column label="客户" prop="name" align="center"> <el-table-column label="客户" prop="name" align="center">
<template #default="scope"> <template #default="scope">
...@@ -300,15 +245,13 @@ export default { ...@@ -300,15 +245,13 @@ export default {
</div> </div>
<!-- 选择标签弹窗 --> <!-- 选择标签弹窗 -->
<SelectTag <SelectTag v-model:visible="dialogVisible" :selected="queryTag" @success="(list) => (queryTag = list)"></SelectTag>
v-model:visible="dialogVisible"
:title="tagDialogType.title"
:selected="selectedTag"
:type="tagDialogType.type"
@success="submitSelectTag"></SelectTag>
<!-- 选择添加人弹窗 --> <!-- 选择添加人弹窗 -->
<SelectUser v-model:visible="dialogVisibleSelectUser" title="选择添加人" @success="selectedUser"></SelectUser> <SelectUser
v-model:visible="dialogVisibleSelectUser"
title="选择添加人"
@success="(list) => (queryUser = list)"></SelectUser>
</div> </div>
</template> </template>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!