详情内容补全

This commit is contained in:
ljx 2024-06-06 16:14:35 +08:00
parent 1e84e934fd
commit 6ece4a8bfd
2 changed files with 169 additions and 20 deletions

View File

@ -49,25 +49,6 @@
</a-descriptions-item>
</a-descriptions>
</div>
<div class="detail-container">
<a-descriptions
size="small"
title="司机工资补贴"
layout="vertical"
:column="3"
bordered
>
<a-descriptions-item label="司机工资" >
{{ data.driver_salary }}
</a-descriptions-item>
<a-descriptions-item label="补贴" >
{{ data.driver_subsidy }}
</a-descriptions-item>
<a-descriptions-item label="补贴备注" >
{{ data.driver_subsidy_remark }}
</a-descriptions-item>
</a-descriptions>
</div>
<div class="detail-container">
<a-descriptions
size="small"
@ -103,8 +84,74 @@
<a-descriptions-item label="总价" >
{{ data.total_price }}
</a-descriptions-item>
<a-descriptions-item label="运费" >
{{ data.freight }}
</a-descriptions-item>
</a-descriptions>
</div>
<div class="detail-container">
<a-descriptions
size="small"
title="司机工资补贴"
layout="vertical"
:column="3"
bordered
>
<a-descriptions-item label="司机工资" >
{{ data.driver_salary }}
</a-descriptions-item>
<a-descriptions-item label="补贴" >
{{ data.driver_subsidy }}
</a-descriptions-item>
<a-descriptions-item label="补贴备注" >
{{ data.driver_subsidy_remark }}
</a-descriptions-item>
</a-descriptions>
</div>
<div class="detail-container" v-if="data.oil_consumption">
<a-descriptions
size="small"
title="加油信息"
layout="vertical"
:column="3"
bordered
>
<a-descriptions-item label="油耗数量" >
{{ data.oil_consumption.oil_consumption_number}}
</a-descriptions-item>
<a-descriptions-item label="油耗单价" >
{{ data.oil_consumption.oil_consumption_price }}
</a-descriptions-item>
<a-descriptions-item label="油耗总价" >
{{ data.oil_consumption.oil_consumption_total_price }}
</a-descriptions-item>
<a-descriptions-item label="加油日期" >
{{ data.oil_consumption.oil_consumption_date | formatDate }}
</a-descriptions-item>
<a-descriptions-item label="加油备注" >
{{ data.oil_consumption.oil_consumption_number }}
</a-descriptions-item>
</a-descriptions>
</div>
<div class="detail-container">
<a-tabs default-active-key="1" size="large">
<a-tab-pane key="1" tab="维修信息" force-render>
<vxe-table :data="maintenance">
<vxe-column v-for="item in columns" :key="item.field" :field="item.field" :title="item.title" :formatter="item.formatter" :sortable="true"></vxe-column>
</vxe-table>
</a-tab-pane>
<a-tab-pane key="2" tab="轮胎更换信息" force-render>
<vxe-table :data="tire">
<vxe-column v-for="item in columns2" :key="item.field" :field="item.field" :title="item.title" :formatter="item.formatter" :sortable="true"></vxe-column>
</vxe-table>
</a-tab-pane>
<a-tab-pane key="3" tab="其他费用" force-render>
<vxe-table :data="other_expenses_log">
<vxe-column v-for="item in columns3" :key="item.field" :field="item.field" :title="item.title" :formatter="item.formatter" :sortable="true"></vxe-column>
</vxe-table>
</a-tab-pane>
</a-tabs>
</div>
</div>
</template>
@ -129,7 +176,94 @@
},
FieldName:'train_number',
//
data: {}
data: {},
maintenance:[],
tire:[],
other_expenses_log:[],
columns:[
{
title: '日期',
field: 'maintenance_date',
key:'maintenance_date',
formatter: 'formatDate',
},
{
title: '维修项目',
field: 'maintenance_name',
key:'maintenance_name',
},
{
title: '维修金额',
field: 'maintenance_price',
key:'maintenance_price',
},
{
title: '维修内容',
field: 'maintenance_description',
key:'maintenance_description',
},
],
columns2:[
{
title: '轮胎更换日期',
field: 'tire_date',
key: 'tire_date',
formatter: 'formatDate',
},
{
title: '轮胎更换类型',
field: 'tire_type',
key: 'tire_type',
},
{
title: '旧轮胎胎号',
field: 'old_tire_number',
key: 'old_tire_number',
},
{
title: '新轮胎胎号',
field: 'tire_number',
key: 'tire_number',
},
{
title: '轮胎品牌',
field: 'tire_brand',
key: 'tire_brand',
},
{
title: '轮胎更换费用金额',
field: 'tire_price',
key: 'tire_price',
},
{
title: '备注',
field: 'tire_remark',
key: 'tire_remark',
},
],
columns3:[
{
title: '日期',
field: 'other_expenses_date',
key: 'other_expenses_date',
formatter: 'formatDate',
},
{
title: '费用项目名称',
field: 'other_expenses_name',
key: 'other_expenses_name',
},
{
title: '费用金额',
field: 'other_expenses_amount',
key: 'other_expenses_amount',
},
{
title: '备注',
field: 'other_expenses_remark',
key: 'other_expenses_remark',
},
]
}
},
created() {
@ -192,6 +326,9 @@
}
}).then(a => {
this.data = a.data[this.FieldName];
this.maintenance = a.data[this.FieldName].maintenance? a.data[this.FieldName].maintenance : [];
this.tire = a.data[this.FieldName].tire? a.data[this.FieldName].tire : [];
this.other_expenses_log = a.data[this.FieldName].other_expenses_log? a.data[this.FieldName].other_expenses_log : [];
}).catch((a) => {
this.$mk.error(a.msg, "aaa");
});

View File

@ -1188,6 +1188,18 @@ export default {
postdata.other_expenses_log = null
}
}
//null
if(postdata.maintenance!= null){
let error = postdata.maintenance.find(item => {
if(!item.maintenance_date || item.maintenance_name == '' || item.maintenance_price == 0){
this.$mk.error("请填写维护费用信息")
return false
}
})
console.log(error)
return error
}
//
if (this.isEdit) {
// postdata = { TrainNumber: postdata }