add(mes): 添加等同物料名称字段并优化物料选择功能

- 在等同物料信息表中添加等同物料名称字段
- 优化物料选择功能,支持物料和等同物料的选择
- 修改表单提交逻辑,根据物料或等同物料更新对应字段
- 更新接口定义,添加等同物料名称相关字段
master
zch 1 month ago
parent 1043ce0956
commit 32a12c3e73

@ -59,6 +59,11 @@ export interface BaseEqualMaterialInfoVO {
*/
materialName: string;//映射字段
/**
*
*/
equalMaterialName: string;//映射字段
}
export interface BaseEqualMaterialInfoForm extends BaseEntity {
@ -92,6 +97,11 @@ export interface BaseEqualMaterialInfoForm extends BaseEntity {
*/
materialName: string;//映射字段
/**
*
*/
equalMaterialName: string;//映射字段
}
export interface BaseEqualMaterialInfoQuery extends PageQuery {
@ -126,6 +136,12 @@ export interface BaseEqualMaterialInfoQuery extends PageQuery {
*
*/
materialName: string;//映射字段
/**
*
*/
equalMaterialName: string;//映射字段
}

@ -51,7 +51,7 @@
<!-- <el-table-column label="主键标识" align="center" prop="equalMaterialInfoId" v-if="columns[0].visible"/>
<el-table-column label="租户编号" align="center" prop="tenantId" v-if="columns[1].visible"/>-->
<el-table-column label="物料" align="center" prop="materialName" v-if="columns[0].visible"/>
<el-table-column label="等同物料ID" align="center" prop="equalMaterialId" v-if="columns[1].visible"/>
<el-table-column label="等同物料ID" align="center" prop="equalMaterialName" v-if="columns[1].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[2].visible">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>
@ -85,6 +85,8 @@
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改等同物料信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="baseEqualMaterialInfoFormRef" :model="form" :rules="rules" label-width="120px">
@ -93,22 +95,19 @@
</el-form-item>-->
<el-form-item label="物料" prop="materialId">
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" />-->
<!-- <el-select v-model="form.materialId" placeholder="请选择物料" clearable >
<el-option v-for="item in materialList"
:key="item.materialId"
:label="item.materialName"
:value="item.materialId"/>
</el-select>-->
<el-input v-model="form.materialName" placeholder="请点击检索物料" @click="handleMaterialAdd" readonly>
<el-input v-model="form.materialName" placeholder="请点击检索物料" @click="handleMaterialAdd('material')" readonly>
<template #append>
<el-icon class="el-input__icon" ><search/></el-icon>
<el-icon class="el-input__icon"><search/></el-icon>
</template>
</el-input>
</el-form-item>
<el-form-item label="等同物料ID" prop="equalMaterialId">
<el-input v-model="form.equalMaterialId" placeholder="请输入等同物料ID" />
<el-input v-model="form.equalMaterialName" placeholder="请点击检索物料" @click="handleMaterialAdd('equalMaterial')" readonly>
<template #append>
<el-icon class="el-input__icon"><search/></el-icon>
</template>
</el-input>
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
@ -193,8 +192,8 @@ const initFormData: BaseEqualMaterialInfoForm = {
equalMaterialId: undefined,
activeFlag: '1',
remark: undefined,
materialName: undefined,//
equalMaterialName: undefined,//
}
const data = reactive<PageData<BaseEqualMaterialInfoForm, BaseEqualMaterialInfoQuery>>({
form: {...initFormData},
@ -207,9 +206,8 @@ const data = reactive<PageData<BaseEqualMaterialInfoForm, BaseEqualMaterialInfoQ
activeFlag: undefined,
materialName: undefined,//
params: {
}
equalMaterialName: undefined,//
params: {},
},
rules: {
}
@ -317,16 +315,24 @@ const getListsSelect = async() => {
/* 以下为添加物料信息对话框相关方法 */
let materialSelectRef = ref();//
const materialOpen = ref(false);//
const selectType = ref(''); //
/** 提交物料BOM信息按钮 */
const submitMaterialForm = () => {
let selectedRow = materialSelectRef.value.tableRef.store.states.currentRow.value;
form.value.materialId = selectedRow.materialId
form.value.materialName = selectedRow.materialName
materialOpen.value = false;
if (selectType.value === 'material') {
form.value.materialId = selectedRow.materialId;
form.value.materialName = selectedRow.materialName;
} else if (selectType.value === 'equalMaterial') {
form.value.equalMaterialId = selectedRow.materialId;
form.value.equalMaterialName = selectedRow.materialName;
}
materialOpen.value = false;
};
/** 新增按钮操作 */
const handleMaterialAdd = () => {
const handleMaterialAdd = (type: string) => {
selectType.value = type;
materialOpen.value = true;
}

Loading…
Cancel
Save