|
@@ -1,6 +1,6 @@
|
|
|
<script setup lang='ts'>
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
-import { getAccountFlow } from '@/api'
|
|
|
+import { getAccountFlow, getShopList } from '@/api'
|
|
|
import { message } from 'ant-design-vue';
|
|
|
import dayjs, { Dayjs } from 'dayjs';
|
|
|
let time = reactive({
|
|
@@ -9,6 +9,7 @@ let time = reactive({
|
|
|
dayjs().format('YYYY-MM-DD'),
|
|
|
]
|
|
|
})
|
|
|
+let shopList = reactive({ arr: [{ id: 0, name: '' }] })
|
|
|
interface FormState {
|
|
|
pageNum: Number
|
|
|
pageSize: Number
|
|
@@ -17,7 +18,7 @@ interface FormState {
|
|
|
endTime?: String
|
|
|
orderSn?: String
|
|
|
cityName?: String
|
|
|
- shopName?: String
|
|
|
+ shopId?: String
|
|
|
}
|
|
|
const params = reactive<FormState>({
|
|
|
pageNum: 1,
|
|
@@ -67,7 +68,7 @@ const columns = reactive([
|
|
|
key: '2'
|
|
|
}
|
|
|
])
|
|
|
-const data = reactive([])
|
|
|
+const data = reactive({ arr: [] })
|
|
|
const handleGetAccountFlow = () => {
|
|
|
params.startTime = time.arr[0]
|
|
|
params.endTime = time.arr[1]
|
|
@@ -75,7 +76,7 @@ const handleGetAccountFlow = () => {
|
|
|
getAccountFlow(params).then((res: any) => {
|
|
|
console.log('res', res);
|
|
|
if (res.code === 200) {
|
|
|
- Object.assign(data, res.data.data)
|
|
|
+ data.arr = res.data.data
|
|
|
pagination.total = res.data.totalNums
|
|
|
} else {
|
|
|
message.error(res.msg)
|
|
@@ -83,6 +84,11 @@ const handleGetAccountFlow = () => {
|
|
|
})
|
|
|
}
|
|
|
handleGetAccountFlow()
|
|
|
+const search = () => {
|
|
|
+ pagination.current = 1
|
|
|
+ params.pageNum = 1
|
|
|
+ handleGetAccountFlow()
|
|
|
+}
|
|
|
const handleTableChange = (e: any) => {
|
|
|
pagination.current = e.current
|
|
|
pagination.pageSize = e.pageSize
|
|
@@ -90,6 +96,16 @@ const handleTableChange = (e: any) => {
|
|
|
params.pageSize = e.pageSize
|
|
|
handleGetAccountFlow()
|
|
|
}
|
|
|
+const handleGetShopList = () => {
|
|
|
+ getShopList().then((res: any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ shopList.arr = res.data
|
|
|
+ } else {
|
|
|
+ message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+handleGetShopList()
|
|
|
onMounted(() => {
|
|
|
|
|
|
})
|
|
@@ -106,17 +122,20 @@ onMounted(() => {
|
|
|
</a-input>
|
|
|
</a-form-item>
|
|
|
<a-form-item label="店铺名称" name="shopName">
|
|
|
- <a-input v-model:value="params.shopName" placeholder="请选择要查询的店铺名称">
|
|
|
- </a-input>
|
|
|
+ <a-select v-model:value="params.shopId" style="width: 200px" placeholder="请选择要查询的店铺名称" allowClear>
|
|
|
+ <a-select-option v-for="(v, i) in shopList.arr" :key="i" :value="v.id">{{ v.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <!-- <a-input v-model:value="params.shopId" placeholder="请选择要查询的店铺名称"> -->
|
|
|
+ <!-- </a-input> -->
|
|
|
</a-form-item>
|
|
|
<a-form-item label="日期" name="time">
|
|
|
<a-range-picker v-model:value="time.arr" valueFormat="YYYY-MM-DD" />
|
|
|
</a-form-item>
|
|
|
<a-form-item>
|
|
|
- <a-button class="ml-20px" type="primary" @click="handleGetAccountFlow">查 询</a-button>
|
|
|
+ <a-button class="ml-20px" type="primary" @click="search">查 询</a-button>
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
- <a-table :columns="columns" :data-source="data" :pagination="pagination" bordered :scroll="true"
|
|
|
+ <a-table :columns="columns" :data-source="data.arr" :pagination="pagination" bordered :scroll="true"
|
|
|
@change="handleTableChange">
|
|
|
<template #bodyCell="{ column, text, record }">
|
|
|
<template v-if="column.dataIndex === 'amount' && column.key === '1'">
|