From 94f264c3f7c867b0e1265984fa84d11cbb4fe4b5 Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Tue, 20 Aug 2024 10:29:56 +0800 Subject: [PATCH] =?UTF-8?q?20240819=20=E6=8A=A5=E4=BB=B7=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quote/quoteDetailAttribute.js | 2 + .../quote/detail/primary/quoteDetailCost.vue | 27 +++++----- .../quote/detail/primary/quoteDetailOther.vue | 54 +++++++++++++++++-- 3 files changed, 67 insertions(+), 16 deletions(-) diff --git a/src/api/quote/quoteDetailAttribute.js b/src/api/quote/quoteDetailAttribute.js index 4b42a06..738bea9 100644 --- a/src/api/quote/quoteDetailAttribute.js +++ b/src/api/quote/quoteDetailAttribute.js @@ -5,5 +5,7 @@ export const queryQuoteDetailAttribute = (data) => createAPI(`/quote/detail/attr export const queryQuoteDetailAttributeItem = (data) => createAPI(`/quote/detail/attribute/item`,'post',data) export const batchUpdateDetailAttribute = (data) => createAPI(`/quote/detail/attribute/batch/update`,'post',data) +export const batchRemoveDetailAttribute = (data) => createAPI(`/quote/detail/attribute/batch/remove`,'post',data) +export const batchSaveDetailAttribute = (data) => createAPI(`/quote/detail/attribute/batch/save`,'post',data) diff --git a/src/views/modules/quote/detail/primary/quoteDetailCost.vue b/src/views/modules/quote/detail/primary/quoteDetailCost.vue index dab3e3e..3b1e7cc 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailCost.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailCost.vue @@ -81,6 +81,9 @@ export default { if (data && data.code === 0){ this.quoteDetail.toolCost = data.row.toolCost; this.quoteDetail.adjustToolCost = data.row.toolCost; + this.quoteDetail.packCost = data.row.packCost; + this.quoteDetail.shippingCost = data.row.shippingCost; + this.quoteDetail.otherCost = data.row.otherCost; }else { this.$message.warning(data.msg); } @@ -236,18 +239,18 @@ export default { v-model="quoteDetail.manageCost" :step="0" :precision="4" :min="0"/> - - - - - - - - - - - - + + + + + + + + + + import { + batchRemoveDetailAttribute, batchSaveDetailAttribute, batchUpdateDetailAttribute, queryQuoteDetailAttribute, queryQuoteDetailAttributeItem @@ -131,8 +132,13 @@ export default { return } // 保存属性 - // console.log(this.dataList) - batchUpdateDetailAttribute(this.dataList).then(({data})=>{ + let params = this.dataList.map(item => { + return{ + ...item, + updateBy: this.$store.state.user.name, + } + }) + batchUpdateDetailAttribute(params).then(({data})=>{ if (data && data.code === 0){ this.$message.success(data.msg); this.handleQueryOther(); @@ -182,6 +188,46 @@ export default { handleItemSelectionChange(val){ this.selectionList = val; }, + handleAddAttribute(){ + if (this.selectionList.length === 0){ + this.$message.warning("请先选择属性"); + return + } + let params = this.selectionList.map(item => { + return{ + ...item, + createBy: this.$store.state.user.name, + } + }) + batchSaveDetailAttribute(params).then(({data})=>{ + if (data && data.code === 0) { + this.$message.success(data.msg); + this.handleQueryOther(); + this.handleQueryAttributeItem(); + }else { + this.$message.warning(data.msg); + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, + handleRemoveAttribute(){ + if (this.selectionDataList.length === 0){ + this.$message.warning("请先选择属性"); + return + } + batchRemoveDetailAttribute(this.selectionDataList).then(({data})=>{ + if (data && data.code === 0){ + this.$message.success(data.msg); + this.handleQueryOther(); + this.handleQueryAttributeItem(); + }else { + this.$message.warning(data.msg); + } + }).catch((error)=>{ + this.$message.error(error); + }) + }, }, created() { if (this.quoteDetail && this.quoteDetail.id){ @@ -289,10 +335,10 @@ export default {
- 添加>> + 添加>>
- 删除<< + 删除<<