123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532 |
- <template>
- <view class="container record clearfix" :style="{ paddingTop: CustomBar + 'px' }">
- <cd-custom
- :systeminfo="systeminfo"
- :navbar-data="nvabarData"
- :headerBtnPosi="headerBtnPosi"
- :page="1"
- @pageDetails="hanldPageDetails"
- ></cd-custom>
- <view
- class="record-content-empty"
- v-if="isEmpty"
- :style="{ height: windowHeight ? windowHeight - CustomBar + 'px' : 'auto' }"
- >
- <view class="record-container clearfix">
- <image
- class="club-empty-image"
- src="https://img.caimei365.com/group1/M00/03/B7/Cmis2178OfaAEjhLAABqsz9OXM0847.png"
- mode="aspectFit"
- ></image>
- <view class="txt">此订单暂无发货记录~</view> <view class="btn" @click="pageGoLink">去发货</view>
- </view>
- </view>
- <view class="record-content" v-else>
- <scroll-view scroll-y="true" class="scroll-view">
- <view class="record-list clearfix" v-for="(item, index) in RecordList" :key="index">
- <view class="record-top clearfix">
- <view class="top-view">
- <view class="top-viewlabel">发货时间:</view>
- <view class="top-viewtext">{{ item.deliveryTime }}</view>
- </view>
- <view class="top-view" v-for="(logist, idx) in item.logisticsInformationList" :key="logist.id">
- <view class="top-viewlabel">{{ logist.logisticsCompanyName }}:</view>
- <view class="top-viewtext">
- <text>{{ logist.nu }}</text>
- </view>
- </view>
- </view>
- <view class="goods-pros">
- <view class="goods-pros-t" v-for="(pros, idx) in item.logisticsRecordList" :key="pros.id">
- <view class="pros-img"
- ><image :src="pros.image ? pros.image : ''" alt="" mode="aspectFill"
- /></view>
- <view class="pros-product">
- <view class="producttitle">{{ pros.productName }}</view>
- <view class="productspec">规格:{{ pros.unit ? pros.unit : '' }}</view>
- <view class="productspec">商品编码:{{ pros.productCode ? pros.productCode : '' }}</view>
- <view class="product-view">
- <view class="view-num">数量:{{ pros.buyNum }}</view>
- </view>
- <view class="product-view">
- <view class="view-num">本次发货:{{ pros.num }}</view>
- <view class="view-num">已发货:{{ pros.shipmentsNum }}</view>
- </view>
- <view class="product-view">
- <view class="view-num">未发货:{{ pros.notShippedNum }}</view>
- <view class="view-num">已退货:{{ pros.returnedNum }}</view>
- </view>
- </view>
- </view>
- <view class="goods-pros-b clearfix" v-show="item.remarkImages.length > 0">
- <view class="b-label">拍照备注</view>
- <view class="b-photo">
- <view class="b-imageView" v-for="(imgItem, imgIdx) in item.remarkImages" :key="imgIdx">
- <image
- :src="imgItem"
- mode="aspectFill"
- @click="previewImg(imgIdx, item.remarkImages)"
- ></image>
- </view>
- </view>
- </view>
- <view class="goods-pros-b clearfix" v-if="item.remark != ''">
- <view class="b-label">文字备注</view>
- <view class="b-photo">
- <view class="text">{{ item.remark ? item.remark : '' }}</view>
- </view>
- </view>
- </view>
- <!-- 底部button -->
- <order-button ref="orderButton" :hanldData="item" @buttonConfirm="handButtonConfirm">
- </order-button>
- </view>
- <!--加载loadding-->
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
- <!--加载loadding-->
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import orderButton from './components/supplierRecorgButton.vue' //底部按钮
- import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
- import tuiNomore from '@/components/tui-components/nomore/nomore'
- import cdCustom from '@/components/cm-custom/custom-d'
- var isPreviewImg
- export default {
- components: {
- orderButton,
- tuiLoadmore,
- tuiNomore,
- cdCustom
- },
- data() {
- return {
- nvabarData: {
- //顶部自定义导航
- showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示
- title: '发货记录' // 导航栏 中间的标题
- },
- headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
- systeminfo: this.setSysteminfo(), //获取设备信息
- CustomBar: this.CustomBar, // 顶部导航栏高度
- isIphoneX: this.$store.state.isIphoneX,
- listQuery: {
- shopOrderId: 0,
- pageNum: 1,
- pageSize: 10
- },
- lgisList: [],
- ramkesList: [],
- RecordList: [], //发货记录
- hasNextPage: false,
- loadding: false,
- pullUpOn: true,
- pullFlag: true,
- isEmpty: false,
- nomoreText: '上拉显示更多',
- scrollHeight: '',
- windowHeight: '',
- mobile: 0
- }
- },
- onLoad(option) {
- this.listQuery.shopOrderId = option.shopOrderId
- this.setScrollHeight()
- this.initShopShipmentsRecord()
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {
- initShopShipmentsRecord() {
- //初始化发货记录 index:1
- this.ShopService.ShopShipmentsRecord(this.listQuery)
- .then(response => {
- console.log(response)
- let data = response.data
- let logisticsBatchPage = data.logisticsBatchPage
- this.mobile = data.userInfo.mobile
- if (logisticsBatchPage.list && logisticsBatchPage.list.length > 0) {
- this.isEmpty = false
- this.hasNextPage = logisticsBatchPage.hasNextPage
- this.RecordList = logisticsBatchPage.list
- this.pullFlag = false
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- if (this.hasNextPage) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- if (this.RecordList.length < 2) {
- this.pullUpOn = true
- this.loadding = false
- } else {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- }
- } else {
- this.isEmpty = true
- }
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- getOnReachBottomData() {
- this.listQuery.pageNum += 1
- this.ShopService.ShopShipmentsRecord(this.listQuery)
- .then(response => {
- let data = response.data.logisticsBatchPage
- if (data.list && data.list.length > 0) {
- this.hasNextPage = data.hasNextPage
- this.RecordList = this.RecordList.concat(data.list)
- this.pullFlag = false // 防上拉暴滑
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- if (this.hasNextPage) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- }
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- setHeaderBtnPosi() {
- // 获得胶囊按钮位置信息
- let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
- return headerBtnPosi
- },
- setSysteminfo() {
- // 获取设备信息
- let systeminfo
- uni.getSystemInfo({
- success: res => {
- systeminfo = res
- }
- })
- return systeminfo
- },
- setScrollHeight() {
- const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
- this.windowHeight = windowHeight - 1
- this.scrollHeight = windowHeight - 1
- },
- previewImg(index, previewUrls) {
- //顶部商品图片预览
- isPreviewImg = true
- uni.previewImage({
- current: index, //图片索引
- urls: previewUrls, //必须是http图片,本地图片无效
- longPressActions: ''
- })
- },
- handButtonConfirm(data) {
- //监听点击时间的按钮类型并执行...
- // console.log(data)
- this.handShowAlert(data)
- },
- handShowAlert(data) {
- //判断点击的按钮类型并执行...
- let hanldType = data.hanldType
- let hanldData = data.hanldData
- console.log(hanldData)
- switch (hanldType) {
- case 'cancel':
- this.handCenceConfirm(hanldData)
- break
- case 'add':
- let setProductList = []
- let repleArray = hanldData.logisticsRecordList
- repleArray.forEach(el => {
- let elObject = {
- orderProductId: el.orderProductId,
- num: el.num
- }
- setProductList.push(elObject)
- })
- let data = {
- logisticsBatchId: hanldData.id,
- logisticsBatchData: setProductList
- }
- this.$api.navigateTo(
- `/pages/supplier/deliver/add-logistics?type=reple&mobile=${this.mobile}&shopOrderId=${
- this.listQuery.shopOrderId
- }&data=${JSON.stringify(data)}`
- )
- break
- case 'qualifications':
- this.$api.navigateTo(
- `/pages/supplier/deliver/qualifications-details?logisticsBatchId=${hanldData.id}&shopOrderId=${
- this.listQuery.shopOrderId
- }`
- )
- break
- }
- },
- handCenceConfirm(data) {
- //取消订单
- this.$util.modal('提示', '确定要撤销本次发货吗?撤销后需重新发货', '确定', '取消', true, () => {
- this.ShopService.ShopCancelShipment({ logisticsBatchId: data.id })
- .then(response => {
- this.$util.msg('撤销成功', 2000, true, 'success')
- setTimeout(() => {
- this.initShopShipmentsRecord()
- }, 2000)
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- })
- },
- pageGoLink() {
- this.$api.navigateTo('/pages/supplier/deliver/deliver-goods?shopOrderId=' + this.listQuery.shopOrderId)
- },
- hanldPageDetails() {
- this.$api.navigateTo('/pages/supplier/order/order-details?shopOrderId=' + this.listQuery.shopOrderId)
- }
- },
- onPullDownRefresh() {
- //下拉刷新
- this.initShopShipmentsRecord()
- uni.stopPullDownRefresh()
- },
- onReachBottom() {
- if (this.hasNextPage) {
- this.loadding = true
- this.pullUpOn = true
- this.getOnReachBottomData()
- }
- },
- onShow() {}
- }
- </script>
- <style lang="scss">
- page {
- background: #f7f7f7;
- height: auto;
- }
- .record-content {
- position: relative;
- border-top: 1px solid #ebebeb;
- .scroll-view {
- height: 100%;
- }
- }
- .record-content-empty {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- .record-container {
- width: 400rpx;
- height: auto;
- image {
- width: 400rpx;
- height: 400rpx;
- display: block;
- }
- .txt {
- font-size: $font-size-28;
- text-align: center;
- color: #333;
- line-height: 30rpx;
- margin-bottom: 20rpx;
- }
- .btn {
- width: 400rpx;
- height: 80rpx;
- background: $btn-confirm;
- border-radius: 40rpx;
- line-height: 80rpx;
- font-size: $font-size-28;
- text-align: center;
- color: #ffffff;
- }
- }
- }
- .record-list {
- width: 100%;
- height: auto;
- background-color: #f7f7f7;
- margin-bottom: 24rpx;
- .record-top {
- width: 702rpx;
- padding: 20rpx 24rpx;
- height: auto;
- background-color: #fff;
- margin-bottom: 20rpx;
- .top-view {
- width: 100%;
- height: auto;
- float: left;
- line-height: 50rpx;
- font-size: $font-size-28;
- color: #333333;
- display: flex;
- .top-viewlabel {
- width: 130rpx;
- margin-right: 10rpx;
- color: #999999;
- }
- .top-viewtext {
- width: 562rpx;
- height: auto;
- text {
- display: inline-block;
- margin-right: 30rpx;
- }
- }
- }
- }
- .goods-pros {
- width: 702rpx;
- padding: 0 24rpx;
- background: #ffffff;
- }
- .goods-pros-t {
- display: flex;
- width: 100%;
- height: auto;
- padding: 20rpx 0;
- .pros-img {
- width: 210rpx;
- height: 210rpx;
- border-radius: 10rpx;
- margin: 0 20rpx;
- border: 1px solid #f3f3f3;
- margin-left: 0;
- image {
- width: 100%;
- height: 100%;
- border-radius: 10rpx;
- }
- }
- .pros-product {
- width: 492rpx;
- height: 100%;
- line-height: 36rpx;
- font-size: $font-size-28;
- position: relative;
- .producttitle {
- width: 100%;
- display: inline-block;
- height: auto;
- text-overflow: ellipsis;
- display: -webkit-box;
- word-break: break-all;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- overflow: hidden;
- margin-bottom: 8rpx;
- }
- .productspec {
- height: 44rpx;
- color: #999999;
- line-height: 44rpx;
- font-size: $font-size-26;
- }
- .product-view {
- width: 100%;
- height: auto;
- display: flex;
- .view-num {
- flex: 1;
- text-align: left;
- font-size: $font-size-26;
- color: #666666;
- line-height: 44rpx;
- }
- }
- }
- }
- .goods-pros-b {
- width: 100%;
- height: auto;
- padding: 10rpx 0;
- border-top: 1px solid #f7f7f7;
- border-bottom: 1px solid #f7f7f7;
- position: relative;
- .b-label {
- width: 100%;
- line-height: 70rpx;
- font-size: $font-size-28;
- color: $text-color;
- }
- .b-photo {
- width: 100%;
- height: auto;
- padding: 10rpx 0;
- .b-imageView {
- width: 112rpx;
- height: 112rpx;
- margin: 0 20rpx 20rpx 0;
- float: left;
- image {
- width: 112rpx;
- height: 112rpx;
- display: block;
- }
- }
- .text {
- line-height: 44rpx;
- font-size: $font-size-28;
- color: $text-color;
- }
- }
- .goods-pros-m {
- width: 100%;
- height: auto;
- line-height: 76rpx;
- font-size: $font-size-26;
- color: $text-color;
- float: left;
- padding: 10rpx 0;
- border-top: 1px solid #f7f7f7;
- border-bottom: 1px solid #f7f7f7;
- .m-text {
- width: 62rpx;
- float: left;
- padding-right: 20rpx;
- font-weight: bold;
- }
- .m-input {
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- -webkit-box-align: center;
- -webkit-align-items: center;
- align-items: center;
- position: relative;
- width: 620rpx;
- height: auto;
- padding: 20rpx 0 10rpx 0;
- background: #ffffff;
- .text {
- width: 100%;
- height: 100%;
- font-size: $font-size-26;
- line-height: 36rpx;
- color: #333333;
- }
- }
- }
- }
- }
- </style>
|