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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -68,6 +68,24 @@
<span class="con-prop">{{ item.workTime }}</span> <span class="con-prop">{{ item.workTime }}</span>
</div> </div>
</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 <el-card
v-if="item.status == 2" v-if="item.status == 2"
style="margin-top:15px" style="margin-top:15px"
@ -120,6 +138,9 @@ export default {
processNum: 100, processNum: 100,
workTime: "08:30:21", workTime: "08:30:21",
maintananceStatus: 1, maintananceStatus: 1,
dailyWorkTime: 7.6,
dailyProcessNum: 238,
dailyEffect: 31.3,
}, },
{ {
modelName: "QB18043", modelName: "QB18043",
@ -131,6 +152,9 @@ export default {
processNum: 100, processNum: 100,
workTime: "03:24:11", workTime: "03:24:11",
maintananceStatus: 2, maintananceStatus: 2,
dailyWorkTime: 7.6,
dailyProcessNum: 238,
dailyEffect: 31.3,
}, },
], ],
}; };