Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq
This commit is contained in:
commit
89da9cc1fc
|
|
@ -163,27 +163,15 @@ export function deletetbProskuCon(data) {
|
|||
* 查询耗材流水信息
|
||||
* @returns
|
||||
*/
|
||||
export function gettbConsInfoFlow(params) {
|
||||
export function gettbConsInfoFlow(data) {
|
||||
return request({
|
||||
url: "/api/tbConsInfoFlow",
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 分组查询获取耗材流水信息
|
||||
*/
|
||||
export function viewConInfoFlow(data) {
|
||||
return request({
|
||||
url: "/api/viewConInfoFlow",
|
||||
method: "get",
|
||||
params: {
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
...data
|
||||
}
|
||||
url: "/api/viewConInfoFlow/get",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询耗材单位列表
|
||||
*/
|
||||
|
|
@ -236,3 +224,23 @@ export function tbProskuConV2(data) {
|
|||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 耗材库存统计
|
||||
*/
|
||||
export function tbConsInfoFlowcount(data) {
|
||||
return request({
|
||||
url: "/api/tbConsInfoFlow/count",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 耗材库存记录列表
|
||||
*/
|
||||
export function tbConsInfoFlowstock(data) {
|
||||
return request({
|
||||
url: "/api/tbConsInfoFlow/stock",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 增加打印机
|
||||
|
||||
* @returns
|
||||
*/
|
||||
export function tbPrintMachine(data, method = 'post') {
|
||||
|
|
@ -21,12 +21,34 @@ export function tbPrintMachine(data, method = 'post') {
|
|||
*/
|
||||
export function tbPrintMachineGet(params) {
|
||||
return request({
|
||||
url: '/api/tbPrintMachine',
|
||||
url: '/api/shop-config/printer/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
sort: '',
|
||||
|
||||
...params
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
export function delTableHandle(id) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/' + id,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
// * 打印机详情
|
||||
export function printerd(id) {
|
||||
return request({
|
||||
url: '/api/shop-config/printer/' + id,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
// 编辑 新增打印机
|
||||
export function configprinter(data, method = "post") {
|
||||
return request({
|
||||
url: `/api/shop-config/printer`,
|
||||
method: method,
|
||||
data
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,3 +40,12 @@ export function delmsg(ids) {
|
|||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
//获取订阅二维码
|
||||
export function subQrCode(params) {
|
||||
return request({
|
||||
url: '/api/msg/subQrCode',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
@ -1,24 +1,16 @@
|
|||
<template>
|
||||
<div id="tags-view-container" class="tags-view-container">
|
||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper">
|
||||
<router-link
|
||||
v-for="tag in visitedViews"
|
||||
ref="tag"
|
||||
:key="tag.path"
|
||||
:class="isActive(tag)?'active':''"
|
||||
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
|
||||
tag="span"
|
||||
class="tags-view-item"
|
||||
@click.middle.native="closeSelectedTag(tag)"
|
||||
@contextmenu.prevent.native="openMenu(tag,$event)"
|
||||
>
|
||||
<router-link v-for="tag in visitedViews" ref="tag" :key="tag.path" :class="isActive(tag) ? 'active' : ''"
|
||||
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" tag="span" class="tags-view-item"
|
||||
@click.middle.native="closeSelectedTag(tag)" @contextmenu.prevent.native="openMenu(tag, $event)">
|
||||
{{ tag.title }}
|
||||
<span v-if="!tag.meta.affix" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
||||
</router-link>
|
||||
</scroll-pane>
|
||||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
||||
<ul v-show="visible" :style="{ left: left + 'px', top: top + 'px' }" class="contextmenu">
|
||||
<li @click="refreshSelectedTag(selectedTag)">刷新</li>
|
||||
<li v-if="!(selectedTag.meta&&selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">关闭</li>
|
||||
<li v-if="!(selectedTag.meta && selectedTag.meta.affix)" @click="closeSelectedTag(selectedTag)">关闭</li>
|
||||
<li @click="closeOthersTags">关闭其他</li>
|
||||
<li @click="closeAllTags(selectedTag)">关闭全部</li>
|
||||
</ul>
|
||||
|
|
@ -198,6 +190,7 @@ export default {
|
|||
background: #fff;
|
||||
border-bottom: 1px solid #d8dce5;
|
||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
|
||||
|
||||
.tags-view-wrapper {
|
||||
.tags-view-item {
|
||||
display: inline-block;
|
||||
|
|
@ -212,29 +205,34 @@ export default {
|
|||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
margin-top: 4px;
|
||||
|
||||
&:first-of-type {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background-color: #42b983;
|
||||
background: #7991BC;
|
||||
color: #fff;
|
||||
border-color: #42b983;
|
||||
&::before {
|
||||
content: '';
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
// &::before {
|
||||
// content: '';
|
||||
// background: #fff;
|
||||
// display: inline-block;
|
||||
// width: 8px;
|
||||
// height: 8px;
|
||||
// border-radius: 50%;
|
||||
// position: relative;
|
||||
// margin-right: 2px;
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contextmenu {
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
|
|
@ -247,10 +245,12 @@ export default {
|
|||
font-weight: 400;
|
||||
color: #333;
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 7px 16px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
|
@ -271,11 +271,13 @@ export default {
|
|||
text-align: center;
|
||||
transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
||||
transform-origin: 100% 50%;
|
||||
|
||||
&:before {
|
||||
transform: scale(.6);
|
||||
display: inline-block;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #b4bccc;
|
||||
color: #fff;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
export const $status= {
|
||||
pending: {
|
||||
label: "挂单中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
using: {
|
||||
label: "开台中",
|
||||
type: "#fa5555",
|
||||
},
|
||||
paying: {
|
||||
label: "结算中",
|
||||
type: "#E6A23C",
|
||||
},
|
||||
idle: {
|
||||
label: "空闲",
|
||||
type: "#3F9EFF",
|
||||
},
|
||||
subscribe: {
|
||||
label: "预定",
|
||||
type: "rgb(34, 191, 100)",
|
||||
},
|
||||
closed: {
|
||||
label: "关台",
|
||||
type: "rgb(221,221,221)",
|
||||
},
|
||||
// opening: {
|
||||
// label: "开台中",
|
||||
// type: "#67C23A",
|
||||
// },
|
||||
cleaning: {
|
||||
label: "待清台",
|
||||
type: "#FAAD14",
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="forms">
|
||||
<el-form-item label="打印机品牌">
|
||||
<el-select v-model="forms.contentType" placeholder="请选择打印机品牌">
|
||||
<el-option label="云想印" value="yxyPrinter"></el-option>
|
||||
<el-option label="飞鹅" value="fePrinter"></el-option>
|
||||
<!-- <el-option label="本地" value="local"></el-option> -->
|
||||
<!-- <el-option label="USB" value="printer"></el-option> -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="小票打印">
|
||||
<el-select v-model="forms.subType" placeholder="请选择小票打印">
|
||||
<el-option label="标签" value="label"></el-option>
|
||||
<el-option label="出品" value="kitchen"></el-option>
|
||||
<el-option label="小票" value="cash"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印机名称">
|
||||
<el-input v-model="forms.name" style="width: 280px;" placeholder="请输入打印机名称"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <template v-if="forms.contentType == 'network'"> -->
|
||||
<el-form-item label="打印机编号">
|
||||
<el-input v-model="forms.address" style="width: 280px;" placeholder="请输入打印机编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印机秘钥">
|
||||
<el-input v-model="forms.port" style="width: 280px;" placeholder="请输入打印机秘钥"></el-input><br />
|
||||
<div style="margin-left: 80px;color: #FF4D4F;">* 可在打印机设备底部查看打印机编号和秘钥(key)</div>
|
||||
</el-form-item>
|
||||
<!-- </template> -->
|
||||
<!-- <template v-if="forms.contentType == 'local'"> <el-form-item label="IP地址">
|
||||
<el-input v-model="forms.address" style="width: 280px;" placeholder="请输入打印机编号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="端口">
|
||||
<el-input v-model="forms.port" style="width: 280px;" placeholder="请输入打印机秘钥"></el-input><br />
|
||||
<div style="margin-left: 80px;color: #FF4D4F;">* 可在打印机设备底部查看打印机编号和秘钥(key)</div>
|
||||
</el-form-item>
|
||||
</template> -->
|
||||
|
||||
<el-form-item label="小票尺寸">
|
||||
<el-radio-group v-model="forms.receiptSize">
|
||||
<el-radio label="58mm"></el-radio>
|
||||
<el-radio label="80mm"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类打印">
|
||||
<el-radio-group v-model="forms.classifyPrint">
|
||||
<el-radio label="0">打印所有</el-radio>
|
||||
<el-radio label="1">部分分类</el-radio>
|
||||
<el-radio label="2">部分商品</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="桌台打印">
|
||||
<el-radio-group v-model="forms.tablePrint">
|
||||
<el-radio label="0">打印所有</el-radio>
|
||||
<el-radio label="1">打印部分桌台</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印数量">
|
||||
<el-radio-group v-model="forms.printQty">
|
||||
<el-radio label="c1m1^2">顾客联+商家联「2张」</el-radio>
|
||||
<el-radio label="m1^1">只打印商家联「1张」</el-radio>
|
||||
<el-radio label="c1^1">只打印顾客联「1张」</el-radio>
|
||||
<el-radio label="c2m1^3">2张顾客联+1张商家联「3张」</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印方式">
|
||||
<el-radio-group v-model="forms.printMethod">
|
||||
<el-radio label="1">普通</el-radio>
|
||||
<el-radio label="2">单个菜</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印类型">
|
||||
<el-checkbox-group v-model="forms.printType">
|
||||
<el-checkbox label="1">确认退款单</el-checkbox>
|
||||
<el-checkbox label="2">交班单</el-checkbox>
|
||||
<el-checkbox label="3">排队取号</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印单据">
|
||||
<el-radio-group v-model="forms.printReceipt">
|
||||
<el-radio label="0">全部打印</el-radio>
|
||||
<el-radio label="1">仅厨房</el-radio>
|
||||
<el-radio label="2">仅前台</el-radio>
|
||||
</el-radio-group>
|
||||
<div style="margin-left: 80px;color: #FF4D4F;">如果你的店只使用一台小票机,建议选择“全部打印”</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印机状态">
|
||||
<el-switch v-model="forms.status" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="80px">
|
||||
<el-button type="primary" @click="$router.go(-1)">返回</el-button>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { configprinter, printerd } from '@/api/devices'
|
||||
export default {
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
forms: {
|
||||
sort: "0",
|
||||
status: "0",
|
||||
connectionType: "network", printType: []
|
||||
}
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
},
|
||||
mounted() {
|
||||
if (this.$route.query.id) {
|
||||
this.getList(this.$route.query.id)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onSubmit() {
|
||||
|
||||
// 删除时间字段
|
||||
if( this.$route.query.id ){
|
||||
delete this.forms.createdAt
|
||||
delete this.forms.updatedAt
|
||||
}
|
||||
|
||||
const res = await configprinter({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
...this.forms,
|
||||
},
|
||||
this.$route.query.id ? 'put' : 'post'
|
||||
)
|
||||
this.$router.go(-1)
|
||||
},
|
||||
async getList(id) {
|
||||
const res = await printerd(id)
|
||||
this.forms = res
|
||||
this.forms.printType = JSON.parse(res.printType)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
export const devices = [
|
||||
{
|
||||
value: 'printer',
|
||||
value: 'local',
|
||||
name: '本地'
|
||||
},
|
||||
{
|
||||
value: 'yxyPrinter',
|
||||
value: 'network',
|
||||
name: '云想印'
|
||||
},
|
||||
{
|
||||
value: 'fePrinter',
|
||||
name: '飞鹅'
|
||||
value: 'USB',
|
||||
name: 'USB打印机'
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</el-form>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addDevice.show()">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="toUrl">
|
||||
添加云打印机
|
||||
</el-button>
|
||||
</div>
|
||||
|
|
@ -30,11 +30,11 @@
|
|||
{{ scope.row.contentType | devicesName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出品模式" prop="config.model">
|
||||
<!-- <el-table-column label="出品模式" prop="config.model">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.config.model | modelsName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="打印类型" prop="subType">
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.subType | subTypesName }}
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
{{ scope.row.createdAt | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" sortable prop="sort"></el-table-column>
|
||||
<!-- <el-table-column label="排序" sortable prop="sort"></el-table-column> -->
|
||||
<el-table-column label="状态" prop="status">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0"
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<el-table-column label="操作" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button type="text" icon="el-icon-edit"
|
||||
@click="$refs.addDevice.show(scope.row)">编辑</el-button>
|
||||
@click="toUrl(scope.row)">编辑</el-button>
|
||||
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
|
||||
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
|
||||
slot="reference">删除</el-button>
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<script>
|
||||
import { devices, models, subTypes } from './devices'
|
||||
import addDevice from './components/addDevice'
|
||||
import { tbPrintMachineGet, tbPrintMachine } from '@/api/devices'
|
||||
import { tbPrintMachineGet, tbPrintMachine, delTableHandle } from '@/api/devices'
|
||||
import dayjs from 'dayjs'
|
||||
export default {
|
||||
components: {
|
||||
|
|
@ -99,16 +99,20 @@ export default {
|
|||
},
|
||||
filters: {
|
||||
devicesName(value) {
|
||||
const item=devices.find(item => item.value == value)
|
||||
return item?item.name:''
|
||||
if (value == 'yxyPrinter') {
|
||||
return '云想印'
|
||||
} else if (value == 'fePrinter') '飞鹅'
|
||||
// const item=devices.find(item => item.value == value)
|
||||
// return item?item.name:''
|
||||
},
|
||||
modelsName(value) {
|
||||
const item=models.find(item => item.value == value)
|
||||
return item?item.name:''
|
||||
const item = models.find(item => item.value == value)
|
||||
return item ? item.name : ''
|
||||
},
|
||||
subTypesName(value) {
|
||||
const item=subTypes.find(item => item.value == value)
|
||||
return item?item.name:''
|
||||
if (value == "label") return '标签'
|
||||
else if (value == 'kitchen') return '出品'
|
||||
else if (value == 'cash') return '小票'
|
||||
},
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format('YYYY-MM-DD HH:mm:ss')
|
||||
|
|
@ -118,6 +122,9 @@ export default {
|
|||
this.getTableData()
|
||||
},
|
||||
methods: {
|
||||
toUrl(item) {
|
||||
this.$router.push({ path: '/shop/devices/details', query:{id:item.id}})
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
|
|
@ -142,13 +149,20 @@ export default {
|
|||
this.tableData.page = e - 1
|
||||
this.getTableData()
|
||||
},
|
||||
// 删除
|
||||
async delTableHandle(item) {
|
||||
const res = await delTableHandle(item)
|
||||
this.getTableData()
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true
|
||||
try {
|
||||
const res = await tbPrintMachineGet({
|
||||
name: this.query.name,
|
||||
contentType: this.query.type
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
contentType: this.query.type,
|
||||
sort: '',
|
||||
})
|
||||
this.tableData.loading = false
|
||||
this.tableData.data = res
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { gettbConsInfoFlow, viewConInfoFlow } from "@/api/consumable";
|
||||
import { gettbConsInfoFlow, gettbConsInfo } from "@/api/consumable";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -206,7 +206,7 @@ export default {
|
|||
async getTableData() {
|
||||
try {
|
||||
this.clickseetableData.loading = true;
|
||||
const res = await viewConInfoFlow({
|
||||
const res = await gettbConsInfo({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
consId: "",
|
||||
|
|
|
|||
|
|
@ -11,71 +11,6 @@
|
|||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="boxitem">
|
||||
<img src="@/assets/images/data_home_item1_icon.png" />
|
||||
<div class="boxitem_s">
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">现有数量</div>
|
||||
<div class="s" style="color: #333333;">3,333</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem">
|
||||
<img src="@/assets/images/data_home_item1_icon.png" />
|
||||
<div class="boxitem_s">
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">增加数量:</div>
|
||||
<div class="s">3,333</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">手动增加:</div>
|
||||
<div class="s">23</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">入库:</div>
|
||||
<div class="s">1111</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem">
|
||||
<img src="@/assets/images/data_home_item1_icon.png" />
|
||||
<div class="boxitem_s">
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">减少数量:</div>
|
||||
<div class="s">1111</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">手动减少:</div>
|
||||
<div class="s">1111</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">消耗:</div>
|
||||
<div class="s">1111</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">报损:</div>
|
||||
<div class="s">1111</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">出库:</div>
|
||||
<div class="s">1111</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id">
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
|
|
@ -97,10 +32,26 @@
|
|||
<!-- <el-table-column label="创建时间" prop="createTime"></el-table-column> -->
|
||||
<el-table-column label="所属商品" width="320" align="center">
|
||||
<template v-slot="scope">
|
||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId"
|
||||
type="text">{{ item.productName }}</el-button>
|
||||
|
||||
<div class="goodslang">
|
||||
<div class="goods-list">
|
||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item.productId)" :key="item.productId"
|
||||
type="text">{{
|
||||
item.productName }}</el-button>
|
||||
</div>
|
||||
<el-dropdown trigger="click" v-if="scope.row.product.length > 1" @command="toGoods">
|
||||
<span class="el-dropdown-link" style="color: blue;">
|
||||
<i class="el-icon-caret-bottom el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item class="clearfix" v-for="(item) in scope.row.product" :key="item.productId"
|
||||
:command="item.productId">
|
||||
{{ item.productName }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template v-slot="scope">
|
||||
|
|
@ -118,10 +69,10 @@
|
|||
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
||||
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="paginationChangetype" @size-change="e => {
|
||||
clickseetableData.size = e;
|
||||
clickseetableData.page = 0;
|
||||
getTableData();
|
||||
}
|
||||
clickseetableData.size = e;
|
||||
clickseetableData.page = 0;
|
||||
getTableData();
|
||||
}
|
||||
" />
|
||||
</div>
|
||||
|
||||
|
|
@ -130,7 +81,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { gettbConsInfoFlow, viewConInfoFlow } from "@/api/consumable";
|
||||
import { gettbConsInfoFlow, gettbConsInfo } from "@/api/consumable";
|
||||
import consRecordDetail from "../components/cons_record_detail";
|
||||
|
||||
export default {
|
||||
|
|
@ -155,11 +106,11 @@ export default {
|
|||
this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
toGoods(data) {
|
||||
toGoods(productId) {
|
||||
this.$router.push({
|
||||
path: '/product/product',
|
||||
query: {
|
||||
productId: data.productId
|
||||
productId: productId
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -194,11 +145,12 @@ export default {
|
|||
async getTableData() {
|
||||
try {
|
||||
this.clickseetableData.loading = true;
|
||||
const res = await viewConInfoFlow({
|
||||
const res = await gettbConsInfo({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
...this.query,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
sort: 'createTime,desc'
|
||||
});
|
||||
this.clickseetableData.loading = false;
|
||||
this.clickseetableData.data = res.content.map(v => {
|
||||
|
|
@ -226,6 +178,26 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.goodslang {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.goods-list {
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
::v-deep .goods-list .el-button--text span {
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
::v-deep .goods-list .el-button--text {
|
||||
white-space: break-spaces;
|
||||
}
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #13ce66;
|
||||
font-weight: bold;
|
||||
|
|
|
|||
|
|
@ -12,49 +12,173 @@
|
|||
style="width: 150px"
|
||||
@keyup.enter.native="getTableData"
|
||||
/> -->
|
||||
<!-- <div style="width: 150px">
|
||||
<div style="width: 150px">
|
||||
<el-select v-model="query.conTypeId" placeholder="请选择耗材分类" style="width: 100%">
|
||||
<el-option :label="item.conTypeName" :value="item.id" v-for="item in consTypeList"
|
||||
:key="item.conTypeId" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 150px"
|
||||
<!--<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入类型名称" style="width: 150px"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 150px"
|
||||
@keyup.enter.native="getTableData" /> -->
|
||||
@keyup.enter.native="getTableData" />
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>-->
|
||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 150px"
|
||||
@keyup.enter.native="getTableData" />
|
||||
<div style="width: 150px">
|
||||
<el-select v-model="query.status" placeholder="请选择商品规格" style="width: 100%">
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in typeEnums" :key="item.label" />
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="width: 300px;">
|
||||
<el-select clearable v-model="query.sort" placeholder="排序">
|
||||
<el-option label="按数量排序" value="balance,desc" />
|
||||
</el-select>
|
||||
</div>
|
||||
<el-date-picker v-model="query.createdAt" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
<el-button type="primary" @click="getTableData">查询</el-button>
|
||||
<el-button @click="resetHandle">重置</el-button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-button @click="$router.push({ name: 'operation_in' })">入库</el-button>
|
||||
<el-button @click="$router.push({ name: 'operation_out' })">出库</el-button>
|
||||
<el-button @click="$router.push({ name: 'cons_record' })">库存记录</el-button>
|
||||
<el-button @click="$router.push({ name: 'type' })">分类管理</el-button>
|
||||
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</el-button>
|
||||
<el-button icon="el-icon-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
|
||||
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row_wrap" style="margin-top: 12px">
|
||||
<div class="row">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
|
||||
<el-button @click="$router.push({ name: 'operation_in' })">入库</el-button>
|
||||
<el-button @click="$router.push({ name: 'operation_out' })">出库</el-button>
|
||||
<el-button @click="$router.push({ name: 'cons_record' })">耗材记录</el-button>
|
||||
<el-button @click="$router.push({ name: 'type' })">分类管理</el-button>
|
||||
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</el-button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<el-select clearable v-model="query.sort" @change="getTableData" placeholder="排序">
|
||||
<el-option label="创建时间" value="createTime,desc" />
|
||||
<el-option label="数量由低到高" value="balance,desc" />
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="boxitem">
|
||||
<img src="@/assets/images/data_home_item1_icon.png" />
|
||||
<div class="boxitem_s">
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">耗材种数</div>
|
||||
<div class="s" style="color: #333333;">{{ tableData.total }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem">
|
||||
<img src="@/assets/images/data_home_item1_icon.png" />
|
||||
<div class="boxitem_s">
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">增加数量:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'addCountNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{
|
||||
tongji.addCountNumber }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">手动增加:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'addNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{ tongji.addNumber }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">入库:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'stockInNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{
|
||||
tongji.stockInNumber }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem">
|
||||
<img src="@/assets/images/data_home_item1_icon.png" />
|
||||
<div class="boxitem_s">
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">减少数量:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'subCountNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{
|
||||
tongji.subCountNumber }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxitem_ses">
|
||||
<div class="es">
|
||||
<div class="e">手动减少:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'subNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{ tongji.subNumber }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">消耗:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'saleNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{ tongji.saleNumber
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">报损:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'lossNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{ tongji.lossNumber
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="es">
|
||||
<div class="e">出库:</div>
|
||||
<div class="s"
|
||||
@click="stockData.column = 'stockOutNumber', stockData.size = 10, stockData.page = 0, gettbConsInfoFlowstock()">
|
||||
{{
|
||||
tongji.stockOutNumber }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 动态信息 出库 报损 消耗 手动减少 减少数量 入库 手动增加 增加数量 现有数量-->
|
||||
<el-dialog :title="variabilitytitle" :visible.sync="variabilityshow">
|
||||
<div class="head-container">
|
||||
<el-table ref="table" :data="stockData.data" v-loading="stockData.loading" row-key="id" height="450">
|
||||
<el-table-column label="耗材名称" prop="conName" />
|
||||
<el-table-column label="变动库存" prop="amount">
|
||||
<template v-slot="scope">
|
||||
<span :class="{ red: scope.row.bizType == '-' }">{{ scope.row.bizType }}{{ scope.row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="现有库存" prop="balance" />
|
||||
<el-table-column label="业务说明" prop="bizName" />
|
||||
<!-- <el-table-column label="商品信息" prop="productName"></el-table-column> -->
|
||||
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="stockData.total" :current-page="stockData.page + 1" :page-size="stockData.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" @current-change="wstockChange" @size-change="(e) => {
|
||||
stockData.size = e;
|
||||
stockData.page = 0;
|
||||
gettbConsInfoFlowstock();
|
||||
}" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- <div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</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 label="耗材名称" prop="conName" style="width: 100px;">
|
||||
|
|
@ -98,11 +222,24 @@
|
|||
</el-table-column> -->
|
||||
<el-table-column label="所属商品">
|
||||
<template v-slot="scope">
|
||||
<div class="goods-list">
|
||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
|
||||
item.productName }}</el-button>
|
||||
<div class="goodslang">
|
||||
<div class="goods-list">
|
||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item.productId)" :key="item.productId"
|
||||
type="text">{{
|
||||
item.productName }}</el-button>
|
||||
</div>
|
||||
<el-dropdown trigger="click" v-if="scope.row.product.length > 1" @command="toGoods">
|
||||
<span class="el-dropdown-link" style="color: blue;">
|
||||
<i class="el-icon-caret-bottom el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item class="clearfix" v-for="(item) in scope.row.product" :key="item.productId"
|
||||
:command="item.productId">
|
||||
{{ item.productName }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockNumber">
|
||||
|
|
@ -370,6 +507,7 @@
|
|||
" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 耗材盘点 -->
|
||||
<AddConsTakin ref="AddConsTakin" @success="resetHandle" />
|
||||
<!-- 查看详情 -->
|
||||
|
|
@ -403,7 +541,9 @@ import {
|
|||
posttbConsInfo,
|
||||
gettbConsInfoFlow,
|
||||
posttbConsInfostockIn,
|
||||
postapitbConsInfo
|
||||
postapitbConsInfo,
|
||||
tbConsInfoFlowcount,
|
||||
tbConsInfoFlowstock
|
||||
} from "@/api/consumable";
|
||||
import AddConsTakin from "../components/addConsTakin";
|
||||
import { tbConsInfodownload, tbConsInfoinputStock } from '@/api/invoicing'
|
||||
|
|
@ -415,6 +555,7 @@ export default {
|
|||
components: { AddConsTakin, UploadExcel, consRecordDetail },
|
||||
data() {
|
||||
return {
|
||||
tongji: {},//统计
|
||||
dayjs,
|
||||
consTypeList: [],
|
||||
query: {
|
||||
|
|
@ -422,7 +563,9 @@ export default {
|
|||
conTypeName: "",
|
||||
conCode: "",
|
||||
conName: "",
|
||||
status: ''
|
||||
status: '',
|
||||
createdAt: [],
|
||||
sort: 'createTime,desc'
|
||||
},
|
||||
resetQuery: '',
|
||||
libraryshow: false, //耗材入库显示
|
||||
|
|
@ -468,6 +611,7 @@ export default {
|
|||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
|
||||
clickseetypedialogshow: false,
|
||||
clickseetableData: {
|
||||
data: [],
|
||||
|
|
@ -476,6 +620,15 @@ export default {
|
|||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
variabilityshow: false,
|
||||
variabilitytitle: '',
|
||||
stockData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0
|
||||
},
|
||||
ruleFormLoading: false,
|
||||
ruleForms: [],
|
||||
ruleForm: {
|
||||
|
|
@ -553,12 +706,12 @@ export default {
|
|||
this.$message({ type: "error", message: "至少保留一种耗材" });
|
||||
}
|
||||
},
|
||||
toGoods(data) {
|
||||
toGoods(productId) {
|
||||
|
||||
this.$router.push({
|
||||
path: '/product/product',
|
||||
query: {
|
||||
productId: data.productId
|
||||
productId: productId
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -640,6 +793,8 @@ export default {
|
|||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query = { ...this.resetQuery }
|
||||
this.query.sort = 'createTime,desc'
|
||||
this.query.createdAt = []
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
|
|
@ -655,17 +810,24 @@ export default {
|
|||
// 获取信息
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
let arr = []
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
} else {
|
||||
arr = []
|
||||
}
|
||||
try {
|
||||
const res = await gettbConsInfo({
|
||||
...this.query,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
createTime: arr
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
// this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
|
||||
this.gettbConsInfoFlowcount()//统计
|
||||
this.tableData.data = res.content.map(v => {
|
||||
const productIds = v.productId ? v.productId.split(',') : []
|
||||
return {
|
||||
|
|
@ -686,6 +848,87 @@ export default {
|
|||
console.log(error);
|
||||
}
|
||||
},
|
||||
//
|
||||
async gettbConsInfoFlowcount() {
|
||||
let arr = []
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
} else {
|
||||
arr = []
|
||||
}
|
||||
try {
|
||||
const res = await tbConsInfoFlowcount({
|
||||
...this.query,
|
||||
page: this.tableData.page,
|
||||
size: this.tableData.size,
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
startTime: arr[0],
|
||||
endTime: arr[1]
|
||||
});
|
||||
this.tongji = res;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
// 列
|
||||
async gettbConsInfoFlowstock() {
|
||||
this.variabilityshow = true
|
||||
switch (this.stockData.column) {
|
||||
case 'stockNumber':
|
||||
this.variabilitytitle = '现有数量'
|
||||
break;
|
||||
case 'addCountNumber':
|
||||
this.variabilitytitle = '增加数量'
|
||||
break;
|
||||
case 'addNumber':
|
||||
this.variabilitytitle = '手动增加'
|
||||
break;
|
||||
case 'stockInNumber':
|
||||
this.variabilitytitle = '入库'
|
||||
break;
|
||||
case 'refundNumber':
|
||||
this.variabilitytitle = '退货'
|
||||
break;
|
||||
case 'subCountNumber':
|
||||
this.variabilitytitle = '减少数量'
|
||||
break;
|
||||
case 'subNumber':
|
||||
this.variabilitytitle = '手动减少'
|
||||
break;
|
||||
case 'saleNumber':
|
||||
this.variabilitytitle = '消耗'
|
||||
break;
|
||||
case 'lossNumber':
|
||||
this.variabilitytitle = '报损'
|
||||
break;
|
||||
case 'stockOutNumber':
|
||||
this.variabilitytitle = '出库'
|
||||
break;
|
||||
}
|
||||
this.stockData.loading = true;
|
||||
let arr = []
|
||||
if (this.query.createdAt.length) {
|
||||
arr = [this.query.createdAt[0] + ' 00:00:00', this.query.createdAt[1] + ' 23:59:59']
|
||||
} else {
|
||||
arr = []
|
||||
}
|
||||
let res = await tbConsInfoFlowstock({
|
||||
page: this.stockData.page,
|
||||
size: this.stockData.size,
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
productId: '',//预留耗材id
|
||||
column: this.stockData.column,//列名
|
||||
createdAt: arr//耗材id
|
||||
})
|
||||
this.stockData.loading = false;
|
||||
this.stockData.data = res.content;
|
||||
this.stockData.total = res.totalElements;
|
||||
},
|
||||
// 分页回调
|
||||
wstockChange(e) {
|
||||
this.stockData.page = e - 1;
|
||||
this.gettbConsInfoFlowstock();
|
||||
},
|
||||
// 获取类型
|
||||
async gettbConsType() {
|
||||
try {
|
||||
|
|
@ -858,9 +1101,10 @@ export default {
|
|||
const res = await gettbConsInfoFlow({
|
||||
page: this.clickseetableData.page,
|
||||
size: this.clickseetableData.size,
|
||||
consId: this.consRecordItem.consId,
|
||||
conName: this.consRecordItem.conName,
|
||||
shopId: localStorage.getItem("shopId")
|
||||
// consId: this.consRecordItem.consId,
|
||||
// conName: this.consRecordItem.conName,
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
sort:'createTime,desc'
|
||||
});
|
||||
this.clickseetableData.loading = false;
|
||||
this.clickseetableData.data = res.content;
|
||||
|
|
@ -874,13 +1118,25 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .goods-list .el-button--text span {
|
||||
display: block;
|
||||
text-align: left;
|
||||
}
|
||||
.goodslang {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
::v-deep .goods-list .el-button--text {
|
||||
white-space: break-spaces;
|
||||
.goods-list {
|
||||
overflow: hidden; //超出的文本隐藏
|
||||
text-overflow: ellipsis; //溢出用省略号显示
|
||||
white-space: nowrap; //溢出不换行
|
||||
}
|
||||
|
||||
::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 {
|
||||
|
|
@ -933,4 +1189,68 @@ export default {
|
|||
.red {
|
||||
color: rgb(219, 32, 32);
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0px 90px 20px 90px;
|
||||
|
||||
.boxitem {
|
||||
min-width: max-content;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 20px 24px;
|
||||
background: rgba(244, 249, 255, 0.5);
|
||||
border-radius: 10px;
|
||||
|
||||
.boxitem_s {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
.boxitem_ses {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.es {
|
||||
border-left: 2px solid #DDDFE6;
|
||||
padding: 0 10px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
|
||||
.e {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.s {
|
||||
margin-left: 10px;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 15px;
|
||||
color: #3F9EFF;
|
||||
}
|
||||
}
|
||||
|
||||
.es:nth-child(1) {
|
||||
margin-top: 0;
|
||||
border-left: none;
|
||||
}
|
||||
}
|
||||
|
||||
.boxitem_ses:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -50,11 +50,27 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- 播报弹窗 -->
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
|
||||
<span>通知消息已发送</span>
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" center width="30%">
|
||||
<div style="text-align: center;">
|
||||
<div style="font-size: 16px;">正在叫号,请稍等</div>
|
||||
<div v-if="profilepicturedata.state == 1" style="color: #52C41A;font-size: 16px;margin-top: 17px;">
|
||||
已发送至用户<i class="el-icon-circle-check" style="color: #52C41A;"></i>
|
||||
</div>
|
||||
<div v-else style="color:#FF4D4F;font-size: 16px;margin-top: 17px;">用户未订阅消息 <i style="color: #FF4D4F;" class="el-icon-circle-close"></i></div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button style="" @click="dialogConfirm(2)">完成</el-button>
|
||||
<el-button type="primary" @click="dialogConfirm(3)">过号</el-button>
|
||||
<el-button style="width: 176px;
|
||||
height: 48px;
|
||||
background: #F7F7FA;
|
||||
box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.02);
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid rgba(255,255,255,0);" @click="dialogConfirm(2)">完成</el-button>
|
||||
<el-button type="primary" style="width: 189px;
|
||||
height: 45px;
|
||||
background: #FF4D4F;
|
||||
box-shadow: 0px 2px 0px 0px rgba(0,0,0,0.02);
|
||||
border-radius: 2px 2px 2px 2px;
|
||||
border: 1px solid rgba(255,255,255,0.28);" @click="dialogConfirm(3)">过号</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<!-- 取号 -->
|
||||
|
|
@ -84,7 +100,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { callTable, callTablequeue, callTableput, callTabletakeNumber ,callTablecall} from '@/api/shop'
|
||||
import { callTable, callTablequeue, callTableput, callTabletakeNumber, callTablecall } from '@/api/shop'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -107,7 +123,9 @@ export default {
|
|||
dialogVisibles: false,
|
||||
profilepictureInfo: "",
|
||||
phone: "",
|
||||
selectTabletype: ""
|
||||
selectTabletype: "",
|
||||
// 播报弹窗显示是否订阅
|
||||
profilepicturedata: ""
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
|
|
@ -138,6 +156,7 @@ export default {
|
|||
})
|
||||
if (res) {
|
||||
this.dialogVisible = true
|
||||
this.profilepicturedata = res
|
||||
this.profilepictureInfo = d
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@
|
|||
<el-table-column label="台桌号" prop="tableName"></el-table-column>
|
||||
<el-table-column label="订单金额">
|
||||
<template v-slot="scope">
|
||||
<div>{{ scope.row.orderType | orderTypeFilter }}</div>
|
||||
<!-- <div>{{ scope.row.orderType | orderTypeFilter }}</div> -->
|
||||
<div class="refund" v-if="
|
||||
scope.row.orderType == 'return'
|
||||
">
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
<el-form-item label="小程序appid">
|
||||
<el-input v-model="form.smallAppid" placeholder="请输入小程序appid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付宝appid">
|
||||
<el-input v-model="form.alipaySmallAppid" placeholder="请输入支付宝appid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺id">
|
||||
<el-input v-model="form.storeId" placeholder="请输入店铺id"></el-input>
|
||||
</el-form-item>
|
||||
|
|
@ -52,7 +55,8 @@ export default ({
|
|||
status: 1,
|
||||
appId: '',
|
||||
smallAppid: '',
|
||||
storeId: ''
|
||||
storeId: '',
|
||||
alipaySmallAppid:''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -94,6 +98,7 @@ export default ({
|
|||
this.form.status = res.status
|
||||
this.form.appId = res.appId
|
||||
this.form.smallAppid = res.smallAppid
|
||||
this.form.alipaySmallAppid = res.alipaySmallAppid
|
||||
this.form.storeId = res.storeId
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<!-- <div class="head-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="3">
|
||||
店铺推送: <el-switch v-model="alldata.allState" :active-value="1" :inactive-value="0"
|
||||
|
|
@ -19,7 +19,21 @@
|
|||
@change="changeEvent(alldata.stockState, 0)"></el-switch>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 查看图片 -->
|
||||
<el-button v-if="url" type="primary" @click="dialogVisible = true" style="margin-bottom: 28px;">查看图片</el-button>
|
||||
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
||||
<div style="width: 100%;text-align: center;">
|
||||
<el-image style="width: 200px; height: 200px;" :src="url"></el-image>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="downloadUrl">下载</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||
<el-table-column label="头像">
|
||||
|
|
@ -70,7 +84,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { msgall, msginfo, shopState, state, delmsg } from '@/api/notifications'
|
||||
import { msgall, msginfo, shopState, state, delmsg, subQrCode } from '@/api/notifications'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -87,14 +101,37 @@ export default {
|
|||
conState: 0,
|
||||
opeState: 0,
|
||||
stockState: 0,
|
||||
}
|
||||
},
|
||||
url: '',
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTableData()
|
||||
this.getlist()
|
||||
this.getsubQrCode()
|
||||
},
|
||||
methods: {
|
||||
downloadUrl() {
|
||||
let link = document.createElement("a");
|
||||
//创建一个a标签
|
||||
link.style.display = "none";
|
||||
//将a标签隐藏
|
||||
link.href = this.url;
|
||||
document.body.appendChild(link);
|
||||
//将上面创建的a标签加入到body的尾部
|
||||
link.click();
|
||||
//执行a标签
|
||||
this.dialogVisible = false
|
||||
},
|
||||
// 二维码
|
||||
async getsubQrCode() {
|
||||
let res = await subQrCode({
|
||||
shopId: localStorage.getItem('shopId')
|
||||
})
|
||||
this.url = res
|
||||
|
||||
},
|
||||
async getlist() {
|
||||
let res = await state({
|
||||
shopId: localStorage.getItem('shopId'),
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@
|
|||
<downloadTableCode :total="total" ref="downloadTableCode" />
|
||||
|
||||
<!-- 点餐 -->
|
||||
<table-diancan ref="diancan" @close="onDiancanClose"></table-diancan>
|
||||
<!-- <table-diancan ref="diancan" @close="onDiancanClose"></table-diancan> -->
|
||||
<!-- 选择人数 -->
|
||||
<choose-diners-number
|
||||
ref="refChooseDinersNumber"
|
||||
|
|
@ -252,13 +252,12 @@ export default {
|
|||
status: $status,
|
||||
selTable: "", //当前选中的桌台
|
||||
areaMap: {},
|
||||
shopInfo:{},
|
||||
shopInfo: {},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.tbShopAreaGet();
|
||||
this.getShopInfo()
|
||||
|
||||
this.getShopInfo();
|
||||
},
|
||||
filters: {
|
||||
formatTime(time) {
|
||||
|
|
@ -271,13 +270,13 @@ export default {
|
|||
try {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
const res = await tbShopInfo(shopId);
|
||||
this.shopInfo=res
|
||||
console.log(res)
|
||||
this.shopInfo = res;
|
||||
console.log(res);
|
||||
} catch (error) {}
|
||||
},
|
||||
// 清台
|
||||
cleanTableHandle(item) {
|
||||
this.$confirm("确定要清台:"+item.name, "提示", {
|
||||
this.$confirm("确定要清台:" + item.name, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
|
|
@ -321,21 +320,31 @@ export default {
|
|||
//key isAddGoods 加菜
|
||||
//key isPayOrder结账
|
||||
this.selTable = item;
|
||||
if(this.shopInfo.isTableFee){
|
||||
if (this.shopInfo.isTableFee) {
|
||||
//免餐位费
|
||||
this.$refs.diancan.open(item, key, '');
|
||||
return
|
||||
this.toInstead({num: 0,key});
|
||||
// this.$refs.diancan.open(item, key, '');
|
||||
return;
|
||||
}
|
||||
const num = item.useNum || 0;
|
||||
if (item.useNum <= 0) {
|
||||
return this.$refs.refChooseDinersNumber.open();
|
||||
}
|
||||
this.$refs.diancan.open(item, key, num);
|
||||
this.toInstead({num: num,key});
|
||||
// this.$refs.diancan.open(item, key, num);
|
||||
},
|
||||
toInstead(query) {
|
||||
this.$router.push({ path: "/tool/Instead/index", query: {
|
||||
table_name: this.selTable.name,
|
||||
tableId: this.selTable.tableId,
|
||||
maxCapacity:this.selTable.maxCapacity,
|
||||
useType: this.selTable.useType,
|
||||
...query
|
||||
}});
|
||||
},
|
||||
chooseDinersNumberConfirm(num) {
|
||||
//就餐人数
|
||||
console.log(num);
|
||||
this.$refs.diancan.open(this.selTable, undefined, num);
|
||||
this.toInstead({num: num});
|
||||
// this.$refs.diancan.open(this.selTable, undefined, num);
|
||||
},
|
||||
tabClick() {
|
||||
this.tbShopTableGet();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,317 @@
|
|||
<template>
|
||||
<div
|
||||
class="flex order-item relative"
|
||||
:class="[isActive]"
|
||||
@click="itemClick"
|
||||
>
|
||||
<span class="absolute pack" v-if="item.isPack === 'true'"> 包 </span>
|
||||
<span class="absolute tui" v-if="item.status === 'return'"> 退 </span>
|
||||
<div class="flex">
|
||||
|
||||
<div class="img">
|
||||
<div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center" v-if="isSeatFee">
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
<img v-else :src="item.coverImg" class="" alt="" />
|
||||
</div>
|
||||
<div class="good-info">
|
||||
<div class="flex lh-16">
|
||||
<div class="name" :class="{ 'free-price': item.status === 'return' }">{{ 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="" v-if="isSeatFee">X{{ item.totalNumber }}</div>
|
||||
<div class="" v-else>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'||item.status=='return' ">¥0</div>
|
||||
<div :class="{ 'free-price': item.isGift === 'true'||item.status=='return' }">
|
||||
<span v-if="isSeatFee"> ¥{{ item.totalAmount }}</span>
|
||||
<span v-else> ¥{{ item.salePrice }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
//是否是餐位费
|
||||
isSeatFee:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
//是否是历史订单商品
|
||||
isOld:{
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
//第几次下单 1以及以上为历史订单 0为当前购物车
|
||||
placeNum:{
|
||||
type: [String,Number],
|
||||
default: 0,
|
||||
},
|
||||
selPlaceNum:{
|
||||
type: [String,Number],
|
||||
default: -1,
|
||||
},
|
||||
//是否允许改变数量
|
||||
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,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isActive(){
|
||||
const isSel= (this.selIndex === this.index)&&(this.placeNum===this.selPlaceNum)
|
||||
console.log(isSel)
|
||||
return isSel?'active':'';
|
||||
}
|
||||
},
|
||||
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() {
|
||||
if(this.isSeatFee){
|
||||
return
|
||||
}
|
||||
this.$emit("itemClick", this.index,this.canChangeNumber,this.placeNum);
|
||||
},
|
||||
},
|
||||
};
|
||||
</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;
|
||||
}
|
||||
.isSeatFee{
|
||||
background: #3F9EFF;
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.tui{
|
||||
right: 100%;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: #ac4735;
|
||||
border-radius: 4px 0 4px 0;
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
}
|
||||
&.active {
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.total-price {
|
||||
width: 94px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.good-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-width: 70px;
|
||||
|
||||
.specSnap {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
color: #212121;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-number-box {
|
||||
position: relative;
|
||||
|
||||
.absolute {
|
||||
width: 60px;
|
||||
height: 40px;
|
||||
right: -30px;
|
||||
top: -12px;
|
||||
position: absolute;
|
||||
|
||||
.order-input-number {
|
||||
position: absolute;
|
||||
right: -6px;
|
||||
top: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
|
||||
padding: 9px 6px;
|
||||
background-color: #fff;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
&:hover .order-input-number {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
.good_info_discount {
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
color: #ff3f3f;
|
||||
background-color: rgba(255, 63, 63, 0.1);
|
||||
border-radius: 2px;
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,270 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="就餐人数" :visible.sync="show">
|
||||
<div class="select_desk_dialog u-p-b-20">
|
||||
<key-board
|
||||
isCanEmpty
|
||||
v-model="number"
|
||||
@clear="clear"
|
||||
:max="max"
|
||||
:maxTips=" '最多'+max+'位'"
|
||||
>
|
||||
<div slot="clear">清空</div>
|
||||
<div slot="input" class="u-p-l-20 u-p-r-20 u-flex w-full">
|
||||
<el-input
|
||||
placeholder="请输入就餐人数"
|
||||
v-model="number"
|
||||
@input="inputNumber"
|
||||
@change="inputChange"
|
||||
type="number"
|
||||
>
|
||||
<template slot="append">位</template>
|
||||
</el-input>
|
||||
</div>
|
||||
</key-board>
|
||||
<div class="confirm_btns">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import keyBoard from "./keyboard.vue";
|
||||
export default {
|
||||
components: { keyBoard },
|
||||
props:{
|
||||
max:{
|
||||
type:Number,
|
||||
default:99
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: "",
|
||||
show: false,
|
||||
hasOpen: false,
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
if (newval >this.max) {
|
||||
this.number = this.max;
|
||||
this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||
}
|
||||
// 使用正则表达式匹配正整数
|
||||
const regex = /^[1-9]\d*$/;
|
||||
// 如果输入的值不是正整数,则将其设置为上一个有效值
|
||||
if (!regex.test(newval)) {
|
||||
this.number = newval.substring(0, newval.length - 1);
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
inputNumber(e) {},
|
||||
inputChange(e) {},
|
||||
clear(e) {
|
||||
console.log(e);
|
||||
this.number = "";
|
||||
},
|
||||
confirm() {
|
||||
if (this.number >this.max) {
|
||||
return this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||
}
|
||||
if (!this.number) {
|
||||
return this.$message("请选择就餐人数");
|
||||
}
|
||||
console.log(this.number)
|
||||
this.$emit("confirm", this.number);
|
||||
this.close();
|
||||
},
|
||||
open(number) {
|
||||
this.number = number || "";
|
||||
this.show = true;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
this.number = "";
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-button {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
border-color: #22bf64;
|
||||
background-color: #22bf64;
|
||||
}
|
||||
.select_desk .btn {
|
||||
height: 34px;
|
||||
}
|
||||
.tags {
|
||||
font-size: 16px;
|
||||
&.using {
|
||||
color: rgb(234, 64, 37);
|
||||
}
|
||||
&.wait {
|
||||
color: rgb(252, 236, 79);
|
||||
}
|
||||
&.idle {
|
||||
color: rgb(137, 234, 71);
|
||||
}
|
||||
&.closed {
|
||||
color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
::v-deep .inputs .el-input__inner {
|
||||
border-color: transparent !important;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.select_desk .select_desk_dialog {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
width: 286px;
|
||||
height: 38px;
|
||||
background: #dcf0e8;
|
||||
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li,
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li {
|
||||
width: 140px;
|
||||
height: 34px;
|
||||
color: #0fc161;
|
||||
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .lion {
|
||||
background: #0fc161;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs {
|
||||
width: 370px;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
height: 54px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs .close {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li {
|
||||
height: 60px;
|
||||
width: 33.333%;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
cursor: pointer;
|
||||
|
||||
user-select: none;
|
||||
border-left: 1px solid #dcdfe6;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||
height: 140px;
|
||||
background: #ff9f2e;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||
background: #f88502;
|
||||
}
|
||||
|
||||
.confirm_btns {
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm_btns .el-button {
|
||||
width: 175px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,287 @@
|
|||
<template>
|
||||
<div class="select_desk">
|
||||
<el-dialog width="410px" title="桌台号/取餐号" :visible.sync="show">
|
||||
<div class="select_desk_dialog u-p-t-20 u-p-b-20">
|
||||
<div class="nav">
|
||||
<div
|
||||
class="li"
|
||||
:class="type === 0 ? 'lion' : ''"
|
||||
@click="changeType(0)"
|
||||
>
|
||||
桌台号
|
||||
</div>
|
||||
<div
|
||||
class="li"
|
||||
:class="type === 1 ? 'lion' : ''"
|
||||
@click="changeType(1)"
|
||||
>
|
||||
自定义取餐号
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="type === 0">
|
||||
<el-select
|
||||
class="inputs"
|
||||
v-model="selTableId"
|
||||
placeholder="请选择桌位"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<div class="u-flex u-row-between ">
|
||||
<span>{{ item.name }}</span>
|
||||
<span :class="['tags',item.status]">
|
||||
{{ status[item.status] ? status[item.status].label : "" }}
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template v-else>
|
||||
<key-board isCanEmpty v-model="masterId"></key-board>
|
||||
</template>
|
||||
|
||||
<div class="confirm_btns">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { tbShopTableGet } from "@/api/table";
|
||||
import keyBoard from "./keyboard.vue";
|
||||
import {$status} from "@/utils/table.js";
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
components: { keyBoard },
|
||||
data() {
|
||||
return {
|
||||
masterId: "",
|
||||
//0 台桌 ,1 取餐号
|
||||
type: 0,
|
||||
show: false,
|
||||
hasOpen: false,
|
||||
total: 0,
|
||||
loading: false,
|
||||
tableList: [],
|
||||
selTableId: "",
|
||||
status:$status
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
const item = this.tableList.find((v) => v.id == this.selTableId);
|
||||
this.$emit("confirm", item);
|
||||
this.close();
|
||||
},
|
||||
// 台桌列表
|
||||
async tbShopTableGet() {
|
||||
this.loading = true;
|
||||
try {
|
||||
const { content, total } = await tbShopTableGet({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
areaId: this.tabVlaue,
|
||||
});
|
||||
this.tableList = content.filter((v) => v.tableId);
|
||||
this.total = total;
|
||||
this.hasOpen = true;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
}, 300);
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
changeType(type) {
|
||||
this.type = type;
|
||||
},
|
||||
open() {
|
||||
this.show = true;
|
||||
if (!this.hasOpen) {
|
||||
this.tbShopTableGet();
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.el-button {
|
||||
padding: 12px 20px;
|
||||
}
|
||||
::v-deep .el-button--success {
|
||||
border-color: #22bf64;
|
||||
background-color: #22bf64;
|
||||
}
|
||||
.select_desk .btn {
|
||||
height: 34px;
|
||||
}
|
||||
.tags {
|
||||
font-size: 16px;
|
||||
&.using {
|
||||
color: rgb(234, 64, 37);
|
||||
}
|
||||
&.wait{
|
||||
color: rgb(252, 236, 79);
|
||||
}
|
||||
&.idle{
|
||||
color: rgb(137, 234, 71);
|
||||
}
|
||||
&.closed {
|
||||
color: rgb(221, 221, 221);
|
||||
filter: grayscale(1);
|
||||
}
|
||||
}
|
||||
::v-deep .inputs .el-input__inner {
|
||||
border-color: transparent !important;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
font-size: 20px;
|
||||
}
|
||||
.select_desk .select_desk_dialog {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
width: 286px;
|
||||
height: 38px;
|
||||
background: #dcf0e8;
|
||||
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li,
|
||||
.select_desk .select_desk_dialog .nav {
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .li {
|
||||
width: 140px;
|
||||
height: 34px;
|
||||
color: #0fc161;
|
||||
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .nav .lion {
|
||||
background: #0fc161;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs {
|
||||
width: 370px;
|
||||
line-height: 54px;
|
||||
margin-top: 24px;
|
||||
height: 54px;
|
||||
margin-bottom: 20px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .inputs .close {
|
||||
color: #aaa;
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
line-height: 30px;
|
||||
top: 50%;
|
||||
margin-top: -15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-right: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li {
|
||||
height: 60px;
|
||||
width: 33.333%;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
cursor: pointer;
|
||||
|
||||
user-select: none;
|
||||
border-left: 1px solid #dcdfe6;
|
||||
border-top: 1px solid #dcdfe6;
|
||||
|
||||
transition: all 0.1s;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li:hover {
|
||||
background: #dcdfe6;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .li .icon {
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm {
|
||||
height: 140px;
|
||||
background: #ff9f2e;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.select_desk .select_desk_dialog .keyboard .confirm:hover {
|
||||
background: #f88502;
|
||||
}
|
||||
|
||||
.confirm_btns {
|
||||
display: flex;
|
||||
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.confirm_btns .el-button {
|
||||
width: 175px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
<template>
|
||||
<el-dialog title="选择用户" width="850px" :visible.sync="show">
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<el-form :model="query" inline>
|
||||
<el-form-item label="">
|
||||
<el-input
|
||||
v-model="query.name"
|
||||
placeholder="请输入昵称或手机号"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否为会员">
|
||||
<el-select v-model="query.isVip" placeholder="是否是会员">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option :value="1" label="是"></el-option>
|
||||
<el-option :value="0" label="否"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<div class="flex gap-20">
|
||||
<el-button type="primary" @click="getTableData" size="medium"
|
||||
>搜索</el-button
|
||||
>
|
||||
<!-- <el-button @click="resetHandle" size="medium">重置</el-button> -->
|
||||
<el-button @click="noChooseUser" size="medium"
|
||||
>不选择用户</el-button
|
||||
>
|
||||
<!-- <el-button @click="resetHandle" size="medium">新建用户</el-button> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- <div class="head-container">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="$refs.addActive.show()">
|
||||
添加活动
|
||||
</el-button>
|
||||
</div> -->
|
||||
|
||||
<div class="head-container">
|
||||
<el-table :data="tableData.data" v-loading="tableData.loading" @cell-click="cellClick">
|
||||
<el-table-column label="ID" prop="id"></el-table-column>
|
||||
<el-table-column label="用户" prop="headImg" width="200px">
|
||||
<template v-slot="scope">
|
||||
<div class="user_info">
|
||||
<el-image
|
||||
:src="scope.row.headImg"
|
||||
style="width: 40px; height: 40px; flex-shrink: 0"
|
||||
>
|
||||
<div slot="error" class="image-slot">
|
||||
<i class="el-icon-user"></i>
|
||||
</div>
|
||||
</el-image>
|
||||
<span class="name">{{ scope.row.nickName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="手机号"
|
||||
prop="telephone"
|
||||
width="160"
|
||||
></el-table-column>
|
||||
<!-- <el-table-column label="性别" prop="sex">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="priamry">{{ scope.row.sex || "未知" }}</el-tag>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="会员" prop="isVip">
|
||||
<template v-slot="scope">
|
||||
<el-tag type="warning" v-if="scope.row.isVip"
|
||||
>会员等级{{ scope.row.isVip }}</el-tag
|
||||
>
|
||||
<span v-else>否</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额" prop="amount"></el-table-column>
|
||||
<el-table-column label="积分" prop="totalScore"></el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="90" fixed="right">
|
||||
<template v-slot="scope">
|
||||
<el-button type="primary" size="mini" @click="choose(scope.row)">选择</el-button>
|
||||
<!-- <el-button type="text" @click="charge(scope.row)">充值</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination
|
||||
:total="tableData.total"
|
||||
:current-page="tableData.page + 1"
|
||||
:page-size="tableData.size"
|
||||
@size-change="sizeChange"
|
||||
@current-change="paginationChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryAllShopUser, queryAllShopInfo } from "@/api/shop";
|
||||
import dayjs from "dayjs";
|
||||
let cacheData = {};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
query: {
|
||||
name: "",
|
||||
},
|
||||
shopInfo: {
|
||||
balanceTotal: 0,
|
||||
userTotal: 0,
|
||||
chageTotal: 0,
|
||||
},
|
||||
tableData: {
|
||||
data: [],
|
||||
page: 0,
|
||||
size: 10,
|
||||
loading: false,
|
||||
total: 0,
|
||||
},
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
timeFilter(s) {
|
||||
return dayjs(s).format("YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// this.getTableData();
|
||||
},
|
||||
methods: {
|
||||
cellClick(user){
|
||||
console.log(user)
|
||||
this.$emit("chooseUser",user)
|
||||
this.close()
|
||||
},
|
||||
noChooseUser(){
|
||||
this.$emit("chooseUser",null)
|
||||
this.close()
|
||||
|
||||
},
|
||||
choose(user) {
|
||||
this.$emit("chooseUser",user)
|
||||
this.close()
|
||||
|
||||
},
|
||||
charge(user) {
|
||||
console.log(user);
|
||||
},
|
||||
close(){
|
||||
this.show = false;
|
||||
},
|
||||
open() {
|
||||
this.getTableData();
|
||||
this.show = true;
|
||||
},
|
||||
toPage(type) {
|
||||
const pages = {
|
||||
charge: "charge_list",
|
||||
cost: "cost_list",
|
||||
};
|
||||
this.$router.push({
|
||||
name: pages[type],
|
||||
});
|
||||
console.log(pages[type]);
|
||||
},
|
||||
// 获取商家用户概述信息
|
||||
async getShopInfo() {
|
||||
try {
|
||||
const res = await queryAllShopInfo(this.query);
|
||||
this.shopInfo = res;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
sizeChange() {
|
||||
this.tableData.page = 0;
|
||||
this.getTableData();
|
||||
},
|
||||
// 切换状态
|
||||
async statusChange(e, row) {
|
||||
try {
|
||||
this.tableData.loading = true;
|
||||
const data = { ...row };
|
||||
data.status = e;
|
||||
await modityActivate(data);
|
||||
this.getTableData();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
this.tableData.loading = false;
|
||||
}
|
||||
},
|
||||
// 重置查询
|
||||
resetHandle() {
|
||||
this.query.name = "";
|
||||
this.getTableData();
|
||||
},
|
||||
// 分页回调
|
||||
paginationChange(e) {
|
||||
this.tableData.page = e - 1;
|
||||
this.getTableData();
|
||||
},
|
||||
// 获取商品列表
|
||||
async getTableData() {
|
||||
this.tableData.loading = true;
|
||||
try {
|
||||
const res = await queryAllShopUser({
|
||||
...this.query,
|
||||
size: this.tableData.size,
|
||||
page: this.tableData.page + 1,
|
||||
});
|
||||
this.tableData.loading = false;
|
||||
this.tableData.data = res.content;
|
||||
this.tableData.total = res.totalElements;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.name {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner{
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
::v-deep .image-slot {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: #efefef;
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.card {
|
||||
background-color: #f5f5f5;
|
||||
padding: 0 14px;
|
||||
|
||||
.title {
|
||||
font-size: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 20px 0;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
|
||||
.t {
|
||||
text-align: center;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #000;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.flex{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.gap-20{
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
<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="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
function toFixedNoRounding(num) {
|
||||
// 转换为字符串
|
||||
var numStr = num.toString();
|
||||
// 分割整数部分和小数部分
|
||||
var parts = numStr.split('.');
|
||||
// 如果小数部分长度大于2,则截取前两位
|
||||
if (parts[1] && parts[1].length > 2) {
|
||||
parts[1] = parts[1].slice(0, 2);
|
||||
}
|
||||
// 拼接回数字字符串并返回
|
||||
return parts.join('.');
|
||||
}
|
||||
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 =toFixedNoRounding(((this.form.curretnMoney / money) * 100).toFixed(3) )
|
||||
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 =toFixedNoRounding( ((this.form.curretnMoney / money) * 100).toFixed(3) );
|
||||
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?toFixedNoRounding(data.discount.toFixed(3)):100;
|
||||
this.show = true;
|
||||
this.init();
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 160px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 160px;
|
||||
}
|
||||
::v-deep .el-input .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
::v-deep .el-input .el-input__inner::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<div class="simple-Keyboard-number">
|
||||
<div class="carts">
|
||||
<div class="box_status">
|
||||
<slot name="input">
|
||||
<span> {{ number }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
<div class="mini-number">
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('1')">1</div>
|
||||
<div class="key" @click="keyboradAdd('2')">2</div>
|
||||
<div class="key" @click="keyboradAdd('3')">3</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('4')">4</div>
|
||||
<div class="key" @click="keyboradAdd('5')">5</div>
|
||||
<div class="key" @click="keyboradAdd('6')">6</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('7')">7</div>
|
||||
<div class="key" @click="keyboradAdd('8')">8</div>
|
||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="clearFunction">
|
||||
<slot name="clear"> </slot>
|
||||
</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div
|
||||
class="key"
|
||||
style="font-size: 31px"
|
||||
@click="keyboradReduce"
|
||||
>
|
||||
<svg
|
||||
t="1723453480343"
|
||||
class="icon"
|
||||
viewBox="0 0 1664 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1467"
|
||||
width="32"
|
||||
height="32"
|
||||
>
|
||||
<path
|
||||
d="M1526.08 1.6H459.84L41.28 416c-53.76 53.248-53.76 139.52 0 192.64l418.624 414.592v-0.064h1066.176a136.96 136.96 0 0 0 137.6-136.256V137.792a136.96 136.96 0 0 0-137.6-136.192z m-331.392 631.168c26.816 26.624 26.816 69.76 0 96.384-26.88 26.56-70.4 26.56-97.28 0l-121.28-120.128-123.328 122.112a69.76 69.76 0 0 1-97.92 0 68.096 68.096 0 0 1 0-96.96L878.208 512l-121.28-120.064a67.648 67.648 0 0 1 0-96.32c26.88-26.624 70.4-26.624 97.28 0l121.216 120.064 122.24-120.96a69.696 69.696 0 0 1 97.92 0 68.032 68.032 0 0 1 0 96.96l-122.24 120.96 121.344 120.064z"
|
||||
fill="#333333"
|
||||
p-id="1468"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="showConfirm">
|
||||
<div class="submit" @click="keyboradConfirm">确认</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
isCanEmpty: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxTips: {
|
||||
type: String,
|
||||
default: "输入值超范围",
|
||||
},
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: Infinity,
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newval) {
|
||||
this.number = newval;
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearFunction() {
|
||||
this.$emit("clear", this.number);
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if (Number(this.number) == 0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
const newval = this.number + n;
|
||||
if (newval > this.max) {
|
||||
return this.$message( this.maxTips);
|
||||
}
|
||||
this.number = newval;
|
||||
},
|
||||
keyboradReduce() {
|
||||
if (this.number.length <= 1) {
|
||||
return (this.number = this.isCanEmpty ? "" : "0");
|
||||
}
|
||||
this.number = `${this.number}`.substring(0, this.number.length - 1);
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.yd-keyboard {
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number,
|
||||
.yd-keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number {
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key {
|
||||
width: 122px;
|
||||
height: 60px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:hover {
|
||||
background-color: #dcdfe6;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:not(:last-child) {
|
||||
border-right: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line:not(:last-child) {
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box2 {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box2 .key {
|
||||
width: 80px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button .key {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key-line {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key,
|
||||
.key-line {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
border-radius: 4px;
|
||||
|
||||
align-items: center;
|
||||
margin-left: 8px;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.simple-Keyboard-number,
|
||||
.simple-Keyboard-weight {
|
||||
min-width: 410px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
border-radius: 2px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
margin-bottom: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.disabled-box {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.carts {
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carts .title,
|
||||
.carts {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.carts .title {
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
padding: 20px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.carts .title .left {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.carts .box_status {
|
||||
margin-bottom: 20px;
|
||||
width: 370px;
|
||||
height: 58px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.carts .box_status span {
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<div class="simple-Keyboard-number">
|
||||
<div class="carts">
|
||||
<div class="box_status">
|
||||
<slot name="input">
|
||||
<span> {{ number }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
<div class="mini-number">
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('1')">1</div>
|
||||
<div class="key" @click="keyboradAdd('2')">2</div>
|
||||
<div class="key" @click="keyboradAdd('3')">3</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('4')">4</div>
|
||||
<div class="key" @click="keyboradAdd('5')">5</div>
|
||||
<div class="key" @click="keyboradAdd('6')">6</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('7')">7</div>
|
||||
<div class="key" @click="keyboradAdd('8')">8</div>
|
||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="clearFunction">
|
||||
<slot name="clear"> </slot>
|
||||
</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div
|
||||
class="key"
|
||||
style="font-size: 31px"
|
||||
@click="keyboradReduce"
|
||||
>
|
||||
<svg
|
||||
t="1723453480343"
|
||||
class="icon"
|
||||
viewBox="0 0 1664 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1467"
|
||||
width="32"
|
||||
height="32"
|
||||
>
|
||||
<path
|
||||
d="M1526.08 1.6H459.84L41.28 416c-53.76 53.248-53.76 139.52 0 192.64l418.624 414.592v-0.064h1066.176a136.96 136.96 0 0 0 137.6-136.256V137.792a136.96 136.96 0 0 0-137.6-136.192z m-331.392 631.168c26.816 26.624 26.816 69.76 0 96.384-26.88 26.56-70.4 26.56-97.28 0l-121.28-120.128-123.328 122.112a69.76 69.76 0 0 1-97.92 0 68.096 68.096 0 0 1 0-96.96L878.208 512l-121.28-120.064a67.648 67.648 0 0 1 0-96.32c26.88-26.624 70.4-26.624 97.28 0l121.216 120.064 122.24-120.96a69.696 69.696 0 0 1 97.92 0 68.032 68.032 0 0 1 0 96.96l-122.24 120.96 121.344 120.064z"
|
||||
fill="#333333"
|
||||
p-id="1468"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="showConfirm">
|
||||
<div class="submit" @click="keyboradConfirm">确认</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
isCanEmpty: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxTips: {
|
||||
type: String,
|
||||
default: "输入值超范围",
|
||||
},
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: Infinity,
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newval) {
|
||||
this.number = newval;
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
clearFunction() {
|
||||
this.$emit("clear", this.number);
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if (Number(this.number) == 0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
const newval = this.number + n;
|
||||
if (newval > this.max) {
|
||||
return this.$message( this.maxTips);
|
||||
}
|
||||
this.number = newval;
|
||||
},
|
||||
keyboradReduce() {
|
||||
if (this.number.length <= 1) {
|
||||
return (this.number = this.isCanEmpty ? "" : "0");
|
||||
}
|
||||
this.number = `${this.number}`.substring(0, this.number.length - 1);
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.yd-keyboard {
|
||||
justify-content: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number,
|
||||
.yd-keyboard {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number {
|
||||
border: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key {
|
||||
width: 122px;
|
||||
height: 60px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:hover {
|
||||
background-color: #dcdfe6;
|
||||
}
|
||||
.mini-number-box1 .mini-number .key:not(:last-child) {
|
||||
border-right: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number .key-line:not(:last-child) {
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box2 {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box2 .key {
|
||||
width: 80px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button {
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button .key {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key-line {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.key,
|
||||
.key-line {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background: #fff;
|
||||
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
border-radius: 4px;
|
||||
|
||||
align-items: center;
|
||||
margin-left: 8px;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.10196078431372549);
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.simple-Keyboard-number,
|
||||
.simple-Keyboard-weight {
|
||||
min-width: 410px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
border-radius: 2px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
margin-bottom: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.disabled-box {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.carts {
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carts .title,
|
||||
.carts {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.carts .title {
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
padding: 20px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.carts .title .left {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.carts .box_status {
|
||||
margin-bottom: 20px;
|
||||
width: 370px;
|
||||
height: 58px;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.carts .box_status span {
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,339 @@
|
|||
<template>
|
||||
<el-dialog width="330px" :title="title" :visible.sync="show">
|
||||
<div class="simple-Keyboard-number">
|
||||
<div class="carts">
|
||||
<div class="pad-14">
|
||||
<div class="box_status">
|
||||
<span class="sym">¥</span>
|
||||
<el-input v-model="number" type="text" @input="numberInput"></el-input>
|
||||
<!-- <span class="inputs" :contenteditable="true" @input="numberInput" type="text" >{{ number }}</span> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="number_list_box">
|
||||
<div class="yd-keyboard">
|
||||
<div class="mini-number-box1">
|
||||
<div class="mini-number">
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('1')">1</div>
|
||||
<div class="key" @click="keyboradAdd('2')">2</div>
|
||||
<div class="key" @click="keyboradAdd('3')">3</div>
|
||||
<div
|
||||
class="key"
|
||||
style="font-size: 31px"
|
||||
@click="keyboradReduce"
|
||||
>
|
||||
<svg
|
||||
t="1723453480343"
|
||||
class="icon"
|
||||
viewBox="0 0 1664 1024"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="1467"
|
||||
width="32"
|
||||
height="32"
|
||||
>
|
||||
<path
|
||||
d="M1526.08 1.6H459.84L41.28 416c-53.76 53.248-53.76 139.52 0 192.64l418.624 414.592v-0.064h1066.176a136.96 136.96 0 0 0 137.6-136.256V137.792a136.96 136.96 0 0 0-137.6-136.192z m-331.392 631.168c26.816 26.624 26.816 69.76 0 96.384-26.88 26.56-70.4 26.56-97.28 0l-121.28-120.128-123.328 122.112a69.76 69.76 0 0 1-97.92 0 68.096 68.096 0 0 1 0-96.96L878.208 512l-121.28-120.064a67.648 67.648 0 0 1 0-96.32c26.88-26.624 70.4-26.624 97.28 0l121.216 120.064 122.24-120.96a69.696 69.696 0 0 1 97.92 0 68.032 68.032 0 0 1 0 96.96l-122.24 120.96 121.344 120.064z"
|
||||
fill="#333333"
|
||||
p-id="1468"
|
||||
></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('4')">4</div>
|
||||
<div class="key" @click="keyboradAdd('5')">5</div>
|
||||
<div class="key" @click="keyboradAdd('6')">6</div>
|
||||
<div class="key" @click="keyboradAdd('clear')">清空</div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('7')">7</div>
|
||||
<div class="key" @click="keyboradAdd('8')">8</div>
|
||||
<div class="key" @click="keyboradAdd('9')">9</div>
|
||||
<div class="key"></div>
|
||||
</div>
|
||||
<div class="key-line">
|
||||
<div class="key" @click="keyboradAdd('.')">.</div>
|
||||
<div class="key" @click="keyboradAdd('0')">0</div>
|
||||
<div class="key" @click="keyboradAdd('00')">00</div>
|
||||
<div class="key"></div>
|
||||
</div>
|
||||
<div class="confirm key" @click="confirm">确认</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="submit" @click="keyboradConfirm">确认</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: "支付",
|
||||
},
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: '0',
|
||||
show:false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
confirm(){
|
||||
|
||||
},
|
||||
open(){
|
||||
this.show=true
|
||||
},
|
||||
close(){
|
||||
this.show=false
|
||||
},
|
||||
numberInput(val){
|
||||
console.log(val)
|
||||
this.number=`${Number(val)}`
|
||||
},
|
||||
keyboradAdd(n) {
|
||||
if (n === "clear") {
|
||||
return (this.number = '0');
|
||||
}
|
||||
if(n==='.'){
|
||||
return this.number += this.number.includes('.')?'' : '.'
|
||||
}
|
||||
if (`${this.number}`.length<=1&&Number(this.number)===0) {
|
||||
return (this.number = n);
|
||||
}
|
||||
this.number += n;
|
||||
},
|
||||
keyboradReduce() {
|
||||
if (this.number.length <= 1) {
|
||||
return (this.number = this.isCanEmpty ? "" : "0");
|
||||
}
|
||||
this.number = this.number.substring(0, this.number.length - 1);
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.pad-14 {
|
||||
padding: 14px;
|
||||
width: 100%;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-outer-spin-button{
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
::v-deep .el-input__inner::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Firefox */
|
||||
::v-deep .el-input__inner {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.number_list_box,
|
||||
.yd-keyboard,
|
||||
.mini-number,
|
||||
.mini-number-box1,
|
||||
.key-line {
|
||||
width: 100%;
|
||||
}
|
||||
.yd-keyboard {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number,
|
||||
.yd-keyboard {
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mini-number-box1 .mini-number {
|
||||
border-top: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.mini-number-box2 {
|
||||
display: flex;
|
||||
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.mini-number-box2 .function-button {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.key,
|
||||
.key-line {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: 25%;
|
||||
height: 70px;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
align-items: center;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
text-align: center;
|
||||
line-height: 34px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.key:hover {
|
||||
background-color: #dcdfe6;
|
||||
}
|
||||
.key:not(:last-child) {
|
||||
border-right: 1px solid #dcdfe6;
|
||||
}
|
||||
|
||||
.key-line:not(:last-child) {
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.confirm {
|
||||
height: 142px;
|
||||
width: 25%;
|
||||
background: #22bf64;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
border-right: none;
|
||||
}
|
||||
.confirm:hover {
|
||||
background: rgba(34, 191, 100, 0.8666666666666667);
|
||||
}
|
||||
.simple-Keyboard-number,
|
||||
.simple-Keyboard-weight {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.submit {
|
||||
width: 366px;
|
||||
height: 44px;
|
||||
background: #22bf64;
|
||||
border-radius: 2px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: #fff;
|
||||
font-family: PingFangSC-Regular;
|
||||
font-weight: 400;
|
||||
margin-bottom: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.disabled-box {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.carts {
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.carts .title,
|
||||
.carts {
|
||||
display: flex;
|
||||
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.carts .title {
|
||||
justify-content: space-between;
|
||||
height: 64px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
padding: 20px;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
.carts .title .left {
|
||||
font-family: PingFangSC-Medium;
|
||||
font-weight: 500;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.carts .title .right {
|
||||
font-size: 14.4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.box_status {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
padding: 14px;
|
||||
align-items: flex-end;
|
||||
font-family: MicrosoftYaHei;
|
||||
font-size: 20px;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
letter-spacing: 1.25px;
|
||||
.sym {
|
||||
font-size: 24px;
|
||||
color: #212121;
|
||||
width: 30px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.inputs {
|
||||
font-size: 28px;
|
||||
color: #212121;
|
||||
outline: none;
|
||||
line-height: 37px;
|
||||
border: none;
|
||||
max-width: 250px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-input--small .el-input__inner{
|
||||
font-size: 28px;
|
||||
color: #212121;
|
||||
outline: none;
|
||||
line-height: 37px;
|
||||
border: none;
|
||||
max-width: 250px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.carts .box_status span {
|
||||
padding: 0 5px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="整单备注(提交订单时生效)"
|
||||
width="410px"
|
||||
:visible.sync="show"
|
||||
@close="reset"
|
||||
>
|
||||
<el-input
|
||||
:rows="6"
|
||||
type="textarea"
|
||||
v-model="note"
|
||||
placeholder="请输入备注"
|
||||
></el-input>
|
||||
<div>
|
||||
<el-tag
|
||||
v-for="(tag, index) in tags"
|
||||
@click="addNote(tag)"
|
||||
size="medium"
|
||||
:key="index"
|
||||
closable
|
||||
@close="delTag(index)"
|
||||
type="primary"
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="close"
|
||||
>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button size="medium"
|
||||
type="primary"
|
||||
@click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
tags: [],
|
||||
note: "",
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'tags.length'(){
|
||||
localStorage.setItem("tags", JSON.stringify(this.tags))
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reset(){
|
||||
this.note=''
|
||||
},
|
||||
delTag(index){
|
||||
this.tags.splice(index,1)
|
||||
},
|
||||
addNote(tag) {
|
||||
if(this.note.length<=0){
|
||||
return this.note = tag
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(note) {
|
||||
this.show = true;
|
||||
this.note=note
|
||||
const tags = localStorage.getItem("tags");
|
||||
console.log(tags)
|
||||
this.tags = tags ? JSON.parse(tags) : ["免香菜", "不要辣", "不要葱"];
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm(){
|
||||
const originTags = [...this.tags]
|
||||
if(this.note.length>=1){
|
||||
if(originTags>=10){
|
||||
originTags.shift()
|
||||
}
|
||||
const newTags=new Set([this.note,...originTags])
|
||||
console.log(newTags)
|
||||
localStorage.setItem("tags", JSON.stringify([...newTags]));
|
||||
}
|
||||
this.$emit('confirm',this.note)
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body{
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
export const orderBtns=[
|
||||
{
|
||||
text: "删除",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "规格",
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
text: "菜品打折",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "赠菜",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "赠菜",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "打包",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "等叫",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "整单等叫",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "单品备注",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "退菜",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "附加费",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "存单",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "取单",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "修改价格",
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
text: "撤单",
|
||||
disabled: false,
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="title">选择支付方式</div>
|
||||
<div class="btn_group">
|
||||
<div class="price_select">
|
||||
<div class="pay_btns">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeSel(item)"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
:type="sel === item.payType ? 'primary' : ''"
|
||||
>
|
||||
{{ item.payName }}
|
||||
</el-button>
|
||||
<!-- <el-button size="medium"> 余额支付 </el-button>
|
||||
<el-button size="medium"> 现金支付 </el-button>
|
||||
<el-button size="medium"> 挂账 </el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { $getPayType } from "@/api/table";
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
sel: "",
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
sel(newval) {
|
||||
console.log(newval);
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeSel(item) {
|
||||
this.sel = item.payType;
|
||||
this.$emit("itemClick", item);
|
||||
},
|
||||
async init() {
|
||||
const res = await $getPayType();
|
||||
this.list = res.filter(v=>v.isDisplay);
|
||||
console.log(res[0]);
|
||||
this.sel = this.sel ? this.sel : res[0].payType;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
padding: 20px 0;
|
||||
}
|
||||
.pay_btns .el-button {
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
<el-dialog title="撤单" width="410px" :visible.sync="show" @close="reset">
|
||||
<div>
|
||||
<div><span>撤单原因</span> <span class="color-red">*</span></div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-flex-wrap tags">
|
||||
<div
|
||||
class="tag"
|
||||
v-for="(tag, index) in tags"
|
||||
@click="changeSel(index)"
|
||||
:key="index"
|
||||
:class="{ active: tagSel == index }"
|
||||
>
|
||||
{{ tag }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-input
|
||||
v-model="note"
|
||||
size="medium"
|
||||
placeholder="请输入自定义备注"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-checkbox v-model="isPrint"
|
||||
>打印退菜单</el-checkbox
|
||||
>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button size="medium" @click="close"> 取消 </el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isPrint:false,
|
||||
tagSel: -1,
|
||||
show: false,
|
||||
tags: ["人手不足", "店满无法招待", "顾客要求", "商品质量问题"],
|
||||
note: "",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeSel(i) {
|
||||
this.tagSel = i;
|
||||
},
|
||||
reset() {
|
||||
this.note = "";
|
||||
},
|
||||
delTag(index) {
|
||||
this.tags.splice(index, 1);
|
||||
},
|
||||
addNote(tag) {
|
||||
if (this.note.length <= 0) {
|
||||
return (this.note = tag);
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(note) {
|
||||
this.show = true;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm() {
|
||||
this.$emit("confirm", this.note);
|
||||
this.close();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.tags {
|
||||
.tag {
|
||||
margin: 10px 10px 0 0;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 10px 13px;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: #1890ff;
|
||||
background: #e8f4ff;
|
||||
border-color: #a3d3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
<el-dialog title="退菜" width="410px" :visible.sync="show" @close="reset">
|
||||
<div>
|
||||
<div><span>退菜原因</span> <span class="color-red">*</span></div>
|
||||
</div>
|
||||
|
||||
<div class="u-flex u-flex-wrap tags">
|
||||
<div
|
||||
class="tag"
|
||||
v-for="(tag, index) in tags"
|
||||
@click="changeSel(tag)"
|
||||
:key="index"
|
||||
:class="{ active: tag.checked }"
|
||||
>
|
||||
{{ tag.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-input
|
||||
v-model="note"
|
||||
size="medium"
|
||||
placeholder="请输入自定义备注"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-checkbox v-model="isPrint"
|
||||
>打印退菜单</el-checkbox
|
||||
>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<el-button size="medium" @click="close"> 取消 </el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isPrint:false,
|
||||
tagSel: -1,
|
||||
show: false,
|
||||
tags: [{label:"不想要了",checked:false} ,{label:"食材不足",checked:false} ,{label:"等待时间过长",checked:false}],
|
||||
note: "",
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeSel(item) {
|
||||
item.checked = !item.checked ;
|
||||
},
|
||||
reset() {
|
||||
this.note = "";
|
||||
},
|
||||
delTag(index) {
|
||||
this.tags.splice(index, 1);
|
||||
},
|
||||
addNote(tag) {
|
||||
if (this.note.length <= 0) {
|
||||
return (this.note = tag);
|
||||
}
|
||||
this.note = tag + "," + this.note;
|
||||
},
|
||||
open(note) {
|
||||
this.show = true;
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
confirm() {
|
||||
this.$emit("confirm", this.note);
|
||||
this.close();
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
margin-bottom: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
::v-deep .el-tag {
|
||||
margin-top: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
line-height: 35px;
|
||||
height: 35px;
|
||||
}
|
||||
.tags {
|
||||
.tag {
|
||||
margin: 10px 10px 0 0;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
padding: 10px 13px;
|
||||
font-size: 14px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
&.active {
|
||||
color: #1890ff;
|
||||
background: #e8f4ff;
|
||||
border-color: #a3d3ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
<template>
|
||||
<el-dialog width="400px" :title="title" :visible.sync="show" @close="reset">
|
||||
<div class="u-p-15">
|
||||
<div v-if="openSwitch">
|
||||
<el-button
|
||||
size="medium"
|
||||
@click="changeKey('paysSel', index)"
|
||||
v-for="(item, index) in pays"
|
||||
:key="index"
|
||||
:type="paysSel == index ? 'success' : ''"
|
||||
>{{ item.text }}</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<el-alert
|
||||
:closable="false"
|
||||
v-if="tips"
|
||||
:title="tips"
|
||||
type="warning"
|
||||
show-icon
|
||||
>
|
||||
</el-alert>
|
||||
</div>
|
||||
<div class="u-m-t-20">
|
||||
<template v-if="paysSel == 0">
|
||||
<el-form label-width="90px" label-position="left">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input :value="form.money" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="付款码">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
@change="codeInputChange"
|
||||
placeholder="请扫码或者输入付款码"
|
||||
ref="refInputCode"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<div class="u-flex u-row-center u-m-t-50">
|
||||
<el-button size="medium" @click="close">取消</el-button>
|
||||
<el-button size="medium" type="primary" @click="confirm"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="u-text-center">
|
||||
<div class="u-flex u-row-center">
|
||||
<img :src="codeImg" class="codeImg" alt="" />
|
||||
</div>
|
||||
<div class="color-333 u-font-20 u-m-t-20">32.00元</div>
|
||||
<div class="color-aaa u-font-12 u-m-t-10">
|
||||
<i class="el-icon-loading"></i>
|
||||
<span>等待用户支付</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
openSwitch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "支付",
|
||||
},
|
||||
price: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
defaultTips: {
|
||||
type: String,
|
||||
default: "请使用扫码枪扫描付款码",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tips: "",
|
||||
paysSel: 0,
|
||||
form: {
|
||||
money: "",
|
||||
code: "",
|
||||
},
|
||||
codeImg:
|
||||
"https://zhyx.eingdong.com/qrcode/api.php?url=https%3A%2F%2Fzhyx.eingdong.com%2Fcopyright%2F%23%2Fpay%3Fid%3D139451580",
|
||||
pays: [
|
||||
{
|
||||
text: "主扫",
|
||||
},
|
||||
{
|
||||
text: "被扫",
|
||||
},
|
||||
],
|
||||
number: "0",
|
||||
show: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
defaultTips(val) {
|
||||
this.tips = val;
|
||||
},
|
||||
price(val) {
|
||||
console.log(val);
|
||||
this.form.money = Number(val).toFixed(2);
|
||||
},
|
||||
paysSel(newval) {
|
||||
if (newval == 0) {
|
||||
this.tips = "请使用扫码枪扫微信/支付宝收款码";
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
} else {
|
||||
this.tips = "请用户使用微信/支付宝扫描付款码";
|
||||
}
|
||||
},
|
||||
number(newval) {
|
||||
this.$emit("input", newval);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
codeInputChange(e){
|
||||
console.log(e)
|
||||
// this.$emit("confirm", this.form.code);
|
||||
},
|
||||
reset() {
|
||||
// this.form.money=''
|
||||
this.form.code = "";
|
||||
this.paysSel = 0;
|
||||
},
|
||||
changeKey(key, val) {
|
||||
this[key] = val;
|
||||
},
|
||||
|
||||
confirm() {
|
||||
if(!this.form.code){
|
||||
return this.$message.error("请输入或扫付款码")
|
||||
}
|
||||
this.close()
|
||||
this.$emit("confirm", this.form.code);
|
||||
},
|
||||
open() {
|
||||
this.show = true;
|
||||
this.form.money = Number(this.price).toFixed(2);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.refInputCode.focus();
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.show = false;
|
||||
},
|
||||
numberInput(val) {
|
||||
console.log(val);
|
||||
this.number = `${Number(val)}`;
|
||||
},
|
||||
keyboradConfirm() {
|
||||
this.$emit("confirm", this.number);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.number = `${this.value}`;
|
||||
this.tips = this.defaultTips;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.codeImg {
|
||||
width: 160px;
|
||||
border: 1px solid rgb(220, 223, 230);
|
||||
height: 160px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -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;
|
||||
}
|
||||
Loading…
Reference in New Issue