Merge remote-tracking branch 'origin/bonus-houqin' into bonus-houqin

This commit is contained in:
lSun 2025-03-06 09:27:25 +08:00
commit 02109c8d45
6 changed files with 1590 additions and 1 deletions

95
src/api/base/canteen.js Normal file
View File

@ -0,0 +1,95 @@
import request from '@/utils/request'
// export function listData(query) {
// return request({
// url: '/system/dict/data/list',
// method: 'get',
// params: query
// })
// }
// export function getDicts(dictType) {
// return request({
// url: '/system/dict/data/type/' + dictType,
// method: 'get'
// })
// }
// 查询食堂列表
export function getPageCanteenApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/page-canteen',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 新增食堂
export function addCanteenApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/add-canteen',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询食堂标签列表(分页)
export function getCanteenLabelApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/label/page',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 人员职位职称查询
export function queryAllCustJobApi(data) {
return request({
url: '/smart-canteen/custJob/queryAllCustJob',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 分页查询人员及职位信息
export function queryCustJobPageApi(data) {
return request({
url: '/smart-canteen/custInfo/page-cust-job-info',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
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
})
}

88
src/api/system/upload.js Normal file
View File

@ -0,0 +1,88 @@
import request from '@/utils/request'
//资源图片上传
export function imgUpLoad(param){
const formData = new FormData()
formData.append('file', param.file)
formData.append('fileType', param.type)
return request({
url: '/system/sys/file/upload',
method: 'post',
data: formData,
header:'multipart/form-data'
})
}
export function imgUpLoadTwo(param){
const formData = new FormData()
formData.append('file', param.file)
formData.append('fileType', param.type)
return request({
url: '/file/upload',
method: 'post',
data: formData,
header:'multipart/form-data'
})
}
export function imgUpLoadThree(param){
const formData = new FormData()
param.forEach(item => {
formData.append('files', item)
})
// formData.append('files', param)
return request({
url: '/file/uploadFiles',
method: 'post',
data: formData,
header:'multipart/form-data'
})
}
//资源文件上传
export function fileUpLoad(param){
const formData = new FormData()
formData.append('file', param.file)
return request({
url: '/system/sys/file/upload',
method: 'post',
data: formData,
})
}
// excel文件上传
export function excelUpLoad(param){
const formData = new FormData()
formData.append('file', param.file)
return request({
url: '/material/base/maPartType/readExcel',
method: 'post',
data: formData,
})
}
// excel文件下载
export function downloadExcel(param){
return request({
url: '/material/base/maPartType/downLoad',
method: 'post',
param
})
}

View File

@ -0,0 +1,759 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属区域" prop="areaNameStr">
<el-cascader
v-model="queryParams.areaNameStr" :show-all-levels="false" :filterable="true"
:options="treeOptions" :props="treeProps" collapse-tags
@change="handleTreeChange"></el-cascader>
</el-form-item>
<el-form-item label="食堂名称" prop="canteenName">
<el-input
v-model="queryParams.canteenName"
placeholder="请输入食堂名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="食堂编号" align="center" prop="canteenNum" :show-overflow-tooltip="true" width="100" fixed="left"/>
<el-table-column label="食堂名称" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150" fixed="left"/>
<el-table-column label="所属区域" align="center" prop="areaNameStr" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="负责人" align="center" prop="custName" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="联系电话" align="center" prop="contactTel" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="食堂标签" align="center" prop="labelNameStr" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="食堂状态" align="center" prop="businessState" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span v-if="scope.row.businessState==1">休息</span>
<span v-if="scope.row.businessState==2">营业</span>
</template>
</el-table-column>
<el-table-column label="主营项目" align="center" prop="mainProject" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="营业时间" align="center" prop="startBusinessTime" :show-overflow-tooltip="true" width="180">
<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"
>
</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="capacity" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="客流统计" align="center" prop="" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="区域人数统计" align="center" prop="" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="食堂图片" align="center" prop="imgUrl" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<img :src="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;">
</template>
</el-table-column>
<el-table-column label="支付设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="配送设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="预订/点餐/报餐设置" align="center" prop="" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="收款码" align="center" prop="payCodeUrl" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span>未开启</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="crtime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="更新时间" align="center" prop="uptime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>休息</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+'-食堂'" :visible.sync="open" width="1000px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="基础设置" name="baseSetting" style="height: 550px;">
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="食堂编号" prop="canteenNum">
<el-input v-model="baseForm.canteenNum" placeholder="请输入食堂编号" maxlength="30" disabled clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="食堂名称" prop="canteenName">
<el-input v-model="baseForm.canteenName" placeholder="请输入食堂名称" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="所属区域" prop="areaId">
<el-cascader
:options="treeOptions" :filterable="true" style="width: 400px;" :show-all-levels="false"
:props="{ checkStrictly: true,value:'id',label:'treeName' }"
clearable @change="handleTreeChange2" >
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="营业时间">
<el-time-picker
is-range
v-model="rangeTime"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围">
</el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="食堂标签" prop="labelName">
<el-select v-model="baseForm.labelName" placeholder="请选择食堂标签" style="width: 100%;">
<el-option v-for="item in labelOptions"
:key="item.labelName"
:label="item.labelName"
:value="item.labelName"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="食堂最大容纳人数" prop="capacity">
<el-input v-model="baseForm.capacity" placeholder="请输入食堂最大容纳人数" maxlength="30" clearable
@input="(v)=>(baseForm.capacity=v.replace(/[^\d]/g,''))"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="负责人" prop="labelName">
<el-select v-model="baseForm.labelName" placeholder="请选择负责人" style="width: 100%;" @focus="chosenCharger"></el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="contactTel">
<el-input v-model="baseForm.contactTel" placeholder="请输入联系电话" maxlength="11" clearable
@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">
<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-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-col :span="12">
<el-form-item label="食堂图片">
<el-upload
:http-request="
(obj) => imgUpLoad(obj, 'fileUrl')
"
action="#"
:limit="1"
:file-list="fileList"
:show-file-list="true"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:on-success="handleAvatarSuccess"
:class="{ disabled: uploadDisabled }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<!-- 支付设置 -->
<el-tab-pane label="支付设置" name="paySetting">
支付设置
</el-tab-pane>
<!-- 配送设置 -->
<el-tab-pane label="配送设置" name="deliverySetting">
配送设置
</el-tab-pane>
<!-- 预订/点餐/报餐设置 -->
<el-tab-pane label="预订/点餐/报餐设置" name="orderSetting">
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="选择负责人" :visible.sync="openJob" width="800px" append-to-body>
<el-form :model="dialogQueryParams" ref="dialogQueryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="" prop="keyWord">
<el-input v-model="dialogQueryParams.keyWord" placeholder="请输入姓名,编号,手机号" clearable style="width: 240px"/>
</el-form-item>
<el-form-item label="" prop="canteenName">
<el-select v-model="baseForm.labelName" placeholder="请选择职位" style="width: 100%;">
<el-option v-for="item in jobOptions"
:key="item.jobId"
:label="item.jobName"
:value="item.jobId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleDialogQuery">搜索</el-button>
</el-form-item>
</el-form>
<el-table :data="jobTableData" height="500">
<el-table-column label="负责人姓名" align="center" prop="custName" :show-overflow-tooltip="true"/>
<el-table-column label="负责人编号" align="center" prop="custNum" :show-overflow-tooltip="true"/>
<el-table-column label="负责人手机号" align="center" prop="mobile" :show-overflow-tooltip="true"/>
<el-table-column label="职位" align="center" prop="job" :show-overflow-tooltip="true"/>
<el-table-column label="所属组织" align="center" prop="orgFullName" :show-overflow-tooltip="true"/>
</el-table>
<pagination
v-show="dialogTotal>0"
:total="dialogTotal"
:page.sync="dialogQueryParams.pageNum"
:limit.sync="dialogQueryParams.pageSize"
@pagination="queryCustJobPage"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click=""> </el-button>
<el-button @click=""> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getPageCanteenApi,getCanteenLabelApi,queryAllCustJobApi,queryCustJobPageApi,getMealtimeListApi,addCanteenApi } from "@/api/base/canteen";
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
treeOptions:[],//
treeProps:{
multiple: true,
value:"id",
label:"treeName",
children:"children",
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
canteenName: undefined,
areaNameStr: undefined,
},
activeName:"baseSetting",
canteenData:{},//-
baseForm: {
"areaId": "420813885705031680",
"canteenName": "",
"canteenNum": "0104-01",
"capacity": "",
"contactTel": "",
"custId": "379497835516661760",
"endBusinessTime": "23:59:59",
"startBusinessTime": "00:00:00",
"ifBook": 2,
"ifEnablePayCode": 2,
"ifReserve": 2,
"imgUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/076073649b5c4f33a7a15d8a363c006d.jpg",
"labelNameList": []
},//
rangeTime:[],//
//
baseFormRules: {
canteenName: [
{ required: true, message: "食堂名称不能为空", trigger: "blur" }
],
// dictType: [
// { required: true, message: "", trigger: "blur" }
// ]
},
labelOptions:[],//
//
openJob: false,
jobOptions:[],//
dialogQueryParams:{//
pageNum: 1,
pageSize: 10,
},
jobTableData:[],//
//
dialogTotal: 0,
fileList: [],//
checkUrlList: [],//
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
mealtimeList:[],//
};
},
created() {
this.getTreeData();
this.getList();
this.getCanteenLabel()
this.queryAllCustJob()
this.getMealtimeList()
},
computed: {
//1
uploadDisabled() {
return this.checkUrlList.length > 0
},
},
methods: {
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response;
console.log(this.treeOptions)
});
},
handleTreeChange(e){
console.log(e)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"current": this.queryParams.pageNum,
"size": this.queryParams.pageSize,
}
getPageCanteenApi(param).then(response => {
this.tableListData = response.records;
this.total = Number(response.total);
this.loading = false;
});
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {};
this.rangeTime=[]
this.resetForm("baseForm");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
this.open = true;
this.title = "修改";
// });
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
// return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 提交按钮 */
submitForm: function() {
console.log(this.baseForm)
console.log(this.rangeTime)
this.$refs["baseForm"].validate(valid => {//
if (valid) {
let param ={
"canteenSaveDTO": {
"areaId": "420813885705031680",
"canteenName": "测试食堂",
"canteenNum": "0104-01",
"capacity": "300",
"contactTel": "18756034328",
"custId": "379497835516661760",
"endBusinessTime": "23:59:59",
"ifBook": 2,
"ifEnablePayCode": 2,
"ifReserve": 1,
"imgUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/076073649b5c4f33a7a15d8a363c006d.jpg",
"labelNameList": [],
"startBusinessTime": "00:00:00"
},
"payDTO": {//
"ifEnablePay": "2",
"payMap": {},
"payTypes": ""
},
"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": {//
"reportMealLimitDay": 0,
"reserveLimitDay": 0
},
}
if (this.canteenData.canteenId != undefined) {
// updateType().then(response => {
this.$modal.msgSuccess("修改成功");
// this.open = false;
// this.getList();
// });
} else {
// addType().then(response => {
this.$modal.msgSuccess("新增成功");
// this.open = false;
// this.getList();
// });
}
}
});
},
//
handleTreeChange2(e){
console.log(e)
},
//
async getCanteenNum(data) {
// let params= {
// "superId":data.id||""
// }
// if(data.parentId=="-1"){
// params.canteenTreeType=-1
// }else{
// params.canteenTreeType=1
// }
// const res = await getAreaNumApi(params);
// this.$set(this.form,"areaNum",res.data)
},
//
getCanteenLabel() {
let param = { "current": 1,"size": -1}
getCanteenLabelApi(param).then((response) => {
this.labelOptions = response.records;
});
},
//
chosenCharger(){
this.queryCustJobPage()
this.openJob=true
},
//
queryAllCustJob() {
queryAllCustJobApi({}).then((response) => {
this.jobOptions = response.data
console.log(response)
});
},
//-
handleDialogQuery(){
this.dialogQueryParams.pageNum=1
this.queryCustJobPage()
},
//-
queryCustJobPage() {
let param = {
"current": this.dialogQueryParams.pageNum,
"ifQueryJob": 1,
"size": this.dialogQueryParams.pageSize
}
queryCustJobPageApi(param).then((response) => {
this.jobTableData = response.records
this.dialogTotal = Number(response.total);
console.log(response)
});
},
//
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
//
imgUpLoad(param, name, index) {
// console.log(param,'image')
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.checkUrlList.push(res.data.fileUrl)
this.checkUrlNameList.push(res.data.fileName)
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
handleAvatarSuccess(res, file) {
console.log('success')
},
handleExceed(files, fileList) {
this.$message.warning('最多只可以上传一张图片')
},
handleRemove(file, fileList) {
let sum = 0
this.checkUrlNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.checkUrlNameList.splice(sum, 1)
this.checkUrlList.splice(sum, 1)
},
//
handlePictureCardPreview(file) {
console.log(file)
this.dialogImageUrl = file.url
this.dialogVisible = true
},
//
getMealtimeList() {
getMealtimeListApi({}).then((response) => {
this.mealtimeList = response
console.log(response)
});
},
}
};
</script>

