优惠券列表接口对接

This commit is contained in:
JasonChen
2023-08-02 17:30:01 +08:00
parent b0c8ee91c5
commit 9b09e33695
8 changed files with 5718 additions and 5108 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -14,7 +14,7 @@
'/static/axios.min.js'
否则报错
# node 版本 10.23.1
# node 版本 node-v14.21.3
# 水感应测试-存放路径
/home/wwwroot/Development/Douhuo/agent

11
public/index.html vendored
View File

@@ -23,7 +23,7 @@
<div class="loading-wrp">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
<div style="display: flex; justify-content: center; align-items: center;"WaterFeel.manager Co.,Ltd.</div>
<div>WaterFeel.manager Co.,Ltd.</div>
</div>
</div>
<!-- require cdn assets js -->
@@ -32,4 +32,13 @@
<% } %>
<!-- built files will be auto injected -->
</body>
<style>
.bottomText{
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
flex-direction: row;
}
</style>
</html>

10
src/api/coupon.js Normal file
View File

@@ -0,0 +1,10 @@
import request from '@/utils/request'
// 优惠券列表
export function getMiddlesCoupons (parameter) {
return request({
url: '/middles/stock/coupons',
method: 'get',
params: parameter
})
}

View File

@@ -14,10 +14,10 @@
<a-icon type="lock" />
修改密码
</a-menu-item>
<!-- <a-menu-item key="changePermission" @click="goPermission">
<a-menu-item key="changePermission" @click="goPermission">
<a-icon type="setting" />
权限管理
</a-menu-item> -->
</a-menu-item>
<a-menu-item key="logout" @click="handleLogout">
<a-icon type="logout" />
退出登录

View File

