Browse Source

20241112

java8
qiezi 1 year ago
parent
commit
590545df2c
  1. 1
      src/api/quote/quoteDetail.js
  2. 4
      src/views/modules/quote/detail/primary/quoteDetailCost.vue
  3. 131
      src/views/modules/quote/detail/tpCost.vue
  4. 9
      src/views/modules/quote/quoteDetailReport.vue

1
src/api/quote/quoteDetail.js

@ -20,3 +20,4 @@ export const queryQuoteDetailReport = (data) => createAPI(`/quote/detail/report/
export const queryQuoteDetailReportOverall = (data) => createAPI(`/quote/detail/report/overall`,'post',data)
export const queryQuoteDetailReportRM = (data) => createAPI(`/quote/detail/report/rm`,'post',data)
export const queryQuoteDetailReportByTP = (data) => createAPI(`/quote/detail/report/tp`,'post',data)

4
src/views/modules/quote/detail/primary/quoteDetailCost.vue

@ -85,9 +85,9 @@ export default {
this.computeLoading = true
queryQuoteDetailAllCost(params).then(({data})=>{
if (data && data.code === 0){
this.quoteDetail.partCost = data.row.unitQuotePrice;
this.quoteDetail.partCost = data.row.unitQuotePrice;//
this.quoteDetail.adjustPartCost = data.row.unitQuotePrice;
this.quoteDetail.bomUnYield = data.row.actualQuotePrice;
this.quoteDetail.bomUnYield = data.row.actualQuotePrice;//
this.quoteDetail.adjustBomUnYield = data.row.actualQuotePrice;
this.quoteDetail.labourCost = data.row.labourCost;
this.quoteDetail.adjustLabourCost = data.row.labourCost;

131
src/views/modules/quote/detail/tpCost.vue

@ -0,0 +1,131 @@
<script>
import {queryQuoteDetailReportByTP} from "../../../../api/quote/quoteDetail";
export default {
name: "tpCost",
props:{
quoteDetail:{
type:Object,
required:true
},
height:{
type:[String,Number],
default:300
}
},
data(){
return{
queryLoading:false,
dataList:[],
}
},
methods:{
handleQuery(){
let params = {
id:this.quoteDetail.id
}
this.queryLoading = true;
queryQuoteDetailReportByTP(params).then(({data})=>{
if (data && data.code === 0){
this.dataList = data.rows
}else {
this.queryLoading = false;
}
this.queryLoading = false;
}).catch((error)=>{
this.queryLoading = false;
this.$message.error(error);
})
},
flexColumnWidth (str, arr1, flag = 'max') {
// str();tableData();
// flag,'max''equal','max'
// flag'max',flag'equal'
str = str + ''
let columnContent = ''
if (!arr1 || !arr1.length || arr1.length === 0 || arr1 === undefined) {
return
}
if (!str || !str.length || str.length === 0 || str === undefined) {
return
}
if (flag === 'equal') {
// ()
for (let i = 0; i < arr1.length; i++) {
if (arr1[i][str].length > 0) {
// console.log('[0]:', arr1[0][str])
columnContent = arr1[i][str]
break
}
}
} else {
// ()
let index = 0
for (let i = 0; i < arr1.length; i++) {
if (arr1[i][str] === null) {
return
}
const now_temp = arr1[i][str] + ''
const max_temp = arr1[index][str] + ''
if (now_temp.length > max_temp.length) {
index = i
}
}
columnContent = arr1[index][str]
}
// console.log('[i]:', columnContent)
//
let flexWidth = 0
for (const char of columnContent) {
if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
// 8
flexWidth += 8
} else if (char >= '\u4e00' && char <= '\u9fa5') {
// 15
flexWidth += 15
} else {
// 8
flexWidth += 8
}
}
if (flexWidth < 80) {
//
flexWidth = 80
}
// if (flexWidth > 250) {
// //
// flexWidth = 250
// }
return flexWidth + 'px'
}
},
watch:{
quoteDetail(newVal,oldVal){
if (newVal){
this.handleQuery();
}else {
this.dataList = [];
}
},
},
computed:{
objectKeys:{
get(){
return Object.keys(this.dataList[0] || {});
}
}
}
}
</script>
<template>
<div>
<el-table :data="dataList" border :fit="true" :height="height">
<el-table-column v-for="key in objectKeys" :key="key" :prop="key" :label="key"></el-table-column>
</el-table>
</div>
</template>
<style scoped>
</style>

9
src/views/modules/quote/quoteDetailReport.vue

@ -13,10 +13,12 @@ import QuoteDetailBom from "./detail/primary/quoteDetailBom.vue";
import QuoteDetailOther from "./detail/primary/quoteDetailOther.vue";
import QuoteDetailCost from "./detail/primary/quoteDetailCost.vue";
import QuoteDetailRouting from "./detail/primary/quoteDetailRouting.vue";
import TpCost from "./detail/tpCost.vue";
export default {
name: "quoteDetailReport",
components: {
TpCost,
QuoteDetailRouting,
QuoteDetailCost,
QuoteDetailOther,
@ -163,7 +165,7 @@ export default {
columnProp: 'partNo',
headerAlign: 'center',
align: 'left',
columnLabel: '产品编码',
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -181,7 +183,7 @@ export default {
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '产品描述',
columnLabel: '物料描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -733,6 +735,9 @@ export default {
<el-tab-pane name="breakdown" label="Cost Breakdown">
<breakdown-cost :quote-detail="currentRow" height="36vh"></breakdown-cost>
</el-tab-pane>
<el-tab-pane name="tp" label="TP">
<tp-cost :quote-detail="currentRow" height="36vh"></tp-cost>
</el-tab-pane>
</el-tabs>
<el-dialog title="属性详情" v-drag :visible.sync="propertyVisible" :close-on-click-modal="false" append-to-body

Loading…
Cancel
Save