修改添加生产工单

master
夜笙歌 6 days ago
parent 1c42a94b4a
commit 0aa74790d6

@ -45,6 +45,7 @@
<el-table <el-table
v-loading='loading' v-loading='loading'
:data='materialBomList' :data='materialBomList'
ref="tableRef"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@row-click="handleRowClick" @row-click="handleRowClick"
highlight-current-row highlight-current-row
@ -118,6 +119,7 @@ const buttonLoading = ref(false);
const showSearch = ref(true); const showSearch = ref(true);
const isExpandAll = ref(true); const isExpandAll = ref(true);
const loading = ref(false); const loading = ref(false);
const tableRef = ref()
const queryFormRef = ref<ElFormInstance>(); const queryFormRef = ref<ElFormInstance>();
const materialBomFormRef = ref<ElFormInstance>(); const materialBomFormRef = ref<ElFormInstance>();
@ -223,4 +225,5 @@ const handleRowClick = (row) =>{
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
defineExpose({tableRef})
</script> </script>

@ -333,7 +333,7 @@ const shiftList = ref([]);
const classTeamList = ref([]); const classTeamList = ref([]);
const materialOpen = ref(false); const materialOpen = ref(false);
const bomSelectRef = ref<InstanceType<typeof BomSelect>>(); const bomSelectRef = ref();
/*获取班次下拉框*/ /*获取班次下拉框*/
const getShiftSelect = async () => { const getShiftSelect = async () => {
@ -576,19 +576,20 @@ const handleExport = () => {
/** 新增按钮操作 */ /** 新增按钮操作 */
const handleMaterialAdd = () => { const handleMaterialAdd = () => {
materialOpen.value = true; materialOpen.value = true;
bomSelectRef.value.open(); // bomSelectRef.value.open();
} }
/** 提交物料信息按钮 */ /** 提交物料信息按钮 */
const submitMaterialForm = () => { const submitMaterialForm = () => {
console.log("bomSelectRef.value",bomSelectRef.value); console.log("bomSelectRef.value",bomSelectRef.value.tableRef.store.states.currentRow.value);
let selectedRow = bomSelectRef.value.selectedRow; let selectedRow = bomSelectRef.value.tableRef.store.states.currentRow.value;
console.log(selectedRow,form.value); console.log(selectedRow,form.value);
form.value.materialName = selectedRow.materialName form.value.materialName = selectedRow.materialName
console.log(selectedRow,form.value);
// this.$set(form, "materialId", selectedRow.materialId); // this.$set(form, "materialId", selectedRow.materialId);
// this.$set(form, "materialName", selectedRow.materialName); // this.$set(form, "materialName", selectedRow.materialName);
// this.$set(form, "erpMaterialId", selectedRow.erpId); // this.$set(form, "erpMaterialId", selectedRow.erpId);
materialOpen.value = false; // materialOpen.value = false;
} }
onMounted(() => { onMounted(() => {

Loading…
Cancel
Save