|
@@ -38,29 +38,36 @@
|
|
|
<div class="col status">操作状态</div>
|
|
<div class="col status">操作状态</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 表格主体 -->
|
|
|
|
|
- <van-list
|
|
|
|
|
- v-model:loading="loading"
|
|
|
|
|
- :finished="finished"
|
|
|
|
|
- finished-text="没有更多了"
|
|
|
|
|
- @load="onLoad"
|
|
|
|
|
- class="table-body">
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="(item, index) in list"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- class="table-row"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="col index">{{ index + 1 }}</div>
|
|
|
|
|
- <div class="col time">{{ item.operationTime }}</div>
|
|
|
|
|
- <div class="col operator">{{ item.operatorName }}</div>
|
|
|
|
|
- <div class="col content">{{ item.deliveryNo }}</div>
|
|
|
|
|
- <div class="col status"
|
|
|
|
|
- :style="{ color: item.isPush === 0 ? '#333' : item.isPush === 1 ? '#67C23A' : '#F56C6C' }"
|
|
|
|
|
- @click="_rePush(item)">
|
|
|
|
|
- {{ item.isPush === 0 ? '待上传' : item.isPush === 1 ? '上传成功' : '上传失败' }}
|
|
|
|
|
|
|
+ <van-pull-refresh
|
|
|
|
|
+ v-model="refreshing"
|
|
|
|
|
+ success-text="刷新成功"
|
|
|
|
|
+ @refresh="onRefresh"
|
|
|
|
|
+ class="table-body"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- 表格主体 -->
|
|
|
|
|
+ <van-list
|
|
|
|
|
+ v-model:loading="loading"
|
|
|
|
|
+ :finished="finished"
|
|
|
|
|
+ finished-text="没有更多了"
|
|
|
|
|
+ @load="onLoad">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="(item, index) in list"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ class="table-row"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="col index">{{ index + 1 }}</div>
|
|
|
|
|
+ <div class="col time">{{ item.operationTime }}</div>
|
|
|
|
|
+ <div class="col operator">{{ item.operatorName }}</div>
|
|
|
|
|
+ <div class="col content">{{ item.deliveryNo }}</div>
|
|
|
|
|
+ <div class="col status"
|
|
|
|
|
+ :style="{ color: item.isPush === 0 ? '#333' : item.isPush === 1 ? '#67C23A' : '#F56C6C' }"
|
|
|
|
|
+ @click="_rePush(item)">
|
|
|
|
|
+ {{ item.isPush === 0 ? '待上传' : item.isPush === 1 ? '上传成功' : '上传失败' }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </van-list>
|
|
|
|
|
|
|
+ <van-back-top />
|
|
|
|
|
+ </van-list>
|
|
|
|
|
+ </van-pull-refresh>
|
|
|
</div>
|
|
</div>
|
|
|
</van-col>
|
|
</van-col>
|
|
|
</van-row>
|
|
</van-row>
|
|
@@ -317,6 +324,7 @@ const _rePush = (item) => {
|
|
|
const result = markAsPushed(item.deliveryNo);
|
|
const result = markAsPushed(item.deliveryNo);
|
|
|
entry.isPushing = false; // 请求完成解锁
|
|
entry.isPushing = false; // 请求完成解锁
|
|
|
item.isPush = 1;
|
|
item.isPush = 1;
|
|
|
|
|
+ scanSuccess();
|
|
|
showNotify({
|
|
showNotify({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
style: 'font-size: 30px !important;height:50px',
|
|
style: 'font-size: 30px !important;height:50px',
|
|
@@ -421,6 +429,10 @@ const page = ref(1)
|
|
|
const size = ref(10)
|
|
const size = ref(10)
|
|
|
// 模拟数据加载
|
|
// 模拟数据加载
|
|
|
const onLoad = () => {
|
|
const onLoad = () => {
|
|
|
|
|
+ if (refreshing.value) {
|
|
|
|
|
+ list.value = [];
|
|
|
|
|
+ refreshing.value = false;
|
|
|
|
|
+ }
|
|
|
const result = pageDelivery(page.value, size.value)
|
|
const result = pageDelivery(page.value, size.value)
|
|
|
if (result.size < size.value) {
|
|
if (result.size < size.value) {
|
|
|
finished.value = true;
|
|
finished.value = true;
|
|
@@ -430,7 +442,17 @@ const onLoad = () => {
|
|
|
list.value.push(...result)
|
|
list.value.push(...result)
|
|
|
loading.value = false;
|
|
loading.value = false;
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+const refreshing = ref(false);
|
|
|
|
|
+const onRefresh = () => {
|
|
|
|
|
+ // 清空列表数据
|
|
|
|
|
+ finished.value = false;
|
|
|
|
|
+
|
|
|
|
|
+ // 重新加载数据
|
|
|
|
|
+ // 将 loading 设置为 true,表示处于加载状态
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ page.value = 1
|
|
|
|
|
+ onLoad();
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="sass">
|
|
<style scoped lang="sass">
|