Commit 0cddef1c by 张立顺

修改价格判断逻辑

1 parent 990227fb
<!-- 选择商品弹窗 --> <!-- 选择商品弹窗 -->
<template> <template>
<!-- :okText="productList.length ? '确定' : '创建商品'" -->
<GLDialog class="muti-pro" <GLDialog class="muti-pro"
bigTitle="选择商品" bigTitle="选择商品"
mode="big" mode="big"
:visible.sync="isMutiSelectVisible" :visible.sync="isMutiSelectVisible"
:before-close="handleMutiSelectClose" :before-close="handleMutiSelectClose"
:okText="productList.length ? '确定' : '创建商品'" :okText="'确定'"
@onOk="handleMutiSelectConfirm" @onOk="handleMutiSelectConfirm"
@onCancel="handleMutiSelectClose" @onCancel="handleMutiSelectClose"
:noClose="false" :noClose="false"
......
<!-- 选择商品 - 单选 --> <!-- 选择商品 - 单选 -->
<template> <template>
<!-- :okText="productList.length ? '确定' : '创建商品'" -->
<GLDialog class="single-pro" <GLDialog class="single-pro"
bigTitle="选择商品" bigTitle="选择商品"
mode="big" mode="big"
:before-close="handleSingleSelectClose" :before-close="handleSingleSelectClose"
:okText="productList.length ? '确定' : '创建商品'" :okText="'确定'"
:visible.sync="isSingleSelectVisible" :visible.sync="isSingleSelectVisible"
@onOk="handleSingleSelectConfirm" @onOk="handleSingleSelectConfirm"
@onCancel="handleSingleSelectClose"> @onCancel="handleSingleSelectClose">
......
...@@ -279,7 +279,7 @@ export default { ...@@ -279,7 +279,7 @@ export default {
this.detailForm.payPrice = res.payPrice ? res.payPrice + '元' : '0元' this.detailForm.payPrice = res.payPrice ? res.payPrice + '元' : '0元'
this.detailForm.crowdFundingPrice = '' this.detailForm.crowdFundingPrice = ''
if (res.payPrice && res.crowdFundingPrice) { if (res.payPrice && res.crowdFundingPrice) {
this.detailForm.crowdFundingPrice = res.crowdFundingPrice - res.payPrice + '元' this.detailForm.crowdFundingPrice = (res.crowdFundingPrice - res.payPrice).toFixed(2) + '元'
} }
this.detailForm.orderSourceName = this.baseData.orderSourceList.map(item => item.confId).includes(res.orderSource + '') ? this.baseData.orderSourceList.find(item => item.confId == res.orderSource).confName : '-' this.detailForm.orderSourceName = this.baseData.orderSourceList.map(item => item.confId).includes(res.orderSource + '') ? this.baseData.orderSourceList.find(item => item.confId == res.orderSource).confName : '-'
this.detailForm.orderStatusName = this.baseData.orderStatusList.map(item => item.confId).includes(res.orderStatus + '') ? this.baseData.orderStatusList.find(item => item.confId == res.orderStatus).confName : '-' this.detailForm.orderStatusName = this.baseData.orderStatusList.map(item => item.confId).includes(res.orderStatus + '') ? this.baseData.orderStatusList.find(item => item.confId == res.orderStatus).confName : '-'
......
...@@ -944,7 +944,7 @@ export default { ...@@ -944,7 +944,7 @@ export default {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
if (!this.editForm.crowdFundingPrice) return callback(new Error('请先填写众筹价')) if (!this.editForm.crowdFundingPrice) return callback(new Error('请先填写众筹价'))
if (value > Number(this.editForm.crowdFundingPrice)) return callback(new Error('定金不能大于众筹价格')) if (value > Number(this.editForm.crowdFundingPrice)) return callback(new Error('定金不能大于众筹价格'))
return value >= +(this.selectedProInfo.retailPrice / 100).toFixed(2) ? callback(new Error('秒杀价必须小于零售价')) : callback() return value > +(this.selectedProInfo.retailPrice / 100).toFixed(2) ? callback(new Error('秒杀价必须小于零售价')) : callback()
}, },
trigger: 'change' trigger: 'change'
} }
...@@ -1688,7 +1688,7 @@ export default { ...@@ -1688,7 +1688,7 @@ export default {
filterBalancePayment(crowdFundingPrice, activityPrice) { filterBalancePayment(crowdFundingPrice, activityPrice) {
let BalancePaymentNum = Number(crowdFundingPrice) - Number(activityPrice) let BalancePaymentNum = Number(crowdFundingPrice) - Number(activityPrice)
if (BalancePaymentNum == 0) return 0 if (BalancePaymentNum == 0) return 0
return BalancePaymentNum > 0 ? BalancePaymentNum : '' return BalancePaymentNum > 0 ? BalancePaymentNum.toFixed(2) : ''
} }
}, },
mounted() { mounted() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!