区域食堂档口模块对接

This commit is contained in:
zzyuan 2025-04-08 14:31:46 +08:00
parent 6bdc71dbc2
commit d282f90aba
6 changed files with 34 additions and 945 deletions

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 系统区域权限
// 区域树
export function systemAreaTreeApi(query) {
return request({
url: '/smart-canteen/alloc_area/areaTree',
@ -22,18 +22,6 @@ export function getAreaListApi(query) {
params: query
})
}
// 集团版--权限 区域=>食堂/超市=>档口 树
export function tenantGroupAreaTreeApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/tenant-group-area/tree',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 新增区域
export function addAreaApi(data) {

View File

@ -52,45 +52,11 @@ export function removeCanteenApi(canteenIds) {
"merchant-id":"378915229716713472",
}
})
}
// 查询餐次时段列表
export function getMealtimeListApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/mealtime/list-by-param',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改食堂 是否支持预订餐
export function changeIfReserveApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/modify-canteen-if-reserve',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改食堂/档口 营业状态
export function changeBusinessStateApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/modify-business-state',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -154,44 +154,7 @@ export function queryCustJobPageApi(data) {
data: data
})
}
// 查询餐次时段列表
export function getMealtimeListApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/mealtime/list-by-param',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改档口 是否支持预订餐
export function changeIfReserveApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/modify-stall-if-reserve',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改档口/档口 营业状态
export function changeBusinessStateApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/modify-business-state',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -112,7 +112,6 @@
</el-table-column>
<el-table-column label="区域名称" align="center" key="areaName" prop="areaName" show-overflow-tooltip/>
<el-table-column label="区域描述" align="center" key="areaDescribe" prop="areaDescribe" show-overflow-tooltip/>
<!-- <el-table-column label="上级区域" align="center" key="parentName" prop="parentName" show-overflow-tooltip/> -->
<el-table-column label="联系人" align="center" key="director" prop="director" show-overflow-tooltip/>
<el-table-column label="联系方式" align="center" key="contactTel" prop="contactTel" show-overflow-tooltip/>
<el-table-column label="创建时间" align="center" key="createTime" prop="createTime" show-overflow-tooltip/>
@ -226,7 +225,6 @@
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { systemAreaTreeApi,getAreaListApi,addAreaApi,updateAreaApi,removeAreaApi } from "@/api/base/area";
// import { imgUpLoad } from "@/api/system/upload";
export default {
name: "ToolsType",

View File

@ -54,32 +54,7 @@
<template slot-scope="scope">
{{ scope.row.startBusinessTime }}-{{ scope.row.endBusinessTime }}
</template>
</el-table-column>
<el-table-column label="预订餐" align="center" prop="ifReserve" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.ifReserve"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2"
@change="changeIfReserve(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<!-- <el-table-column label="报餐" align="center" prop="ifBook" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.ifBook"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2"
>
</el-switch>
</template>
</el-table-column> -->
<el-table-column label="食堂图片" align="center" prop="imgUrl">
<template slot-scope="scope">
<img :src="scope.row.imgUrl" v-if="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;" @click="openImg(scope.row)">
@ -90,16 +65,6 @@
<el-table-column label="更新时间" align="center" prop="updateTime" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<!-- <el-button
size="mini"
type="text" v-if="scope.row.businessState==2"
@click="handleRest(scope.row)"
>休息</el-button>
<el-button
size="mini"
type="text" v-if="scope.row.businessState==1"
@click="handleBuss(scope.row)"
>营业</el-button> -->
<el-button
size="mini"
type="text"
@ -189,31 +154,7 @@
@input="(v)=>(baseForm.contactTel=v.replace(/[^\d]/g,''))"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否开启预订餐" prop="ifReserve" label-width="120">
<el-switch
v-model="baseForm.ifReserve"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否开启报餐" prop="ifBook">
<el-switch
v-model="baseForm.ifBook"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="食堂图片">
@ -238,200 +179,9 @@
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-row>
</el-form>
</el-tab-pane>
<!-- 支付设置 -->
<!-- <el-tab-pane label="支付设置" name="paySetting" style="height: 600px;overflow-y: auto;">
<div style="width: 100%;height: auto;">
<div>
<span style="font-weight: bold;">启用本食堂独立规则</span>
<el-switch v-model="payDTO.ifEnablePay"
active-text="开启" inactive-text="关闭"
:active-value="1" :inactive-value="2"></el-switch>
</div>
<div style="color: red;">
*提示需勾选对应的支付方式后配置方可生效只针对下层的设备生效小程序不生效
</div>
<div style="margin: 10px;">
<el-checkbox-group v-model="payTypeList" size="small">
<el-checkbox label="1" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;margin-left: 10px;">支付宝</el-checkbox>
<el-checkbox label="2" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">微信</el-checkbox>
<el-checkbox label="3" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">云闪付</el-checkbox>
<el-checkbox label="4" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">农业银行</el-checkbox>
<el-checkbox label="5" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">工商银行</el-checkbox>
<el-checkbox label="6" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">兴业银行</el-checkbox>
<el-checkbox label="7" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">建设银行</el-checkbox>
<el-checkbox label="8" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">苏州农商银行</el-checkbox>
<el-checkbox label="9" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">银联支付</el-checkbox>
<el-checkbox label="10" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">富友支付</el-checkbox>
<el-checkbox label="11" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">太仓农商行</el-checkbox>
<el-checkbox label="12" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">宁波银行</el-checkbox>
<el-checkbox label="13" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">南京银行</el-checkbox>
<el-checkbox label="14" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">无锡农商行</el-checkbox>
<el-checkbox label="15" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">扫呗支付</el-checkbox>
<el-checkbox label="16" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">甘肃农信社</el-checkbox>
</el-checkbox-group>
</div>
</div>
</el-tab-pane> -->
<!-- 配送设置 -->
<!-- <el-tab-pane label="配送设置" name="deliverySetting" style="height: 600px;overflow-y: auto;">
<div style="width: 100%;height: auto;">
<div>
<span style="font-weight: bold;">启用本食堂独立规则</span>
<el-switch v-model="deliveryModel.ifEnableDelivery"
active-text="开启" inactive-text="关闭"
:active-value="1" :inactive-value="2"></el-switch>
</div>
<div style="margin: 10px;">
<el-checkbox-group v-model="deliveriesList" size="small">
<el-checkbox label="1" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">自取堂食</el-checkbox>
<el-checkbox label="2" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">商家配送</el-checkbox>
<el-checkbox label="3" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">取餐柜配送</el-checkbox><br>
<el-checkbox label="4" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">生鲜柜配送</el-checkbox>
<el-checkbox label="5" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">自取外带</el-checkbox>
<el-checkbox label="6" border style="width: 180px;background: #e8f0ff;margin-bottom: 10px;">取餐点自取</el-checkbox>
</el-checkbox-group>
</div>
</div>
</el-tab-pane> -->
<!-- 预订/点餐/报餐设置 -->
<!-- <el-tab-pane label="预订设置" name="orderSetting" style="height: 600px;overflow-y: auto;">
<el-form ref="orderDTO" :model="orderDTO" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="启用本档口独立规则" prop="ifEnableOrder" label-width="160px">
<el-switch
v-model="orderDTO.ifEnableOrder"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="允许预定餐预定当天" prop="ifAllowReserveToday" label-width="160px">
<el-switch
v-model="orderDTO.ifAllowReserveToday"
active-text="开启"
inactive-text="关闭"
active-value="1"
inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-table :data="mealtimeList" height="400" >
<el-table-column label="餐次类型" align="center" prop="mealtimeName" width="100"/>
<el-table-column label="餐次时段" align="center" width="220">
<template slot-scope="scope">
<el-time-picker
is-range
v-model="scope.row.orderTimeList" style="width: 190px;"
range-separator="至" format="HH:mm:ss" value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" @change="changeOrderTimeList(scope.row)">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="预定餐" align="center">
<el-table-column label="预定时段" align="center" width="220">
<template slot-scope="scope">
<el-time-picker
is-range :clearable="true"
v-model="scope.row.reserveTimeList" style="width: 190px;"
range-separator="至" format="HH:mm:ss" value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" @change="changeReserveTimeList(scope.row)">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="退单截止时间" align="center" width="150">
<template slot-scope="scope">
<el-time-picker
v-model="scope.row.reserveRefundDeadline" style="width: 120px;"
placeholder="选择时间">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="自动打印时间" align="center" width="150">
<template slot-scope="scope">
<el-time-picker
v-model="scope.row.reservePrintTime" style="width: 120px;"
placeholder="选择时间">
</el-time-picker>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="当餐点餐" align="center">
<el-table-column label="点餐时段" align="center" width="220">
<template slot-scope="scope">
<el-time-picker
is-range :clearable="true"
v-model="scope.row.currTimeList" style="width: 190px;"
range-separator="至" format="HH:mm:ss" value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" @change="changeCurrTimeList(scope.row)">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="退单截止时间" align="center" width="150">
<template slot-scope="scope">
<el-time-picker
v-model="scope.row.currRefundDeadline" style="width: 120px;"
placeholder="选择时间">
</el-time-picker>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="状态" align="center" prop="ifUse" width="150">
<template slot-scope="scope">
<el-switch
v-model="scope.row.ifUse"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</template>
</el-table-column>
</el-table>
</el-row>
<div style="font-weight: bold;margin: 10px 0;">预订第二天及以后相关设置</div>
<el-row style="margin-bottom: 10px;">
<el-col :span="12">
<span>预订餐最多允许订</span><el-input style="width: 100px;margin: auto 5px;" maxlength="5" v-model="orderDTO.reserveLimitDay" @input="(v)=>(orderDTO.reserveLimitDay=v.replace(/[^\d]/g,''))"></el-input><span></span>
<el-checkbox v-model="orderDTO.ifReserveSkipHoliday" style="margin: auto 5px;" :true-label="1" :false-label="2">跳过节假日</el-checkbox>
</el-col>
<el-col :span="12">
<span>今天预订第二天餐次截止</span>
<el-time-picker
v-model="orderDTO.reserveEndTime" style="width: 120px;margin: auto 5px;" clearable
placeholder="选择时间">
</el-time-picker>
</el-col>
</el-row>
<el-row style="margin-bottom: 10px;">
<el-col :span="12">
<span>每天</span>
<el-time-picker
v-model="orderDTO.reserveRefundEndTime" style="width: 120px;margin: auto 5px;" clearable
placeholder="选择时间">
</el-time-picker>
<span>系统自动确认次日订单一经确认用户不可退</span>
</el-col>
</el-row>
</el-form>
</el-tab-pane> -->
</el-tabs>
<div slot="footer" class="dialog-footer">
@ -456,7 +206,6 @@
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getPageCanteenApi, addCanteenApi, getCanteenInfoModifyApi, updateCanteenApi, removeCanteenApi } from "@/api/base/canteen";
import { getMealtimeListApi,changeIfReserveApi,changeBusinessStateApi } from "@/api/base/canteen";
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
@ -505,10 +254,7 @@
"contactTel": "",
"director": "",
"endBusinessTime": "",
"startBusinessTime": "",
"ifBook": 2,
"ifEnablePayCode": 2,
"ifReserve": 2,
"startBusinessTime": "",
"imgUrl": "",
},//
rangeTime:["08:00:00", "18:00:00"],//
@ -532,62 +278,8 @@
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
payDTO:{
"ifEnablePay": "2",
"payMap": {},
"payTypes": ""
},//
payTypeList:[],//
deliveryModel:{//
"ifEnableDelivery": "2",
"deliveries": "",
"minDeliveryFeeOnOff": 1,
"deliveryList": [
{
"deliveryEndTime": "23:59:59",
"deliveryStartTime": "00:00:00",
"deliveryType": 2
},
{
"deliveryEndTime": "23:59:59",
"deliveryStartTime": "00:00:00",
"deliveryType": 3
},
{
"deliveryEndTime": "23:59:59",
"deliveryStartTime": "00:00:00",
"deliveryType": 4
},
{
"deliveryEndTime": "23:59:59",
"deliveryStartTime": "00:00:00",
"deliveryType": 5
},
{
"deliveryEndTime": "23:59:59",
"deliveryStartTime": "00:00:00",
"deliveryType": 6
}
],
},
deliveriesList:[],//
mealtimeList:[],//
orderDTO: {//
"bookEndTime": "",
"bookRefundEndTime": "",
"cancelBookFeeRatio": "",
"dayBeforeCancelBookChargeTime": "",
"ifAllowReserveToday": "1",
"ifBookSkipHoliday": "",
"ifEnableOrder": 2,
"ifReserveSkipHoliday": "1",
"nearDinnerCancelBookChargeHour": "2",
"reportMealLimitDay": 0,
"reserveEndTime": "",
"reserveLimitDay": 0,
"reserveRefundEndTime": ""
},
dialogImageUrl:"",//
};
},
created() {
@ -633,16 +325,6 @@
this.loading = false;
});
},
//
changeIfReserve(row){
let param = {
"canteenId": row.canteenId,
"ifReserve": row.ifReserve
}
changeIfReserveApi(param).then((response) => {
this.getList()
});
},
handleTabClick(tab, event) {
console.log(tab, event);
@ -650,8 +332,7 @@
/** 新增按钮操作 */
handleAdd() {
this.canteenId=""
this.reset();
// this.getMealtimeList()
this.reset();
this.activeName="baseSetting"
this.open = true;
this.title = "新增";
@ -665,22 +346,7 @@
reset() {
this.fileList=[]
this.checkUrlList=[]
this.baseForm = {};
// this.orderDTO = {//
// "bookEndTime": "",
// "bookRefundEndTime": "",
// "cancelBookFeeRatio": "",
// "dayBeforeCancelBookChargeTime": "",
// "ifAllowReserveToday": "1",
// "ifBookSkipHoliday": "",
// "ifEnableOrder": 2,
// "ifReserveSkipHoliday": "1",
// "nearDinnerCancelBookChargeHour": "2",
// "reportMealLimitDay": 0,
// "reserveEndTime": "",
// "reserveLimitDay": 0,
// "reserveRefundEndTime": ""
// }
this.baseForm = {};
this.rangeTime=["08:00:00", "18:00:00"]
this.resetForm("baseForm");
},
@ -700,16 +366,7 @@
this.fileList=[]
this.checkUrlList=[]
}
this.rangeTime=[response.data.startBusinessTime, response.data.endBusinessTime]
// this.deliveryModel = response.deliveryModel;
// this.orderDTO = response.orderDTO;
// this.payDTO = response.payDTO;
// this.mealtimeList = response.mealtimeList;
// this.mealtimeList.forEach(item=>{
// this.$set(item,"orderTimeList",[item.startTime,item.endTime])
// this.$set(item,"reserveTimeList",[item.reserveStartTime||'',item.reserveEndTime||''])
// this.$set(item,"currTimeList",[item.currStartTime||'',item.currEndTime||''])
// })
this.rangeTime=[response.data.startBusinessTime, response.data.endBusinessTime]
this.open = true;
this.title = "修改";
});
@ -722,35 +379,7 @@
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 休息按钮操作 */
handleRest(row) {
let param = {
"businessState": 1,
"canteenTreeType": 1,
"modifyId": row.canteenId
}
this.$modal.confirm('是否确认休息?').then(function() {
return changeBusinessStateApi(param);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
/** 营业按钮操作 */
handleBuss(row) {
let param = {
"businessState": 2,
"canteenTreeType": 1,
"modifyId": row.canteenId
}
this.$modal.confirm('是否确认营业?').then(function() {
return changeBusinessStateApi(param);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
},
/** 提交按钮 */
submitForm: function() {
console.log(this.baseForm)
@ -759,45 +388,7 @@
if (valid) {
this.baseForm.startBusinessTime=this.rangeTime[0]
this.baseForm.endBusinessTime=this.rangeTime[1]
this.baseForm.imgUrl = this.checkUrlList[0]
// let param ={
// "allocCanteen": this.baseForm,
// "payDTO": this.payDTO,
// "deliveryModel": {//
// "deliveries": "",
// "deliveryList": [
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 2
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 3
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 4
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 5
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 6
// }
// ],
// "ifEnableDelivery": "2",
// "minDeliveryFeeOnOff": 1
// },
// "orderDTO": this.orderDTO,
// "mealtimeList":this.mealtimeList
// }
this.baseForm.imgUrl = this.checkUrlList[0]
let param = this.baseForm
if (this.canteenId != "") {
param.canteenId = this.canteenId
@ -865,44 +456,7 @@
console.log(file)
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
getMealtimeList() {
getMealtimeListApi({}).then((response) => {
this.mealtimeList = response;
this.mealtimeList.forEach(item=>{
this.$set(item,"orderTimeList",[item.startTime,item.endTime])
this.$set(item,"reserveTimeList",['',''])
this.$set(item,"currTimeList",['',''])
})
});
},
changeOrderTimeList(row){
console.log(row)
row.startTime = row.orderTimeList[0]
row.endTime = row.orderTimeList[1]
},
changeReserveTimeList(row){ //item.reserveStartTime,item.reserveEndTime
console.log(row)
if(row.reserveTimeList){
row.reserveStartTime = row.reserveTimeList[0]
row.reserveEndTime = row.reserveTimeList[1]
}
},
changeCurrTimeList(row){ //item.currStartTime,item.currEndTime
console.log(row)
if(row.currTimeList){
row.currStartTime = row.currTimeList[0]
row.currEndTime = row.currTimeList[1]
}
}
}
};
</script>

View File

@ -64,20 +64,7 @@
<template slot-scope="scope">
{{ scope.row.startBusinessTime }}-{{ scope.row.endBusinessTime }}
</template>
</el-table-column>
<el-table-column label="预订餐" align="center" prop="ifReserve" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<el-switch
v-model="scope.row.ifReserve"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2"
@change="changeIfReserve(scope.row)"
>
</el-switch>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="线上流水号前缀" align="center" prop="onLineMealCodePrefix" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="线下流水号前缀" align="center" prop="offLineMealCodePrefix" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="档口图片" align="center" prop="imgUrl" width="100">
@ -85,27 +72,11 @@
<img :src="scope.row.imgUrl" v-if="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;" @click="openImg(scope.row)">
<span v-else></span>
</template>
</el-table-column>
<!-- <el-table-column label="收款码" align="center" prop="payCodeUrl" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span v-if="scope.row.payCodeUrl">未开启</span>
<span v-else>未开启</span>
</template>
</el-table-column> -->
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="更新时间" align="center" prop="updateTime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<!-- <el-button
size="mini"
type="text" v-if="scope.row.businessState==2"
@click="handleRest(scope.row)"
>休息</el-button>
<el-button
size="mini"
type="text" v-if="scope.row.businessState==1"
@click="handleBuss(scope.row)"
>营业</el-button> -->
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@ -212,42 +183,6 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否启用叫号" prop="ifUseCallNum" label-width="120">
<el-switch
v-model="baseForm.ifUseCallNum"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否开启预订餐" prop="ifReserve" label-width="120">
<el-switch
v-model="baseForm.ifReserve"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="是否开启报餐" prop="ifBook" label-width="120">
<el-switch
v-model="baseForm.ifBook"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="档口图片">
<el-upload
@ -269,162 +204,9 @@
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="12">
<el-form-item label="是否开启收款码" prop="ifEnablePayCode">
<el-switch
v-model="baseForm.ifEnablePayCode"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col> -->
</el-row>
</el-row>
</el-form>
</el-tab-pane>
<!-- 配送设置 -->
<!-- <el-tab-pane label="配送设置" name="deliverySetting" style="height: 600px;overflow-y: auto;">
</el-tab-pane> -->
<!-- 预订/点餐/报餐设置 -->
<!-- <el-tab-pane label="预订设置" name="orderSetting" style="height: 600px;overflow-y: auto;">
<el-form ref="orderDTO" :model="orderDTO" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="启用本档口独立规则" prop="ifEnableOrder" label-width="160px">
<el-switch
v-model="orderDTO.ifEnableOrder"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="允许预定餐预定当天" prop="ifAllowReserveToday" label-width="160px">
<el-switch
v-model="orderDTO.ifAllowReserveToday"
active-text="开启"
inactive-text="关闭"
active-value="1"
inactive-value="2">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-table :data="mealtimeList" height="400" >
<el-table-column label="餐次类型" align="center" prop="mealtimeName" width="100"/>
<el-table-column label="餐次时段" align="center" width="220">
<template slot-scope="scope">
<el-time-picker
is-range
v-model="scope.row.orderTimeList" style="width: 190px;"
range-separator="至" format="HH:mm:ss" value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" @change="changeOrderTimeList(scope.row)">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="预定餐" align="center">
<el-table-column label="预定时段" align="center" width="220">
<template slot-scope="scope">
<el-time-picker
is-range :clearable="true"
v-model="scope.row.reserveTimeList" style="width: 190px;"
range-separator="至" format="HH:mm:ss" value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" @change="changeReserveTimeList(scope.row)">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="退单截止时间" align="center" width="150">
<template slot-scope="scope">
<el-time-picker
v-model="scope.row.reserveRefundDeadline" style="width: 120px;"
placeholder="选择时间">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="自动打印时间" align="center" width="150">
<template slot-scope="scope">
<el-time-picker
v-model="scope.row.reservePrintTime" style="width: 120px;"
placeholder="选择时间">
</el-time-picker>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="当餐点餐" align="center">
<el-table-column label="点餐时段" align="center" width="220">
<template slot-scope="scope">
<el-time-picker
is-range :clearable="true"
v-model="scope.row.currTimeList" style="width: 190px;"
range-separator="至" format="HH:mm:ss" value-format="HH:mm:ss"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围" @change="changeCurrTimeList(scope.row)">
</el-time-picker>
</template>
</el-table-column>
<el-table-column label="退单截止时间" align="center" width="150">
<template slot-scope="scope">
<el-time-picker
v-model="scope.row.currRefundDeadline" style="width: 120px;"
placeholder="选择时间">
</el-time-picker>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="状态" align="center" prop="ifUse" width="150">
<template slot-scope="scope">
<el-switch
v-model="scope.row.ifUse"
active-text="开启"
inactive-text="关闭"
:active-value="1"
:inactive-value="2">
</el-switch>
</template>
</el-table-column>
</el-table>
</el-row>
<div style="font-weight: bold;margin: 10px 0;">预订第二天及以后相关设置</div>
<el-row style="margin-bottom: 10px;">
<el-col :span="12">
<span>预订餐最多允许订</span><el-input style="width: 100px;margin: auto 5px;" maxlength="5" v-model="orderDTO.reserveLimitDay" @input="(v)=>(orderDTO.reserveLimitDay=v.replace(/[^\d]/g,''))"></el-input><span></span>
<el-checkbox v-model="orderDTO.ifReserveSkipHoliday" style="margin: auto 5px;" :true-label="1" :false-label="2">跳过节假日</el-checkbox>
</el-col>
<el-col :span="12">
<span>今天预订第二天餐次截止</span>
<el-time-picker
v-model="orderDTO.reserveEndTime" style="width: 120px;margin: auto 5px;" clearable
placeholder="选择时间">
</el-time-picker>
</el-col>
</el-row>
<el-row style="margin-bottom: 10px;">
<el-col :span="12">
<span>每天</span>
<el-time-picker
v-model="orderDTO.reserveRefundEndTime" style="width: 120px;margin: auto 5px;" clearable
placeholder="选择时间">
</el-time-picker>
<span>系统自动确认次日订单一经确认用户不可退</span>
</el-col>
</el-row>
</el-form>
</el-tab-pane> -->
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -447,8 +229,7 @@
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getCanteenByAreaApi, getPageStallApi, getStallNumApi, addStallApi, getStallInfoModifyApi, updateStallApi, removeStallApi } from "@/api/base/stall";
import { getMealtimeListApi,changeIfReserveApi,changeBusinessStateApi,userListByRoleApi } from "@/api/base/stall";
import { getCanteenByAreaApi, getPageStallApi, addStallApi, getStallInfoModifyApi, updateStallApi, removeStallApi } from "@/api/base/stall";
import { imgUpLoadTwo } from '@/api/system/upload'
// import C from "highlight.js/lib/languages/1c";
export default {
@ -485,21 +266,16 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
areaId: undefined,
stallName: undefined,
canteenId: undefined,
areaIdList: [],
areaArr: []
canteenId: undefined
},
canteenOptions:[],//-
userOptions:[],//
canteenOptions:[],//-
activeName:"baseSetting",
areaId:"",
stallId:"",//-
stallData:{},//-
baseForm: {
"effIds": "",
"extendMap": {},
"mainProject": null,
"offLineMealCodePrefix": null,
"onLineMealCodePrefix": null,
"payCodeUrl": null,
@ -509,14 +285,8 @@ export default {
"contactTel": "",
"director": "",
"endBusinessTime": "",
"startBusinessTime": "",
"ifBook": 2,
"ifEnablePayCode": 2,
"ifReserve": 2,
"ifUseCallNum": 2,
"imgUrl": "",
"kindNameList": [],
"labelNameList": []
"startBusinessTime": "",
"imgUrl": "",
},//
rangeTime:["08:00:00", "18:00:00"],//
canteenOptions2:[],//
@ -543,24 +313,7 @@ export default {
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
deliveryModel:{},//
mealtimeList:[],//
orderDTO: {//
"bookEndTime": "",
"bookRefundEndTime": "",
"cancelBookFeeRatio": "",
"dayBeforeCancelBookChargeTime": "",
"ifAllowReserveToday": "1",
"ifBookSkipHoliday": "",
"ifEnableOrder": 2,
"ifReserveSkipHoliday": "1",
"nearDinnerCancelBookChargeHour": "2",
"reportMealLimitDay": 0,
"reserveEndTime": "",
"reserveLimitDay": 0,
"reserveRefundEndTime": ""
},
dialogImageUrl:"",//
};
},
created() {
@ -601,10 +354,9 @@ export default {
this.queryParams = {
pageNum: 1,
pageSize: 10,
areaId: undefined,
stallName: undefined,
canteenId: undefined,
areaIdList: [],
areaArr: []
canteenId: undefined
}
this.resetForm("queryForm");
this.handleQuery();
@ -617,7 +369,7 @@ export default {
"size": this.queryParams.pageSize,
"stallName": this.queryParams.stallName,
"canteenId": this.queryParams.canteenId,
"areaIdList": this.queryParams.areaIdList
"areaId": this.queryParams.areaId
}
getPageStallApi(param).then(response => {
this.tableListData = response.rows;
@ -625,28 +377,14 @@ export default {
this.loading = false;
});
},
//
changeIfReserve(row){
let param = {
"canteenId": row.canteenId,
"stallId": row.stallId,
"ifReserve": row.ifReserve
}
changeIfReserveApi(param).then((response) => {
this.getList()
}).catch(() => {
this.getList()
});
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 新增按钮操作 */
handleAdd() {
this.stallId=""
this.reset();
// this.getMealtimeList()
this.reset();
this.activeName="baseSetting"
this.open = true;
this.title = "新增";
@ -660,22 +398,7 @@ export default {
reset() {
this.fileList=[]
this.checkUrlList=[]
this.baseForm = {};
// this.orderDTO = {//
// "bookEndTime": "",
// "bookRefundEndTime": "",
// "cancelBookFeeRatio": "",
// "dayBeforeCancelBookChargeTime": "",
// "ifAllowReserveToday": "1",
// "ifBookSkipHoliday": "",
// "ifEnableOrder": 2,
// "ifReserveSkipHoliday": "1",
// "nearDinnerCancelBookChargeHour": "2",
// "reportMealLimitDay": 0,
// "reserveEndTime": "",
// "reserveLimitDay": 0,
// "reserveRefundEndTime": ""
// }
this.baseForm = {};
this.rangeTime=["08:00:00", "18:00:00"]
this.resetForm("baseForm");
},
@ -702,15 +425,7 @@ export default {
this.$forceUpdate()
});
},200)
this.rangeTime=[response.data.startBusinessTime, response.data.endBusinessTime]
// this.deliveryModel = response.deliveryModel;
// this.orderDTO = response.orderDTO;
// this.mealtimeList = response.mealtimeList;
// this.mealtimeList.forEach(item=>{
// this.$set(item,"orderTimeList",[item.startTime,item.endTime])
// this.$set(item,"reserveTimeList",[item.reserveStartTime||'',item.reserveEndTime||''])
// this.$set(item,"currTimeList",[item.currStartTime||'',item.currEndTime||''])
// })
this.rangeTime=[response.data.startBusinessTime, response.data.endBusinessTime]
this.open = true;
this.title = "修改";
});
@ -723,35 +438,7 @@ export default {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 休息按钮操作 */
handleRest(row) {
let param = {
"businessState": 1,
"canteenTreeType": 2,
"modifyId": row.stallId
}
this.$modal.confirm('是否确认休息?').then(function() {
return changeBusinessStateApi(param);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
/** 营业按钮操作 */
handleBuss(row) {
let param = {
"businessState": 2,
"canteenTreeType": 2,
"modifyId": row.stallId
}
this.$modal.confirm('是否确认营业?').then(function() {
return changeBusinessStateApi(param);
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
},
/** 提交按钮 */
submitForm: function() {
console.log(this.baseForm)
@ -760,44 +447,7 @@ export default {
if (valid) {
this.baseForm.startBusinessTime=this.rangeTime[0]
this.baseForm.endBusinessTime=this.rangeTime[1]
this.baseForm.imgUrl = this.checkUrlList[0]
// let param ={
// "stallSaveDTO": this.baseForm,
// "deliveryModel": {//
// "deliveries": "",
// "deliveryList": [
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 2
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 3
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 4
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 5
// },
// {
// "deliveryEndTime": "23:59:59",
// "deliveryStartTime": "00:00:00",
// "deliveryType": 6
// }
// ],
// "ifEnableDelivery": "2",
// "minDeliveryFeeOnOff": 1
// },
// "orderDTO":this.orderDTO,
// "mealtimeList":this.mealtimeList
// }
this.baseForm.imgUrl = this.checkUrlList[0]
let param = this.baseForm
if (this.stallId != "") {
param.stallId = this.stallId
@ -877,36 +527,6 @@ export default {
console.log(file)
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
getMealtimeList() {
getMealtimeListApi({}).then((response) => {
this.mealtimeList = response;
this.mealtimeList.forEach(item=>{
this.$set(item,"orderTimeList",[item.startTime,item.endTime])
this.$set(item,"reserveTimeList",['',''])
this.$set(item,"currTimeList",['',''])
})
});
},
changeOrderTimeList(row){
console.log(row)
row.startTime = row.orderTimeList[0]
row.endTime = row.orderTimeList[1]
},
changeReserveTimeList(row){ //item.reserveStartTime,item.reserveEndTime
console.log(row)
if(row.reserveTimeList){
row.reserveStartTime = row.reserveTimeList[0]
row.reserveEndTime = row.reserveTimeList[1]
}
},
changeCurrTimeList(row){ //item.currStartTime,item.currEndTime
console.log(row)
if(row.currTimeList){
row.currStartTime = row.currTimeList[0]
row.currEndTime = row.currTimeList[1]
}
}