Merge branch 'test' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq
This commit is contained in:
@@ -573,6 +573,17 @@ export function tbPlussShopStaff(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function tbShopPermissionlist(params) {
|
||||||
|
return request({
|
||||||
|
url: `/api/tbShopPermission/list`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id获取员工信息
|
* 通过id获取员工信息
|
||||||
* @returns
|
* @returns
|
||||||
@@ -603,6 +614,13 @@ export function callRecord(params) {
|
|||||||
params
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export function callTablecall(data) {
|
||||||
|
return request({
|
||||||
|
url: `/callTable/call`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
// 删除桌型
|
// 删除桌型
|
||||||
export function callTabledelete(data) {
|
export function callTabledelete(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
// 桌台管理
|
// 桌台管理
|
||||||
import request from "@/utils/request";
|
import request from "@/utils/request";
|
||||||
|
//就餐形式,默认堂食后付费
|
||||||
|
const useType='dine-in-after'
|
||||||
|
function getUseType(){
|
||||||
|
const type=localStorage.getItem("useType")
|
||||||
|
return type?type:useType
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 台桌列表
|
* 台桌列表
|
||||||
* @returns
|
* @returns
|
||||||
@@ -133,6 +138,7 @@ export function getCart(params) {
|
|||||||
method: "get",
|
method: "get",
|
||||||
params:{
|
params:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...params
|
...params
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -162,6 +168,7 @@ export function addCart(data) {
|
|||||||
method: "post",
|
method: "post",
|
||||||
data:{
|
data:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -177,6 +184,7 @@ export function $clearCart(data) {
|
|||||||
method: "delete",
|
method: "delete",
|
||||||
data:{
|
data:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -192,6 +200,7 @@ export function $removeCart(data) {
|
|||||||
method: "delete",
|
method: "delete",
|
||||||
data:{
|
data:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -234,6 +243,7 @@ export function $getMasterId(data) {
|
|||||||
method: "get",
|
method: "get",
|
||||||
params:{
|
params:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -262,6 +272,7 @@ export function $createOrder(data) {
|
|||||||
method: "post",
|
method: "post",
|
||||||
data:{
|
data:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -278,6 +289,7 @@ export function $cacheOrder(data) {
|
|||||||
method: "post",
|
method: "post",
|
||||||
data:{
|
data:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -293,6 +305,7 @@ export function $getCacheOrder(data) {
|
|||||||
method: "get",
|
method: "get",
|
||||||
params:{
|
params:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -362,6 +375,7 @@ export function $choseCount(data) {
|
|||||||
method: "put",
|
method: "put",
|
||||||
data:{
|
data:{
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
useType: getUseType(),
|
||||||
...data
|
...data
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -403,3 +417,14 @@ export function $printDishes(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 就餐模式切换
|
||||||
|
export function $changeUseType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/place/choseModel',
|
||||||
|
method: "put",
|
||||||
|
data:{
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
...data
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ export default {
|
|||||||
this.resetSearchForm = { ...this.searchForm }
|
this.resetSearchForm = { ...this.searchForm }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
reset(){
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
},
|
||||||
onInput: _.debounce(function (event) { //防抖请求
|
onInput: _.debounce(function (event) { //防抖请求
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
}, 500),
|
}, 500),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="head-container">
|
<div>
|
||||||
<el-form :model="query" inline>
|
<el-form :model="query" inline>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="query.conName" placeholder="耗材信息名称" />
|
<el-input v-model="query.conName" placeholder="耗材信息名称" />
|
||||||
@@ -11,24 +11,83 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</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">
|
<div class="head-container">
|
||||||
<el-table
|
<el-table ref="table" :data="clickseetableData.data" v-loading="clickseetableData.loading" row-key="id">
|
||||||
ref="table"
|
|
||||||
:data="clickseetableData.data"
|
|
||||||
v-loading="clickseetableData.loading"
|
|
||||||
row-key="id"
|
|
||||||
height="66vh"
|
|
||||||
>
|
|
||||||
<el-table-column label="耗材名称" prop="conName" />
|
<el-table-column label="耗材名称" prop="conName" />
|
||||||
<el-table-column label="现有库存" >
|
<el-table-column label="现有库存">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span :class="[computedClass(scope.row.balance)]"> {{scope.row.balance }}</span>
|
<span :class="[computedClass(scope.row.balance)]"> {{ scope.row.balance }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="耗材消耗" prop="conConsume" align="center" />
|
<el-table-column label="耗材消耗" prop="conConsume" align="center" />
|
||||||
<el-table-column label="耗材入库" prop="conIn" align="center" />
|
<el-table-column label="耗材入库" prop="conIn" align="center" />
|
||||||
<el-table-column label="耗材出库" prop="conOut" align="center" />
|
<el-table-column label="耗材出库" prop="conOut" align="center" />
|
||||||
<el-table-column label="耗材反还" prop="conReturn" align="center"/>
|
<el-table-column label="耗材反还" prop="conReturn" align="center" />
|
||||||
|
|
||||||
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
<!-- <el-table-column label="业务编码" prop="bizCode" /> -->
|
||||||
<!-- <el-table-column label="业务说明" prop="bizName" /> -->
|
<!-- <el-table-column label="业务说明" prop="bizName" /> -->
|
||||||
@@ -36,25 +95,16 @@
|
|||||||
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
<!-- <el-table-column label="正负号标识" prop="bizType" /> -->
|
||||||
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
<!-- <el-table-column label="耗材id" prop="consId" /> -->
|
||||||
<!-- <el-table-column label="创建时间" prop="createTime"></el-table-column> -->
|
<!-- <el-table-column label="创建时间" prop="createTime"></el-table-column> -->
|
||||||
<el-table-column label="所属商品" width="320" align="center">
|
<el-table-column label="所属商品" width="320" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId"
|
||||||
v-for="(item) in scope.row.product"
|
type="text">{{ item.productName }}</el-button>
|
||||||
@click="toGoods(item)"
|
|
||||||
:key="item.productId"
|
|
||||||
type="text"
|
|
||||||
>{{item.productName}}</el-button
|
|
||||||
>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="center">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button type="text" @click="lookDetail(scope.row)">查看详情</el-button>
|
||||||
type="text"
|
|
||||||
@click="lookDetail(scope.row)"
|
|
||||||
>查看详情</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="更新时间" prop="updateTime">
|
<!-- <el-table-column label="更新时间" prop="updateTime">
|
||||||
@@ -65,20 +115,14 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-pagination
|
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
|
||||||
:total="clickseetableData.total"
|
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:current-page="clickseetableData.page + 1"
|
@current-change="paginationChangetype" @size-change="e => {
|
||||||
:page-size="clickseetableData.size"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
@current-change="paginationChangetype"
|
|
||||||
@size-change="
|
|
||||||
e => {
|
|
||||||
clickseetableData.size = e;
|
clickseetableData.size = e;
|
||||||
clickseetableData.page = 0;
|
clickseetableData.page = 0;
|
||||||
getTableData();
|
getTableData();
|
||||||
}
|
}
|
||||||
"
|
" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<cons-record-detail ref="recodeDetail"></cons-record-detail>
|
<cons-record-detail ref="recodeDetail"></cons-record-detail>
|
||||||
@@ -86,11 +130,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { gettbConsInfoFlow,viewConInfoFlow } from "@/api/consumable";
|
import { gettbConsInfoFlow, viewConInfoFlow } from "@/api/consumable";
|
||||||
import consRecordDetail from "../components/cons_record_detail";
|
import consRecordDetail from "../components/cons_record_detail";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components: {
|
||||||
consRecordDetail
|
consRecordDetail
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -111,26 +155,26 @@ export default {
|
|||||||
this.getTableData();
|
this.getTableData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toGoods(data){
|
toGoods(data) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path:'/product/product',
|
path: '/product/product',
|
||||||
query:{
|
query: {
|
||||||
productId: data.productId
|
productId: data.productId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computedClass(num){
|
computedClass(num) {
|
||||||
if(num>0){
|
if (num > 0) {
|
||||||
return 'green'
|
return 'green'
|
||||||
}else{
|
} else {
|
||||||
return 'red'
|
return 'red'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lookDetail(row){
|
lookDetail(row) {
|
||||||
this.$refs.recodeDetail.open({
|
this.$refs.recodeDetail.open({
|
||||||
"consId": row.consId,
|
"consId": row.consId,
|
||||||
"conName": row.conName
|
"conName": row.conName
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
resetHandle() {
|
resetHandle() {
|
||||||
this.clickseetableData.page = 0;
|
this.clickseetableData.page = 0;
|
||||||
@@ -157,17 +201,17 @@ export default {
|
|||||||
shopId: localStorage.getItem("shopId")
|
shopId: localStorage.getItem("shopId")
|
||||||
});
|
});
|
||||||
this.clickseetableData.loading = false;
|
this.clickseetableData.loading = false;
|
||||||
this.clickseetableData.data = res.content.map(v=>{
|
this.clickseetableData.data = res.content.map(v => {
|
||||||
const productIds=v.productId?v.productId.split(','):[]
|
const productIds = v.productId ? v.productId.split(',') : []
|
||||||
return{
|
return {
|
||||||
...v,
|
...v,
|
||||||
product:productIds.map((str,index)=>{
|
product: productIds.map((str, index) => {
|
||||||
const startIndex=str.indexOf('_')
|
const startIndex = str.indexOf('_')
|
||||||
const productId=str.slice(0,startIndex)
|
const productId = str.slice(0, startIndex)
|
||||||
const productName=str.slice(startIndex+1,str.length)
|
const productName = str.slice(startIndex + 1, str.length)
|
||||||
return {
|
return {
|
||||||
productId,
|
productId,
|
||||||
productName:productName+`${(index==productIds.length-1)?'':','}`
|
productName: productName + `${(index == productIds.length - 1) ? '' : ','}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -182,22 +226,88 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.green{
|
.green {
|
||||||
color: #13ce66;
|
color: #13ce66;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.red{
|
|
||||||
|
.red {
|
||||||
color: #ff4949;
|
color: #ff4949;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
||||||
}
|
}
|
||||||
::v-deep .el-table .cell{
|
|
||||||
|
::v-deep .el-table .cell {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-table th.el-table__cell>.cell{
|
::v-deep .el-table th.el-table__cell>.cell {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
.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: 10px 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>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
style="width: 150px"
|
style="width: 150px"
|
||||||
@keyup.enter.native="getTableData"
|
@keyup.enter.native="getTableData"
|
||||||
/> -->
|
/> -->
|
||||||
<div style="width: 150px">
|
<!-- <div style="width: 150px">
|
||||||
<el-select v-model="query.conTypeId" placeholder="请选择耗材分类" style="width: 100%">
|
<el-select v-model="query.conTypeId" placeholder="请选择耗材分类" style="width: 100%">
|
||||||
<el-option :label="item.conTypeName" :value="item.id" v-for="item in consTypeList"
|
<el-option :label="item.conTypeName" :value="item.id" v-for="item in consTypeList"
|
||||||
:key="item.conTypeId" />
|
:key="item.conTypeId" />
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<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" />
|
@keyup.enter.native="getTableData" />
|
||||||
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 150px"
|
<el-input v-model="query.conCode" size="small" clearable placeholder="请输入耗材代码" style="width: 150px"
|
||||||
@keyup.enter.native="getTableData" />
|
@keyup.enter.native="getTableData" /> -->
|
||||||
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 150px"
|
<el-input v-model="query.conName" size="small" clearable placeholder="请输入耗材名称" style="width: 150px"
|
||||||
@keyup.enter.native="getTableData" />
|
@keyup.enter.native="getTableData" />
|
||||||
<div style="width: 150px">
|
<div style="width: 150px">
|
||||||
@@ -38,6 +38,11 @@
|
|||||||
<el-button @click="resetHandle">重置</el-button>
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<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-download" :loading="downloadLoading" @click="protHandle">导出耗材</el-button>
|
||||||
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
|
<el-button icon="el-icon-upload2" :loading="uploadLoading" @click="dialogVisible = true">导入耗材</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,9 +68,8 @@
|
|||||||
<i class="el-icon-edit" @click="scope.row.editNYD = 1"></i>
|
<i class="el-icon-edit" @click="scope.row.editNYD = 1"></i>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="分类名称" prop="conTypeName"></el-table-column>
|
<!-- <el-table-column label="分类名称" prop="conTypeName"></el-table-column> -->
|
||||||
<el-table-column label="单位" prop="conUnit">
|
<el-table-column label="单位" prop="conUnit">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div v-if="scope.row.editNYD == 2">
|
<div v-if="scope.row.editNYD == 2">
|
||||||
<el-input v-model="scope.row.conUnit" placeholder="请输入内容" @blur="conNameClick(scope.row)"></el-input>
|
<el-input v-model="scope.row.conUnit" placeholder="请输入内容" @blur="conNameClick(scope.row)"></el-input>
|
||||||
@@ -77,12 +81,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="现有库存">
|
<!-- <el-table-column label="现有库存">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span :class="[computedClass(scope.row.balance)]"> {{ scope.row.balance }}</span>
|
<span :class="[computedClass(scope.row.balance)]"> {{ scope.row.balance }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="耗材消耗" prop="conConsume" />
|
<el-table-column label="耗材消耗" prop="conConsume" />
|
||||||
<el-table-column label="耗材入库" prop="conIn" />
|
<el-table-column label="耗材入库" prop="conIn" />
|
||||||
<el-table-column label="耗材出库" prop="conOut" />
|
<el-table-column label="耗材出库" prop="conOut" />
|
||||||
<el-table-column label="耗材反还" prop="conReturn" />
|
<el-table-column label="耗材反还" prop="conReturn" />
|
||||||
@@ -91,14 +95,14 @@
|
|||||||
<el-switch v-model="scope.row.isCheck" active-value="1" inactive-value="0"
|
<el-switch v-model="scope.row.isCheck" active-value="1" inactive-value="0"
|
||||||
@change="showChange($event, scope.row)"></el-switch>
|
@change="showChange($event, scope.row)"></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="所属商品" width="220">
|
<el-table-column label="所属商品">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="goods-list">
|
<div class="goods-list">
|
||||||
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
|
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
|
||||||
item.productName }}</el-button>
|
item.productName }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="库存数量" prop="stockNumber">
|
<el-table-column label="库存数量" prop="stockNumber">
|
||||||
@@ -118,19 +122,20 @@
|
|||||||
<i class="el-icon-edit" @click="scope.row.editNYD = 3"></i>
|
<i class="el-icon-edit" @click="scope.row.editNYD = 3"></i>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" prop="status">
|
||||||
<el-table-column label="创建时间" prop="createTime" width="200">
|
<template v-slot="scope">
|
||||||
<!-- <template v-slot="scope">
|
<el-switch v-model="scope.row.status" active-value="1" inactive-value="0"
|
||||||
{{ dayjs(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
|
@change="changeswitchstatus(scope.row)"></el-switch>
|
||||||
</template> -->
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="创建时间" prop="createTime" width="200"> </el-table-column> -->
|
||||||
<el-table-column label="操作" width="250" fixed="right">
|
<el-table-column label="操作" width="250" fixed="right">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button type="text" @click="editorHandle(scope.row)">编辑</el-button>
|
<el-button type="text" @click="editorHandle(scope.row)">编辑</el-button>
|
||||||
<el-button type="text" @click="clicksee(scope.row)" style="margin-left: 10px !important">耗材记录</el-button>
|
<el-button type="text" @click="clicksee(scope.row)" style="margin-left: 10px !important">耗材记录</el-button>
|
||||||
<el-button type="text" size="mini" style="margin-left: 10px !important"
|
<el-button type="text" size="mini" style="margin-left: 10px !important"
|
||||||
@click="$refs.AddConsTakin.show(scope.row)">耗材盘点</el-button>
|
@click="$refs.AddConsTakin.show(scope.row)">耗材盘点</el-button>
|
||||||
<el-button style="margin-left: 10px !important" type="text" @click="lookDetail(scope.row)">查看详情</el-button>
|
<!-- <el-button style="margin-left: 10px !important" type="text" @click="lookDetail(scope.row)">查看详情</el-button> -->
|
||||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||||
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
|
<!-- <el-button type="text" @click="clickdialogfadd(scope.row)"
|
||||||
style="margin-left: 10px !important;">入库</el-button> -->
|
style="margin-left: 10px !important;">入库</el-button> -->
|
||||||
@@ -586,6 +591,14 @@ export default {
|
|||||||
row.editNYD = 0
|
row.editNYD = 0
|
||||||
this.$message.success('修改成功')
|
this.$message.success('修改成功')
|
||||||
},
|
},
|
||||||
|
async changeswitchstatus(row) {
|
||||||
|
await postapitbConsInfo([{
|
||||||
|
id: row.consId,
|
||||||
|
...row,
|
||||||
|
shopId: localStorage.getItem('shopId')
|
||||||
|
}])
|
||||||
|
this.$message.success('修改成功')
|
||||||
|
},
|
||||||
computedClass(num) {
|
computedClass(num) {
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
return 'green'
|
return 'green'
|
||||||
@@ -861,13 +874,15 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
::v-deep .goods-list .el-button--text span{
|
::v-deep .goods-list .el-button--text span {
|
||||||
display: block;
|
display: block;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
::v-deep .goods-list .el-button--text{
|
|
||||||
|
::v-deep .goods-list .el-button--text {
|
||||||
white-space: break-spaces;
|
white-space: break-spaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-success {
|
.color-success {
|
||||||
color: #67c23a;
|
color: #67c23a;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- eslint-disable no-empty -->
|
<!-- eslint-disable no-empty -->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div class="head-container">
|
<!-- <div class="head-container">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入耗材类型名称" style="width: 100%;"
|
<el-input v-model="query.conTypeName" size="small" clearable placeholder="请输入耗材类型名称" style="width: 100%;"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<el-button @click="resetHandle">重置</el-button>
|
<el-button @click="resetHandle">重置</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
@@ -31,32 +31,34 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="head-container" id="table_drag">
|
<div class="head-container" id="table_drag">
|
||||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
||||||
<el-table-column prop="id" label="ID" width="50px" />
|
<el-table-column prop="id" label="ID" />
|
||||||
<el-table-column label="耗材类型名称" prop="conTypeName" />
|
<el-table-column label="耗材类型名称" prop="conTypeName" />
|
||||||
<el-table-column label="耗材类型代码" prop="conTypeCode" />
|
<!-- <el-table-column label="耗材类型代码" prop="conTypeCode" />
|
||||||
<el-table-column label="创建时间" prop="createTime">
|
<el-table-column label="创建时间" prop="createTime">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="店铺ID" prop="shopId">
|
<el-table-column label="店铺ID" prop="shopId">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.shopId }}
|
<el-link type="primary" @click="$router.push({ name: 'information' })">{{ scope.row.shopId }}</el-link>
|
||||||
<!-- <el-link type="primary" @click="$router.push({ name: 'information' })">{{ scope.row.shopId }}</el-link> -->
|
</template>
|
||||||
</template>
|
</el-table-column> -->
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="状态" prop="status">
|
<el-table-column label="状态" prop="status">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
|
<!-- <el-tag type="primary" v-if="scope.row.status == '1'">正常</el-tag>
|
||||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag> -->
|
||||||
|
<el-switch active-value="0" inactive-value="1"
|
||||||
|
v-model="scope.row.status" @change="changeswitch(scope.row)" />
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
<!-- <el-table-column label="排序" prop="sort" sortable />
|
||||||
<el-table-column label="更新时间" prop="updateTime">
|
<el-table-column label="更新时间" prop="updateTime">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
||||||
@@ -77,7 +79,7 @@
|
|||||||
<el-dialog :title="dialogtitle" :visible.sync="dialogshow">
|
<el-dialog :title="dialogtitle" :visible.sync="dialogshow">
|
||||||
<el-form ref="refruleForm" :model="ruleForm" :rules="rules">
|
<el-form ref="refruleForm" :model="ruleForm" :rules="rules">
|
||||||
<el-form-item label="耗材类型名称" prop="conTypeName">
|
<el-form-item label="耗材类型名称" prop="conTypeName">
|
||||||
<el-input v-model="ruleForm.conTypeName" @input="trimInput($event,'conTypeName')"/>
|
<el-input v-model="ruleForm.conTypeName" @input="trimInput($event, 'conTypeName')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="耗材类型代码" prop="conTypeCode">
|
<!-- <el-form-item label="耗材类型代码" prop="conTypeCode">
|
||||||
<el-input v-model="ruleForm.conTypeCode" />
|
<el-input v-model="ruleForm.conTypeCode" />
|
||||||
@@ -153,7 +155,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
trimInput(val,key){
|
trimInput(val, key) {
|
||||||
console.log(val)
|
console.log(val)
|
||||||
this.ruleForm[key] = val.replace(/\s+/g, '')
|
this.ruleForm[key] = val.replace(/\s+/g, '')
|
||||||
},
|
},
|
||||||
@@ -230,6 +232,17 @@ export default {
|
|||||||
}
|
}
|
||||||
this.dialogshow = true
|
this.dialogshow = true
|
||||||
},
|
},
|
||||||
|
async changeswitch(item) {
|
||||||
|
console.log(item)
|
||||||
|
await puttbConsType({
|
||||||
|
id: item.id,
|
||||||
|
conTypeCode: item.conTypeCode,
|
||||||
|
conTypeName: item.conTypeName,
|
||||||
|
shopId: item.shopId,
|
||||||
|
status: item.status
|
||||||
|
})
|
||||||
|
this.getTableData()
|
||||||
|
},
|
||||||
submitForm(formName) {
|
submitForm(formName) {
|
||||||
this.$refs[formName].validate(async (valid) => {
|
this.$refs[formName].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
@@ -117,4 +117,68 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.box {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0px 90px 20px 90px;
|
||||||
|
|
||||||
|
.boxitem {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 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>
|
||||||
@@ -385,8 +385,25 @@ export default {
|
|||||||
this.shopTypesActive = type == 'in' ? 0 : 1
|
this.shopTypesActive = type == 'in' ? 0 : 1
|
||||||
this.inTabValue = value
|
this.inTabValue = value
|
||||||
this.resetHandle()
|
this.resetHandle()
|
||||||
this.$refs.shopList.clearSelection()//清除选项
|
this.$refs.shopList.reset()//清除选项
|
||||||
this.$refs.ConsumableList.clearSelection()//清除选项
|
this.$refs.ConsumableList.reset()//清除选项
|
||||||
|
},
|
||||||
|
// 切换类型
|
||||||
|
changeTypeEnum(index) {
|
||||||
|
this.inTabs.forEach((i) => {
|
||||||
|
if (i.value == this.inTabValue) {
|
||||||
|
this.queryForm.type = i.type
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (this.inTabValue == 'consumable') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
//商品入库是否显示应付实付
|
||||||
|
if (this.queryForm.purveyorId) {
|
||||||
|
this.shopTypesActive = 0
|
||||||
|
} else {
|
||||||
|
this.shopTypesActive = 1
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 计算耗材总价
|
// 计算耗材总价
|
||||||
consCountTotal(cvalue, row, key1, key2 = undefined) {
|
consCountTotal(cvalue, row, key1, key2 = undefined) {
|
||||||
@@ -470,8 +487,8 @@ export default {
|
|||||||
}
|
}
|
||||||
this.queryFormLoading = false
|
this.queryFormLoading = false
|
||||||
this.showResult = true
|
this.showResult = true
|
||||||
this.$refs.shopList.clearSelection()//清除选项
|
this.$refs.shopList.reset()//清除选项
|
||||||
this.$refs.ConsumableList.clearSelection()//清除选项
|
this.$refs.ConsumableList.reset()//清除选项
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
this.queryFormLoading = false
|
this.queryFormLoading = false
|
||||||
@@ -496,7 +513,7 @@ export default {
|
|||||||
this.showResult = false
|
this.showResult = false
|
||||||
this.queryForm = { ...this.resetForm }
|
this.queryForm = { ...this.resetForm }
|
||||||
if (this.inTabValue == 'goods') {
|
if (this.inTabValue == 'goods') {
|
||||||
this.queryForm.type = this.shopTypes[this.shopTypesActive].value
|
this.queryForm.type = 'purveyor'
|
||||||
} else {
|
} else {
|
||||||
this.queryForm.type = this.inTabs.find(item => item.value == this.inTabValue).type
|
this.queryForm.type = this.inTabs.find(item => item.value == this.inTabValue).type
|
||||||
}
|
}
|
||||||
@@ -504,22 +521,7 @@ export default {
|
|||||||
this.$refs.queryForm.resetFields()
|
this.$refs.queryForm.resetFields()
|
||||||
this.$refs.queryForm.resetFields()
|
this.$refs.queryForm.resetFields()
|
||||||
},
|
},
|
||||||
// 切换类型
|
|
||||||
changeTypeEnum(index) {
|
|
||||||
console.log(this.inTabValue)
|
|
||||||
if (this.inTabValue == 'consumable') {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (this.queryForm.purveyorId) {
|
|
||||||
this.shopTypesActive = 0
|
|
||||||
} else {
|
|
||||||
this.shopTypesActive = 1
|
|
||||||
}
|
|
||||||
this.queryForm.type = this.shopTypes[this.shopTypesActive].value
|
|
||||||
// console.log(index)
|
|
||||||
// this.shopTypesActive = index
|
|
||||||
// this.queryForm.type = this.shopTypes[index].value
|
|
||||||
},
|
|
||||||
// 获取供应商列表
|
// 获取供应商列表
|
||||||
async tbShopPurveyorGet() {
|
async tbShopPurveyorGet() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -19,12 +19,12 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="buttonstyle">
|
<div class="buttonstyle">
|
||||||
<el-button type="primary" @click="dialogVisibles = true">取号</el-button>
|
<el-button type="primary" @click="dialogVisibles = true; phone = ''">取号</el-button>
|
||||||
<el-button plain type="primary" @click="toUrl">叫号记录</el-button>
|
<el-button plain type="primary" @click="toUrl">叫号记录</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex;align-items: center;flex-wrap: wrap;justify-content: space-between; ">
|
<div style="display: flex;align-items: center;flex-wrap: wrap; ">
|
||||||
<div class="lineUpBoxList" v-for="item in list.records" :key="item.id">
|
<div class="lineUpBoxList" v-for="item in list.records" style="margin-right: 20px;" :key="item.id">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div>用户</div>
|
<div>用户</div>
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { callTable, callTablequeue, callTableput, callTabletakeNumber } from '@/api/shop'
|
import { callTable, callTablequeue, callTableput, callTabletakeNumber ,callTablecall} from '@/api/shop'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -131,9 +131,15 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
profilepicture(d) {
|
async profilepicture(d) {
|
||||||
this.dialogVisible = true
|
let res = await callTablecall({
|
||||||
this.profilepictureInfo = d
|
shopId: localStorage.getItem('shopId'),
|
||||||
|
callQueueId: d.id
|
||||||
|
})
|
||||||
|
if (res) {
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.profilepictureInfo = d
|
||||||
|
}
|
||||||
},
|
},
|
||||||
gettypeevent(d) {
|
gettypeevent(d) {
|
||||||
this.selecttopType = d
|
this.selecttopType = d
|
||||||
@@ -155,7 +161,7 @@ export default {
|
|||||||
} else if (value == 2) {
|
} else if (value == 2) {
|
||||||
const res = await callTableput({
|
const res = await callTableput({
|
||||||
shopId: localStorage.getItem('shopId'),
|
shopId: localStorage.getItem('shopId'),
|
||||||
state: 1,
|
state: 2,
|
||||||
callQueueId: this.profilepictureInfo.id
|
callQueueId: this.profilepictureInfo.id
|
||||||
})
|
})
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|||||||
@@ -1,49 +1,79 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="title" :visible.sync="dialogVisible" @open="reset">
|
<el-dialog :title="title" top="80px" :visible.sync="dialogVisible" @open="reset">
|
||||||
|
<h3 style="color: #3F9EFF;">
|
||||||
|
基本信息设置
|
||||||
|
</h3>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
<el-form ref="form" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||||
<el-form-item label="员工姓名" prop="name">
|
<el-row>
|
||||||
<el-input v-model="form.name" placeholder="请输入员工姓名" />
|
<el-col :span="10">
|
||||||
</el-form-item>
|
<el-form-item label="员工姓名" prop="name">
|
||||||
<el-form-item label="员工编号" prop="code">
|
<el-input v-model="form.name" placeholder="请输入员工姓名" />
|
||||||
<el-input v-model="form.code" placeholder="请输入员工编号" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
<el-form-item label="手机号" prop="phone">
|
<el-col :span="4"> </el-col>
|
||||||
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
<el-col :span="10">
|
||||||
</el-form-item>
|
<el-form-item label="员工编号" prop="code">
|
||||||
<el-form-item label="员工账号" prop="account">
|
<el-input v-model="form.code" placeholder="请输入员工编号" />
|
||||||
<el-input v-model="form.account" placeholder="请输入员工账号,建议使用手机号" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
<el-form-item label="登录密码">
|
</el-row>
|
||||||
<el-input type="password" v-model="form.password" placeholder="请输入登录密码,不填默认123456" />
|
<el-row>
|
||||||
</el-form-item>
|
<el-col :span="10">
|
||||||
<el-form-item label="优惠类型">
|
<el-form-item label="手机号" prop="phone">
|
||||||
<el-radio-group v-model="form.discountType" @change="form.maxDiscountAmount = 0">
|
<el-input v-model="form.phone" placeholder="请输入手机号" />
|
||||||
<el-radio-button label="1">折扣</el-radio-button>
|
</el-form-item>
|
||||||
<el-radio-button label="0">金额</el-radio-button>
|
</el-col>
|
||||||
</el-radio-group>
|
<el-col :span="4"> </el-col>
|
||||||
</el-form-item>
|
<el-col :span="10"> <el-form-item label="员工账号" prop="account">
|
||||||
<el-form-item label="最大优惠金额" v-if="form.discountType == 0">
|
<el-input v-model="form.account" placeholder="请输入员工账号,建议使用手机号" />
|
||||||
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0" :max="100000"
|
</el-form-item>
|
||||||
:step="0.1" style="width: 200px;"></el-input-number>
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
<el-form-item label="最低优惠折扣" v-if="form.discountType == 1">
|
<el-row>
|
||||||
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0" :max="0.99"
|
<el-col :span="10"> <el-form-item label="登录密码">
|
||||||
:step="0.1" style="width: 200px;"></el-input-number>
|
<el-input type="password" v-model="form.password" placeholder="请输入登录密码,不填默认123456" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色" prop="roleId">
|
</el-col>
|
||||||
<el-select v-model="form.roleId" placeholder="请选择角色">
|
<el-col :span="4"> </el-col>
|
||||||
<el-option :label="item.name" :value="item.id" v-for="item in roles" :key="item.id"></el-option>
|
<el-col :span="10">
|
||||||
</el-select>
|
<el-form-item label="优惠类型">
|
||||||
</el-form-item>
|
<el-radio-group v-model="form.discountType" @change="form.maxDiscountAmount = 0">
|
||||||
<el-form-item label="允许登录PC桌面端">
|
<el-radio-button label="1">折扣</el-radio-button>
|
||||||
<el-switch v-model="form.isPc" :active-value="1" :inactive-value="0"></el-switch>
|
<el-radio-button label="0">金额</el-radio-button>
|
||||||
</el-form-item>
|
</el-radio-group>
|
||||||
<el-form-item label="允许登录管理端">
|
</el-form-item>
|
||||||
<el-switch v-model="form.isManage" :active-value="1" :inactive-value="0"></el-switch>
|
</el-col>
|
||||||
</el-form-item>
|
</el-row>
|
||||||
<el-form-item label="是否启用">
|
|
||||||
<el-switch v-model="form.status" :active-value="1" :inactive-value="0"></el-switch>
|
<el-row>
|
||||||
</el-form-item>
|
<el-col :span="10">
|
||||||
|
<el-form-item label="最大优惠金额" v-if="form.discountType == 0">
|
||||||
|
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0"
|
||||||
|
:max="100000" :step="0.1" style="width: 200px;"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最低优惠折扣" v-if="form.discountType == 1">
|
||||||
|
<el-input-number v-model="form.maxDiscountAmount" controls-position="right" :min="0" :max="0.99"
|
||||||
|
:step="0.1" style="width: 200px;"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4"> </el-col>
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-form-item label="角色" prop="roleId">
|
||||||
|
<el-select v-model="form.roleId" placeholder="请选择角色">
|
||||||
|
<el-option :label="item.name" :value="item.id" v-for="item in roles"
|
||||||
|
:key="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<h3 style="color: #3F9EFF;">
|
||||||
|
员工权限设置
|
||||||
|
</h3>
|
||||||
|
<div v-for="item in form.permissions" :key="item.id">
|
||||||
|
<h4>{{ item.label }}</h4>
|
||||||
|
<el-checkbox v-for="ele in item.children" :true-label="1" :false-label="0" v-model="ele.hasPermission"
|
||||||
|
:key="ele.id" :label="ele.label"></el-checkbox>
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
@@ -53,7 +83,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { tbPlussShopStaff, rolesGet, tbPlussShopStaffDetail } from '@/api/shop.js'
|
import { tbPlussShopStaff, rolesGet, tbPlussShopStaffDetail, tbShopPermissionlist } from '@/api/shop.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -64,14 +94,15 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
code: '',
|
code: '',
|
||||||
account: '',
|
account: '',
|
||||||
discountType: '1',
|
discountType: '',
|
||||||
maxDiscountAmount: '',
|
maxDiscountAmount: '',
|
||||||
status: 1,
|
status: 1,
|
||||||
isPc: 1,
|
isPc: 1,
|
||||||
isManage: 1,
|
isManage: 1,
|
||||||
roleId: '',
|
roleId: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
password: ''
|
password: '',
|
||||||
|
checkList: ['选中且禁用', '复选框 A']
|
||||||
},
|
},
|
||||||
resetForm: '',
|
resetForm: '',
|
||||||
rules: {
|
rules: {
|
||||||
@@ -126,6 +157,7 @@ export default {
|
|||||||
return this.form.id ? '编辑员工' : '添加员工'
|
return this.form.id ? '编辑员工' : '添加员工'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.resetForm = { ...this.form }
|
this.resetForm = { ...this.form }
|
||||||
this.rolesGet()
|
this.rolesGet()
|
||||||
@@ -137,6 +169,9 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
if (this.form.id) {
|
||||||
|
this.form.staff_id = this.form.id
|
||||||
|
}
|
||||||
await tbPlussShopStaff(this.form)
|
await tbPlussShopStaff(this.form)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
@@ -174,9 +209,15 @@ export default {
|
|||||||
// this.form = { ...row }
|
// this.form = { ...row }
|
||||||
this.tbPlussShopStaffDetail(row.id)
|
this.tbPlussShopStaffDetail(row.id)
|
||||||
} else {
|
} else {
|
||||||
this.reset()
|
// this.reset()
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 获取员工信息
|
||||||
|
async getList() {
|
||||||
|
const res = await tbShopPermissionlist()
|
||||||
|
this.$set(this.form, 'permissions', res)
|
||||||
|
},
|
||||||
// 通过id获取员工信息
|
// 通过id获取员工信息
|
||||||
async tbPlussShopStaffDetail(id) {
|
async tbPlussShopStaffDetail(id) {
|
||||||
try {
|
try {
|
||||||
@@ -188,4 +229,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style>
|
||||||
|
el-dialog {
|
||||||
|
padding-top: 6vh !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -13,7 +13,9 @@
|
|||||||
label-position="left"
|
label-position="left"
|
||||||
>
|
>
|
||||||
<el-form-item label="选择区域" prop="areaId">
|
<el-form-item label="选择区域" prop="areaId">
|
||||||
<el-select v-model="form.areaId" placeholder="请选择区域">
|
<el-select v-model="form.areaId" placeholder="请选择区域"
|
||||||
|
@change="selectChange($event, 'form' , 'areaId')"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
@@ -32,7 +34,7 @@
|
|||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="台桌标识" >
|
<el-form-item label="台桌标识" prop="sign">
|
||||||
<div class="u-flex">
|
<div class="u-flex">
|
||||||
<div class="u-flex" style="width: 57px;">
|
<div class="u-flex" style="width: 57px;">
|
||||||
<el-input
|
<el-input
|
||||||
@@ -155,14 +157,14 @@ export default {
|
|||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择区域",
|
message: "请选择区域",
|
||||||
trigger: "blur",
|
trigger: ["blur","change"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sign: [
|
sign: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入台桌标识",
|
message: "请输入台桌标识",
|
||||||
trigger: "blur",
|
trigger: ["blur","change"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -173,6 +175,10 @@ export default {
|
|||||||
this.resetForm = { ...this.form };
|
this.resetForm = { ...this.form };
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//解决selectc值改变后未验证问题
|
||||||
|
selectChange($event, ref, type) {
|
||||||
|
this.$refs[ref][0].validateField(type)
|
||||||
|
},
|
||||||
onSubmitHandle() {
|
onSubmitHandle() {
|
||||||
this.$refs.form.validate(async (valid) => {
|
this.$refs.form.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ export default {
|
|||||||
this.number = newval;
|
this.number = newval;
|
||||||
},
|
},
|
||||||
number(newval) {
|
number(newval) {
|
||||||
console.log(newval);
|
|
||||||
this.$emit("input", newval);
|
this.$emit("input", newval);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -53,13 +53,10 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
number(newval) {
|
number(newval) {
|
||||||
console.log(newval)
|
|
||||||
console.log(this.max)
|
|
||||||
if (newval >this.max) {
|
if (newval >this.max) {
|
||||||
this.number = this.max;
|
this.number = this.max;
|
||||||
this.$message("最多只能选择"+this.max+"位就餐人数");
|
this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||||
}
|
}
|
||||||
console.log(newval);
|
|
||||||
// 使用正则表达式匹配正整数
|
// 使用正则表达式匹配正整数
|
||||||
const regex = /^[1-9]\d*$/;
|
const regex = /^[1-9]\d*$/;
|
||||||
// 如果输入的值不是正整数,则将其设置为上一个有效值
|
// 如果输入的值不是正整数,则将其设置为上一个有效值
|
||||||
@@ -76,14 +73,13 @@ export default {
|
|||||||
this.number = "";
|
this.number = "";
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
console.log(this.number)
|
|
||||||
console.log(this.max)
|
|
||||||
if (this.number >this.max) {
|
if (this.number >this.max) {
|
||||||
return this.$message("最多只能选择"+this.max+"位就餐人数");
|
return this.$message("最多只能选择"+this.max+"位就餐人数");
|
||||||
}
|
}
|
||||||
if (!this.number) {
|
if (!this.number) {
|
||||||
return this.$message("请选择就餐人数");
|
return this.$message("请选择就餐人数");
|
||||||
}
|
}
|
||||||
|
console.log(this.number)
|
||||||
this.$emit("confirm", this.number);
|
this.$emit("confirm", this.number);
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
<div class="el-dialog__title" style="margin-right: 10px">
|
<div class="el-dialog__title" style="margin-right: 10px">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown @command="changePostPay">
|
<!-- 先付后付start -->
|
||||||
|
<!-- <el-dropdown @command="changePostPay">
|
||||||
<el-button plain type="primary" size="mini">
|
<el-button plain type="primary" size="mini">
|
||||||
{{ postPay ? "后付费" : "先付费" }}
|
{{ postPay ? "后付费" : "先付费" }}
|
||||||
<i class="el-icon-caret-bottom"></i>
|
<i class="el-icon-caret-bottom"></i>
|
||||||
@@ -21,7 +22,11 @@
|
|||||||
<el-dropdown-item :command="false">先付费</el-dropdown-item>
|
<el-dropdown-item :command="false">先付费</el-dropdown-item>
|
||||||
<el-dropdown-item :command="true">后付费</el-dropdown-item>
|
<el-dropdown-item :command="true">后付费</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown> -->
|
||||||
|
<el-button plain type="primary" size="mini">
|
||||||
|
{{ postPay ? "后付费" : "先付费" }}
|
||||||
|
</el-button>
|
||||||
|
<!-- 先付后付end -->
|
||||||
<span
|
<span
|
||||||
@click="toggleFullScreen"
|
@click="toggleFullScreen"
|
||||||
class="flex flex-xy-center cur-pointer full-screen"
|
class="flex flex-xy-center cur-pointer full-screen"
|
||||||
@@ -173,6 +178,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="u-m-l-20 u-p-b-10 meal_box">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button
|
||||||
|
:class="{ active: item.value == useTypes.sel }"
|
||||||
|
:disabled="order.old.list.length > 0"
|
||||||
|
v-for="(item, index) in useTypes.list"
|
||||||
|
@click="changeUseType(item.value)"
|
||||||
|
:key="index"
|
||||||
|
>{{ item.name }}</el-button
|
||||||
|
>
|
||||||
|
</el-button-group>
|
||||||
|
</div>
|
||||||
<div class="flex row-between table-list u-m-l-20">
|
<div class="flex row-between table-list u-m-l-20">
|
||||||
<!-- <div class="tableId" @click="chooseTableOpen"> -->
|
<!-- <div class="tableId" @click="chooseTableOpen"> -->
|
||||||
<el-popover
|
<el-popover
|
||||||
@@ -203,15 +220,27 @@
|
|||||||
|
|
||||||
<div class="u-flex">
|
<div class="u-flex">
|
||||||
<div class="u-p-r-14 border-r u-m-r-14">
|
<div class="u-p-r-14 border-r u-m-r-14">
|
||||||
<div
|
<template v-if="!shopInfo.isTableFee">
|
||||||
class="u-flex cur-pointer"
|
<div
|
||||||
@click="refToggle('refChooseDinersNumber', true, perpole)"
|
class="u-flex cur-pointer"
|
||||||
>
|
@click="
|
||||||
<span>就餐人数:{{ perpole }}位</span>
|
refToggle('refChooseDinersNumber', true, perpole)
|
||||||
<span
|
"
|
||||||
class="el-icon-arrow-right diningPeople_cell_arrow"
|
>
|
||||||
></span>
|
<span>就餐人数:{{ perpole }}位</span>
|
||||||
</div>
|
<span
|
||||||
|
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="u-flex">
|
||||||
|
<span>就餐人数:-位</span>
|
||||||
|
<span
|
||||||
|
class="el-icon-arrow-right diningPeople_cell_arrow"
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<el-button
|
<el-button
|
||||||
@click="clearCart"
|
@click="clearCart"
|
||||||
@@ -1071,6 +1100,8 @@ import chooseDinersNumber from "./table-diancan-components/choose-diners-number.
|
|||||||
import returnCart from "./table-diancan-components/return-cart.vue";
|
import returnCart from "./table-diancan-components/return-cart.vue";
|
||||||
import moneyKeyboard from "./money-keyboard.vue";
|
import moneyKeyboard from "./money-keyboard.vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import { tbShopInfo } from "@/api/user";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getGoodsLists,
|
getGoodsLists,
|
||||||
addCart,
|
addCart,
|
||||||
@@ -1090,7 +1121,8 @@ import {
|
|||||||
$choseCount,
|
$choseCount,
|
||||||
$returnCart,
|
$returnCart,
|
||||||
$printOrder,
|
$printOrder,
|
||||||
tbShopTableGet
|
tbShopTableGet,
|
||||||
|
$changeUseType,
|
||||||
} from "@/api/table";
|
} from "@/api/table";
|
||||||
import { tbShopCategoryGet } from "@/api/shop";
|
import { tbShopCategoryGet } from "@/api/shop";
|
||||||
import {
|
import {
|
||||||
@@ -1115,6 +1147,22 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//店铺信息
|
||||||
|
shopInfo: {},
|
||||||
|
//就餐饭方式
|
||||||
|
useTypes: {
|
||||||
|
list: [
|
||||||
|
{
|
||||||
|
name: "堂食",
|
||||||
|
value: "dine-in",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "自取",
|
||||||
|
value: "takeout",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
sel: "dine-in",
|
||||||
|
},
|
||||||
//台桌列表
|
//台桌列表
|
||||||
tableList: [],
|
tableList: [],
|
||||||
tableShow: false,
|
tableShow: false,
|
||||||
@@ -1179,7 +1227,7 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
seatFee:{totalAmount:0},//餐位费
|
seatFee: { totalAmount: 0 }, //餐位费
|
||||||
orderId: "",
|
orderId: "",
|
||||||
payType: "",
|
payType: "",
|
||||||
masterId: "",
|
masterId: "",
|
||||||
@@ -1218,7 +1266,7 @@ export default {
|
|||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 20,
|
size: 200,
|
||||||
},
|
},
|
||||||
number: 1,
|
number: 1,
|
||||||
cacheNumber: 1,
|
cacheNumber: 1,
|
||||||
@@ -1318,7 +1366,7 @@ export default {
|
|||||||
allPrice() {
|
allPrice() {
|
||||||
const oldPrice = this.order.old.list.reduce((a, b) => {
|
const oldPrice = this.order.old.list.reduce((a, b) => {
|
||||||
const bTotal = b.info
|
const bTotal = b.info
|
||||||
.filter((v) => v.isGift !== "true"&& v.status !== "return")
|
.filter((v) => v.isGift !== "true" && v.status !== "return")
|
||||||
.reduce((prve, cur) => {
|
.reduce((prve, cur) => {
|
||||||
return prve + cur.number * cur.salePrice;
|
return prve + cur.number * cur.salePrice;
|
||||||
}, 0);
|
}, 0);
|
||||||
@@ -1329,7 +1377,7 @@ export default {
|
|||||||
.reduce((a, b) => {
|
.reduce((a, b) => {
|
||||||
return a + b.number * b.salePrice;
|
return a + b.number * b.salePrice;
|
||||||
}, 0);
|
}, 0);
|
||||||
return (oldPrice + price+this.order.seatFee.totalAmount*1).toFixed(2);
|
return (oldPrice + price + this.order.seatFee.totalAmount * 1).toFixed(2);
|
||||||
},
|
},
|
||||||
allNumber() {
|
allNumber() {
|
||||||
const oldNumber = this.order.old.list.reduce((a, b) => {
|
const oldNumber = this.order.old.list.reduce((a, b) => {
|
||||||
@@ -1374,8 +1422,13 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
perpole(newval,oldval) {
|
"useTypes.sel": function (newval, oldval) {
|
||||||
if (!oldval&&newval&&this.table.tableId) {
|
console.log(newval);
|
||||||
|
this.setPostPay();
|
||||||
|
this.setUseType();
|
||||||
|
},
|
||||||
|
perpole(newval, oldval) {
|
||||||
|
if (!oldval && newval && this.table.tableId) {
|
||||||
// $choseCount({
|
// $choseCount({
|
||||||
// masterId: this.masterId,
|
// masterId: this.masterId,
|
||||||
// tableId: this.table.tableId,
|
// tableId: this.table.tableId,
|
||||||
@@ -1386,9 +1439,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
table(oldval, newval) {
|
table(oldval, newval) {
|
||||||
if(oldval&&newval) {
|
if (oldval && newval) {
|
||||||
this.onTableChange()
|
this.onTableChange();
|
||||||
}
|
}
|
||||||
// if (oldval && newval) {
|
// if (oldval && newval) {
|
||||||
// console.log(oldval, newval);
|
// console.log(oldval, newval);
|
||||||
// $choseTable({
|
// $choseTable({
|
||||||
@@ -1407,8 +1460,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vipUser.id": async function (val) {
|
"vipUser.id": async function (val) {
|
||||||
if(!this.table.tableId){
|
if (!this.table.tableId) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
let masterId = this.order.masterId;
|
let masterId = this.order.masterId;
|
||||||
if (!masterId) {
|
if (!masterId) {
|
||||||
@@ -1533,17 +1586,69 @@ export default {
|
|||||||
// this.getCategory();
|
// this.getCategory();
|
||||||
// this.refToggle('refScanCode',true)
|
// this.refToggle('refScanCode',true)
|
||||||
// this.refToggle("refDiscount", true);
|
// this.refToggle("refDiscount", true);
|
||||||
|
this.getShopInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeOrderUseType(useType) {
|
||||||
|
if (useType && this.order.list.length) {
|
||||||
|
$changeUseType({
|
||||||
|
useType,
|
||||||
|
cartIds: this.order.list.map((v) => v.id),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//设置用餐类型
|
||||||
|
setUseType() {
|
||||||
|
// 自取
|
||||||
|
let useType = "takeout";
|
||||||
|
if (this.useTypes.sel == "takeout") {
|
||||||
|
localStorage.setItem("useType", "takeout");
|
||||||
|
} else {
|
||||||
|
//堂食
|
||||||
|
useType = `dine-in-${this.postPay ? "after" : "before"}`;
|
||||||
|
localStorage.setItem("useType", useType);
|
||||||
|
}
|
||||||
|
this.changeOrderUseType(useType);
|
||||||
|
},
|
||||||
|
//设置先付后付
|
||||||
|
setPostPay() {
|
||||||
|
// 自取
|
||||||
|
// postPay true 后付 false 先付
|
||||||
|
|
||||||
|
if (this.useTypes.sel == "takeout") {
|
||||||
|
this.postPay = false;
|
||||||
|
} else {
|
||||||
|
//munchies 先付 restaurant 后付
|
||||||
|
this.postPay = this.shopInfo.registerType == "munchies" ? false : true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//获取店铺信息
|
||||||
|
async getShopInfo() {
|
||||||
|
try {
|
||||||
|
const shopId = localStorage.getItem("shopId");
|
||||||
|
const res = await tbShopInfo(shopId);
|
||||||
|
this.shopInfo = res;
|
||||||
|
this.setPostPay();
|
||||||
|
this.setUseType();
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
//更改就餐方式
|
||||||
|
changeUseType(type) {
|
||||||
|
if (this.order.old.list.length > 0) {
|
||||||
|
return this.$message("下单后不支持更改就餐方式");
|
||||||
|
}
|
||||||
|
console.log(type);
|
||||||
|
this.useTypes.sel = type;
|
||||||
|
},
|
||||||
//更改就餐人数
|
//更改就餐人数
|
||||||
changePerpole(){
|
changePerpole() {
|
||||||
$choseCount({
|
$choseCount({
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
num: this.perpole,
|
num: this.perpole,
|
||||||
}).then(res=>{
|
}).then((res) => {
|
||||||
this.order.seatFee=res
|
this.order.seatFee = res;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//台桌变化时重新获取取餐号、购物车数据,如果是正在结账状态,创建订单到待支付页面
|
//台桌变化时重新获取取餐号、购物车数据,如果是正在结账状态,创建订单到待支付页面
|
||||||
async onTableChange() {
|
async onTableChange() {
|
||||||
@@ -1555,11 +1660,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取台桌详情
|
// 获取台桌详情
|
||||||
async getTableDetail(){
|
async getTableDetail() {
|
||||||
const res=await tbShopTableGet({
|
const res = await tbShopTableGet({
|
||||||
qrcode:this.table.tableId
|
qrcode: this.table.tableId,
|
||||||
})
|
});
|
||||||
console.log(res)
|
console.log(res);
|
||||||
},
|
},
|
||||||
//打印制作单
|
//打印制作单
|
||||||
printOrder() {
|
printOrder() {
|
||||||
@@ -1587,7 +1692,7 @@ export default {
|
|||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
});
|
});
|
||||||
this.order.selGoods.status = "return";
|
this.order.selGoods.status = "return";
|
||||||
this.order.old.selIndex=-1;
|
this.order.old.selIndex = -1;
|
||||||
console.log(this.order.selGoods);
|
console.log(this.order.selGoods);
|
||||||
},
|
},
|
||||||
// 台桌列表
|
// 台桌列表
|
||||||
@@ -1596,7 +1701,7 @@ export default {
|
|||||||
const { content, total } = await tbShopTableGet({
|
const { content, total } = await tbShopTableGet({
|
||||||
shopId: localStorage.getItem("shopId"),
|
shopId: localStorage.getItem("shopId"),
|
||||||
});
|
});
|
||||||
this.tableList = content.filter(v=>v.status!='closed');
|
this.tableList = content.filter((v) => v.status != "closed");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
@@ -1607,8 +1712,7 @@ export default {
|
|||||||
},
|
},
|
||||||
chooseDinersNumberConfirm(e) {
|
chooseDinersNumberConfirm(e) {
|
||||||
this.perpole = e;
|
this.perpole = e;
|
||||||
this.changePerpole()
|
this.changePerpole();
|
||||||
|
|
||||||
},
|
},
|
||||||
//扫码支付弹窗确认
|
//扫码支付弹窗确认
|
||||||
scanPayConfirm(code) {
|
scanPayConfirm(code) {
|
||||||
@@ -1794,6 +1898,8 @@ export default {
|
|||||||
},
|
},
|
||||||
//生成订单
|
//生成订单
|
||||||
toCreateOrderDebounce(isNowPay) {
|
toCreateOrderDebounce(isNowPay) {
|
||||||
|
console.log(this.createOrder.status);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.createOrder.status != "" &&
|
this.createOrder.status != "" &&
|
||||||
this.createOrder.status != "success"
|
this.createOrder.status != "success"
|
||||||
@@ -1806,7 +1912,9 @@ export default {
|
|||||||
async toCreateOrder(isNowPay = false) {
|
async toCreateOrder(isNowPay = false) {
|
||||||
console.log(this.order);
|
console.log(this.order);
|
||||||
console.log(this.order.orderId);
|
console.log(this.order.orderId);
|
||||||
const res = await $createOrder({
|
let res=''
|
||||||
|
try {
|
||||||
|
res = await $createOrder({
|
||||||
masterId: this.order.masterId || this.masterId,
|
masterId: this.order.masterId || this.masterId,
|
||||||
vipUserId: this.vipUser.id,
|
vipUserId: this.vipUser.id,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
@@ -1814,6 +1922,13 @@ export default {
|
|||||||
postPay: this.postPay,
|
postPay: this.postPay,
|
||||||
orderld: this.order.orderId,
|
orderld: this.order.orderId,
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if(!res){
|
||||||
|
this.createOrder.status = "success";
|
||||||
|
return
|
||||||
|
}
|
||||||
//后付款
|
//后付款
|
||||||
console.log(this.postPay);
|
console.log(this.postPay);
|
||||||
console.log(isNowPay);
|
console.log(isNowPay);
|
||||||
@@ -2394,7 +2509,7 @@ export default {
|
|||||||
.filter((v) => v.specSnap.match(i))
|
.filter((v) => v.specSnap.match(i))
|
||||||
.every((v) => {
|
.every((v) => {
|
||||||
// return isCanBuy(v,this.selGoods.data.isStock)
|
// return isCanBuy(v,this.selGoods.data.isStock)
|
||||||
return isCanBuy(v);
|
return !isCanBuy(v);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2443,7 +2558,7 @@ export default {
|
|||||||
this.order.selPlaceNum = -1;
|
this.order.selPlaceNum = -1;
|
||||||
this.order.old.list = [];
|
this.order.old.list = [];
|
||||||
this.order.selGoods = "";
|
this.order.selGoods = "";
|
||||||
this.order.seatFee={totalAmount:0}//餐位费
|
this.order.seatFee = { totalAmount: 0 }; //餐位费
|
||||||
this.prveOrder.list = [];
|
this.prveOrder.list = [];
|
||||||
this.prveOrder.selIndex = -1;
|
this.prveOrder.selIndex = -1;
|
||||||
this.order.old.selIndex = -1;
|
this.order.old.selIndex = -1;
|
||||||
@@ -2461,21 +2576,22 @@ export default {
|
|||||||
this.key = "";
|
this.key = "";
|
||||||
this.order.orderId = "";
|
this.order.orderId = "";
|
||||||
this.perpole = "";
|
this.perpole = "";
|
||||||
|
this.useTypes.sel = "dine-in";
|
||||||
},
|
},
|
||||||
//获取购物车数据
|
//获取购物车数据
|
||||||
async getCart() {
|
async getCart() {
|
||||||
console.log(this.table)
|
console.log(this.table);
|
||||||
const res = await getCart({
|
const res = await getCart({
|
||||||
...this.order.query,
|
...this.order.query,
|
||||||
masterId: this.masterId,
|
masterId: this.masterId,
|
||||||
tableId: this.table.tableId,
|
tableId: this.table.tableId,
|
||||||
});
|
});
|
||||||
this.order.seatFee=res.seatFee?res.seatFee:this.order.seatFee;
|
this.order.seatFee = res.seatFee ? res.seatFee : this.order.seatFee;
|
||||||
this.perpole=res.seatFee?res.seatFee.totalNumber:1;
|
this.perpole = res.seatFee ? res.seatFee.totalNumber : 1;
|
||||||
const nowCart=res.records.find((v) => v.placeNum == 0);
|
const nowCart = res.records.find((v) => v.placeNum == 0);
|
||||||
this.order.list=nowCart?nowCart.info:[];
|
this.order.list = nowCart ? nowCart.info : [];
|
||||||
const oldCart=res.records.filter((v) => v.placeNum != 0);
|
const oldCart = res.records.filter((v) => v.placeNum != 0);
|
||||||
this.order.old.list=oldCart?oldCart:[];
|
this.order.old.list = oldCart ? oldCart : [];
|
||||||
// if (this.key|| res.records.length) {
|
// if (this.key|| res.records.length) {
|
||||||
// this.order.old.list = res.records;
|
// this.order.old.list = res.records;
|
||||||
// } else {
|
// } else {
|
||||||
@@ -2723,6 +2839,10 @@ export default {
|
|||||||
},
|
},
|
||||||
async open(item, key, perpoleNumber) {
|
async open(item, key, perpoleNumber) {
|
||||||
this.table = item;
|
this.table = item;
|
||||||
|
if(item.useType){
|
||||||
|
localStorage.setItem("useType",item.useType);
|
||||||
|
this.useTypes.sel = item.useType=='takeout'?item.useType:item.useType.replace(/-after|-before/g,'');
|
||||||
|
}
|
||||||
this.key = key;
|
this.key = key;
|
||||||
if (this.key == "isPayOrder") {
|
if (this.key == "isPayOrder") {
|
||||||
this.isCreateOrder = true;
|
this.isCreateOrder = true;
|
||||||
@@ -2738,7 +2858,17 @@ export default {
|
|||||||
// if(this.key!=='isPayOrder'){
|
// if(this.key!=='isPayOrder'){
|
||||||
// this.getCart();
|
// this.getCart();
|
||||||
// }
|
// }
|
||||||
this.changePerpole()
|
// this.changePerpole()
|
||||||
|
|
||||||
|
if (!this.shopInfo.isTableFee) {
|
||||||
|
//不免餐位费
|
||||||
|
await $choseCount({
|
||||||
|
masterId: this.masterId,
|
||||||
|
tableId: this.table.tableId,
|
||||||
|
num: this.perpole,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.getCart();
|
this.getCart();
|
||||||
this.getGoods();
|
this.getGoods();
|
||||||
this.getCategory();
|
this.getCategory();
|
||||||
@@ -2822,6 +2952,19 @@ input[type="number"]::-webkit-outer-spin-button {
|
|||||||
::v-deep .el-button--text {
|
::v-deep .el-button--text {
|
||||||
// color: #000;
|
// color: #000;
|
||||||
}
|
}
|
||||||
|
::v-deep .meal_box .el-button-group {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
::v-deep .meal_box .el-button-group .el-button {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
::v-deep .meal_box .el-button-group .active {
|
||||||
|
border: 1px solid #409eff !important;
|
||||||
|
color: #409eff !important;
|
||||||
|
background: rgba(24, 144, 255, 0.1) !important;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
::v-deep .number-box .el-input__inner {
|
::v-deep .number-box .el-input__inner {
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0 4px;
|
padding: 0 4px;
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ import downloadTableCode from "./components/downloadTableCode";
|
|||||||
import tableDiancan from "./components/table-diancan.vue";
|
import tableDiancan from "./components/table-diancan.vue";
|
||||||
import $status from "./status.js";
|
import $status from "./status.js";
|
||||||
import chooseDinersNumber from "./components/table-diancan-components/choose-diners-number.vue";
|
import chooseDinersNumber from "./components/table-diancan-components/choose-diners-number.vue";
|
||||||
|
import { tbShopInfo } from "@/api/user";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
tbShopTableGet,
|
tbShopTableGet,
|
||||||
@@ -251,10 +252,13 @@ export default {
|
|||||||
status: $status,
|
status: $status,
|
||||||
selTable: "", //当前选中的桌台
|
selTable: "", //当前选中的桌台
|
||||||
areaMap: {},
|
areaMap: {},
|
||||||
|
shopInfo:{},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.tbShopAreaGet();
|
this.tbShopAreaGet();
|
||||||
|
this.getShopInfo()
|
||||||
|
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
formatTime(time) {
|
formatTime(time) {
|
||||||
@@ -262,6 +266,15 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//获取店铺信息
|
||||||
|
async getShopInfo() {
|
||||||
|
try {
|
||||||
|
const shopId = localStorage.getItem("shopId");
|
||||||
|
const res = await tbShopInfo(shopId);
|
||||||
|
this.shopInfo=res
|
||||||
|
console.log(res)
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
// 清台
|
// 清台
|
||||||
cleanTableHandle(item) {
|
cleanTableHandle(item) {
|
||||||
this.$confirm("确定要清台:"+item.name, "提示", {
|
this.$confirm("确定要清台:"+item.name, "提示", {
|
||||||
@@ -308,6 +321,11 @@ export default {
|
|||||||
//key isAddGoods 加菜
|
//key isAddGoods 加菜
|
||||||
//key isPayOrder结账
|
//key isPayOrder结账
|
||||||
this.selTable = item;
|
this.selTable = item;
|
||||||
|
if(this.shopInfo.isTableFee){
|
||||||
|
//免餐位费
|
||||||
|
this.$refs.diancan.open(item, key, '');
|
||||||
|
return
|
||||||
|
}
|
||||||
const num = item.useNum || 0;
|
const num = item.useNum || 0;
|
||||||
if (item.useNum <= 0) {
|
if (item.useNum <= 0) {
|
||||||
return this.$refs.refChooseDinersNumber.open();
|
return this.$refs.refChooseDinersNumber.open();
|
||||||
|
|||||||
Reference in New Issue
Block a user