项目初始化

This commit is contained in:
2025-07-18 11:16:12 +08:00
parent fa2608f906
commit 138eb96729
2 changed files with 40 additions and 31 deletions

View File

@@ -17,30 +17,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="日产能" prop="capacity">
<el-input
v-model="queryParams.capacity"
placeholder="请输入日产能"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产能单位" prop="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入产能单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否启用" prop="isEnabled">
<el-input
v-model="queryParams.isEnabled"
placeholder="请输入是否启用"
clearable
@keyup.enter.native="handleQuery"
/>
</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>
@@ -100,7 +77,18 @@
<el-table-column label="产线名称" align="center" prop="lineName" />
<el-table-column label="日产能" align="center" prop="capacity" />
<el-table-column label="产能单位" align="center" prop="unit" />
<el-table-column label="是否启用" align="center" prop="isEnabled" />
<el-table-column label="是否启用" align="center" prop="isEnabled">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isEnabled"
:active-value="1"
:inactive-value="0"
active-text="启用"
inactive-text="禁用"
@change="handleEnabledChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@@ -146,7 +134,13 @@
<el-input v-model="form.unit" placeholder="请输入产能单位" />
</el-form-item>
<el-form-item label="是否启用" prop="isEnabled">
<el-input v-model="form.isEnabled" placeholder="请输入是否启用" />
<el-switch
v-model="form.isEnabled"
:active-value="1"
:inactive-value="0"
active-text="启用"
inactive-text="禁用"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
@@ -333,6 +327,26 @@ export default {
this.download('klp/productionLine/export', {
...this.queryParams
}, `productionLine_${new Date().getTime()}.xlsx`)
},
handleEnabledChange(row) {
// 只更新isEnabled字段
const updateData = {
lineId: row.lineId,
isEnabled: row.isEnabled
};
this.loading = true;
updateProductionLine(updateData)
.then(() => {
this.$modal.msgSuccess("状态更新成功");
})
.catch(() => {
this.$modal.msgError("状态更新失败");
// 回滚状态
row.isEnabled = row.isEnabled === 1 ? 0 : 1;
})
.finally(() => {
this.loading = false;
});
}
}
};

View File

@@ -28,31 +28,26 @@ public class WmsProductionLineBo extends BaseEntity {
/**
* 产线编号
*/
@NotBlank(message = "产线编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String lineCode;
/**
* 产线名称
*/
@NotBlank(message = "产线名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String lineName;
/**
* 日产能(单位同产品)
*/
@NotNull(message = "日产能(单位同产品)不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal capacity;
/**
* 产能单位
*/
@NotBlank(message = "产能单位不能为空", groups = { AddGroup.class, EditGroup.class })
private String unit;
/**
* 是否启用0=否1=是)
*/
@NotNull(message = "是否启用0=否1=是)不能为空", groups = { AddGroup.class, EditGroup.class })
private Integer isEnabled;
/**