Commit 6a74e149 by xinla

朋友圈修改

1 parent b04d94b1
...@@ -6,13 +6,18 @@ export default { ...@@ -6,13 +6,18 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: () => ({ isContain: '1', customerTypes: ['1'] }), default: () => ({ isContain: '1' }),
}, },
// 是否为详情展示(不显示选择按钮) // 是否为详情展示(不显示选择按钮)
isDetail: { isDetail: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
// 是否转换数据
isTrans: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { form: this.data, stageList: [], dialogVisibleSelectUser: false, dialogVisibleSelectTag: false } return { form: this.data, stageList: [], dialogVisibleSelectUser: false, dialogVisibleSelectTag: false }
...@@ -21,12 +26,43 @@ export default { ...@@ -21,12 +26,43 @@ export default {
watch: { watch: {
form: { form: {
deep: true, deep: true,
handler(val) { handler(data) {
this.$emit('update:data', val) data = JSON.parse(JSON.stringify(data))
if (this.isTrans) {
data = {
genders: data.genders?.join(','),
customerTypes: data.customerTypes?.join(','),
tagIds: data.tags?.map((e) => e.tagId)?.join(','),
tagNames: data.tags?.map((e) => e.name)?.join(','),
userIds: data.users?.map((e) => e.userId)?.join(','),
userNames: data.users?.map((e) => e.name)?.join(','),
beginTime: data.dateRange?.[0],
endTime: data.dateRange?.[1],
trackState: data.trackState,
isContain: data.tags?.length ? data.isContain : undefined,
}
}
this.$emit('update:data', data)
}, },
}, },
}, },
created() { created() {
if (this.isTrans) {
let data = this.data
if (data) {
data = JSON.parse(JSON.stringify(data))
let userNames = data.userNames?.split(',')
let tagNames = data.tagNames?.split(',')
this.form = Object.assign(data, {
isContain: data.isContain + '',
genders: data.genders?.split(','),
customerTypes: data.customerTypes?.split(','),
users: data.userIds?.split(',')?.map((e, i) => ({ userId: e, name: userNames?.[i] })),
tags: data.tagIds?.split(',')?.map((e, i) => ({ tagId: e, name: tagNames?.[i] })),
dateRange: [data.beginTime, data.endTime],
})
}
}
this.$emit('update:data', this.data) // 赋默认值 this.$emit('update:data', this.data) // 赋默认值
getList().then((res) => { getList().then((res) => {
this.stageList = res.data this.stageList = res.data
...@@ -48,7 +84,7 @@ export default { ...@@ -48,7 +84,7 @@ export default {
:defaultValues="form.users" :defaultValues="form.users"
@success="(data) => ((form.users = data), $refs.form.validateField('users'))"></SelectUser> @success="(data) => ((form.users = data), $refs.form.validateField('users'))"></SelectUser>
</div> </div>
<TagEllipsis :list="form.users" limit="10"></TagEllipsis> <TagEllipsis :list="form.users" limit="10" :emptyText="isDetail"></TagEllipsis>
</el-form-item> </el-form-item>
<el-form-item label="客户类型" prop="customerTypes"> <el-form-item label="客户类型" prop="customerTypes">
......
...@@ -195,7 +195,7 @@ export default { ...@@ -195,7 +195,7 @@ export default {
}, },
gotoRoute() { gotoRoute() {
this.$router.push({ this.$router.push({
path: '/customerMaintain/friendCircle/publish', path: './publish',
}) })
}, },
setTimeChange(e) { setTimeChange(e) {
...@@ -228,7 +228,7 @@ export default { ...@@ -228,7 +228,7 @@ export default {
// 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型 // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
let type = this.determineType(row) let type = this.determineType(row)
this.$router.push({ this.$router.push({
path: '/customerMaintain/friendCircle/publish', path: './publish',
query: { query: {
type, type,
id: row.id, id: row.id,
...@@ -240,7 +240,7 @@ export default { ...@@ -240,7 +240,7 @@ export default {
// 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型 // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
let type = this.determineType(row) let type = this.determineType(row)
this.$router.push({ this.$router.push({
path: '/customerMaintain/friendCircle/statistics', path: './statistics',
query: { query: {
type, type,
id: row.id, id: row.id,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!