Commit b786080d by xinla

新客拉群等升级优化

1 parent 54ec7e9b
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
ref="pagination" ref="pagination"
v-if="['false', 'undefined'].includes($attrs['hide-on-single-page'] + '') || $attrs.total > limit"> v-if="['false', 'undefined'].includes($attrs['hide-on-single-page'] + '') || $attrs.total > limit">
<el-pagination <el-pagination
v-bind="$attrs" v-bind="Object.assign({}, this.$attrs, { style: undefined, class: undefined })"
:background="background" :background="background"
v-model:current-page="currentPage" v-model:current-page="currentPage"
v-model:page-size="pageSize" v-model:page-size="pageSize"
......
...@@ -165,6 +165,7 @@ export default { ...@@ -165,6 +165,7 @@ export default {
<slot :data="data"></slot> <slot :data="data"></slot>
<pagination <pagination
style="margin-bottom: -20px"
:total="total" :total="total"
v-model:page="query.pageNum" v-model:page="query.pageNum"
v-model:limit="query.pageSize" v-model:limit="query.pageSize"
......
...@@ -37,10 +37,11 @@ ...@@ -37,10 +37,11 @@
// } // }
.el-button:not(.el-button--small, .el-button--large) { .el-button:not(.el-button--small, .el-button--large) {
padding: 9px 19px; padding: 9px 19px;
}
.el-button:not(.is-text) {
font-size: 13px; font-size: 13px;
} }
.el-button.is-circle {
padding: 9px;
}
.el-button:not(.is-text, .is-circle, .is-round) { .el-button:not(.is-text, .is-circle, .is-round) {
border-radius: var(--border-radius-small); border-radius: var(--border-radius-small);
} }
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
height: auto; height: auto;
font-size: 12px; font-size: 13px;
background-clip: content-box; background-clip: content-box;
outline: 0 !important; outline: 0 !important;
} }
...@@ -348,6 +349,7 @@ ...@@ -348,6 +349,7 @@
// 表单禁用详情数据展示 // 表单禁用详情数据展示
.form-detail { .form-detail {
.el-input.is-disabled .el-input__inner, .el-input.is-disabled .el-input__inner,
.el-input.is-disabled .el-input__wrapper,
.el-textarea.is-disabled .el-textarea__inner { .el-textarea.is-disabled .el-textarea__inner {
background-color: transparent; background-color: transparent;
// border-color: transparent; // border-color: transparent;
......
...@@ -139,19 +139,22 @@ export default { ...@@ -139,19 +139,22 @@ export default {
<template> <template>
<div v-loading="loading"> <div v-loading="loading">
<div class="flex"> <div class="flex">
<el-form :model="form" ref="form" :rules="rules" label-width="100px" class="fxauto g-margin-r"> <el-form
:model="form"
ref="form"
:rules="rules"
label-width="100px"
scroll-to-error
class="fxauto g-margin-r"
:class="isDetail && 'form-detail'"
:disabled="isDetail">
<div class="g-card"> <div class="g-card">
<div class="g-card-title fxbw"> <div class="g-card-title fxbw">
基础信息 基础信息
<el-button <el-button
v-if="isDetail" v-if="isDetail"
type="primary" type="primary"
@click=" @click="$router.push({ path: './aev', query: { id: $route.query.id } })">
$router.push({
path: './aev',
query: { id: $route.query.id },
})
">
编辑 编辑
</el-button> </el-button>
</div> </div>
...@@ -235,15 +238,24 @@ export default { ...@@ -235,15 +238,24 @@ export default {
</div> </div>
</el-form> </el-form>
<div> <div>
<div class="g-card" v-if="isDetail"></div> <div class="g-card" v-if="isDetail">
<div class="g-card-title">活码</div>
<div class="ac">
<el-image class="" :src="form.groupCodeUrl" fit="contain" style="width: 120px"></el-image>
<div class="mt10">
<el-button text @click="downloadBlob(form.groupCodeUrl, '新客拉群活码.png', 'image')">下载活码</el-button>
<el-button class="copy" text @click="$copyText(form.groupCodeUrl)">复制链接</el-button>
</div>
</div>
</div>
<div class="preview-wrap g-card"> <div class="preview-wrap g-card">
<!-- 预览 --> <div class="g-card-title">预览</div>
<PhoneDialog :message="form.welcomeMsg || '请输入加群引导语'" isOther> <PhoneDialog :message="form.welcomeMsg || '请输入加群引导语'" isOther>
<div style="line-height: 1.5"> <div style="line-height: 1.5">
<div class="msg-title">{{ form.linkTitle }}</div> <div class="msg-title">{{ form.linkTitle }}</div>
<div class="msg-content"> <div class="msg-content">
<div class="msg-desc">{{ form.linkDesc }}</div> <div class="msg-desc">{{ form.linkDesc }}</div>
<el-image class="phone-dialog-image fxnone" :src="form.linkCoverUrl" fit="contain"></el-image> <el-image class="fxnone" :src="form.linkCoverUrl" fit="contain"></el-image>
</div> </div>
</div> </div>
</PhoneDialog> </PhoneDialog>
......
...@@ -6,6 +6,7 @@ export default { ...@@ -6,6 +6,7 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
getList,
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
...@@ -15,12 +16,6 @@ export default { ...@@ -15,12 +16,6 @@ export default {
endTime: '', // 结束日期 endTime: '', // 结束日期
}, },
dateRange: [], // 添加日期 dateRange: [], // 添加日期
total: 0, // 数据总量
form: {},
list: [],
dialogVisible: false,
disabled: false,
loading: false,
status: ['正常', '停用'], status: ['正常', '停用'],
pushType: { pushType: {
0: '发给客户', 0: '发给客户',
...@@ -46,32 +41,14 @@ export default { ...@@ -46,32 +41,14 @@ export default {
}, },
}, },
created() { created() {
this.getList()
this.$store.setBusininessDesc( this.$store.setBusininessDesc(
` `
<div>指在客户通过员工活码加为好友后,员工自动推送入群引导语和群活码,客户可通过群活码扫码入群。</div> <div>指在客户通过员工活码加为好友后,员工自动推送入群引导语和群活码,客户可通过群活码扫码入群。</div>
`, `,
) )
}, },
mounted() { mounted() {},
// new clipboard(".copy-btn");
},
methods: { methods: {
// 获取新客数据
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
},
// 新建/编辑新客数据 // 新建/编辑新客数据
goRoute(path = 'aev', id) { goRoute(path = 'aev', id) {
this.$router.push({ this.$router.push({
...@@ -95,29 +72,14 @@ export default { ...@@ -95,29 +72,14 @@ export default {
return remove(ids) return remove(ids)
}) })
.then(() => { .then(() => {
this.getList() this.$refs.table.getList()
this.msgSuccess('删除成功') this.msgSuccess('删除成功')
}) })
.catch(function () {}) .catch(function () {})
}, },
// 下载
download(data) {
let name = data.codeName + '.png'
download(data.id).then((res) => {
if (res != null) {
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = name // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
})
},
// 批量下载 // 批量下载
downloadBatch() { downloadBatch() {
this.$confirm('是否确认下载所有活码图片吗?', '警告', { this.$confirm('确认下载所有选中活码图片吗?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
...@@ -127,27 +89,10 @@ export default { ...@@ -127,27 +89,10 @@ export default {
// window.open(downloadBatch(this.ids)) // window.open(downloadBatch(this.ids))
}) })
.then((res) => { .then((res) => {
if (res != null) { this.downloadBlob(res, '批量新客拉群活码.zip', 'zip')
let blob = new Blob([res], { type: 'application/zip' })
let url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '批量员工活码.zip' // 重命名文件
link.click()
URL.revokeObjectURL(url) // 释放内存
}
}) })
.catch(function () {}) .catch(function () {})
}, },
// 重置查询参数
resetQuery() {
this.dateRange = []
this.$refs['queryForm'].resetFields()
this.$nextTick(() => {
this.getList(1)
})
},
}, },
} }
</script> </script>
...@@ -173,21 +118,24 @@ export default { ...@@ -173,21 +118,24 @@ export default {
end-placeholder="结束日期" end-placeholder="结束日期"
align="right"></el-date-picker> align="right"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=""> <SearchResetButton
<el-button type="primary" @click="getList(1)">查询</el-button> :search="() => $refs.table.getList()"
<el-button @click="resetQuery()">重置</el-button> :reset="() => $refs.queryForm.resetFields()"></SearchResetButton>
</el-form-item>
</el-form> </el-form>
<div class="g-card">
<div class="mid-action"> <RequestChartTable ref="table" :request="(params) => (Object.assign(params, query), getList(params))">
<template #operation>
<div class="fxbw">
<el-button type="primary" @click="goRoute()">新建活码</el-button> <el-button type="primary" @click="goRoute()">新建活码</el-button>
<div> <div>
<el-button type="primary" :disabled="!ids.length" @click="downloadBatch()">批量下载</el-button> <el-button type="primary" :disabled="!ids.length" @click="downloadBatch()">批量下载</el-button>
<el-button type="primary" :disabled="!ids.length" @click="remove()">批量删除</el-button> <el-button type="primary" :disabled="!ids.length" @click="remove()">批量删除</el-button>
</div> </div>
</div> </div>
</template>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <template #="{ data }">
<el-table :data="data" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center"></el-table-column> <el-table-column type="selection" width="50" align="center"></el-table-column>
<el-table-column prop="codeName" label="活码名称" align="center"></el-table-column> <el-table-column prop="codeName" label="活码名称" align="center"></el-table-column>
<el-table-column prop="emplList" label="活码" align="center" width="130"> <el-table-column prop="emplList" label="活码" align="center" width="130">
...@@ -231,9 +179,9 @@ export default { ...@@ -231,9 +179,9 @@ export default {
</el-popover> </el-popover>
</template> </template>
<template #default="{ row }"> <template #default="{ row }">
<el-button text @click="goRoute('detail', row.id)"> <div class="g-color cp" @click="goRoute('detail', row.id)">
{{ row.addCustomerNumber }}/{{ row.joinGroupNumber }} {{ row.addCustomerNumber }}/{{ row.joinGroupNumber }}
</el-button> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="createBy"></el-table-column> --> <!-- <el-table-column label="创建人" align="center" prop="createBy"></el-table-column> -->
...@@ -258,22 +206,18 @@ export default { ...@@ -258,22 +206,18 @@ export default {
</el-button> --> </el-button> -->
<el-button text @click="goRoute('detail', row.id)">详情|统计</el-button> <el-button text @click="goRoute('detail', row.id)">详情|统计</el-button>
<el-button text @click="goRoute('aev', row.id)">编辑</el-button> <el-button text @click="goRoute('aev', row.id)">编辑</el-button>
<el-button text @click="download(row)">下载</el-button> <el-button text @click="downloadBlob(row.emplCodeUrl, row.codeName + '.png', 'image')">
<el-button text @click="download(row)">复制</el-button> 下载
</el-button>
<el-button text @click="$copyText(row.groupCodeUrl)">复制</el-button>
<el-button text @click="remove(row.id)">删除</el-button> <el-button text @click="remove(row.id)">删除</el-button>
</template> </template>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</template>
<pagination </RequestChartTable>
v-show="total > 0"
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getList()" />
</div>
</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!