Commit 09dd9b75 by xuyl

去掉标签管理的Name参数

1 parent 10623846
import { getCustomersList, exportLabelList } from '@/api/modules/tagsManage'
import { getStaffList } from '@/api/modules/clientManage'
import {
getCustomersList,
exportLabelList
} from '@/api/modules/tagsManage'
import {
getStaffList
} from '@/api/modules/clientManage'
export default {
data() {
return {
......@@ -24,15 +29,20 @@ export default {
this.tagHeight = 0
}
this.allListParams = []
this.sopListParams = []
const tagNode = this.$common.utils.deepClone(this.tagCheckItem)
tagNode.forEach(group_item => {
group_item.children.forEach(label_item => {
if (label_item) {
this.allListParams.push({
groupId: group_item.id,
groupName: group_item.name,
// groupName: group_item.name,
groupType: group_item.labelType,
labelId: label_item.id,
// labelName: label_item.name
})
this.sopListParams.push({
labelGroupName: group_item.name,
labelName: label_item.name
})
}
......@@ -71,7 +81,10 @@ export default {
value: item.staffName
}
})
staff.unshift({ label: '全部', value: '' })
staff.unshift({
label: '全部',
value: ''
})
this.$nextTick(() => {
this.tagsPartFormList[id].optionList = staff
......@@ -136,7 +149,9 @@ export default {
//导出
handleExport() {
const params = {
...JSON.parse(JSON.stringify({ tagLists: this.allListParams })),
...JSON.parse(JSON.stringify({
tagLists: this.allListParams
})),
...this.searchForm,
combineType: 2
}
......@@ -154,7 +169,9 @@ export default {
const tagLists = this.$common.utils.deepClone(this.allListParams)
this.userLoading = true
const params = {
...JSON.parse(JSON.stringify({ tagLists })),
...JSON.parse(JSON.stringify({
tagLists
})),
...JSON.parse(JSON.stringify(this.searchForm)),
combineType: 2,
pageSize: this.$refs.viewCustomers.page.pageSize,
......@@ -195,7 +212,10 @@ export default {
const tagCombine = this.allListParams.reduce((prev, cur) => {
const index = prev.findIndex(group => cur.groupId == group.groupId)
if (index == -1) {
return prev.concat({ groupId: cur.groupId, labelIdList: [cur.labelId] })
return prev.concat({
groupId: cur.groupId,
labelIdList: [cur.labelId]
})
} else {
prev[index].labelIdList.push(cur.labelId)
return prev
......
......@@ -615,9 +615,13 @@ export default {
let getDatas = JSON.parse(
JSON.stringify(this.allListParams)
.replace(/groupId/g, 'labelGroupId')
.replace(/groupName/g, 'labelGroupName')
// .replace(/groupName/g, 'labelGroupName')
.replace(/groupType/g, 'labelGroupType')
)
let mergeDatas = getDatas.map((item,index) => {
return {...item,...this.sopListParams[index]}
})
console.log(getDatas)
var params = {
addOrEdit: 'add',
fromPage: '/custom/tagsManage/index',
......@@ -625,7 +629,7 @@ export default {
info: {
// 标签
customerOptType: 3,
labelList: [...getDatas]
labelList: [...mergeDatas]
}
}
this.$common.utils.storage.set('sopInfo', params)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!