|
@@ -2,23 +2,68 @@
|
|
|
<!-- 添加运单 -->
|
|
|
<view>
|
|
|
<u-navbar :title="headline" autoBack placeholder></u-navbar>
|
|
|
- <view class="title_waybill">寄件人:</view>
|
|
|
+ <view class="space_between card_Address">
|
|
|
+ <view class="title_waybill">寄件人:</view>
|
|
|
+ <view class="card_flex_il" @click="addressBook('sender')">
|
|
|
+ <u-icon name="order" size="22"></u-icon>
|
|
|
+ <view class="title_sou">寄件人簿</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<x-form ref="sender" :list="list" :model="senderModel" :rules="rules"></x-form>
|
|
|
- <view class="title_waybill">收件人:</view>
|
|
|
+ <view class="space_between card_Address">
|
|
|
+ <view class="title_waybill">收件人:</view>
|
|
|
+ <view class="card_flex_il" @click="addressBook('consignee')">
|
|
|
+ <u-icon name="order" size="22"></u-icon>
|
|
|
+ <view class="title_sou">收件人簿</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<x-form ref="recipients" :list="list" :model="recipientsModel" :rules="rules"></x-form>
|
|
|
+ <view class="space_between card_Address">
|
|
|
+ <view class="title_waybill">配送员:</view>
|
|
|
+ <view class="card_flex_il" @click="deliveryBook">
|
|
|
+ <u-icon name="order" size="22"></u-icon>
|
|
|
+ <view class="title_sou">配送员簿</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <x-form ref="recipients" :list="courierList" :model="courierModel" :rules="rules"></x-form>
|
|
|
<view class="title_waybill1"></view>
|
|
|
<x-form ref="goods" :list="goodsList" :model="goodsModel" :rules="goodsRules"></x-form>
|
|
|
<view style="width: 100%;height: 150rpx;"></view>
|
|
|
<view class="btn_print" @click="printWaybill">
|
|
|
- <u-button type="primary" :text="headline"></u-button>
|
|
|
+ <u-button type="primary" shape="circle" :text="headline"></u-button>
|
|
|
</view>
|
|
|
+ <u-popup :show="courierShow" mode="bottom" closeable :round="10" :closeOnClickOverlay="false" @close="close">
|
|
|
+ <view class="card_courier">
|
|
|
+ <view class="headline">选择配送员</view>
|
|
|
+ <view class="search_card">
|
|
|
+ <u-search :showAction="false" v-model="keyword" @change="searchChange"
|
|
|
+ placeholder="输入姓名、电话、地址快速查找"></u-search>
|
|
|
+ </view>
|
|
|
+ <scroll-view class="scroll-view" scroll-y="true" @scrolltolower="loadMore">
|
|
|
+ <view class="courier" v-if="courieList.length > 0">
|
|
|
+ <view class="courier_item space_between" v-for="(item,index) in courieList" :key="index"
|
|
|
+ @click="bindingDistributor(item)">
|
|
|
+ <view class="courier_name">
|
|
|
+ <view class="title_name">{{item.nickName}}</view>
|
|
|
+ <view class="title_phone">{{item.phone}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="xd_title center_in">下单给TA</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="margin-top: 30rpx;" v-else>
|
|
|
+ <u-empty mode="list" text="暂无配送员"></u-empty>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
formRules,
|
|
|
- pickupRulesil
|
|
|
+ pickupRulesil,
|
|
|
+ printList
|
|
|
} from "./waybill.js";
|
|
|
export default {
|
|
|
name: 'addWaybill',
|
|
@@ -34,6 +79,10 @@
|
|
|
phone: '',
|
|
|
address: '',
|
|
|
},
|
|
|
+ courierModel: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
+ },
|
|
|
goodsModel: {
|
|
|
tamperProofLabel: '',
|
|
|
tamperProofLabelImg: '',
|
|
@@ -69,10 +118,36 @@
|
|
|
},
|
|
|
},
|
|
|
list: pickupRulesil(),
|
|
|
+ courierList: printList(),
|
|
|
goodsList: formRules(),
|
|
|
userInfo: {},
|
|
|
headline: '添加运单',
|
|
|
type: 1,
|
|
|
+ operationType: 'sender',
|
|
|
+ courierShow: false,
|
|
|
+ courieList: [],
|
|
|
+ keyword: '',
|
|
|
+ incubatorMore: true,
|
|
|
+ Pagination: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ saveSenderAddress: true,
|
|
|
+ saveConsigneeAddress: true,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ // console.log('页面销毁')
|
|
|
+ uni.removeStorageSync('selectAddress')
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
+ let address = uni.getStorageSync('selectAddress')
|
|
|
+ if (address) {
|
|
|
+ if (this.operationType == 'sender') {
|
|
|
+ this.senderModel = address
|
|
|
+ this.saveSenderAddress = false
|
|
|
+ } else {
|
|
|
+ this.recipientsModel = address
|
|
|
+ this.saveConsigneeAddress = false
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
onLoad(value) {
|
|
@@ -86,6 +161,8 @@
|
|
|
this.recipientsModel.name = orderList.consigneeAddressName
|
|
|
this.recipientsModel.phone = orderList.consigneeAddressPhone
|
|
|
this.recipientsModel.address = orderList.consigneeAddressDetails
|
|
|
+ this.courierModel.name = orderList.deliveryName
|
|
|
+ this.courierModel.phone = orderList.deliveryPhone
|
|
|
this.goodsModel.tamperProofLabel = orderList.tamperProofLabel
|
|
|
this.goodsModel.tamperProofLabelImg = orderList.tamperProofLabelImg
|
|
|
this.goodsModel.remark = orderList.remark
|
|
@@ -123,6 +200,10 @@
|
|
|
consigneeAddressName: this.recipientsModel.name,
|
|
|
consigneeAddressPhone: this.recipientsModel.phone,
|
|
|
consigneeAddressDetails: this.recipientsModel.address,
|
|
|
+ deliveryName: this.courierModel.name,
|
|
|
+ deliveryPhone: this.courierModel.phone,
|
|
|
+ saveSenderAddress: this.saveSenderAddress,
|
|
|
+ saveConsigneeAddress: this.saveConsigneeAddress,
|
|
|
...this.goodsModel,
|
|
|
}
|
|
|
uni.showLoading();
|
|
@@ -159,6 +240,62 @@
|
|
|
} else {
|
|
|
uni.$u.toast('请先完善表单')
|
|
|
}
|
|
|
+ },
|
|
|
+ // 选择类型
|
|
|
+ addressBook(type) {
|
|
|
+ this.operationType = type
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/order/addressBook?type=' + type
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 配送员
|
|
|
+ deliveryBook() {
|
|
|
+ this.courierShow = true
|
|
|
+ this.getDelivery()
|
|
|
+ },
|
|
|
+ // 获取配送员
|
|
|
+ getDelivery() {
|
|
|
+ this.$api.get('/api/sys-user', {
|
|
|
+ page: this.Pagination,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ name: this.keyword,
|
|
|
+ type: 3,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ const data = res.data.list
|
|
|
+ if (this.incubatorMore == true) {
|
|
|
+ this.courieList = this.courieList.concat(data);
|
|
|
+ }
|
|
|
+ if (data.length < this.pageSize) {
|
|
|
+ this.incubatorMore = false
|
|
|
+ } else {
|
|
|
+ this.incubatorMore = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 配送员
|
|
|
+ bindingDistributor(value) {
|
|
|
+ this.courierShow = false
|
|
|
+ this.courierModel.name = value.nickName
|
|
|
+ this.courierModel.phone = value.phone
|
|
|
+ },
|
|
|
+ // 滚动加载更多
|
|
|
+ loadMore() {
|
|
|
+ if (this.incubatorMore) {
|
|
|
+ this.Pagination++
|
|
|
+ this.getDelivery()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 搜索配送员
|
|
|
+ searchChange() {
|
|
|
+ this.Pagination = 1
|
|
|
+ this.incubatorMore = true
|
|
|
+ this.courieList = []
|
|
|
+ this.getDelivery()
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.courierShow = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -170,10 +307,7 @@
|
|
|
}
|
|
|
|
|
|
.title_waybill {
|
|
|
- position: relative;
|
|
|
- margin: 20rpx;
|
|
|
- border-bottom: 1rpx;
|
|
|
- padding-bottom: 20rpx;
|
|
|
+ padding: 20rpx;
|
|
|
}
|
|
|
|
|
|
.title_waybill1 {
|
|
@@ -183,7 +317,21 @@
|
|
|
padding-bottom: 20rpx;
|
|
|
}
|
|
|
|
|
|
- .title_waybill:before {
|
|
|
+ .card_Address {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card_flex_il {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_sou {
|
|
|
+ font-size: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card_Address:before {
|
|
|
content: " ";
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
@@ -196,4 +344,60 @@
|
|
|
-webkit-transform: scaleY(0.5);
|
|
|
transform: scaleY(0.5);
|
|
|
}
|
|
|
+
|
|
|
+ .card_courier {
|
|
|
+ min-height: 600rpx;
|
|
|
+ padding-bottom: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .scroll-view {
|
|
|
+ max-height: 60vh;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .headline {
|
|
|
+ padding: 30rpx 30rpx 0rpx 30rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding-bottom: 30rpx;
|
|
|
+ font-size: 32rpx;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ .search_card {
|
|
|
+ padding: 0rpx 30rpx 10rpx 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .courier_item {
|
|
|
+ margin: 20rpx 20rpx;
|
|
|
+ width: calc(100% - 80rpx);
|
|
|
+ padding: 20rpx;
|
|
|
+ border-radius: 20rpx;
|
|
|
+ box-shadow: 0 2rpx 10rpx 0 rgba(0, 0, 0, .1);
|
|
|
+ }
|
|
|
+
|
|
|
+ .courier_name {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_name {
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin-bottom: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_phone {
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .xd_title {
|
|
|
+ width: auto;
|
|
|
+ font-size: 28rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
+ border-radius: 35rpx;
|
|
|
+ border: 3rpx solid #82848a;
|
|
|
+ }
|
|
|
</style>
|