|
|
@ -35,7 +35,7 @@ |
|
|
|
<view class="line req"> |
|
|
|
<view class="line req"> |
|
|
|
<view class="name">订单类型</view> |
|
|
|
<view class="name">订单类型</view> |
|
|
|
<view v-if="isDetail" class="val">{{ form.industryClassName }}</view> |
|
|
|
<view v-if="isDetail" class="val">{{ form.industryClassName }}</view> |
|
|
|
<uni-data-picker v-else class="picker-input" placeholder="请选择订单类型" popup-title="请选择订单类型" preload :clear-icon="false" :localdata="orderTypes" v-model="form.orderType"></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"></uni-data-picker> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
|
<view class="name">订单编号</view> |
|
|
|
<view class="name">订单编号</view> |
|
|
@ -107,12 +107,8 @@ |
|
|
|
<view :class="['product', isDetail ? 'show' : 'edit']"> |
|
|
|
<view :class="['product', isDetail ? 'show' : 'edit']"> |
|
|
|
<view class="text"> |
|
|
|
<view class="text"> |
|
|
|
<view class="total"> |
|
|
|
<view class="total"> |
|
|
|
{{ isDetail ? '共' : '已' }}选 |
|
|
|
<view v-if="isDetail">共选<text class="num">{{ courses.length }}</text>个产品</view> |
|
|
|
<text class="num">{{ courses.length }}</text> |
|
|
|
<view class="column">总成交价合计<text class="num">{{ form.orderAmount }}</text>元</view> |
|
|
|
个产品  |
|
|
|
|
|
|
|
总成交价合计 |
|
|
|
|
|
|
|
<text class="num">{{ form.orderAmount }}</text> |
|
|
|
|
|
|
|
元 |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="info"> |
|
|
|
<view class="info"> |
|
|
|
<view class="line"> |
|
|
|
<view class="line"> |
|
|
@ -123,7 +119,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="!isDetail" class="btn" @click="submit">提交</view> |
|
|
|
<view v-if="!isDetail" class="btn" @click="submit">提交({{ courses.length }})</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
@ -211,6 +207,12 @@ |
|
|
|
uni.removeStorageSync('courses') |
|
|
|
uni.removeStorageSync('courses') |
|
|
|
} catch (e) {} |
|
|
|
} catch (e) {} |
|
|
|
this.calcTotal() |
|
|
|
this.calcTotal() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// 如果是客户订单记录页面点的新增,会有客户id,要默认选中该客户 |
|
|
|
|
|
|
|
const { customerId } = options |
|
|
|
|
|
|
|
customerId && this.customerChange({ |
|
|
|
|
|
|
|
customerId |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 非详情才需要查询客户 |
|
|
|
// 非详情才需要查询客户 |
|
|
|
if (!this.isDetail) { |
|
|
|
if (!this.isDetail) { |
|
|
@ -360,6 +362,7 @@ |
|
|
|
// 计算订单总额 |
|
|
|
// 计算订单总额 |
|
|
|
calcTotal() { |
|
|
|
calcTotal() { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
|
|
|
|
const isTrial = form.orderType === 2 // 是否试用 |
|
|
|
let total = 0 |
|
|
|
let total = 0 |
|
|
|
const list = this.courses |
|
|
|
const list = this.courses |
|
|
|
let purchase = 0 // 总采购成本 |
|
|
|
let purchase = 0 // 总采购成本 |
|
|
@ -380,9 +383,9 @@ |
|
|
|
purchase += curPurchase |
|
|
|
purchase += curPurchase |
|
|
|
profit += +e.finalPrice - curPurchase |
|
|
|
profit += +e.finalPrice - curPurchase |
|
|
|
}) |
|
|
|
}) |
|
|
|
form.purchaseCost = Math.round(purchase) |
|
|
|
form.purchaseCost = isTrial ? 0 : Math.round(purchase) |
|
|
|
form.profit = Math.round(profit) |
|
|
|
form.profit = isTrial ? 0 : Math.round(profit) |
|
|
|
form.orderAmount = +form.purchaseCost + +form.profit |
|
|
|
form.orderAmount = isTrial ? 0 : +form.purchaseCost + +form.profit |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
submit() { |
|
|
|
submit() { |
|
|
@ -527,41 +530,48 @@ |
|
|
|
padding: 24rpx; |
|
|
|
padding: 24rpx; |
|
|
|
background-color: #fff; |
|
|
|
background-color: #fff; |
|
|
|
.total { |
|
|
|
.total { |
|
|
|
|
|
|
|
|
|
|
|
white-space: nowrap; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.line { |
|
|
|
|
|
|
|
text-align: right; |
|
|
|
|
|
|
|
&:first-child { |
|
|
|
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
&.show { |
|
|
|
&.show { |
|
|
|
padding: 24rpx 50rpx; |
|
|
|
padding: 24rpx 50rpx; |
|
|
|
.total { |
|
|
|
.total { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
margin-bottom: 30rpx; |
|
|
|
margin-bottom: 30rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
font-size: 30rpx; |
|
|
|
font-weight: 600; |
|
|
|
font-weight: 600; |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|
|
|
|
|
.column { |
|
|
|
|
|
|
|
margin-left: 10rpx; |
|
|
|
|
|
|
|
} |
|
|
|
.num { |
|
|
|
.num { |
|
|
|
|
|
|
|
margin: 0 5rpx; |
|
|
|
|
|
|
|
font-size: 34rpx; |
|
|
|
|
|
|
|
font-weight: 600; |
|
|
|
color: #007EFF; |
|
|
|
color: #007EFF; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.line { |
|
|
|
|
|
|
|
text-align: right; |
|
|
|
|
|
|
|
&:first-child { |
|
|
|
|
|
|
|
margin-bottom: 8px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
&.edit { |
|
|
|
&.edit { |
|
|
|
.total { |
|
|
|
.total { |
|
|
|
margin-bottom: 10rpx; |
|
|
|
margin-bottom: 10rpx; |
|
|
|
|
|
|
|
text-align: right; |
|
|
|
font-size: 24rpx; |
|
|
|
font-size: 24rpx; |
|
|
|
color: #666; |
|
|
|
color: #666; |
|
|
|
|
|
|
|
.num { |
|
|
|
|
|
|
|
font-weight: 600; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.num { |
|
|
|
.num { |
|
|
|
margin: 0 5rpx; |
|
|
|
margin: 0 5rpx; |
|
|
|
font-size: 34rpx; |
|
|
|
font-size: 34rpx; |
|
|
|
color: #007EFF; |
|
|
|
color: #007EFF; |
|
|
|
} |
|
|
|
} |
|
|
|
.info { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
.info { |
|
|
|
.info { |
|
|
|
font-size: 24rpx; |
|
|
|
font-size: 24rpx; |
|
|
@ -570,7 +580,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
.btn { |
|
|
|
.btn { |
|
|
|
width: 180rpx; |
|
|
|
width: 180rpx; |
|
|
|
margin-left: 10rpx; |
|
|
|
margin-left: 30rpx; |
|
|
|
line-height: 80rpx; |
|
|
|
line-height: 80rpx; |
|
|
|
font-size: 32rpx; |
|
|
|
font-size: 32rpx; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|