Files
aida_front/src/component/Pay/allOrder.vue

258 lines
7.0 KiB
Vue
Raw Normal View History

2024-03-15 09:21:17 +08:00
<template>
2024-03-22 12:01:11 +08:00
<div class="allOrder_page generalModel_page">
<div class="generalModel_table_search">
<div class="generalModel_state">
<div class="generalModel_state_item">
2024-12-11 16:26:36 +08:00
<!-- <span>{{$t('allOrder.Time')}}:</span> -->
2024-12-18 17:38:43 +08:00
<a-range-picker
2024-03-15 17:23:25 +08:00
class="range_picker"
v-model:value="rangePickerValue"
:placeholder="[
$t('HistoryPage.StartDate'),
$t('HistoryPage.EndDate'),
]"
2024-03-22 12:01:11 +08:00
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
valueFormat="YYYY-MM-DD HH:mm:ss"
2024-03-15 09:21:17 +08:00
>
2024-03-15 17:23:25 +08:00
<template #suffixIcon>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
</div>
2024-12-18 17:38:43 +08:00
<div class="generalModel_state_item">
<!-- <span>{{$t('allOrder.Time')}}:</span> -->
<input type="Number" :placeholder="$t('Generate.jsContent3')" v-model="orderId">
</div>
2024-03-15 17:23:25 +08:00
</div>
2024-03-22 12:01:11 +08:00
<div class="generalModel_search">
2024-12-11 16:26:36 +08:00
<div class="gallery_btn" @click="searchAllOrderList()">Search</div>
<!-- <div
2024-03-22 12:01:11 +08:00
class="generalModel_search_item"
2024-03-15 17:23:25 +08:00
@click="searchAllOrderList()"
>
<span
class="icon iconfont icon-sousuo"
></span>
2024-12-11 16:26:36 +08:00
</div> -->
2024-03-15 17:23:25 +08:00
</div>
2024-03-15 09:21:17 +08:00
</div>
2024-03-22 12:01:11 +08:00
<div class="generalModel_table_content" ref="historyTable">
2024-03-15 09:21:17 +08:00
<a-table
:columns="columns"
:data-source="collectionList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
:pagination="{
2024-12-11 16:26:36 +08:00
showSizeChanger: false,
2024-03-15 09:21:17 +08:00
current: currentPage,
pageSize: pageSize,
total: total,
showQuickJumper: true,
bordered: false,
2024-12-11 16:26:36 +08:00
size:'small',
position:['bottomCenter']
2024-03-15 09:21:17 +08:00
}"
>
<template
#bodyCell="{ column, text, record, index }"
>
<div
class="operate_list"
v-if="column?.Operations"
>
2024-12-18 17:38:43 +08:00
<div class="operate_item"><a v-if="text" :href="text" target="_blank">LINK</a><span v-else>\</span></div>
2024-03-15 09:21:17 +08:00
</div>
</template>
2024-12-11 16:26:36 +08:00
<template #itemRender="{ type, originalElement }">
{{ type }}
</template>
2024-03-15 09:21:17 +08:00
</a-table>
2024-12-11 16:26:36 +08:00
<!-- <a-table :row-selection="{ selectedRowKeys: selectedRowKey, onChange: onSelectChange }" :columns="columns" :data-source="collectionList" /> -->
2024-03-15 09:21:17 +08:00
</div>
</div>
</template>
<script lang="ts">
2024-05-21 15:59:36 +08:00
import { defineComponent, ref, nextTick, computed } from "vue";
2024-03-15 09:21:17 +08:00
import { Https } from "@/tool/https";
import { useI18n } from "vue-i18n";
export default defineComponent({
components: {
},
setup() {
let renameData: any = ref({}); //修改名字选中的数据
2024-03-26 15:45:32 +08:00
const {t} = useI18n()
2024-03-15 09:21:17 +08:00
const columns: any = computed(() => {
return [
2024-12-11 16:26:36 +08:00
{
2024-03-26 15:45:32 +08:00
title: useI18n().t('allOrder.Serial'),
2024-03-15 09:21:17 +08:00
align: "center",
ellipsis: true,
2024-12-18 17:38:43 +08:00
dataIndex: "id",
key: "id",
2024-03-15 09:21:17 +08:00
},
2024-12-11 16:26:36 +08:00
{
title: useI18n().t('allOrder.Time'),
2024-03-15 09:21:17 +08:00
align: "center",
ellipsis: true,
2024-12-11 16:26:36 +08:00
dataIndex: "createTime",
key: "createTime",
2024-03-15 09:21:17 +08:00
},
{
2024-03-26 15:45:32 +08:00
title: useI18n().t('allOrder.Money'),
2024-03-15 09:21:17 +08:00
align: "center",
ellipsis: true,
2024-12-18 17:38:43 +08:00
dataIndex: "amount",
key: "amount",
2024-03-15 09:21:17 +08:00
},
{
2024-12-11 16:26:36 +08:00
title: useI18n().t('allOrder.PaymentMethods'),
2024-03-15 09:21:17 +08:00
align: "center",
ellipsis: true,
2024-12-18 17:38:43 +08:00
dataIndex: "paymentMethod",
key: "paymentMethod",
2024-03-15 09:21:17 +08:00
},
{
2024-03-26 15:45:32 +08:00
title: useI18n().t('allOrder.State'),
2024-03-15 09:21:17 +08:00
align: "center",
ellipsis: true,
2024-12-18 17:38:43 +08:00
dataIndex: "state",
key: "state",
2024-03-15 09:21:17 +08:00
},
2024-12-11 16:26:36 +08:00
{
title: useI18n().t('allOrder.OrderType'),
align: "center",
ellipsis: true,
2024-12-18 17:38:43 +08:00
dataIndex: "orderType",
key: "orderType",
},
{
title: useI18n().t('allOrder.Receipt'),
align: "center",
ellipsis: true,
Operations:true,
dataIndex: "invoiceLink",
key: "invoiceLink",
2024-12-11 16:26:36 +08:00
},
2024-03-15 09:21:17 +08:00
// {
// title: useI18n().t("HistoryPage.Operations"),
// key: "operation",
// align: "center",
// // slots:{customRender:'action'}
// Operations: true,
// },
];
});
let dataList: any = ref([]);
let rangePickerValue: any = ref([]);
2024-12-18 17:38:43 +08:00
let orderId: any = ref();
2024-03-15 09:21:17 +08:00
let collectionList: any = ref([]);
2024-12-11 16:26:36 +08:00
2024-03-15 09:21:17 +08:00
let userInfo: any = {};
2024-03-15 17:23:25 +08:00
let currentState = ref({
value:'income',
})
let state:any = ref([
{
label:'Income',
value:'income',
},
{
label:'Expend',
value:'expend',
},
])
2024-12-11 16:26:36 +08:00
let selectedRowKey = ref([])
const onSelectChange= (selectedRowKeys:any,)=>{
selectedRowKey.value = selectedRowKeys
}
2024-03-15 09:21:17 +08:00
return {
columns,
dataList,
renameData,
rangePickerValue,
2024-12-18 17:38:43 +08:00
orderId,
2024-03-15 09:21:17 +08:00
collectionList,
userInfo,
2024-03-15 17:23:25 +08:00
currentState,
state,
2024-03-26 15:45:32 +08:00
t,
2024-12-11 16:26:36 +08:00
selectedRowKey,
onSelectChange,
2024-03-15 09:21:17 +08:00
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
searchCollectionName: "",
};
},
mounted() {
},
methods: {
2024-12-18 17:38:43 +08:00
init(id:any){
2024-03-15 09:21:17 +08:00
this.currentPage = 1
this.pageSize = 10
2024-12-18 17:38:43 +08:00
this.orderId = id
2024-12-11 16:26:36 +08:00
nextTick(()=>{
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 100;
})
2024-03-15 09:21:17 +08:00
this.getAllOrderList()
2024-12-11 16:26:36 +08:00
2024-03-15 09:21:17 +08:00
},
//改变页码
changePage(e: any) {
2024-03-15 17:23:25 +08:00
this.currentPage = e.current
this.pageSize = e.pageSize
this.getAllOrderList();
2024-03-15 09:21:17 +08:00
},
//查询列表
searchAllOrderList() {
this.currentPage = 1;
this.getAllOrderList();
},
//获取列表
getAllOrderList() {
2024-12-11 16:26:36 +08:00
let startDate: any = this.rangePickerValue?.[0]?this.rangePickerValue[0] : "";
let endDate: any = this.rangePickerValue?.[1]?this.rangePickerValue[1] : "";
2024-03-15 17:23:25 +08:00
let data = {
endTime: endDate,
isIncome: this.currentState.value == 'income'?true:false,
page:this.currentPage,
size:this.pageSize,
2024-12-18 17:38:43 +08:00
startTime: startDate,
2024-12-19 17:59:00 +08:00
id:this.orderId
2024-03-15 17:23:25 +08:00
}
// getCreditsDetail
// orderInfoList
Https.axiosPost(Https.httpUrls.orderInfoList,data).then((rv: any) => {
if(this.currentPage > 1 && rv.content.length == 0){
this.currentPage = 1
this.getAllOrderList()
}else{
2024-12-11 16:26:36 +08:00
rv.content.forEach((item:any) => item.key = item.id);
2024-03-15 17:23:25 +08:00
this.collectionList = rv.content
this.total = rv.total
}
2024-03-15 09:21:17 +08:00
});
},
},
});
</script>
2024-12-11 16:26:36 +08:00
<style lang="less" scoped>
2024-03-22 12:01:11 +08:00
.allOrder_page{
padding: 0 !important;
flex: 1;
2024-03-15 09:21:17 +08:00
}
2024-03-26 15:45:32 +08:00
.generalModel_page {
}
2024-03-15 09:21:17 +08:00
</style>