胶料信息

This commit is contained in:
2026-05-20 15:30:42 +08:00
parent 84286a6769
commit 34b6ed4478
7 changed files with 157 additions and 59 deletions

View File

@@ -11,9 +11,9 @@ menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type),
is_route=VALUES(is_route), is_leaf=VALUES(is_leaf), hidden=VALUES(hidden), status=VALUES(status), del_flag=VALUES(del_flag),
always_show=VALUES(always_show), keep_alive=VALUES(keep_alive), internal_or_external=VALUES(internal_or_external);
-- 二级菜单料信息
-- 二级菜单料信息
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, menu_type, perms, perms_type, sort_no, is_route, is_leaf, hidden, status, del_flag, keep_alive, internal_or_external, create_by, create_time)
VALUES ('1860000000000000011', '1860000000000000001', '料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
VALUES ('1860000000000000011', '1860000000000000001', '料信息', '/mes/materialinfo', 'mes/materialinfo/index', 'MesMaterialList', 1, NULL, '1', 1, 1, 1, 0, '1', 0, 1, 0, 'admin', NOW())
ON DUPLICATE KEY UPDATE
parent_id=VALUES(parent_id), name=VALUES(name), url=VALUES(url), component=VALUES(component), component_name=VALUES(component_name),
menu_type=VALUES(menu_type), perms=VALUES(perms), perms_type=VALUES(perms_type), sort_no=VALUES(sort_no),

View File

@@ -22,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@Slf4j
@Tag(name = "MES-料信息")
@Tag(name = "MES-料信息")
@RestController
@RequestMapping("/mes/material/material")
public class MesMaterialController extends JeecgController<MesMaterial, IMesMaterialService> {
@@ -39,8 +39,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK(pageList);
}
@AutoLog(value = "MES-料信息-添加")
@Operation(summary = "MES-料信息-添加")
@AutoLog(value = "MES-料信息-添加")
@Operation(summary = "MES-料信息-添加")
@RequiresPermissions("mes:mes_material:add")
@PostMapping("/add")
public Result<String> add(@RequestBody MesMaterial model) {
@@ -49,8 +49,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK("添加成功!");
}
@AutoLog(value = "MES-料信息-编辑")
@Operation(summary = "MES-料信息-编辑")
@AutoLog(value = "MES-料信息-编辑")
@Operation(summary = "MES-料信息-编辑")
@RequiresPermissions("mes:mes_material:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody MesMaterial model) {
@@ -59,8 +59,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK("编辑成功!");
}
@AutoLog(value = "MES-料信息-通过id删除")
@Operation(summary = "MES-料信息-通过id删除")
@AutoLog(value = "MES-料信息-通过id删除")
@Operation(summary = "MES-料信息-通过id删除")
@RequiresPermissions("mes:mes_material:delete")
@DeleteMapping("/delete")
public Result<String> delete(@RequestParam(name = "id") String id) {
@@ -72,8 +72,8 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
return Result.OK("删除成功!");
}
@AutoLog(value = "MES-料信息-批量删除")
@Operation(summary = "MES-料信息-批量删除")
@AutoLog(value = "MES-料信息-批量删除")
@Operation(summary = "MES-料信息-批量删除")
@RequiresPermissions("mes:mes_material:deleteBatch")
@DeleteMapping("/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
@@ -94,7 +94,7 @@ public class MesMaterialController extends JeecgController<MesMaterial, IMesMate
@RequiresPermissions("mes:mes_material:exportXls")
@RequestMapping("/exportXls")
public ModelAndView exportXls(HttpServletRequest request, MesMaterial model) {
return super.exportXls(request, model, MesMaterial.class, "MES料信息");
return super.exportXls(request, model, MesMaterial.class, "MES料信息");
}
@RequiresPermissions("mes:mes_material:importExcel")

View File

@@ -19,7 +19,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
@TableName("mes_material")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "MES料主数据")
@Schema(description = "MES料主数据")
public class MesMaterial implements Serializable {
private static final long serialVersionUID = 1L;
@@ -28,15 +28,15 @@ public class MesMaterial implements Serializable {
@Excel(name = "物料编码", width = 15)
private String materialCode;
@Excel(name = "料名称", width = 20)
@Excel(name = "料名称", width = 20)
private String materialName;
@Excel(name = "别名", width = 15)
@Excel(name = "胶料别名", width = 15)
private String aliasName;
@Excel(name = "简称", width = 15)
private String shortName;
@Excel(name = "分类", width = 15, dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
@Dict(dictTable = "mes_material_category", dicText = "category_name", dicCode = "id")
@Excel(name = "胶料类别", width = 15, dictTable = "sys_category", dicText = "name", dicCode = "id")
@Dict(dictTable = "sys_category", dicText = "name", dicCode = "id")
private String categoryId;
@Excel(name = "等级", width = 12)
private String materialGrade;
@@ -57,16 +57,27 @@ public class MesMaterial implements Serializable {
@Excel(name = "换算系数", width = 12)
private BigDecimal unitConvertRate;
@Excel(name = "ERP编号", width = 15)
private String erpCode;
@Excel(name = "终炼胶保质期(天)", width = 15)
private Integer finalShelfLifeDays;
@Excel(name = "母炼胶保质期(天)", width = 15)
private Integer masterShelfLifeDays;
@Excel(name = "最小停放时间(时)", width = 15)
private Integer minStandingHours;
@Excel(name = "标准码", width = 15)
private String standardCode;
@Excel(name = "产地", width = 15)
private String originPlace;
@Excel(name = "供应商ID", width = 15)
private String supplierId;
@Excel(name = "客户ID", width = 15)
@Excel(name = "胶料客户", width = 15, dictTable = "mes_xsl_customer", dicText = "customer_name", dicCode = "id")
@Dict(dictTable = "mes_xsl_customer", dicText = "customer_name", dicCode = "id")
private String customerId;
@Excel(name = "用状态", width = 10)
@Excel(name = "使用状态", width = 10, replace = {"使用中_1", "停用_0"})
private Integer enableFlag;
@Excel(name = "是否为特种胶", width = 12, replace = {"是_1", "否_0"})
private Integer isSpecialRubber;
@Excel(name = "ERP同步", width = 10)
private Integer syncFromErpFlag;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")

View File

@@ -0,0 +1,11 @@
-- MES 物料信息改造为胶料信息补充胶料业务字段并更新菜单名称
ALTER TABLE `mes_material`
ADD COLUMN `erp_code` varchar(64) DEFAULT NULL COMMENT 'ERP编号' AFTER `customer_id`,
ADD COLUMN `final_shelf_life_days` int DEFAULT NULL COMMENT '终炼胶保质期' AFTER `erp_code`,
ADD COLUMN `master_shelf_life_days` int DEFAULT NULL COMMENT '母炼胶保质期' AFTER `final_shelf_life_days`,
ADD COLUMN `min_standing_hours` int DEFAULT NULL COMMENT '最小停放时间' AFTER `master_shelf_life_days`,
ADD COLUMN `is_special_rubber` tinyint DEFAULT 0 COMMENT '是否为特种胶0否1是' AFTER `enable_flag`;
UPDATE `sys_permission`
SET `name` = '胶料信息'
WHERE `component` = 'mes/materialinfo/index';

View File

@@ -1,67 +1,143 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
import { loadTreeData } from '/@/api/common/api';
function useStatusText(v: unknown) {
if (v === 1) return '使用中';
if (v === 0) return '停用';
return '-';
}
function specialRubberText(v: unknown) {
if (v === 1) return '是';
if (v === 0) return '否';
return '-';
}
const useStatusOptions = [
{ label: '使用中', value: 1 },
{ label: '停用', value: 0 },
];
const specialRubberOptions = [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
];
const glueCategoryProps = {
api: loadTreeData,
params: { pcode: 'XSLMES_MATERIAL' },
resultField: '',
labelField: 'title',
valueField: 'key',
placeholder: '请选择胶料类别',
};
export const columns: BasicColumn[] = [
{ title: '物料编码', align: 'center', dataIndex: 'materialCode' },
{ title: '物料名称', align: 'center', dataIndex: 'materialName' },
{ title: '分类', align: 'center', dataIndex: 'categoryId_dictText' },
{ title: '基础单位', align: 'center', dataIndex: 'baseUnitId_dictText' },
{ title: '状态', align: 'center', dataIndex: 'enableFlag' },
{ title: '创建时间', align: 'center', dataIndex: 'createTime' },
{ title: '胶料名称', align: 'center', width: 160, dataIndex: 'materialName' },
{ title: '胶料类别', align: 'center', width: 140, dataIndex: 'categoryId_dictText' },
{ title: '胶料别名', align: 'center', width: 140, dataIndex: 'aliasName' },
{ title: '胶料客户', align: 'center', width: 140, dataIndex: 'customerId_dictText' },
{ title: 'ERP编号', align: 'center', width: 140, dataIndex: 'erpCode' },
{ title: '终炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'finalShelfLifeDays' },
{ title: '母炼胶保质期(天)', align: 'center', width: 150, dataIndex: 'masterShelfLifeDays' },
{ title: '最小停放时间(时)', align: 'center', width: 150, dataIndex: 'minStandingHours' },
{
title: '使用状态',
align: 'center',
width: 110,
dataIndex: 'enableFlag',
customRender: ({ text }) => useStatusText(text),
},
{
title: '是否为特种胶',
align: 'center',
width: 120,
dataIndex: 'isSpecialRubber',
customRender: ({ text }) => specialRubberText(text),
},
];
export const searchFormSchema: FormSchema[] = [
{ label: '物料编码', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
{ label: '物料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
{ label: '胶料名称', field: 'materialName', component: 'Input', colProps: { span: 6 } },
{
label: '分类',
label: '胶料类别',
field: 'categoryId',
component: 'ApiSelect',
componentProps: glueCategoryProps,
colProps: { span: 6 },
},
{
label: '胶料客户',
field: 'customerId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_material_category,category_name,id' },
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id' },
colProps: { span: 6 },
},
{ label: 'ERP编号', field: 'erpCode', component: 'Input', colProps: { span: 6 } },
{
label: '使用状态',
field: 'enableFlag',
component: 'Select',
componentProps: { options: useStatusOptions },
colProps: { span: 6 },
},
{
label: '是否为特种胶',
field: 'isSpecialRubber',
component: 'Select',
componentProps: { options: specialRubberOptions },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{ label: '物料编码', field: 'materialCode', component: 'Input', required: true },
{ label: '物料名称', field: 'materialName', component: 'Input', required: true },
{ label: '别名', field: 'aliasName', component: 'Input' },
{ label: '简称', field: 'shortName', component: 'Input' },
{ label: '胶料名称', field: 'materialName', component: 'Input', required: true },
{
label: '分类',
label: '胶料类别',
field: 'categoryId',
component: 'JDictSelectTag',
component: 'ApiSelect',
required: true,
componentProps: { dictCode: 'mes_material_category,category_name,id' },
componentProps: glueCategoryProps,
},
{ label: '胶料别名', field: 'aliasName', component: 'Input' },
{
label: '基础单位',
field: 'baseUnitId',
label: '胶料客户',
field: 'customerId',
component: 'JDictSelectTag',
required: true,
componentProps: { dictCode: 'mes_unit,unit_name,id' },
componentProps: { dictCode: 'mes_xsl_customer,customer_name,id', placeholder: '请选择胶料客户' },
},
{ label: 'ERP编号', field: 'erpCode', component: 'Input' },
{
label: '终炼胶保质期(天)',
field: 'finalShelfLifeDays',
component: 'InputNumber',
componentProps: { min: 0, precision: 0 },
},
{
label: '统计单位',
field: 'statUnitId',
component: 'JDictSelectTag',
componentProps: { dictCode: 'mes_unit,unit_name,id' },
label: '母炼胶保质期(天)',
field: 'masterShelfLifeDays',
component: 'InputNumber',
componentProps: { min: 0, precision: 0 },
},
{ label: '计划价格', field: 'planPrice', component: 'InputNumber' },
{ label: '最小库存', field: 'minStock', component: 'InputNumber' },
{ label: '最大库存', field: 'maxStock', component: 'InputNumber' },
{ label: '换算系数', field: 'unitConvertRate', component: 'InputNumber', defaultValue: 1 },
{
label: '状态',
label: '最小停放时间(时)',
field: 'minStandingHours',
component: 'InputNumber',
componentProps: { min: 0, precision: 0 },
},
{
label: '使用状态',
field: 'enableFlag',
component: 'Select',
defaultValue: 1,
componentProps: {
options: [
{ label: '启用', value: 1 },
{ label: '停用', value: 0 },
],
},
componentProps: { options: useStatusOptions },
},
{
label: '是否为特种胶',
field: 'isSpecialRubber',
component: 'Select',
defaultValue: 0,
componentProps: { options: specialRubberOptions },
},
{ label: '备注', field: 'remark', component: 'InputTextArea' },
];

View File

@@ -33,14 +33,14 @@ import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './MesM
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '料信息',
title: '料信息',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 120, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: true },
actionColumn: { width: 120 },
},
exportConfig: { name: '料信息', url: getExportUrl },
exportConfig: { name: '料信息', url: getExportUrl },
importConfig: { url: getImportUrl, success: handleSuccess },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;

View File

@@ -30,7 +30,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
setProps({ disabled: !data?.showFooter });
});
const title = computed(() => (!unref(isUpdate) ? '新增料' : '编辑料'));
const title = computed(() => (!unref(isUpdate) ? '新增料' : '编辑料'));
async function handleSubmit() {
try {