xlcp-frontend/src/views/prison/consumption/ConsumptionDetailDialog.vue
tangweijie 2115e4aa52 refactor: 前端重构评估模块为答题模块
主要变更:
- 删除 assessment 模块前端代码
- 消费记录模块表单和列表优化
- 问卷答题记录模块扩展测评执行和统计功能
- 更新字典配置

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-15 22:36:24 +08:00

48 lines
1.6 KiB
Vue

<template>
<Dialog title="消费明细" v-model="dialogVisible" width="600px">
<el-table :data="detailList" v-loading="loading">
<el-table-column label="商品名称" prop="goodsName" align="center" />
<el-table-column label="商品编码" prop="goodsCode" align="center" width="120" />
<el-table-column label="单价" prop="goodsPrice" align="center" width="100">
<template #default="{ row }">
¥{{ row.goodsPrice?.toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="数量" prop="goodsCount" align="center" width="80" />
<el-table-column label="小计" prop="subtotal" align="center" width="100">
<template #default="{ row }">
<span class="text-primary">¥{{ row.subtotal?.toFixed(2) }}</span>
</template>
</el-table-column>
</el-table>
<template #footer>
<el-button @click="dialogVisible = false">关闭</el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { ConsumptionApi, ConsumptionDetail } from '@/api/prison/consumption'
defineOptions({ name: 'ConsumptionDetailDialog' })
const dialogVisible = ref(false)
const loading = ref(false)
const detailList = ref<ConsumptionDetail[]>([])
const consumptionId = ref<number>()
/** 打开弹窗 */
const open = async (id: number) => {
consumptionId.value = id
dialogVisible.value = true
loading.value = true
try {
detailList.value = await ConsumptionApi.getConsumptionDetailList(id)
} finally {
loading.value = false
}
}
defineExpose({ open })
</script>