|
@@ -4,11 +4,9 @@
|
|
|
<van-search style="width: 100%;" v-model="params.search" placeholder="请输入批次号" />
|
|
|
<van-icon @click="onSearch" size="20" style="margin: 19px 8px 0 0px;" name="search" />
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="batch_box" @scroll.passive="getScroll($event)"
|
|
|
- style=" height: calc(100vh - 154px);overflow-y: auto;">
|
|
|
- <van-pull-refresh v-model="refreshLoading" @refresh="onRefresh">
|
|
|
- <div class="batch" v-for="(item, index) in waiteList" :key="index">
|
|
|
+ <ScrollRefresh height="calc(100vh - 154px)" ref="scrollRefresh" :request="request">
|
|
|
+ <template v-slot="slotProps">
|
|
|
+ <div class="batch" v-for="(item, index) in slotProps.list" :key="index">
|
|
|
<div class="batch-top">
|
|
|
<div style="font-size: 16px;">批次号:{{ item.dispatchBatchNo
|
|
|
}}
|
|
@@ -18,53 +16,27 @@
|
|
|
<!-- 各个运单 -->
|
|
|
<div class="batchss"
|
|
|
:style="{ overflow: item.openCard ? 'auto' : 'hidden', height: item.openCard ? 'auto' : '130px', }">
|
|
|
-
|
|
|
- <div v-if="item.openCard == false" class="batch-middel">
|
|
|
+ <div class="batch-middel" v-for="unfold in item.list" :key="unfold.id">
|
|
|
<div class="batch-middel-text">
|
|
|
- <div class="batch-middel-text-style">[{{ item.list.expressCompany }}]运单号:{{
|
|
|
- item.list.expressNo }}</div>
|
|
|
- <div class="batch-middel-text-style">收件人:{{ item.list.recipient }}</div>
|
|
|
- <div class="batch-middel-text-style">部门:{{ item.list.departmentId }}</div>
|
|
|
- <div class="batch-middel-text-style">楼层:{{ item.list.floor }}</div>
|
|
|
- <div class="batch-middel-text-style">座位号:{{ item.list.sendSeat }}</div>
|
|
|
- <div style="display: flex;" class="batch-middel-text-style">联系方式:{{ item.list.phone }}
|
|
|
+ <div class="batch-middel-text-style">[{{ unfold.expressCompany }}]运单号:{{
|
|
|
+ unfold.expressNo }}</div>
|
|
|
+ <div class="batch-middel-text-style">收件人1:{{ unfold.recipient }}xxx</div>
|
|
|
+ <div class="batch-middel-text-style">部门:{{ unfold.departmentId }}</div>
|
|
|
+ <div class="batch-middel-text-style">楼层:{{ unfold.floor }}</div>
|
|
|
+ <div class="batch-middel-text-style">座位号:{{ unfold.sendSeat }}</div>
|
|
|
+ <div style="display: flex;" class="batch-middel-text-style">联系方式:{{ unfold.phone }}
|
|
|
<van-button style="margin-top: -5px; border-radius: 6px;" type="info" plain
|
|
|
size="mini">拨打</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display: flex; justify-content:space-around; padding-top: 5px;">
|
|
|
<van-button style="width: 100px; border-radius: 6px;" size="small" plain type="info"
|
|
|
- @click="onReceiving(item, type = 1)">签收
|
|
|
+ @click="onReceiving(unfold, type = 2)">签收
|
|
|
</van-button>
|
|
|
<van-button style="width: 100px; border-radius: 6px;" size="small" plain type="danger"
|
|
|
- @click="onSureRetention(item, type = 1)">设为滞留</van-button>
|
|
|
+ @click="onSureRetention(unfold, type = 2)">设为滞留</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div v-else>
|
|
|
- <div class="batch-middel" v-for="unfold in unfoldList" :key="unfold.id">
|
|
|
- <div class="batch-middel-text">
|
|
|
- <div class="batch-middel-text-style">[{{ unfold.expressCompany }}]运单号:{{
|
|
|
- unfold.expressNo }}</div>
|
|
|
- <div class="batch-middel-text-style">收件人1:{{ unfold.recipient }}xxx</div>
|
|
|
- <div class="batch-middel-text-style">部门:{{ unfold.departmentId }}</div>
|
|
|
- <div class="batch-middel-text-style">楼层:{{ unfold.floor }}</div>
|
|
|
- <div class="batch-middel-text-style">座位号:{{ unfold.sendSeat }}</div>
|
|
|
- <div style="display: flex;" class="batch-middel-text-style">联系方式:{{ unfold.phone }}
|
|
|
- <van-button style="margin-top: -5px; border-radius: 6px;" type="info" plain
|
|
|
- size="mini">拨打</van-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div style="display: flex; justify-content:space-around; padding-top: 5px;">
|
|
|
- <van-button style="width: 100px; border-radius: 6px;" size="small" plain type="info"
|
|
|
- @click="onReceiving(unfold, type = 2)">签收
|
|
|
- </van-button>
|
|
|
- <van-button style="width: 100px; border-radius: 6px;" size="small" plain
|
|
|
- type="danger" @click="onSureRetention(unfold, type = 2)">设为滞留</van-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
<div @click="onUnfold(item)" class="batch-bottom">
|
|
@@ -72,20 +44,9 @@
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
- <template v-if="!refreshLoading && waiteList.length > 0">
|
|
|
- <div class="bottom_text" v-if="loading">
|
|
|
- 加载中...
|
|
|
- </div>
|
|
|
- <div class="bottom_text" v-else-if="noData">
|
|
|
- 已经到底啦...
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-if="waiteList.length === 0">
|
|
|
- <div>数据为空!</div>
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
+ </ScrollRefresh>
|
|
|
|
|
|
- </van-pull-refresh>
|
|
|
- </div>
|
|
|
|
|
|
<!-- 签收 -->
|
|
|
<van-popup v-model="receiving" style="width: 100%; height: 84%;">
|
|
@@ -152,16 +113,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import ScrollRefresh from './ScrollRefresh.vue';
|
|
|
import { appOutboundInquiry, appGetTheDetails, appSetStrands, appDelivery, appUploadTheSignature } from '@/api/index'
|
|
|
export default {
|
|
|
name: 'waitsent',
|
|
|
+ components: {
|
|
|
+ ScrollRefresh
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- refreshLoading: false, // 刷新loading
|
|
|
- loading: false, // 加载更多loading
|
|
|
- noData: false, // 没有更多数据
|
|
|
- waiteList: [],
|
|
|
- unfoldList: [],//展开后获取的数据
|
|
|
getOtherPhone: '',//他人签收
|
|
|
otherCause: '',//滞留原因
|
|
|
receiving: false,//签收
|
|
@@ -179,8 +139,6 @@ export default {
|
|
|
|
|
|
params: {
|
|
|
search: '', //'SF202303221917',
|
|
|
- page: 1,
|
|
|
- limit: 3
|
|
|
},
|
|
|
onReceivingVlaue: {},//点击签收存放的数据
|
|
|
onSureRetentionVlaue: {},//点击签收滞留的数据
|
|
@@ -190,66 +148,30 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
// 获取数据
|
|
|
- this.getData();
|
|
|
+ // this.getData();
|
|
|
},
|
|
|
methods: {
|
|
|
- // 刷新
|
|
|
- async onRefresh() {
|
|
|
- this.params.page = 1;
|
|
|
- this.params.limit = 3;
|
|
|
- this.refreshLoading = true;
|
|
|
- await this.getData(true)
|
|
|
- this.refreshLoading = false
|
|
|
- },
|
|
|
+
|
|
|
// 搜索批次号
|
|
|
async onSearch() {
|
|
|
- // 每次查询都查询第一页
|
|
|
- this.params.page = 1;
|
|
|
- this.getData(true)
|
|
|
+ this.$refs.scrollRefresh.loadData(true)
|
|
|
},
|
|
|
- async getData(isClear) {
|
|
|
- this.loading = true
|
|
|
+ async request(_params) {
|
|
|
let parmas = {
|
|
|
dispatchBatchNo: this.params.search, // 批次号
|
|
|
deliveryPeopleId: localStorage.getItem('courierId'), //派送员id
|
|
|
isFinish: '2',//完成 1已完成 2未完成
|
|
|
- page: this.params.page, // 页数,
|
|
|
- limit: this.params.limit, // 条数
|
|
|
+ ..._params
|
|
|
|
|
|
}
|
|
|
const res = await appOutboundInquiry({ ...parmas }, { emulateJSON: true })
|
|
|
- let waiteList = res.data.map((item) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- openCard: false
|
|
|
- }
|
|
|
+ res.data = res.data.map((item) => {
|
|
|
+ item.list = [item.list]
|
|
|
+ return item
|
|
|
})
|
|
|
- if (isClear) {
|
|
|
- this.waiteList = waiteList
|
|
|
- } else {
|
|
|
- this.waiteList.push(...waiteList)
|
|
|
- }
|
|
|
-
|
|
|
- this.loading = false
|
|
|
- if (this.params.page * this.params.limit >= res.count) {
|
|
|
- this.noData = true;
|
|
|
- } else {
|
|
|
- this.noData = false;
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- // 滚动事件
|
|
|
- getScroll(event) {
|
|
|
- let scrollBottom =
|
|
|
- event.target.scrollHeight -
|
|
|
- event.target.scrollTop -
|
|
|
- event.target.clientHeight;
|
|
|
- // 距离底部20px以内 && 还有数据 && 没有正在加载中
|
|
|
- if (scrollBottom <= 20 && !this.noData && !this.loading) {
|
|
|
- this.params.page += 1;
|
|
|
- this.getData();
|
|
|
- }
|
|
|
- },
|
|
|
+ return res
|
|
|
+ }
|
|
|
+ ,
|
|
|
// 签收控制显示
|
|
|
onReceiving(value, type) {
|
|
|
if (type == 1) {
|
|
@@ -331,14 +253,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
const res = await appDelivery({ ...params })
|
|
|
- console.log(res, '........')
|
|
|
},
|
|
|
// 展开
|
|
|
async onUnfold(waite) {
|
|
|
const data = await appGetTheDetails({ dispatchBatchNo: waite.dispatchBatchNo })
|
|
|
- console.log("===", data)
|
|
|
- this.unfoldList = data.data
|
|
|
- waite.openCard = !waite.openCard;
|
|
|
+ waite.list = [...data.data, ...data.data, ...data.data]
|
|
|
+ this.$set(waite, "openCard", !waite.openCard)
|
|
|
}
|
|
|
},
|
|
|
}
|
|
@@ -351,11 +271,7 @@ export default {
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
|
|
|
-.bottom_text {
|
|
|
- text-align: center;
|
|
|
- color: #969799;
|
|
|
- font-size: 14px;
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
.container {
|
|
|
height: 100%
|
|
@@ -394,9 +310,10 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
&-style {
|
|
|
- width: 165px;
|
|
|
+ width: 50%;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|