change(hwmom-mes): 修改物料信息页面

- 添加物料类型和计量单位的下拉选择功能
- 调整部分字段的显示和隐藏
- 班次页面标准工时显示自动转换时间
master
zch 5 days ago
parent 131e0ef444
commit fefd42de83

@ -269,6 +269,22 @@ export interface BaseMaterialInfoVO {
*/
updateTime: string;
/**
*
*/
factoryName: string;//连表查询映射字段
/**
*
*/
matrialTypeName: string;//连表查询映射字段
/**
*
*/
materialTypeName: string;//连表查询映射字段
}
export interface BaseMaterialInfoForm extends BaseEntity {

@ -7,9 +7,9 @@
<!-- <el-form-item label="主键标识" prop="materialId">
<el-input v-model="queryParams.materialId" placeholder="请输入主键标识" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="ERP信息" prop="erpId">
<!-- <el-form-item label="ERP信息" prop="erpId">
<el-input v-model="queryParams.erpId" placeholder="请输入ERP信息" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-form-item>-->
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="queryParams.materialCode" placeholder="请输入物料编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
@ -30,11 +30,11 @@
<!-- <el-form-item label="物料小类" prop="materialSubclass">
<el-input v-model="queryParams.materialSubclass" placeholder="请输入物料小类" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="批次标识" prop="batchFlag">
<!-- <el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable >
<el-option v-for="dict in mes_batch_flag" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-form-item>-->
<!-- <el-form-item label="小批次数量" prop="batchAmount">
<el-input v-model="queryParams.batchAmount" placeholder="请输入小批次数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
@ -56,11 +56,11 @@
<el-form-item label="毛重" prop="grossWeight">
<el-input v-model="queryParams.grossWeight" placeholder="请输入毛重" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="绑定标识" prop="alwaysFlag">
<!-- <el-form-item label="绑定标识" prop="alwaysFlag">
<el-select v-model="queryParams.alwaysFlag" placeholder="请选择绑定标识" clearable >
<el-option v-for="dict in always_flag" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-form-item>-->
<!-- <el-form-item label="所属工厂" prop="factoryId">
<el-input v-model="queryParams.factoryId" placeholder="请输入所属工厂" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
@ -86,7 +86,7 @@
<!-- <el-form-item label="采购计价单位" prop="purchasePriceUnitId">
<el-input v-model="queryParams.purchasePriceUnitId" placeholder="请输入采购计价单位" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="审核日期" style="width: 308px">
<!-- <el-form-item label="审核日期" style="width: 308px">
<el-date-picker
v-model="dateRangeApproveDate"
value-format="YYYY-MM-DD HH:mm:ss"
@ -96,15 +96,15 @@
end-placeholder="结束日期"
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
/>
</el-form-item>
<el-form-item label="erp最后更新日期" prop="erpModifyDate">
</el-form-item>-->
<!-- <el-form-item label="erp最后更新日期" prop="erpModifyDate">
<el-date-picker clearable
v-model="queryParams.erpModifyDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择erp最后更新日期"
/>
</el-form-item>
</el-form-item>-->
<!-- <el-form-item label="最大库存数量" prop="maxStockAmount">
<el-input v-model="queryParams.maxStockAmount" placeholder="请输入最大库存数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
@ -174,11 +174,11 @@
<el-form-item label="标准重量下限" prop="weightLowerLimit">
<el-input v-model="queryParams.weightLowerLimit" placeholder="请输入标准重量下限" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="内胎标记" prop="innerTubeFlag">
<!-- <el-form-item label="内胎标记" prop="innerTubeFlag">
<el-select v-model="queryParams.innerTubeFlag" placeholder="请选择内胎标记" clearable >
<el-option v-for="dict in inner_tube_flag" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
</el-form-item>-->
<el-form-item label="销售类型" prop="saleType">
<el-select v-model="queryParams.saleType" placeholder="请选择销售类型" clearable >
<el-option v-for="dict in sale_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
@ -213,14 +213,15 @@
</template>
<el-table v-loading="loading" :data="baseMaterialInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="60" align="center" />
<!-- <el-table-column label="主键标识" align="center" prop="materialId" v-if="columns[0].visible"/>-->
<!-- <el-table-column label="租户编号" align="center" prop="tenantId" v-if="columns[1].visible"/>-->
<el-table-column label="ERP信息" align="center" prop="erpId" v-if="columns[0].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[1].visible"/>
<el-table-column label="旧物料编码" align="center" prop="oldMaterialCode" v-if="columns[2].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[3].visible"/>
<el-table-column label="物料类型ID" align="center" prop="materialTypeId" v-if="columns[4].visible"/>
<!-- <el-table-column label="物料类型ID" align="center" prop="materialTypeId" v-if="columns[4].visible"/>-->
<el-table-column label="物料类型" align="center" prop="matrialTypeName" v-if="columns[4].visible"/>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[5].visible">
<template #default="scope">
<dict-tag :options="mes_material_categories" :value="scope.row.materialCategories"/>
@ -292,7 +293,7 @@
<dict-tag :options="mes_accessories_flag" :value="scope.row.accessoriesFlag"/>
</template>
</el-table-column>
<el-table-column label="低值易耗品标识(1是 0否)" align="center" prop="lowValueConsumableFlag" v-if="columns[32].visible">
<el-table-column label="低值易耗品标识" align="center" prop="lowValueConsumableFlag" v-if="columns[32].visible">
<template #default="scope">
<dict-tag :options="mes_low_value_consumable_flag" :value="scope.row.lowValueConsumableFlag"/>
</template>
@ -352,13 +353,13 @@
</el-card>
<!-- 添加或修改物料信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="baseMaterialInfoFormRef" :model="form" :rules="rules" label-width="80px">
<el-form ref="baseMaterialInfoFormRef" :model="form" :rules="rules" label-width="120px">
<!-- <el-form-item label="主键标识" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入主键标识" />
</el-form-item>-->
<el-form-item label="ERP信息" prop="erpId">
<!-- <el-form-item label="ERP信息" prop="erpId">
<el-input v-model="form.erpId" placeholder="请输入ERP信息" />
</el-form-item>
</el-form-item>-->
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" />
</el-form-item>
@ -368,11 +369,19 @@
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" />
</el-form-item>
<el-form-item label="物料类型ID" prop="materialTypeId">
<el-input v-model="form.materialTypeId" placeholder="请输入物料类型ID" />
<el-form-item label="物料类型" prop="materialTypeId">
<!-- <el-input v-model="form.materialTypeId" placeholder="请输入物料类型ID" />-->
<el-select v-model="form.materialTypeId" placeholder="请选择物料类型">
<el-option
v-for="item in materialTypeList"
:key="item.matrialTypeId"
:label="item.matrialTypeName"
:value="item.matrialTypeId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-select v-model="form.materialCategories" placeholder="请选择物料大类(1原材料 2半成品 3成品)">
<el-select v-model="form.materialCategories" placeholder="请选择物料大类">
<el-option
v-for="dict in mes_material_categories"
:key="dict.value"
@ -396,12 +405,21 @@
<el-form-item label="小批次数量" prop="batchAmount">
<el-input v-model="form.batchAmount" placeholder="请输入小批次数量" />
</el-form-item>
<el-form-item label="计量单位ID" prop="materialUnitId">
<el-input v-model="form.materialUnitId" placeholder="请输入计量单位ID" />
</el-form-item>
<el-form-item label="计量单位名称" prop="materialUnit">
<el-input v-model="form.materialUnit" placeholder="请输入计量单位名称" />
</el-form-item>
<el-form-item label="计量单位" prop="materialUnitId">
<!-- <el-input v-model="form.materialUnitId" placeholder="请输入计量单位" />-->
<el-tree-select
v-model="form.materialUnitId"
:data="MeasureUnitList"
:props="{ value: 'unitId', label: 'unitName', children: 'children' }"
value-key="unitId"
placeholder="请选择计量单位"
check-strictly
@node-click="handleNodeClick"
/>
</el-form-item>
<!-- <el-form-item label="计量单位名称" prop="materialUnit">
<el-input v-model="form.materialUnit" placeholder="请输入计量单位名称" disable/>
</el-form-item>-->
<el-form-item label="物料组" prop="materialMatkl">
<el-input v-model="form.materialMatkl" placeholder="请输入物料组" />
</el-form-item>
@ -474,14 +492,14 @@
placeholder="请选择审核日期">
</el-date-picker>
</el-form-item>
<el-form-item label="erp最后更新日期" prop="erpModifyDate">
<!-- <el-form-item label="erp最后更新日期" prop="erpModifyDate">
<el-date-picker clearable
v-model="form.erpModifyDate"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择erp最后更新日期">
</el-date-picker>
</el-form-item>
</el-form-item>-->
<el-form-item label="最大库存数量" prop="maxStockAmount">
<el-input v-model="form.maxStockAmount" placeholder="请输入最大库存数量" />
</el-form-item>
@ -577,7 +595,7 @@
<el-form-item label="标准重量下限" prop="weightLowerLimit">
<el-input v-model="form.weightLowerLimit" placeholder="请输入标准重量下限" />
</el-form-item>
<el-form-item label="内胎标记(0无 1有)" prop="innerTubeFlag">
<el-form-item label="内胎标记" prop="innerTubeFlag">
<el-radio-group v-model="form.innerTubeFlag">
<el-radio
v-for="dict in inner_tube_flag"
@ -586,8 +604,8 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="销售类型(0内销 1外销)" prop="saleType">
<el-select v-model="form.saleType" placeholder="请选择销售类型(0内销 1外销)">
<el-form-item label="销售类型" prop="saleType">
<el-select v-model="form.saleType" placeholder="请选择销售类型">
<el-option
v-for="dict in sale_type"
:key="dict.value"
@ -614,6 +632,9 @@
import { listBaseMaterialInfo, getBaseMaterialInfo, delBaseMaterialInfo, addBaseMaterialInfo, updateBaseMaterialInfo } from '@/api/mes/baseMaterialInfo';
import { BaseMaterialInfoVO, BaseMaterialInfoQuery, BaseMaterialInfoForm } from '@/api/mes/baseMaterialInfo/types';
import { getFactoryList } from "@/api/mes/baseFactoryInfo";
import {getBaseMeasurementUnitInfoList} from "@/api/mes/baseMeasurementUnitInfo";
import {BaseMeasurementUnitInfoVO} from "@/api/mes/baseMeasurementUnitInfo/types";
import { getBaseMaterialTypeList } from "@/api/mes/baseMaterialType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { apply_flag, inner_tube_flag,
@ -634,6 +655,13 @@ const dateRangeApproveDate = ref<[DateModelType, DateModelType]>(['', '']);
const queryFormRef = ref<ElFormInstance>();
const baseMaterialInfoFormRef = ref<ElFormInstance>();
/*type MeasureUnitList = {
unitId: number;
unitName: string;
children? : MeasureUnitList[];
}*/
const dialog = reactive<DialogOption>({
visible: false,
title: ''
@ -643,7 +671,7 @@ const dialog = reactive<DialogOption>({
const columns = ref<FieldOption[]>([
/* { key: 0, label: ``, visible: true },
{ key: 1, label: `租户编号`, visible: true },*/
{ key: 0, label: `ERP信息`, visible: true },
{ key: 0, label: `ERP信息`, visible: false },
{ key: 1, label: `物料编码`, visible: true },
{ key: 2, label: `旧物料编码`, visible: true },
{ key: 3, label: `物料名称`, visible: true },
@ -652,12 +680,12 @@ const columns = ref<FieldOption[]>([
{ key: 6, label: `物料小类`, visible: true },
{ key: 7, label: `批次标识`, visible: true },
{ key: 8, label: `小批次数量`, visible: true },
{ key: 9, label: `计量单位ID`, visible: true },
{ key: 9, label: `计量单位ID`, visible: false },
{ key: 10, label: `计量单位名称`, visible: true },
{ key: 11, label: `物料组`, visible: true },
{ key: 12, label: `物料规格`, visible: true },
{ key: 13, label: `净重`, visible: true },
{ key: 14, label: `毛重`, visible: true },
{ key: 13, label: `净重`, visible: false },
{ key: 14, label: `毛重`, visible: false },
{ key: 15, label: `绑定标识`, visible: false },
{ key: 16, label: `所属工厂`, visible: false },
{ key: 17, label: `创建组织`, visible: false },
@ -666,7 +694,7 @@ const columns = ref<FieldOption[]>([
{ key: 20, label: `激活标识`, visible: false },
{ key: 21, label: `删除标识`, visible: false },
{ key: 22, label: `采购计价单位`, visible: false },
{ key: 23, label: `审核日期`, visible: true },
{ key: 23, label: `审核日期`, visible: false },
{ key: 24, label: `erp最后更新日期`, visible: false },
{ key: 25, label: `最大库存数量`, visible: false },
{ key: 26, label: `最小库存数量`, visible: false },
@ -803,9 +831,9 @@ const data = reactive<PageData<BaseMaterialInfoForm, BaseMaterialInfoQuery>>({
}
},
rules: {
erpId: [
/* erpId: [
{ required: true, message: "ERP信息不能为空", trigger: "blur" }
],
],*/
materialCode: [
{ required: true, message: "物料编码不能为空", trigger: "blur" }
],
@ -870,6 +898,9 @@ const handleSelectionChange = (selection: BaseMaterialInfoVO[]) => {
/** 新增按钮操作 */
const handleAdd = () => {
reset();
getFactorySelect();
getMeasureUnit();
getMaterialType();
dialog.visible = true;
dialog.title = "添加物料信息";
}
@ -877,6 +908,9 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: BaseMaterialInfoVO) => {
reset();
getFactorySelect();
getMeasureUnit();
getMaterialType();
const _materialId = row?.materialId || ids.value[0]
const res = await getBaseMaterialInfo(_materialId);
Object.assign(form.value, res.data);
@ -917,8 +951,31 @@ const handleExport = () => {
}, `baseMaterialInfo_${new Date().getTime()}.xlsx`)
}
//
let MeasureUnitList = ref<BaseMeasurementUnitInfoVO[]>([]);
const getMeasureUnit = async() => {
const res = await getBaseMeasurementUnitInfoList(null);
const data = proxy?.handleTree<BaseMeasurementUnitInfoVO>(res.data, "unitId", "parentId");
if (data){
MeasureUnitList.value = data;
}
}
//idunitNameform.value.materialUnit
const handleNodeClick = (data: BaseMeasurementUnitInfoVO) => {
form.value.materialUnitId = data.unitId;
form.value.materialUnit = data.unitName;
}
//
let materialTypeList = ref([]);
const getMaterialType = async () => {
const res = await getBaseMaterialTypeList(null);
materialTypeList.value = res.data;
}
onMounted(() => {
getFactorySelect();
getList();
});
</script>

@ -66,7 +66,7 @@
>
<!-- <el-table-column label="物料类型ID" align="center" prop="matrialTypeId" />
<el-table-column label="租户编号" prop="tenantId" />-->
<el-table-column label="父级标识" align="center" prop="parentId" />
<!-- <el-table-column label="父级标识" align="center" prop="parentId" />-->
<el-table-column label="物料类型编号" align="center" prop="matrialTypeCode" />
<el-table-column label="物料类型名称" align="center" prop="matrialTypeName" />
<el-table-column label="祖级列表" align="center" prop="ancestors" />

@ -111,7 +111,12 @@
<dict-tag :options="mes_end_cross_flag" :value="scope.row.endCrossFlag"/>
</template>
</el-table-column>
<el-table-column label="标准工作时长" align="center" prop="workHour" v-if="columns[6].visible"/>
<!-- <el-table-column label="标准工作时长" align="center" prop="workHour" v-if="columns[6].visible"/>-->
<el-table-column label="标准工作时长" align="center" prop="workHour" v-if="columns[6].visible">
<template #default="scope">
<span>{{ formatDayHourMinutes(scope.row.workHour )}}</span>
</template>
</el-table-column>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[7].visible">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>

Loading…
Cancel
Save