Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq
This commit is contained in:
32
src/api/class-api.js
Normal file
32
src/api/class-api.js
Normal file
@@ -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,
|
data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 校验安全密码
|
||||||
|
export function tbShopInfoPUT(data) {
|
||||||
|
return request({
|
||||||
|
url: "/api/tbShopInfo",
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -625,10 +625,18 @@ export function tbShopUseredit(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 通过活动id获取赠送商品列表
|
// 通过活动id获取赠送商品列表
|
||||||
|
|
||||||
export function activate(id) {
|
export function activate(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `shop/storage/activate/${id}`,
|
url: `shop/storage/activate/${id}`,
|
||||||
method: "get"
|
method: "get"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 通过活动id获取赠送商品列表
|
||||||
|
export function queryShopUserFlow(params) {
|
||||||
|
return request({
|
||||||
|
url: `/api/tbShopUser/queryShopUserFlow`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
38
src/api/version.js
Normal file
38
src/api/version.js
Normal file
@@ -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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
BIN
src/assets/images/perpole.png
Normal file
BIN
src/assets/images/perpole.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 877 B |
367
src/assets/styles/util.scss
Normal file
367
src/assets/styles/util.scss
Normal file
@@ -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
|
// global css
|
||||||
import "./assets/styles/index.scss";
|
import "./assets/styles/index.scss";
|
||||||
|
import "./assets/styles/util.scss";
|
||||||
|
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const getters = {
|
|||||||
fileUploadApi: state => state.api.fileUploadApi,
|
fileUploadApi: state => state.api.fileUploadApi,
|
||||||
updateAvatarApi: state => state.api.updateAvatarApi,
|
updateAvatarApi: state => state.api.updateAvatarApi,
|
||||||
qiNiuUploadApi: state => state.api.qiNiuUploadApi,
|
qiNiuUploadApi: state => state.api.qiNiuUploadApi,
|
||||||
|
versionUploadApi: state => state.api.versonUploadApi,
|
||||||
sqlApi: state => state.api.sqlApi,
|
sqlApi: state => state.api.sqlApi,
|
||||||
swaggerApi: state => state.api.swaggerApi,
|
swaggerApi: state => state.api.swaggerApi,
|
||||||
sidebarRouters: state => state.permission.sidebarRouters
|
sidebarRouters: state => state.permission.sidebarRouters
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ const api = {
|
|||||||
swaggerApi: baseUrl + '/doc.html',
|
swaggerApi: baseUrl + '/doc.html',
|
||||||
// 文件上传
|
// 文件上传
|
||||||
fileUploadApi: baseUrl + '/api/localStorage',
|
fileUploadApi: baseUrl + '/api/localStorage',
|
||||||
|
// 上传版本文件
|
||||||
|
versonUploadApi: baseUrl + '/api/qiNiuContent/uploadVersionFile',
|
||||||
// baseUrl,
|
// baseUrl,
|
||||||
baseApi: baseUrl
|
baseApi: baseUrl
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<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 :model="searhForm" inline>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input>
|
<el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input>
|
||||||
@@ -93,6 +93,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
reset(){
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
},
|
||||||
onInput: _.debounce(function (event) {//防抖请求
|
onInput: _.debounce(function (event) {//防抖请求
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
}, 500),
|
}, 500),
|
||||||
@@ -210,6 +213,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.head-container{
|
||||||
|
max-height: 60vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
.shop_info {
|
.shop_info {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<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="app-container">
|
||||||
<!-- <div class="head-container">
|
<!-- <div class="head-container">
|
||||||
<el-form :model="query" inline>
|
<el-form :model="query" inline>
|
||||||
@@ -93,6 +93,10 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.head-container{
|
||||||
|
max-height: 60vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
.cursor-pointer{
|
.cursor-pointer{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #1890ff;
|
color: #1890ff;
|
||||||
|
|||||||
@@ -94,8 +94,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="所属商品" width="220">
|
<el-table-column label="所属商品" width="220">
|
||||||
<template v-slot="scope">
|
<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>
|
item.productName }}</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="库存数量" prop="stockNumber">
|
<el-table-column label="库存数量" prop="stockNumber">
|
||||||
@@ -858,6 +861,13 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<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-success {
|
||||||
color: #67c23a;
|
color: #67c23a;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
:title="dialogtitle"
|
:title="dialogtitle"
|
||||||
:visible.sync="dialogshow"
|
:visible.sync="dialogshow"
|
||||||
width="1000px"
|
width="1000px"
|
||||||
|
top="5vh"
|
||||||
@close="resetCommodityArr"
|
@close="resetCommodityArr"
|
||||||
>
|
>
|
||||||
<el-form ref="addSelect" :inline="true">
|
<el-form ref="addSelect" :inline="true">
|
||||||
@@ -153,96 +154,95 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<template>
|
<template>
|
||||||
<el-table :span-method="objectSpanMethod" :data="commodityArr">
|
<div class="scroll-box">
|
||||||
<el-table-column prop="name" label="商品名称"> </el-table-column>
|
<el-table :span-method="objectSpanMethod" :data="commodityArr">
|
||||||
<el-table-column label="规格">
|
<el-table-column prop="name" label="商品名称"> </el-table-column>
|
||||||
<template v-slot="scope">
|
<el-table-column label="规格">
|
||||||
<!-- 多规格 -->
|
|
||||||
<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="耗材信息">
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>
|
<!-- 多规格 -->
|
||||||
<div
|
<template
|
||||||
style="margin-bottom: 10px"
|
v-if="
|
||||||
v-for="(haocai, index) in scope.row.haocais"
|
scope.row.typeEnum == '多规格' &&
|
||||||
:key="index"
|
scope.row.isDistribute == 0
|
||||||
>
|
"
|
||||||
<template v-if="haocai.conName">
|
>
|
||||||
<div>{{ haocai.conName }}</div>
|
{{ scope.row.specSnap }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<!-- 单规格 -->
|
||||||
<el-input
|
<div v-else>
|
||||||
disabled
|
{{ scope.row.name }}
|
||||||
v-model="haocai.conName"
|
|
||||||
style="width: 130px"
|
|
||||||
placeholder="请选择耗材信息"
|
|
||||||
></el-input>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单位耗材值" width="180">
|
<el-table-column label="耗材">
|
||||||
<template v-slot="scope">
|
<el-table-column label="耗材信息">
|
||||||
<div>
|
<template v-slot="scope">
|
||||||
<div
|
<div>
|
||||||
style="margin-bottom: 10px; display: flex"
|
<div
|
||||||
v-for="(haocai, haocaiIndex) in scope.row.haocais"
|
style="margin-bottom: 10px"
|
||||||
:key="haocaiIndex"
|
v-for="(haocai, index) in scope.row.haocais"
|
||||||
>
|
:key="index"
|
||||||
<el-input
|
>
|
||||||
v-model="haocai.surplusStock"
|
<template v-if="haocai.conName">
|
||||||
type="number"
|
<div>{{ haocai.conName }}</div>
|
||||||
placeholder="单位耗材值"
|
</template>
|
||||||
@input="handleKeyUp($event, haocaiIndex)"
|
<template v-else>
|
||||||
></el-input>
|
<el-input
|
||||||
<div style="margin-left: 10px">
|
disabled
|
||||||
<el-button
|
v-model="haocai.conName"
|
||||||
v-if="scope.row.haocais.length > 1"
|
style="width: 130px"
|
||||||
type="danger"
|
placeholder="请选择耗材信息"
|
||||||
size="mini"
|
></el-input>
|
||||||
@click="
|
</template>
|
||||||
delGoodsHaocai(scope.row.haocais, haocaiIndex)
|
|
||||||
"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
circle
|
|
||||||
></el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="单位耗材值" width="180">
|
||||||
<el-table-column label="操作">
|
<template v-slot="scope">
|
||||||
<template v-slot="scope">
|
<div>
|
||||||
<el-button
|
<div
|
||||||
size="mini"
|
style="margin-bottom: 10px; display: flex"
|
||||||
type="primary"
|
v-for="(haocai, haocaiIndex) in scope.row.haocais"
|
||||||
@click="selecthaocai(scope.row)"
|
:key="haocaiIndex"
|
||||||
>去选择耗材信息</el-button
|
>
|
||||||
>
|
<el-input
|
||||||
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)">
|
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> -->
|
</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
<!-- <el-table-column label="操作">
|
||||||
<!-- <el-table-column label="操作">
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -252,8 +252,8 @@
|
|||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</div>
|
||||||
<!-- <div v-for="(ele, index) in commodityArr" :key="ele.id">
|
<!-- <div v-for="(ele, index) in commodityArr" :key="ele.id">
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
@@ -312,16 +312,13 @@
|
|||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
</template>
|
</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>
|
</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>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@@ -414,7 +411,7 @@
|
|||||||
<el-table-column label="单位" prop="conUnit" />
|
<el-table-column label="单位" prop="conUnit" />
|
||||||
<el-table-column label="库存数量" prop="stockNumber">
|
<el-table-column label="库存数量" prop="stockNumber">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ (scope.row.stockNumber - scope.row.stockConsume).toFixed(2) }}
|
{{ scope.row.balance }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@@ -626,7 +623,7 @@ export default {
|
|||||||
initTableSelected() {
|
initTableSelected() {
|
||||||
for (let i in haocaiSelectedMap) {
|
for (let i in haocaiSelectedMap) {
|
||||||
const index = this.tableDatainformation.data.findIndex(
|
const index = this.tableDatainformation.data.findIndex(
|
||||||
(v) => v.id == i
|
(v) => v.consId == i
|
||||||
);
|
);
|
||||||
if (index != -1 && haocaiSelectedMap[i]) {
|
if (index != -1 && haocaiSelectedMap[i]) {
|
||||||
//删除缓存里的id
|
//删除缓存里的id
|
||||||
@@ -658,10 +655,11 @@ export default {
|
|||||||
let index = -1;
|
let index = -1;
|
||||||
for (let key in haocaiSelectedMap) {
|
for (let key in haocaiSelectedMap) {
|
||||||
const item = haocaiSelectedMap[key];
|
const item = haocaiSelectedMap[key];
|
||||||
|
console.log(item);
|
||||||
index++;
|
index++;
|
||||||
this.$set(ele.haocais, index, {
|
this.$set(ele.haocais, index, {
|
||||||
consInfoId: item.id,
|
consInfoId: item.consId,
|
||||||
conInfoId: item.id,
|
conInfoId: item.consId,
|
||||||
conName: item.conName,
|
conName: item.conName,
|
||||||
skuId: ele.skuId,
|
skuId: ele.skuId,
|
||||||
shopId: ele.shopId,
|
shopId: ele.shopId,
|
||||||
@@ -685,14 +683,14 @@ export default {
|
|||||||
console.log(arr);
|
console.log(arr);
|
||||||
for (let item of this.tableDatainformation.data) {
|
for (let item of this.tableDatainformation.data) {
|
||||||
//判断缓存队列是否有这个id
|
//判断缓存队列是否有这个id
|
||||||
const hasCacheIncludes = haocaiSelectedMap.hasOwnProperty(item.id);
|
const hasCacheIncludes = haocaiSelectedMap.hasOwnProperty(item.consId);
|
||||||
//判断当前选中队列里是否有这个id
|
//判断当前选中队列里是否有这个id
|
||||||
const hasSelectedIncludes = arr.find((v) => v.id == item.id);
|
const hasSelectedIncludes = arr.find((v) => v.consId == item.consId);
|
||||||
if (hasSelectedIncludes) {
|
if (hasSelectedIncludes) {
|
||||||
haocaiSelectedMap[item.id] = hasSelectedIncludes;
|
haocaiSelectedMap[item.consId] = hasSelectedIncludes;
|
||||||
}
|
}
|
||||||
if (hasCacheIncludes && !hasSelectedIncludes) {
|
if (hasCacheIncludes && !hasSelectedIncludes) {
|
||||||
delete haocaiSelectedMap[item.id];
|
delete haocaiSelectedMap[item.consId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(haocaiSelectedMap);
|
console.log(haocaiSelectedMap);
|
||||||
@@ -785,11 +783,11 @@ export default {
|
|||||||
},
|
},
|
||||||
// 选择耗材
|
// 选择耗材
|
||||||
selecthaocai(item) {
|
selecthaocai(item) {
|
||||||
console.log(item)
|
console.log(item);
|
||||||
console.log(haocaiSelectedMap)
|
console.log(haocaiSelectedMap);
|
||||||
this.ALLisDistribute = item;
|
this.ALLisDistribute = item;
|
||||||
this.commodityArr.forEach((ele) => {
|
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) => {
|
ele.haocais.map((v) => {
|
||||||
if (v.conInfoId) {
|
if (v.conInfoId) {
|
||||||
haocaiSelectedMap[v.conInfoId] = v;
|
haocaiSelectedMap[v.conInfoId] = v;
|
||||||
@@ -906,7 +904,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 耗材信息的信息
|
// 耗材信息的信息
|
||||||
tableDatainformationtable(item) {
|
tableDatainformationtable(item) {
|
||||||
haocaiSelectedMap[item.id] = item;
|
haocaiSelectedMap[item.consId] = item;
|
||||||
this.haocaiConfirm();
|
this.haocaiConfirm();
|
||||||
return;
|
return;
|
||||||
this.commodityArr.forEach((ele) => {
|
this.commodityArr.forEach((ele) => {
|
||||||
@@ -963,7 +961,7 @@ export default {
|
|||||||
async submitForm(formName) {
|
async submitForm(formName) {
|
||||||
if (this.dialogtitle == "编辑") {
|
if (this.dialogtitle == "编辑") {
|
||||||
await puttbProskuCon({
|
await puttbProskuCon({
|
||||||
...this.surplusStocks
|
...this.surplusStocks,
|
||||||
});
|
});
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "修改成功",
|
message: "修改成功",
|
||||||
@@ -988,8 +986,8 @@ export default {
|
|||||||
|
|
||||||
let newArr = [];
|
let newArr = [];
|
||||||
for (let i of this.commodityArr) {
|
for (let i of this.commodityArr) {
|
||||||
//共享库存
|
//共享库存
|
||||||
console.log(i.haocais)
|
console.log(i.haocais);
|
||||||
if (i.isDistribute) {
|
if (i.isDistribute) {
|
||||||
for (let k of i.haocais) {
|
for (let k of i.haocais) {
|
||||||
newArr.push({
|
newArr.push({
|
||||||
@@ -1004,8 +1002,8 @@ export default {
|
|||||||
newArr.push({
|
newArr.push({
|
||||||
consInfoId: k.conInfoId,
|
consInfoId: k.conInfoId,
|
||||||
productId: i.id,
|
productId: i.id,
|
||||||
skuInfos:{
|
skuInfos: {
|
||||||
...k
|
...k,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1090,4 +1088,8 @@ export default {
|
|||||||
.head-container .filter-item {
|
.head-container .filter-item {
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
}
|
}
|
||||||
|
.scroll-box {
|
||||||
|
max-height: 70vh;
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -68,8 +68,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="库存" prop="number">
|
<el-table-column label="库存" prop="number">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope" >
|
||||||
<span :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
<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}` }}
|
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -41,19 +41,11 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="订单号">
|
<el-form-item label="订单号">
|
||||||
<el-input
|
<el-input v-model="query.orderNo" placeholder="请输入订单号" style="width: 300px;"></el-input>
|
||||||
v-model="query.orderNo"
|
|
||||||
placeholder="请输入订单号"
|
|
||||||
style="width: 300px;"
|
|
||||||
></el-input>
|
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品名称">
|
<el-form-item label="商品名称">
|
||||||
<el-input
|
<el-input v-model="query.productName" placeholder="请输入商品名称" style="width: 300px;"></el-input>
|
||||||
v-model="query.productName"
|
|
||||||
placeholder="请输入商品名称"
|
|
||||||
style="width: 300px;"
|
|
||||||
></el-input>
|
|
||||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||||
<el-button @click="resetHandle">重置</el-button>
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
|
<el-button icon="el-icon-download" v-loading="downloadLoading" @click="downloadHandle">
|
||||||
@@ -108,7 +100,7 @@
|
|||||||
<el-image :src="item.productImg" class="cover" lazy></el-image>
|
<el-image :src="item.productImg" class="cover" lazy></el-image>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<span :class="[item.isVip==1?'colorStyle':'']">
|
<span :class="[item.isVip == 1 ? 'colorStyle' : '']">
|
||||||
{{ item.productName }}
|
{{ item.productName }}
|
||||||
</span>
|
</span>
|
||||||
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
|
<span class="refund" v-if="item.refundNumber">(退 - {{ item.refundNumber }})</span>
|
||||||
@@ -194,7 +186,7 @@ export default {
|
|||||||
payType: "",
|
payType: "",
|
||||||
orderNo: "",
|
orderNo: "",
|
||||||
createdAt: [],
|
createdAt: [],
|
||||||
productName:''
|
productName: ''
|
||||||
},
|
},
|
||||||
tableData: {
|
tableData: {
|
||||||
data: [],
|
data: [],
|
||||||
@@ -239,7 +231,7 @@ export default {
|
|||||||
if (this.$route.query.tableName) {
|
if (this.$route.query.tableName) {
|
||||||
this.query.tableName = 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.query.orderNo = this.$route.query.orderNo
|
||||||
}
|
}
|
||||||
this.resetQuery = { ...this.query };
|
this.resetQuery = { ...this.query };
|
||||||
@@ -290,7 +282,7 @@ export default {
|
|||||||
this.timeValue = "";
|
this.timeValue = "";
|
||||||
this.query = { ...this.resetQuery };
|
this.query = { ...this.resetQuery };
|
||||||
this.page = 0;
|
this.page = 0;
|
||||||
this.getTableData();
|
this.getTableData(true);
|
||||||
},
|
},
|
||||||
// 分页大小改变
|
// 分页大小改变
|
||||||
sizeChange(e) {
|
sizeChange(e) {
|
||||||
@@ -303,17 +295,18 @@ export default {
|
|||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
async getTableData() {
|
async getTableData(switchs = false) {
|
||||||
this.tableData.loading = true;
|
this.tableData.loading = true;
|
||||||
try {
|
try {
|
||||||
this.payCount();
|
this.payCount();
|
||||||
const productName=this.query.productName.replace(/\s+/g,'')
|
const productName = this.query.productName.replace(/\s+/g, '')
|
||||||
const res = await tbOrderInfoData({
|
const res = await tbOrderInfoData({
|
||||||
page: this.tableData.page,
|
page: this.tableData.page,
|
||||||
pageSize: this.tableData.size,
|
pageSize: this.tableData.size,
|
||||||
orderType: this.orderType,
|
orderType: this.orderType,
|
||||||
...this.query,
|
...this.query,
|
||||||
productName
|
productName,
|
||||||
|
userId: switchs == true ? '' : this.$route.query.userId
|
||||||
});
|
});
|
||||||
this.tableData.loading = false;
|
this.tableData.loading = false;
|
||||||
this.tableData.data = res.content;
|
this.tableData.data = res.content;
|
||||||
@@ -520,7 +513,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.colorStyle{
|
|
||||||
color: #ffc315;
|
.colorStyle {
|
||||||
|
color: #ffc315;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,7 @@
|
|||||||
<el-table-column label="售价">
|
<el-table-column label="售价">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span>¥{{ scope.row.lowPrice }}</span>
|
<span>¥{{ scope.row.lowPrice }}</span>
|
||||||
|
<span v-if="scope.row.typeEnum == '多规格'">~¥{{ scope.row.maxPrice }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品规格" prop="typeEnum">
|
<el-table-column label="商品规格" prop="typeEnum">
|
||||||
|
|||||||
@@ -1,31 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="resetting">添加</el-button>
|
<!-- <el-button type="primary" @click="resetting">添加</el-button> -->
|
||||||
<el-table :data="tableData">
|
<el-table :data="tableData">
|
||||||
<el-table-column label="类型" prop="type">
|
<!-- <el-table-column label="类型" prop="type">
|
||||||
<template v-slot="row">
|
<template v-slot="row">
|
||||||
{{ row.row.type == 'text' ? '文本' : '图片' }}
|
{{ row.row.type == 'text' ? '文本' : '图片' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="描述" prop="name"> </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="图片" prop="value">
|
||||||
<el-table-column label="value" prop="value">
|
|
||||||
<template v-slot="row">
|
<template v-slot="row">
|
||||||
<img v-if="row.row.type == 'img'" :src="row.row.value" style="width: 40px;height: 40px;">
|
<img v-if="row.row.type == 'img'" :src="row.row.value" style="width: 40px;height: 40px;">
|
||||||
<span v-else>{{ row.row.value }}</span>
|
<span v-else>{{ row.row.value }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<el-table-column label="操作" width="250">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="text" size="mini" round icon="el-icon-edit"
|
<el-button type="text" size="mini" round icon="el-icon-edit" @click="edit(scope.row)">编辑</el-button>
|
||||||
@click="edit(scope.row.id)">编辑</el-button>
|
<!-- <el-popconfirm title="确定删除吗?" @confirm="delHandle([scope.row.id])">
|
||||||
<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 type="text" size="mini" round icon="el-icon-delete" slot="reference">
|
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-popconfirm>
|
</el-popconfirm> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -38,15 +34,17 @@
|
|||||||
|
|
||||||
<el-form-item label="描述">
|
<el-form-item label="描述">
|
||||||
<el-input v-model="form.name" placeholder="请输入内容"></el-input>
|
<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>
|
||||||
|
<!-- <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-form-item label="上传图片" v-if="form.type == 'img'">
|
||||||
<el-upload :headers="headers" class="avatar-uploader" :action="qiNiuUploadApi"
|
<el-upload :headers="headers" class="avatar-uploader" :action="qiNiuUploadApi"
|
||||||
:show-file-list="false" :on-success="handleSuccess">
|
:show-file-list="false" :on-success="handleSuccess">
|
||||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
<span>{{ form.detail }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文本" v-else>
|
<el-form-item label="文本" v-else>
|
||||||
<el-input v-model="form.value" placeholder="请输入内容"></el-input>
|
<el-input v-model="form.value" placeholder="请输入内容"></el-input>
|
||||||
@@ -98,13 +96,11 @@ export default {
|
|||||||
handleBeforeRemove(file, fileList) {
|
handleBeforeRemove(file, fileList) {
|
||||||
|
|
||||||
},
|
},
|
||||||
async edit(id) {
|
async edit(item) {
|
||||||
this.title = '编辑'
|
this.title = '编辑'
|
||||||
let res = await querytbShopExtend(id)
|
|
||||||
this.form.id = id
|
|
||||||
this.showLocation = true
|
this.showLocation = true
|
||||||
this.form = res
|
this.form = item
|
||||||
this.imageUrl = res.value
|
this.imageUrl = item.value
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
async delHandle(proId) {
|
async delHandle(proId) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" :model="form" label-width="120px" label-position="left">
|
<el-form ref="form" :model="form" label-width="120px" label-position="left">
|
||||||
|
|
||||||
<el-form-item label="操作密码">
|
<el-form-item label="操作密码">
|
||||||
<el-input v-model="form.password" type="number" @input="jiantingshuru" :disabled="disabled"
|
<el-input v-model="form.password" type="number" @input="jiantingshuru" :disabled="disabled"
|
||||||
:placeholder="disabled ? '******' : '请输入操作密码'" style="width: 200px;"></el-input>
|
:placeholder="disabled ? '******' : '请输入操作密码'" style="width: 200px;"></el-input>
|
||||||
@@ -17,17 +18,29 @@
|
|||||||
<el-button type="primary" @click="submitHandle">保存 </el-button>
|
<el-button type="primary" @click="submitHandle">保存 </el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
import { tbShopInfo } from "@/api/user";
|
import { tbShopInfo } from "@/api/user";
|
||||||
import { sendMsg, modfiyUserInfo } from "@/api/securitySetting"
|
import { sendMsg, modfiyUserInfo, tbShopInfoPUT } from "@/api/securitySetting"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
form: {}
|
form: {
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -42,20 +55,31 @@ export default {
|
|||||||
const shopId = localStorage.getItem("shopId");
|
const shopId = localStorage.getItem("shopId");
|
||||||
const res = await tbShopInfo(shopId);
|
const res = await tbShopInfo(shopId);
|
||||||
this.form = res
|
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() {
|
async submitHandle() {
|
||||||
let data = {
|
|
||||||
code: this.form.prepareAmount,
|
|
||||||
pwd: md5(this.form.password),
|
|
||||||
}
|
|
||||||
if (!this.form.prepareAmount) {
|
if (!this.form.prepareAmount) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "请输入验证码或密码"
|
message: "请输入验证码"
|
||||||
})
|
})
|
||||||
return
|
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.prepareAmount = ''
|
||||||
this.form.password = "******"
|
this.form.password = "******"
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
@@ -64,6 +88,21 @@ export default {
|
|||||||
type: 'success'
|
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() {
|
resetting() {
|
||||||
this.form.password = ''
|
this.form.password = ''
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
|
|||||||
@@ -35,13 +35,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="昵称" prop="nickname"> </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">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.proState" :active-value="1" :inactive-value="0"
|
<el-switch v-model="scope.row.proState" :active-value="1" :inactive-value="0"
|
||||||
@change="changeHot(scope.row.proState, 0, scope.row.openId)"></el-switch>
|
@change="changeHot(scope.row.proState, 0, scope.row.openId)"></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="耗材" prop="createdAt">
|
<el-table-column label="耗材库存预警" prop="createdAt">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-switch v-model="scope.row.conState" :active-value="1" :inactive-value="0"
|
<el-switch v-model="scope.row.conState" :active-value="1" :inactive-value="0"
|
||||||
@change="changeHot(scope.row.conState, 1, scope.row.openId)"></el-switch>
|
@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="2"></el-tab-pane>
|
||||||
<!-- <el-tab-pane label="通知配置" name="3"></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="4"></el-tab-pane>
|
||||||
<el-tab-pane label="扩展参数" name="5"></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="6" v-if="shopId==1"></el-tab-pane>
|
||||||
|
<el-tab-pane label="通知中心" name="7"></el-tab-pane>
|
||||||
|
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<shopInfo v-if="activeName == 1" />
|
<shopInfo v-if="activeName == 1" />
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
<securitySetting v-if="activeName == 4" />
|
<securitySetting v-if="activeName == 4" />
|
||||||
<extend v-if="activeName == 5" />
|
<extend v-if="activeName == 5" />
|
||||||
<goxcx v-if="activeName == 6" />
|
<goxcx v-if="activeName == 6" />
|
||||||
|
<notifications v-if="activeName == 7" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -26,15 +28,17 @@ import notice from './components/notice'
|
|||||||
import securitySetting from './components/securitySetting'
|
import securitySetting from './components/securitySetting'
|
||||||
import extend from './components/extend'
|
import extend from './components/extend'
|
||||||
import goxcx from './components/goxcx'
|
import goxcx from './components/goxcx'
|
||||||
|
import notifications from './notifications/index.vue'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
shopInfo,
|
shopInfo,
|
||||||
shopSetting,
|
shopSetting,
|
||||||
notice,securitySetting,extend,goxcx
|
notice,securitySetting,extend,goxcx,notifications
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: '1',
|
activeName: '1',
|
||||||
|
shopId:localStorage.getItem('shopId')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
157
src/views/system/version/components/add-version-file.vue
Normal file
157
src/views/system/version/components/add-version-file.vue
Normal file
@@ -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>
|
||||||
|
|
||||||
211
src/views/system/version/components/add-version.vue
Normal file
211
src/views/system/version/components/add-version.vue
Normal file
@@ -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>
|
||||||
|
|
||||||
125
src/views/system/version/components/upload-file.vue
Normal file
125
src/views/system/version/components/upload-file.vue
Normal file
@@ -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>
|
||||||
251
src/views/system/version/index.vue
Normal file
251
src/views/system/version/index.vue
Normal file
@@ -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-option :label="item.name" :value="item.id" v-for="item in areaList" :key="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</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-form-item label="台桌名称">
|
||||||
<el-input v-model="form.name" placeholder="请输入台桌名称"></el-input>
|
<el-input v-model="form.name" placeholder="请输入台桌名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -43,6 +48,16 @@ export default {
|
|||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
resetForm: '',
|
resetForm: '',
|
||||||
loading: false,
|
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: {
|
form: {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
@@ -76,6 +91,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
let res = await tbShopTable({
|
let res = await tbShopTable({
|
||||||
...this.form,
|
...this.form,
|
||||||
|
qrcode:this.form.tableId,
|
||||||
shopId: localStorage.getItem('shopId')
|
shopId: localStorage.getItem('shopId')
|
||||||
}, this.form.id ? 'put' : 'post')
|
}, this.form.id ? 'put' : 'post')
|
||||||
this.$emit('success', res)
|
this.$emit('success', res)
|
||||||
|
|||||||
@@ -128,9 +128,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
cacheData = { ...this.query };
|
// this.getTableData();
|
||||||
this.getTableData();
|
|
||||||
this.getShopInfo();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
cellClick(user){
|
cellClick(user){
|
||||||
@@ -155,6 +153,7 @@ export default {
|
|||||||
this.show = false;
|
this.show = false;
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
|
this.getTableData();
|
||||||
this.show = true;
|
this.show = true;
|
||||||
},
|
},
|
||||||
toPage(type) {
|
toPage(type) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
changeSel(item) {
|
changeSel(item) {
|
||||||
this.sel = item.payType;
|
this.sel = item.payType;
|
||||||
|
this.$emit("itemClick", item);
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const res = await $getPayType();
|
const res = await $getPayType();
|
||||||
|
|||||||
3804
src/views/table/components/table-diancan-back.vue
Normal file
3804
src/views/table/components/table-diancan-back.vue
Normal file
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>
|
||||||
197
src/views/table/components/table-diancan-components/discount.vue
Normal file
197
src/views/table/components/table-diancan-components/discount.vue
Normal file
@@ -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>
|
||||||
178
src/views/table/components/table-diancan-components/scan-pay.vue
Normal file
178
src/views/table/components/table-diancan-components/scan-pay.vue
Normal file
@@ -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>
|
||||||
3839
src/views/table/components/table-diancan-oldList-back.vue
Normal file
3839
src/views/table/components/table-diancan-oldList-back.vue
Normal file
File diff suppressed because one or more lines are too long
@@ -142,7 +142,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="diancan">
|
<div class="diancan" v-loading="loading">
|
||||||
<div class="order">
|
<div class="order">
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div style="padding-right: 14px">
|
<div style="padding-right: 14px">
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<div v-else class="headimg flex flex-x-y-center">
|
<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>
|
<div>
|
||||||
<div class="ft-13 color-000">{{ vipUser.nickName }}</div>
|
<div class="ft-13 color-000">{{ vipUser.nickName }}</div>
|
||||||
@@ -250,7 +250,7 @@
|
|||||||
type="success"
|
type="success"
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="!order.list.length"
|
:disabled="!order.list.length"
|
||||||
@click="toCreateOrder(false)"
|
@click="toCreateOrderDebounce(false)"
|
||||||
>
|
>
|
||||||
仅下单
|
仅下单
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -260,8 +260,8 @@
|
|||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<el-button
|
<el-button
|
||||||
size="medium"
|
size="medium"
|
||||||
:disabled="!order.list.length"
|
:disabled="!order.list.length && !order.old.list.length"
|
||||||
@click="toCreateOrder(true)"
|
@click="toCreateOrderDebounce(true)"
|
||||||
>
|
>
|
||||||
去结账
|
去结账
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -270,75 +270,46 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div
|
<!-- 当前购物车列表 -->
|
||||||
v-for="(item, index) in order.list"
|
<template v-if="order.list.length">
|
||||||
:key="index"
|
<cart-item
|
||||||
class="flex order-item relative"
|
@itemClick="changeOrderSel"
|
||||||
:class="{ active: order.selIndex === index }"
|
@changeOrderNumber="changeOrderNumber"
|
||||||
@click="changeOrderSel(index)"
|
@cartGoodsNumberInput="cartGoodsNumberInput"
|
||||||
>
|
@cartGoodsNumberChange="cartGoodsNumberChange"
|
||||||
<span class="absolute pack" v-if="item.isPack === 'true'">
|
v-for="(item, index) in order.list"
|
||||||
包
|
:key="index"
|
||||||
</span>
|
:index="index"
|
||||||
<div class="flex">
|
:item="item"
|
||||||
<div class="img">
|
:selIndex="order.selIndex"
|
||||||
<img :src="item.coverImg" class="" alt="" />
|
></cart-item>
|
||||||
</div>
|
</template>
|
||||||
<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>
|
|
||||||
|
|
||||||
<div v-if="order.gift.list.length">
|
<div v-if="order.gift.list.length">
|
||||||
<div class="carts_list_title">以下是优惠菜品</div>
|
<div class="carts_list_title">以下是优惠菜品</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!order.list.length">
|
<div v-if="!order.list.length">
|
||||||
<el-empty description="点餐列表为空"></el-empty>
|
<el-empty
|
||||||
|
:image-size="50"
|
||||||
|
description="点餐列表为空"
|
||||||
|
></el-empty>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="order_remark" v-if="note.content">
|
||||||
订单备注: {{ note.content }}
|
订单备注: {{ note.content }}
|
||||||
@@ -346,7 +317,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<div class="numberbox">
|
<div
|
||||||
|
class="numberbox"
|
||||||
|
:class="{ 'cur-pointer': order.old.selIndex < 0 }"
|
||||||
|
>
|
||||||
<div class="reduce" @click="changeOrderGoodsNumber('-')">-</div>
|
<div class="reduce" @click="changeOrderGoodsNumber('-')">-</div>
|
||||||
<div class="input relative">
|
<div class="input relative">
|
||||||
<div
|
<div
|
||||||
@@ -504,10 +478,7 @@
|
|||||||
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
<div class="flex img-box" v-if="layout.sel !== 'text'">
|
||||||
<img class="goods-img" :src="item.coverImg" alt="" />
|
<img class="goods-img" :src="item.coverImg" alt="" />
|
||||||
<template v-if="layout.sel === 'img-and-text'">
|
<template v-if="layout.sel === 'img-and-text'">
|
||||||
<div
|
<div class="sell-out-svg" v-if="isSellOut(item)">
|
||||||
class="sell-out-svg"
|
|
||||||
v-if="isSellOut(item)"
|
|
||||||
>
|
|
||||||
<svg
|
<svg
|
||||||
t="1724234807994"
|
t="1724234807994"
|
||||||
class="icon"
|
class="icon"
|
||||||
@@ -595,14 +566,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
||||||
|
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -649,12 +612,19 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div> -->
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="btn_group">
|
<div class="btn_group">
|
||||||
<el-button size="medium"> 整单打折/减免 </el-button>
|
<el-button size="medium" @click="disCountShow">
|
||||||
<el-button size="medium "> 免单 </el-button>
|
整单打折/减免
|
||||||
</div> -->
|
</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">
|
<div style="margin-top: 20px">
|
||||||
<el-button type="success" size="medium" @click="payOrder">
|
<el-button type="success" size="medium" @click="payOrder">
|
||||||
<span>立即支付</span>
|
<span>立即支付</span>
|
||||||
@@ -701,14 +671,23 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">整单改价</div>
|
<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>
|
||||||
<!---->
|
|
||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">桌位费/附加费</div>
|
<div class="left">桌位费/附加费</div>
|
||||||
<div class="right">¥0.00</div>
|
<div class="right">¥0.00</div>
|
||||||
</div>
|
</div>
|
||||||
<!----><!----><!---->
|
|
||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">总价</div>
|
<div class="left">总价</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
@@ -722,7 +701,9 @@
|
|||||||
<div class="detail_form_item">
|
<div class="detail_form_item">
|
||||||
<div class="left">应付金额</div>
|
<div class="left">应付金额</div>
|
||||||
<div class="right redfont">
|
<div class="right redfont">
|
||||||
¥{{ createOrder.data.amount | to2 }}
|
¥{{
|
||||||
|
(createOrder.data.amount * createOrder.discount) | to2
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
@@ -774,27 +755,6 @@
|
|||||||
>
|
>
|
||||||
{{ val.name }}
|
{{ val.name }}
|
||||||
</el-button>
|
</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>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -806,7 +766,7 @@
|
|||||||
<div class="price">¥{{ skuGoods.data.salePrice | to2 }}</div>
|
<div class="price">¥{{ skuGoods.data.salePrice | to2 }}</div>
|
||||||
<div class="sku-group-text">
|
<div class="sku-group-text">
|
||||||
<span> {{ skuText }}</span>
|
<span> {{ skuText }}</span>
|
||||||
<span>库存:{{ skuGoods.data.stockNumber || "" }}</span>
|
<span>库存:{{ skuGoods.data.stockNumber || 0 }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
@@ -831,14 +791,23 @@
|
|||||||
>
|
>
|
||||||
已下架
|
已下架
|
||||||
</button>
|
</button>
|
||||||
<button
|
<template v-else>
|
||||||
class="my-btn success flex-1"
|
<button
|
||||||
v-else
|
class="my-btn disabled flex-1"
|
||||||
:disabled="CanConfirm"
|
v-if="skuGoods.data.stockNumber <= 0"
|
||||||
@click="chooseSkuConfirm"
|
disabled
|
||||||
>
|
>
|
||||||
确定
|
库存不足
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
class="my-btn success flex-1"
|
||||||
|
v-else
|
||||||
|
:disabled="CanConfirm"
|
||||||
|
@click="chooseSkuConfirm"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -981,13 +950,30 @@
|
|||||||
<!-- 支付时的键盘弹窗 -->
|
<!-- 支付时的键盘弹窗 -->
|
||||||
<money-keyboard ref="refMoneyKeyboard" :title="moneyKeyboard.title">
|
<money-keyboard ref="refMoneyKeyboard" :title="moneyKeyboard.title">
|
||||||
</money-keyboard>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import _ from "lodash";
|
||||||
import chooseUser from "./choose-user.vue";
|
import chooseUser from "./choose-user.vue";
|
||||||
import payType from "./pay-type.vue";
|
import payType from "./pay-type.vue";
|
||||||
import chooseTable from "./table-diancan-components/choose-table-master.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 orderNote from "./table-diancan-components/note.vue";
|
||||||
import moneyKeyboard from "./money-keyboard.vue";
|
import moneyKeyboard from "./money-keyboard.vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
@@ -1008,54 +994,12 @@ import {
|
|||||||
$payOrder,
|
$payOrder,
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
//判断商品是否可以下单
|
import {
|
||||||
function isCanBuy(goods) {
|
isCanBuy,
|
||||||
return goods.isGrounding && goods.isPauseSale == 0 && goods.stockNumber > 0;
|
arrayContainsAll,
|
||||||
}
|
generateCombinations,
|
||||||
|
returnReverseVal,
|
||||||
// 一个数组是否包含另外一个数组全部元素
|
} from "./util.js";
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
chooseUser,
|
chooseUser,
|
||||||
@@ -1063,9 +1007,16 @@ export default {
|
|||||||
payType,
|
payType,
|
||||||
orderNote,
|
orderNote,
|
||||||
moneyKeyboard,
|
moneyKeyboard,
|
||||||
|
scanPay,
|
||||||
|
moneyDiscount,
|
||||||
|
cartItem,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//整体点餐页面loading
|
||||||
|
loading: false,
|
||||||
|
//台桌点餐页面打开时带来的参数 isAddGoods 加菜 isPayOrder结账
|
||||||
|
key: "",
|
||||||
//是否是从挂单里取出来的订单
|
//是否是从挂单里取出来的订单
|
||||||
isPrverOrder: false,
|
isPrverOrder: false,
|
||||||
//是否全屏
|
//是否全屏
|
||||||
@@ -1120,6 +1071,7 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
|
orderId: "",
|
||||||
payType: "",
|
payType: "",
|
||||||
masterId: "",
|
masterId: "",
|
||||||
allPack: false,
|
allPack: false,
|
||||||
@@ -1146,6 +1098,11 @@ export default {
|
|||||||
list: [],
|
list: [],
|
||||||
selIndex: -1,
|
selIndex: -1,
|
||||||
},
|
},
|
||||||
|
//已下单菜品
|
||||||
|
old: {
|
||||||
|
list: [],
|
||||||
|
selIndex: -1,
|
||||||
|
},
|
||||||
query: {
|
query: {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 20,
|
size: 20,
|
||||||
@@ -1187,8 +1144,13 @@ export default {
|
|||||||
canUpdate: true,
|
canUpdate: true,
|
||||||
//下单
|
//下单
|
||||||
createOrder: {
|
createOrder: {
|
||||||
|
code: "",
|
||||||
|
status: "",
|
||||||
|
discount: 1,
|
||||||
form: {},
|
form: {},
|
||||||
data: {},
|
data: {
|
||||||
|
amount: 0,
|
||||||
|
},
|
||||||
quan: {
|
quan: {
|
||||||
list: [],
|
list: [],
|
||||||
sel: "",
|
sel: "",
|
||||||
@@ -1241,17 +1203,26 @@ export default {
|
|||||||
return result.substring(0, result.length - 1);
|
return result.substring(0, result.length - 1);
|
||||||
},
|
},
|
||||||
allPrice() {
|
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
|
const price = this.order.list
|
||||||
.filter((v) => v.isGift !== "true")
|
.filter((v) => v.isGift !== "true")
|
||||||
.reduce((a, b) => {
|
.reduce((a, b) => {
|
||||||
return a + b.number * b.salePrice;
|
return a + b.number * b.salePrice;
|
||||||
}, 0);
|
}, 0);
|
||||||
return price.toFixed(2);
|
return (oldPrice + price).toFixed(2);
|
||||||
},
|
},
|
||||||
allNumber() {
|
allNumber() {
|
||||||
return this.order.list.reduce((a, b) => {
|
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||||
return a + b.number*1;
|
return a + b.number * 1;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
const cartNumber = this.order.list.reduce((a, b) => {
|
||||||
|
return a + b.number * 1;
|
||||||
|
}, 0);
|
||||||
|
return oldNumber + cartNumber;
|
||||||
},
|
},
|
||||||
selGoodsHide() {
|
selGoodsHide() {
|
||||||
this.selGoods.show = false;
|
this.selGoods.show = false;
|
||||||
@@ -1287,6 +1258,11 @@ export default {
|
|||||||
masterId: function (val) {
|
masterId: function (val) {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
},
|
},
|
||||||
|
isCreateOrder: function (val) {
|
||||||
|
if (!val) {
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
"vipUser.id": async function (val) {
|
"vipUser.id": async function (val) {
|
||||||
let masterId = this.order.masterId;
|
let masterId = this.order.masterId;
|
||||||
if (!masterId) {
|
if (!masterId) {
|
||||||
@@ -1361,6 +1337,7 @@ export default {
|
|||||||
},
|
},
|
||||||
"order.selIndex": function (val, oldval) {
|
"order.selIndex": function (val, oldval) {
|
||||||
console.log(val);
|
console.log(val);
|
||||||
|
this.order.old.selIndex = -1;
|
||||||
if (val === -1) {
|
if (val === -1) {
|
||||||
// return (this.order.number = 1);
|
// return (this.order.number = 1);
|
||||||
this.order.cacheNumber = 1;
|
this.order.cacheNumber = 1;
|
||||||
@@ -1378,7 +1355,7 @@ export default {
|
|||||||
// this.order.number = this.order.list[this.order.selIndex].number;
|
// 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) {
|
if (this.order.list.length <= 0 || this.order.selIndex < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1387,64 +1364,91 @@ export default {
|
|||||||
let item = this.order.list[this.order.selIndex];
|
let item = this.order.list[this.order.selIndex];
|
||||||
console.log(item.specSnap);
|
console.log(item.specSnap);
|
||||||
const { productId, skuId, isPack, isGift, number } = item;
|
const { productId, skuId, isPack, isGift, number } = item;
|
||||||
|
const oldGoods = this.order.old.list.find((v) => {
|
||||||
|
return v.productId === productId && v.skuId === skuId;
|
||||||
|
});
|
||||||
$updateCart({
|
$updateCart({
|
||||||
cartId: item.id,
|
cartId: item.id,
|
||||||
productId,
|
productId,
|
||||||
skuId,
|
skuId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: this.order.number, // 0会删除此商品
|
num: this.order.number + (oldGoods ? oldGoods.number : 0), // 0会删除此商品
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$set(this.order.list, this.order.selIndex, {
|
this.$set(this.order.list, this.order.selIndex, {
|
||||||
...res,
|
...res,
|
||||||
specSnap: item.specSnap,
|
specSnap: item.specSnap,
|
||||||
|
number: this.order.number,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
this.updateOrder({
|
this.updateOrder({
|
||||||
num: newval, // 0会删除此商品
|
num: newval, // 0会删除此商品
|
||||||
});
|
});
|
||||||
},
|
}, 30),
|
||||||
"goods.query.productId": function (newval) {
|
"goods.query.productId": function (newval) {
|
||||||
console.log(newval);
|
if (!this.$goodsData) {
|
||||||
if (newval === "") {
|
return;
|
||||||
this.goods.list = this.$goodsData.records || [];
|
}
|
||||||
|
if (newval == "") {
|
||||||
|
this.goods.list = this.$goodsData || [];
|
||||||
} else {
|
} else {
|
||||||
const newarr = this.$goodsData.records.filter((v) =>
|
const newarr = this.$goodsData.filter((v) =>
|
||||||
v.name.includes(newval.trim())
|
v.name.includes(newval.trim())
|
||||||
);
|
);
|
||||||
this.search.list = newarr;
|
this.search.list = newarr;
|
||||||
this.goods.list = newarr.length ? newarr : this.$goodsData.records;
|
this.goods.list = newarr.length ? newarr : this.$goodsData;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.getGoods();
|
// this.getGoods();
|
||||||
// this.getCategory();
|
// this.getCategory();
|
||||||
|
// this.refToggle('refScanCode',true)
|
||||||
|
// this.refToggle("refDiscount", true);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//购物车商品输入框数量输入
|
//扫码支付弹窗确认
|
||||||
cartGoodsNumberInput(newval,item){
|
scanPayConfirm(code) {
|
||||||
if(newval<=0){
|
this.createOrder.code = code;
|
||||||
return this.order.cacheNumber=1
|
this.payOrder();
|
||||||
|
},
|
||||||
|
payTypeItemClick(item) {
|
||||||
|
console.log(item);
|
||||||
|
if (item.payType == "deposit") {
|
||||||
|
//扫码支付
|
||||||
|
this.refToggle("refScanCode", true);
|
||||||
}
|
}
|
||||||
newval=`${newval}`.split('.')[0]*1
|
},
|
||||||
this.order.cacheNumber=newval
|
ChangeDiscount(discount) {
|
||||||
this.$nextTick(()=>{
|
this.createOrder.discount = discount;
|
||||||
item.number=newval
|
},
|
||||||
})
|
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){
|
cartGoodsNumberChange(newval, index) {
|
||||||
console.log(newval)
|
const item = this.order.list[index];
|
||||||
if(newval<=0){
|
newval = `${newval}`.split(".")[0] * 1;
|
||||||
item.number=1
|
console.log(newval);
|
||||||
return this.order.number=1
|
this.order.cacheNumber = newval;
|
||||||
}
|
this.order.number = newval;
|
||||||
newval=`${newval}`.split('.')[0]*1
|
|
||||||
console.log(newval)
|
|
||||||
this.order.cacheNumber=newval
|
|
||||||
this.order.number=newval
|
|
||||||
|
|
||||||
},
|
},
|
||||||
//判读单规格商品是否售尽
|
//判读单规格商品是否售尽
|
||||||
isSellOut(item) {
|
isSellOut(item) {
|
||||||
@@ -1515,14 +1519,22 @@ export default {
|
|||||||
orderId: this.createOrder.data.id,
|
orderId: this.createOrder.data.id,
|
||||||
payType: this.order.payType,
|
payType: this.order.payType,
|
||||||
});
|
});
|
||||||
const res = await $payOrder({
|
this.loading = true;
|
||||||
tableId: this.table.tableId,
|
try {
|
||||||
masterId: this.masterId,
|
const res = await $payOrder({
|
||||||
orderId: this.createOrder.data.id,
|
tableId: this.table.tableId,
|
||||||
payType: this.order.payType,
|
masterId: this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
orderId: this.createOrder.data.id,
|
||||||
});
|
payType: this.order.payType,
|
||||||
this.payOrderSuccess();
|
vipUserId: this.vipUser.id,
|
||||||
|
discount: this.createOrder.discount,
|
||||||
|
code: this.createOrder.code,
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
this.payOrderSuccess();
|
||||||
|
} catch (error) {
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
payOrderSuccess() {
|
payOrderSuccess() {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
@@ -1554,18 +1566,32 @@ export default {
|
|||||||
this.isCreateOrder = false;
|
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) {
|
async toCreateOrder(isNowPay = false) {
|
||||||
|
console.log(this.order);
|
||||||
|
console.log(this.order.orderId);
|
||||||
const res = await $createOrder({
|
const res = await $createOrder({
|
||||||
masterId: this.order.masterId || this.masterId,
|
masterId: this.order.masterId || this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
note: this.note.content,
|
note: this.note.content,
|
||||||
postPay: this.postPay,
|
postPay: this.postPay,
|
||||||
|
orderld: this.order.orderId,
|
||||||
});
|
});
|
||||||
//后付款
|
//后付款
|
||||||
console.log(this.postPay);
|
console.log(this.postPay);
|
||||||
console.log(isNowPay);
|
console.log(isNowPay);
|
||||||
console.log(this.postPay && isNowPay);
|
console.log(this.postPay && isNowPay);
|
||||||
|
this.createOrder.status = "success";
|
||||||
if (this.postPay && !isNowPay) {
|
if (this.postPay && !isNowPay) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: "下单成功",
|
title: "下单成功",
|
||||||
@@ -1578,7 +1604,6 @@ export default {
|
|||||||
const { masterId } = await this.getMasterId();
|
const { masterId } = await this.getMasterId();
|
||||||
this.masterId = masterId;
|
this.masterId = masterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isCreateOrder = true;
|
this.isCreateOrder = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1724,10 +1749,13 @@ export default {
|
|||||||
// masterId:order.carList[0].masterId
|
// 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,
|
orderId: this.prveOrder.list[this.prveOrder.sel].orderId,
|
||||||
isPending: false,
|
isPending: false,
|
||||||
});
|
});
|
||||||
|
this.order.orderId = id;
|
||||||
|
console.log(this.order.orderId);
|
||||||
|
|
||||||
this.masterId = masterId;
|
this.masterId = masterId;
|
||||||
this.isPrverOrder = true;
|
this.isPrverOrder = true;
|
||||||
console.log(masterId);
|
console.log(masterId);
|
||||||
@@ -1747,6 +1775,9 @@ export default {
|
|||||||
//删除挂单
|
//删除挂单
|
||||||
async delPrveOrder(isRequest = true) {
|
async delPrveOrder(isRequest = true) {
|
||||||
const { sel } = this.prveOrder;
|
const { sel } = this.prveOrder;
|
||||||
|
if (this.prveOrder.list <= 0 || sel < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const order = this.prveOrder.list[sel];
|
const order = this.prveOrder.list[sel];
|
||||||
const orderMasterId = order.carList[0].masterId;
|
const orderMasterId = order.carList[0].masterId;
|
||||||
//当前订单是否是当前挂单
|
//当前订单是否是当前挂单
|
||||||
@@ -1821,6 +1852,7 @@ export default {
|
|||||||
this.order.list = [];
|
this.order.list = [];
|
||||||
this.order.selIndex = -1;
|
this.order.selIndex = -1;
|
||||||
this.note.content = "";
|
this.note.content = "";
|
||||||
|
this.order.orderId = "";
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.getCacheOrder();
|
this.getCacheOrder();
|
||||||
});
|
});
|
||||||
@@ -1850,6 +1882,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.order.selIndex = index;
|
this.order.selIndex = index;
|
||||||
console.log(index);
|
console.log(index);
|
||||||
|
console.log(isReduce);
|
||||||
const item = this.order.list[index];
|
const item = this.order.list[index];
|
||||||
const mumber = item.number * 1;
|
const mumber = item.number * 1;
|
||||||
const newval = mumber + (isReduce ? -1 : 1);
|
const newval = mumber + (isReduce ? -1 : 1);
|
||||||
@@ -1950,10 +1983,16 @@ export default {
|
|||||||
id: "",
|
id: "",
|
||||||
name: "全部",
|
name: "全部",
|
||||||
});
|
});
|
||||||
console.log(this.category.list);
|
|
||||||
},
|
},
|
||||||
|
//改变购物车菜品选中
|
||||||
changeOrderSel(index) {
|
changeOrderSel(index) {
|
||||||
this.order.selIndex = 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() {
|
chooseSkuConfirm() {
|
||||||
if (this.timer) {
|
if (this.timer) {
|
||||||
@@ -2010,20 +2049,34 @@ export default {
|
|||||||
});
|
});
|
||||||
const orderGoods =
|
const orderGoods =
|
||||||
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
|
orderGoodsIndex != -1 ? this.order.list[orderGoodsIndex] : undefined;
|
||||||
console.log(orderGoods);
|
const oldOrderGoods = this.order.old.list.find((V) => {
|
||||||
if (orderGoods) {
|
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({
|
res = await $updateCart({
|
||||||
cartId: orderGoods.id,
|
cartId: orderGoods ? orderGoods.id : oldOrderGoods.id,
|
||||||
productId: this.selGoods.data.id,
|
productId: this.selGoods.data.id,
|
||||||
skuId: item.id,
|
skuId: item.id,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: orderGoods.number * 1 + this.skuGoods.number, // 0会删除此商品
|
num: newNum, // 0会删除此商品
|
||||||
isPack: false, // 是否打包
|
isPack: false, // 是否打包
|
||||||
});
|
});
|
||||||
orderGoods.number += this.skuGoods.number;
|
if (this.key && orderGoodsIndex == -1) {
|
||||||
this.order.selIndex = orderGoodsIndex;
|
this.orderListPush({
|
||||||
this.order.cacheNumber = orderGoods.number;
|
...res,
|
||||||
|
specSnap: name,
|
||||||
|
number: this.skuGoods.number,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
orderGoods.number += this.skuGoods.number;
|
||||||
|
this.order.selIndex = orderGoodsIndex;
|
||||||
|
this.order.cacheNumber = orderGoods.number;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//添加
|
//添加
|
||||||
res = await addCart({
|
res = await addCart({
|
||||||
@@ -2098,14 +2151,14 @@ export default {
|
|||||||
prve[i] = matchArr
|
prve[i] = matchArr
|
||||||
.filter((v) => v.specSnap.match(i))
|
.filter((v) => v.specSnap.match(i))
|
||||||
.every((v) => {
|
.every((v) => {
|
||||||
return (
|
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||||
!v.isGrounding || v.isPauseSale == 1 || v.stockNumber <= 0
|
return isCanBuy(v);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return prve;
|
return prve;
|
||||||
}, {});
|
}, {});
|
||||||
|
console.log(includeSkuMap);
|
||||||
for (let i in includeSkuMap) {
|
for (let i in includeSkuMap) {
|
||||||
for (let k in skuList) {
|
for (let k in skuList) {
|
||||||
const index = skuList[k].valueArr.findIndex((val) => val === i);
|
const index = skuList[k].valueArr.findIndex((val) => val === i);
|
||||||
@@ -2138,17 +2191,29 @@ export default {
|
|||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
// this.goods.list = [];
|
// this.goods.list = [];
|
||||||
|
this.loading = false;
|
||||||
this.order.masterId = "";
|
this.order.masterId = "";
|
||||||
this.order.list = [];
|
this.order.list = [];
|
||||||
this.order.query.page = 1;
|
this.order.query.page = 1;
|
||||||
this.goods.total = 0;
|
this.goods.total = 0;
|
||||||
this.order.list = [];
|
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.isCreateOrder = false;
|
||||||
|
this.createOrder.status = "";
|
||||||
|
this.createOrder.code = "";
|
||||||
this.note.content = "";
|
this.note.content = "";
|
||||||
this.vipUser = { id: "" };
|
this.vipUser = { id: "" };
|
||||||
this.allPack = false;
|
this.allPack = false;
|
||||||
this.note.content = "";
|
this.note.content = "";
|
||||||
this.isPrverOrder = false;
|
this.isPrverOrder = false;
|
||||||
|
this.createOrder.discount = 1;
|
||||||
|
this.order.cacheNumber = 1;
|
||||||
|
this.key = "";
|
||||||
|
this.order.orderId = "";
|
||||||
},
|
},
|
||||||
//获取购物车数据
|
//获取购物车数据
|
||||||
async getCart() {
|
async getCart() {
|
||||||
@@ -2158,6 +2223,10 @@ export default {
|
|||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
});
|
});
|
||||||
this.order.list = res.records;
|
this.order.list = res.records;
|
||||||
|
if (this.key) {
|
||||||
|
// this.order.old.list = res.records;
|
||||||
|
} else {
|
||||||
|
}
|
||||||
this.order.total = res.total;
|
this.order.total = res.total;
|
||||||
},
|
},
|
||||||
showSelGoods(item) {
|
showSelGoods(item) {
|
||||||
@@ -2263,13 +2332,14 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
//增加
|
//增加
|
||||||
console.log(item);
|
console.log(item);
|
||||||
|
const num = item.specList[0].suit;
|
||||||
res = await addCart({
|
res = await addCart({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
productId: item.id,
|
productId: item.id,
|
||||||
skuId: item.specList[0].id,
|
skuId: item.specList[0].id,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: item.specList[0].suit, // 0会删除此商品
|
num: num <= 0 ? 1 : num, // 0会删除此商品
|
||||||
isPack: false, // 是否打包
|
isPack: false, // 是否打包
|
||||||
});
|
});
|
||||||
this.orderListPush(res);
|
this.orderListPush(res);
|
||||||
@@ -2384,22 +2454,33 @@ export default {
|
|||||||
},
|
},
|
||||||
async getGoods() {
|
async getGoods() {
|
||||||
const res = await getGoodsLists(this.goods.query);
|
const res = await getGoodsLists(this.goods.query);
|
||||||
console.log(res);
|
const goods = res.records.filter((v) => {
|
||||||
this.goods.list = res.records.filter((v) => {
|
if (!v) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let isShow = true;
|
let isShow = true;
|
||||||
if (v.typeEnum !== "sku") {
|
if (v.typeEnum !== "sku") {
|
||||||
isShow = v.specList.length >= 1;
|
isShow = v.specList.length >= 1;
|
||||||
}
|
}
|
||||||
return isShow;
|
return isShow;
|
||||||
});
|
});
|
||||||
|
this.goods.list = goods;
|
||||||
this.goods.total = res.total;
|
this.goods.total = res.total;
|
||||||
this.$goodsData = res;
|
this.$goodsData = goods;
|
||||||
},
|
},
|
||||||
async open(item) {
|
async open(item, key) {
|
||||||
this.table = item;
|
this.table = item;
|
||||||
|
this.key = key;
|
||||||
|
if (this.key == "isPayOrder") {
|
||||||
|
this.isCreateOrder = true;
|
||||||
|
}
|
||||||
|
this.informationdialogshow;
|
||||||
this.informationdialogshow = true;
|
this.informationdialogshow = true;
|
||||||
const res = await this.getMasterId();
|
const res = await this.getMasterId();
|
||||||
this.masterId = res.masterId;
|
this.masterId = res.masterId;
|
||||||
|
if (this.key == "isPayOrder") {
|
||||||
|
this.toCreateOrder(true);
|
||||||
|
}
|
||||||
this.getCart();
|
this.getCart();
|
||||||
this.getGoods();
|
this.getGoods();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
@@ -2487,10 +2568,8 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
::v-deep .el-empty {
|
||||||
::v-deep .number-box .el-input__inner::-webkit-outer-spin-button {
|
padding: 0;
|
||||||
-webkit-appearance: none;
|
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
::v-deep .el-button--success:not(.is-disabled) {
|
::v-deep .el-button--success:not(.is-disabled) {
|
||||||
background: #22bf64;
|
background: #22bf64;
|
||||||
@@ -2522,6 +2601,10 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
::v-deep .number-box .el-input__inner::-webkit-outer-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
.carts_list_title {
|
.carts_list_title {
|
||||||
padding: 16px 0 12px 0;
|
padding: 16px 0 12px 0;
|
||||||
display: flex;
|
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 {
|
.ft-12 {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
@@ -2937,8 +3001,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
margin: 0 10px 10px 0;
|
margin: 0 10px 10px 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.tag-group {
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .tag-group .el-tag {
|
::v-deep .tag-group .el-tag {
|
||||||
min-width: 80px;
|
min-width: 80px;
|
||||||
@@ -2978,6 +3040,7 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
color: #888;
|
color: #888;
|
||||||
margin: 0 0 10px 7px;
|
margin: 0 0 10px 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.numberbox {
|
.numberbox {
|
||||||
border: 1px solid #dcdfe6;
|
border: 1px solid #dcdfe6;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -2987,7 +3050,6 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
|
||||||
margin: 0 0 10px;
|
margin: 0 0 10px;
|
||||||
|
|
||||||
.reduce,
|
.reduce,
|
||||||
|
|||||||
47
src/views/table/components/util.js
Normal file
47
src/views/table/components/util.js
Normal file
@@ -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>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<div class="table_list" v-loading="loading">
|
<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="top">
|
||||||
<div class="row row1">
|
<div class="row row1">
|
||||||
<span>{{ item.name }}</span>
|
<span>{{ item.name }}</span>
|
||||||
<div class="state">
|
<div class="state">
|
||||||
<span
|
<span
|
||||||
class="dot"
|
class="dot"
|
||||||
:style="{ backgroundColor: status[item.status].type }"
|
:style="{
|
||||||
|
backgroundColor: status[item.status]
|
||||||
|
? status[item.status].type
|
||||||
|
: '',
|
||||||
|
}"
|
||||||
></span>
|
></span>
|
||||||
{{ status[item.status].label }}
|
{{ status[item.status] ? status[item.status].label : "" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -66,19 +91,46 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<span class="tips">客座次数:{{ item.maxCapacity }}人</span>
|
<span class="tips">客座次数:{{ item.maxCapacity }}人</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row btn-group">
|
||||||
<el-button
|
<template v-if="item.status == 'idle'">
|
||||||
type="primary"
|
<el-button
|
||||||
:disabled="!item.tableId||item.status==='closed'"
|
type="primary"
|
||||||
@click="diancanShow(item)"
|
:disabled="!item.tableId || item.status === 'closed'"
|
||||||
>点餐</el-button
|
@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>
|
||||||
|
<!-- <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>
|
||||||
<div class="btm">
|
<!-- <div class="btm">
|
||||||
<!-- <div class="btm_item">
|
|
||||||
<i class="i el-icon-edit"></i>
|
|
||||||
</div> -->
|
|
||||||
<div class="btm_item" @click="$refs.addTable.show(item)">
|
<div class="btm_item" @click="$refs.addTable.show(item)">
|
||||||
<i class="i el-icon-edit"></i>
|
<i class="i el-icon-edit"></i>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,7 +143,7 @@
|
|||||||
<i class="i el-icon-delete"></i>
|
<i class="i el-icon-delete"></i>
|
||||||
</div>
|
</div>
|
||||||
</el-popconfirm>
|
</el-popconfirm>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="empty_wrap">
|
<div class="empty_wrap">
|
||||||
<el-empty description="空空如也~" v-if="!tableList.length"></el-empty>
|
<el-empty description="空空如也~" v-if="!tableList.length"></el-empty>
|
||||||
@@ -133,17 +185,17 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
tableList: [],
|
tableList: [],
|
||||||
status: {
|
status: {
|
||||||
pending:{
|
pending: {
|
||||||
label: "挂单中",
|
label: "挂单中",
|
||||||
type: "#E6A23C",
|
type: "#E6A23C",
|
||||||
},
|
},
|
||||||
using:{
|
using: {
|
||||||
label: "开台中",
|
label: "开台中",
|
||||||
type: "#E6A23C",
|
type: "#E6A23C",
|
||||||
},
|
},
|
||||||
paying:{
|
paying: {
|
||||||
label: "结算中",
|
label: "结算中",
|
||||||
type: "#E6A23C",
|
type: "#E6A23C",
|
||||||
},
|
},
|
||||||
idle: {
|
idle: {
|
||||||
label: "空闲",
|
label: "空闲",
|
||||||
@@ -155,12 +207,12 @@ export default {
|
|||||||
},
|
},
|
||||||
closed: {
|
closed: {
|
||||||
label: "关台",
|
label: "关台",
|
||||||
type: "#F56C6C",
|
type: "rgb(221,221,221)",
|
||||||
},
|
|
||||||
opening: {
|
|
||||||
label: "开台中",
|
|
||||||
type: "#67C23A",
|
|
||||||
},
|
},
|
||||||
|
// opening: {
|
||||||
|
// label: "开台中",
|
||||||
|
// type: "#67C23A",
|
||||||
|
// },
|
||||||
cleaning: {
|
cleaning: {
|
||||||
label: "台桌清理中",
|
label: "台桌清理中",
|
||||||
type: "#909399",
|
type: "#909399",
|
||||||
@@ -172,11 +224,32 @@ export default {
|
|||||||
this.tbShopAreaGet();
|
this.tbShopAreaGet();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onDiancanClose(){
|
tableComman(command,item){
|
||||||
this.tbShopTableGet()
|
if(command=='edit'){
|
||||||
|
return this.$refs.addTable.show(item)
|
||||||
|
}
|
||||||
|
if(command=='del'){
|
||||||
|
return this.delPop(item)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
diancanShow(item) {
|
delPop(item){
|
||||||
this.$refs.dianan.open(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() {
|
tabClick() {
|
||||||
this.tbShopTableGet();
|
this.tbShopTableGet();
|
||||||
@@ -210,6 +283,13 @@ export default {
|
|||||||
});
|
});
|
||||||
console.log(content);
|
console.log(content);
|
||||||
this.tableList = 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;
|
this.total = total;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -244,7 +324,15 @@ export default {
|
|||||||
.icon {
|
.icon {
|
||||||
margin-left: 10px;
|
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 {
|
.table_list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -256,13 +344,46 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
.btn-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
padding: 1px;
|
||||||
|
overflow: hidden;
|
||||||
border: 1px solid #ddd;
|
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 {
|
.top {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
flex:1;
|
||||||
|
// border-radius: 6px 6px 0 0;
|
||||||
|
border-radius: 6px;
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
@@ -272,7 +393,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:not(:first-child) {
|
&:not(:first-child) {
|
||||||
margin-top: 20px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.row1 {
|
&.row1 {
|
||||||
@@ -282,7 +403,6 @@ export default {
|
|||||||
.state {
|
.state {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 80px;
|
|
||||||
|
|
||||||
.dot {
|
.dot {
|
||||||
$size: 6px;
|
$size: 6px;
|
||||||
@@ -300,7 +420,7 @@ export default {
|
|||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
border-radius: 0 0 6px 6px;
|
||||||
.btm_item {
|
.btm_item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
|||||||
@@ -72,9 +72,21 @@
|
|||||||
<span v-else>否</span>
|
<span v-else>否</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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="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="totalScore"></el-table-column>
|
||||||
<el-table-column label="手机号" prop="telephone" width="160"></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>
|
<el-table-column label="生日" prop="birthDay" width="200"></el-table-column>
|
||||||
@@ -97,14 +109,6 @@
|
|||||||
<el-dropdown-item>增减余额</el-dropdown-item>
|
<el-dropdown-item>增减余额</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -162,13 +166,15 @@
|
|||||||
<el-radio label="out">扣除</el-radio>
|
<el-radio label="out">扣除</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</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-input v-model="userinfo.amount" @input="amountNum" style="width: 200px;"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类型">
|
<el-form-item label="类型">
|
||||||
<el-radio-group v-model="userinfo.type">
|
<el-radio-group v-model="userinfo.type">
|
||||||
<el-radio label="consume">消费</el-radio>
|
<el-radio label="inMoney" v-show="userinfo.operationType == 'in'">充值</el-radio>
|
||||||
<el-radio label="inMoney ">充值退款</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-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -177,11 +183,39 @@
|
|||||||
<el-button type="primary" @click="sumbit">确 定</el-button>
|
<el-button type="primary" @click="sumbit">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { queryAllShopUser, queryAllShopInfo, midfiyAccount, tbShopUseredit } from "@/api/shop";
|
import { queryAllShopUser, queryAllShopInfo, midfiyAccount, tbShopUseredit, queryShopUserFlow } from "@/api/shop";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
let cacheData = {};
|
let cacheData = {};
|
||||||
export default {
|
export default {
|
||||||
@@ -205,16 +239,22 @@ export default {
|
|||||||
},
|
},
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogVisibleedit: false,
|
dialogVisibleedit: false,
|
||||||
|
moneyvisible: false,
|
||||||
userinfo: {
|
userinfo: {
|
||||||
nickName: '',
|
nickName: '',
|
||||||
operationType: 'in',
|
operationType: 'in',
|
||||||
type: 'consume'
|
type: 'consume',
|
||||||
|
amount: ''
|
||||||
},
|
},
|
||||||
userinfos: {
|
userinfos: {
|
||||||
levelConsume: "0",
|
levelConsume: "0",
|
||||||
sex: '1',
|
sex: '1',
|
||||||
status: '1'
|
status: '1'
|
||||||
}
|
},
|
||||||
|
// 余额分页
|
||||||
|
moneyList: [],
|
||||||
|
pages: 1,
|
||||||
|
moneyuserId: '', // 查询当前用户余额的id
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@@ -229,10 +269,31 @@ export default {
|
|||||||
this.getShopInfo();
|
this.getShopInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
checkIfNum() {
|
||||||
this.userinfos.telephone = this.userinfos.telephone.toString().replace(/\D/g, '');
|
this.userinfos.telephone = this.userinfos.telephone.toString().replace(/\D/g, '');
|
||||||
},
|
},
|
||||||
amountNum(){
|
amountNum() {
|
||||||
this.userinfo.amount = this.userinfo.amount.toString().replace(/[^\d|\.]/g, '')
|
this.userinfo.amount = this.userinfo.amount.toString().replace(/[^\d|\.]/g, '')
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -251,6 +312,10 @@ export default {
|
|||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
async sumbit() {
|
async sumbit() {
|
||||||
|
if (!this.userinfo.amount) {
|
||||||
|
this.$message.error("请填写金额")
|
||||||
|
return
|
||||||
|
}
|
||||||
let res = await midfiyAccount(this.userinfo)
|
let res = await midfiyAccount(this.userinfo)
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.$message.success('修改成功')
|
this.$message.success('修改成功')
|
||||||
@@ -261,6 +326,7 @@ export default {
|
|||||||
this.userinfo.nickName = d.nickName
|
this.userinfo.nickName = d.nickName
|
||||||
this.userinfo.amounts = d.amount
|
this.userinfo.amounts = d.amount
|
||||||
this.userinfo.id = d.id
|
this.userinfo.id = d.id
|
||||||
|
this.userinfo.amount = ""
|
||||||
},
|
},
|
||||||
edituser(d) {
|
edituser(d) {
|
||||||
let obj = { ...d }
|
let obj = { ...d }
|
||||||
@@ -323,6 +389,10 @@ export default {
|
|||||||
this.tableData.page = e - 1;
|
this.tableData.page = e - 1;
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
|
paginationChanges(e) {
|
||||||
|
this.pages = e;
|
||||||
|
this.moneyevents()
|
||||||
|
},
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
async getTableData() {
|
async getTableData() {
|
||||||
this.tableData.loading = true;
|
this.tableData.loading = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user