From e54797af5cc1f70843c83e5c875d638f95014e9d Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Wed, 30 Oct 2024 09:36:22 +0800 Subject: [PATCH] 20241030 --- src/api/property/templateDetail.js | 2 + .../modules/property/propertyTemplate.vue | 2 +- .../modules/quote/detail/breakdownCost.vue | 9 +- src/views/modules/quote/quoteDetailReport.vue | 339 ++++++++++++------ 4 files changed, 232 insertions(+), 120 deletions(-) diff --git a/src/api/property/templateDetail.js b/src/api/property/templateDetail.js index 1554e4b..60636ad 100644 --- a/src/api/property/templateDetail.js +++ b/src/api/property/templateDetail.js @@ -11,3 +11,5 @@ export const removePropertyTemplateDetail = (data) => createAPI('/property/templ export const removeBatchPropertyTemplateDetail = (data) => createAPI('/property/template/detail/batch/remove','post',data) export const batchUpdatePropertyTemplateDetail = (data) => createAPI('/property/template/detail/batch/update','post',data) + +export const queryPropertyTemplateDetailAvailableList = (data) => createAPI('/property/template/detail/available','post',data) diff --git a/src/views/modules/property/propertyTemplate.vue b/src/views/modules/property/propertyTemplate.vue index fe11ccd..879be0a 100644 --- a/src/views/modules/property/propertyTemplate.vue +++ b/src/views/modules/property/propertyTemplate.vue @@ -6,7 +6,6 @@ import { } from "../../../api/property/template"; import {getSiteAndBuByUserName} from "../../../api/eam/eam"; import BuSelect from "../../../components/selector/select/BuSelect.vue"; -import {queryPropertyItemByPage} from "../../../api/property/propertyItem"; import { batchSavePropertyTemplateDetail, batchUpdatePropertyTemplateDetail, queryPropertyTemplateDetail, @@ -401,6 +400,7 @@ export default { } }else { this.saveForm = { + buId: '', codeNo:'', codeDesc:'', functionType:'', diff --git a/src/views/modules/quote/detail/breakdownCost.vue b/src/views/modules/quote/detail/breakdownCost.vue index 0bc6158..b60756d 100644 --- a/src/views/modules/quote/detail/breakdownCost.vue +++ b/src/views/modules/quote/detail/breakdownCost.vue @@ -340,6 +340,14 @@ export default { }, methods:{ handleQueryQuoteDetailReportOverall(){ + if (!this.quoteDetail.id){ + this.dataList = [] + this.dataListRm = [] + this.subtotalCostStd = 0 + this.subtotalCostQuote = 0 + this.queryLoading = false; + return + } let params = { id:this.quoteDetail.id } @@ -423,7 +431,6 @@ export default { return; } const values = data.map(item => Number(item[column.property])); - console.log(values) if (!values.every(value => isNaN(value))) { sums[index] = values.reduce((prev, curr) => { const value = Number(curr); diff --git a/src/views/modules/quote/quoteDetailReport.vue b/src/views/modules/quote/quoteDetailReport.vue index 9f5f476..0985689 100644 --- a/src/views/modules/quote/quoteDetailReport.vue +++ b/src/views/modules/quote/quoteDetailReport.vue @@ -4,30 +4,35 @@ import {getSiteAndBuByUserName} from "../../../api/qc/qc"; import {queryQuoteDetailReport} from "../../../api/quote/quoteDetail"; import {getItemListByInquiryPartAndCodeNo} from "../../../api/inquiry/inquiryDetail"; import BreakdownCost from "./detail/breakdownCost.vue"; +import BuSelect from "../../../components/selector/select/BuSelect.vue"; +import {queryPropertyTemplate} from "../../../api/property/template"; +import {queryPropertyTemplateDetailAvailableList} from "../../../api/property/templateDetail"; export default { name: "quoteDetailReport", - components: {BreakdownCost}, - props:{ - height:{ - type:[String,Number], + components: {BuSelect, BreakdownCost}, + props: { + height: { + type: [String, Number], default: "38vh" } }, - data(){ - return{ - queryForm:{ - buId:undefined, - customerNo:'', - customerDesc:'' + data() { + return { + queryForm: { + buId: '', + customerNo: '', + customerDesc: '', + partNo: '', + partDesc: '' }, - no:1, - size:20, - total:0, - dataList:[], - queryLoading:false, - userBuList:[], - columns:[ + no: 1, + size: 20, + total: 0, + dataList: [], + queryLoading: false, + userBuList: [], + columns: [ { userId: this.$store.state.user.name, functionId: 5013, @@ -117,7 +122,7 @@ export default { status: true, fixed: '', columnWidth: 120 - },{ + }, { userId: this.$store.state.user.name, functionId: 5013, serialNumber: '5011Table1CustomerInquiryNo', @@ -225,42 +230,6 @@ export default { fixed: '', columnWidth: 100 }, - { - userId: this.$store.state.user.name, - functionId: 5013, - serialNumber: '5011Table1UpdateDate', - tableId: '5013Table1', - tableName: '报价信息表', - columnProp: 'updateDate', - headerAlign: 'center', - align: 'center', - columnLabel: '最近更新日期', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 130 - }, - { - userId: this.$store.state.user.name, - functionId: 5013, - serialNumber: '5011Table1UpdateBy', - tableId: '5013Table1', - tableName: '报价信息表', - columnProp: 'updateBy', - headerAlign: 'center', - align: 'left', - columnLabel: '最近更新人', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 100 - }, { userId: this.$store.state.user.name, functionId: 5013, @@ -281,12 +250,21 @@ export default { }, ], currentRow: {}, - activeName:'detail', - inquiryDataList:[], - queryPropertyLoading:false + activeName: 'detail', + inquiryDataList: [], + queryPropertyLoading: false, + propertyVisible: false, + propertyList: [], + + currentProperty: { + id: undefined, + codeNo: '', + codeDesc: '', + }, + propertyItemList: [], } }, - methods:{ + methods: { getSiteAndBuByUserName() { let tempData = { username: this.$store.state.user.name, @@ -297,84 +275,147 @@ export default { } }) }, - handleQuery(){ + handleQuery() { + let list = []; + if (this.propertyItemList.length > 0){ + list = this.propertyItemList.filter(item=>item.textValue || item.numValue); + } let params = { ...this.queryForm, no: this.no, - size: this.size + size: this.size, + codeNo:this.currentProperty.codeNo, + list, } this.queryLoading = true - queryQuoteDetailReport(params).then(({data})=>{ - if (data && data.code === 0){ + queryQuoteDetailReport(params).then(({data}) => { + if (data && data.code === 0) { this.dataList = data.rows this.total = data.total - if (this.total === 0){ + if (this.total === 0) { this.currentRow = {} - }else if (this.currentRow.id !== undefined){ + } else if (this.currentRow.id !== undefined) { // this.currentRow = {} - }else { + } else { this.currentRow = this.dataList[0] } - }else { + } else { this.$message.warning(data.msg) } this.queryLoading = false - }).catch((error)=>{ + }).catch((error) => { this.$message.error(error) this.queryLoading = false }) }, - handleRowClick(row){ + handleRowClick(row) { this.currentRow = {...row} }, - rowStyle({row}){ - if(this.currentRow && this.currentRow.id === row.id){ - return { 'background-color': '#E8F7F6' }; - }else { + rowStyle({row}) { + if (this.currentRow && this.currentRow.id === row.id) { + return {'background-color': '#E8F7F6'}; + } else { return {} } }, - handleSizeChange(val){ + handleSizeChange(val) { this.size = val this.handleQuery() }, - handlePageChange(val){ + handlePageChange(val) { this.no = val this.handleQuery() }, - handleQueryInquiryProperties(){ - if (this.currentRow.id === undefined){ + handleQueryInquiryProperties() { + if (this.currentRow.id === undefined) { + this.inquiryDataList = [] return } let params = { - inquiryPartId:this.currentRow.rfqDetailId, - buNo:this.currentRow.buNo, - site:this.currentRow.site, - recordType:'PRICECHECK', + inquiryPartId: this.currentRow.rfqDetailId, + buNo: this.currentRow.buNo, + site: this.currentRow.site, + recordType: 'PRICECHECK', } this.queryPropertyLoading = true - getItemListByInquiryPartAndCodeNo(params).then(({data})=>{ - if (data && data.code === 0){ + getItemListByInquiryPartAndCodeNo(params).then(({data}) => { + if (data && data.code === 0) { this.inquiryDataList = data.rows - }else { + } else { this.$message.warning(data.msg) } this.queryPropertyLoading = false - }).catch((error)=>{ + }).catch((error) => { this.$message.error(error) this.queryPropertyLoading = false }) - } + }, + handleClickProperty() { + if (!this.queryForm.buId) { + this.$message.warning('请先选择BU') + return + } + // this.handleQueryProperty(); + this.propertyVisible = true; + }, + handleQueryProperty() { + let params = { + buId: this.queryForm.buId, + createBy: this.$store.state.user.name, + functionType: 'IP' + } + queryPropertyTemplate(params).then(({data}) => { + if (data && data.code === 0) { + this.propertyList = data.rows + if (this.propertyList.length > 0) { + this.currentProperty.id = this.propertyList[0].id + this.currentProperty.codeNo = this.propertyList[0].codeNo + } + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + }) + }, + handleQueryPropertyTemplateDetailAvailableList() { + let params = { + headerId: this.currentProperty.id, + } + this.propertyItemList = [] + queryPropertyTemplateDetailAvailableList(params).then(({data}) => { + if (data && data.code === 0) { + this.propertyItemList = data.rows + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + }) + }, }, created() { this.getSiteAndBuByUserName(); this.handleQuery(); }, - watch:{ - currentRow(newVal,oldVal){ - if (newVal){ + watch: { + currentRow(newVal, oldVal) { + if (newVal) { this.handleQueryInquiryProperties() } + }, + 'queryForm.buId'(newVal, oldVal) { + this.currentProperty.id = undefined + this.currentProperty.codeNo = '' + this.propertyItemList = [] + if (newVal) { + this.handleQueryProperty(); + } + }, + 'currentProperty.id'(newVal, oldVal) { + if (newVal) { + this.handleQueryPropertyTemplateDetailAvailableList(); + } } } } @@ -382,45 +423,52 @@ export default {