View File

@ -0,0 +1,323 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属区域" prop="areaNameStr">
<el-cascader
v-model="queryParams.areaNameStr" :show-all-levels="false" :filterable="true"
:options="treeOptions" :props="treeProps" collapse-tags
@change="handleTreeChange"></el-cascader>
</el-form-item>
<el-form-item label="食堂名称" prop="canteenName">
<el-input
v-model="queryParams.canteenName"
placeholder="请输入食堂名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="食堂编号" align="center" prop="canteenNum" :show-overflow-tooltip="true" width="100" fixed="left"/>
<el-table-column label="食堂名称" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150" fixed="left"/>
<el-table-column label="所属区域" align="center" prop="areaNameStr" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="负责人" align="center" prop="custName" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="联系电话" align="center" prop="contactTel" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="食堂标签" align="center" prop="labelNameStr" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="食堂状态" align="center" prop="businessState" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span v-if="scope.row.businessState==1">休息</span>
<span v-if="scope.row.businessState==2">营业</span>
</template>
</el-table-column>
<el-table-column label="主营项目" align="center" prop="mainProject" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="营业时间" align="center" prop="startBusinessTime" :show-overflow-tooltip="true" width="180">
<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"
>
</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="capacity" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="客流统计" align="center" prop="" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="区域人数统计" align="center" prop="" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="食堂图片" align="center" prop="imgUrl" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<img :src="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;">
</template>
</el-table-column>
<el-table-column label="支付设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="配送设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="预订/点餐/报餐设置" align="center" prop="" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="收款码" align="center" prop="payCodeUrl" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span>未开启</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="crtime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="更新时间" align="center" prop="uptime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>休息</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getPageCanteenApi } from "@/api/base/canteen";
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
treeOptions:[],//
treeProps:{
multiple: true,
value:"id",
label:"treeName",
children:"children",
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
canteenName: undefined,
areaNameStr: undefined,
},
//
form: {},
//
rules: {
// canteenName: [
// { required: true, message: "", trigger: "blur" }
// ],
// dictType: [
// { required: true, message: "", trigger: "blur" }
// ]
}
};
},
created() {
this.getTreeData();
this.getList();
},
methods: {
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response;
console.log(this.treeOptions)
});
},
handleTreeChange(e){
console.log(e)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"current": this.queryParams.pageNum,
"size": this.queryParams.pageSize,
}
getPageCanteenApi(param).then(response => {
this.tableListData = response.records;
this.total = Number(response.total);
this.loading = false;
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
// this.form = response.data;
this.open = true;
this.title = "修改";
// });
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {};
this.resetForm("form");
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
// updateType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
} else {
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
// return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
}
};
</script>

