|
|
|
@ -35,11 +35,11 @@ |
|
|
|
|
<view class="name">邮箱</view> |
|
|
|
|
<view class="val">{{ form.email }}</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- <view :class="['line req', {err: err === 'orderType'}]"> |
|
|
|
|
<view :class="['line req', {err: err === 'orderType'}]"> |
|
|
|
|
<view class="name">订单类型</view> |
|
|
|
|
<view v-if="isDetail" class="val">{{ orderTypes.find(e => e.value === form.orderType).text }}</view> |
|
|
|
|
<uni-data-picker v-else class="picker-input" placeholder="请选择订单类型" popup-title="请选择订单类型" preload :clear-icon="false" :localdata="orderTypes" v-model="form.orderType" @change="calcTotal(1)"></uni-data-picker> |
|
|
|
|
</view> --> |
|
|
|
|
</view> |
|
|
|
|
<template v-if="edited"> |
|
|
|
|
<view v-if="form.orderNumber" class="line"> |
|
|
|
|
<view class="name">订单编号</view> |
|
|
|
@ -226,7 +226,7 @@ |
|
|
|
|
email: '', |
|
|
|
|
customerId: '', // 客户id |
|
|
|
|
customerName: '', |
|
|
|
|
orderType: 2, |
|
|
|
|
orderType: '', |
|
|
|
|
cityId: '', |
|
|
|
|
cityName: '', |
|
|
|
|
phone: '', |
|
|
|
@ -297,6 +297,9 @@ |
|
|
|
|
if (this.orderId) { |
|
|
|
|
this.getInfo() |
|
|
|
|
} else if (options.edited && store) { // 不是从购物车进来,并且有产品缓存(即是从当前页面点下一步编辑完产品回来的情况),则处理缓存里的产品 |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
// 新增取缓存,取了删除 |
|
|
|
|
const list = [] |
|
|
|
|
for (const i in store) { |
|
|
|
@ -320,6 +323,9 @@ |
|
|
|
|
uni.removeStorageSync('courses') |
|
|
|
|
} catch (e) {} |
|
|
|
|
this.calcTotal() |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果是客户订单记录页面点的新增,会有客户id,要默认选中该客户 |
|
|
|
@ -530,6 +536,16 @@ |
|
|
|
|
}, |
|
|
|
|
// 跳转 |
|
|
|
|
toAdd(add) { |
|
|
|
|
const { form } = this |
|
|
|
|
if (!form.customerId) { |
|
|
|
|
this.err = 'customerName' |
|
|
|
|
return this.$util.errMsg('请选择客户!') |
|
|
|
|
} |
|
|
|
|
if (!form.orderType) { |
|
|
|
|
this.err = 'orderType' |
|
|
|
|
return this.$util.errMsg('请选择订单类型!') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
add && uni.setStorageSync('courses', this.courses) |
|
|
|
|
uni.setStorageSync('orderForm', this.form) |
|
|
|
|
const { customerId, orderType } = this.form |
|
|
|
@ -537,9 +553,7 @@ |
|
|
|
|
const url = this.shopCart ? |
|
|
|
|
`../editCourse/editCourse` : |
|
|
|
|
`../addCourse/addCourse` |
|
|
|
|
customerId ? |
|
|
|
|
this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`) : |
|
|
|
|
this.$util.errMsg('请先选择客户!') |
|
|
|
|
this.$util.to(url + `?orderType=${orderType}&customerId=${customerId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`) |
|
|
|
|
}, |
|
|
|
|
// 前往创建客户 |
|
|
|
|
toClient() { |
|
|
|
@ -609,8 +623,8 @@ |
|
|
|
|
profit += +e.finalPrice - curPurchase |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
form.purchaseCost = purchase |
|
|
|
|
form.profit = profit |
|
|
|
|
form.purchaseCost = purchase.toFixed(2) |
|
|
|
|
form.profit = profit.toFixed(2) |
|
|
|
|
form.orderAmount = (+form.purchaseCost + +form.profit).toFixed(2) |
|
|
|
|
}, |
|
|
|
|
// 计算订单总额 |
|
|
|
@ -1160,15 +1174,15 @@ |
|
|
|
|
.action { |
|
|
|
|
z-index: 2; |
|
|
|
|
position: fixed; |
|
|
|
|
bottom: 0; |
|
|
|
|
bottom: 24rpx; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-around; |
|
|
|
|
justify-content: flex-end; |
|
|
|
|
width: 100%; |
|
|
|
|
padding: 5px 10px; |
|
|
|
|
padding-right: 50rpx; |
|
|
|
|
padding-bottom: env(safe-area-inset-bottom); |
|
|
|
|
background-color: #fff; |
|
|
|
|
border-top: 1px solid #f3f3f3; |
|
|
|
|
box-shadow: 0 -2px 2px #f5f5f5; |
|
|
|
|
// background-color: #fff; |
|
|
|
|
// border-top: 1px solid #f3f3f3; |
|
|
|
|
// box-shadow: 0 -2px 2px #f5f5f5; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
&:empty { |
|
|
|
|
padding: 0 !important; |
|
|
|
|