设备增加设备名以及设备看板更新

This commit is contained in:
zhangjunwen 2024-09-29 17:54:18 +08:00
parent 981bb9e51e
commit 4d805279c9
8 changed files with 276 additions and 69 deletions

View File

@ -23,6 +23,11 @@ public class EquipInfoDetailsVO {
*/
private String equipNo;
/**
* 设备名称
*/
private String equipName;
/**
* 客户信息id
*/
@ -48,6 +53,11 @@ public class EquipInfoDetailsVO {
*/
private Integer status;
/**
* 机床运行状态
*/
private Integer runStatus;
/**
* 技术参数
*/

View File

@ -22,4 +22,6 @@ public class EquipInfoPageReqVO extends PageParam {
@Schema(description = "机床状态")
private Integer status;
@Schema(description = "机床运行状态")
private Integer runStatus;
}

View File

@ -37,6 +37,10 @@ public class EquipInfoRespVO {
@ExcelProperty("机床设备编号")
private String equipNo;
@Schema(description = "机床设备名称", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("机床设备名称")
private String equipName;
@Schema(description = "生产日期")
@ExcelProperty("生产日期")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)

View File

@ -31,6 +31,10 @@ public class EquipInfoSaveReqVO {
@Size(message = "机床设备编号最大不允许超过30个字符", max = 30)
private String equipNo;
@Schema(description = "机床设备名称", requiredMode = Schema.RequiredMode.REQUIRED)
@Size(message = "机床设备名称不允许超过50个字符", max = 30)
private String equipName;
@Schema(description = "生产日期")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date productDate;

View File

@ -38,6 +38,12 @@ public class EquipInfoDO extends BaseDO {
* 客户信息id
*/
private String customerId;
/**
* 机床设备名称
*/
private String equipName;
/**
* 机床设备编号
*/
@ -59,6 +65,12 @@ public class EquipInfoDO extends BaseDO {
*
*/
private Integer status;
/**
* 机床运行状态
*/
private Integer runStatus;
/**
* 二维码图片路径
*/

View File

@ -45,6 +45,7 @@ public class EquipInfoServiceImpl implements EquipInfoService {
public String createEquipInfo(EquipInfoSaveReqVO createReqVO) {
// 插入
EquipInfoDO equipInfo = BeanUtils.toBean(createReqVO, EquipInfoDO.class);
equipInfo.setRunStatus(0);//新增设备默认正常
equipInfoMapper.insert(equipInfo);
// 返回
return equipInfo.getEquipId();

View File

@ -1,104 +1,250 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="机床型号" prop="modelId">
<el-select v-model="queryParams.modelId" placeholder="请选择机床型号" clearable size="small">
<el-option v-for="item in modelSelection"
:key="item.modelId" :label="item.modelName" :value="item.modelId"/>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item
label="机床型号"
prop="modelId"
>
<el-select
v-model="queryParams.modelId"
placeholder="请选择机床型号"
clearable
size="small"
>
<el-option
v-for="item in modelSelection"
:key="item.modelId"
:label="item.modelName"
:value="item.modelId"
/>
</el-select>
</el-form-item>
<el-form-item label="客户信息" prop="customerId">
<el-select v-model="queryParams.customerId" placeholder="请选择客户信息" clearable size="small">
<el-option v-for="item in customerSelection"
:key="item.customerId" :label="item.customerName" :value="item.customerId"/>
<el-form-item
label="客户信息"
prop="customerId"
>
<el-select
v-model="queryParams.customerId"
placeholder="请选择客户信息"
clearable
size="small"
>
<el-option
v-for="item in customerSelection"
:key="item.customerId"
:label="item.customerName"
:value="item.customerId"
/>
</el-select>
</el-form-item>
<el-form-item label="机床设备编号" prop="equipNo">
<el-input v-model="queryParams.equipNo" placeholder="请输入机床设备编号" clearable
@keyup.enter.native="handleQuery"/>
<el-form-item
label="机床设备编号"
prop="equipNo"
>
<el-input
v-model="queryParams.equipNo"
placeholder="请输入机床设备编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="机床状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择机床状态" clearable size="small">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQUIP_STATUS)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
<el-form-item
label="机床状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择机床状态"
clearable
size="small"
>
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.EQUIP_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
>搜索</el-button>
<el-button
icon="el-icon-refresh"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['imt:equip-info:create']">新增
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="openForm(undefined)"
v-hasPermi="['imt:equip-info:create']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['imt:equip-info:export']">导出
v-hasPermi="['imt:equip-info:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="机床设备编号" align="center" prop="equipNo"/>
<el-table-column label="机床型号" align="center" prop="modelName"/>
<el-table-column label="客户信息" align="center" prop="customerName"/>
<el-table-column label="生产日期" align="center" prop="productDate" width="180"/>
<el-table-column label="出厂日期/购买日期" align="center" prop="purchaseDate" width="180"/>
<el-table-column label="保修到期日期" align="center" prop="expireDate" width="180"/>
<el-table-column label="机床状态" align="center" prop="status">
<el-table
v-loading="loading"
:data="list"
:stripe="true"
:show-overflow-tooltip="true"
>
<el-table-column
label="机床设备编号"
align="center"
prop="equipNo"
/>
<el-table-column
label="机床设备名称"
align="center"
prop="equipName"
/>
<el-table-column
label="机床型号"
align="center"
prop="modelName"
/>
<el-table-column
label="客户信息"
align="center"
prop="customerName"
/>
<el-table-column
label="生产日期"
align="center"
prop="productDate"
width="180"
/>
<el-table-column
label="出厂日期/购买日期"
align="center"
prop="purchaseDate"
width="180"
/>
<el-table-column
label="保修到期日期"
align="center"
prop="expireDate"
width="180"
/>
<el-table-column
label="机床状态"
align="center"
prop="status"
>
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.EQUIP_STATUS" :value="scope.row.status"/>
<dict-tag
:type="DICT_TYPE.EQUIP_STATUS"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column label="二维码" align="center" prop="qrcodePicPath">
<!-- <el-table-column label="二维码" align="center" prop="qrcodePicPath">
<template v-slot="scope">
<span v-if="scope.row.qrcodePicPath == null || scope.row.qrcodePicPath === ''">-</span>
<!-- <img-->
<!-- :src="scope.row.qrcodePicPath"-->
<!-- style="display: block; width: 100px; height: 100px; margin: 0 auto"-->
<!-- />-->
<el-image v-else
style="width: 100px; height: 100px"
:src="scope.row.qrcodePicPath"
:preview-src-list="[scope.row.qrcodePicPath]"></el-image>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
</el-table-column> -->
<el-table-column
label="备注"
align="center"
prop="remark"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.equipId)"
v-hasPermi="['imt:equip-info:update']">修改
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="openForm(scope.row.equipId)"
v-hasPermi="['imt:equip-info:update']"
>修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['imt:equip-info:delete']">删除
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['imt:equip-info:delete']"
>删除
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDetails(scope.row.equipId)"
v-hasPermi="['imt:equip-info:query']">设备详情
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDetails(scope.row.equipId)"
v-hasPermi="['imt:equip-info:query']"
>设备详情
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 对话框(添加 / 修改) -->
<EquipInfoForm ref="formRef" @success="getList"/>
<EquipInfoForm
ref="formRef"
@success="getList"
/>
</div>
</template>
<script>
import * as EquipInfoApi from '@/api/system/equip/equipInfo';
import {getCustomerSelection} from '@/api/system/baseData/customerInfo';
import {getModelSelection} from '@/api/system/baseData/modelinfo';
import EquipInfoForm from './EquipInfoForm.vue';
import * as EquipInfoApi from "@/api/system/equip/equipInfo";
import { getCustomerSelection } from "@/api/system/baseData/customerInfo";
import { getModelSelection } from "@/api/system/baseData/modelinfo";
import EquipInfoForm from "./EquipInfoForm.vue";
export default {
name: "EquipInfo",
@ -138,16 +284,19 @@ export default {
},
created() {
this.getList();
getCustomerSelection().then(res=>{
getCustomerSelection().then((res) => {
this.customerSelection = res;
})
getModelSelection().then(res=>{
});
getModelSelection().then((res) => {
this.modelSelection = res;
})
});
},
methods: {
handleDetails(equipId) {
this.$router.push({ path: "/equip/equipdetails", query: { equipId: equipId}});
this.$router.push({
path: "/equip/equipdetails",
query: { equipId: equipId },
});
},
/** 查询列表 */
async getList() {
@ -177,26 +326,27 @@ export default {
/** 删除按钮操作 */
async handleDelete(row) {
const equipId = row.equipId;
await this.$modal.confirm('是否确认删除设备编号编号为"' + row.equipNo + '"的数据项?')
await this.$modal.confirm(
'是否确认删除设备编号编号为"' + row.equipNo + '"的数据项?'
);
try {
await EquipInfoApi.deleteEquipInfo(equipId);
await this.getList();
this.$modal.msgSuccess("删除成功");
} catch {
}
} catch {}
},
/** 导出按钮操作 */
async handleExport() {
await this.$modal.confirm('是否确认导出所有机床信息数据项?');
await this.$modal.confirm("是否确认导出所有机床信息数据项?");
try {
this.exportLoading = true;
const data = await EquipInfoApi.exportEquipInfoExcel(this.queryParams);
this.$download.excel(data, '机床信息.xls');
this.$download.excel(data, "机床信息.xls");
} catch {
} finally {
this.exportLoading = false;
}
},
}
},
};
</script>

View File

@ -68,6 +68,24 @@
<span class="con-prop">{{ item.workTime }}</span>
</div>
</div>
<div
v-if="item.status == 0"
class="content"
style="margin-top:5%"
>
<div class="equ-content">
<span class="con-name">今日工作时间</span>
<span class="con-prop">{{ item.dailyWorkTime + "小时" }} </span>
</div>
<div class="equ-content">
<span class="con-name">今日加工件数</span>
<span class="con-prop">{{ item.dailyProcessNum + "件" }} </span>
</div>
<div class="equ-content">
<span class="con-name">今日效率</span>
<span class="con-prop">{{ item.dailyEffect +"件/每小时" }} </span>
</div>
</div>
<el-card
v-if="item.status == 2"
style="margin-top:15px"
@ -120,6 +138,9 @@ export default {
processNum: 100,
workTime: "08:30:21",
maintananceStatus: 1,
dailyWorkTime: 7.6,
dailyProcessNum: 238,
dailyEffect: 31.3,
},
{
modelName: "QB18043",
@ -131,6 +152,9 @@ export default {
processNum: 100,
workTime: "03:24:11",
maintananceStatus: 2,
dailyWorkTime: 7.6,
dailyProcessNum: 238,
dailyEffect: 31.3,
},
],
};