diff --git a/src/api/quote/quoteDetailBom.js b/src/api/quote/quoteDetailBom.js index d89e7b3..eddc699 100644 --- a/src/api/quote/quoteDetailBom.js +++ b/src/api/quote/quoteDetailBom.js @@ -1,3 +1,5 @@ import {createAPI} from "../../utils/httpRequest"; export const queryQuoteDetailBom = (data) => createAPI("/quote/detail/bom", "post", data); + +export const updateQuoteDetailBom = (data) => createAPI("/quote/detail/bom/update", "post", data); diff --git a/src/views/modules/quote/detail/primary/quoteDetailBom.vue b/src/views/modules/quote/detail/primary/quoteDetailBom.vue index f83ccf8..4071caf 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailBom.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailBom.vue @@ -6,6 +6,7 @@ import { } from "@/api/quote/quoteDetailBomTree"; import {queryQuoteDetailBom} from "@/api/quote/quoteDetailBom"; import {changeQuoteDetailBomTree} from "../../../../../api/quote/quoteDetailBomTree"; +import {updateQuoteDetailBom} from "../../../../../api/quote/quoteDetailBom"; export default { name: "quoteDetailBom", @@ -164,6 +165,24 @@ export default { fixed: '', columnWidth: 90, }, + { + userId: this.$store.state.user.name, + functionId: 5011, + serialNumber: '5011Table4AttritionRate', + tableId: "5011Table4", + tableName: "报价材料信息", + columnProp: 'attritionRate', + headerAlign: "center", + align: "right", + columnLabel: '报价成本损耗', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 90, + }, { userId: this.$store.state.user.name, functionId: 5011, @@ -272,7 +291,9 @@ export default { buNo: '', site: '', engChgLevel: null, - } + }, + quoteDetailBom:{}, + quoteDetailBomVisible:false, } }, methods: { @@ -438,7 +459,37 @@ export default { } this.$router.push(params) } - } + }, + handleUpdateQuoteDetailBom(row){ + if (row.attritionRate === undefined || row.attritionRate === null || row.attritionRate <= 0) { + this.$message.warning('报价成本损耗不能为空或小于等于0'); + return; + } + let params = { + id:row.id, + attritionRate:row.attritionRate, + } + updateQuoteDetailBom(params).then(({data})=>{ + if (data && data.code === 0){ + this.$message.success(data.msg); + this.quoteDetailBomVisible = false; + this.handleQueryQuoteDetailBom(); + }else{ + this.$message.warning(data.msg); + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, + handleClickUpdate(row,column,cell,event){ + if (column.label === '报价成本损耗'){ + this.quoteDetailBom = { + ...row, + } + this.quoteDetailBomVisible = true; + } + }, + }, created() { if (this.quoteDetail && this.quoteDetail.id) { @@ -475,8 +526,15 @@ export default { - - + + + + + + + {{ scope.row[item.columnProp] }} +