diff --git a/src/api/mes/baseMaterialInfo/types.ts b/src/api/mes/baseMaterialInfo/types.ts index eaed500..13d6b60 100644 --- a/src/api/mes/baseMaterialInfo/types.ts +++ b/src/api/mes/baseMaterialInfo/types.ts @@ -269,6 +269,22 @@ export interface BaseMaterialInfoVO { */ updateTime: string; + + /** + * 所属工厂 + */ + factoryName: string;//连表查询映射字段 + + /** + * 物料类型名称 + */ + matrialTypeName: string;//连表查询映射字段 + + /** + * 物料类型名称 + */ + materialTypeName: string;//连表查询映射字段 + } export interface BaseMaterialInfoForm extends BaseEntity { diff --git a/src/views/mes/baseMaterialInfo/index.vue b/src/views/mes/baseMaterialInfo/index.vue index d0bd5c5..596d6af 100644 --- a/src/views/mes/baseMaterialInfo/index.vue +++ b/src/views/mes/baseMaterialInfo/index.vue @@ -7,9 +7,9 @@ - + @@ -30,11 +30,11 @@ - + - + @@ -86,7 +86,7 @@ - + + - + @@ -213,14 +213,15 @@ - + - + + - + @@ -352,13 +353,13 @@ - + - + @@ -368,11 +369,19 @@ - - + + + + + - + - - - - - - + + + + + @@ -474,14 +492,14 @@ placeholder="请选择审核日期"> - + @@ -577,7 +595,7 @@ - + {{dict.label}} - - + + (['', '']); const queryFormRef = ref(); const baseMaterialInfoFormRef = ref(); +/*type MeasureUnitList = { + unitId: number; + unitName: string; + children? : MeasureUnitList[]; +}*/ + + const dialog = reactive({ visible: false, title: '' @@ -643,7 +671,7 @@ const dialog = reactive({ const columns = ref([ /* { 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([ { 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([ { 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>({ } }, 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([]); +const getMeasureUnit = async() => { + const res = await getBaseMeasurementUnitInfoList(null); + const data = proxy?.handleTree(res.data, "unitId", "parentId"); + if (data){ + MeasureUnitList.value = data; + } +} + + +//点击计量单位,根据id同时将unitName赋值给form.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(); }); diff --git a/src/views/mes/baseMaterialType/index.vue b/src/views/mes/baseMaterialType/index.vue index 578ffb6..5b7ed59 100644 --- a/src/views/mes/baseMaterialType/index.vue +++ b/src/views/mes/baseMaterialType/index.vue @@ -66,7 +66,7 @@ > - + diff --git a/src/views/mes/baseShiftInfo/index.vue b/src/views/mes/baseShiftInfo/index.vue index ed2cbd5..565c11d 100644 --- a/src/views/mes/baseShiftInfo/index.vue +++ b/src/views/mes/baseShiftInfo/index.vue @@ -111,7 +111,12 @@ - + + + +