refactor(wms): 移除废品相关选项并统一质量状态选择

重构多个视图组件,移除废品材料类型选项及相关逻辑,统一使用字典数据选择质量状态
This commit is contained in:
砂糖
2026-01-13 14:36:32 +08:00
parent 1012a48e2b
commit d147651192
11 changed files with 129 additions and 134 deletions

View File

@@ -127,7 +127,7 @@
<el-table-column v-if="showGrade" label="质量状态" align="center" prop="qualityStatus">
<template slot-scope="scope">
<el-select v-model="scope.row.qualityStatus" placeholder="请选择质量状态" @change="handleGradeChange(scope.row)">
<el-option v-for="item in qualityStatusEnum" :key="item.value" :value="item.value" :label="item.label" />
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :value="item.value" :label="item.label" />
</el-select>
</template>
</el-table-column>
@@ -191,7 +191,6 @@
<el-select v-model="form.materialType" placeholder="请选择材料类型" @change="handleMaterialTypeChange">
<el-option label="成品" value="成品" />
<el-option label="原料" value="原料" />
<el-option label="废品" value="废品" />
</el-select>
</el-form-item>
<el-form-item :label="getItemLabel" prop="itemId">
@@ -201,33 +200,25 @@
style="width: 100%;" clearable />
<div v-else>请先选择材料类型</div>
</el-form-item>
<el-form-item v-if="form.materialType === '成品'" label="质量状态" prop="qualityStatus">
<el-form-item label="质量状态" prop="qualityStatus">
<el-select v-model="form.qualityStatus" placeholder="请选择质量状态" style="width: 100%">
<el-option label="A+" value="A+" />
<el-option label="A" value="A" />
<el-option label="A-" value="A-" />
<el-option label="B+" value="B+" />
<el-option label="B" value="B" />
<el-option label="B-" value="B-" />
<el-option label="C+" value="C+" />
<el-option label="C" value="C" />
<el-option label="C-" value="C-" />
<el-option v-for="item in dict.type.coil_quality_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item v-if="form.materialType === '成品'" label="切边要求" prop="trimmingRequirement">
<el-form-item label="切边要求" prop="trimmingRequirement">
<el-select v-model="form.trimmingRequirement" placeholder="请选择切边要求" style="width: 100%">
<el-option label="净边料" value="净边料" />
<el-option label="毛边料" value="毛边料" />
</el-select>
</el-form-item>
<el-form-item v-if="form.materialType === '成品'" label="打包状态" prop="packingStatus">
<el-form-item label="打包状态" prop="packingStatus">
<el-input v-model="form.packingStatus" placeholder="请输入打包状态">
</el-input>
</el-form-item>
<el-form-item v-if="form.materialType === '成品'" label="包装要求" prop="packagingRequirement">
<el-form-item label="包装要求" prop="packagingRequirement">
<el-select v-model="form.packagingRequirement" placeholder="请选择包装要求" style="width: 100%">
<el-option label="裸包" value="裸包" />
<el-option label="普包" value="普包" />
@@ -340,7 +331,7 @@ export default {
MutiSelect,
OuterTagPreview,
},
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'],
props: {
qrcode: {
type: Boolean,
@@ -403,6 +394,9 @@ export default {
{ label: 'C+', value: 'C+' },
{ label: 'C', value: 'C' },
{ label: 'C-', value: 'C-' },
{ label: 'D+', value: 'D+' },
{ label: 'D', value: 'D' },
{ label: 'D-', value: 'D-' },
],
// 按钮loading
buttonLoading: false,
@@ -567,7 +561,7 @@ export default {
getItemLabel() {
if (this.form.materialType === '成品') {
return '产品类型';
} else if (this.form.materialType === '原料' || this.form.materialType === '废品') {
} else if (this.form.materialType === '原料') {
return '原料类型';
}
return '物品类型';
@@ -606,7 +600,7 @@ export default {
// 根据材料类型设置物品类型
if (value === '成品') {
this.form.itemType = 'product';
} else if (value === '原料' || value === '废品') {
} else if (value === '原料') {
this.form.itemType = 'raw_material';
}
},
@@ -759,7 +753,7 @@ export default {
// 同时设置对应的 itemType
if (this.querys.materialType === '成品') {
this.form.itemType = 'product';
} else if (this.querys.materialType === '原料' || this.querys.materialType === '废品') {
} else if (this.querys.materialType === '原料') {
this.form.itemType = 'raw_material';
}
}
@@ -792,7 +786,7 @@ export default {
// 同时设置对应的 itemType
if (this.querys.materialType === '成品') {
this.form.itemType = 'product';
} else if (this.querys.materialType === '原料' || this.querys.materialType === '废品') {
} else if (this.querys.materialType === '原料') {
this.form.itemType = 'raw_material';
}
}
@@ -834,7 +828,7 @@ export default {
// 同时设置对应的 itemType
if (this.querys.materialType === '成品') {
this.form.itemType = 'product';
} else if (this.querys.materialType === '原料' || this.querys.materialType === '废品') {
} else if (this.querys.materialType === '原料') {
this.form.itemType = 'raw_material';
}
}