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