fix(wms): 修复钢卷操作中物料类型和ID的同步问题

- 在split.vue中确保子卷继承母卷的itemType、itemId和materialType
- 在typing.vue中根据materialType自动设置itemType
- 在actflow.vue中使用coil-selector组件替换手动选择钢卷逻辑
This commit is contained in:
砂糖
2025-11-27 15:43:27 +08:00
parent 1579c725e9
commit ad8ef21ff6
3 changed files with 15 additions and 13 deletions

View File

@@ -194,12 +194,7 @@
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="钢卷" prop="coilId">
<el-button size="small" @click="showCoilSelector">
<i class="el-icon-search"></i> 选择钢卷
</el-button>
<span v-if="form.currentCoilNo" style="margin-left: 10px;">
<el-tag type="info">{{ form.currentCoilNo }}</el-tag>
</span>
<coil-selector v-model="form.coilId" :use-trigger="true" @select="handleCoilSelect" />
</el-form-item>
<el-form-item label="操作类型" prop="actionType">
<div class="action-type-cards">
@@ -262,12 +257,6 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 钢卷选择器 -->
<coil-selector
:visible.sync="coilSelectorVisible"
@select="handleCoilSelect"
/>
</div>
</template>
@@ -284,6 +273,7 @@ import {
} from '@/api/wms/pendingAction';
import CoilSelector from '@/components/CoilSelector';
export default {
name: 'CoilActflow',
dicts: ['action_type'],

View File

@@ -662,6 +662,17 @@ export default {
}
// 不复制 itemType 和 itemId让它们由 materialType 自动决定
if (item.itemType) {
item.itemType = this.motherCoil.itemType;
}
if (item.itemId) {
item.itemId = this.motherCoil.itemId;
}
if (item.materialType) {
item.materialType = this.motherCoil.materialType;
}
});
// 不再预加载物品列表,改为实时搜索

View File

@@ -587,12 +587,13 @@ export default {
// 复制当前信息到更新表单
copyFromCurrent() {
const itemType = this.currentInfo.materialType === '原料' ? 'raw_material' : 'product';
this.updateForm = {
currentCoilNo: this.currentInfo.currentCoilNo,
team: this.currentInfo.team,
materialType: this.currentInfo.materialType,
// 不复制 itemType 和 itemId让它们由 materialType 自动决定
itemType: null,
itemType,
itemId: null,
grossWeight: parseFloat(this.currentInfo.grossWeight) || null,
netWeight: parseFloat(this.currentInfo.netWeight) || null,