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