优惠券列表接口对接
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
'/static/axios.min.js'
|
'/static/axios.min.js'
|
||||||
否则报错
|
否则报错
|
||||||
|
|
||||||
# node 版本 10.23.1
|
# node 版本 node-v14.21.3
|
||||||
|
|
||||||
# 水感应测试-存放路径
|
# 水感应测试-存放路径
|
||||||
/home/wwwroot/Development/Douhuo/agent
|
/home/wwwroot/Development/Douhuo/agent
|
||||||
|
|||||||
11
public/index.html
vendored
11
public/index.html
vendored
@@ -23,7 +23,7 @@
|
|||||||
<div class="loading-wrp">
|
<div class="loading-wrp">
|
||||||
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; justify-content: center; align-items: center;"WaterFeel.manager Co.,Ltd.</div>
|
<div>WaterFeel.manager Co.,Ltd.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- require cdn assets js -->
|
<!-- require cdn assets js -->
|
||||||
@@ -32,4 +32,13 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
</body>
|
</body>
|
||||||
|
<style>
|
||||||
|
.bottomText{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
10
src/api/coupon.js
Normal file
10
src/api/coupon.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 优惠券列表
|
||||||
|
export function getMiddlesCoupons (parameter) {
|
||||||
|
return request({
|
||||||
|
url: '/middles/stock/coupons',
|
||||||
|
method: 'get',
|
||||||
|
params: parameter
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -14,10 +14,10 @@
|
|||||||
<a-icon type="lock" />
|
<a-icon type="lock" />
|
||||||
修改密码
|
修改密码
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<!-- <a-menu-item key="changePermission" @click="goPermission">
|
<a-menu-item key="changePermission" @click="goPermission">
|
||||||
<a-icon type="setting" />
|
<a-icon type="setting" />
|
||||||
权限管理
|
权限管理
|
||||||
</a-menu-item> -->
|
</a-menu-item>
|
||||||
<a-menu-item key="logout" @click="handleLogout">
|
<a-menu-item key="logout" @click="handleLogout">
|
||||||
<a-icon type="logout" />
|
<a-icon type="logout" />
|
||||||
退出登录
|
退出登录
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import detail from './routes/detail'
|
import detail from './routes/detail'
|
||||||
import stock from './routes/stock'
|
import stock from './routes/stock'
|
||||||
import user from './routes/user'
|
import user from './routes/user'
|
||||||
// import coupon from './routes/coupon'
|
import coupon from './routes/coupon'
|
||||||
import permission from './routes/permission'
|
import permission from './routes/permission'
|
||||||
import sales from './routes/sales'
|
import sales from './routes/sales'
|
||||||
import cityExperienceOfficer from './routes/cityExperienceOfficer'
|
import cityExperienceOfficer from './routes/cityExperienceOfficer'
|
||||||
@@ -42,7 +42,7 @@ export const asyncRouterMap = [{
|
|||||||
...stock,
|
...stock,
|
||||||
...sales,
|
...sales,
|
||||||
...user,
|
...user,
|
||||||
// ...coupon,
|
...coupon,
|
||||||
...permission
|
...permission
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,35 +6,32 @@
|
|||||||
<a-form layout="inline">
|
<a-form layout="inline">
|
||||||
<a-row :gutter="48">
|
<a-row :gutter="48">
|
||||||
<a-col :md="8" :sm="24">
|
<a-col :md="8" :sm="24">
|
||||||
<a-form-item label="优惠券生成人姓名">
|
<a-form-item label="管理人手机号或昵称">
|
||||||
<a-input v-model="queryParam.item_id" placeholder="优惠券生成人姓名" />
|
<a-input v-model="queryParam.manage_username" placeholder="请输入" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="8" :sm="24">
|
<a-col :md="8" :sm="24">
|
||||||
<a-form-item label="优惠券类型" has-feedback>
|
<a-form-item label="优惠券名称" has-feedback>
|
||||||
<a-select v-model="queryParam.business_type_id" @change="onBusinessChange" placeholder="优惠券类型">
|
<a-select v-model="queryParam.goods_id" placeholder="请选择">
|
||||||
<a-select-option v-for="item in businessArray" :key="item.id" :value="item.id">{{ item.title }}</a-select-option>
|
<a-select-option v-for="item in goods" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :md="8" :sm="24">
|
<a-col :md="8" :sm="24">
|
||||||
<a-form-item label="优惠券状态" has-feedback>
|
<a-form-item label="优惠券状态" has-feedback>
|
||||||
<a-select v-model="queryParam.business_type_id" @change="onBusinessChange" placeholder="优惠券状态">
|
<a-select v-model="queryParam.status" placeholder="请选择">
|
||||||
<a-select-option v-for="item in businessArray" :key="item.id" :value="item.id">{{ item.title }}</a-select-option>
|
<a-select-option v-for="item in status" :key="item.value" :value="item.value">{{ item.text }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :md="8" :sm="24">
|
||||||
|
<a-form-item label="使用人手机号或昵称">
|
||||||
|
<a-input v-model="queryParam.username" placeholder="请输入" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :md="8" :sm="24">
|
<a-col :md="8" :sm="24">
|
||||||
<a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button>
|
<a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button>
|
||||||
<!-- <a-button class="ml8" t ype="primary" @click="onAddRole"><a-icon type="plus" />新增</a-button> -->
|
|
||||||
<a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button>
|
<a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button>
|
||||||
<a-button
|
|
||||||
v-if="exports_can"
|
|
||||||
class="ml8"
|
|
||||||
type="dashed"
|
|
||||||
shape="round"
|
|
||||||
icon="download"
|
|
||||||
@click="exports"/>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
@@ -47,26 +44,29 @@
|
|||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="loadData"
|
:data="loadData"
|
||||||
:rowKey="(row) => row.order_item_id"
|
:rowKey="(row) => row.stock_card_id"
|
||||||
showPagination="auto"
|
showPagination="auto"
|
||||||
bordered
|
bordered
|
||||||
size="default"
|
size="default"
|
||||||
:scroll="{ x: 1200, y: 1000 }">
|
:scroll="{ x: 1200, y: 1000 }">
|
||||||
<div slot="name">
|
<div slot="manage-name" slot-scope="text,record">
|
||||||
<div>zdx</div>
|
<div>{{ record.manage.nickname || '--' }}{{ record.manage.name?'('+record.manage.name+')':'' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="phone">
|
<div slot="manage-username" slot-scope="text,record">
|
||||||
<div>14745798066</div>
|
<div>{{ record.manage.username || '--' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div slot="time">
|
<div slot="user-name" slot-scope="text,record">
|
||||||
<div>2023-11-11~2029-11-11</div>
|
<div>{{ record.user.nickname || '--' }}{{ record.user.name?'('+record.user.name+')':'' }}</div>
|
||||||
|
</div>
|
||||||
|
<div slot="user-username" slot-scope="text,record">
|
||||||
|
<div>{{ record.user.username || '--' }}</div>
|
||||||
|
</div>
|
||||||
|
<div slot="time" slot-scope="text, record">
|
||||||
|
<div>{{ record.created_at }}~{{ record.actived_at }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div slot="type">
|
<div slot="status" slot-scope="text, record">
|
||||||
<div>3瓶优惠券</div>
|
<a-tag :color="record.status.value === 0?'blue':record.status.value === 1?'pink':record.status.value === 2?'orange':record.status.value === 3?'green':record.status.value === 9?'purple':''">{{ record.status.text }}</a-tag>
|
||||||
</div>
|
|
||||||
<div slot="status">
|
|
||||||
<div>待使用</div>
|
|
||||||
</div>
|
</div>
|
||||||
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
|
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
@@ -81,31 +81,39 @@
|
|||||||
<script>
|
<script>
|
||||||
import { STable, UserInfo } from '@/components'
|
import { STable, UserInfo } from '@/components'
|
||||||
import DeriveButton from '@/components/OrderDetailInfo/DeriveButton'
|
import DeriveButton from '@/components/OrderDetailInfo/DeriveButton'
|
||||||
import { institutionsExports } from '@/api/storage'
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import Info from '@/views/home/components/Info'
|
import Info from '@/views/home/components/Info'
|
||||||
import {
|
import {
|
||||||
getList,
|
getMiddlesCoupons
|
||||||
init,
|
} from '@/api/coupon'
|
||||||
canExport
|
|
||||||
} from '@/api/organization'
|
|
||||||
import storage from 'store'
|
|
||||||
import StockInfo from './widgets/StockInfo.vue'
|
import StockInfo from './widgets/StockInfo.vue'
|
||||||
import AddRole from './widgets/AddRole.vue'
|
import AddRole from './widgets/AddRole.vue'
|
||||||
|
|
||||||
// 列表规格
|
// 列表规格
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '优惠券名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
width: 120,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '优惠券状态',
|
||||||
|
scopedSlots: { customRender: 'status' },
|
||||||
|
width: 140,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '优惠券生成人',
|
title: '优惠券生成人',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
scopedSlots: { customRender: 'name' },
|
scopedSlots: { customRender: 'manage-name' },
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '手机号',
|
title: '手机号',
|
||||||
scopedSlots: { customRender: 'phone' },
|
scopedSlots: { customRender: 'manage-username' },
|
||||||
align: 'center'
|
align: 'center'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -116,12 +124,12 @@ const columns = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
scopedSlots: { customRender: 'name' },
|
scopedSlots: { customRender: 'user-name' },
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '手机号',
|
title: '手机号',
|
||||||
scopedSlots: { customRender: 'phone' },
|
scopedSlots: { customRender: 'user-username' },
|
||||||
align: 'center'
|
align: 'center'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -132,18 +140,6 @@ const columns = [
|
|||||||
scopedSlots: { customRender: 'time' },
|
scopedSlots: { customRender: 'time' },
|
||||||
width: 240,
|
width: 240,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '优惠券类型',
|
|
||||||
scopedSlots: { customRender: 'type' },
|
|
||||||
width: 140,
|
|
||||||
align: 'center'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '优惠券状态',
|
|
||||||
scopedSlots: { customRender: 'status' },
|
|
||||||
width: 140,
|
|
||||||
align: 'center'
|
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
// title: '操作',
|
// title: '操作',
|
||||||
@@ -164,74 +160,34 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
exports_can: false,
|
|
||||||
columns,
|
columns,
|
||||||
searchType: false, // 展示全部的搜索
|
goods: [], // 优惠券类型
|
||||||
businessArray: [], // 业务类型
|
status: [], // 优惠券使用状态
|
||||||
statusArray: [], // 机构列表
|
|
||||||
|
|
||||||
queryParam: {
|
queryParam: {
|
||||||
order_no: '', // 订单编号
|
goods_id: undefined, // 商品id
|
||||||
institution: '', // 机构名称
|
manage_username: undefined, // 管理人手机号或昵称
|
||||||
item_id: '', // 机构编号
|
username: undefined, // 使用人手机号或昵称
|
||||||
nickname: '', // 下单人
|
status: undefined // 优惠券状态
|
||||||
business_type_id: '', // 业务类型
|
|
||||||
status: '', // 机构状态
|
|
||||||
paid_at: undefined, // 下单时间
|
|
||||||
audit_at: undefined, // 执行时间
|
|
||||||
settle_at: undefined // 结案时间
|
|
||||||
},
|
},
|
||||||
listCount: 0,
|
|
||||||
loadData: (parameter) => {
|
loadData: (parameter) => {
|
||||||
const requestParameters = Object.assign({}, parameter, this.queryParam)
|
const requestParameters = Object.assign({}, parameter, this.queryParam)
|
||||||
return getList(requestParameters)
|
return getMiddlesCoupons(requestParameters).then(res => {
|
||||||
|
if (this.goods.length === 0) {
|
||||||
|
this.goods = res.search.goods
|
||||||
|
this.status = res.search.status
|
||||||
|
}
|
||||||
|
return res.cards
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route (to, from) {
|
$route (to, from) {
|
||||||
if (
|
|
||||||
(from.name === 'Detail' && to.name === 'FristCheckrderIndex') ||
|
|
||||||
(from.name === 'Home' && to.name === 'FristCheckrderIndex') ||
|
|
||||||
(from.name === 'AssignrderIndex' && to.name === 'FristCheckrderIndex') ||
|
|
||||||
(from.name === 'SignInrderIndex' && to.name === 'FristCheckrderIndex') ||
|
|
||||||
(from.name === 'ReCheckrderIndex' && to.name === 'FristCheckrderIndex') ||
|
|
||||||
(from.name === 'HandleService' && to.name === 'FristCheckrderIndex') ||
|
|
||||||
(from.name === 'CompleteOrder' && to.name === 'FristCheckrderIndex')
|
|
||||||
) {
|
|
||||||
this.$refs.table.loadData()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
|
||||||
this.init()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
moment,
|
moment,
|
||||||
// 获取检索的基本样式
|
|
||||||
init () {
|
|
||||||
init().then(res => {
|
|
||||||
this.statusArray = res.status // 机构状态
|
|
||||||
this.businessArray = res.type // 业务类型
|
|
||||||
// this.canExports()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 更改创建时间
|
|
||||||
onCreateChange (dates, dateStrings) {
|
|
||||||
this.queryParam.paid_at = dateStrings
|
|
||||||
},
|
|
||||||
// 更改执行时间
|
|
||||||
onCarryChange (dates, dateStrings) {
|
|
||||||
this.queryParam.audit_at = dateStrings
|
|
||||||
},
|
|
||||||
// 更改结案时间
|
|
||||||
onSettleChange (dates, dateStrings) {
|
|
||||||
this.queryParam.settle_at = dateStrings
|
|
||||||
},
|
|
||||||
// 处理状态
|
|
||||||
onDisposeChange (e) {
|
|
||||||
this.queryParam.dispose = e
|
|
||||||
},
|
|
||||||
// 业务类型
|
// 业务类型
|
||||||
onBusinessChange (e) {
|
onBusinessChange (e) {
|
||||||
this.queryParam.business_type_id = e
|
this.queryParam.business_type_id = e
|
||||||
@@ -247,43 +203,13 @@ export default {
|
|||||||
// 重置搜索列表
|
// 重置搜索列表
|
||||||
resetSearch () {
|
resetSearch () {
|
||||||
this.queryParam = {
|
this.queryParam = {
|
||||||
order_no: '', // 订单编号
|
goods_id: undefined, // 商品id
|
||||||
institution: '', // 机构名称
|
manage_username: undefined, // 管理人手机号或昵称
|
||||||
item_id: '', // 机构编号
|
username: undefined, // 使用人手机号或昵称
|
||||||
nickname: '', // 下单人
|
status: undefined // 优惠券状态
|
||||||
business_type_id: '', // 业务类型
|
|
||||||
status: '', // 机构状态
|
|
||||||
paid_at: undefined, // 下单时间
|
|
||||||
audit_at: undefined, // 执行时间
|
|
||||||
settle_at: undefined// 结案时间
|
|
||||||
}
|
}
|
||||||
this.$refs.table.refresh(true) // 重置接口且刷先到第一页
|
this.$refs.table.refresh(true) // 重置接口且刷先到第一页
|
||||||
},
|
},
|
||||||
// 机构是否能导出
|
|
||||||
canExports () {
|
|
||||||
canExport(storage.get('userid')).then(res => {
|
|
||||||
this.exports_can = res.exports
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 导出列表
|
|
||||||
exports () {
|
|
||||||
const params = this.queryParam
|
|
||||||
params.audit_at = this.queryParam.audit_at || ''
|
|
||||||
params.paid_at = this.queryParam.paid_at || ''
|
|
||||||
params.settle_at = this.queryParam.settle_at || ''
|
|
||||||
if (this.listCount > 0) {
|
|
||||||
let downUrl = institutionsExports() + '?user_id=' + storage.get('userid')
|
|
||||||
for (const key in params) {
|
|
||||||
downUrl = downUrl + '&' + key + '=' + params[key]
|
|
||||||
}
|
|
||||||
window.open(downUrl)
|
|
||||||
} else {
|
|
||||||
this.$notification.error({
|
|
||||||
message: '温馨提醒',
|
|
||||||
description: '数据为空不能下载!'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 新增用户
|
// 新增用户
|
||||||
onAddRole () {
|
onAddRole () {
|
||||||
const success = {
|
const success = {
|
||||||
|
|||||||
Reference in New Issue
Block a user