Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a21713e429 | |||
| 466f821a88 | |||
| dc08bdf819 | |||
| 05379dcf5f | |||
| 8c48703349 | |||
| 8185286bf1 | |||
| a7af170360 | |||
| fd6ce7c799 | |||
| d6db947a6f | |||
| 24ed6118f2 |
@@ -31,6 +31,9 @@
|
||||
<el-form-item label="品牌车型:" prop="title">
|
||||
{{ form.brandName }}
|
||||
</el-form-item>
|
||||
<el-form-item label="补贴金额:" prop="title">
|
||||
{{ form.money }}
|
||||
</el-form-item>
|
||||
<el-form-item label="入池时间:" prop="title">
|
||||
{{ form.cluesCtime }}
|
||||
</el-form-item>
|
||||
@@ -121,7 +124,8 @@
|
||||
idCardImg: [],
|
||||
pTime: '',
|
||||
billTime: '',
|
||||
cluesCtime: ''
|
||||
cluesCtime: '',
|
||||
money: 0
|
||||
};
|
||||
return {
|
||||
editVersion: false,
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ module.exports = {
|
||||
'/api': {
|
||||
target: process.env.URL,
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^/api/common': '/common' } //路由重写调用公共方法
|
||||
// pathRewrite: { '^/api/common': '/common' } //路由重写调用公共方法
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
VUE_APP_NAME=超级车补管理后台
|
||||
VUE_APP_API_BASE_URL=https://hcb.liche.cn/pingan
|
||||
# webSocket配置
|
||||
VUE_APP_WS_URL=wss://api.ss.haodian.cn/wss
|
||||
VUE_APP_WS_URL=wss://sapi.liche.cn/wss
|
||||
VUE_APP_WS_PLATFORM=2
|
||||
|
||||
@@ -41,3 +41,10 @@ export async function pageOrgNameList(params) {
|
||||
});
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export async function pageTeamList(params) {
|
||||
const res = await request.get('/common/teamList', {
|
||||
params
|
||||
});
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@@ -99,3 +99,19 @@ export async function exportProduct(params) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券列表
|
||||
* @param params
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function pageCouponList(params) {
|
||||
const res = await request.get('/car/product/couponList', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
export async function pageCmmssn(params) {
|
||||
const res = await request.get('/cmmssn/cmmssn/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function exportCmmssn(params) {
|
||||
const res = await request.get('/cmmssn/cmmssn/export', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function updateCmmssnSend(data) {
|
||||
const res = await request.put('/cmmssn/cmmssn', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出金额未支付金额大于100的用户
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function exportCmmssnLgMoney(params) {
|
||||
const res = await request.get('/cmmssn/cmmssn/exportLgMoney', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -98,3 +98,16 @@ export async function updateLevel(data) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送优惠券
|
||||
* @param data
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
export async function sendCoupon(data) {
|
||||
const res = await request.post('/receiver/clues/sendCoupon', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
<!-- 团队选择组件 -->
|
||||
<template>
|
||||
<el-cascader
|
||||
clearable
|
||||
filterable
|
||||
collapse-tags
|
||||
:value="value"
|
||||
:options="regionsData"
|
||||
:placeholder="placeholder"
|
||||
popper-class="ele-pop-wrap-higher"
|
||||
:props="props"
|
||||
@input="updateValue"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { pageTeamList } from '@/api/auto';
|
||||
export default {
|
||||
name: 'TeamSelect',
|
||||
props: {
|
||||
value: Array,
|
||||
placeholder: String,
|
||||
options: Array,
|
||||
valueField: {
|
||||
type: String,
|
||||
validator: (val) => {
|
||||
return !val || val === 'label';
|
||||
}
|
||||
},
|
||||
props: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 级联选择器数据
|
||||
regionsData: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/* 更新 value */
|
||||
updateValue(value) {
|
||||
this.$emit('input', value);
|
||||
},
|
||||
/* 级联选择器数据 value 处理 */
|
||||
formatData(data) {
|
||||
if (this.valueField === 'label') {
|
||||
return data.map((d) => {
|
||||
const item = {
|
||||
label: d.label,
|
||||
value: d.label
|
||||
};
|
||||
if (d.children) {
|
||||
item.children = d.children.map((c) => {
|
||||
const cItem = {
|
||||
label: c.label,
|
||||
value: c.label
|
||||
};
|
||||
if (c.children) {
|
||||
cItem.children = c.children.map((cc) => {
|
||||
return {
|
||||
label: cc.label,
|
||||
value: cc.label
|
||||
};
|
||||
});
|
||||
}
|
||||
return cItem;
|
||||
});
|
||||
}
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
},
|
||||
/* 省市区数据筛选 */
|
||||
filterData(data) {
|
||||
return this.formatData(data);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
options: {
|
||||
handler(options) {
|
||||
console.log(options);
|
||||
this.regionsData = this.filterData(options ?? []);
|
||||
if (!options) {
|
||||
pageTeamList().then((data) => {
|
||||
this.regionsData = this.filterData(data ?? []);
|
||||
this.$emit('load-data-done', data);
|
||||
});
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -202,7 +202,7 @@ export default {
|
||||
},
|
||||
/* 清空通知 */
|
||||
clearNotice() {
|
||||
setRead({ type: 'all' })
|
||||
setRead({ type: 'all', isRead: 1 })
|
||||
.then(() => {
|
||||
this.query()
|
||||
})
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<el-form
|
||||
label-width="77px"
|
||||
class="ele-form-search"
|
||||
@keyup.enter.native="search"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-row :gutter="15">
|
||||
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||
<el-form-item label="坐席:">
|
||||
<el-input clearable v-model="where.username" placeholder="请输入"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||
<el-form-item label="类型:">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="where.type"
|
||||
placeholder="请选择"
|
||||
class="ele-fluid"
|
||||
>
|
||||
<el-option label="线索" :value="1"/>
|
||||
<el-option label="订单" :value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||
<el-form-item label="是否发放:">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="where.ifSend"
|
||||
placeholder="请选择"
|
||||
class="ele-fluid"
|
||||
>
|
||||
<el-option label="否" :value="0"/>
|
||||
<el-option label="是" :value="1"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
|
||||
<el-form-item label="解锁时间:">
|
||||
<el-date-picker
|
||||
unlink-panels
|
||||
v-model="where.dateRange"
|
||||
range-separator="-"
|
||||
type="daterange"
|
||||
end-placeholder="结束日期"
|
||||
start-placeholder="开始日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
|
||||
<div class="ele-form-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
class="ele-btn-icon"
|
||||
@click="search"
|
||||
>
|
||||
查询
|
||||
</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
<el-button icon="el-icon-download" type="primary" @click="exportData">未发放金额大于100</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
// 默认表单数据
|
||||
const defaultWhere = {
|
||||
username: '',
|
||||
type: '',
|
||||
ifSend: '',
|
||||
dateRange: ''
|
||||
}
|
||||
return {
|
||||
// 表单数据
|
||||
where: { ...defaultWhere }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 是否开启响应式布局
|
||||
styleResponsive() {
|
||||
return this.$store.state.theme.styleResponsive
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* 搜索 */
|
||||
search() {
|
||||
this.$emit('search', this.where)
|
||||
},
|
||||
/* 重置 */
|
||||
reset() {
|
||||
this.where = { ...this.defaultWhere }
|
||||
this.search()
|
||||
},
|
||||
exportData() {
|
||||
this.$emit('exportLgMoney')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<el-card shadow="never">
|
||||
<!-- 搜索表单 -->
|
||||
<cmmssn-search @search="reload" @exportLgMoney="exportLgMoney"/>
|
||||
<!-- 数据表格 -->
|
||||
<ele-pro-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:selection.sync="selection"
|
||||
cache-key="systemUserTable"
|
||||
>
|
||||
<!-- 表头工具栏 -->
|
||||
<template v-slot:toolbar>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
class="ele-btn-icon"
|
||||
@click="sendBatch"
|
||||
>
|
||||
批量标记发放
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
class="ele-btn-icon"
|
||||
@click="exportData"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 操作列 -->
|
||||
<template v-slot:action="{ row }">
|
||||
<el-link
|
||||
v-if="row.ifSend!=='1'"
|
||||
type="primary"
|
||||
:underline="false"
|
||||
@click="setSend(row)"
|
||||
>
|
||||
标记已发放
|
||||
</el-link>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CmmssnSearch from './components/cmmssn-search.vue'
|
||||
import { pageCmmssn, exportCmmssn, updateCmmssnSend, exportCmmssnLgMoney } from '@/api/cmmssn/cmmssn'
|
||||
import { utils, writeFile } from 'xlsx'
|
||||
|
||||
export default {
|
||||
name: 'cmmssn',
|
||||
components: { CmmssnSearch },
|
||||
data() {
|
||||
return {
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
columnKey: 'selection',
|
||||
type: 'selection',
|
||||
width: 50,
|
||||
align: 'center',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'mobile',
|
||||
label: '线索',
|
||||
width: 120,
|
||||
align: 'center',
|
||||
showOverflowTooltip: true,
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'bizName',
|
||||
label: '解锁门店',
|
||||
showOverflowTooltip: true,
|
||||
width: 120,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'centerName',
|
||||
label: '中心',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 110,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'orgName',
|
||||
label: '机构',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'userName',
|
||||
label: '坐席',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 110,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'userCode',
|
||||
label: '坐席工号',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 110,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'typeCn',
|
||||
label: '类型',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'unlockTime',
|
||||
label: '解锁时间',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 110,
|
||||
align: 'center',
|
||||
formatter: (_row, _column, cellValue) => {
|
||||
return this.$util.toDateString(cellValue)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'orderTime',
|
||||
label: '订单时间',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 110,
|
||||
align: 'center',
|
||||
formatter: (_row, _column, cellValue) => {
|
||||
return this.$util.toDateString(cellValue)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'money',
|
||||
label: '佣金',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
resizable: false,
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'sendCn',
|
||||
label: '是否发放',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
columnKey: 'action',
|
||||
label: '操作',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
resizable: false,
|
||||
slot: 'action',
|
||||
showOverflowTooltip: true,
|
||||
fixed: 'right'
|
||||
}
|
||||
],
|
||||
// 表格选中数据
|
||||
selection: [],
|
||||
// 当前编辑数据
|
||||
current: null,
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
// 是否显示导入弹窗
|
||||
showImport: false,
|
||||
title: '用户佣金',
|
||||
title1: '未发放佣金大于100用户',
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* 表格数据源 */
|
||||
datasource({ page, limit, where, order }) {
|
||||
return pageCmmssn({ ...where, ...order, page, limit })
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload(where) {
|
||||
this.$refs.table.reload({ page: 1, where: where })
|
||||
},
|
||||
/* 打开编辑弹窗 */
|
||||
openEdit(row) {
|
||||
this.current = row
|
||||
this.showEdit = true
|
||||
},
|
||||
exportData() {
|
||||
const loading = this.$loading({ lock: true })
|
||||
this.$refs.table.doRequest(({ where, order }) => {
|
||||
exportCmmssn({ ...where, ...order })
|
||||
.then((data) => {
|
||||
loading.close()
|
||||
const array = [data.columns]
|
||||
data.list.forEach((d) => {
|
||||
let arrayItem = []
|
||||
for (let key in d) {
|
||||
arrayItem.push(d[key])
|
||||
}
|
||||
array.push(arrayItem)
|
||||
})
|
||||
writeFile(
|
||||
{
|
||||
SheetNames: ['Sheet1'],
|
||||
Sheets: {
|
||||
Sheet1: utils.aoa_to_sheet(array)
|
||||
}
|
||||
},
|
||||
this.title + '.xlsx'
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close()
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
})
|
||||
},
|
||||
setSend(row) {
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要标记【' + row['mobile'] + '】已发放吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.loading = true
|
||||
updateCmmssnSend({ ids: [row.id] }).then((res) => {
|
||||
this.$message.success(res)
|
||||
this.reload()
|
||||
}).catch((e) => {
|
||||
this.$message.error(e.message)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
sendBatch() {
|
||||
if (!this.selection.length) {
|
||||
this.$message.error('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要批量标记发放选中数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.loading = true
|
||||
updateCmmssnSend({ ids: this.selection.map((d) => d.id) }).then((res) => {
|
||||
this.$message.success(res)
|
||||
this.reload()
|
||||
}).catch((e) => {
|
||||
this.$message.error(e.message)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
exportLgMoney() {
|
||||
const loading = this.$loading({ lock: true })
|
||||
this.$refs.table.doRequest(({ where, order }) => {
|
||||
exportCmmssnLgMoney({ ...where, ...order })
|
||||
.then((data) => {
|
||||
loading.close()
|
||||
const array = [data.columns]
|
||||
data.list.forEach((d) => {
|
||||
let arrayItem = []
|
||||
for (let key in d) {
|
||||
arrayItem.push(d[key])
|
||||
}
|
||||
array.push(arrayItem)
|
||||
})
|
||||
writeFile(
|
||||
{
|
||||
SheetNames: ['Sheet1'],
|
||||
Sheets: {
|
||||
Sheet1: utils.aoa_to_sheet(array)
|
||||
}
|
||||
},
|
||||
this.title1 + '.xlsx'
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close()
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,152 @@
|
||||
<!-- 用户导入弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
width="520px"
|
||||
title="发送优惠券"
|
||||
:visible="visible"
|
||||
@update:visible="updateVisible"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="线索编号:" prop="title">
|
||||
<el-input
|
||||
:maxlength="60"
|
||||
v-model="form.sid"
|
||||
placeholder=""
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户手机号:" prop="title">
|
||||
<el-input
|
||||
:maxlength="60"
|
||||
v-model="form.mobile"
|
||||
placeholder=""
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌:">
|
||||
<brand-select
|
||||
v-model="brands"
|
||||
type="provinceCity"
|
||||
:props="{ multiple: false }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠券:" prop="couponId">
|
||||
<el-select v-model="form.couponId" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in couponList"
|
||||
:key="item.id"
|
||||
:value="item.id"
|
||||
:label="item.title"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-slot:footer>
|
||||
<el-button @click="updateVisible(false)">取消</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="save">
|
||||
保存
|
||||
</el-button>
|
||||
</template>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { pageCouponList } from '@/api/car/product'
|
||||
import { sendCoupon } from '@/api/receiver/clues'
|
||||
|
||||
import BrandSelect from '@/components/BrandSelect/index.vue'
|
||||
|
||||
export default {
|
||||
components: { BrandSelect },
|
||||
props: {
|
||||
// 是否打开弹窗
|
||||
visible: Boolean,
|
||||
// 修改回显的数据
|
||||
data: Object
|
||||
},
|
||||
data() {
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
cityId: '',
|
||||
sid: '',
|
||||
mobile: '',
|
||||
couponId: ''
|
||||
}
|
||||
return {
|
||||
defaultForm,
|
||||
editVersion: false,
|
||||
form: { ...defaultForm },
|
||||
// 表单验证规则
|
||||
rules: {
|
||||
couponId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择优惠券',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
loading: false,
|
||||
brands: [],
|
||||
couponList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.loading = true
|
||||
sendCoupon(this.form).then((msg) => {
|
||||
this.$message.success(msg)
|
||||
this.updateVisible(false);
|
||||
}).catch((e) => {
|
||||
this.$message.error(e.message)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
//加载优惠券
|
||||
loadCouponList() {
|
||||
this.couponList = []
|
||||
this.form.couponId = ''
|
||||
if (this.brands && this.brands.length > 0) {
|
||||
pageCouponList({ brands: this.brands, cityId: this.form.cityId }).then((data) => {
|
||||
this.couponList = data
|
||||
}).catch((e) => {
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
}
|
||||
},
|
||||
/* 更新visible */
|
||||
updateVisible(value) {
|
||||
this.$emit('update:visible', value)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(visible) {
|
||||
this.editVersion = false
|
||||
if (visible) {
|
||||
this.editVersion = true
|
||||
if (this.data) {
|
||||
this.$util.assignObject(this.form, {
|
||||
...this.data
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$refs.form.clearValidate()
|
||||
this.form = { ...this.defaultForm }
|
||||
}
|
||||
},
|
||||
brands() {
|
||||
this.loadCouponList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -131,6 +131,16 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" v-if="isShowTeamSearch">
|
||||
<el-form-item label="归属团队:">
|
||||
<team-select
|
||||
v-model="where.teamIds"
|
||||
placeholder="请选择团队"
|
||||
class="ele-fluid"
|
||||
:props="{multiple:true}"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<div class="ele-form-actions">
|
||||
<el-button
|
||||
@@ -147,7 +157,8 @@
|
||||
icon="el-icon-download"
|
||||
type="primary"
|
||||
@click="exportData"
|
||||
>导出</el-button
|
||||
>导出
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -183,7 +194,8 @@
|
||||
<template v-slot:brandSeries="{ row }">
|
||||
<div v-for="(item, index) in row.brandList" :key="index">{{
|
||||
item
|
||||
}}</div>
|
||||
}}
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:status="{ row }">
|
||||
{{ row.statusCn }}
|
||||
@@ -213,8 +225,17 @@
|
||||
>
|
||||
拨打电话
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
:underline="false"
|
||||
@click="showSendCoupon(row)"
|
||||
>
|
||||
发券
|
||||
</el-button>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
<send-coupon :visible.sync="visibleSendCoupon" :data="current"/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -226,15 +247,17 @@
|
||||
callPhone,
|
||||
exportClues,
|
||||
updateLevel
|
||||
} from '@/api/receiver/clues';
|
||||
import RegionsSelect from '@/components/RegionsSelect/index.vue';
|
||||
import BrandSelect from '@/components/BrandSelect/index.vue';
|
||||
import { pageCenterList, pageOrgNameList } from '@/api/auto';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
} from '@/api/receiver/clues'
|
||||
import RegionsSelect from '@/components/RegionsSelect/index.vue'
|
||||
import BrandSelect from '@/components/BrandSelect/index.vue'
|
||||
import sendCoupon from '@/views/receiver/clues/components/send-coupon.vue'
|
||||
import { pageCenterList, pageOrgNameList } from '@/api/auto'
|
||||
import { utils, writeFile } from 'xlsx'
|
||||
import TeamSelect from '@/components/teamSelect/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'receiverClues',
|
||||
components: { RegionsSelect, BrandSelect },
|
||||
components: { TeamSelect, RegionsSelect, BrandSelect, sendCoupon },
|
||||
data() {
|
||||
return {
|
||||
where: {
|
||||
@@ -245,7 +268,8 @@
|
||||
userCode: '',
|
||||
centerNumber: '',
|
||||
orgName: '',
|
||||
level: ''
|
||||
level: '',
|
||||
teamIds: []
|
||||
},
|
||||
// 表格列配置
|
||||
columns: [
|
||||
@@ -323,7 +347,7 @@
|
||||
prop: 'action',
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
width: 170,
|
||||
slot: 'action',
|
||||
fixed: 'right'
|
||||
}
|
||||
@@ -340,46 +364,46 @@
|
||||
{
|
||||
text: '今天',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
picker.$emit('pick', [start, end]);
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24);
|
||||
end.setTime(end.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', [start, end]);
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24)
|
||||
end.setTime(end.getTime() - 3600 * 1000 * 24)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -389,87 +413,90 @@
|
||||
centerList: [],
|
||||
orgNameList: [],
|
||||
levelList: [],
|
||||
title: '线索列表'
|
||||
};
|
||||
title: '线索列表',
|
||||
visibleSendCoupon: false,
|
||||
isShowTeamSearch: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSearch();
|
||||
this.loadCenterList();
|
||||
this.loadOrgNameList();
|
||||
this.loadSearch()
|
||||
this.loadCenterList()
|
||||
this.loadOrgNameList()
|
||||
},
|
||||
computed: {
|
||||
// 是否开启响应式布局
|
||||
styleResponsive() {
|
||||
return this.$store.state.theme.styleResponsive;
|
||||
return this.$store.state.theme.styleResponsive
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadOrgNameList() {
|
||||
pageOrgNameList()
|
||||
.then((data) => {
|
||||
this.orgNameList = data;
|
||||
this.orgNameList = data
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
},
|
||||
loadCenterList() {
|
||||
pageCenterList()
|
||||
.then((data) => {
|
||||
this.centerList = data;
|
||||
this.centerList = data
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
},
|
||||
loadSearch() {
|
||||
getSearch()
|
||||
.then((data) => {
|
||||
this.statusList = data.statusList;
|
||||
this.belongOptions = data.belongList;
|
||||
this.levelList = data.levelList;
|
||||
this.statusList = data.statusList
|
||||
this.belongOptions = data.belongList
|
||||
this.levelList = data.levelList
|
||||
this.isShowTeamSearch = data.isShowTeamSearch
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
},
|
||||
/* 下拉按钮点击 */
|
||||
dropClick(command, row) {
|
||||
if (command === 'edit') {
|
||||
this.current = row;
|
||||
this.showEdit = true;
|
||||
this.current = row
|
||||
this.showEdit = true
|
||||
} else if (command === 'brokerage') {
|
||||
this.current = row;
|
||||
this.showEditBrokerage = true;
|
||||
this.current = row
|
||||
this.showEditBrokerage = true
|
||||
} else if (command === 'coupon') {
|
||||
const path = '/car/product/coupon';
|
||||
const path = '/car/product/coupon'
|
||||
this.$nextTick(() => {
|
||||
this.$router.push({
|
||||
path,
|
||||
query: row ? { id: row.id, title: row.title } : undefined
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
goDetail(row) {
|
||||
const path = '/receiver/clues/detail';
|
||||
const path = '/receiver/clues/detail'
|
||||
this.$router.push({
|
||||
path,
|
||||
query: row ? { id: row.id, title: row.title } : undefined
|
||||
});
|
||||
})
|
||||
},
|
||||
/* 表格数据源 */
|
||||
datasource({ page, limit, where, order }) {
|
||||
return pageClues({ ...where, ...order, page, limit });
|
||||
return pageClues({ ...where, ...order, page, limit })
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({ page: 1, where: this.where });
|
||||
this.$refs.table.reload({ page: 1, where: this.where })
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {};
|
||||
this.reload();
|
||||
this.where = {}
|
||||
this.reload()
|
||||
},
|
||||
/* 拨打电话 */
|
||||
call(row) {
|
||||
@@ -477,33 +504,34 @@
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
const loading = this.$loading({ lock: true });
|
||||
const loading = this.$loading({ lock: true })
|
||||
callPhone({ id: row.id })
|
||||
.then((msg) => {
|
||||
loading.close();
|
||||
this.$message.success(msg);
|
||||
loading.close()
|
||||
this.$message.success(msg)
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close();
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
loading.close()
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
exportData() {
|
||||
const loading = this.$loading({ lock: true });
|
||||
const loading = this.$loading({ lock: true })
|
||||
this.$refs.table.doRequest(({ where, order }) => {
|
||||
exportClues({ ...where, ...order })
|
||||
.then((data) => {
|
||||
loading.close();
|
||||
const array = [data.columns];
|
||||
loading.close()
|
||||
const array = [data.columns]
|
||||
data.list.forEach((d) => {
|
||||
let arrayItem = [];
|
||||
let arrayItem = []
|
||||
for (let key in d) {
|
||||
arrayItem.push(d[key]);
|
||||
arrayItem.push(d[key])
|
||||
}
|
||||
array.push(arrayItem);
|
||||
});
|
||||
array.push(arrayItem)
|
||||
})
|
||||
writeFile(
|
||||
{
|
||||
SheetNames: ['Sheet1'],
|
||||
@@ -512,13 +540,13 @@
|
||||
}
|
||||
},
|
||||
this.title + '.xlsx'
|
||||
);
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close();
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
});
|
||||
loading.close()
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
})
|
||||
},
|
||||
handleLevelChange(value, row) {
|
||||
this.$confirm(
|
||||
@@ -533,18 +561,22 @@
|
||||
.then(() => {
|
||||
updateLevel({ id: row.id, level: value })
|
||||
.then((msg) => {
|
||||
this.$message.success(msg);
|
||||
this.$message.success(msg)
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
// 用户取消操作,恢复原值
|
||||
});
|
||||
})
|
||||
},
|
||||
showSendCoupon(row) {
|
||||
this.current = row
|
||||
this.visibleSendCoupon = true
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .el-cascader__tags input::-webkit-input-placeholder {
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UserSearch from './components/user-search.vue';
|
||||
import { pageCmmssn } from '@/api/user/cmmssn';
|
||||
import UserSearch from './components/user-search.vue'
|
||||
import { pageCmmssn } from '@/api/user/cmmssn'
|
||||
|
||||
export default {
|
||||
name: 'SystemUser',
|
||||
@@ -52,7 +52,9 @@
|
||||
label: '线索编号',
|
||||
showOverflowTooltip: true,
|
||||
align: 'center',
|
||||
slot: 'fromCn'
|
||||
slot: 'fromCn',
|
||||
width: 220,
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'brandSeries',
|
||||
@@ -82,38 +84,44 @@
|
||||
minWidth: 100,
|
||||
resizable: false,
|
||||
showOverflowTooltip: true
|
||||
}
|
||||
}, {
|
||||
prop: 'ifSendCn',
|
||||
label: '是否发放',
|
||||
showOverflowTooltip: true,
|
||||
minWidth: 80,
|
||||
align: 'center'
|
||||
},
|
||||
],
|
||||
tabPosition: '1',
|
||||
money: 0,
|
||||
showTeam: 0
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/* 表格数据源 */
|
||||
async datasource({ page, limit, where, order }) {
|
||||
where.type = this.tabPosition;
|
||||
const result = await pageCmmssn({ ...where, ...order, page, limit });
|
||||
this.money = result.money;
|
||||
this.showTeam = result.showTeam;
|
||||
return result;
|
||||
where.type = this.tabPosition
|
||||
const result = await pageCmmssn({ ...where, ...order, page, limit })
|
||||
this.money = result.money
|
||||
this.showTeam = result.showTeam
|
||||
return result
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload(where) {
|
||||
this.$refs.table.reload({ page: 1, where: where });
|
||||
this.$refs.table.reload({ page: 1, where: where })
|
||||
},
|
||||
handleOptionChange() {
|
||||
console.log(this.tabPosition);
|
||||
this.reload();
|
||||
console.log(this.tabPosition)
|
||||
this.reload()
|
||||
},
|
||||
goDetail(row) {
|
||||
const path = row.from.url;
|
||||
const path = row.from.url
|
||||
if (path) {
|
||||
this.$router.push({
|
||||
path
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = {
|
||||
'/pingan': {
|
||||
target: process.env.URL,
|
||||
changeOrigin: true,
|
||||
pathRewrite: { '^/pingan/common': '/common' } //路由重写调用公共方法
|
||||
// pathRewrite: { '^/pingan/common': '/common' } //路由重写调用公共方法
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user