修复bug
This commit is contained in:
parent
db35f2d707
commit
6de147a86c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -112,8 +112,8 @@ defineExpose({
|
|||
</el-input>
|
||||
</div>
|
||||
<div class="order-list" v-loading="loading" v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="500"
|
||||
infinite-scroll-immediate="false"
|
||||
style="overflow: auto">
|
||||
<div class="item" :class="{'item-active': activeStore == index}" v-for="(item, index) in orderList" :key="index" @click="setForm(item, index)">
|
||||
|
|
|
@ -89,8 +89,8 @@ onUnmounted(() => {
|
|||
<div
|
||||
class="shop-list"
|
||||
v-infinite-scroll="loadMore"
|
||||
infinite-scroll-distance="100"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="100"
|
||||
:infinite-scroll-delay="500"
|
||||
:infinite-scroll-immediate="false"
|
||||
style="overflow: auto"
|
||||
>
|
||||
|
|
|
@ -135,8 +135,8 @@ onUnmounted(() => {
|
|||
class="table"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="300"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="300"
|
||||
style="overflow: auto"
|
||||
v-if="formData?.id"
|
||||
:infinite-scroll-immediate="false"
|
||||
|
|
|
@ -180,8 +180,8 @@ onUnmounted(()=>{
|
|||
class="order-lists"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="500"
|
||||
style="overflow: auto"
|
||||
>
|
||||
<div
|
||||
|
|
|
@ -150,8 +150,8 @@ onUnmounted(() => {
|
|||
class="table"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="300"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="300"
|
||||
style="overflow: auto"
|
||||
:infinite-scroll-immediate="false"
|
||||
>
|
||||
|
|
|
@ -162,8 +162,8 @@ onUnmounted(()=>{
|
|||
class="order-lists"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="500"
|
||||
style="overflow: auto"
|
||||
>
|
||||
<div
|
||||
|
|
|
@ -77,8 +77,8 @@ defineExpose({
|
|||
class="table"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="300"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="300"
|
||||
style="overflow: auto"
|
||||
:infinite-scroll-immediate="false"
|
||||
>
|
||||
|
|
|
@ -89,8 +89,8 @@ onUnmounted(() => {
|
|||
<div
|
||||
class="shop-list"
|
||||
v-infinite-scroll="loadMore"
|
||||
infinite-scroll-distance="1000"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="1000"
|
||||
:infinite-scroll-delay="500"
|
||||
:infinite-scroll-immediate="false"
|
||||
style="overflow: auto"
|
||||
>
|
||||
|
|
|
@ -130,8 +130,8 @@ onUnmounted(() => {
|
|||
class="table"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="300"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="300"
|
||||
style="overflow: auto"
|
||||
:infinite-scroll-immediate="false"
|
||||
>
|
||||
|
|
|
@ -155,8 +155,8 @@ onUnmounted(()=>{
|
|||
class="order-lists"
|
||||
v-loading="loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="500"
|
||||
style="overflow: auto"
|
||||
>
|
||||
<div
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<script setup>
|
||||
import { onMounted, onUnmounted, ref } from "vue";
|
||||
import { amountTakingListsApi, financialRecordListsApi } from "@/api/merchant.js";
|
||||
import {
|
||||
amountTakingListsApi,
|
||||
financialRecordListsApi,
|
||||
} from "@/api/merchant.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import mitt from "@/utils/mitt.js";
|
||||
import moment from "moment";
|
||||
|
@ -11,7 +14,7 @@ const where = ref({
|
|||
loadend: false,
|
||||
loading: false,
|
||||
create_time: "",
|
||||
start_time: ""
|
||||
start_time: "",
|
||||
});
|
||||
const changeDate = () => {
|
||||
where.value.page_no = 1;
|
||||
|
@ -24,7 +27,7 @@ const changeDate = () => {
|
|||
const listType = ref(1);
|
||||
const goods_list = ref([]);
|
||||
const getOrderList = () => {
|
||||
console.log("触底", !where.value.loadend , !where.value.loading);
|
||||
console.log("触底", !where.value.loadend, !where.value.loading);
|
||||
if (!where.value.loadend && !where.value.loading) {
|
||||
console.log("加载");
|
||||
where.value.loading = true;
|
||||
|
@ -40,12 +43,22 @@ const getOrderList = () => {
|
|||
where.value.loading = false;
|
||||
where.value.page_no++;
|
||||
});
|
||||
if (listType.value == 2)
|
||||
if (listType.value == 2) {
|
||||
if(where.value.start_time[0] >= where.value.start_time[1]) {
|
||||
where.value.loading = false;
|
||||
return ElMessage.error('开始时间不能大于等于结束时间');
|
||||
}
|
||||
let start_time = where.value.start_time[0]
|
||||
? moment(where.value.start_time[0]).format("YYYY-MM-DD")
|
||||
: "";
|
||||
let end_time = where.value.start_time[1]
|
||||
? moment(where.value.start_time[1]).format("YYYY-MM-DD")
|
||||
: "";
|
||||
financialRecordListsApi({
|
||||
page_no: where.value.page_no,
|
||||
page_size: where.value.page_size,
|
||||
start_time: moment(where.value.start_time || new Date()).format('YYYY-MM-DD'),
|
||||
// end_time: moment('2024-05-16').format('YYYY-MM-DD'),
|
||||
start_time: start_time,
|
||||
end_time: end_time,
|
||||
}).then((res) => {
|
||||
goods_list.value = [...goods_list.value, ...res.data.lists];
|
||||
if (res.data.lists.length < where.value.page_size)
|
||||
|
@ -54,6 +67,7 @@ const getOrderList = () => {
|
|||
where.value.page_no++;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
getOrderList();
|
||||
|
||||
|
@ -85,16 +99,16 @@ onUnmounted(() => {
|
|||
<div class="date">
|
||||
<div>
|
||||
<el-date-picker
|
||||
v-if="listType==1"
|
||||
v-if="listType == 1"
|
||||
v-model="where.create_time"
|
||||
type="month"
|
||||
placeholder="请选择月份"
|
||||
@change="changeDate"
|
||||
/>
|
||||
<el-date-picker
|
||||
v-if="listType==2"
|
||||
v-if="listType == 2"
|
||||
v-model="where.start_time"
|
||||
type="date"
|
||||
type="daterange"
|
||||
placeholder="请选择日期"
|
||||
@change="changeDate"
|
||||
format="YYYY-MM-DD"
|
||||
|
@ -111,11 +125,11 @@ onUnmounted(() => {
|
|||
class="table"
|
||||
v-loading="where.loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="300"
|
||||
::infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
style="overflow: auto"
|
||||
:infinite-scroll-immediate="false"
|
||||
v-if="listType==1"
|
||||
v-if="listType == 1"
|
||||
>
|
||||
<el-table :data="goods_list">
|
||||
<el-table-column
|
||||
|
@ -174,25 +188,20 @@ onUnmounted(() => {
|
|||
class="table"
|
||||
v-loading="where.loading"
|
||||
v-infinite-scroll="getOrderList"
|
||||
infinite-scroll-distance="500"
|
||||
infinite-scroll-delay="500"
|
||||
::infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
style="overflow: auto"
|
||||
:infinite-scroll-immediate="false"
|
||||
v-if="listType==2"
|
||||
v-if="listType == 2"
|
||||
>
|
||||
<el-table :data="goods_list">
|
||||
<el-table-column
|
||||
prop="number_sn"
|
||||
label="订单号"
|
||||
width="250"
|
||||
>
|
||||
<el-table-column prop="number_sn" label="订单号" width="250">
|
||||
</el-table-column>
|
||||
<el-table-column prop="number" label="变动金额" width="180" />
|
||||
<el-table-column prop="financial_type" label="变动类型" width="180" />
|
||||
<el-table-column prop="create_time" label="时间" />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -80,8 +80,8 @@ const submit = ()=>{
|
|||
</div>
|
||||
<div
|
||||
class="order-lists"
|
||||
infinite-scroll-distance="300"
|
||||
infinite-scroll-delay="500"
|
||||
:infinite-scroll-distance="300"
|
||||
:infinite-scroll-delay="500"
|
||||
style="overflow: auto"
|
||||
>
|
||||
<div
|
||||
|
|
Loading…
Reference in New Issue