@@ -13,7 +13,7 @@ import {
import detail from './routes/detail'
import stock from './routes/stock'
import user from './routes/user'
// import coupon from './routes/coupon'
import coupon from './routes/coupon'
import permission from './routes/permission'
import sales from './routes/sales'
import cityExperienceOfficer from './routes/cityExperienceOfficer'
@@ -42,7 +42,7 @@ export const asyncRouterMap = [{
...stock,
...sales,
...user,
// ...coupon,
...coupon,
...permission
]
},

View File

@@ -6,35 +6,32 @@
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-form-item label="优惠券生成人姓名">
<a-input v-model="queryParam.item_id" placeholder="优惠券生成人姓名" />
<a-form-item label="管理人手机号或昵称">
<a-input v-model="queryParam.manage_username" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="优惠券类型" has-feedback>
<a-select v-model="queryParam.business_type_id" @change="onBusinessChange" placeholder="优惠券类型">
<a-select-option v-for="item in businessArray" :key="item.id" :value="item.id">{{ item.title }}</a-select-option>
<a-form-item label="优惠券名称" has-feedback>
<a-select v-model="queryParam.goods_id" placeholder="请选择">
<a-select-option v-for="item in goods" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="优惠券状态" has-feedback>
<a-select v-model="queryParam.business_type_id" @change="onBusinessChange" placeholder="优惠券状态">
<a-select-option v-for="item in businessArray" :key="item.id" :value="item.id">{{ item.title }}</a-select-option>
<a-select v-model="queryParam.status" placeholder="请选择">
<a-select-option v-for="item in status" :key="item.value" :value="item.value">{{ item.text }}</a-select-option>
</a-select>
</a-form-item>
</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-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
v-if="exports_can"
class="ml8"
type="dashed"
shape="round"
icon="download"
@click="exports"/>
</a-col>
</a-row>
</a-form>
@@ -47,26 +44,29 @@
ref="table"
:columns="columns"
:data="loadData"
:rowKey="(row) => row.order_item_id"
:rowKey="(row) => row.stock_card_id"
showPagination="auto"
bordered
size="default"
:scroll="{ x: 1200, y: 1000 }">
<div slot="name">
<div>zdx</div>
<div slot="manage-name" slot-scope="text,record">
<div>{{ record.manage.nickname || '--' }}{{ record.manage.name?'('+record.manage.name+')':'' }}</div>
</div>
<div slot="phone">
<div>14745798066</div>
<div slot="manage-username" slot-scope="text,record">
<div>{{ record.manage.username || '--' }}</div>
</div>
<div slot="time">
<div>2023-11-11~2029-11-11</div>
<div slot="user-name" slot-scope="text,record">
<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 slot="type">
<div>3瓶优惠券</div>
</div>
<div slot="status">
<div>待使用</div>
<div slot="status" slot-scope="text, record">
<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>
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
<!-- 操作 -->
@@ -81,31 +81,39 @@
<script>
import { STable, UserInfo } from '@/components'
import DeriveButton from '@/components/OrderDetailInfo/DeriveButton'
import { institutionsExports } from '@/api/storage'
import moment from 'moment'
import Info from '@/views/home/components/Info'
import {
getList,
init,
canExport
} from '@/api/organization'
import storage from 'store'
getMiddlesCoupons
} from '@/api/coupon'
import StockInfo from './widgets/StockInfo.vue'
import AddRole from './widgets/AddRole.vue'
// 列表规格
const columns = [
{
title: '优惠券名称',
dataIndex: 'name',
width: 120,
align: 'center'
},
{
title: '优惠券状态',
scopedSlots: { customRender: 'status' },
width: 140,
align: 'center'
},
{
title: '优惠券生成人',
children: [
{
title: '姓名',
scopedSlots: { customRender: 'name' },
scopedSlots: { customRender: 'manage-name' },
align: 'center'
},
{
title: '手机号',
scopedSlots: { customRender: 'phone' },
scopedSlots: { customRender: 'manage-username' },
align: 'center'
}
],
@@ -116,12 +124,12 @@ const columns = [
children: [
{
title: '姓名',
scopedSlots: { customRender: 'name' },
scopedSlots: { customRender: 'user-name' },
align: 'center'
},
{
title: '手机号',
scopedSlots: { customRender: 'phone' },
scopedSlots: { customRender: 'user-username' },
align: 'center'
}
],
@@ -132,18 +140,6 @@ const columns = [
scopedSlots: { customRender: 'time' },
width: 240,
align: 'center'
},
{
title: '优惠券类型',
scopedSlots: { customRender: 'type' },
width: 140,
align: 'center'
},
{
title: '优惠券状态',
scopedSlots: { customRender: 'status' },
width: 140,
align: 'center'
}
// {
// title: '操作',
@@ -164,74 +160,34 @@ export default {
},
data () {
return {
exports_can: false,
columns,
searchType: false, // 展示全部的搜索
businessArray: [], // 业务类型
statusArray: [], // 机构列表
goods: [], // 优惠券类型
status: [], // 优惠券使用状态
queryParam: {
order_no: '', // 订单编号
institution: '', // 机构名
item_id: '', // 机构编号
nickname: '', // 下单人
business_type_id: '', // 业务类型
status: '', // 机构状态
paid_at: undefined, // 下单时间
audit_at: undefined, // 执行时间
settle_at: undefined // 结案时间
goods_id: undefined, // 商品id
manage_username: undefined, // 管理人手机号或昵
username: undefined, // 使用人手机号或昵称
status: undefined // 优惠券状态
},
listCount: 0,
loadData: (parameter) => {
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: {
$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: {
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) {
this.queryParam.business_type_id = e
@@ -247,43 +203,13 @@ export default {
// 重置搜索列表
resetSearch () {
this.queryParam = {
order_no: '', // 订单编号
institution: '', // 机构名
item_id: '', // 机构编号
nickname: '', // 下单人
business_type_id: '', // 业务类型
status: '', // 机构状态
paid_at: undefined, // 下单时间
audit_at: undefined, // 执行时间
settle_at: undefined// 结案时间
goods_id: undefined, // 商品id
manage_username: undefined, // 管理人手机号或昵
username: undefined, // 使用人手机号或昵称
status: undefined // 优惠券状态
}
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 () {
const success = {

10595
yarn.lock

File diff suppressed because it is too large Load Diff