小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

201 lines
5.3 KiB

<template>
<view class="v-pages">
<!-- 页面 筛选 -->
<view class="v-pages-filter">
<!-- 页面 搜索 -->
<view class="v-pages-search">
<uni-search-bar @confirm="search" :focus="true" @cancel="cancel" @clear="clear"></uni-search-bar>
</view>
</view>
<!-- 页面 列表 -->
<view class="v-pages-list v-container m-t-regular">
<u-list @scrolltolower="scrolltolower">
<view class="v-pages-list-item" v-for="(item,index) in listData" :key="item.id">
<!-- 页面 卡片 -->
<view class="v-card">
<!-- 卡片 内容 -->
<view class="v-card-content">
<!-- 卡片 上部 -->
<view class="v-card-top row">
<!-- 卡片 信息 -->
<view class="v-card-info">
<view class="v-card-title row">
<text class="name col">{{item.processingName}}</text>
</view>
<view class="v-card-state m-t-mini">
<text class="state secondary"
v-if="item.speciesName">{{item.speciesName}}</text>
<dict-tag class="state primary" type="source_type" :value="item.sourceType" />
</view>
<view class="v-card-code"><text
class="iconfont icon-code m-r-small"></text>{{item.traceabilityCode}}</view>
</view>
</view>
<!-- 卡片 下部 -->
<view class="v-card-bot">
<view class="v-card-small-item" @click="openPopup(index)">
<view class="v-card-small-box row v-page-form small">
<view class="v-form-item col">
<uni-icons type="calendar" size="14"></uni-icons>
<text
class="content m-r-small">{{getFormat(item.recordList[0].deliveryTime)}}
</text>
配送
</view>
<view class="record"><text class="btn">配送记录</text></view>
</view>
</view>
</view>
</view>
</view>
</view>
<u-loadmore :status="status" />
</u-list>
</view>
<!-- 记录 弹框 -->
<uni-popup ref="popup">
<view class="popup-content v-container">
<view class="close" @click="closePopup">
<uni-icons type="close" size="30"></uni-icons>
</view>
<view class="v-card">
<view class="v-popup-title"><text>{{RecordName}}</text> 配送记录</view>
<view class="v-card-small-item" v-for="(item,index) in RecordData" :key="index">
<view class="v-card-small-box row v-page-form small">
<view class="col-10">
<view class="time">{{getFormat(item.deliveryTime)}}</view>
<view class="name delivery"><text>{{formatData(item.deliveryMan)}}</text></view>
</view>
<view class="col-4">
<view class="line">
<image src="@/static/images/icon_delivery.svg"></image>
</view>
</view>
<view class="col-10">
<view class="time">{{getFormat(item.receivedTime)}}</view>
<view class="name received"><text>{{formatData(item.receivedMan)}}</text></view>
</view>
<view class="v-form-item col-24 m-t-mini">
<text class="label">配送公司</text>
<text class="content">{{formatData(item.logisticsName)}}</text>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import * as ProductApi from "@/api/traceability/deliveryrecord"
import mix from '@/utils/mix.js'
import DictTag from "@/components/DictTag/index"
export default {
components: {
DictTag
},
data() {
return {
listData: [],
RecordName: null,
RecordData: [],
loadMoreStatus: 'loadmore',
queryParams: {
pageNo: 1,
pageSize: 10,
processingName: null,
total: null
}
}
},
watch: {
"queryParams.processingName"(newV, oldV) {
if (newV == "") {
this.go_clear()
}
}
},
mixins: [mix],
onLoad: function() {
this.getListData()
},
methods: {
// 获取产品数据
async getListData() {
this.loadMoreStatus = 'loading';
try {
const res = await ProductApi.getDeliveryRecordPage(this.queryParams)
console.log(res)
this.listData = [...this.listData, ...res?.data?.list];
this.queryParams.total = res?.data?.total;
if (this.queryParams.pageNo * this.queryParams.pageSize >= this.queryParams.total) {
this.loadMoreStatus = 'nomore';
} else {
this.loadMoreStatus = 'loadmore';
}
} finally {}
},
// 打开 弹窗
openPopup(index) {
console.log(this.listData[index])
this.RecordName = this.listData[index].processingName
this.RecordData = this.listData[index].recordList
this.$refs.popup.open()
},
// 关闭 弹窗
closePopup() {
this.$refs.popup.close()
},
//触底加载
scrolltolower() {
if (this.loadMoreStatus == 'loading' || this.loadMoreStatus == 'nomore') {
return;
}
this.queryParams.pageNo++;
this.getListData()
},
//确定搜索
search(res) {
this.queryParams.pageNo = 1
this.queryParams.processingName = res.value
this.listData = []
this.getListData()
},
//清除搜索
clear(res) {
this.queryParams = {
pageNo: 1,
pageSize: 10,
processingName: null,
total: null
}
this.listData = []
this.getListData()
},
//取消搜索
cancel(res) {
this.queryParams = {
pageNo: 1,
pageSize: 10,
processingName: null,
total: null
}
this.listData = []
this.getListData()
},
}
}
</script>
<style>
</style>