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