Commit 412a074e by lixiaomin

提交

parent b26f62ed
......@@ -44,7 +44,24 @@ export function getCoffeeList(id) {
// 提交原料
export function addMaterial(data) {
return request({
url: "v1/add/machine/component/material",
url: "/v1/add/machine/component/material",
method: "post",
data: data,
});
}
// 组件属性监控
export function getAttributeList(id) {
return request({
url: "/v1/machine/property/list?machine_id=" + id,
method: "get",
});
}
// 更新状态
export function updateState(data) {
return request({
url: "/v1/update/machine/state",
method: "post",
data: data,
});
......
import request from "@/utils/request";
// 机型组件
export function getModelComponentList(id) {
return request({
url: "/v1/model/component?model_id=" + id,
method: "get",
});
}
// 机型列表
export function getModelList() {
return request({
url: "/v1/machine/model",
method: "get",
});
}
<template>
<div class="app-container">
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="优惠券类别" >
<el-input v-model="queryParams.name" clearable @keyup.enter.native="handleQuery"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="queryParams.state" placeholder="请选择状态" clearable @keyup.enter.native="handleQuery">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="机器型号">
<el-select v-model="queryParams.model_id" placeholder="请选择机器型号" clearable @keyup.enter.native="handleQuery">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
v-for="item in modelList"
:key="item.id"
:label="item.model_name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="机器编码" >
<el-input placeholder="请输入机器编码" v-model="queryParams.code" clearable @keyup.enter.native="handleQuery"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:category:query']">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> -->
</el-form>
<el-table v-loading="loading" :data="machineList">
<el-table-column label="机器编码" align="center">
......@@ -34,14 +34,21 @@
<a @click="handleComponentDialog(scope.row)" style="color: blue">管理组件</a>
</template>
</el-table-column>
<el-table-column label="组件属性监控" align="center" />
<el-table-column label="组件属性监控" align="center">
<template slot-scope="scope">
<a @click="handleAttributeDialog(scope.row)" style="color: blue">查看</a>
</template>
</el-table-column>
<el-table-column label="其他设置" align="center">
<template slot-scope="scope">
<a @click="handleOtherDialog(scope.row)" style="color: blue">查看</a>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<el-button size="mini" type="text" @click="handleBinding()">店铺绑定</el-button>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.limit"
@pagination="getList" />
<!-- 机器日志对话框 -->
<MachineDetailsLog ref="machineDetailsLog" ></MachineDetailsLog>
......@@ -49,17 +56,21 @@
<MachineDetailsCom ref="machineDetailsCom" ></MachineDetailsCom>
<!-- 其他组件对话框 -->
<MachineDetailsOther ref="machineDetailsOther" ></MachineDetailsOther>
<!-- 组件属性监控对话框 -->
<MachineDetailsAttribute ref="machineDetailsAttribute" ></machineDetailsAttribute>
</div>
</template>
<script>
import {getMachineList
import {getMachineList,updateState
} from "@/api/machine/machineDetails";
import MachineDetailsLog from './machineDetailsLog.vue';
import MachineDetailsCom from './machineDetailsCom.vue';
import MachineDetailsOther from './machineDetailsOther.vue';
import MachineDetailsAttribute from './machineDetailsAttribute.vue';
import {getModelList} from "@/api/model/model";
export default {
components: { MachineDetailsLog,MachineDetailsCom,MachineDetailsOther},
components: { MachineDetailsLog,MachineDetailsCom,MachineDetailsOther,MachineDetailsAttribute},
data() {
return {
// 遮罩层
......@@ -70,13 +81,15 @@ export default {
machineList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
}
page: 1,
limit: 10,
},
modelList:[]
};
},
created() {
this.getList();
this.getModelList();
},
methods: {
/** 查询列表 */
......@@ -90,16 +103,24 @@ export default {
}
});
},
//获取机器型号
getModelList(){
getModelList().then((response) => {
if(response.code==0){
this.modelList = response.data;
}
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams.name=null;
this.queryParams.state=null;
this.handleQuery();
this.getList();
},
//日志
handleLogDialog(row){
......@@ -109,9 +130,29 @@ export default {
handleComponentDialog(row){
this.$refs.machineDetailsCom.handleComDiaLog(row);
},
//属性监控
handleAttributeDialog(row){
this.$refs.machineDetailsAttribute.handleAttributeDialog(row);
},
//其他设置
handleOtherDialog(row){
this.$refs.machineDetailsOther.handleOthDiaLog(row);
},
//店铺绑定
handleBinding(){
this.$router.push("/shop/shop/");
},
//更新状态
updateState(row){
let obj={
"machine_id":row.id,
"state":''
}
updateState(obj).then((response) => {
if(response.code==0){
}
});
}
}
};
......
<template>
<div>
<el-dialog title="组件属性监控" :visible.sync="attributeDiaLog" width="700px" append-to-body class="dialogClass">
<el-tabs v-model="activeName" >
<el-tab-pane label="组件属性" name="first" >
<div v-for="item in attributeData" :key="item.id">
<el-row style="margin-bottom: 10px;">
<el-col :span="3"><div >组件名称:</div></el-col>
<el-col :span="10"><div >{{item.component_name}}</div></el-col>
</el-row>
<el-row style="margin-bottom: 10px;">
<el-col :span="3"><div >组件属性:</div></el-col>
<el-col :span="20">
<el-row v-for="pro in item.property" :key="pro.property_name">
<el-col :span="4"><div >{{pro.property_name}}</div></el-col>
<el-col :span="10"><div >{{pro.value}}</div></el-col>
</el-row>
</el-col>
</el-row>
<el-divider/>
</div>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer" >
<el-button type="primary" @click="attributeDiaLogCancel" >确定</el-button>
<el-button @click="attributeDiaLogCancel">退出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getAttributeList} from "@/api/machine/machineDetails";
export default {
data() {
return {
attributeDiaLog:false,
activeName:"first",
attributeData:[]
};
},
created() {
},
methods: {
//弹出组件属性监控
handleAttributeDialog(row){
this.attributeDiaLog=true;
this.getAttributeList(row.id);
},
getAttributeList(id){
getAttributeList(id).then((response) => {
if(response.code==0){
this.attributeData = response.data;
}
});
},
attributeDiaLogCancel(){
this.attributeDiaLog=false;
}
}
};
</script>
<style lang="scss">
.dialogClass .el-dialog__body {
padding: 0px 20px;
}
</style>
\ No newline at end of file
<template>
<div>
机型
</div>
</template>
\ No newline at end of file
<template>
<div class="app-container">
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="100px">
<el-form-item label="机器型号">
<el-select v-model="queryParams.model_id" placeholder="请选择机器型号" clearable @keyup.enter.native="handleQuery">
<el-option
v-for="item in modelList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="机器编码" >
<el-input placeholder="请输入机器编码" v-model="queryParams.code" clearable @keyup.enter.native="handleQuery"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" v-hasPermi="['coupon:category:query']">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> -->
<el-table v-loading="loading" :data="modelList">
<el-table-column label="机器型号" align="center" prop="model_name"/>
<el-table-column label="创建时间" align="center" prop="created_at" />
<el-table-column label="组件管理" align="center">
<template slot-scope="scope">
<a @click="handleComponentDialog(scope.row)" style="color: blue">管理组件</a>
</template>
</el-table-column>
<el-table-column label="机器数量" align="center" prop=""/>
<el-table-column label="备注说明" align="center" prop=""/>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.limit"
@pagination="getList" />
<!-- 组件对话框 -->
<ModelCom ref="modelCom" ></ModelCom>
</div>
</template>
<script>
import {getModelList} from "@/api/model/model";
import ModelCom from './modelCom.vue';
export default {
components: {ModelCom },
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 表格数据
modelList: [],
// 查询参数
queryParams: {
page: 1,
limit: 10,
},
modelList:[]
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
getModelList(this.queryParams).then((response) => {
if(response.code==0){
this.modelList = response.data;
this.total = response.data.length;
this.loading = false;
}
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.getList();
},
//组件
handleComponentDialog(row){
this.$refs.modelCom.handleModelComDialog(row.id);
},
}
};
</script>
<template>
<div>
<el-dialog title="机型设置" :visible.sync="comDiaLog" width="900px" append-to-body >
<el-tabs v-model="activeName" >
<el-tab-pane label="机器组件" name="first" >
<el-table v-loading="loading" :data="modelComponentList">
<el-table-column label="组件类型" align="center" prop="type_desc" />
<el-table-column label="组件名称" align="center" prop="component_name" />
<el-table-column label="组件编码" align="center" prop="ros_code" />
<el-table-column label="备注说明" align="center" prop=""/>
<el-table-column label="组件状态" align="center" prop="state"/>
<el-table-column label="原料" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleEditDialog(scope.row)">编辑组件属性</el-button>
<el-button size="mini" type="text" @click="handlDelete(scope.row)(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer" >
<el-button type="primary" @click="comDiaLogCancel" >确定</el-button>
<el-button @click="comDiaLogCancel">退出</el-button>
</div>
</el-dialog>
<el-dialog title="编辑组件属性" :visible.sync="editDiaLog" width="800px" append-to-body>
<el-row style="margin-bottom: 10px;">
<el-col :span="3"><div >组件名称:</div></el-col>
<el-col :span="10"><div >{{}}</div></el-col>
</el-row>
<el-row style="margin-bottom: 10px;">
<el-col :span="3"><div >组件属性:</div></el-col>
<el-col :span="20">
<el-row v-for="(item,idx) in comAry" :key="idx">
<el-col :span="4"><div ><el-input v-model="item.pro_name" placeholder="输入属性名"/></div></el-col>
<el-col :span="6">
<div>
<el-select v-model="item.type" placeholder="请选择属性类型">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</el-col>
<el-col :span="6"><div ><el-input v-model="item.pro_ros_code" placeholder="输入ROS硬件编码"/></div></el-col>
<el-col :span="2">
<el-button @click="addItem">+</el-button>
</el-col>
</el-row>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer" >
<el-button type="primary" @click="editDiaLogCancel" >确定</el-button>
<el-button @click="editDiaLogCancel">退出</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getModelComponentList} from "@/api/model/model";
export default {
data() {
return {
// 遮罩层
loading: true,
comDiaLog:false,
activeName:"first",
modelId:"",
modelComponentList:[],
editDiaLog:false,
options:[
{
value: '1',
label: '开关'
},
{
value: '2',
label: '状态'
},
{
value: '3',
label: '时间(年月日)'
},
{
value: '4',
label: '时间(日分秒)'
},
{
value: '5',
label: '值'
}
],
pro_name:"",
type:"",
pro_ros_code:"",
comAry:[{pro_name:"",type:"",pro_ros_code:""}],
};
},
created() {
},
methods: {
addItem(){
this.comAry.push({pro_name:"",type:"",pro_ros_code:""});
console.log("this.comAry",this.comAry);
},
//弹出机型组件页面
handleModelComDialog(id){
this.comDiaLog=true;
this.modelId=id;
this.activeName="first";
this.getModelComponentList();
},
getModelComponentList(){
this.loading = true;
getModelComponentList(this.modelId).then((response) => {
if(response.code==0){
this.modelComponentList = response.data;
this.loading = false;
}
});
},
//弹出编辑组件属性
handleEditDialog(){
this.editDiaLog=true;
},
comDiaLogCancel(){
this.comDiaLog=false
},
editDiaLogCancel(){
this.editDiaLog=false
}
}
};
</script>
<style lang="scss">
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment