69 lines
2.1 KiB
Vue
Raw Normal View History

2024-05-11 11:16:01 +08:00
<template>
<div>
2024-05-11 14:33:33 +08:00
<el-table :data="pager.lists" border style="width: 100%;">
2024-05-11 11:16:01 +08:00
<el-table-column prop="id" label="ID" width="120" />
<el-table-column label="单据编号" prop="number" show-overflow-tooltip />
<el-table-column label="单据金额" prop="total" show-overflow-tooltip />
<el-table-column
label="抵扣金额"
prop="deduction_price"
show-overflow-tooltip
/>
<el-table-column label="实际金额" prop="actual" show-overflow-tooltip />
<el-table-column label="实收金额" prop="money" show-overflow-tooltip />
<el-table-column
label="单据时间"
prop="create_time"
show-overflow-tooltip
/>
2024-05-11 14:33:33 +08:00
<el-table-column label="操作" fixed="right">
<template #default="{ row }">
<el-button type="primary" @click="openDetail(row)" link>详情</el-button>
</template>
</el-table-column>
2024-05-11 11:16:01 +08:00
</el-table>
<div class="flex mt-4 justify-end">
2024-05-17 18:24:03 +08:00
<pagination v-if="pager.lists" v-model="pager" @change="getLists" />
2024-05-11 11:16:01 +08:00
</div>
2024-05-11 18:14:39 +08:00
<detail ref="detailRef" v-if="showDetail" :dictData="dictData"
@close="showDetail = false"/>
2024-05-11 11:16:01 +08:00
</div>
</template>
<script lang="ts" setup name="subOrder">
import { usePaging } from "@/hooks/usePaging";
2024-05-11 18:14:39 +08:00
import { useDictData } from '@/hooks/useDictOptions'
2024-05-11 11:16:01 +08:00
import { apiOpurchaseclassSubOrders } from "@/api/opurchaseclass";
import { useRoute } from "vue-router";
2024-05-11 18:14:39 +08:00
import detail from "@/views/retail/cashierclass/detail.vue";
2024-05-11 11:16:01 +08:00
const route = useRoute();
const queryParams = reactive({
id: route.query.id,
2024-05-17 18:24:03 +08:00
is_mer: 1
2024-05-11 11:16:01 +08:00
});
// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiOpurchaseclassSubOrders,
params: queryParams,
});
2024-05-11 13:54:06 +08:00
defineExpose({
getLists
})
2024-05-11 14:33:33 +08:00
2024-05-11 18:14:39 +08:00
// 获取字典数据
const { dictData } = useDictData('pay_type,auditing_type')
2024-05-11 14:33:33 +08:00
2024-05-11 18:14:39 +08:00
const showDetail = ref(false);
const detailRef = ref(null);
const openDetail = async (row: any) => {
showDetail.value = true
await nextTick()
detailRef.value?.open('edit')
detailRef.value?.getDetail(row)
2024-05-11 14:33:33 +08:00
}
2024-05-11 11:16:01 +08:00
</script>