rt-sim-training-client/src/views/orderauthor/order/detail.vue

76 lines
2.2 KiB
Vue
Raw Normal View History

<template>
2019-12-09 16:52:01 +08:00
<el-dialog v-dialogDrag :title="this.$t('orderAuthor.orderDetails')" :visible.sync="show" width="1000px" :before-do-close="doClose" :close-on-click-modal="false">
<el-table
ref="table2"
highlight-current-row
stripe
border
:data="orderList"
size="medium"
>
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.commodityName')" prop="goodsName" />
<el-table-column :key="forever" :label="this.$t('orderAuthor.permanenceOrNot')" prop="forever">
<template slot-scope="scope">
2019-12-09 17:25:20 +08:00
{{ $ConstSelect.translate(scope.row.forever, 'Whether') }}
2019-12-09 16:52:01 +08:00
</template>
</el-table-column>
2019-12-09 17:25:20 +08:00
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.goodsAmount')" prop="goodsAmount" />
2019-12-09 16:52:01 +08:00
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.itemPricing')" prop="price" />
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.startDate')" prop="startTime" />
<el-table-column :key="goodsName" :label="this.$t('orderAuthor.purchaseMonths')" prop="monthAmount">
<template slot-scope="scope">
{{ scope.row.forever?'/':scope.row.monthAmount }}
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
2019-12-09 16:52:01 +08:00
import { getGoodsListByOrderId } from '@/api/management/goods';
export default {
name: 'RouteDetail',
data() {
return {
show: false,
2019-12-09 16:52:01 +08:00
orderId:'',
orderList:[]
};
},
methods: {
doShow(data) {
2019-12-09 16:52:01 +08:00
this.orderId = data.id;
this.reloadTable();
this.show = true;
},
doClose() {
this.show = false;
2019-12-09 16:52:01 +08:00
},
reloadTable() {
if (this.orderId) {
this.initData();
}
},
initData() {
getGoodsListByOrderId(this.orderId).then(res=>{
this.orderList = res.data;
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
/deep/{
.data-box .el-form-item {
margin-bottom: 12px;
}
}
</style>