Compare commits

...

3 Commits

11 changed files with 2490 additions and 740 deletions

View File

@ -38,6 +38,7 @@
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0",
"base-64": "^1.0.0",
"clipboard": "2.0.8",
"core-js": "3.25.3",
"crypto-js": "^4.2.0",

View File

@ -37,10 +37,52 @@ export function addCanteenApi(data) {
data: data
})
}
// 获取食堂
export function getCanteenInfoModifyApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/get-canteen-for-modify',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改食堂
export function updateCanteenApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/modify-canteen',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除食堂
export function removeCanteenApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/remove-canteen',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询食堂编号
export function getCanteenNumApi(data) {
return request({
url: 'smart-canteen/api/v2/alloc/canteen/get-canteen-num',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询食堂标签列表(分页)
export function getCanteenLabelApi(data) {
@ -76,11 +118,6 @@ export function queryCustJobPageApi(data) {
})
}
// 查询餐次时段列表
export function getMealtimeListApi(data) {
return request({
@ -92,4 +129,32 @@ export function getMealtimeListApi(data) {
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
})
}

205
src/api/base/stall.js Normal file
View File

@ -0,0 +1,205 @@
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'
// })
// }
// 通过区域Id查询食堂
export function getCanteenByAreaApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/list-all-auth-canteen',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 通过食堂查询档口
export function getStallByCanteenApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/list-multiple-auth-stall',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询档口列表
export function getPageStallApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/page-stall',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 新增档口
export function addStallApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/add-stall',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 获取档口
export function getStallInfoModifyApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/get-stall-for-modify',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改档口
export function updateStallApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/modify-stall',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除档口
export function removeStallApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/canteen/remove-stall',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询档口编号
export function getStallNumApi(data) {
return request({
url: 'smart-canteen/api/v2/alloc/canteen/get-canteen-num',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询标签列表(分页)
export function getLabelListApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/label/page',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 查询品类列表(分页)
export function getKindListApi(data) {
return request({
url: '/smart-canteen/api/v2/alloc/kind/list-name',
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
})
}
// 修改档口 是否支持预订餐
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
})
}

113
src/api/device/index.js Normal file
View File

@ -0,0 +1,113 @@
import request from '@/utils/request'
// 分页查询设备信息
export function getDeviceListPageApi(data) {
return request({
url: '/smart-canteen/api/v2/device/page',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 新增设备
export function addDeviceApi(data) {
return request({
url: '/smart-canteen/api/v2/device/insert',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改设备信息
export function updateDeviceApi(data) {
return request({
url: '/smart-canteen/api/v2/device/update',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除设备信息
// export function deleteDeviceApi(data) {
// return request({
// url: '/smart-canteen/api/v2/device/delete',
// method: 'post',
// headers: {
// "merchant-id":"378915229716713472",
// },
// data: data
// })
// }
export function deleteDeviceApi(deviceId){
const formData = new FormData()
formData.append('deviceId', deviceId)
return request({
url: '/smart-canteen/api/v2/device/delete',
method: 'post',
data: formData,
headers: {
"merchant-id":"378915229716713472",
},
header:'multipart/form-data'
})
}
//{"page":{"current":1,"size":20,"total":0},"object":{"deviceSn":"124"}}
// 分页查询设备异常信息
export function getDeviceStateLogApi(data) {
return request({
url: '/smart-canteen/api/v2/device/statelog/page',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 获取指定日期菜谱计划菜品详情
export function getMenuRecipeDetailApi(data) {
return request({
url: '/smart-canteen/api/v2/menurecipe/date/detail',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -80,10 +80,10 @@
v-show="showSearch"
label-width="68px"
>
<el-form-item label="区域" prop="keyword">
<el-form-item label="区域名称" prop="areaName">
<el-input
v-model="queryParams.keyword"
placeholder="请输入关键字"
v-model="queryParams.areaName"
placeholder="请输入区域名称"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
@ -274,7 +274,8 @@
//
queryParams: {
pageNum: 1,
pageSize: 10,
pageSize: 10,
areaName:""
},
//
total: 0,
@ -348,7 +349,7 @@
getList() {
this.loading = true;
let params= {
"areaName":this.areaName,
"areaName":this.queryParams.areaName,
"areaId":this.areaId,
"size": this.queryParams.pageSize,
"current": this.queryParams.pageNum

View File

@ -1,9 +1,9 @@
<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-form-item label="所属区域" prop="areaIds">
<el-cascader
v-model="queryParams.areaNameStr" :show-all-levels="false" :filterable="true"
v-model="queryParams.areaIds" :show-all-levels="false" :filterable="true"
:options="treeOptions" :props="treeProps" collapse-tags
@change="handleTreeChange"></el-cascader>
</el-form-item>
@ -63,6 +63,7 @@
inactive-text="关闭"
:active-value="1"
:inactive-value="2"
@change="changeIfReserve(scope.row)"
>
</el-switch>
</template>
@ -92,7 +93,7 @@
</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;">
<img :src="scope.row.imgUrl" alt="" style="width: 80px;height: 40px;" @click="openImg(scope.row)">
</template>
</el-table-column>
<el-table-column label="支付设置" align="center" prop="canteenName" :show-overflow-tooltip="true" width="80">
@ -121,20 +122,17 @@
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
type="text"
@click="handleRest(scope.row)"
>休息</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
type="text"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
type="text"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
@ -170,9 +168,13 @@
<el-row>
<el-col :span="12">
<el-form-item label="所属区域" prop="areaId">
<el-cascader
<el-cascader v-model="baseForm.areaId"
:options="treeOptions" :filterable="true" style="width: 400px;" :show-all-levels="false"
:props="{ checkStrictly: true,value:'id',label:'treeName' }"
:props="{
emitPath: false,// falseid
checkStrictly: true,//
value:'id',label:'treeName'
}"
clearable @change="handleTreeChange2" >
</el-cascader>
</el-form-item>
@ -182,6 +184,7 @@
<el-time-picker
is-range
v-model="rangeTime"
value-format="HH:mm:ss"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
@ -307,8 +310,7 @@
<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">
@ -348,9 +350,7 @@
<el-button @click=""> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
@ -364,7 +364,8 @@
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getPageCanteenApi,getCanteenLabelApi,queryAllCustJobApi,queryCustJobPageApi,getMealtimeListApi,addCanteenApi } from "@/api/base/canteen";
import { getPageCanteenApi, getCanteenNumApi, addCanteenApi, getCanteenInfoModifyApi, updateCanteenApi, removeCanteenApi } from "@/api/base/canteen";
import { getCanteenLabelApi, queryAllCustJobApi, queryCustJobPageApi, getMealtimeListApi,changeIfReserveApi,changeBusinessStateApi } from "@/api/base/canteen";
import { imgUpLoadTwo } from '@/api/system/upload'
export default {
name: "",
@ -401,34 +402,35 @@
pageNum: 1,
pageSize: 10,
canteenName: undefined,
areaNameStr: undefined,
areaIds: [],
},
activeName:"baseSetting",
canteenId:"",//-
canteenData:{},//-
baseForm: {
"areaId": "420813885705031680",
"areaId": "",
"canteenName": "",
"canteenNum": "0104-01",
"canteenNum": "",
"capacity": "",
"contactTel": "",
"custId": "379497835516661760",
"endBusinessTime": "23:59:59",
"startBusinessTime": "00:00:00",
"endBusinessTime": "",
"startBusinessTime": "",
"ifBook": 2,
"ifEnablePayCode": 2,
"ifReserve": 2,
"imgUrl": "http://sgwpdm.ah.sgcc.com.cn/canteen/lnyst/378915229716713472/dishes/076073649b5c4f33a7a15d8a363c006d.jpg",
"labelNameList": []
},//
rangeTime:[],//
rangeTime:["08:00:00", "18:00:00"],//
//
baseFormRules: {
canteenName: [
{ required: true, message: "食堂名称不能为空", trigger: "blur" }
],
// dictType: [
// { required: true, message: "", trigger: "blur" }
// ]
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "blur" }
]
},
labelOptions:[],//
//
@ -446,6 +448,10 @@
checkUrlNameList: [],//
dialogVisible:false,//
dialogImageUrl:"",//
deliveryModel:{},//
payDTO:{},//
orderDTO:{},//
mealtimeList:[],//
};
@ -455,7 +461,7 @@
this.getList();
this.getCanteenLabel()
this.queryAllCustJob()
this.getMealtimeList()
},
computed: {
//1
@ -472,8 +478,7 @@
});
},
handleTreeChange(e){
console.log(e)
console.log(e)
},
/** 搜索按钮操作 */
handleQuery() {
@ -488,10 +493,17 @@
/** 查询列表 */
getList() {
this.loading = true;
let arr=[]
if(this.queryParams.areaIds.length>0){
this.queryParams.areaIds.forEach(item=>{
arr.push(item[item.length - 1])
})
}
let param = {
"current": this.queryParams.pageNum,
"size": this.queryParams.pageSize,
"size": this.queryParams.pageSize,
"canteenName": this.queryParams.canteenName,
"areaIdList":arr
}
getPageCanteenApi(param).then(response => {
this.tableListData = response.records;
@ -500,12 +512,28 @@
});
},
//
changeIfReserve(row){
let param = {
"canteenId": row.canteenId,
"ifReserve": row.ifReserve
}
changeIfReserveApi(param).then((response) => {
this.getList()
});
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 新增按钮操作 */
handleAdd() {
this.canteenId=""
this.reset();
this.getMealtimeList()
this.open = true;
this.title = "新增";
},
@ -517,52 +545,58 @@
//
reset() {
this.baseForm = {};
this.rangeTime=[]
this.rangeTime=["08:00:00", "18:00:00"]
this.resetForm("baseForm");
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
console.log(row)
this.reset();
getCanteenInfoModifyApi({"canteenId":row.canteenId}).then(response => {
console.log(response)
this.canteenId = response.canteenId;
this.baseForm = response.canteenSaveDTO;
this.deliveryModel = response.deliveryModel;
this.orderDTO = response.orderDTO;
this.payDTO = response.payDTO;
this.mealtimeList = response.mealtimeList;
this.open = true;
this.title = "修改";
// });
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
// return delType(dictIds);
return removeCanteenApi({"canteenId":row.canteenId});
}).then(() => {
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(() => {});
},
/** 提交按钮 */
submitForm: function() {
console.log(this.baseForm)
console.log(this.rangeTime)
this.$refs["baseForm"].validate(valid => {//
if (valid) {
this.baseForm.startBusinessTime=this.rangeTime[0]
this.baseForm.endBusinessTime=this.rangeTime[1]
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"
},
"canteenSaveDTO": this.baseForm,
"payDTO": {//
"ifEnablePay": "2",
"payMap": {},
@ -604,56 +638,40 @@
"reportMealLimitDay": 0,
"reserveLimitDay": 0
},
}
if (this.canteenData.canteenId != undefined) {
// updateType().then(response => {
"mealtimeList":this.mealtimeList
}
if (this.canteenId != "") {
param.canteenId = this.canteenId
updateCanteenApi(param).then(response => {
this.$modal.msgSuccess("修改成功");
// this.open = false;
// this.getList();
// });
this.open = false;
this.getList();
});
} else {
// addType().then(response => {
addCanteenApi(param).then(response => {
this.$modal.msgSuccess("新增成功");
// this.open = false;
// this.getList();
// });
this.open = false;
this.getList();
});
}
}
});
},
//
handleTreeChange2(e){
console.log(e)
//-
handleTreeChange2(val){
setTimeout(()=>{
this.getCanteenNum()
},800)
},
//
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)
async getCanteenNum() {
let params= {
"superId":this.baseForm.areaId,
"canteenTreeType":1
}
const res = await getCanteenNumApi(params);
this.$set(this.baseForm,"canteenNum",res.data)
},
//
getCanteenLabel() {
@ -700,6 +718,10 @@
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
openImg(row) {
this.dialogImageUrl = row.imgUrl;
this.dialogVisible = true;
},
//
imgUpLoad(param, name, index) {
// console.log(param,'image')

View File

@ -1,323 +1,295 @@
<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">
<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="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-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;
});
},
<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>
/** 新增按钮操作 */
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>
<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 { 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,
//
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.getList();
},
methods: {
/** 搜索按钮操作 */
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>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,747 @@
<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="deviceSearchInfo">
<el-input
v-model="queryParams.deviceSearchInfo"
placeholder="请输入关键字"
clearable
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属区域" prop="areaArr">
<el-cascader style="width: 400px"
v-model="queryParams.areaArr" :show-all-levels="false" :filterable="true"
:options="treeOptions" :props="treeProps" collapse-tags
@change="handleTreeChange"></el-cascader>
</el-form-item>
<el-form-item label="所属食堂" prop="canteenIdList">
<el-select v-model="queryParams.canteenIdList" placeholder="请选择所属食堂" collapse-tags :multiple="true" style="width: 400px;" @change="changeQueryCanteen">
<el-option v-for="item in canteenOptions"
:key="item.canteenId"
:label="item.canteenName"
:value="item.canteenId"
></el-option>
</el-select>
</el-form-item>
<br>
<el-form-item label="所属档口" prop="stallIdList">
<el-select v-model="queryParams.stallIdList" placeholder="请选择所属档口" collapse-tags :multiple="true" style="width: 500px;">
<el-option v-for="item in stallOptions"
:key="item.stallId"
:label="item.stallName"
:value="item.stallId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="通讯状态" prop="">
<el-select v-model="queryParams.onlineState" placeholder="请选择通讯状态" style="width: 300px;">
<el-option v-for="item in statusOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</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="deviceNum" :show-overflow-tooltip="true" width="120" fixed="left"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" width="180" fixed="left"/>
<el-table-column label="当前菜谱" align="center" prop="firstRecipeName" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="通讯状态" align="center" prop="onlineState" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.onlineState==1">在线</span>
<span v-if="scope.row.onlineState==2">离线</span>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" prop="deviceState" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span v-if="scope.row.deviceState==1">正常</span>
<span v-if="scope.row.deviceState==2">异常</span>
</template>
</el-table-column>
<el-table-column label="所属区域" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.bindList[0].areaName}}</span>
</template>
</el-table-column>
<el-table-column label="所属食堂" align="center" prop="firstCanteenName" :show-overflow-tooltip="true"/>
<el-table-column label="所属档口" align="center" prop="firstShopstallName" :show-overflow-tooltip="true"/>
<el-table-column label="设备版本号" align="center" prop="versionCode" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="openLogDialog(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="700px" append-to-body>
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<!-- 基础设置 -->
<el-tab-pane label="基础设置" name="baseSetting" style="height: 500px;">
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="设备编号" prop="deviceNum">
<el-input v-model="baseForm.deviceNum" placeholder="请输入设备编号" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="baseForm.deviceName" placeholder="请输入设备名称" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备Sn" prop="deviceSn">
<el-input v-model="baseForm.deviceSn" placeholder="请输入设备Sn" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备Ip" prop="deviceIp">
<el-input v-model="baseForm.deviceIp" placeholder="请输入设备Ip" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备key" prop="deviceKey">
<el-input v-model="baseForm.deviceKey" placeholder="请输入设备key" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安装地址" prop="deviceAddr">
<el-input v-model="baseForm.deviceAddr" placeholder="请输入安装地址" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备Mac" prop="deviceMac">
<el-input v-model="baseForm.deviceMac" placeholder="请输入设备key" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="网关" prop="deviceGateway">
<el-input v-model="baseForm.deviceGateway" 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 v-model="baseForm.areaId"
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: true,//
value:'id',label:'treeName'
}"
clearable @change="handleTreeChange2" >
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属食堂" prop="canteenId">
<el-select v-model="baseForm.canteenId" placeholder="请选择所属食堂" style="width: 100%;" @change="chosenCanteen">
<el-option v-for="item in canteenOptions2"
:key="item.canteenId"
:label="item.canteenName"
:value="item.canteenId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="所属档口" prop="stallId">
<el-select v-model="baseForm.stallId" placeholder="请选择所属档口" style="width: 100%;" @change="chosenStall">
<el-option v-for="item in stallOptions2"
:key="item.stallId"
:label="item.stallName"
:value="item.stallId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密码" prop="devicePwd">
<el-input v-model="baseForm.devicePwd" placeholder="请输入密码" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<!-- 配送设置 -->
<el-tab-pane label="设备参数" name="deliverySetting">
<!-- metadata -->
<div style="width: 100%;height: 600px;overflow-y: auto;">
<div class="form-title">
<span>支付参数</span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="checked">启用混合支付</el-checkbox>
<div>
<span>单笔消费最高金额</span>
<el-input v-model="metadata.payOnceHighMoney" style="width: 100px;" placeholder="请输入" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
<span></span>
</div>
<el-checkbox v-model="checked">用户刷脸支付需二次确认,等待时间 (仅支持双屏双触设备)</el-checkbox><br>
<el-checkbox v-model="checked">支持需要收银员二次确认</el-checkbox><br>
<div>
<span>同一个人</span>
<el-input v-model="metadata.paySamePersonSameMoneyTime" style="width: 100px;" placeholder="请输入" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
<span>秒内不能重复支付 默认10秒</span>
</div>
</div>
<div class="form-title">
<span>离线参数</span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="checked">允许离线使用</el-checkbox>
<span>离线总金额</span>
<el-input v-model="metadata.offlineTotalMoney" style="width: 100px;" placeholder="请输入" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
<span>离线总比数</span>
<el-input v-model="metadata.offlineTotalCount" style="width: 100px;" placeholder="请输入" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
</div>
<div class="form-title">
<span>显示参数</span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="checked">用户照片不显示</el-checkbox>
<el-checkbox v-model="checked">用户余额不显示</el-checkbox>
<el-checkbox v-model="checked">个人钱包余额不显示</el-checkbox>
<el-checkbox v-model="checked">补贴余额不显示</el-checkbox>
<el-checkbox v-model="checked">营养信息不显示</el-checkbox>
<div>
<span>支付成功显示倒计时时间</span>
<el-input v-model="metadata.showPaySuccessTime" style="width: 100px;" placeholder="请输入" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
<span></span>
</div>
</div>
<div class="form-title">
<span>语言参数 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<div style="width: 100%; display: flex;">
<div style="width: 45%;margin-left: 3%;">
<div>请选择成功提示音</div>
<el-select v-model="metadata.voiceRemindSuccess" placeholder="请选择成功提示音">
<el-option label="成功" value="1"></el-option>
<el-option label="男版提示音" value="2"></el-option>
<el-option label="女版提示音" value="3"></el-option>
</el-select>
</div>
<div style="width: 45%;margin-left: 3%;">
<div>请选择失败提示声音</div>
<el-select v-model="metadata.voiceRemindFail" placeholder="请选择失败提示声音">
<el-option label="失败" value="1"></el-option>
<el-option label="男版提示音" value="2"></el-option>
<el-option label="女版提示音" value="3"></el-option>
</el-select>
</div>
</div>
<el-checkbox v-model="checked" style="margin-left: 5%;margin-top: 20px;">生日提醒</el-checkbox>
</div>
<div class="form-title">
<span>打印参数 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="checked">启用打印 打印份数1</el-checkbox>
<el-checkbox v-model="checked">打印诺诺发票</el-checkbox>
</div>
<div class="form-title">
<span>核身方式 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="metadata.identityCard" true-label="1" false-label="0"></el-checkbox>
<el-checkbox v-model="metadata.identityQR" true-label="1" false-label="0"></el-checkbox>
<el-checkbox v-model="metadata.identityFace" true-label="1" false-label="0"></el-checkbox>
<el-checkbox v-model="checked">禁用支付宝</el-checkbox>
<el-checkbox v-model="checked">禁用微信</el-checkbox>
<el-checkbox v-model="checked">禁用云闪付</el-checkbox>
<el-checkbox v-model="checked">禁用农行</el-checkbox>
<el-checkbox v-model="checked">禁用工行</el-checkbox>
</div>
<div class="form-title">
<span>人脸参数 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<div>
<el-input v-model="metadata.faceRecognitionScore" style="width: 45%;margin-left: 3%;" placeholder="人脸识别分数" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
<el-input v-model="metadata.faceSize" style="width: 45%;margin-left: 3%;" placeholder="人脸大小" @input="(v)=>(metadata.payOnceHighMoney=v.replace(/[^\d]/g,''))"></el-input>
</div>
</div>
<div class="form-title">
<span>读盘参数 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="checked">出品错误餐盘允许结算</el-checkbox>
<el-checkbox v-model="checked">已结算的餐盘允许结算</el-checkbox>
<el-checkbox v-model="checked">不识别未加密的餐盘</el-checkbox>
<el-checkbox v-model="checked">关闭菜品拍照功能</el-checkbox>
<el-checkbox v-model="checked">关闭读盘错误语音提示</el-checkbox>
<el-checkbox v-model="checked">是否从时段菜谱获取菜品</el-checkbox>
</div>
<div class="form-title">
<span>规则 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-select v-model="metadata.ruleCardQRTran" placeholder="卡号转换规则" style="width: 45%;margin-left: 3%;">
<el-option label="标准" value="0"></el-option>
<el-option label="卡号倒叙" value="1"></el-option>
<el-option label="读6位卡号(去尾)" value="2"></el-option>
<el-option label="读6位卡号(去头)" value="3"></el-option>
<el-option label="卡号10进制转16进制" value="4"></el-option>
<el-option label="卡号16进制转10进制" value="5"></el-option>
</el-select>
</div>
<div class="form-title">
<span>叫号参数 </span>
<span style="font-size: 10px;margin-left: 10px;">云食堂和设备同步</span>
</div>
<div class="form-item">
<el-checkbox v-model="checked">使用订单部分叫号</el-checkbox>
</div>
</div>
</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="openLog" width="800px" append-to-body>
<el-table :data="logTableData" height="500">
<el-table-column label="序号" align="center" type="index" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="发生时间" align="center" prop="messageTime" :show-overflow-tooltip="true"/>
<el-table-column label="异常描述" align="center" prop="message" :show-overflow-tooltip="true"/>
</el-table>
<pagination
v-show="dialogTotal>0"
:total="dialogTotal"
:page.sync="dialogQueryParams.pageNum"
:limit.sync="dialogQueryParams.pageSize"
@pagination="queryLogPage"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="openLog=false"> </el-button>
<el-button @click="openLog=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/area";
import { getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { getDeviceListPageApi,addDeviceApi, updateDeviceApi, deleteDeviceApi, getDeviceStateLogApi } from "@/api/device/index";
import base64 from 'base-64';
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,
emitPath: false,// falseid
value:"id",
label:"treeName",
children:"children",
},
statusOptions:[{id:"1",name:"在线"},{id:"2",name:"离线"}],
//
queryParams: {
pageNum: 1,
pageSize: 10,
deviceSearchInfo:"",//
areaArr:[],//
areaIdList:[],//
canteenIdList:[],//
stallIdList :[],//
onlineState:""
},
canteenOptions:[],//-
stallOptions:[],//-
activeName:"baseSetting",
deviceData:{},
//
baseForm: {},
canteenOptions2:[],//-
stallOptions2:[],//-
//
baseFormRules: {
deviceNum: [
{ required: true, message: "设备编号不能为空", trigger: "blur" }
],
deviceName: [
{ required: true, message: "设备名称不能为空", trigger: "blur" }
],
deviceSn: [
{ required: true, message: "设备Sn不能为空", trigger: "blur" }
],
deviceKey: [
{ required: true, message: "设备Key不能为空", trigger: "blur" }
],
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "blur" }
],
canteenId: [
{ required: true, message: "所属食堂不能为空", trigger: "blur" }
],
stallId: [
{ required: true, message: "所属档口不能为空", trigger: "blur" }
],
},
metadata:{
"voiceRemindSuccess": "1",
"showPaySuccessTime": "3",
"offlineTotalCount": "10000",
"faceSize": "100",
"faceRecognitionScore": "80",
"printIsor": "2",
"payOnceHighMoney": "100000",
"ruleCardQRTran": "0",
"offlineTotalMoney": "10000",
"showNoSubBalance": "1",
"showNoNutrition": "2",
"identityCard": "1",
"paySamePersonSameMoneyTime": "10",
"identityQR": "1",
"voiceRemindFail": "1",
"offlineAllow": "2",
"identityFace": "1"
},
openLog:false,
dialogQueryParams:{//
pageNum: 1,
pageSize: 10,
},
logTableData:[],//
//
dialogTotal: 0,
};
},
created() {
this.getTreeData();
this.getList();
},
methods: {
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response;
console.log(this.treeOptions)
});
},
//-
handleTreeChange(e){
console.log(e)
let arr=e
let param= {
areaIdList:arr
}
this.queryParams.areaIdList=arr;
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response||[]
});
},
//-
changeQueryCanteen(e){
console.log(e)
let arr=e
let param= {
canteenIdList:arr
}
getStallByCanteenApi(param).then((response) => {
this.stallOptions=response||[]
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.onlineState = ""
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"page":{"current":this.queryParams.pageNum,"size":this.queryParams.pageSize},
"object":{
"areaIdList":this.queryParams.areaIdList,
"canteenIdList":this.queryParams.canteenIdList,
"stallIdList":this.queryParams.stallIdList,
"mealLineIdList":[],
"deviceSearchInfo":this.queryParams.deviceSearchInfo,
"onlineState":this.queryParams.onlineState,
"deviceType":20
}
}
let str = base64.encode(JSON.stringify(param))
// console.log(str)
getDeviceListPageApi({"content":str}).then(response => {
this.tableListData = response.records;
this.total = Number(response.total);
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
getCanteenByAreaApi({ areaIdList:[row.bindList[0].areaId] }).then((response) => {
this.canteenOptions2=response||[]
});
getStallByCanteenApi({canteenIdList:[row.bindList[0].canteenId]}).then((response) => {
this.stallOptions2=response||[]
});
this.baseForm = Object.assign({}, row)
this.$set(this.baseForm,"areaId",row.bindList[0].areaId)
this.$set(this.baseForm,"canteenId",row.bindList[0].canteenId)
this.$set(this.baseForm,"stallId",row.bindList[0].stallId)
this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
handleTabClick(tab, event) {
console.log(tab, event);
},
//-
handleTreeChange2(val){
setTimeout(()=>{
let arr=[val]
let param= { areaIdList:arr }
//
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions2=response||[]
this.stallOptions2=[]
this.baseForm.canteenId=null
this.baseForm.stallId=null
});
},800)
},
//
chosenCanteen(e){
console.log(e)
this.baseForm.canteenId=e
this.$refs['baseForm'].clearValidate(['canteenId']);
let param= {
canteenIdList:[e]
}
getStallByCanteenApi(param).then((response) => {
this.stallOptions2=response||[]
this.baseForm.stallId=null
});
},
//
chosenStall(e){
console.log(e)
this.baseForm.stallId=e
this.$refs['baseForm'].clearValidate(['stallId']);
this.$forceUpdate()
},
/** 提交按钮 */
submitForm: function() {
console.log(this.baseForm)
this.$refs["baseForm"].validate(valid => {
if (valid) {
// console.log(this.baseForm)
this.baseForm.binds=[{
"areaId": this.baseForm.areaId,
"canteenId": this.baseForm.canteenId,
"stallId": this.baseForm.stallId
}]
this.baseForm.deviceType=20
this.baseForm.metadata=this.metadata
if (this.baseForm.deviceId != undefined) {
updateDeviceApi(this.baseForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceApi(this.baseForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
return deleteDeviceApi(row.deviceId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
openLogDialog(row){
this.openLog=true
this.queryLogPage(row)
},
//-
queryLogPage(row) {
let param = {"page":{"current":this.dialogQueryParams.pageNum,"size":this.dialogQueryParams.pageSize},"object":{"deviceSn":row.deviceSn}}
let str = base64.encode(JSON.stringify(param))
getDeviceStateLogApi({"content":str}).then((response) => {
this.logTableData = response.records
this.dialogTotal = Number(response.total);
console.log(response)
});
},
}
};
</script>
<style scoped lang="scss">
.form-title{
display: flex;
align-items: flex-end;
// width: 100%;
// height: 40px;
background: #e7f0fa;
border-left: 3px solid #46a6ff;
margin: 10px 0;
padding: 5px;
}
.form-item{
width: 100%;
font-size: 14px !important;
}
</style>

View File

@ -195,6 +195,17 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="form.areaId"
:options="areaOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: true,//
value:'id',label:'treeName'
}"
clearable @change="handleTreeChange" >
</el-cascader>
</el-form-item>
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">展开/折叠</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">全选/全不选
@ -280,7 +291,7 @@ import {
deptTreeSelect
} from '@/api/system/role'
import { treeselect as menuTreeselect, roleMenuTreeselect } from '@/api/system/menu'
import { systemAreaTreeApi } from "@/api/base/area";
export default {
name: 'Role',
dicts: ['sys_normal_disable'],
@ -349,6 +360,7 @@ export default {
},
//
form: {},
areaOptions:[],//
defaultProps: {
children: 'children',
label: 'label'
@ -363,11 +375,15 @@ export default {
],
roleSort: [
{ required: true, message: '角色顺序不能为空', trigger: 'blur' }
]
],
areaId: [
{ required: true, message: '所属区域不能为空', trigger: 'change' }
],
}
}
},
created() {
this.getTreeData()
this.getList()
},
methods: {
@ -381,6 +397,17 @@ export default {
}
)
},
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.areaOptions = response;
console.log(this.areaOptions)
});
},
handleAreaChange(e){
console.log(e)
console.log(this.form.areaId)
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
@ -457,6 +484,7 @@ export default {
status: '0',
menuIds: [],
deptIds: [],
areaId: undefined,
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined

View File

@ -464,6 +464,32 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="用户类别">
<el-select v-model="form.psnType" placeholder="请选择用户类别">
<el-option
v-for="dict in dict.type.user_psn_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="APP用户">
<el-radio-group v-model="form.isCustomer">
<el-radio
v-for="item in isCustomerList"
:key="item.id"
:label="item.id"
>{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="岗位">
@ -619,6 +645,7 @@ export default {
dicts: [
'sys_normal_disable',
'sys_user_sex',
'user_psn_type',
'sys_login_type',
'sys_user_permanent',
],
@ -657,6 +684,7 @@ export default {
roleOptions: [],
//
loginTypeArr: [],
isCustomerList:[{id:"0",name:"是"},{id:"1",name:"否"}],
//
multipleLimit: 1,
//
@ -895,6 +923,7 @@ export default {
email: undefined,
sex: undefined,
status: '0',
isCustomer: '0',
remark: undefined,
postIds: [],
roleIds: [],