|
|
@@ -15,7 +15,7 @@
|
|
|
<el-button type="primary" size="mini" @click="handleAdd"
|
|
|
>新增</el-button
|
|
|
>
|
|
|
- <el-button type="primary" size="mini" @click="handleAdd"
|
|
|
+ <el-button type="primary" size="mini" @click="handleSave"
|
|
|
>保存</el-button
|
|
|
>
|
|
|
</div>
|
|
|
@@ -119,7 +119,8 @@
|
|
|
import {
|
|
|
getBomPageCategoryId,
|
|
|
contactList,
|
|
|
- deleteBomTreeList
|
|
|
+ deleteBomTreeList,
|
|
|
+ updateBatchBOM
|
|
|
} from '@/api/material/BOM';
|
|
|
import { getByCode } from '@/api/system/dictionary-data';
|
|
|
|
|
|
@@ -368,6 +369,20 @@
|
|
|
});
|
|
|
})
|
|
|
.finally(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSave() {
|
|
|
+ let _list = this.$refs.table.getData() ?? [];
|
|
|
+ if (_list.length == 0) {
|
|
|
+ return this.$message.info('明细表最少有一条数据');
|
|
|
+ }
|
|
|
+ let list = JSON.parse(JSON.stringify(_list));
|
|
|
+ updateBatchBOM(list).then((res) => {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ this.$refs.table.reload({
|
|
|
+ pageNum: 1
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|