View File

@ -0,0 +1,323 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属区域" prop="areaNameStr">
<el-cascader
v-model="queryParams.areaNameStr" :show-all-levels="false" :filterable="true"
:options="treeOptions" :props="treeProps" collapse-tags
@change="handleTreeChange"></el-cascader>
</el-form-item>
<el-form-item label="食堂名称" prop="canteenName">
<el-input
v-model="queryParams.canteenName"
placeholder="请输入食堂名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<el-table-column label="食堂编号" align="center" prop="canteenNum" :show-overflow-tooltip="true" width="100" fixed="left"/>
<el-table-column label="食堂名称" align="center" prop="canteenName" :show-overflow-tooltip="true" width="150" fixed="left"/>
<el-table-column label="所属区域" align="center" prop="areaNameStr" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="负责人" align="center" prop="custName" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="联系电话" align="center" prop="contactTel" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="食堂标签" align="center" prop="labelNameStr" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="食堂状态" align="center" prop="businessState" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span v-if="scope.row.businessState==1">休息</span>
<span v-if="scope.row.businessState==2">营业</span>
</template>
</el-table-column>
<el-table-column label="主营项目" align="center" prop="mainProject" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="营业时间" align="center" prop="startBusinessTime" :show-overflow-tooltip="true" width="180">
<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"
>
</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="capacity" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="客流统计" align="center" prop="" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="区域人数统计" align="center" prop="" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="食堂图片" align="center" prop="imgUrl" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<img :src="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;">
</template>
</el-table-column>
<el-table-column label="支付设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="配送设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="预订/点餐/报餐设置" align="center" prop="" :show-overflow-tooltip="true" width="140">
<template slot-scope="scope">
<span style="color: #4b80fd;">详情</span>
</template>
</el-table-column>
<el-table-column label="收款码" align="center" prop="payCodeUrl" :show-overflow-tooltip="true" width="80">
<template slot-scope="scope">
<span>未开启</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="crtime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="更新时间" align="center" prop="uptime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>休息</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getPageCanteenApi } from "@/api/base/canteen";
export default {
name: "",
dicts: [],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
treeOptions:[],//
treeProps:{
multiple: true,
value:"id",
label:"treeName",
children:"children",
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
canteenName: undefined,
areaNameStr: undefined,
},
//
form: {},
//
rules: {
// canteenName: [
// { required: true, message: "", trigger: "blur" }
// ],
// dictType: [
// { required: true, message: "", trigger: "blur" }
// ]
}
};
},
created() {
this.getTreeData();
this.getList();
},
methods: {
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response;
console.log(this.treeOptions)
});
},
handleTreeChange(e){
console.log(e)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"current": this.queryParams.pageNum,
"size": this.queryParams.pageSize,
}
getPageCanteenApi(param).then(response => {
this.tableListData = response.records;
this.total = Number(response.total);
this.loading = false;
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
// this.form = response.data;
this.open = true;
this.title = "修改";
// });
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {};
this.resetForm("form");
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
// updateType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
} else {
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
// return delType(dictIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
}
};
</script>

View File

@ -36,7 +36,8 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://192.168.2.209:38080`,
target: `http://192.168.2.76:38080`,
// target: `http://192.168.0.61:58080`,
target: `http://192.168.0.44:58085`,
// target: `http://192.168.0.244:18877`,
changeOrigin: true,
pathRewrite: {