Browse Source

20240507

java8
qiezi 9 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:{ saveQuoteDetail:{
}, },
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','weighted','weighted2'],
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','totalCostUSD','weighted','weighted2'],
dataList:[], dataList:[],
saveLoading:false, saveLoading:false,
queryLoading:false, queryLoading:false,
@ -112,7 +112,7 @@ export default {
type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}], type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}],
costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}], costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}],
}, },
columns: [
columnList: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5011, functionId: 5011,
@ -293,6 +293,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 75 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, userId: this.$store.state.user.name,
functionId: 5011, functionId: 5011,
@ -381,7 +399,7 @@ export default {
sortLv: 0, sortLv: 0,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 290
columnWidth: 215
}, },
], ],
partVisible:false, 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() { created() {
this.quoteDetail.profitRate = this.quote.markup this.quoteDetail.profitRate = this.quote.markup
this.quoteDetail.quoteProfitRate = this.quote.markup this.quoteDetail.quoteProfitRate = this.quote.markup
@ -680,7 +715,7 @@ export default {
<template v-if="saveAuth"> <template v-if="saveAuth">
<el-button type="primary" v-if="!authFlag" :disabled="quote.status !== '草稿' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button> <el-button type="primary" v-if="!authFlag" :disabled="quote.status !== '草稿' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button>
</template> </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 === '草稿'"> <el-table-column width="50" align="center" label="默认行" v-if="quoteGroupDetail && quoteGroupDetail.status === '草稿'">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-radio <el-radio

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

@ -98,7 +98,7 @@ export default {
saveQuoteDetail:{ saveQuoteDetail:{
}, },
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','weighted','weighted2'],
numberProp:['adjustBomUnYield','adjustLabourCost','adjustFabricateCost','adjustMachineCost','adjustToolCost','totalCost','totalCostUSD','weighted','weighted2'],
dataList:[], dataList:[],
saveLoading:false, saveLoading:false,
queryLoading:false, queryLoading:false,
@ -110,7 +110,7 @@ export default {
type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}], type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}],
costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}], costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}],
}, },
columns:[
columnList:[
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5011, functionId: 5011,
@ -291,6 +291,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 75 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, userId: this.$store.state.user.name,
functionId: 5011, functionId: 5011,
@ -379,7 +397,7 @@ export default {
sortLv: 0, sortLv: 0,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 290
columnWidth: 215
}, },
], ],
partVisible:false, partVisible:false,
@ -638,6 +656,23 @@ export default {
this.saveQuoteDetail.partNo = newVal.toUpperCase(); 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> </script>
@ -649,6 +684,7 @@ export default {
<el-table <el-table
v-loading="queryLoading" v-loading="queryLoading"
border border
ref="table1"
:data="dataList" :data="dataList"
style="width: 100%;margin-top: 5px" style="width: 100%;margin-top: 5px"
:height="height" :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-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"> @row-click="quoteGroupDetailRowClick" :row-style="rowStyle" border :data="dataList" style="width: 100%;margin-top: 5px;" height="250px">
<el-table-column <el-table-column
v-for="(item,index) in columns" :key="index" v-for="(item,index) in columns" :key="index"
@ -819,9 +855,14 @@ export default {
:min-width="item.columnWidth" :min-width="item.columnWidth"
:label="item.columnLabel"> :label="item.columnLabel">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

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

@ -19,8 +19,8 @@ export default {
return{ return{
queryLoading:false, queryLoading:false,
dataList:[], 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, userId: this.$store.state.user.name,
functionId: 5011, functionId: 5011,
@ -201,6 +201,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 75 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, userId: this.$store.state.user.name,
functionId: 5011, functionId: 5011,
@ -289,7 +307,7 @@ export default {
sortLv: 0, sortLv: 0,
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 448
columnWidth: 373
}, },
], ],
} }
@ -416,13 +434,28 @@ export default {
// return Object.keys(this.dataList[0] || {}); // 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> </script>
<template> <template>
<div> <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="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 <el-table-column
v-for="(item,index) in columns" :key="index" v-for="(item,index) in columns" :key="index"

Loading…
Cancel
Save