feat(物料管理): 优化物料管理相关功能

- 在出库记录页面添加操作员查询字段
- 将物料分类状态值从数字改为文字"启用"
- 调整交易类型表格列显示,隐藏主键ID和创建时间
- 重构物料管理页面,优化分类选择逻辑和显示
- 显示供应商编码和名称列,移除部分冗余字段
This commit is contained in:
Tom
2026-01-05 10:57:58 +08:00
parent 152393eb9c
commit 7e4d259db3
4 changed files with 33 additions and 41 deletions

View File

@@ -15,8 +15,10 @@
</el-form-item>
<el-form-item label="物料分类名称" prop="categoryCode">
<el-select v-model="queryParams.categoryCode" placeholder="请选择">
<el-option label="全部" value="" />
<el-option v-for="item in materialCategoryOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-option v-for="item in options.materialCodeOptions" :key="item.value" :label="item.label" :value="item.value">
<span style="float: left">{{ item.value }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
@@ -112,13 +114,18 @@
<el-col :lg="12">
<el-form-item label="物料分类编码" prop="categoryCode">
<el-input v-model="form.categoryCode" placeholder="请输入物料分类编码" />
<el-select @change="handleCategoryChange" v-model="form.categoryCode" filterable placeholder="请选择物料分类编码">
<el-option v-for="item in options.materialCodeOptions" :key="item.label" :label="item.label" :value="item">
<span style="float: left">{{ item.value }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.label }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="物料分类名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入物料分类名称" />
<el-input :disabled="true" v-model="form.categoryName" placeholder="请输入物料分类名称" />
</el-form-item>
</el-col>
@@ -128,18 +135,6 @@
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="物料类型" prop="type">
<el-select v-model="form.type" placeholder="请选择物料类型(原材料/半成品/产成品/打包材料/辅料)">
<el-option
v-for="item in options.typeOptions"
:key="item.dictValue"
:label="item.dictLabel"
:value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="供应商编码" prop="supplierCode">
<el-input v-model="form.supplierCode" placeholder="请输入供应商编码" />
@@ -168,20 +163,6 @@
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="创建时间" prop="createdTime">
<el-date-picker v-model="form.createdTime" type="datetime" placeholder="选择日期时间" value-format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="更新时间" prop="updatedTime">
<el-date-picker v-model="form.updatedTime" type="datetime" placeholder="选择日期时间" value-format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :lg="12">
<el-form-item label="描述" prop="description">
<el-input v-model="form.description" placeholder="请输入描述" />
@@ -228,8 +209,8 @@ const columns = ref([
{ visible: true, align: 'center', type: '', prop: 'categoryName', label: '物料分类名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'unit', label: '计量单位', showOverflowTooltip: true },
{ visible: true, align: 'center', type: 'dict', prop: 'type', label: '物料类型(原材料/半成品/产成品/打包材料/辅料)', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'supplierCode', label: '供应商编码', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'supplierName', label: '供应商名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'supplierCode', label: '供应商编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'supplierName', label: '供应商名称', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'safetyStock', label: '安全库存' },
{ visible: false, align: 'center', type: 'dict', prop: 'status', label: '状态(停用/启用)', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'createdTime', label: '创建时间', showOverflowTooltip: true },
@@ -331,7 +312,9 @@ const state = reactive({
dictValue: '启用',
dictLabel: '启用'
}
]
],
// 物料分类编码 选项列表 格式 eg:{ materialCode: '001', materialName: '原材料'}
materialCodeOptions: []
}
})
@@ -429,8 +412,6 @@ function handleDelete(row) {
proxy.$modal.msgSuccess('删除成功')
})
}
// 物料分类名称下拉列表
const materialCategoryOptions = ref([])
// 物料分类名称下拉列表 可见性变化时触发
function handleGetMmMaterialCategoryOptions() {
@@ -438,14 +419,22 @@ function handleGetMmMaterialCategoryOptions() {
getMmMaterialCategoryOptions().then((res) => {
const { code, data } = res
if (code == 200) {
console.log(data)
materialCategoryOptions.value = data
state.options.materialCodeOptions = data
}
})
} catch (err) {
console.log(err)
}
}
// 物料分类名称下拉列表 选项变化时触发
function handleCategoryChange(val) {
if (val) {
form.value.categoryCode = val.value
form.value.categoryName = val.label
}
}
handleGetMmMaterialCategoryOptions()
handleQuery()
</script>

View File

@@ -232,7 +232,7 @@ const state = reactive({
single: true,
multiple: true,
form: {
status: 1
status: '启用',
},
rules: {
categoryCode: [{ required: true, message: '分类编码不能为空', trigger: 'blur' }],
@@ -270,7 +270,7 @@ function reset() {
parentCode: null,
levelNo: null,
description: null,
status: 1, // 设置默认值为'1'启用
status: '启用', // 设置默认值为'启用'
createdTime: null,
updatedTime: null
}

View File

@@ -22,6 +22,9 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="操作员" prop="operator">
<el-input v-model="queryParams.operator" placeholder="请输入操作员" />
</el-form-item>
<el-form-item label="创建日期" prop="createdTime">
<el-date-picker
v-model="queryParams.createdTime"

View File

@@ -167,13 +167,13 @@ const queryParams = reactive({
transactionDirection: ''
})
const columns = ref([
{ visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' },
// { visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' },
{ visible: false, align: 'center', type: '', prop: 'typeCode', label: '类别编码', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'typeName', label: '类别名称', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'transactionDirection', label: '操作方向', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'description', label: '描述', showOverflowTooltip: true },
{ visible: true, align: 'center', type: 'dict', prop: 'status', label: '状态', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'createdTime', label: '创建时间', showOverflowTooltip: true },
{ visible: false, align: 'center', type: '', prop: 'createdTime', label: '创建时间', showOverflowTooltip: true },
{ visible: true, align: 'center', type: '', prop: 'updatedTime', label: '更新时间', showOverflowTooltip: true }
//{ visible: false, prop: 'actions', label: '操作', type: 'slot', width: '160' }
])