厨房设备管理接口对接
This commit is contained in:
parent
a86e9823ca
commit
6885c5ccbb
|
|
@ -0,0 +1,85 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询设备-下拉框
|
||||
export function getKitchenDeviceTypeApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_info/deviceType',
|
||||
method: 'get',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 查询设备-下拉框
|
||||
export function getKitchenDeviceSelectApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_info/select',
|
||||
method: 'get',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设备列表
|
||||
export function getKitchenDeviceListApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_info/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 设备新增
|
||||
export function addKitchenDeviceApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_info/add',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设备
|
||||
export function editKitchenDeviceApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_info/edit',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
export function delKitchenDeviceApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_info/del',
|
||||
method: 'post',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询设备使用记录
|
||||
export function getKitchenDeviceUsageApi(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/kitchen_device_usage/list',
|
||||
method: 'get',
|
||||
headers: {
|
||||
"merchant-id":"378915229716713472",
|
||||
},
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
<div style="width: 100%;margin: 10px auto;border: 1px solid #ccc;padding: 10px;border-radius: 10px;">
|
||||
<div style="font-weight: bold;border-left: 4px solid #1890FF;padding-left: 4px;">存储设置</div>
|
||||
<div class="item">
|
||||
<!-- <div class="item">
|
||||
<div>
|
||||
<div>
|
||||
<span class="item-label">晨检视频存储时长设置:</span>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
<div style="color: #999;font-size: 14px;margin-top: 10px">超过存储时长的员工晨检视频,系统会自动清除</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="item">
|
||||
<div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
></el-input>
|
||||
<span class="item-unit">{{item.measureUnit}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="item.deviceType!=15">
|
||||
<span class="item-label"></span>
|
||||
<span>低于</span>
|
||||
<el-input
|
||||
|
|
|
|||
|
|
@ -1,21 +1,27 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div style="width: 100%;overflow-y: auto;">
|
||||
<el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
|
||||
<el-tab-pane :label="item.label" :name="item.key" v-for="(item,index) in deviceTypeList" :key="index"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关键字" prop="searchValue">
|
||||
<el-input v-model="queryParams.searchValue" placeholder="请输入设备名称,编号" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="faceStatus">
|
||||
<el-select v-model="queryParams.faceStatus" style="width: 240px" clearable>
|
||||
<el-option label="在线" value="0"></el-option>
|
||||
<el-option label="离线" value="1"></el-option>
|
||||
<el-form-item label="设备状态" prop="deviceNetworkState">
|
||||
<el-select v-model="queryParams.deviceNetworkState" style="width: 240px" clearable>
|
||||
<el-option label="在线" value="1"></el-option>
|
||||
<el-option label="离线" value="2"></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-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
|
|
@ -35,12 +41,17 @@
|
|||
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编号" align="center" prop="canteenNum" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备状态" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备名称" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备SN码" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备编号" align="center" prop="deviceNo" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备状态" align="center" prop="deviceNetworkState" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.deviceNetworkState==1">在线</span>
|
||||
<span v-if="scope.row.deviceNetworkState==2">离线</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备SN码" align="center" prop="deviceSn" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="位置" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="位置" align="center" prop="subPlace" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -76,31 +87,31 @@
|
|||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编号:" prop="devicesNum">
|
||||
<el-input v-model="form.devicesNum"
|
||||
<el-form-item label="设备编号:" prop="deviceNo">
|
||||
<el-input v-model="form.deviceNo"
|
||||
placeholder="请输入设备编号"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称:" prop="devicesName">
|
||||
<el-input v-model="form.userName"
|
||||
<el-form-item label="设备名称:" prop="deviceName">
|
||||
<el-input v-model="form.deviceName"
|
||||
placeholder="请输入设备名称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备SN码:" prop="devicesSn">
|
||||
<el-input v-model="form.userName"
|
||||
placeholder="请输入设备名称"
|
||||
<el-form-item label="设备SN码:" prop="deviceSn">
|
||||
<el-input v-model="form.deviceSn"
|
||||
placeholder="请输入设备SN码"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属食堂:" prop="userName">
|
||||
<el-form-item label="关联食堂:" prop="canteenId">
|
||||
<el-select v-model="form.canteenId" style="width: 100%;" placeholder="请选择关联食堂">
|
||||
<el-option
|
||||
v-for="item in canteenOptions"
|
||||
|
|
@ -112,8 +123,8 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="位置:" prop="userName">
|
||||
<el-input v-model="form.userName"
|
||||
<el-form-item label="位置:" prop="subPlace">
|
||||
<el-input v-model="form.subPlace"
|
||||
placeholder="请输入位置"
|
||||
maxlength="11"
|
||||
/>
|
||||
|
|
@ -135,7 +146,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getPageCanteenApi } from "@/api/base/canteen";
|
||||
import { getKitchenDeviceTypeApi, getKitchenDeviceListApi, addKitchenDeviceApi, editKitchenDeviceApi, delKitchenDeviceApi } from "@/api/kitchen/devices";
|
||||
import { getCanteenByAreaApi } from "@/api/base/stall";
|
||||
export default {
|
||||
name: "",
|
||||
|
|
@ -156,6 +167,7 @@ export default {
|
|||
total: 0,
|
||||
//表格数据
|
||||
tableListData: [],
|
||||
deviceTypeList: [],
|
||||
canteenOptions: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
|
|
@ -168,6 +180,7 @@ export default {
|
|||
canteenName: undefined,
|
||||
areaNameStr: undefined,
|
||||
},
|
||||
activeName:"1",
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
|
|
@ -183,9 +196,22 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getCanteenList();
|
||||
// this.getList();
|
||||
this.getKitchenDeviceType();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 设备类型选项
|
||||
getKitchenDeviceType(){
|
||||
getKitchenDeviceTypeApi({}).then((response) => {
|
||||
let obj = response.data
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
console.log(`Key: ${key}, Value: ${obj[key]}`);
|
||||
this.deviceTypeList.push({"key":key,"label":obj[key]})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 食堂选项
|
||||
getCanteenList(){
|
||||
getCanteenByAreaApi({}).then((response) => {
|
||||
|
|
@ -202,15 +228,21 @@ export default {
|
|||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleTabClick(tab, event) {
|
||||
console.log(tab.name,tab.label)
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let param = {
|
||||
"current": this.queryParams.pageNum,
|
||||
"size": this.queryParams.pageSize,
|
||||
"deviceType":this.activeName,
|
||||
"deviceNetworkState":this.queryParams.deviceNetworkState,
|
||||
"pageNum": this.queryParams.pageNum,
|
||||
"pageSize": this.queryParams.pageSize,
|
||||
}
|
||||
getPageCanteenApi(param).then(response => {
|
||||
this.tableListData = response.records;
|
||||
getKitchenDeviceListApi(param).then(response => {
|
||||
this.tableListData = response.rows;
|
||||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
@ -223,13 +255,10 @@ export default {
|
|||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
// const dictId = row.dictId || this.ids
|
||||
// getType(dictId).then(response => {
|
||||
// this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
// });
|
||||
this.reset();
|
||||
this.form = Object.assign({}, row)
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
|
|
@ -244,21 +273,22 @@ export default {
|
|||
/** 提交按钮 */
|
||||
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();
|
||||
// });
|
||||
if (valid) {
|
||||
this.form.deviceType = this.activeName
|
||||
if (this.form.deviceId != undefined) {
|
||||
editKitchenDeviceApi(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();
|
||||
// });
|
||||
addKitchenDeviceApi(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
|
|
|
|||
|
|
@ -4,8 +4,15 @@
|
|||
<el-form-item label="关键字" prop="searchValue">
|
||||
<el-input v-model="queryParams.searchValue" placeholder="请输入设备名称,编号" maxlength="20" clearable style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入设备类型" maxlength="20" clearable style="width: 240px"/>
|
||||
<el-form-item label="设备类型" prop="deviceType">
|
||||
<el-select v-model="queryParams.deviceType" style="width: 100%;" placeholder="请选择设备类型">
|
||||
<el-option
|
||||
v-for="item in deviceTypeList"
|
||||
:key="item.key"
|
||||
:label="item.label"
|
||||
:value="item.key"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
|
@ -23,15 +30,20 @@
|
|||
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备信息" align="center" prop="canteenNum" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备类型" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="设备类型" align="center" prop="deviceType" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="位置" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="工作状态" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="开始使用时间" align="center" prop="canteenName" :show-overflow-tooltip="true" width="160"/>
|
||||
<el-table-column label="结束使用时间" align="center" prop="canteenName" :show-overflow-tooltip="true" width="160"/>
|
||||
<el-table-column label="使用时长(h)" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="离线时长(h)" align="center" prop="canteenName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="位置" align="center" prop="subPlace" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="工作状态" align="center" prop="deviceNetworkState" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.deviceNetworkState==1">在线</span>
|
||||
<span v-if="scope.row.deviceNetworkState==2">离线</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始使用时间" align="center" prop="" :show-overflow-tooltip="true" width="160"/>
|
||||
<el-table-column label="结束使用时间" align="center" prop="" :show-overflow-tooltip="true" width="160"/>
|
||||
<el-table-column label="使用时长(h)" align="center" prop="" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="离线时长(h)" align="center" prop="" :show-overflow-tooltip="true" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
|
|
@ -54,7 +66,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { getPageCanteenApi } from "@/api/base/canteen";
|
||||
import { getKitchenDeviceUsageApi,getKitchenDeviceTypeApi } from "@/api/kitchen/devices";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
|
|
@ -75,6 +87,7 @@ export default {
|
|||
total: 0,
|
||||
//表格数据
|
||||
tableListData: [],
|
||||
deviceTypeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
|
|
@ -83,8 +96,8 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
canteenName: undefined,
|
||||
areaNameStr: undefined,
|
||||
deviceType: undefined,
|
||||
searchValue: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
|
@ -100,9 +113,22 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
// this.getList();
|
||||
this.getKitchenDeviceType();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
// 设备类型选项
|
||||
getKitchenDeviceType(){
|
||||
getKitchenDeviceTypeApi({}).then((response) => {
|
||||
let obj = response.data
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
console.log(`Key: ${key}, Value: ${obj[key]}`);
|
||||
this.deviceTypeList.push({"key":key,"label":obj[key]})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
@ -116,12 +142,8 @@ export default {
|
|||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
let param = {
|
||||
"current": this.queryParams.pageNum,
|
||||
"size": this.queryParams.pageSize,
|
||||
}
|
||||
getPageCanteenApi(param).then(response => {
|
||||
this.tableListData = response.records;
|
||||
getKitchenDeviceUsageApi(this.queryParams).then(response => {
|
||||
this.tableListData = response.rows;
|
||||
this.total = Number(response.total);
|
||||
this.loading = false;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue