Browse Source

20240506

java8
qiezi 8 months ago
parent
commit
ee3ddc87fd
  1. 104
      src/views/modules/quote/detail/quoteDetail.vue
  2. 98
      src/views/modules/quote/detail/quoteGroupDetail.vue
  3. 299
      src/views/modules/quote/detail/tpCost.vue
  4. 4
      src/views/modules/quote/index.vue

104
src/views/modules/quote/detail/quoteDetail.vue

@ -17,6 +17,7 @@ import PartTable from "../../../../components/selector/table/partTable.vue";
import {handleQueryPart} from "../../../../api/part/partInformation";
import {updateColumnSize} from "../../../../api/table";
import QuoteDetailCalculation from "./primary/quoteDetailCalculation.vue";
import {Decimal} from "decimal.js";
export default {
name: "quoteDetail",
@ -40,10 +41,13 @@ export default {
type:Boolean,
default:true
},
height:{
type:[Number,String],
default:300
},
},
data(){
return{
height: 300,
quoteDetail:{
id:null,
partNo:'',
@ -96,6 +100,7 @@ export default {
saveQuoteDetail:{
},
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','totalCost','weighted','weighted2'],
dataList:[],
saveLoading:false,
queryLoading:false,
@ -117,14 +122,14 @@ export default {
columnProp: 'partNo',
headerAlign: 'center',
align: 'left',
columnLabel: '物料编码',
columnLabel: 'Quotation Code',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90
columnWidth: 100
},
{
userId: this.$store.state.user.name,
@ -135,7 +140,7 @@ export default {
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnLabel: 'Description',
columnHidden: false,
columnImage: false,
columnSortable: false,
@ -170,15 +175,15 @@ export default {
tableName: '报价详情信息表',
columnProp: 'qty',
headerAlign: 'center',
align: 'left',
columnLabel: '报价数量',
align: 'right',
columnLabel: 'MOQ',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
columnWidth: 70
},
{
userId: this.$store.state.user.name,
@ -189,14 +194,14 @@ export default {
columnProp: 'adjustBomUnYield',
headerAlign: 'center',
align: 'right',
columnLabel: '报价成本',
columnLabel: 'FG BOM Cost',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
columnWidth: 100
},
{
userId: this.$store.state.user.name,
@ -214,7 +219,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
columnWidth: 60
},
{
userId: this.$store.state.user.name,
@ -232,7 +237,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
columnWidth: 60
},
{
userId: this.$store.state.user.name,
@ -250,7 +255,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
columnWidth: 60
}
,{
userId: this.$store.state.user.name,
@ -261,14 +266,14 @@ export default {
columnProp: 'totalCost',
headerAlign: 'center',
align: 'right',
columnLabel: 'Total Cost(RMB.KCT)',
columnLabel: 'Total Cost',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90
columnWidth: 70
},
{
userId: this.$store.state.user.name,
@ -286,43 +291,25 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Weighted',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'weighted',
headerAlign: 'center',
align: 'right',
columnLabel: 'Weighted TP for MOQ>250K(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Weighted2',
serialNumber: '5011Table2Type',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'weighted2',
columnProp: 'type',
headerAlign: 'center',
align: 'right',
columnLabel: 'Weighted TP for MOQ>5M(USD/KCT)',
align: 'center',
columnLabel: 'TP',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
columnWidth: 80
},
{
userId: this.$store.state.user.name,
@ -333,14 +320,14 @@ export default {
columnProp: 'weighted',
headerAlign: 'center',
align: 'right',
columnLabel: 'Standard TP for MOQ>250K(USD/KCT)',
columnLabel: 'MOQ > 250K(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
columnWidth: 83
},
{
userId: this.$store.state.user.name,
@ -351,14 +338,14 @@ export default {
columnProp: 'weighted2',
headerAlign: 'center',
align: 'right',
columnLabel: 'Standard TP for MOQ>5M(USD/KCT)',
columnLabel: 'MOQ > 5M (USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
columnWidth: 80
},
{
userId: this.$store.state.user.name,
@ -368,15 +355,15 @@ export default {
tableName: '报价详情信息表',
columnProp: 'remark',
headerAlign: 'center',
align: 'center',
columnLabel: '备注',
align: 'left',
columnLabel: 'COMMENT',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70
columnWidth: 180
},
],
partVisible:false,
@ -622,6 +609,12 @@ export default {
this.$emit('close');
this.saveVisible = false
},
toFixed(val,fixed){
if (!val || isNaN(val) || !fixed){
return val
}
return new Decimal(val).toFixed(fixed)
}
},
watch:{
quote(newVal,oldVal){
@ -659,11 +652,7 @@ export default {
this.handleQueryQuoteDetail();
},
mounted () {
if (!this.authFlag){
this.$nextTick(() => {
this.height = window.innerHeight - 150
})
}
}
}
</script>
@ -673,8 +662,7 @@ export default {
<template v-if="saveAuth">
<el-button type="primary" v-if="!authFlag" :disabled="quote.status !== '草稿' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button>
</template>
<el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height +
150" @header-dragend="handleColumnResize">
<el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height" @header-dragend="handleColumnResize">
<el-table-column width="80" align="center" label="默认报价行" v-if="quoteGroupDetail && quoteGroupDetail.status === '草稿'">
<template slot-scope="{row}">
<el-radio
@ -684,7 +672,7 @@ export default {
></el-radio>
</template>
</el-table-column>·
<el-table-column type="index" v-if="!authFlag" width="55" align="center" label="序号"></el-table-column>
<el-table-column type="index" v-if="!authFlag" width="30" align="center" label="NO"></el-table-column>
<el-table-column
v-for="(item,index) in columns" :key="index"
:sortable="item.columnSortable"
@ -696,11 +684,8 @@ export default {
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<template v-if="item.columnLabel === 'Weighted TP for MOQ>250K(USD/KCT)' || item.columnLabel === 'Weighted TP for MOQ>5M(USD/KCT)'">
<span v-if="scope.row.type && scope.row.type === 'Weighted TP'"> {{scope.row[item.columnProp] }}</span>
</template>
<template v-else-if="item.columnLabel === 'Standard TP for MOQ>250K(USD/KCT)' || item.columnLabel === 'Standard TP for MOQ>5M(USD/KCT)'">
<span v-if="!scope.row.type || scope.row.type === 'Standard TP'">{{scope.row[item.columnProp] }}</span>
<template v-if="numberProp.includes(item.columnProp)">
{{ toFixed(scope.row[item.columnProp],scope.row['decimalPlace']) }}
</template>
<template v-else>
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
@ -855,9 +840,8 @@ export default {
.radio /deep/ .el-radio__label{
display: none;
}
</style>
<style lang="scss" scoped>
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;

98
src/views/modules/quote/detail/quoteGroupDetail.vue

@ -17,6 +17,7 @@ import {
} from "../../../../api/quote/quoteGroupDetail";
import QuoteDetail from "./quoteDetail.vue";
import QuoteDetailCalculation from "./primary/quoteDetailCalculation.vue";
import {Decimal} from "decimal.js";
export default {
name: "quoteGroupDetail",
@ -97,6 +98,7 @@ export default {
saveQuoteDetail:{
},
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','totalCost','weighted','weighted2'],
dataList:[],
saveLoading:false,
queryLoading:false,
@ -108,8 +110,7 @@ export default {
type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}],
costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}],
},
columns: [
columns:[
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -119,14 +120,14 @@ export default {
columnProp: 'partNo',
headerAlign: 'center',
align: 'left',
columnLabel: '物料编码',
columnLabel: 'Quotation Code',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 100
},
{
userId: this.$store.state.user.name,
@ -137,14 +138,14 @@ export default {
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnLabel: 'Description',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 320
columnWidth: 170
},
{
userId: this.$store.state.user.name,
@ -173,14 +174,14 @@ export default {
columnProp: 'qty',
headerAlign: 'center',
align: 'right',
columnLabel: '报价数量',
columnLabel: 'MOQ',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
columnWidth: 70
},
{
userId: this.$store.state.user.name,
@ -191,14 +192,14 @@ export default {
columnProp: 'adjustBomUnYield',
headerAlign: 'center',
align: 'right',
columnLabel: '报价成本',
columnLabel: 'FG BOM Cost',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 130
columnWidth: 100
},
{
userId: this.$store.state.user.name,
@ -216,7 +217,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 60
},
{
userId: this.$store.state.user.name,
@ -234,7 +235,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 60
},
{
userId: this.$store.state.user.name,
@ -252,7 +253,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
columnWidth: 60
}
,{
userId: this.$store.state.user.name,
@ -263,14 +264,14 @@ export default {
columnProp: 'totalCost',
headerAlign: 'center',
align: 'right',
columnLabel: 'Total Cost(RMB.KCT)',
columnLabel: 'Total Cost',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
columnWidth: 70
},
{
userId: this.$store.state.user.name,
@ -288,43 +289,25 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Weighted',
serialNumber: '5011Table2Type',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'weighted',
columnProp: 'type',
headerAlign: 'center',
align: 'right',
columnLabel: 'Weighted TP for MOQ>250K(USD/KCT)',
align: 'center',
columnLabel: 'TP',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 260
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Weighted2',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'weighted2',
headerAlign: 'center',
align: 'right',
columnLabel: 'Weighted TP for MOQ>5M(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 260
columnWidth: 80
},
{
userId: this.$store.state.user.name,
@ -335,14 +318,14 @@ export default {
columnProp: 'weighted',
headerAlign: 'center',
align: 'right',
columnLabel: 'Standard TP for MOQ>250K(USD/KCT)',
columnLabel: 'MOQ > 250K(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 260
columnWidth: 83
},
{
userId: this.$store.state.user.name,
@ -353,14 +336,14 @@ export default {
columnProp: 'weighted2',
headerAlign: 'center',
align: 'right',
columnLabel: 'Standard TP for MOQ>5M(USD/KCT)',
columnLabel: 'MOQ > 5M (USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 260
columnWidth: 80
},
{
userId: this.$store.state.user.name,
@ -371,14 +354,14 @@ export default {
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnLabel: 'COMMENT',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
columnWidth: 180
},
],
partVisible:false,
@ -605,6 +588,12 @@ export default {
handleSelectionChange(val){
let ids = val.map((item)=>item.id);
this.$emit('handleSelectionChange', ids);
},
toFixed(val,fixed){
if (!val || isNaN(val) || !fixed){
return val
}
return new Decimal(val).toFixed(fixed)
}
},
created() {
@ -646,7 +635,7 @@ export default {
style="width: 100%;margin-top: 5px"
:height="height"
@selection-change="handleSelectionChange">
<el-table-column v-if="!selection" type="index" width="55" align="center" label="序号"></el-table-column>
<el-table-column v-if="!selection" type="index" width="30" align="center" label="NO"></el-table-column>
<el-table-column v-else type="selection" align="center" width="55"/>
<el-table-column
v-for="(item,index) in columns" :key="index"
@ -659,11 +648,8 @@ export default {
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<template v-if="item.columnLabel === 'Weighted TP for MOQ>250K(USD/KCT)' || item.columnLabel === 'Weighted TP for MOQ>5M(USD/KCT)'">
<span v-if="scope.row.type && scope.row.type === 'Weighted TP'"> {{scope.row[item.columnProp] }}</span>
</template>
<template v-else-if="item.columnLabel === 'Standard TP for MOQ>250K(USD/KCT)' || item.columnLabel === 'Standard TP for MOQ>5M(USD/KCT)'">
<span v-if="!scope.row.type || scope.row.type === 'Standard TP'">{{scope.row[item.columnProp] }}</span>
<template v-if="numberProp.includes(item.columnProp)">
{{ toFixed(scope.row[item.columnProp],scope.row['decimalPlace']) }}
</template>
<template v-else>
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
@ -803,7 +789,7 @@ export default {
<el-dialog title="报价明细" v-drag :visible.sync="drawerVisible" top="10vh" width="1200px" append-to-body :close-on-click-modal="false">
<el-table v-loading="queryLoading"
@row-click="quoteGroupDetailRowClick" :row-style="rowStyle" border :data="dataList" style="width: 100%;margin-top: 5px;" :height="'30vh'">
@row-click="quoteGroupDetailRowClick" :row-style="rowStyle" border :data="dataList" style="width: 100%;margin-top: 5px;" height="250px">
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
<el-table-column
v-for="(item,index) in columns" :key="index"
@ -829,7 +815,7 @@ export default {
:quote="quote"
:quote-group-detail="quoteGroupDetail"
:auth-flag="false"
:height="'33vh'"
height="250px"
@currentQuoteDetailItemNo="handleCurrentQuoteDetailItemNo"
@reload = "handleQueryQuoteDetail">
@ -849,4 +835,10 @@ export default {
height: auto;
line-height: 1.5;
}
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;
}
</style>

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

@ -1,6 +1,7 @@
<script>
import {queryQuoteDetailReportByTP} from "../../../../api/quote/quoteDetail";
import {updateColumnSize} from "../../../../api/table";
import {Decimal} from "decimal.js";
export default {
name: "tpCost",
@ -18,6 +19,261 @@ export default {
return{
queryLoading:false,
dataList:[],
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','totalCost','weighted','weighted2'],
columns:[
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2PartNo',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'partNo',
headerAlign: 'center',
align: 'left',
columnLabel: 'Quotation Code',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2PartDesc',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: 'Description',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 210
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2CostModel',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'costModel',
headerAlign: 'center',
align: 'left',
columnLabel: 'Cost Model',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Qty',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'qty',
headerAlign: 'center',
align: 'right',
columnLabel: 'MOQ',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2AdjustBomUnYield',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustBomUnYield',
headerAlign: 'center',
align: 'right',
columnLabel: 'FG BOM Cost',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2AdjustLabourCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustLabourCost',
headerAlign: 'center',
align: 'right',
columnLabel: 'DL',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2AdjustFabricateCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustFabricateCost',
headerAlign: 'center',
align: 'right',
columnLabel: 'VOH',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2AdjustMachineCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustMachineCost',
headerAlign: 'center',
align: 'right',
columnLabel: 'FOH',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
}
,{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2TotalCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'totalCost',
headerAlign: 'center',
align: 'right',
columnLabel: 'Total Cost',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2QuoteProfitRate',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'quoteProfitRate',
headerAlign: 'center',
align: 'right',
columnLabel: 'markup(%)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 60
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Type',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'type',
headerAlign: 'center',
align: 'center',
columnLabel: 'TP',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Weighted',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'weighted',
headerAlign: 'center',
align: 'right',
columnLabel: 'MOQ > 250K(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 83
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Weighted2',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'weighted2',
headerAlign: 'center',
align: 'right',
columnLabel: 'MOQ > 5M (USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Remark',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: 'COMMENT',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 260
},
],
}
},
methods:{
@ -119,6 +375,12 @@ export default {
flexWidth = 120
}
return flexWidth + 'px'
},
toFixed(val,fixed){
if (!val || isNaN(val) || !fixed){
return val
}
return new Decimal(val).toFixed(fixed)
}
},
watch:{
@ -131,11 +393,11 @@ export default {
},
},
computed:{
objectKeys:{
get(){
return Object.keys(this.dataList[0] || {});
}
}
// objectKeys:{
// get(){
// return Object.keys(this.dataList[0] || {});
// }
// }
}
}
</script>
@ -143,11 +405,36 @@ export default {
<template>
<div>
<el-table :data="dataList" border :height="height" v-loading="queryLoading" @header-dragend="handleColumnResize">
<el-table-column v-for="key in objectKeys" :align="alignIsNan(key,dataList)" header-align="center" :width="flexColumnWidth(key,dataList)" :key="key" :prop="key" :label="key"></el-table-column>
<!-- <el-table-column v-for="key in objectKeys" :align="alignIsNan(key,dataList)" header-align="center" :width="flexColumnWidth(key,dataList)" :key="key" :prop="key" :label="key"></el-table-column>-->
<el-table-column
v-for="(item,index) in columns" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<template v-if="numberProp.includes(item.columnProp)">
{{ toFixed(scope.row[item.columnProp],scope.row['decimalPlace']) }}
</template>
<template v-else>
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
style="width: 100px; height: 80px"/></span>
</template>
</template>
</el-table-column>
</el-table>
</div>
</template>
<style scoped>
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;
}
</style>

4
src/views/modules/quote/index.vue

@ -898,10 +898,10 @@ export default {
</el-pagination>
<el-tabs v-model="activeName" >
<el-tab-pane label="报价明细" name="group_detail">
<quote-group-detail :quote="currentQuote" :auth-flag="false" :height="'33vh'"></quote-group-detail>
<quote-group-detail :quote="currentQuote" :auth-flag="false" height="33vh"></quote-group-detail>
</el-tab-pane>
<el-tab-pane label="条目明细" name="detail">
<quote-detail v-if="activeName === 'detail'" :save-auth="false" :quote="currentQuote" :auth-flag="false" :height="'33vh'"></quote-detail>
<quote-detail v-if="activeName === 'detail'" :save-auth="false" :quote="currentQuote" :auth-flag="false" height="33vh"></quote-detail>
</el-tab-pane>
</el-tabs>

Loading…
Cancel
Save