Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq
This commit is contained in:
commit
89a4ab2c72
|
|
@ -0,0 +1,32 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
class API {
|
||||
constructor(url, req) {
|
||||
const map = {
|
||||
add: 'POST',
|
||||
del: 'DELETE',
|
||||
update: 'PUT',
|
||||
get: 'GET'
|
||||
}
|
||||
this.url = url
|
||||
for (let key in map) {
|
||||
this[key] = function (data) {
|
||||
data = Array.isArray(data) ? data : {
|
||||
...data, shopId: localStorage.getItem("shopId"),
|
||||
}
|
||||
if (key === 'del') {
|
||||
delete data.shopId
|
||||
}
|
||||
const par={ url, method: map[key] }
|
||||
if(key==='get'){
|
||||
par.params=data
|
||||
}else{
|
||||
par.data=data
|
||||
}
|
||||
return request(par)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default API
|
||||
|
|
@ -18,3 +18,11 @@ export function modfiyUserInfo(data) {
|
|||
data,
|
||||
});
|
||||
}
|
||||
// 校验安全密码
|
||||
export function tbShopInfoPUT(data) {
|
||||
return request({
|
||||
url: "/api/tbShopInfo",
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,10 +625,18 @@ export function tbShopUseredit(data) {
|
|||
});
|
||||
}
|
||||
// 通过活动id获取赠送商品列表
|
||||
|
||||
export function activate(id) {
|
||||
return request({
|
||||
url: `shop/storage/activate/${id}`,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
||||
// 通过活动id获取赠送商品列表
|
||||
export function queryShopUserFlow(params) {
|
||||
return request({
|
||||
url: `/api/tbShopUser/queryShopUserFlow`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
import $api from './class-api'
|
||||
import request from '@/utils/request'
|
||||
|
||||
export const $version = new $api('/api/tbVersion')
|
||||
/**
|
||||
* 修改当前选中 版本
|
||||
* @returns
|
||||
*/
|
||||
export function $upSel(data) {
|
||||
return request({
|
||||
url: 'api/tbVersion/upSel',
|
||||
method: "put",
|
||||
data: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传版本文件
|
||||
* @returns
|
||||
*/
|
||||
export function $uploadVersionFile(file, par) {
|
||||
var data = new FormData()
|
||||
data.append('file', file)
|
||||
for(let i in par){
|
||||
if(i!=='file'){
|
||||
data.append(i, par[i])
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: 'api/qiNiuContent/uploadVersionFile',
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 877 B |
|
|
@ -0,0 +1,367 @@
|
|||
.u-relative,
|
||||
.u-rela,
|
||||
.relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.u-absolute,
|
||||
.u-abso,
|
||||
.absolute {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.u-fixed,
|
||||
.u-fix {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
// nvue不能用标签命名样式,不能放在微信组件中,否则微信开发工具会报警告,无法使用标签名当做选择器
|
||||
/* #ifndef APP-NVUE */
|
||||
image {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// 在weex,也即nvue中,所有元素默认为border-box
|
||||
view,
|
||||
text {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* #endif */
|
||||
|
||||
.u-font-xs {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.u-font-sm {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.u-font-md {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.u-font-lg {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.u-font-xl {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.u-flex {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.u-flex-wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.u-flex-nowrap {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.free-price {
|
||||
text-decoration: line-through;
|
||||
color: #999;
|
||||
}
|
||||
.cur-pointer{
|
||||
cursor: pointer;
|
||||
}
|
||||
.u-col-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.u-col-top {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.u-col-bottom {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.u-row-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.u-row-left {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.u-row-right {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.u-row-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.u-row-around {
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.u-text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.u-text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.u-text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.u-flex-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
// 定义flex等分
|
||||
@for $i from 0 through 12 {
|
||||
.u-flex-#{$i} {
|
||||
flex: $i;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义字体(px)单位,小于20都为px单位字体
|
||||
@for $i from 9 to 20 {
|
||||
.u-font-#{$i} {
|
||||
font-size: $i + px;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义字体(rpx)单位,大于或等于20的都为rpx单位字体
|
||||
@for $i from 20 through 40 {
|
||||
.u-font-#{$i} {
|
||||
font-size: $i + px;
|
||||
}
|
||||
}
|
||||
|
||||
// 定义内外边距,历遍1-80
|
||||
@for $i from 0 through 80 {
|
||||
|
||||
// 只要双数和能被5除尽的数
|
||||
@if $i % 2==0 or $i % 5==0 {
|
||||
|
||||
// 得出:u-margin-30或者u-m-30
|
||||
.u-margin-#{$i},
|
||||
.u-m-#{$i} {
|
||||
margin: $i + px !important;
|
||||
}
|
||||
|
||||
// 得出:u-padding-30或者u-p-30
|
||||
.u-padding-#{$i},
|
||||
.u-p-#{$i} {
|
||||
padding: $i + px !important;
|
||||
}
|
||||
|
||||
@each $short, $long in l left, t top, r right, b bottom {
|
||||
|
||||
// 缩写版,结果如: u-m-l-30
|
||||
// 定义外边距
|
||||
.u-m-#{$short}-#{$i} {
|
||||
margin-#{$long}: $i + px !important;
|
||||
}
|
||||
|
||||
// 定义内边距
|
||||
.u-p-#{$short}-#{$i} {
|
||||
padding-#{$long}: $i + px !important;
|
||||
}
|
||||
|
||||
// 完整版,结果如:u-margin-left-30
|
||||
// 定义外边距
|
||||
.u-margin-#{$long}-#{$i} {
|
||||
margin-#{$long}: $i + px !important;
|
||||
}
|
||||
|
||||
// 定义内边距
|
||||
.u-padding-#{$long}-#{$i} {
|
||||
padding-#{$long}: $i + px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 重置nvue的默认关于flex的样式
|
||||
.u-reset-nvue {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* start--文本行数限制--start */
|
||||
.u-line-1 {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.u-line-2 {
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.u-line-3 {
|
||||
-webkit-line-clamp: 3;
|
||||
}
|
||||
|
||||
.u-line-4 {
|
||||
-webkit-line-clamp: 4;
|
||||
}
|
||||
|
||||
.u-line-5 {
|
||||
-webkit-line-clamp: 5;
|
||||
}
|
||||
|
||||
.u-line-2,
|
||||
.u-line-3,
|
||||
.u-line-4,
|
||||
.u-line-5 {
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box; // 弹性伸缩盒
|
||||
-webkit-box-orient: vertical; // 设置伸缩盒子元素排列方式
|
||||
}
|
||||
|
||||
/* end--文本行数限制--end */
|
||||
|
||||
|
||||
/* start--不同颜色文字--start */
|
||||
.color-333 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.color-666 {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.color-red {
|
||||
color: rgb(250, 85, 85);
|
||||
}
|
||||
|
||||
|
||||
/* end--不同颜色文字--end */
|
||||
|
||||
.tranistion {
|
||||
transition: all .3s ease-in-out;
|
||||
}
|
||||
|
||||
.tranistion-1 {
|
||||
transition: all .1s ease-in-out;
|
||||
}
|
||||
|
||||
.tranistion-2 {
|
||||
transition: all .2s ease-in-out;
|
||||
}
|
||||
|
||||
.font-bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.font-600 {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.bg-gray {
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
|
||||
.w-full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.gap-10 {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.gap-20 {
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.color-aaa {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.color-000 {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.color-fff {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.bg-fff {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bg-gray {
|
||||
background-color: #F9F9F9;
|
||||
}
|
||||
|
||||
.overflow-hide {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.no-wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.border-r-12 {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.border-r-18 {
|
||||
border-radius: 18px;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #E5E5E5;
|
||||
}
|
||||
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
}
|
||||
|
||||
.scale7 {
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
.position-all {
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.lh16 {
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.default-box-padding {
|
||||
padding: 16px 14px;
|
||||
}
|
||||
|
||||
.zIndex-999 {
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.icon-default-size {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.filter-gray {
|
||||
filter: grayscale(1);
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ import "./assets/styles/element-variables.scss";
|
|||
|
||||
// global css
|
||||
import "./assets/styles/index.scss";
|
||||
import "./assets/styles/util.scss";
|
||||
|
||||
import App from "./App";
|
||||
import store from "./store";
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const getters = {
|
|||
fileUploadApi: state => state.api.fileUploadApi,
|
||||
updateAvatarApi: state => state.api.updateAvatarApi,
|
||||
qiNiuUploadApi: state => state.api.qiNiuUploadApi,
|
||||
versionUploadApi: state => state.api.versonUploadApi,
|
||||
sqlApi: state => state.api.sqlApi,
|
||||
swaggerApi: state => state.api.swaggerApi,
|
||||
sidebarRouters: state => state.permission.sidebarRouters
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ const api = {
|
|||
swaggerApi: baseUrl + '/doc.html',
|
||||
// 文件上传
|
||||
fileUploadApi: baseUrl + '/api/localStorage',
|
||||
// 上传版本文件
|
||||
versonUploadApi: baseUrl + '/api/qiNiuContent/uploadVersionFile',
|
||||
// baseUrl,
|
||||
baseApi: baseUrl
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()" @close="reset" top="5vh">
|
||||
<el-form :model="searhForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input>
|
||||
|
|
@ -93,6 +93,9 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
reset(){
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
onInput: _.debounce(function (event) {//防抖请求
|
||||
this.getTableData()
|
||||
}, 500),
|
||||
|
|
@ -210,6 +213,10 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.head-container{
|
||||
max-height: 60vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog width="60%" :visible.sync="dialogVisible" :title="query.conName">
|
||||
<el-dialog width="60%" :visible.sync="dialogVisible" :title="query.conName" top="5vh">
|
||||
<div class="app-container">
|
||||
<!-- <div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
|
|
@ -93,6 +93,10 @@
|
|||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.head-container{
|
||||
max-height: 60vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.cursor-pointer{
|
||||
cursor: pointer;
|
||||
color: #1890ff;
|
||||
|
|
|
|||
|
|
@ -94,8 +94,11 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="所属商品" width="220">
|
||||
<template v-slot="scope">
|
||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
|
||||
<div class="goods-list">
|
||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
|
||||
item.productName }}</el-button>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
|
|
@ -858,6 +861,13 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .goods-list .el-button--text span{
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
::v-deep .goods-list .el-button--text{
|
||||
white-space: break-spaces;
|
||||
}
|
||||
.color-success {
|
||||
color: #67c23a;
|
||||
cursor: pointer;
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@
|
|||
:title="dialogtitle"
|
||||
:visible.sync="dialogshow"
|
||||
width="1000px"
|
||||
top="5vh"
|
||||
@close="resetCommodityArr"
|
||||
>
|
||||
<el-form ref="addSelect" :inline="true">
|
||||
|
|
@ -153,96 +154,95 @@
|
|||
</template>
|
||||
</el-form-item> -->
|
||||
<template>
|
||||
<el-table :span-method="objectSpanMethod" :data="commodityArr">
|
||||
<el-table-column prop="name" label="商品名称"> </el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template v-slot="scope">
|
||||
<!-- 多规格 -->
|
||||
<template
|
||||
v-if="
|
||||
scope.row.typeEnum == '多规格' &&
|
||||
scope.row.isDistribute == 0
|
||||
"
|
||||
>
|
||||
{{ scope.row.specSnap }}
|
||||
</template>
|
||||
<!-- 单规格 -->
|
||||
<div v-else>
|
||||
{{ scope.row.name }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗材">
|
||||
<el-table-column label="耗材信息">
|
||||
<div class="scroll-box">
|
||||
<el-table :span-method="objectSpanMethod" :data="commodityArr">
|
||||
<el-table-column prop="name" label="商品名称"> </el-table-column>
|
||||
<el-table-column label="规格">
|
||||
<template v-slot="scope">
|
||||
<div>
|
||||
<div
|
||||
style="margin-bottom: 10px"
|
||||
v-for="(haocai, index) in scope.row.haocais"
|
||||
:key="index"
|
||||
>
|
||||
<template v-if="haocai.conName">
|
||||
<div>{{ haocai.conName }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="haocai.conName"
|
||||
style="width: 130px"
|
||||
placeholder="请选择耗材信息"
|
||||
></el-input>
|
||||
</template>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- 多规格 -->
|
||||
<template
|
||||
v-if="
|
||||
scope.row.typeEnum == '多规格' &&
|
||||
scope.row.isDistribute == 0
|
||||
"
|
||||
>
|
||||
{{ scope.row.specSnap }}
|
||||
</template>
|
||||
<!-- 单规格 -->
|
||||
<div v-else>
|
||||
{{ scope.row.name }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位耗材值" width="180">
|
||||
<template v-slot="scope">
|
||||
<div>
|
||||
<div
|
||||
style="margin-bottom: 10px; display: flex"
|
||||
v-for="(haocai, haocaiIndex) in scope.row.haocais"
|
||||
:key="haocaiIndex"
|
||||
>
|
||||
<el-input
|
||||
v-model="haocai.surplusStock"
|
||||
type="number"
|
||||
placeholder="单位耗材值"
|
||||
@input="handleKeyUp($event, haocaiIndex)"
|
||||
></el-input>
|
||||
<div style="margin-left: 10px">
|
||||
<el-button
|
||||
v-if="scope.row.haocais.length > 1"
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="
|
||||
delGoodsHaocai(scope.row.haocais, haocaiIndex)
|
||||
"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
></el-button>
|
||||
<el-table-column label="耗材">
|
||||
<el-table-column label="耗材信息">
|
||||
<template v-slot="scope">
|
||||
<div>
|
||||
<div
|
||||
style="margin-bottom: 10px"
|
||||
v-for="(haocai, index) in scope.row.haocais"
|
||||
:key="index"
|
||||
>
|
||||
<template v-if="haocai.conName">
|
||||
<div>{{ haocai.conName }}</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-input
|
||||
disabled
|
||||
v-model="haocai.conName"
|
||||
style="width: 130px"
|
||||
placeholder="请选择耗材信息"
|
||||
></el-input>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="selecthaocai(scope.row)"
|
||||
>去选择耗材信息</el-button
|
||||
>
|
||||
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位耗材值" width="180">
|
||||
<template v-slot="scope">
|
||||
<div>
|
||||
<div
|
||||
style="margin-bottom: 10px; display: flex"
|
||||
v-for="(haocai, haocaiIndex) in scope.row.haocais"
|
||||
:key="haocaiIndex"
|
||||
>
|
||||
<el-input
|
||||
v-model="haocai.surplusStock"
|
||||
type="number"
|
||||
placeholder="单位耗材值"
|
||||
@input="handleKeyUp($event, haocaiIndex)"
|
||||
></el-input>
|
||||
<div style="margin-left: 10px">
|
||||
<el-button
|
||||
v-if="scope.row.haocais.length > 1"
|
||||
type="danger"
|
||||
size="mini"
|
||||
@click="
|
||||
delGoodsHaocai(scope.row.haocais, haocaiIndex)
|
||||
"
|
||||
icon="el-icon-delete"
|
||||
circle
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="selecthaocai(scope.row)"
|
||||
>去选择耗材信息</el-button
|
||||
>
|
||||
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)">
|
||||
增加耗材
|
||||
</el-button> -->
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作">
|
||||
<!-- <el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -252,8 +252,8 @@
|
|||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- <div v-for="(ele, index) in commodityArr" :key="ele.id">
|
||||
<template>
|
||||
<div>
|
||||
|
|
@ -312,16 +312,13 @@
|
|||
|
||||
</div> -->
|
||||
</template>
|
||||
|
||||
<el-form-item
|
||||
style="display: flex; margin-top: 20px; justify-content: flex-end"
|
||||
>
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('addSelect')"
|
||||
>确 定</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" style="display: flex; justify-content: flex-end">
|
||||
<el-button @click="dialogshow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('addSelect')"
|
||||
>确 定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
|
|
@ -414,7 +411,7 @@
|
|||
<el-table-column label="单位" prop="conUnit" />
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
<template v-slot="scope">
|
||||
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
|
||||
{{ scope.row.balance }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
|
@ -626,7 +623,7 @@ export default {
|
|||
initTableSelected() {
|
||||
for (let i in haocaiSelectedMap) {
|
||||
const index = this.tableDatainformation.data.findIndex(
|
||||
(v) => v.id == i
|
||||
(v) => v.consId == i
|
||||
);
|
||||
if (index != -1 && haocaiSelectedMap[i]) {
|
||||
//删除缓存里的id
|
||||
|
|
@ -658,10 +655,11 @@ export default {
|
|||
let index = -1;
|
||||
for (let key in haocaiSelectedMap) {
|
||||
const item = haocaiSelectedMap[key];
|
||||
console.log(item);
|
||||
index++;
|
||||
this.$set(ele.haocais, index, {
|
||||
consInfoId: item.id,
|
||||
conInfoId: item.id,
|
||||
consInfoId: item.consId,
|
||||
conInfoId: item.consId,
|
||||
conName: item.conName,
|
||||
skuId: ele.skuId,
|
||||
shopId: ele.shopId,
|
||||
|
|
@ -685,14 +683,14 @@ export default {
|
|||
console.log(arr);
|
||||
for (let item of this.tableDatainformation.data) {
|
||||
//判断缓存队列是否有这个id
|
||||
const hasCacheIncludes = haocaiSelectedMap.hasOwnProperty(item.id);
|
||||
const hasCacheIncludes = haocaiSelectedMap.hasOwnProperty(item.consId);
|
||||
//判断当前选中队列里是否有这个id
|
||||
const hasSelectedIncludes = arr.find((v) => v.id == item.id);
|
||||
const hasSelectedIncludes = arr.find((v) => v.consId == item.consId);
|
||||
if (hasSelectedIncludes) {
|
||||
haocaiSelectedMap[item.id] = hasSelectedIncludes;
|
||||
haocaiSelectedMap[item.consId] = hasSelectedIncludes;
|
||||
}
|
||||
if (hasCacheIncludes && !hasSelectedIncludes) {
|
||||
delete haocaiSelectedMap[item.id];
|
||||
delete haocaiSelectedMap[item.consId];
|
||||
}
|
||||
}
|
||||
console.log(haocaiSelectedMap);
|
||||
|
|
@ -785,11 +783,11 @@ export default {
|
|||
},
|
||||
// 选择耗材
|
||||
selecthaocai(item) {
|
||||
console.log(item)
|
||||
console.log(haocaiSelectedMap)
|
||||
console.log(item);
|
||||
console.log(haocaiSelectedMap);
|
||||
this.ALLisDistribute = item;
|
||||
this.commodityArr.forEach((ele) => {
|
||||
if (ele.id == this.ALLisDistribute.id && ele.skuId==item.skuId) {
|
||||
if (ele.id == this.ALLisDistribute.id && ele.skuId == item.skuId) {
|
||||
ele.haocais.map((v) => {
|
||||
if (v.conInfoId) {
|
||||
haocaiSelectedMap[v.conInfoId] = v;
|
||||
|
|
@ -906,7 +904,7 @@ export default {
|
|||
},
|
||||
// 耗材信息的信息
|
||||
tableDatainformationtable(item) {
|
||||
haocaiSelectedMap[item.id] = item;
|
||||
haocaiSelectedMap[item.consId] = item;
|
||||
this.haocaiConfirm();
|
||||
return;
|
||||
this.commodityArr.forEach((ele) => {
|
||||
|
|
@ -963,7 +961,7 @@ export default {
|
|||
async submitForm(formName) {
|
||||
if (this.dialogtitle == "编辑") {
|
||||
await puttbProskuCon({
|
||||
...this.surplusStocks
|
||||
...this.surplusStocks,
|
||||
});
|
||||
this.$message({
|
||||
message: "修改成功",
|
||||
|
|
@ -988,8 +986,8 @@ export default {
|
|||
|
||||
let newArr = [];
|
||||
for (let i of this.commodityArr) {
|
||||
//共享库存
|
||||
console.log(i.haocais)
|
||||
//共享库存
|
||||
console.log(i.haocais);
|
||||
if (i.isDistribute) {
|
||||
for (let k of i.haocais) {
|
||||
newArr.push({
|
||||
|
|
@ -1004,8 +1002,8 @@ export default {
|
|||
newArr.push({
|
||||
consInfoId: k.conInfoId,
|
||||
productId: i.id,
|
||||
skuInfos:{
|
||||
...k
|
||||
skuInfos: {
|
||||
...k,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -1090,4 +1088,8 @@ export default {
|
|||
.head-container .filter-item {
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
.scroll-box {
|
||||
max-height: 70vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -68,8 +68,16 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" prop="number">
|
||||
<template v-slot="scope">
|
||||
<span :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
<template v-slot="scope" >
|
||||
<span v-if="!scope.row.isStock" :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
<span v-if="scope.row.stockNumber < 0" style="font-weight: 700;color: #999;font-size: 14px;">-</span>
|
||||
<span >
|
||||
<span> {{ Math.abs(scope.row.stockNumber) }}</span>
|
||||
<span> {{ scope.row.unitName }}</span>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
<span v-else :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
|
||||
</span>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -39,21 +39,13 @@
|
|||
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-input v-model="query.orderNo" placeholder="请输入订单号" style="width: 300px;"></el-input>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称">
|
||||
<el-input
|
||||
v-model="query.productName"
|
||||
placeholder="请输入商品名称"
|
||||
style="width: 300px;"
|
||||
></el-input>
|
||||
<el-input v-model="query.productName" 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">
|
||||
|
|
@ -61,7 +53,7 @@
|
|||
<span v-else>下载中...</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
|
|
@ -108,8 +100,8 @@
|
|||
<el-image :src="item.productImg" class="cover" lazy></el-image>
|
||||
<div class="info">
|
||||
<div class="name">
|
||||
<span :class="[item.isVip==1?'colorStyle':'']">
|
||||
{{ item.productName }}
|
||||
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
||||
{{ item.productName }}
|
||||
</span>
|
||||
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
|
||||
</div>
|
||||
|
|
@ -194,7 +186,7 @@ export default {
|
|||
payType: "",
|
||||
orderNo: "",
|
||||
createdAt: [],
|
||||
productName:''
|
||||
productName: ''
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
|
|
@ -239,7 +231,7 @@ export default {
|
|||
if (this.$route.query.tableName) {
|
||||
this.query.tableName = this.$route.query.tableName
|
||||
}
|
||||
if(this.$route.query.orderNo){
|
||||
if (this.$route.query.orderNo) {
|
||||
this.query.orderNo = this.$route.query.orderNo
|
||||
}
|
||||
this.resetQuery = { ...this.query };
|
||||
|
|
@ -290,7 +282,7 @@ export default {
|
|||
this.timeValue = "";
|
||||
this.query = { ...this.resetQuery };
|
||||
this.page = 0;
|
||||
this.getTableData();
|
||||
this.getTableData(true);
|
||||
},
|
||||
// 分页大小改变
|
||||
sizeChange(e) {
|
||||
|
|
@ -303,17 +295,18 @@ export default {
|
|||
this.getTableData();
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
async getTableData(switchs = false) {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
this.payCount();
|
||||
const productName=this.query.productName.replace(/\s+/g,'')
|
||||
const productName = this.query.productName.replace(/\s+/g, '')
|
||||
const res = await tbOrderInfoData({
|
||||
page: this.tableData.page,
|
||||
pageSize: this.tableData.size,
|
||||
orderType: this.orderType,
|
||||
...this.query,
|
||||
productName
|
||||
productName,
|
||||
userId: switchs == true ? '' : this.$route.query.userId
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
|
|
@ -520,7 +513,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
.colorStyle{
|
||||
color: #ffc315;
|
||||
|
||||
.colorStyle {
|
||||
color: #ffc315;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -52,6 +52,7 @@
|
|||
<el-table-column label="售价">
|
||||
<template v-slot="scope">
|
||||
<span>¥{{ scope.row.lowPrice }}</span>
|
||||
<span v-if="scope.row.typeEnum == '多规格'">~¥{{ scope.row.maxPrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品规格" prop="typeEnum">
|
||||
|
|
|
|||
|
|
@ -1,31 +1,27 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-button type="primary" @click="resetting">添加</el-button>
|
||||
<!-- <el-button type="primary" @click="resetting">添加</el-button> -->
|
||||
<el-table :data="tableData">
|
||||
<el-table-column label="类型" prop="type">
|
||||
<!-- <el-table-column label="类型" prop="type">
|
||||
<template v-slot="row">
|
||||
{{ row.row.type == 'text' ? '文本' : '图片' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="描述" prop="name"> </el-table-column>
|
||||
<el-table-column label="key" prop="autokey"> </el-table-column>
|
||||
<el-table-column label="value" prop="value">
|
||||
<el-table-column label="图片" prop="value">
|
||||
<template v-slot="row">
|
||||
<img v-if="row.row.type == 'img'" :src="row.row.value" style="width: 40px;height: 40px;">
|
||||
<span v-else>{{ row.row.value }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="updateTime"> </el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime"> </el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
||||
@click="edit(scope.row.id)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
<el-button type="text" size="mini" round icon="el-icon-edit" @click="edit(scope.row)">编辑</el-button>
|
||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||
<el-button type="text" :disabled="!scope.row.id" size="mini" round icon="el-icon-delete" slot="reference">
|
||||
删除
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
</el-popconfirm> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -35,18 +31,20 @@
|
|||
<el-radio v-model="form.type" label="text">文本</el-radio>
|
||||
<el-radio v-model="form.type" label="img">图片</el-radio>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="描述">
|
||||
<el-input v-model="form.name" placeholder="请输入内容"></el-input>
|
||||
</el-form-item> <el-form-item label="自定义key">
|
||||
<el-input v-model="form.autokey" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="自定义key">
|
||||
<el-input v-model="form.autokey" placeholder="请输入内容"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="上传图片" v-if="form.type == 'img'">
|
||||
<el-upload :headers="headers" class="avatar-uploader" :action="qiNiuUploadApi"
|
||||
:show-file-list="false" :on-success="handleSuccess">
|
||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
<span>{{ form.detail }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="文本" v-else>
|
||||
<el-input v-model="form.value" placeholder="请输入内容"></el-input>
|
||||
|
|
@ -98,13 +96,11 @@ export default {
|
|||
handleBeforeRemove(file, fileList) {
|
||||
|
||||
},
|
||||
async edit(id) {
|
||||
async edit(item) {
|
||||
this.title = '编辑'
|
||||
let res = await querytbShopExtend(id)
|
||||
this.form.id = id
|
||||
this.showLocation = true
|
||||
this.form = res
|
||||
this.imageUrl = res.value
|
||||
this.form = item
|
||||
this.imageUrl = item.value
|
||||
},
|
||||
// 删除
|
||||
async delHandle(proId) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" label-width="120px" label-position="left">
|
||||
|
||||
<el-form-item label="操作密码">
|
||||
<el-input v-model="form.password" type="number" @input="jiantingshuru" :disabled="disabled"
|
||||
:placeholder="disabled ? '******' : '请输入操作密码'" style="width: 200px;"></el-input>
|
||||
|
|
@ -17,17 +18,29 @@
|
|||
<el-button type="primary" @click="submitHandle">保存 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<hr />
|
||||
<el-form ref="form" :model="form" label-width="120px" label-position="left">
|
||||
<el-form-item label="校验安全密码">
|
||||
<el-checkbox v-model="form.isReturn">退款</el-checkbox>
|
||||
<el-checkbox v-model="form.isMemberIn">会员充值</el-checkbox>
|
||||
<el-checkbox v-model="form.isMemberReturn">会员退款</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitHandles">保存 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import md5 from 'js-md5';
|
||||
import { tbShopInfo } from "@/api/user";
|
||||
import { sendMsg, modfiyUserInfo } from "@/api/securitySetting"
|
||||
import { sendMsg, modfiyUserInfo, tbShopInfoPUT } from "@/api/securitySetting"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
disabled: true,
|
||||
form: {}
|
||||
form: {
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -42,20 +55,31 @@ export default {
|
|||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await tbShopInfo(shopId);
|
||||
this.form = res
|
||||
// this.form.password = '******'
|
||||
this.form.isReturn = this.form.isReturn == 1 ? true : false
|
||||
this.form.isMemberIn = this.form.isMemberIn == 1 ? true : false
|
||||
this.form.isMemberReturn = this.form.isMemberReturn == 1 ? true : false
|
||||
},
|
||||
async submitHandle() {
|
||||
let data = {
|
||||
code: this.form.prepareAmount,
|
||||
pwd: md5(this.form.password),
|
||||
}
|
||||
|
||||
if (!this.form.prepareAmount) {
|
||||
this.$message({
|
||||
message: "请输入验证码或密码"
|
||||
message: "请输入验证码"
|
||||
})
|
||||
return
|
||||
}
|
||||
const res = await modfiyUserInfo(data);
|
||||
if (!this.form.password) {
|
||||
this.$message({
|
||||
message: "请输入密码"
|
||||
})
|
||||
return
|
||||
}
|
||||
const res = await modfiyUserInfo({
|
||||
code: this.form.prepareAmount,
|
||||
pwd: md5(this.form.password),
|
||||
});
|
||||
console.log(222)
|
||||
|
||||
|
||||
this.form.prepareAmount = ''
|
||||
this.form.password = "******"
|
||||
this.disabled = true
|
||||
|
|
@ -64,6 +88,21 @@ export default {
|
|||
type: 'success'
|
||||
})
|
||||
},
|
||||
async submitHandles() {
|
||||
const res = await tbShopInfoPUT({
|
||||
// code: this.form.prepareAmount,
|
||||
// id: this.form.id,
|
||||
// status:this.form.status,
|
||||
...this.form,
|
||||
isReturn: this.form.isReturn == true ? 1 : 0,
|
||||
isMemberIn: this.form.isMemberIn == true ? 1 : 0,
|
||||
isMemberReturn: this.form.isMemberReturn == true ? 1 : 0,
|
||||
});
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
resetting() {
|
||||
this.form.password = ''
|
||||
this.disabled = false
|
||||
|
|
|
|||
|
|
@ -35,13 +35,13 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="昵称" prop="nickname"> </el-table-column>
|
||||
<el-table-column label="商品库存" prop="createdAt">
|
||||
<el-table-column label="商品库存预警" prop="createdAt">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.proState" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot(scope.row.proState, 0, scope.row.openId)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗材" prop="createdAt">
|
||||
<el-table-column label="耗材库存预警" prop="createdAt">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.conState" :active-value="1" :inactive-value="0"
|
||||
@change="changeHot(scope.row.conState, 1, scope.row.openId)"></el-switch>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
<el-tab-pane label="基础配置" name="2"></el-tab-pane>
|
||||
<!-- <el-tab-pane label="通知配置" name="3"></el-tab-pane> -->
|
||||
<el-tab-pane label="安全设置" name="4"></el-tab-pane>
|
||||
<el-tab-pane label="扩展参数" name="5"></el-tab-pane>
|
||||
<el-tab-pane label="跳转小程序" name="6"></el-tab-pane>
|
||||
<el-tab-pane label="店铺装修" name="5"></el-tab-pane>
|
||||
<el-tab-pane label="跳转小程序" name="6" v-if="shopId==1"></el-tab-pane>
|
||||
<el-tab-pane label="通知中心" name="7"></el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
<shopInfo v-if="activeName == 1" />
|
||||
|
|
@ -15,6 +16,7 @@
|
|||
<securitySetting v-if="activeName == 4" />
|
||||
<extend v-if="activeName == 5" />
|
||||
<goxcx v-if="activeName == 6" />
|
||||
<notifications v-if="activeName == 7" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -26,15 +28,17 @@ import notice from './components/notice'
|
|||
import securitySetting from './components/securitySetting'
|
||||
import extend from './components/extend'
|
||||
import goxcx from './components/goxcx'
|
||||
import notifications from './notifications/index.vue'
|
||||
export default {
|
||||
components: {
|
||||
shopInfo,
|
||||
shopSetting,
|
||||
notice,securitySetting,extend,goxcx
|
||||
notice,securitySetting,extend,goxcx,notifications
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: '1',
|
||||
shopId:localStorage.getItem('shopId')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,157 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
width="500px"
|
||||
:visible.sync="dialogVisible"
|
||||
@close="diaClose"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item label="版本文件">
|
||||
<uploadFile ref="uploadImg" :limit="1" @remove="uploadRemove" />
|
||||
<div class="tips"></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmitHandle">确 定 上 传</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadFile from "./upload-file";
|
||||
import { $uploadVersionFile } from "@/api/version";
|
||||
|
||||
const form = {
|
||||
file: "",
|
||||
name: "",
|
||||
};
|
||||
export default {
|
||||
components: {
|
||||
uploadFile,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: "",
|
||||
dialogVisible: false,
|
||||
rules: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "版本号必填",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
form: { ...form },
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
restForm() {
|
||||
console.log("restForm");
|
||||
console.log(form);
|
||||
this.form = { ...form };
|
||||
this.$refs.uploadImg.clearFiles();
|
||||
},
|
||||
diaClose() {
|
||||
this.restForm();
|
||||
},
|
||||
uploadSuccess(res) {
|
||||
this.form.img = res[0];
|
||||
console.log(this.form.img);
|
||||
},
|
||||
uploadRemove() {
|
||||
this.form.img = "";
|
||||
},
|
||||
// 提交
|
||||
onSubmitHandle() {
|
||||
console.log(this.form);
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
try {
|
||||
let res = "";
|
||||
if (this.form.id) {
|
||||
//编辑
|
||||
|
||||
res = await tbShopSongEdit(this.form);
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `修改成功`,
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
//添加
|
||||
const file=this.$refs.uploadImg.getFileList()[0]
|
||||
console.log(this.form)
|
||||
res = await $uploadVersionFile(file,this.form);
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `添加成功`,
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
this.close();
|
||||
|
||||
this.$emit("success", res);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async show(obj = {}) {
|
||||
console.log(obj);
|
||||
// this.form=this.$options.data().form
|
||||
this.dialogVisible = true;
|
||||
this.title = "上传版本文件";
|
||||
|
||||
if (obj && obj.id) {
|
||||
this.title = "编辑版本文件";
|
||||
this.form = {
|
||||
...obj,
|
||||
};
|
||||
}
|
||||
if (obj && obj.hasOwnProperty("img") && obj.img) {
|
||||
console.log(obj.img);
|
||||
this.form.img = obj.img;
|
||||
requestAnimationFrame(() => {
|
||||
this.$refs.uploadImg.fileList = [
|
||||
{
|
||||
url: obj.img,
|
||||
},
|
||||
];
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.restForm();
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.goods_info {
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
width="500px"
|
||||
:visible.sync="dialogVisible"
|
||||
@close="diaClose"
|
||||
>
|
||||
<el-form
|
||||
v-loading="loading"
|
||||
:element-loading-text="loadingText"
|
||||
element-loading-spinner="el-icon-loading"
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item label="平台">
|
||||
<el-select
|
||||
v-model="form.source"
|
||||
placeholder="请选择平台"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in sources"
|
||||
:key="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="tips"></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="form.version"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否强制更新" prop="isUp">
|
||||
<el-radio-group v-model="form.isUp">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新提示内容" prop="message">
|
||||
<el-input type="textarea" v-model="form.message"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="版本文件">
|
||||
<uploadFile ref="uploadFile" @success="changeHasUpload" :limit="1" @remove="uploadRemove" />
|
||||
<div class="tips"></div>
|
||||
</el-form-item>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onSubmitHandle">确 定</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uploadFile from "./upload-file";
|
||||
import { $uploadVersionFile, $version } from "@/api/version";
|
||||
|
||||
const form = {
|
||||
source: "PC",
|
||||
version: "",
|
||||
isUp: 0,
|
||||
message: "",
|
||||
url: "",
|
||||
};
|
||||
export default {
|
||||
components: {
|
||||
uploadFile,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
loadingText:'',
|
||||
sources: [
|
||||
{ label: "PC", value: "PC" },
|
||||
{ label: "APP", value: "APP" },
|
||||
],
|
||||
title: "",
|
||||
dialogVisible: false,
|
||||
rules: {
|
||||
version: [
|
||||
{
|
||||
required: true,
|
||||
message: "版本号必填",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
form: { ...form },
|
||||
//文件是否已经上传过
|
||||
hasUpload:true
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
changeHasUpload(){
|
||||
this.hasUpload=false
|
||||
},
|
||||
restForm() {
|
||||
console.log("restForm");
|
||||
console.log(form);
|
||||
this.form = { ...form };
|
||||
this.loadingText=''
|
||||
this.loading=false
|
||||
this.$refs.uploadFile.clearFiles();
|
||||
},
|
||||
diaClose() {
|
||||
this.restForm();
|
||||
},
|
||||
uploadSuccess(res) {
|
||||
this.form.img = res[0];
|
||||
console.log(this.form.img);
|
||||
},
|
||||
uploadRemove() {
|
||||
this.form.img = "";
|
||||
},
|
||||
// 提交
|
||||
onSubmitHandle() {
|
||||
console.log(this.form);
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
try {
|
||||
const { version } = this.form;
|
||||
let fileRes=''
|
||||
const file = this.$refs.uploadFile.getFileList();
|
||||
if(!this.hasUpload&&file){
|
||||
this.loadingText='文件上传中,请耐心等待。。。!'
|
||||
this.loading = true;
|
||||
fileRes = await $uploadVersionFile(file, { name:version });
|
||||
this.loading = false;
|
||||
}
|
||||
let res = "";
|
||||
if (this.form.id) {
|
||||
//编辑
|
||||
res = await $version.update({...this.form,url:fileRes?fileRes.data:this.form.url});
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `修改成功`,
|
||||
type: "success",
|
||||
});
|
||||
|
||||
} else {
|
||||
//添加
|
||||
if (file) {
|
||||
console.log(1);
|
||||
}
|
||||
res = await $version.add({...this.form,url:fileRes?fileRes.data:this.form.url});
|
||||
this.$notify({
|
||||
title: "成功",
|
||||
message: `添加成功`,
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
this.close();
|
||||
|
||||
this.$emit("success", res);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async show(obj = {}) {
|
||||
console.log(obj);
|
||||
// this.form=this.$options.data().form
|
||||
this.dialogVisible = true;
|
||||
this.title = "新增版本";
|
||||
|
||||
if (obj && obj.id) {
|
||||
this.title = "编辑版本";
|
||||
this.form = {
|
||||
...obj,
|
||||
};
|
||||
requestAnimationFrame(()=>{
|
||||
this.$refs.uploadFile.fileList = [{
|
||||
url: obj.url,
|
||||
name: obj.url,
|
||||
}]
|
||||
})
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.restForm();
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-footer{
|
||||
display: flex;
|
||||
margin-top: 30px;
|
||||
justify-content: right;
|
||||
}
|
||||
.goods_info {
|
||||
background-color: #f9f9f9;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,125 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:action="versionUploadApi"
|
||||
:auto-upload="true"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:limit="limit"
|
||||
:show-file-list="true"
|
||||
:http-request="uploadVersionFile"
|
||||
:list-type="type"
|
||||
:multiple="limit > 1"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:on-exceed="onExceed"
|
||||
:on-remove="handleRemove"
|
||||
:before-upload="beforeUpload"
|
||||
>
|
||||
<el-button size="small" type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :z-index="99">
|
||||
<img width="100%" :src="dialogImageUrl" alt="" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { Notification } from "element-ui";
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters(["versionUploadApi"]),
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
default: "text",
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
// files: [],
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
beforeUpload(file) {
|
||||
// const isExe = file.name.endsWith(".exe");
|
||||
// if (!isExe) {
|
||||
// this.$message.error("只允许上传.exe文件!");
|
||||
// return false; // 阻止上传
|
||||
// }
|
||||
return true; // 允许上传
|
||||
},
|
||||
uploadVersionFile(e) {
|
||||
this.fileList.push(e.file);
|
||||
this.$emit("success");
|
||||
},
|
||||
getFileList() {
|
||||
if (this.limit == 1) {
|
||||
return this.fileList[0];
|
||||
} else {
|
||||
return this.fileList;
|
||||
}
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
console.log("handleSuccess");
|
||||
setTimeout(() => {
|
||||
this.fileList.push({
|
||||
url: response.data[0],
|
||||
id: response.data.id,
|
||||
});
|
||||
}, 100);
|
||||
// this.files = response.data
|
||||
this.$emit("success", response.data);
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
// console.log(e)
|
||||
const m = JSON.parse(e.message);
|
||||
Notification.error({
|
||||
title: m.message,
|
||||
duration: 5000,
|
||||
});
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
onExceed() {
|
||||
this.$notify.error({
|
||||
title: "错误",
|
||||
message: `最多上传${this.limit}个文件`,
|
||||
});
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file);
|
||||
let arr = fileList.map((item) => item.url);
|
||||
// 删除数据
|
||||
let index = this.fileList.findIndex((ele) => ele.url == file.url);
|
||||
this.fileList.splice(index, 1);
|
||||
this.$emit("remove", arr);
|
||||
},
|
||||
clearFiles() {
|
||||
this.$refs.upload.clearFiles();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
/* .el-upload-list__item {
|
||||
transition: none;
|
||||
} */
|
||||
</style>
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
<el-input
|
||||
v-model="query.version"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="请输入版本号"
|
||||
style="width: 100%"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="getTableData"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button type="primary" @click="queryHandle">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button @click="addVersionShow" type="primary" icon="el-icon-plus"
|
||||
>新增版本</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="tableData.data"
|
||||
v-loading="tableData.loading"
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column prop="id" label="ID" width="50px"></el-table-column>
|
||||
<el-table-column prop="source" label="平台"></el-table-column>
|
||||
|
||||
<el-table-column prop="version" label="版本号"></el-table-column>
|
||||
<el-table-column label="当前选中版本" prop="sel">
|
||||
<template v-slot="scope">
|
||||
<el-switch
|
||||
v-if="scope.row.sel"
|
||||
disabled
|
||||
@change="changeSel($event, scope.row)"
|
||||
v-model="scope.row.sel"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
<el-switch
|
||||
v-else
|
||||
@change="changeSel(scope.row)"
|
||||
v-model="scope.row.sel"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否强制更新" prop="createdAt">
|
||||
<template v-slot="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isUp"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@change="changeIsup($event, scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新提示内容" prop="message"> </el-table-column>
|
||||
|
||||
<el-table-column label="下载地址" prop="url">
|
||||
<template v-slot="scope">
|
||||
<a :href="scope.row.url">{{ scope.row.url }}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="创建时间" prop="createdAt">
|
||||
<template v-slot="scope">
|
||||
{{ dayjs(scope.row.createdAt).format("YYYY-MM-DD HH:mm:ss") }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="updatedAt">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.updatedAt">{{
|
||||
dayjs(scope.row.updatedAt).format("YYYY-MM-DD HH:mm:ss")
|
||||
}}</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" @click="editClick(scope.row)" icon="el-icon-edit">编辑</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"
|
||||
@size-change="handleSizeChange"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
|
||||
<add-version ref="refAddVersion" @success="refresh"></add-version>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dayjs from "dayjs";
|
||||
import { $version,$upSel } from "@/api/version";
|
||||
import addVersion from "./components/add-version";
|
||||
export default {
|
||||
components: { addVersion },
|
||||
data() {
|
||||
return {
|
||||
dayjs,
|
||||
query: {
|
||||
version: "",
|
||||
},
|
||||
categorys: [],
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 30,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
await this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
|
||||
addVersionShow() {
|
||||
this.$refs.refAddVersion.show();
|
||||
},
|
||||
editClick(item){
|
||||
this.$refs.refAddVersion.show(item);
|
||||
},
|
||||
// 选择分类
|
||||
queryHandle() {
|
||||
localStorage.setItem("shopIndexQuery", JSON.stringify(this.query));
|
||||
this.getTableData();
|
||||
},
|
||||
async changeIsup(e,item){
|
||||
const res= await $version.update(item)
|
||||
this.getTableData()
|
||||
},
|
||||
async changeSel(item){
|
||||
const res= await $upSel(item)
|
||||
this.getTableData()
|
||||
},
|
||||
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = "";
|
||||
this.query.categoryId = "";
|
||||
this.query.typeEnum = "";
|
||||
this.query.productId = "";
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
refresh(){
|
||||
this.tableData.page=0
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const res = await $version.get({
|
||||
page: this.tableData.page,
|
||||
pageSize: this.tableData.size,
|
||||
version: this.query.version,
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableData.size = val;
|
||||
this.getTableData();
|
||||
},
|
||||
// 删除商品
|
||||
async delTableHandle(ids) {
|
||||
try {
|
||||
await $version.del(ids);
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.handle {
|
||||
font-size: 18px;
|
||||
color: #999;
|
||||
|
||||
&:hover {
|
||||
cursor: grab;
|
||||
}
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
padding-left: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.tag_wrap {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -6,6 +6,11 @@
|
|||
<el-option :label="item.name" :value="item.id" v-for="item in areaList" :key="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="台桌状态" prop="status" v-if="form.id">
|
||||
<el-select v-model="form.status" placeholder="请选择台桌状态">
|
||||
<el-option :label="item.name" :value="item.value" v-for="item in status" :key="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="台桌名称">
|
||||
<el-input v-model="form.name" placeholder="请输入台桌名称"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -43,6 +48,16 @@ export default {
|
|||
dialogVisible: false,
|
||||
resetForm: '',
|
||||
loading: false,
|
||||
status:[
|
||||
{value:'pending',name:'挂单中'},
|
||||
{value:'using',name:'开台中'},
|
||||
{value:'paying',name:'结算中'},
|
||||
{value:'idle',name:'空闲'},
|
||||
{value:'subscribe',name:'预定'},
|
||||
{value:'closed',name:'关台'},
|
||||
// {value:'opening',name:'开台中'},
|
||||
{value:'cleaning',name:'台桌清理中'},
|
||||
],
|
||||
form: {
|
||||
id: '',
|
||||
name: '',
|
||||
|
|
@ -76,6 +91,7 @@ export default {
|
|||
try {
|
||||
let res = await tbShopTable({
|
||||
...this.form,
|
||||
qrcode:this.form.tableId,
|
||||
shopId: localStorage.getItem('shopId')
|
||||
}, this.form.id ? 'put' : 'post')
|
||||
this.$emit('success', res)
|
||||
|
|
|
|||
|
|
@ -128,9 +128,7 @@ export default {
|
|||
},
|
||||
},
|
||||
mounted() {
|
||||
cacheData = { ...this.query };
|
||||
this.getTableData();
|
||||
this.getShopInfo();
|
||||
// this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
cellClick(user){
|
||||
|
|
@ -155,6 +153,7 @@ export default {
|
|||
this.show = false;
|
||||
},
|
||||
open() {
|
||||
this.getTableData();
|
||||
this.show = true;
|
||||
},
|
||||
toPage(type) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ export default {
|
|||
methods: {
|
||||
changeSel(item) {
|
||||
this.sel = item.payType;
|
||||
this.$emit("itemClick", item);
|
||||
},
|
||||
async init() {
|
||||
const res = await $getPayType();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,265 @@
|
|||
<template>
|
||||
<div
|
||||
class="flex order-item relative"
|
||||
:class="{ active: selIndex === index }"
|
||||
@click="itemClick"
|
||||
>
|
||||
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||
<div class="flex">
|
||||
<div class="img">
|
||||
<img :src="item.coverImg" class="" alt="" />
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="flex lh-16">
|
||||
<div class="name">{{ item.name }}</div>
|
||||
<span class="good_info_discount" v-if="item.isGift === 'true'"
|
||||
>赠</span
|
||||
>
|
||||
</div>
|
||||
<div v-if="item.specSnap" class="specSnap">
|
||||
{{ item.specSnap }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="order-number-box">
|
||||
<div class="" style="">X{{ item.number }}</div>
|
||||
<div class="absolute" v-if="canChangeNumber">
|
||||
<div class="order-input-number">
|
||||
<i class="icon-remove" @click="changeOrderNumber(true)"></i>
|
||||
<div style="width: 40px" class="number-box">
|
||||
<el-input
|
||||
:min="0"
|
||||
type="number"
|
||||
@input="cartGoodsNumberInput"
|
||||
@change="cartGoodsNumberChange"
|
||||
v-model="number"
|
||||
placeholder="0"
|
||||
></el-input>
|
||||
</div>
|
||||
<i
|
||||
class="el-icon-circle-plus icon-add"
|
||||
@click="changeOrderNumber(false)"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="color-333 total-price">
|
||||
<div v-if="item.isGift === 'true'">¥0</div>
|
||||
<div :class="{ 'free-price': item.isGift === 'true' }">
|
||||
¥{{ item.salePrice }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
//是否允许改变梳理
|
||||
canChangeNumber: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
item: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
},
|
||||
selIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"item.number": function (val) {
|
||||
this.number = val;
|
||||
// this.$emit('changeOrderNumber',this.index)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = this.item.number;
|
||||
},
|
||||
methods: {
|
||||
//购物车商品输入框数量改变
|
||||
cartGoodsNumberChange(newval) {
|
||||
if (newval <= 0) {
|
||||
item.number = 1;
|
||||
}
|
||||
newval = `${newval}`.split(".")[0] * 1;
|
||||
this.number = newval;
|
||||
this.$emit("cartGoodsNumberChange",newval, this.index);
|
||||
|
||||
},
|
||||
//购物车商品输入框数量输入
|
||||
cartGoodsNumberInput(newval) {
|
||||
if (newval <= 0) {
|
||||
return this.number =1
|
||||
}
|
||||
newval = `${newval}`.split(".")[0] * 1;
|
||||
this.number = newval;
|
||||
this.$emit("cartGoodsNumberInput",newval, this.index);
|
||||
},
|
||||
changeOrderNumber(isReduce) {
|
||||
this.$emit("changeOrderNumber", this.index, isReduce);
|
||||
},
|
||||
itemClick() {
|
||||
this.$emit("itemClick", this.index,this.canChangeNumber);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .number-box .el-input__inner {
|
||||
border: none;
|
||||
}
|
||||
::v-deep .el-button--text {
|
||||
color: #000;
|
||||
}
|
||||
::v-deep .number-box .el-input__inner {
|
||||
border: none;
|
||||
padding: 0 4px;
|
||||
text-align: center;
|
||||
}
|
||||
.icon-remove {
|
||||
border: 1px solid #d8d8d8;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
box-sizing: border-box;
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 10px;
|
||||
height: 1px;
|
||||
background: #999;
|
||||
}
|
||||
}
|
||||
.icon-add {
|
||||
color: rgb(34, 191, 100);
|
||||
font-size: 22px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.order-item {
|
||||
padding: 4px;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
transition: all 0.3s;
|
||||
.pack {
|
||||
right: 100%;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #35ac6a;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
}
|
||||
&.active {
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.total-price {
|
||||
width: 94px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.good-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-width: 70px;
|
||||
|
||||
.specSnap {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
color: #212121;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-number-box {
|
||||
position: relative;
|
||||
|
||||
.absolute {
|
||||
width: 60px;
|
||||
height: 40px;
|
||||
right: -30px;
|
||||
top: -12px;
|
||||
position: absolute;
|
||||
|
||||
.order-input-number {
|
||||
position: absolute;
|
||||
right: -6px;
|
||||
top: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
|
||||
padding: 9px 6px;
|
||||
background-color: #fff;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
&:hover .order-input-number {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
.good_info_discount {
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
color: #ff3f3f;
|
||||
background-color: rgba(255, 63, 63, 0.1);
|
||||
border-radius: 2px;
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
<template>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show">
|
||||
<div class="u-p-15">
|
||||
<div class="u-m-t-20">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="应付金额">
|
||||
<div class="color-red u-font-18 font-600">¥{{ form.money }}</div>
|
||||
<!-- <el-input :value="form.money" disabled> </el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="减免金额">
|
||||
<el-input
|
||||
v-model="form.reduceMoney"
|
||||
clearable
|
||||
autofocus
|
||||
type="number"
|
||||
@keyup.enter.native="init('reduceMoney')"
|
||||
@blur="init('reduceMoney')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠折扣">
|
||||
<el-input
|
||||
v-model="form.discount"
|
||||
type="number"
|
||||
@keyup.enter.native="init('discount')"
|
||||
@blur="init('discount')"
|
||||
>
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="实收金额">
|
||||
<el-input
|
||||
v-model="form.curretnMoney"
|
||||
type="number"
|
||||
clearable
|
||||
@keyup.enter.native="init('curretnMoney')"
|
||||
@blur="init('curretnMoney')"
|
||||
>
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="success" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "优惠金额",
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
money: 0,
|
||||
discount: 100,
|
||||
reduceMoney: 0,
|
||||
curretnMoney: 0,
|
||||
},
|
||||
number: "0",
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
watch: {},
|
||||
methods: {
|
||||
// init(key) {
|
||||
// const { money, reduceMoney, discount, curretnMoney } = this.form;
|
||||
// if (key == "reduceMoney") {
|
||||
// this.form.curretnMoney = (money - reduceMoney).toFixed(2);
|
||||
// this.form.discount = ((this.form.curretnMoney / money) * 100).toFixed(
|
||||
// 2
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// if (key == "discount") {
|
||||
// this.form.curretnMoney = ((money * discount) / 100).toFixed(2);
|
||||
// this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
// return;
|
||||
// }
|
||||
// if (key == "curretnMoney") {
|
||||
// this.form.reduceMoney = (money - curretnMoney).toFixed(2);
|
||||
// this.form.discount = ((this.form.curretnMoney / money) * 100).toFixed(
|
||||
// 2
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
// this.form.curretnMoney = ((money * discount) / 100).toFixed(2);
|
||||
// this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
// },
|
||||
init(key) {
|
||||
const { money, reduceMoney, discount, curretnMoney } = this.form;
|
||||
if (key == "reduceMoney") {
|
||||
if (reduceMoney < 0) {
|
||||
this.$message.error("减免金额不能小于0");
|
||||
this.form.reduceMoney = 0;
|
||||
}
|
||||
if (reduceMoney > money) {
|
||||
this.$message.error("减免金额不能大于总金额");
|
||||
this.form.reduceMoney = money;
|
||||
}
|
||||
this.form.curretnMoney = (money - this.form.reduceMoney).toFixed(2);
|
||||
this.form.discount = ((this.form.curretnMoney / money) * 100).toFixed(
|
||||
2
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (key == "discount") {
|
||||
if (discount < 0) {
|
||||
this.$message.error("折扣不能小于0");
|
||||
this.form.discount = 0;
|
||||
}
|
||||
if (discount > 100) {
|
||||
this.$message.error("折扣不能大于100");
|
||||
this.form.discount = 100;
|
||||
}
|
||||
this.form.curretnMoney = ((money * this.form.discount) / 100).toFixed(
|
||||
2
|
||||
);
|
||||
this.form.reduceMoney = (
|
||||
(money * (100 - this.form.discount)) /
|
||||
100
|
||||
).toFixed(2);
|
||||
return;
|
||||
}
|
||||
if (key == "curretnMoney") {
|
||||
if (curretnMoney < 0) {
|
||||
this.$message.error("实收金额不能小于0");
|
||||
this.form.curretnMoney = 0;
|
||||
}
|
||||
if (curretnMoney > money) {
|
||||
this.$message.error("实收金额不能大于总金额");
|
||||
this.form.curretnMoney = 0;
|
||||
}
|
||||
this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
this.form.discount = ((this.form.curretnMoney / money) * 100).toFixed(
|
||||
2
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.form.curretnMoney = ((money * discount) / 100).toFixed(2);
|
||||
this.form.reduceMoney = (money - this.form.curretnMoney).toFixed(2);
|
||||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
confirm() {
|
||||
this.$emit("confirm", (this.form.discount / 100));
|
||||
this.close();
|
||||
},
|
||||
open(data) {
|
||||
console.log(data);
|
||||
this.form.money = data.amount;
|
||||
this.form.discount = data.discount||100;
|
||||
this.show = true;
|
||||
this.init();
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 160px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 160px;
|
||||
}
|
||||
::v-deep .el-input .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
::v-deep .el-input .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
<template>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div v-if="openSwitch">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeKey('paysSel', index)"
|
||||
v-for="(item, index) in pays"
|
||||
:key="index"
|
||||
:type="paysSel == index ? 'success' : ''"
|
||||
>{{ item.text }}</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
v-if="tips"
|
||||
:title="tips"
|
||||
type="warning"
|
||||
show-icon
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<template v-if="paysSel == 0">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input :value="form.money" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款码">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
placeholder="请扫码或者输入付款码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="success" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="u-text-center">
|
||||
<div class="u-flex u-row-center">
|
||||
<img :src="codeImg" class="codeImg" alt="" />
|
||||
</div>
|
||||
<div class="color-333 u-font-20 u-m-t-20">32.00元</div>
|
||||
<div class="color-aaa u-font-12 u-m-t-10">
|
||||
<i class="el-icon-loading"></i>
|
||||
<span>等待用户支付</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
openSwitch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "支付",
|
||||
},
|
||||
price: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
defaultTips: {
|
||||
type: String,
|
||||
default: "请使用扫码枪扫描付款码",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tips: "",
|
||||
paysSel: 0,
|
||||
form: {
|
||||
money: "",
|
||||
code: "",
|
||||
},
|
||||
codeImg:
|
||||
"https://zhyx.eingdong.com/qrcode/api.php?url=https%3A%2F%2Fzhyx.eingdong.com%2Fcopyright%2F%23%2Fpay%3Fid%3D139451580",
|
||||
pays: [
|
||||
{
|
||||
text: "主扫",
|
||||
},
|
||||
{
|
||||
text: "被扫",
|
||||
},
|
||||
],
|
||||
number: "0",
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
defaultTips(val) {
|
||||
this.tips = val;
|
||||
},
|
||||
price(val) {
|
||||
console.log(val);
|
||||
this.form.money = Number(val).toFixed(2);
|
||||
},
|
||||
paysSel(newval) {
|
||||
if (newval == 0) {
|
||||
this.tips = "请使用扫码枪扫微信/支付宝收款码";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
} else {
|
||||
this.tips = "请用户使用微信/支付宝扫描付款码";
|
||||
}
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
codeInputChange(e){
|
||||
console.log(e)
|
||||
// this.$emit("confirm", this.form.code);
|
||||
},
|
||||
reset() {
|
||||
// this.form.money=''
|
||||
this.form.code = "";
|
||||
this.paysSel = 0;
|
||||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if(!this.form.code){
|
||||
return this.$message.error("请输入或扫付款码")
|
||||
}
|
||||
this.close()
|
||||
this.$emit("confirm", this.form.code);
|
||||
},
|
||||
open() {
|
||||
this.show = true;
|
||||
this.form.money = Number(this.price).toFixed(2);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
numberInput(val) {
|
||||
console.log(val);
|
||||
this.number = `${Number(val)}`;
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
this.tips = this.defaultTips;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 160px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 160px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -142,7 +142,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="diancan">
|
||||
<div class="diancan" v-loading="loading">
|
||||
<div class="order">
|
||||
<div class="relative">
|
||||
<div style="padding-right: 14px">
|
||||
|
|
@ -162,7 +162,7 @@
|
|||
alt=""
|
||||
/>
|
||||
<div v-else class="headimg flex flex-x-y-center">
|
||||
<i-icon class="el-icon-user"></i-icon>
|
||||
<i class="el-icon-user"></i>
|
||||
</div>
|
||||
<div>
|
||||
<div class="ft-13 color-000">{{ vipUser.nickName }}</div>
|
||||
|
|
@ -250,7 +250,7 @@
|
|||
type="success"
|
||||
size="medium"
|
||||
:disabled="!order.list.length"
|
||||
@click="toCreateOrder(false)"
|
||||
@click="toCreateOrderDebounce(false)"
|
||||
>
|
||||
仅下单
|
||||
</el-button>
|
||||
|
|
@ -260,8 +260,8 @@
|
|||
<div class="flex-1">
|
||||
<el-button
|
||||
size="medium"
|
||||
:disabled="!order.list.length"
|
||||
@click="toCreateOrder(true)"
|
||||
:disabled="!order.list.length && !order.old.list.length"
|
||||
@click="toCreateOrderDebounce(true)"
|
||||
>
|
||||
去结账
|
||||
</el-button>
|
||||
|
|
@ -270,75 +270,46 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div
|
||||
v-for="(item, index) in order.list"
|
||||
:key="index"
|
||||
class="flex order-item relative"
|
||||
:class="{ active: order.selIndex === index }"
|
||||
@click="changeOrderSel(index)"
|
||||
>
|
||||
<span class="absolute pack" v-if="item.isPack === 'true'">
|
||||
包
|
||||
</span>
|
||||
<div class="flex">
|
||||
<div class="img">
|
||||
<img :src="item.coverImg" class="" alt="" />
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="flex lh-16">
|
||||
<div class="name">{{ item.name }}</div>
|
||||
<span
|
||||
class="good_info_discount"
|
||||
v-if="item.isGift === 'true'"
|
||||
>赠</span
|
||||
>
|
||||
</div>
|
||||
<div v-if="item.specSnap" class="specSnap">
|
||||
{{ item.specSnap }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="order-number-box">
|
||||
<div class="color-999" style="">X{{ item.number }}</div>
|
||||
<div class="absolute">
|
||||
<div class="order-input-number">
|
||||
<i
|
||||
class="icon-remove"
|
||||
@click="changeOrderNumber(index, '-')"
|
||||
></i>
|
||||
<div style="width: 40px" class="number-box">
|
||||
<el-input
|
||||
:min="0"
|
||||
type="number"
|
||||
@input="cartGoodsNumberInput($event,item)"
|
||||
@change="cartGoodsNumberChange($event,item)"
|
||||
v-model="item.number"
|
||||
placeholder="0"
|
||||
></el-input>
|
||||
</div>
|
||||
<i
|
||||
class="el-icon-circle-plus icon-add"
|
||||
@click="changeOrderNumber(index)"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="color-333 total-price">
|
||||
¥{{ item.salePrice }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 当前购物车列表 -->
|
||||
<template v-if="order.list.length">
|
||||
<cart-item
|
||||
@itemClick="changeOrderSel"
|
||||
@changeOrderNumber="changeOrderNumber"
|
||||
@cartGoodsNumberInput="cartGoodsNumberInput"
|
||||
@cartGoodsNumberChange="cartGoodsNumberChange"
|
||||
v-for="(item, index) in order.list"
|
||||
:key="index"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:selIndex="order.selIndex"
|
||||
></cart-item>
|
||||
</template>
|
||||
<div v-if="order.gift.list.length">
|
||||
<div class="carts_list_title">以下是优惠菜品</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!order.list.length">
|
||||
<el-empty description="点餐列表为空"></el-empty>
|
||||
<el-empty
|
||||
:image-size="50"
|
||||
description="点餐列表为空"
|
||||
></el-empty>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 已下单菜品列表 -->
|
||||
<template v-if="order.old.list.length">
|
||||
<div class="carts_list_title">已下单菜品</div>
|
||||
<div class="list">
|
||||
<cart-item
|
||||
@itemClick="changeOrderOldSel"
|
||||
:canChangeNumber="false"
|
||||
v-for="(item, index) in order.old.list"
|
||||
:key="index"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:selIndex="order.old.selIndex"
|
||||
></cart-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="order_remark" v-if="note.content">
|
||||
订单备注: {{ note.content }}
|
||||
|
|
@ -346,7 +317,10 @@
|
|||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<div class="numberbox">
|
||||
<div
|
||||
class="numberbox"
|
||||
:class="{ 'cur-pointer': order.old.selIndex < 0 }"
|
||||
>
|
||||
<div class="reduce" @click="changeOrderGoodsNumber('-')">-</div>
|
||||
<div class="input relative">
|
||||
<div
|
||||
|
|
@ -504,10 +478,7 @@
|
|||
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
||||
<img class="goods-img" :src="item.coverImg" alt="" />
|
||||
<template v-if="layout.sel === 'img-and-text'">
|
||||
<div
|
||||
class="sell-out-svg"
|
||||
v-if="isSellOut(item)"
|
||||
>
|
||||
<div class="sell-out-svg" v-if="isSellOut(item)">
|
||||
<svg
|
||||
t="1724234807994"
|
||||
class="icon"
|
||||
|
|
@ -595,14 +566,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-pagination :total="goods.total" :current-page="goods.query.page + 1" :page-size="goods.query.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChangeinformation" @size-change="
|
||||
(e) => {
|
||||
goods.query.size = e;
|
||||
goods.query.page = 0;
|
||||
getGoods();
|
||||
}
|
||||
" /> -->
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
|
|
@ -649,12 +612,19 @@
|
|||
</el-form>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- <div class="btn_group">
|
||||
<el-button size="medium"> 整单打折/减免 </el-button>
|
||||
<el-button size="medium "> 免单 </el-button>
|
||||
</div> -->
|
||||
<div class="btn_group">
|
||||
<el-button size="medium" @click="disCountShow">
|
||||
整单打折/减免
|
||||
</el-button>
|
||||
<!-- <el-button size="medium "> 免单 </el-button> -->
|
||||
</div>
|
||||
|
||||
<pay-type ref="refPayType" v-model="order.payType"> </pay-type>
|
||||
<pay-type
|
||||
ref="refPayType"
|
||||
v-model="order.payType"
|
||||
@itemClick="payTypeItemClick"
|
||||
>
|
||||
</pay-type>
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="success" size="medium" @click="payOrder">
|
||||
<span>立即支付</span>
|
||||
|
|
@ -701,14 +671,23 @@
|
|||
</div>
|
||||
<div class="detail_form_item">
|
||||
<div class="left">整单改价</div>
|
||||
<div class="right">-¥0.00</div>
|
||||
<div class="right">
|
||||
-¥{{
|
||||
((1 - createOrder.discount) * createOrder.data.amount)
|
||||
| to2
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail_form_item" v-if="createOrder.data.packFee">
|
||||
<div class="left">打包费</div>
|
||||
<div class="right">
|
||||
¥{{ createOrder.data.packFee || "0.00" }}
|
||||
</div>
|
||||
</div>
|
||||
<!---->
|
||||
<div class="detail_form_item">
|
||||
<div class="left">桌位费/附加费</div>
|
||||
<div class="right">¥0.00</div>
|
||||
</div>
|
||||
<!----><!----><!---->
|
||||
<div class="detail_form_item">
|
||||
<div class="left">总价</div>
|
||||
<div class="right">
|
||||
|
|
@ -722,7 +701,9 @@
|
|||
<div class="detail_form_item">
|
||||
<div class="left">应付金额</div>
|
||||
<div class="right redfont">
|
||||
¥{{ createOrder.data.amount | to2 }}
|
||||
¥{{
|
||||
(createOrder.data.amount * createOrder.discount) | to2
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
|
@ -774,27 +755,6 @@
|
|||
>
|
||||
{{ val.name }}
|
||||
</el-button>
|
||||
<!-- <el-tag
|
||||
v-if="val === item.sel"
|
||||
size="medium"
|
||||
:disabled="item.disabled"
|
||||
@click="changeTagSel(index, val)"
|
||||
effect="dark"
|
||||
type="success"
|
||||
>
|
||||
|
||||
{{ val }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else
|
||||
size="medium"
|
||||
type="success"
|
||||
:disabled="item.disabled"
|
||||
@click="changeTagSel(index, val)"
|
||||
effect="light"
|
||||
>
|
||||
{{ val }}
|
||||
</el-tag> -->
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -806,7 +766,7 @@
|
|||
<div class="price">¥{{ skuGoods.data.salePrice | to2 }}</div>
|
||||
<div class="sku-group-text">
|
||||
<span> {{ skuText }}</span>
|
||||
<span>库存:{{ skuGoods.data.stockNumber || "" }}</span>
|
||||
<span>库存:{{ skuGoods.data.stockNumber || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
|
|
@ -831,14 +791,23 @@
|
|||
>
|
||||
已下架
|
||||
</button>
|
||||
<button
|
||||
class="my-btn success flex-1"
|
||||
v-else
|
||||
:disabled="CanConfirm"
|
||||
@click="chooseSkuConfirm"
|
||||
>
|
||||
确定
|
||||
</button>
|
||||
<template v-else>
|
||||
<button
|
||||
class="my-btn disabled flex-1"
|
||||
v-if="skuGoods.data.stockNumber <= 0"
|
||||
disabled
|
||||
>
|
||||
库存不足
|
||||
</button>
|
||||
<button
|
||||
class="my-btn success flex-1"
|
||||
v-else
|
||||
:disabled="CanConfirm"
|
||||
@click="chooseSkuConfirm"
|
||||
>
|
||||
确定
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
|
@ -981,13 +950,30 @@
|
|||
<!-- 支付时的键盘弹窗 -->
|
||||
<money-keyboard ref="refMoneyKeyboard" :title="moneyKeyboard.title">
|
||||
</money-keyboard>
|
||||
|
||||
<!-- 扫码支付 -->
|
||||
<scan-pay
|
||||
ref="refScanCode"
|
||||
title="扫码支付"
|
||||
defaultTips="注意:扫码支付请保证输入框获得焦点"
|
||||
:openSwitch="false"
|
||||
:price="createOrder.data.amount * createOrder.discount"
|
||||
@confirm="scanPayConfirm"
|
||||
></scan-pay>
|
||||
<!-- 打折 -->
|
||||
<money-discount ref="refDiscount" @confirm="ChangeDiscount">
|
||||
</money-discount>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import _ from "lodash";
|
||||
import chooseUser from "./choose-user.vue";
|
||||
import payType from "./pay-type.vue";
|
||||
import chooseTable from "./table-diancan-components/choose-table-master.vue";
|
||||
import cartItem from "./table-diancan-components/cart-item.vue";
|
||||
import scanPay from "./table-diancan-components/scan-pay.vue";
|
||||
import moneyDiscount from "./table-diancan-components/discount.vue";
|
||||
import orderNote from "./table-diancan-components/note.vue";
|
||||
import moneyKeyboard from "./money-keyboard.vue";
|
||||
import dayjs from "dayjs";
|
||||
|
|
@ -1008,54 +994,12 @@ import {
|
|||
$payOrder,
|
||||
} from "@/api/table";
|
||||
import { tbShopCategoryGet } from "@/api/shop";
|
||||
//判断商品是否可以下单
|
||||
function isCanBuy(goods) {
|
||||
return goods.isGrounding && goods.isPauseSale == 0 && goods.stockNumber > 0;
|
||||
}
|
||||
|
||||
// 一个数组是否包含另外一个数组全部元素
|
||||
function arrayContainsAll(arr1, arr2) {
|
||||
for (let i = 0; i < arr2.length; i++) {
|
||||
if (!arr1.includes(arr2[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//n项 n-1项组合,生成全部结果
|
||||
function generateCombinations(arr, k) {
|
||||
let result = [];
|
||||
|
||||
function helper(index, current) {
|
||||
if (current.length === k) {
|
||||
result.push(current.slice()); // 使用slice()来避免直接修改原始数组
|
||||
} else {
|
||||
for (let i = index; i < arr.length; i++) {
|
||||
current.push(arr[i]); // 将当前元素添加到组合中
|
||||
helper(i + 1, current); // 递归调用,索引增加以避免重复选择相同的元素
|
||||
current.pop(); // 回溯,移除当前元素以便尝试其他组合
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
helper(0, []); // 从索引0开始,初始空数组作为起点
|
||||
return result;
|
||||
}
|
||||
|
||||
function returnReverseVal(val, isReturnString = true) {
|
||||
const isBol = typeof val === "boolean";
|
||||
const isString = typeof val === "string";
|
||||
let reverseNewval = "";
|
||||
if (isBol) {
|
||||
reverseNewval = !val;
|
||||
}
|
||||
if (isString) {
|
||||
reverseNewval = val === "true" ? "false" : "true";
|
||||
}
|
||||
return reverseNewval;
|
||||
}
|
||||
|
||||
import {
|
||||
isCanBuy,
|
||||
arrayContainsAll,
|
||||
generateCombinations,
|
||||
returnReverseVal,
|
||||
} from "./util.js";
|
||||
export default {
|
||||
components: {
|
||||
chooseUser,
|
||||
|
|
@ -1063,9 +1007,16 @@ export default {
|
|||
payType,
|
||||
orderNote,
|
||||
moneyKeyboard,
|
||||
scanPay,
|
||||
moneyDiscount,
|
||||
cartItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//整体点餐页面loading
|
||||
loading: false,
|
||||
//台桌点餐页面打开时带来的参数 isAddGoods 加菜 isPayOrder结账
|
||||
key: "",
|
||||
//是否是从挂单里取出来的订单
|
||||
isPrverOrder: false,
|
||||
//是否全屏
|
||||
|
|
@ -1120,6 +1071,7 @@ export default {
|
|||
total: 0,
|
||||
},
|
||||
order: {
|
||||
orderId: "",
|
||||
payType: "",
|
||||
masterId: "",
|
||||
allPack: false,
|
||||
|
|
@ -1146,6 +1098,11 @@ export default {
|
|||
list: [],
|
||||
selIndex: -1,
|
||||
},
|
||||
//已下单菜品
|
||||
old: {
|
||||
list: [],
|
||||
selIndex: -1,
|
||||
},
|
||||
query: {
|
||||
page: 1,
|
||||
size: 20,
|
||||
|
|
@ -1187,8 +1144,13 @@ export default {
|
|||
canUpdate: true,
|
||||
//下单
|
||||
createOrder: {
|
||||
code: "",
|
||||
status: "",
|
||||
discount: 1,
|
||||
form: {},
|
||||
data: {},
|
||||
data: {
|
||||
amount: 0,
|
||||
},
|
||||
quan: {
|
||||
list: [],
|
||||
sel: "",
|
||||
|
|
@ -1241,17 +1203,26 @@ export default {
|
|||
return result.substring(0, result.length - 1);
|
||||
},
|
||||
allPrice() {
|
||||
const oldPrice = this.order.old.list
|
||||
.filter((v) => v.isGift !== "true")
|
||||
.reduce((a, b) => {
|
||||
return a + b.number * b.salePrice;
|
||||
}, 0);
|
||||
const price = this.order.list
|
||||
.filter((v) => v.isGift !== "true")
|
||||
.reduce((a, b) => {
|
||||
return a + b.number * b.salePrice;
|
||||
}, 0);
|
||||
return price.toFixed(2);
|
||||
return (oldPrice + price).toFixed(2);
|
||||
},
|
||||
allNumber() {
|
||||
return this.order.list.reduce((a, b) => {
|
||||
return a + b.number*1;
|
||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||
return a + b.number * 1;
|
||||
}, 0);
|
||||
const cartNumber = this.order.list.reduce((a, b) => {
|
||||
return a + b.number * 1;
|
||||
}, 0);
|
||||
return oldNumber + cartNumber;
|
||||
},
|
||||
selGoodsHide() {
|
||||
this.selGoods.show = false;
|
||||
|
|
@ -1287,6 +1258,11 @@ export default {
|
|||
masterId: function (val) {
|
||||
console.log(val);
|
||||
},
|
||||
isCreateOrder: function (val) {
|
||||
if (!val) {
|
||||
this.createOrder.discount = 1;
|
||||
}
|
||||
},
|
||||
"vipUser.id": async function (val) {
|
||||
let masterId = this.order.masterId;
|
||||
if (!masterId) {
|
||||
|
|
@ -1361,6 +1337,7 @@ export default {
|
|||
},
|
||||
"order.selIndex": function (val, oldval) {
|
||||
console.log(val);
|
||||
this.order.old.selIndex = -1;
|
||||
if (val === -1) {
|
||||
// return (this.order.number = 1);
|
||||
this.order.cacheNumber = 1;
|
||||
|
|
@ -1378,7 +1355,7 @@ export default {
|
|||
// this.order.number = this.order.list[this.order.selIndex].number;
|
||||
}
|
||||
},
|
||||
"order.number": function (newval) {
|
||||
"order.number": _.debounce(function (newval) {
|
||||
if (this.order.list.length <= 0 || this.order.selIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -1387,64 +1364,91 @@ export default {
|
|||
let item = this.order.list[this.order.selIndex];
|
||||
console.log(item.specSnap);
|
||||
const { productId, skuId, isPack, isGift, number } = item;
|
||||
const oldGoods = this.order.old.list.find((v) => {
|
||||
return v.productId === productId && v.skuId === skuId;
|
||||
});
|
||||
$updateCart({
|
||||
cartId: item.id,
|
||||
productId,
|
||||
skuId,
|
||||
tableId: this.table.tableId,
|
||||
num: this.order.number, // 0会删除此商品
|
||||
num: this.order.number + (oldGoods ? oldGoods.number : 0), // 0会删除此商品
|
||||
}).then((res) => {
|
||||
this.$set(this.order.list, this.order.selIndex, {
|
||||
...res,
|
||||
specSnap: item.specSnap,
|
||||
number: this.order.number,
|
||||
});
|
||||
});
|
||||
return;
|
||||
this.updateOrder({
|
||||
num: newval, // 0会删除此商品
|
||||
});
|
||||
},
|
||||
}, 30),
|
||||
"goods.query.productId": function (newval) {
|
||||
console.log(newval);
|
||||
if (newval === "") {
|
||||
this.goods.list = this.$goodsData.records || [];
|
||||
if (!this.$goodsData) {
|
||||
return;
|
||||
}
|
||||
if (newval == "") {
|
||||
this.goods.list = this.$goodsData || [];
|
||||
} else {
|
||||
const newarr = this.$goodsData.records.filter((v) =>
|
||||
const newarr = this.$goodsData.filter((v) =>
|
||||
v.name.includes(newval.trim())
|
||||
);
|
||||
this.search.list = newarr;
|
||||
this.goods.list = newarr.length ? newarr : this.$goodsData.records;
|
||||
this.goods.list = newarr.length ? newarr : this.$goodsData;
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// this.getGoods();
|
||||
// this.getCategory();
|
||||
// this.refToggle('refScanCode',true)
|
||||
// this.refToggle("refDiscount", true);
|
||||
},
|
||||
methods: {
|
||||
//购物车商品输入框数量输入
|
||||
cartGoodsNumberInput(newval,item){
|
||||
if(newval<=0){
|
||||
return this.order.cacheNumber=1
|
||||
//扫码支付弹窗确认
|
||||
scanPayConfirm(code) {
|
||||
this.createOrder.code = code;
|
||||
this.payOrder();
|
||||
},
|
||||
payTypeItemClick(item) {
|
||||
console.log(item);
|
||||
if (item.payType == "deposit") {
|
||||
//扫码支付
|
||||
this.refToggle("refScanCode", true);
|
||||
}
|
||||
newval=`${newval}`.split('.')[0]*1
|
||||
this.order.cacheNumber=newval
|
||||
this.$nextTick(()=>{
|
||||
item.number=newval
|
||||
})
|
||||
},
|
||||
ChangeDiscount(discount) {
|
||||
this.createOrder.discount = discount;
|
||||
},
|
||||
disCountShow() {
|
||||
const { amount } = this.createOrder.data;
|
||||
this.refToggle("refDiscount", true, {
|
||||
amount,
|
||||
discount: this.createOrder.discount * 100,
|
||||
});
|
||||
},
|
||||
refToggle(key, isShow, data) {
|
||||
if (!this.$refs[key]) {
|
||||
return;
|
||||
}
|
||||
isShow ? this.$refs[key].open(data) : this.$refs[key].close(data);
|
||||
},
|
||||
//购物车商品输入框数量输入
|
||||
cartGoodsNumberInput(newval, index) {
|
||||
const item = this.order.list[index];
|
||||
console.log(item);
|
||||
this.order.cacheNumber = newval;
|
||||
item.number = newval;
|
||||
},
|
||||
//购物车商品输入框数量改变
|
||||
cartGoodsNumberChange(newval,item){
|
||||
console.log(newval)
|
||||
if(newval<=0){
|
||||
item.number=1
|
||||
return this.order.number=1
|
||||
}
|
||||
newval=`${newval}`.split('.')[0]*1
|
||||
console.log(newval)
|
||||
this.order.cacheNumber=newval
|
||||
this.order.number=newval
|
||||
|
||||
cartGoodsNumberChange(newval, index) {
|
||||
const item = this.order.list[index];
|
||||
newval = `${newval}`.split(".")[0] * 1;
|
||||
console.log(newval);
|
||||
this.order.cacheNumber = newval;
|
||||
this.order.number = newval;
|
||||
},
|
||||
//判读单规格商品是否售尽
|
||||
isSellOut(item) {
|
||||
|
|
@ -1515,14 +1519,22 @@ export default {
|
|||
orderId: this.createOrder.data.id,
|
||||
payType: this.order.payType,
|
||||
});
|
||||
const res = await $payOrder({
|
||||
tableId: this.table.tableId,
|
||||
masterId: this.masterId,
|
||||
orderId: this.createOrder.data.id,
|
||||
payType: this.order.payType,
|
||||
vipUserId: this.vipUser.id,
|
||||
});
|
||||
this.payOrderSuccess();
|
||||
this.loading = true;
|
||||
try {
|
||||
const res = await $payOrder({
|
||||
tableId: this.table.tableId,
|
||||
masterId: this.masterId,
|
||||
orderId: this.createOrder.data.id,
|
||||
payType: this.order.payType,
|
||||
vipUserId: this.vipUser.id,
|
||||
discount: this.createOrder.discount,
|
||||
code: this.createOrder.code,
|
||||
});
|
||||
this.loading = false;
|
||||
this.payOrderSuccess();
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
payOrderSuccess() {
|
||||
this.$notify({
|
||||
|
|
@ -1554,18 +1566,32 @@ export default {
|
|||
this.isCreateOrder = false;
|
||||
},
|
||||
//生成订单
|
||||
toCreateOrderDebounce(isNowPay) {
|
||||
if (
|
||||
this.createOrder.status != "" &&
|
||||
this.createOrder.status != "success"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
this.createOrder.status = "loading";
|
||||
this.toCreateOrder(isNowPay);
|
||||
},
|
||||
async toCreateOrder(isNowPay = false) {
|
||||
console.log(this.order);
|
||||
console.log(this.order.orderId);
|
||||
const res = await $createOrder({
|
||||
masterId: this.order.masterId || this.masterId,
|
||||
vipUserId: this.vipUser.id,
|
||||
tableId: this.table.tableId,
|
||||
note: this.note.content,
|
||||
postPay: this.postPay,
|
||||
orderld: this.order.orderId,
|
||||
});
|
||||
//后付款
|
||||
console.log(this.postPay);
|
||||
console.log(isNowPay);
|
||||
console.log(this.postPay && isNowPay);
|
||||
this.createOrder.status = "success";
|
||||
if (this.postPay && !isNowPay) {
|
||||
this.$notify({
|
||||
title: "下单成功",
|
||||
|
|
@ -1578,7 +1604,6 @@ export default {
|
|||
const { masterId } = await this.getMasterId();
|
||||
this.masterId = masterId;
|
||||
}
|
||||
|
||||
this.isCreateOrder = true;
|
||||
},
|
||||
|
||||
|
|
@ -1724,10 +1749,13 @@ export default {
|
|||
// masterId:order.carList[0].masterId
|
||||
// })
|
||||
|
||||
const { masterId, tableId, userId, remark } = await $cacheOrder({
|
||||
const { masterId, tableId, userId, remark, id } = await $cacheOrder({
|
||||
orderId: this.prveOrder.list[this.prveOrder.sel].orderId,
|
||||
isPending: false,
|
||||
});
|
||||
this.order.orderId = id;
|
||||
console.log(this.order.orderId);
|
||||
|
||||
this.masterId = masterId;
|
||||
this.isPrverOrder = true;
|
||||
console.log(masterId);
|
||||
|
|
@ -1747,6 +1775,9 @@ export default {
|
|||
//删除挂单
|
||||
async delPrveOrder(isRequest = true) {
|
||||
const { sel } = this.prveOrder;
|
||||
if (this.prveOrder.list <= 0 || sel < 0) {
|
||||
return;
|
||||
}
|
||||
const order = this.prveOrder.list[sel];
|
||||
const orderMasterId = order.carList[0].masterId;
|
||||
//当前订单是否是当前挂单
|
||||
|
|
@ -1821,6 +1852,7 @@ export default {
|
|||
this.order.list = [];
|
||||
this.order.selIndex = -1;
|
||||
this.note.content = "";
|
||||
this.order.orderId = "";
|
||||
this.$nextTick(() => {
|
||||
this.getCacheOrder();
|
||||
});
|
||||
|
|
@ -1850,6 +1882,7 @@ export default {
|
|||
}
|
||||
this.order.selIndex = index;
|
||||
console.log(index);
|
||||
console.log(isReduce);
|
||||
const item = this.order.list[index];
|
||||
const mumber = item.number * 1;
|
||||
const newval = mumber + (isReduce ? -1 : 1);
|
||||
|
|
@ -1950,10 +1983,16 @@ export default {
|
|||
id: "",
|
||||
name: "全部",
|
||||
});
|
||||
console.log(this.category.list);
|
||||
},
|
||||
//改变购物车菜品选中
|
||||
changeOrderSel(index) {
|
||||
this.order.selIndex = index;
|
||||
this.order.old.selIndex = -1;
|
||||
},
|
||||
//改变已下单菜品选中
|
||||
changeOrderOldSel(index) {
|
||||
this.order.old.selIndex = index;
|
||||
this.order.cacheNumber = this.order.old.list[index].number;
|
||||
},
|
||||
chooseSkuConfirm() {
|
||||
if (this.timer) {
|
||||
|
|
@ -2010,20 +2049,34 @@ export default {
|
|||
});
|
||||
const orderGoods =
|
||||
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
|
||||
console.log(orderGoods);
|
||||
if (orderGoods) {
|
||||
const oldOrderGoods = this.order.old.list.find((V) => {
|
||||
return V.skuId == item.id && V.productId == this.selGoods.data.id;
|
||||
});
|
||||
if (orderGoods || oldOrderGoods) {
|
||||
//更新
|
||||
const newNum =
|
||||
(oldOrderGoods ? oldOrderGoods.number : 0) +
|
||||
(orderGoods ? orderGoods.number * 1 : 0) +
|
||||
this.skuGoods.number;
|
||||
res = await $updateCart({
|
||||
cartId: orderGoods.id,
|
||||
cartId: orderGoods ? orderGoods.id : oldOrderGoods.id,
|
||||
productId: this.selGoods.data.id,
|
||||
skuId: item.id,
|
||||
tableId: this.table.tableId,
|
||||
num: orderGoods.number * 1 + this.skuGoods.number, // 0会删除此商品
|
||||
num: newNum, // 0会删除此商品
|
||||
isPack: false, // 是否打包
|
||||
});
|
||||
orderGoods.number += this.skuGoods.number;
|
||||
this.order.selIndex = orderGoodsIndex;
|
||||
this.order.cacheNumber = orderGoods.number;
|
||||
if (this.key && orderGoodsIndex == -1) {
|
||||
this.orderListPush({
|
||||
...res,
|
||||
specSnap: name,
|
||||
number: this.skuGoods.number,
|
||||
});
|
||||
} else {
|
||||
orderGoods.number += this.skuGoods.number;
|
||||
this.order.selIndex = orderGoodsIndex;
|
||||
this.order.cacheNumber = orderGoods.number;
|
||||
}
|
||||
} else {
|
||||
//添加
|
||||
res = await addCart({
|
||||
|
|
@ -2098,14 +2151,14 @@ export default {
|
|||
prve[i] = matchArr
|
||||
.filter((v) => v.specSnap.match(i))
|
||||
.every((v) => {
|
||||
return (
|
||||
!v.isGrounding || v.isPauseSale == 1 || v.stockNumber <= 0
|
||||
);
|
||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||
return isCanBuy(v);
|
||||
});
|
||||
}
|
||||
}
|
||||
return prve;
|
||||
}, {});
|
||||
console.log(includeSkuMap);
|
||||
for (let i in includeSkuMap) {
|
||||
for (let k in skuList) {
|
||||
const index = skuList[k].valueArr.findIndex((val) => val === i);
|
||||
|
|
@ -2138,17 +2191,29 @@ export default {
|
|||
},
|
||||
reset() {
|
||||
// this.goods.list = [];
|
||||
this.loading = false;
|
||||
this.order.masterId = "";
|
||||
this.order.list = [];
|
||||
this.order.query.page = 1;
|
||||
this.goods.total = 0;
|
||||
this.order.list = [];
|
||||
this.order.selIndex = -1;
|
||||
this.order.old.list = [];
|
||||
this.prveOrder.list = [];
|
||||
this.prveOrder.selIndex = -1;
|
||||
this.order.old.selIndex = -1;
|
||||
this.isCreateOrder = false;
|
||||
this.createOrder.status = "";
|
||||
this.createOrder.code = "";
|
||||
this.note.content = "";
|
||||
this.vipUser = { id: "" };
|
||||
this.allPack = false;
|
||||
this.note.content = "";
|
||||
this.isPrverOrder = false;
|
||||
this.createOrder.discount = 1;
|
||||
this.order.cacheNumber = 1;
|
||||
this.key = "";
|
||||
this.order.orderId = "";
|
||||
},
|
||||
//获取购物车数据
|
||||
async getCart() {
|
||||
|
|
@ -2158,6 +2223,10 @@ export default {
|
|||
tableId: this.table.tableId,
|
||||
});
|
||||
this.order.list = res.records;
|
||||
if (this.key) {
|
||||
// this.order.old.list = res.records;
|
||||
} else {
|
||||
}
|
||||
this.order.total = res.total;
|
||||
},
|
||||
showSelGoods(item) {
|
||||
|
|
@ -2263,13 +2332,14 @@ export default {
|
|||
} else {
|
||||
//增加
|
||||
console.log(item);
|
||||
const num = item.specList[0].suit;
|
||||
res = await addCart({
|
||||
masterId: this.masterId,
|
||||
vipUserId: this.vipUser.id,
|
||||
productId: item.id,
|
||||
skuId: item.specList[0].id,
|
||||
tableId: this.table.tableId,
|
||||
num: item.specList[0].suit, // 0会删除此商品
|
||||
num: num <= 0 ? 1 : num, // 0会删除此商品
|
||||
isPack: false, // 是否打包
|
||||
});
|
||||
this.orderListPush(res);
|
||||
|
|
@ -2384,22 +2454,33 @@ export default {
|
|||
},
|
||||
async getGoods() {
|
||||
const res = await getGoodsLists(this.goods.query);
|
||||
console.log(res);
|
||||
this.goods.list = res.records.filter((v) => {
|
||||
const goods = res.records.filter((v) => {
|
||||
if (!v) {
|
||||
return false;
|
||||
}
|
||||
let isShow = true;
|
||||
if (v.typeEnum !== "sku") {
|
||||
isShow = v.specList.length >= 1;
|
||||
}
|
||||
return isShow;
|
||||
});
|
||||
this.goods.list = goods;
|
||||
this.goods.total = res.total;
|
||||
this.$goodsData = res;
|
||||
this.$goodsData = goods;
|
||||
},
|
||||
async open(item) {
|
||||
async open(item, key) {
|
||||
this.table = item;
|
||||
this.key = key;
|
||||
if (this.key == "isPayOrder") {
|
||||
this.isCreateOrder = true;
|
||||
}
|
||||
this.informationdialogshow;
|
||||
this.informationdialogshow = true;
|
||||
const res = await this.getMasterId();
|
||||
this.masterId = res.masterId;
|
||||
if (this.key == "isPayOrder") {
|
||||
this.toCreateOrder(true);
|
||||
}
|
||||
this.getCart();
|
||||
this.getGoods();
|
||||
this.getCategory();
|
||||
|
|
@ -2487,10 +2568,8 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
padding: 0 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
::v-deep .number-box .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
::v-deep .el-empty {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-button--success:not(.is-disabled) {
|
||||
background: #22bf64;
|
||||
|
|
@ -2522,6 +2601,10 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .number-box .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
.carts_list_title {
|
||||
padding: 16px 0 12px 0;
|
||||
display: flex;
|
||||
|
|
@ -2650,25 +2733,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
}
|
||||
}
|
||||
|
||||
.color-333 {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.color-666 {
|
||||
color: #666;
|
||||
}
|
||||
.ft-13 {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.color-000 {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.color-999 {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.ft-12 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
|
@ -2937,8 +3001,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
margin: 0 10px 10px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
.tag-group {
|
||||
}
|
||||
|
||||
::v-deep .tag-group .el-tag {
|
||||
min-width: 80px;
|
||||
|
|
@ -2978,6 +3040,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
color: #888;
|
||||
margin: 0 0 10px 7px;
|
||||
}
|
||||
|
||||
.numberbox {
|
||||
border: 1px solid #dcdfe6;
|
||||
background-color: #fff;
|
||||
|
|
@ -2987,7 +3050,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||
text-align: center;
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
margin: 0 0 10px;
|
||||
|
||||
.reduce,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
//判断商品是否可以下单
|
||||
export function isCanBuy(goods,isStock) {
|
||||
return goods.isGrounding && goods.isPauseSale == 0 && (isStock?goods.stockNumber > 0:true) ;
|
||||
}
|
||||
|
||||
// 一个数组是否包含另外一个数组全部元素
|
||||
export function arrayContainsAll(arr1, arr2) {
|
||||
for (let i = 0; i < arr2.length; i++) {
|
||||
if (!arr1.includes(arr2[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//n项 n-1项组合,生成全部结果
|
||||
export function generateCombinations(arr, k) {
|
||||
let result = [];
|
||||
|
||||
function helper(index, current) {
|
||||
if (current.length === k) {
|
||||
result.push(current.slice()); // 使用slice()来避免直接修改原始数组
|
||||
} else {
|
||||
for (let i = index; i < arr.length; i++) {
|
||||
current.push(arr[i]); // 将当前元素添加到组合中
|
||||
helper(i + 1, current); // 递归调用,索引增加以避免重复选择相同的元素
|
||||
current.pop(); // 回溯,移除当前元素以便尝试其他组合
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
helper(0, []); // 从索引0开始,初始空数组作为起点
|
||||
return result;
|
||||
}
|
||||
|
||||
export function returnReverseVal(val, isReturnString = true) {
|
||||
const isBol = typeof val === "boolean";
|
||||
const isString = typeof val === "string";
|
||||
let reverseNewval = "";
|
||||
if (isBol) {
|
||||
reverseNewval = !val;
|
||||
}
|
||||
if (isString) {
|
||||
reverseNewval = val === "true" ? "false" : "true";
|
||||
}
|
||||
return reverseNewval;
|
||||
}
|
||||
|
|
@ -43,16 +43,41 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<div class="table_list" v-loading="loading">
|
||||
<div class="item" v-for="item in tableList" :key="item.id">
|
||||
<div
|
||||
class="item"
|
||||
v-for="item in tableList"
|
||||
:key="item.id"
|
||||
:class="[item.status]"
|
||||
>
|
||||
<div class="new-top flex u-row-between">
|
||||
<span class="name">{{ item.name }}</span>
|
||||
<el-dropdown trigger="click" @command="tableComman($event,item)">
|
||||
<i class="el-icon-more cur-pointer color-fff"></i>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="edit">
|
||||
<i class="i el-icon-edit"></i>
|
||||
<span>编辑</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="del">
|
||||
<i class="i el-icon-delete"></i>
|
||||
<span>删除</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
<div class="top">
|
||||
<div class="row row1">
|
||||
<span>{{ item.name }}</span>
|
||||
<div class="state">
|
||||
<span
|
||||
class="dot"
|
||||
:style="{ backgroundColor: status[item.status].type }"
|
||||
:style="{
|
||||
backgroundColor: status[item.status]
|
||||
? status[item.status].type
|
||||
: '',
|
||||
}"
|
||||
></span>
|
||||
{{ status[item.status].label }}
|
||||
{{ status[item.status] ? status[item.status].label : "" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
@ -66,19 +91,46 @@
|
|||
<div class="row">
|
||||
<span class="tips">客座次数:{{ item.maxCapacity }}人</span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!item.tableId||item.status==='closed'"
|
||||
@click="diancanShow(item)"
|
||||
>点餐</el-button
|
||||
>
|
||||
<div class="row btn-group">
|
||||
<template v-if="item.status == 'idle'">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item)"
|
||||
>开始点餐</el-button
|
||||
>
|
||||
</template>
|
||||
<template v-else >
|
||||
<template v-if="item.status == 'using'">
|
||||
<el-button
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item, 'isAddGoods')"
|
||||
>加菜</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!item.tableId || item.status === 'closed'"
|
||||
@click="diancanShow(item, 'isPayOrder')"
|
||||
>结账</el-button
|
||||
>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
type="info"
|
||||
disabled
|
||||
>开始点餐</el-button
|
||||
>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<!-- <div class="u-flex u-col-center">
|
||||
<img style="width: 16px;height: 16px;" src="@/assets/images/perpole.png" alt="">
|
||||
<span class="color-000 u-font-12">{{ item.maxCapacity }}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="btm">
|
||||
<!-- <div class="btm_item">
|
||||
<i class="i el-icon-edit"></i>
|
||||
</div> -->
|
||||
<!-- <div class="btm">
|
||||
|
||||
<div class="btm_item" @click="$refs.addTable.show(item)">
|
||||
<i class="i el-icon-edit"></i>
|
||||
</div>
|
||||
|
|
@ -91,7 +143,7 @@
|
|||
<i class="i el-icon-delete"></i>
|
||||
</div>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="empty_wrap">
|
||||
<el-empty description="空空如也~" v-if="!tableList.length"></el-empty>
|
||||
|
|
@ -133,17 +185,17 @@ export default {
|
|||
total: 0,
|
||||
tableList: [],
|
||||
status: {
|
||||
pending:{
|
||||
label: "挂单中",
|
||||
type: "#E6A23C",
|
||||
pending: {
|
||||
label: "挂单中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
using:{
|
||||
label: "开台中",
|
||||
type: "#E6A23C",
|
||||
using: {
|
||||
label: "开台中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
paying:{
|
||||
label: "结算中",
|
||||
type: "#E6A23C",
|
||||
paying: {
|
||||
label: "结算中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
idle: {
|
||||
label: "空闲",
|
||||
|
|
@ -155,12 +207,12 @@ export default {
|
|||
},
|
||||
closed: {
|
||||
label: "关台",
|
||||
type: "#F56C6C",
|
||||
},
|
||||
opening: {
|
||||
label: "开台中",
|
||||
type: "#67C23A",
|
||||
type: "rgb(221,221,221)",
|
||||
},
|
||||
// opening: {
|
||||
// label: "开台中",
|
||||
// type: "#67C23A",
|
||||
// },
|
||||
cleaning: {
|
||||
label: "台桌清理中",
|
||||
type: "#909399",
|
||||
|
|
@ -172,11 +224,32 @@ export default {
|
|||
this.tbShopAreaGet();
|
||||
},
|
||||
methods: {
|
||||
onDiancanClose(){
|
||||
this.tbShopTableGet()
|
||||
tableComman(command,item){
|
||||
if(command=='edit'){
|
||||
return this.$refs.addTable.show(item)
|
||||
}
|
||||
if(command=='del'){
|
||||
return this.delPop(item)
|
||||
}
|
||||
},
|
||||
diancanShow(item) {
|
||||
this.$refs.dianan.open(item);
|
||||
delPop(item){
|
||||
this.$confirm('是否删除'+item.name+'台桌', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.delTableHandle([item.id])
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
},
|
||||
onDiancanClose() {
|
||||
this.tbShopTableGet();
|
||||
},
|
||||
diancanShow(item, key) {
|
||||
//key isAddGoods 加菜
|
||||
//key isPayOrder结账
|
||||
this.$refs.dianan.open(item, key);
|
||||
},
|
||||
tabClick() {
|
||||
this.tbShopTableGet();
|
||||
|
|
@ -210,6 +283,13 @@ export default {
|
|||
});
|
||||
console.log(content);
|
||||
this.tableList = content;
|
||||
// this.tableList = content.sort((a,b)=>{
|
||||
// if(a.status=='idle'&&b.status!='idle'){
|
||||
// return 1
|
||||
// }else if(a.status!='idle'&&b.status=='idle'){
|
||||
// return -1
|
||||
// }
|
||||
// });
|
||||
this.total = total;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
|
|
@ -244,7 +324,15 @@ export default {
|
|||
.icon {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
::v-deep .btn-group .el-button {
|
||||
width: 100%;
|
||||
}
|
||||
::v-deep .el-dropdown-menu__item {
|
||||
line-height: 36px;
|
||||
padding: 0 20px;
|
||||
min-width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
.table_list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
|
@ -256,13 +344,46 @@ export default {
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 1px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #ddd;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
border-radius: 6px;
|
||||
background-color: #1890ff;
|
||||
min-width: 162px;
|
||||
&.using {
|
||||
background-color: rgb(250, 85, 85);
|
||||
}
|
||||
&.closed{
|
||||
background-color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
.new-top {
|
||||
height: 30px;
|
||||
color: #fff;
|
||||
padding: 0 12px;
|
||||
}
|
||||
.name {
|
||||
font-size: 16px;
|
||||
line-height: 30px;
|
||||
margin-right: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.top {
|
||||
padding: 20px;
|
||||
|
||||
background-color: #fff;
|
||||
flex:1;
|
||||
// border-radius: 6px 6px 0 0;
|
||||
border-radius: 6px;
|
||||
.row {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
|
|
@ -272,7 +393,7 @@ export default {
|
|||
}
|
||||
|
||||
&:not(:first-child) {
|
||||
margin-top: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
&.row1 {
|
||||
|
|
@ -282,7 +403,6 @@ export default {
|
|||
.state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 80px;
|
||||
|
||||
.dot {
|
||||
$size: 6px;
|
||||
|
|
@ -300,7 +420,7 @@ export default {
|
|||
border-top: 1px solid #ddd;
|
||||
background-color: #efefef;
|
||||
display: flex;
|
||||
|
||||
border-radius: 0 0 6px 6px;
|
||||
.btm_item {
|
||||
flex: 1;
|
||||
height: 40px;
|
||||
|
|
|
|||
|
|
@ -72,9 +72,21 @@
|
|||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||
<el-table-column label="余额" prop="amount">
|
||||
<template v-slot="scope">
|
||||
<span style="color: #1890ff;cursor: pointer;" @click="moneyevent(scope.row)">
|
||||
{{ scope.row.amount }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="充值金额" prop="inMoney"></el-table-column>
|
||||
<el-table-column label="订单数量" prop="orderNumber"></el-table-column>
|
||||
<el-table-column label="订单数量" prop="orderNumber">
|
||||
<template v-slot="scope">
|
||||
<span style="color: #1890ff;cursor: pointer;" @click="orderNumberevent(scope.row)">
|
||||
{{ scope.row.orderNumber }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
||||
<el-table-column label="手机号" prop="telephone" width="160"></el-table-column>
|
||||
<el-table-column label="生日" prop="birthDay" width="200"></el-table-column>
|
||||
|
|
@ -97,14 +109,6 @@
|
|||
<el-dropdown-item>增减余额</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<!-- <el-button type="text" @click="editPop(scope.row)">增减余额</el-button> -->
|
||||
<!-- <el-button type="text" @click="">历史订单</el-button>
|
||||
<el-button type="text" @click="">充值记录</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>
|
||||
|
|
@ -162,13 +166,15 @@
|
|||
<el-radio label="out">扣除</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="余额">
|
||||
<el-form-item label="金额">
|
||||
<el-input v-model="userinfo.amount" @input="amountNum" style="width: 200px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group v-model="userinfo.type">
|
||||
<el-radio label="consume">消费</el-radio>
|
||||
<el-radio label="inMoney ">充值退款</el-radio>
|
||||
<el-radio label="inMoney" v-show="userinfo.operationType == 'in'">充值</el-radio>
|
||||
<el-radio label="consumeIn" v-show="userinfo.operationType == 'in'">消费退款</el-radio>
|
||||
<el-radio label="consumeOut" v-show="userinfo.operationType != 'in'">消费</el-radio>
|
||||
<el-radio label="inMoneyOut" v-show="userinfo.operationType != 'in'">充值退款</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
|
@ -177,11 +183,39 @@
|
|||
<el-button type="primary" @click="sumbit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 余额列表 -->
|
||||
<el-dialog title="余额明细" :visible.sync="moneyvisible" width="60%">
|
||||
<div>
|
||||
<el-table :data="moneyList.records" style="width: 100%">
|
||||
<el-table-column label="变动金额">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.type }} {{ scope.row.amount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="balance" label="余额">
|
||||
</el-table-column>
|
||||
<el-table-column prop="biz_name" label="业务名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="时间">
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="moneyList.total" :current-page="pages" @current-change="paginationChanges"
|
||||
layout="total, prev, pager, next, jumper"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="moneyvisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryAllShopUser, queryAllShopInfo, midfiyAccount, tbShopUseredit } from "@/api/shop";
|
||||
import { queryAllShopUser, queryAllShopInfo, midfiyAccount, tbShopUseredit, queryShopUserFlow } from "@/api/shop";
|
||||
import dayjs from "dayjs";
|
||||
let cacheData = {};
|
||||
export default {
|
||||
|
|
@ -205,16 +239,22 @@ export default {
|
|||
},
|
||||
dialogVisible: false,
|
||||
dialogVisibleedit: false,
|
||||
moneyvisible: false,
|
||||
userinfo: {
|
||||
nickName: '',
|
||||
operationType: 'in',
|
||||
type: 'consume'
|
||||
type: 'consume',
|
||||
amount: ''
|
||||
},
|
||||
userinfos: {
|
||||
levelConsume: "0",
|
||||
sex: '1',
|
||||
status: '1'
|
||||
}
|
||||
},
|
||||
// 余额分页
|
||||
moneyList: [],
|
||||
pages: 1,
|
||||
moneyuserId: '', // 查询当前用户余额的id
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
|
|
@ -229,12 +269,33 @@ export default {
|
|||
this.getShopInfo();
|
||||
},
|
||||
methods: {
|
||||
moneyevent(d) {
|
||||
this.moneyuserId = d.id
|
||||
this.moneyevents()
|
||||
},
|
||||
async moneyevents() {
|
||||
let res = await queryShopUserFlow({
|
||||
userId: this.moneyuserId,
|
||||
page: this.pages,
|
||||
pageSize: 10,
|
||||
})
|
||||
this.moneyList = res
|
||||
this.moneyvisible = true
|
||||
},
|
||||
orderNumberevent(d) {
|
||||
this.$router.push({
|
||||
path: '/order_manage/order_list',
|
||||
query: {
|
||||
userId: d.userId
|
||||
}
|
||||
})
|
||||
},
|
||||
checkIfNum() {
|
||||
this.userinfos.telephone = this.userinfos.telephone.toString().replace(/\D/g, '');
|
||||
},
|
||||
amountNum(){
|
||||
amountNum() {
|
||||
this.userinfo.amount = this.userinfo.amount.toString().replace(/[^\d|\.]/g, '')
|
||||
|
||||
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
|
|
@ -251,6 +312,10 @@ export default {
|
|||
this.getTableData();
|
||||
},
|
||||
async sumbit() {
|
||||
if (!this.userinfo.amount) {
|
||||
this.$message.error("请填写金额")
|
||||
return
|
||||
}
|
||||
let res = await midfiyAccount(this.userinfo)
|
||||
this.dialogVisible = false
|
||||
this.$message.success('修改成功')
|
||||
|
|
@ -261,6 +326,7 @@ export default {
|
|||
this.userinfo.nickName = d.nickName
|
||||
this.userinfo.amounts = d.amount
|
||||
this.userinfo.id = d.id
|
||||
this.userinfo.amount = ""
|
||||
},
|
||||
edituser(d) {
|
||||
let obj = { ...d }
|
||||
|
|
@ -323,6 +389,10 @@ export default {
|
|||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
paginationChanges(e) {
|
||||
this.pages = e;
|
||||
this.moneyevents()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue