Browse Source

20240507

java8
qiezi 8 months ago
parent
commit
1f854d8525
  1. 43
      src/views/modules/quote/detail/quoteDetail.vue
  2. 55
      src/views/modules/quote/detail/quoteGroupDetail.vue
  3. 43
      src/views/modules/quote/detail/tpCost.vue

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

@ -100,7 +100,7 @@ export default {
saveQuoteDetail:{
},
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','weighted','weighted2'],
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','totalCostUSD','weighted','weighted2'],
dataList:[],
saveLoading:false,
queryLoading:false,
@ -112,7 +112,7 @@ export default {
type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}],
costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}],
},
columns: [
columnList: [
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -293,6 +293,24 @@ export default {
fixed: '',
columnWidth: 75
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2TotalCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'totalCostUSD',
headerAlign: 'center',
align: 'right',
columnLabel: 'Total Cost(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 75
},
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -381,7 +399,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 290
columnWidth: 215
},
],
partVisible:false,
@ -664,6 +682,23 @@ export default {
}
}
},
computed:{
columns:{
get(){
let val = this.dataList.every(item=>!isNaN(item.adjustToolCost) && item.adjustToolCost > 0);
if (val){
return this.columnList
}
return this.columnList.filter(item=>item.columnProp !== 'adjustToolCost')
},
}
},
beforeUpdate() {
this.$nextTick(() => {
this.$refs.table1.doLayout()
// this.$refs.table2.doLayout()
})
},
created() {
this.quoteDetail.profitRate = this.quote.markup
this.quoteDetail.quoteProfitRate = this.quote.markup
@ -680,7 +715,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 key="table" v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height" @header-dragend="handleColumnResize">
<el-table ref="table1" v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height" @header-dragend="handleColumnResize">
<el-table-column width="50" align="center" label="默认行" v-if="quoteGroupDetail && quoteGroupDetail.status === '草稿'">
<template slot-scope="{row}">
<el-radio

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

@ -98,7 +98,7 @@ export default {
saveQuoteDetail:{
},
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','weighted','weighted2'],
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','totalCostUSD','weighted','weighted2'],
dataList:[],
saveLoading:false,
queryLoading:false,
@ -110,7 +110,7 @@ export default {
type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}],
costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}],
},
columns:[
columnList:[
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -291,6 +291,24 @@ export default {
fixed: '',
columnWidth: 75
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2TotalCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'totalCostUSD',
headerAlign: 'center',
align: 'right',
columnLabel: 'Total Cost(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 75
},
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -379,7 +397,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 290
columnWidth: 215
},
],
partVisible:false,
@ -638,6 +656,23 @@ export default {
this.saveQuoteDetail.partNo = newVal.toUpperCase();
}
},
},
computed:{
columns:{
get(){
let val = this.dataList.every(item=>!isNaN(item.adjustToolCost) && item.adjustToolCost > 0);
if (val){
return this.columnList
}
return this.columnList.filter(item=>item.columnProp !== 'adjustToolCost')
},
}
},
beforeUpdate() {
this.$nextTick(() => {
this.$refs.table1.doLayout()
this.$refs.table2.doLayout()
})
}
}
</script>
@ -649,6 +684,7 @@ export default {
<el-table
v-loading="queryLoading"
border
ref="table1"
:data="dataList"
style="width: 100%;margin-top: 5px"
:height="height"
@ -806,7 +842,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"
<el-table v-loading="queryLoading" ref="table2"
@row-click="quoteGroupDetailRowClick" :row-style="rowStyle" border :data="dataList" style="width: 100%;margin-top: 5px;" height="250px">
<el-table-column
v-for="(item,index) in columns" :key="index"
@ -819,9 +855,14 @@ export default {
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<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 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>

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

@ -19,8 +19,8 @@ export default {
return{
queryLoading:false,
dataList:[],
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','weighted','weighted2'],
columns:[
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','totalCostUSD','weighted','weighted2'],
columnList:[
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -201,6 +201,24 @@ export default {
fixed: '',
columnWidth: 75
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2TotalCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'totalCostUSD',
headerAlign: 'center',
align: 'right',
columnLabel: 'Total Cost(USD/KCT)',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 75
},
{
userId: this.$store.state.user.name,
functionId: 5011,
@ -289,7 +307,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
columnWidth: 448
columnWidth: 373
},
],
}
@ -416,13 +434,28 @@ export default {
// return Object.keys(this.dataList[0] || {});
// }
// }
}
columns:{
get(){
let val = this.dataList.every(item=>!isNaN(item.adjustToolCost) && item.adjustToolCost > 0);
if (val){
return this.columnList
}
return this.columnList.filter(item=>item.columnProp !== 'adjustToolCost')
},
}
},
beforeUpdate() {
this.$nextTick(() => {
this.$refs.table1.doLayout()
// this.$refs.table2.doLayout()
})
},
}
</script>
<template>
<div>
<el-table :data="dataList" border :height="height" v-loading="queryLoading" @header-dragend="handleColumnResize">
<el-table ref="table1" :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="(item,index) in columns" :key="index"

Loading…
Cancel
Save