新增订单列表对接数据
This commit is contained in:
parent
87d084dfed
commit
0998c30b1a
|
|
@ -2,8 +2,9 @@ ENV = 'development'
|
|||
|
||||
# 接口地址
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.128:8000' // 刘一帆
|
||||
VUE_APP_BASE_API = 'http://192.168.2.98:8000'
|
||||
# VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.98:8000' // 公司测试
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.96:8000' // 阿伟
|
||||
VUE_APP_BASE_API = 'https://cashieradmin.sxczgkj.cn'
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.16:8000'
|
||||
VUE_APP_WS_API = 'ws://192.168.2.128:8000'
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoData(data) {
|
||||
return request({
|
||||
url: '/api/tbOrderInfo/date',
|
||||
method: 'post',
|
||||
data: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
...data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param {*} data
|
||||
* @returns
|
||||
*/
|
||||
export function tbOrderInfoDownload(data) {
|
||||
return request({
|
||||
url: '/api/tbOrderInfo/download',
|
||||
method: 'post',
|
||||
data: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
...data
|
||||
},
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<div class="list_title">{{ item.name }}</div>
|
||||
<div class="item_wrap">
|
||||
<el-button :type="item.active ? 'primary' : ''" @click="selectHandle(item)">全部</el-button>
|
||||
<el-button :type="item.active ? 'primary' : ''" v-for="val in item.childrenList" :key="val.id"
|
||||
<el-button :type="val.active ? 'primary' : ''" v-for="val in item.childrenList" :key="val.id"
|
||||
@click="selectHandle(val, index)">{{
|
||||
val.name }}</el-button>
|
||||
</div>
|
||||
|
|
@ -58,9 +58,12 @@ export default {
|
|||
},
|
||||
// 选择分类
|
||||
selectHandle(item, index = -1) {
|
||||
console.log(item, index)
|
||||
if (index != -1) {
|
||||
this.categorys[index].childrenList.map(val => {
|
||||
val.active = false
|
||||
this.categorys[index].active = false
|
||||
} else {
|
||||
item.childrenList.map(item => {
|
||||
item.active = false
|
||||
})
|
||||
}
|
||||
item.active = !item.active
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">查询</el-button>
|
||||
<el-button>重置</el-button>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="head-container">
|
||||
|
|
@ -31,13 +31,11 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售价">
|
||||
|
||||
<template v-slot="scope">
|
||||
¥{{ scope.row.lowPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销量/库存">
|
||||
|
||||
<template v-slot="scope">
|
||||
0/0
|
||||
</template>
|
||||
|
|
@ -46,7 +44,8 @@
|
|||
</el-table>
|
||||
</div>
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="confirmHandle">确 定</el-button>
|
||||
|
|
@ -87,12 +86,18 @@ export default {
|
|||
this.searhForm.name = ''
|
||||
this.searhForm.category = ''
|
||||
this.tableData.page = 0
|
||||
this.tableData.size = 10
|
||||
this.tableData.list = []
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 商品列表
|
||||
|
|
@ -102,6 +107,8 @@ export default {
|
|||
const res = await tbProduct({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.searhForm.name,
|
||||
categoryId: this.searhForm.category,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
sort: 'id',
|
||||
})
|
||||
|
|
@ -140,6 +147,7 @@ export default {
|
|||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.tbShopCategoryGet()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { Notification } from 'element-ui'
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
|
|
@ -49,8 +50,12 @@ export default {
|
|||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.crud.notify(msg.message, CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
// console.log(e)
|
||||
const m = JSON.parse(e.message)
|
||||
Notification.error({
|
||||
title: m.message,
|
||||
duration: 5000
|
||||
})
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,9 @@
|
|||
</template> -->
|
||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="user.avatarName ? baseApi + '/avatar/' + user.avatarName : Avatar" class="user-avatar">
|
||||
<img :src="logo || Avatar" class="user-avatar">
|
||||
<!-- <i class="el-icon-caret-bottom" /> -->
|
||||
<span class="shop_name">{{ shopName }}</span>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<!-- <span style="display:block;" @click="show = true">
|
||||
|
|
@ -65,7 +66,9 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
Avatar: Avatar,
|
||||
dialogVisible: false
|
||||
dialogVisible: false,
|
||||
logo: localStorage.getItem('logo'),
|
||||
shopName: localStorage.getItem('shopName')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -171,8 +174,9 @@ export default {
|
|||
margin-right: 10px;
|
||||
|
||||
.avatar-wrapper {
|
||||
margin-top: 5px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.user-avatar {
|
||||
cursor: pointer;
|
||||
|
|
@ -188,6 +192,11 @@ export default {
|
|||
top: 25px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.shop_name {
|
||||
font-size: 16px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ const user = {
|
|||
// console.log('登录成功后返回===', res)
|
||||
localStorage.setItem('logoutHandle', false)
|
||||
localStorage.setItem('shopId', res.shopId)
|
||||
localStorage.setItem('shopName', res.shopName)
|
||||
localStorage.setItem('logo', res.logo)
|
||||
setToken(res.token, rememberMe)
|
||||
commit('SET_TOKEN', res.token)
|
||||
setUserInfo(res.user, commit)
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="设备尺寸">
|
||||
<el-radio-group v-model="form.config.width">
|
||||
<el-radio-button label="58mm"></el-radio-button>
|
||||
<el-radio-button label="80mm"></el-radio-button>
|
||||
<el-radio-button label="58">58mm</el-radio-button>
|
||||
<el-radio-button label="80">80mm</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
<el-switch v-model="form.config.autoCut" :active-value="0" :inactive-value="1"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-switch v-model="form.status" :active-value="0" :inactive-value="1"></el-switch>
|
||||
<el-switch v-model="form.status" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序">
|
||||
<el-input-number v-model="form.sort" controls-position="right" :min="0"></el-input-number>
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import devices from '../devices'
|
||||
import { devices, models, subTypes } from '../devices'
|
||||
import { tbPrintMachine } from '@/api/devices'
|
||||
import classify from '@/components/classify'
|
||||
|
||||
|
|
@ -79,34 +79,8 @@ export default {
|
|||
return {
|
||||
dialogVisible: false,
|
||||
devices,
|
||||
models: [
|
||||
{
|
||||
value: 'normal',
|
||||
name: '普通出单'
|
||||
},
|
||||
{
|
||||
value: 'one',
|
||||
name: '一菜一品'
|
||||
},
|
||||
{
|
||||
value: 'category',
|
||||
name: '分类出单'
|
||||
}
|
||||
],
|
||||
subTypes: [
|
||||
{
|
||||
value: 'kitchen',
|
||||
name: '出品'
|
||||
},
|
||||
{
|
||||
value: 'cash',
|
||||
name: '小票'
|
||||
},
|
||||
{
|
||||
value: 'label',
|
||||
name: '标签'
|
||||
}
|
||||
],
|
||||
models,
|
||||
subTypes,
|
||||
feets: [0, 1, 2, 3, 4, 5, 8],
|
||||
loading: false,
|
||||
form: {
|
||||
|
|
@ -178,7 +152,7 @@ export default {
|
|||
show(obj) {
|
||||
this.dialogVisible = true
|
||||
if (obj && obj.id) {
|
||||
this.form = obj
|
||||
this.form = { ...obj }
|
||||
}
|
||||
},
|
||||
close() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
export default [
|
||||
export const devices = [
|
||||
{
|
||||
value: 'printer',
|
||||
name: '本地'
|
||||
},
|
||||
{
|
||||
value: 'yxyPrinter',
|
||||
name: '云想印'
|
||||
|
|
@ -7,4 +11,34 @@ export default [
|
|||
value: 'fePrinter',
|
||||
name: '飞鹅'
|
||||
}
|
||||
]
|
||||
|
||||
export const models = [
|
||||
{
|
||||
value: 'normal',
|
||||
name: '普通出单'
|
||||
},
|
||||
{
|
||||
value: 'one',
|
||||
name: '一菜一品'
|
||||
},
|
||||
{
|
||||
value: 'category',
|
||||
name: '分类出单'
|
||||
}
|
||||
]
|
||||
|
||||
export const subTypes = [
|
||||
{
|
||||
value: 'kitchen',
|
||||
name: '出品'
|
||||
},
|
||||
{
|
||||
value: 'cash',
|
||||
name: '小票'
|
||||
},
|
||||
{
|
||||
value: 'label',
|
||||
name: '标签'
|
||||
}
|
||||
]
|
||||
|
|
@ -11,31 +11,72 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">查询</el-button>
|
||||
<el-button>重置</el-button>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addDevice.show()">添加云打印机</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addDevice.show()">
|
||||
添加云打印机
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="设备名称" prop="name"></el-table-column>
|
||||
<el-table-column label="设备号" prop="address"></el-table-column>
|
||||
<el-table-column label="品牌" prop="contentType">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.contentType | devicesName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出品模式" prop="config.model">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.config.model | modelsName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打印类型" prop="subType">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.subType | subTypesName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" sortable prop="createdAt">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.createdAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" sortable prop="sort"></el-table-column>
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
|
||||
@change="statusChange($event, scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
@click="$refs.addDevice.show(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total"></el-pagination>
|
||||
</div>
|
||||
<addDevice ref="addDevice" />
|
||||
<addDevice ref="addDevice" @success="getTableData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import devices from './devices'
|
||||
import { devices, models, subTypes } from './devices'
|
||||
import addDevice from './components/addDevice'
|
||||
import { tbPrintMachineGet } from '@/api/devices'
|
||||
import { tbPrintMachineGet, tbPrintMachine } from '@/api/devices'
|
||||
import dayjs from 'dayjs'
|
||||
export default {
|
||||
components: {
|
||||
addDevice
|
||||
|
|
@ -56,15 +97,41 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
devicesName(value) {
|
||||
return devices.find(item => item.value == value).name
|
||||
},
|
||||
modelsName(value) {
|
||||
return models.find(item => item.value == value).name
|
||||
},
|
||||
subTypesName(value) {
|
||||
return subTypes.find(item => item.value == value).name
|
||||
},
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true
|
||||
const data = { ...row }
|
||||
data.status = e
|
||||
await tbPrintMachine(data, 'put')
|
||||
this.getTableData()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
this.tableData.loading = false
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = ''
|
||||
this.query.categoryId = ''
|
||||
this.query.typeEnum = ''
|
||||
this.query.type = ''
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
|
|
@ -77,8 +144,6 @@ export default {
|
|||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbPrintMachineGet({
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
name: this.query.name,
|
||||
contentType: this.query.type
|
||||
})
|
||||
|
|
@ -88,7 +153,7 @@ export default {
|
|||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -43,7 +43,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" @click="$refs.invoicingDetail.show(scope.row)">库存记录</el-button>
|
||||
<el-button type="text" size="mini"
|
||||
@click="$refs.invoicingDetail.show(scope.row)">库存记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
export default {
|
||||
status: [
|
||||
{
|
||||
key: 'unpaid',
|
||||
label: '待支付'
|
||||
},
|
||||
{
|
||||
key: 'unsend',
|
||||
label: '待发货'
|
||||
},
|
||||
{
|
||||
key: 'closed',
|
||||
label: '订单完成'
|
||||
},
|
||||
{
|
||||
key: 'send',
|
||||
label: '已发'
|
||||
},
|
||||
{
|
||||
key: 'refunding',
|
||||
label: '申请退单'
|
||||
},
|
||||
{
|
||||
key: 'refund',
|
||||
label: '退单'
|
||||
},
|
||||
{
|
||||
key: 'cancelled',
|
||||
label: '取消订单'
|
||||
},
|
||||
{
|
||||
key: 'merge',
|
||||
label: '合台'
|
||||
},
|
||||
{
|
||||
key: 'pending',
|
||||
label: '挂单'
|
||||
},
|
||||
{
|
||||
key: 'activate',
|
||||
label: '激活'
|
||||
},
|
||||
{
|
||||
key: 'paying',
|
||||
label: '支付中'
|
||||
}
|
||||
],
|
||||
sendType: [
|
||||
{
|
||||
key: 'post',
|
||||
label: '快递'
|
||||
},
|
||||
{
|
||||
key: 'takeaway',
|
||||
label: '外卖'
|
||||
},
|
||||
{
|
||||
key: 'takeself',
|
||||
label: '自提'
|
||||
},
|
||||
{
|
||||
key: 'table',
|
||||
label: '堂食'
|
||||
}
|
||||
],
|
||||
orderType: [
|
||||
{
|
||||
key: 'cash',
|
||||
label: '收银'
|
||||
},
|
||||
{
|
||||
key: 'miniapp',
|
||||
label: '小程序'
|
||||
},
|
||||
{
|
||||
key: 'offline',
|
||||
label: '线下'
|
||||
},
|
||||
{
|
||||
key: 'return',
|
||||
label: '退单'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,336 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="orderType" @tab-click="getTableData">
|
||||
<el-tab-pane label="全部订单" name=""></el-tab-pane>
|
||||
<el-tab-pane label="收银订单" name="cash"></el-tab-pane>
|
||||
<el-tab-pane label="小程序订单" name="miniapp"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="head-container">
|
||||
<el-form :model="query" label-width="100px" label-position="left">
|
||||
<el-form-item label="订单状态">
|
||||
<el-radio-group v-model="query.status">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button :label="item.key" v-for="item in orderEnum.status" :key="item.key">
|
||||
{{ item.label }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式">
|
||||
<el-radio-group v-model="query.payType">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button :label="item.payType" v-for="item in payTypes" :key="item.payType">
|
||||
{{ item.payName }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-radio-group v-model="timeValue" @change="timeChange">
|
||||
<el-radio-button label="">全部</el-radio-button>
|
||||
<el-radio-button label="0">今天</el-radio-button>
|
||||
<el-radio-button label="-1">昨天</el-radio-button>
|
||||
<el-radio-button label="-7">最近7天</el-radio-button>
|
||||
<el-radio-button label="-30">最近30天</el-radio-button>
|
||||
<el-radio-button label="week">本周</el-radio-button>
|
||||
<el-radio-button label="month">本月</el-radio-button>
|
||||
<el-radio-button label="custom">自定义</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" v-if="timeValue == 'custom'">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="query.orderNo" placeholder="请输入订单号" style="width: 300px;"></el-input>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
|
||||
<span v-if="!downloadLoading">导出Excel</span>
|
||||
<span v-else>下载中...</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div class="head-container">
|
||||
<div class="collect_wrap">
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
<i class="el-icon-s-goods"></i>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="m">¥224.45</div>
|
||||
<div class="t">总金额</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading">
|
||||
<el-table-column label="订单号信息">
|
||||
<template v-slot="scope">
|
||||
<div class="table_order_info">
|
||||
<div class="order_no">{{ scope.row.orderNo }}</div>
|
||||
<!-- <div>会员 {{ scope.row.orderNo }}</div> -->
|
||||
<div class="type">【{{ scope.row.orderType | orderTypeFilter }}{{ scope.row.sendType |
|
||||
sendTypeFilter }}】</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
<template v-slot="scope">
|
||||
<div class="goods_info">
|
||||
<div class="row" v-for="item in scope.row.detailList" :key="item.id">
|
||||
<el-image :src="item.productImg" class="cover" lazy></el-image>
|
||||
<div class="info">
|
||||
<div class="name">{{ item.productName }}</div>
|
||||
<div class="sku">{{ item.productSkuName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额">
|
||||
<template v-slot="scope">
|
||||
<div>{{ scope.row.orderType | orderTypeFilter }}</div>
|
||||
<div>¥{{ scope.row.productAmount }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="primary" v-if="scope.row.status == 'closed'">
|
||||
{{ scope.row.status | statusFilter }}
|
||||
</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.status != 'closed'">
|
||||
{{ scope.row.status | statusFilter }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.createdAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" @size-change="sizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import orderEnum from './orderEnum'
|
||||
import { tbShopPayTypeGet } from '@/api/setting'
|
||||
import { tbOrderInfoData, tbOrderInfoDownload } from '@/api/order'
|
||||
import dayjs from 'dayjs'
|
||||
import { downloadFile } from '@/utils/index'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderEnum,
|
||||
payTypes: [],
|
||||
timeValue: '',
|
||||
resetQuery: null,
|
||||
orderType: "",
|
||||
query: {
|
||||
id: '',
|
||||
status: '',
|
||||
payType: '',
|
||||
orderNo: '',
|
||||
createdAt: []
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
downloadLoading: false
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
orderTypeFilter(t) {
|
||||
if (t) {
|
||||
return t && orderEnum.orderType.find(item => item.key == t).label
|
||||
} else {
|
||||
return t
|
||||
}
|
||||
},
|
||||
sendTypeFilter(t) {
|
||||
if (t) {
|
||||
return orderEnum.sendType.find(item => item.key == t).label
|
||||
} else {
|
||||
return t
|
||||
}
|
||||
},
|
||||
statusFilter(t) {
|
||||
if (t) {
|
||||
return t && orderEnum.status.find(item => item.key == t).label
|
||||
} else {
|
||||
return t
|
||||
}
|
||||
},
|
||||
timeFilter(time) {
|
||||
return dayjs(time).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.resetQuery = { ...this.query }
|
||||
this.tbShopPayTypeGet()
|
||||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
// 导出Excel
|
||||
async downloadHandle() {
|
||||
try {
|
||||
this.downloadLoading = true
|
||||
const file = await tbOrderInfoDownload({
|
||||
orderType: this.orderType,
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
...this.query
|
||||
})
|
||||
downloadFile(file, '订单数据', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
} catch (error) {
|
||||
this.downloadLoading = false
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.timeValue = ''
|
||||
this.query = { ...this.resetQuery }
|
||||
this.page = 0
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
this.tableData.size = e
|
||||
this.getTableData()
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbOrderInfoData({
|
||||
page: this.tableData.page,
|
||||
pageSize: this.tableData.size,
|
||||
orderType: this.orderType,
|
||||
...this.query
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res.content
|
||||
this.tableData.total = res.totalElements
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 切换时间
|
||||
timeChange(e) {
|
||||
const format = ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']
|
||||
switch (e) {
|
||||
case '':
|
||||
// 全部
|
||||
this.query.createdAt = []
|
||||
break;
|
||||
case '0':
|
||||
// 今天
|
||||
this.query.createdAt = [dayjs().format(format[0]), dayjs().format(format[1])]
|
||||
break;
|
||||
case '-1':
|
||||
// 昨天
|
||||
this.query.createdAt = [dayjs().add(-1, 'd').format(format[0]), dayjs().add(-1, 'd').format(format[1])]
|
||||
break;
|
||||
case '-7':
|
||||
// 最近7天
|
||||
this.query.createdAt = [dayjs().add(-7, 'd').format(format[0]), dayjs().format(format[1])]
|
||||
break;
|
||||
case '-30':
|
||||
// 最近7天
|
||||
this.query.createdAt = [dayjs().add(-30, 'd').format(format[0]), dayjs().format(format[1])]
|
||||
break;
|
||||
case 'week':
|
||||
// 本周
|
||||
this.query.createdAt = [dayjs().startOf('week').format(format[0]), dayjs().endOf('week').format(format[1])]
|
||||
break;
|
||||
case 'month':
|
||||
// 本周
|
||||
this.query.createdAt = [dayjs().startOf('month').format(format[0]), dayjs().endOf('month').format(format[1])]
|
||||
break;
|
||||
case 'custom':
|
||||
// 自定义
|
||||
this.query.createdAt = []
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 获取支付方式
|
||||
async tbShopPayTypeGet() {
|
||||
try {
|
||||
const { content } = await tbShopPayTypeGet({
|
||||
page: 0,
|
||||
size: 100,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.payTypes = content
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.collect_wrap {
|
||||
display: flex;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.table_order_info {
|
||||
.order_no {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.type {
|
||||
color: #E6A23C;
|
||||
}
|
||||
}
|
||||
|
||||
.goods_info {
|
||||
.row {
|
||||
display: flex;
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 10px;
|
||||
|
||||
.sku {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -43,7 +43,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品信息">
|
||||
|
||||
<template v-slot="scope">
|
||||
<div class="shop_list">
|
||||
<div class="item" v-for="item in scope.row.goods" :key="item.id">
|
||||
|
|
@ -57,7 +56,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="几选几">
|
||||
|
||||
<template v-slot="scope">
|
||||
<span>{{ scope.row.goods.length }}选</span>
|
||||
<el-input-number v-model="scope.row.number" controls-position="right"
|
||||
|
|
@ -65,7 +63,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160">
|
||||
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="tableAddShop(scope.$index, scope.row.goods)">添加商品</el-button>
|
||||
<el-button type="text" @click="form.groupSnap.splice(scope.$index, 1)">删除分组</el-button>
|
||||
|
|
@ -79,32 +76,36 @@
|
|||
<el-table :data="form.skuList" border>
|
||||
<el-table-column label="售价" prop="salePrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.salePrice"></el-input-number>
|
||||
<el-input-number v-model="scope.row.salePrice" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会员价" prop="memberPrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.memberPrice"></el-input-number>
|
||||
<el-input-number v-model="scope.row.memberPrice"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成本价" prop="costPrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.costPrice"></el-input-number>
|
||||
<el-input-number v-model="scope.row.costPrice" controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="原价" prop="originPrice">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.originPrice"></el-input-number>
|
||||
<el-input-number v-model="scope.row.originPrice"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.stockNumber" :disabled="!!form.id"></el-input-number>
|
||||
<el-input-number v-model="scope.row.stockNumber" :disabled="!!form.id"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分销金额" prop="firstShared">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.firstShared"></el-input-number>
|
||||
<el-input-number v-model="scope.row.firstShared"
|
||||
controls-position="right"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品条码">
|
||||
|
|
@ -427,9 +428,9 @@ export default {
|
|||
}
|
||||
},
|
||||
// 提交
|
||||
async submitHandle() {
|
||||
try {
|
||||
this.$refs.formRef.validate(async faild => {
|
||||
submitHandle() {
|
||||
this.$refs.formRef.validate(async faild => {
|
||||
try {
|
||||
if (faild) {
|
||||
this.loading = true
|
||||
this.form.lowPrice = this.form.skuList[0].salePrice
|
||||
|
|
@ -448,13 +449,13 @@ export default {
|
|||
type: 'success'
|
||||
});
|
||||
this.$router.back()
|
||||
this.loading = true
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
this.loading = true
|
||||
console.log(error)
|
||||
}
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
console.log(error)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 给分组添加商品
|
||||
tableAddShop(index, goods) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ export default {
|
|||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.tableData.page = e -1;
|
||||
this.getTableData()
|
||||
},
|
||||
// 删除
|
||||
|
|
|
|||
|
|
@ -12,9 +12,12 @@
|
|||
</el-button>
|
||||
</div>
|
||||
<div class="shop_list">
|
||||
<div class="item" v-for="(item, index) in productIds" :key="item.id" :data-index="index + 1"
|
||||
<div class="item_wrap" v-for="(item, index) in productIds" :key="item.id"
|
||||
@click="productIds.splice(index, 1)">
|
||||
<el-image :src="item.coverImg" style="width: 100%;height: 100%;"></el-image>
|
||||
<div class="item" :data-index="index + 1">
|
||||
<el-image :src="item.coverImg" style="width: 100%;height: 100%;"></el-image>
|
||||
</div>
|
||||
<div class="name">{{ item.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
@ -133,60 +136,70 @@ export default {
|
|||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.item {
|
||||
.item_wrap {
|
||||
$size: 80px;
|
||||
$radius: 4px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
.item {
|
||||
$radius: 4px;
|
||||
width: $size;
|
||||
height: $size;
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
margin-top: 10px;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
|
||||
&::before {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: attr(data-index);
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-radius: 0 0 $radius 0;
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
&::before {
|
||||
transform: translateY(0);
|
||||
content: '删除';
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
transform: translateY(100%);
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: attr(data-index);
|
||||
font-size: 12px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
border-radius: 0 0 $radius 0;
|
||||
align-items: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: '删除';
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
padding: 0 10px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(10px);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
transform: translateY(100%);
|
||||
transition: all .1s ease-in-out;
|
||||
.name {
|
||||
width: $size;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export default {
|
|||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e
|
||||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 删除
|
||||
|
|
|
|||
Loading…
Reference in New Issue