双屏机设备管理

This commit is contained in:
zzyuan 2025-04-09 10:02:02 +08:00
parent e804ff9812
commit e337b10466
4 changed files with 67 additions and 41 deletions

View File

@ -38,31 +38,31 @@ export function updateDeviceApi(data) {
})
}
// 删除设备信息
export function deleteDeviceApi(data) {
return request({
url: '/smart-canteen/doubleScreenMachine/delete',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// export function deleteDeviceApi(deviceId){
// const formData = new FormData()
// formData.append('deviceId', deviceId)
// // 删除设备信息
// export function deleteDeviceApi(data) {
// return request({
// url: '/smart-canteen/doubleScreenMachine/delete',
// method: 'post',
// data: formData,
// headers: {
// "merchant-id":"378915229716713472",
// },
// header:'multipart/form-data'
// url: '/smart-canteen/doubleScreenMachine/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/doubleScreenMachine/delete',
method: 'post',
data: formData,
headers: {
"merchant-id":"378915229716713472",
},
header:'multipart/form-data'
})
}
// 获取指定日期菜谱计划菜品详情

View File

@ -337,7 +337,7 @@ export default {
let param= {
"areaId":e,
"canteenType":1,
"pagenation"
"pagenation":true
}
getCanteenByAreaApi(param).then((response) => {
this.canteenOptions=response.rows||[]

View File

@ -150,7 +150,7 @@
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号" prop="deviceNum">
<el-input v-model="baseForm.deviceNum" placeholder="请输入设备编号" maxlength="30" clearable/>
@ -160,7 +160,7 @@
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="baseForm.deviceName" placeholder="请输入设备名称" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-col>
<el-col :span="12">
<el-form-item label="设备Sn" prop="deviceSn">
<el-input v-model="baseForm.deviceSn" placeholder="请输入设备Sn" maxlength="30" clearable/>
@ -314,7 +314,20 @@
activeName:"baseSetting",
deviceData:{},
//
baseForm: {},
baseForm: {
areaId:null,
canteenId:null,
stallId:null,
deviceNum:"",
deviceName:"",
deviceSn:"",
deviceIp:"",
deviceKey:"",
deviceAddr:"",
deviceMac:"",
deviceGateway:"",
devicePwd:""
},
canteenOptions2:[],//-
stallOptions2:[],//-
//
@ -382,18 +395,18 @@
mounted(){
this.getTreeData();
if(this.$route.query.areaId){
this.queryParams.areaId = this.$route.query.areaId+''
this.queryParams.areaId = this.$route.query.areaId
getCanteenByAreaApi({
"areaId":this.queryParams.areaId,"canteenType": 1
}).then((response) => {
this.canteenOptions=response.rows||[]
this.queryParams.canteenId=this.$route.query.canteenId+''
this.queryParams.canteenId=this.$route.query.canteenId
getStallByCanteenApi({
canteenId:this.queryParams.canteenId
}).then((response) => {
this.stallOptions=response.rows||[];
if(this.$route.query.canteenId){
this.queryParams.stallId=this.$route.query.stallId+''
this.queryParams.stallId=this.$route.query.stallId
}
});
});
@ -451,13 +464,13 @@
"canteenId":this.queryParams.canteenId,
"stallId":this.queryParams.stallId,
"keyWord":this.queryParams.keyWord,
"deviceType":20
// "deviceType":20
}
console.log("param",param)
let str = base64.encode(JSON.stringify(param))
// console.log(str)
getDeviceListPageApi({"content":str}).then(response => {
this.tableListData = response.records;
// let str = base64.encode(JSON.stringify(param))
// console.log({"content":str})
getDeviceListPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
@ -469,7 +482,20 @@
},
//
reset() {
this.baseForm = {};
this.baseForm = {
areaId:null,
canteenId:null,
stallId:null,
deviceNum:"",
deviceName:"",
deviceSn:"",
deviceIp:"",
deviceKey:"",
deviceAddr:"",
deviceMac:"",
deviceGateway:"",
devicePwd:""
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
@ -489,9 +515,9 @@
this.stallOptions2=response.rows||[]
});
this.baseForm = Object.assign({}, row)
this.$set(this.baseForm,"areaId",row.areaId)
this.$set(this.baseForm,"canteenId",row.canteenId)
this.$set(this.baseForm,"stallId",row.stallId)
this.$set(this.baseForm,"areaId",Number(row.areaId))
this.$set(this.baseForm,"canteenId",Number(row.canteenId))
this.$set(this.baseForm,"stallId",Number(row.stallId))
// this.$set(this,"metadata",row.deviceMetadata)
this.title = "修改";
},
@ -558,7 +584,7 @@
handleDelete(row) {
// const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
return deleteDeviceApi({deviceId:row.deviceId});
return deleteDeviceApi(row.deviceId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");

View File

@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://192.168.2.82:48380`,
target: `http://192.168.2.80:48380`,
// target: `http://192.168.0.244:58580`,
changeOrigin: true,
pathRewrite: {