Commit 7012ac1f authored by dragondean@qq.com's avatar dragondean@qq.com

限制订单暗佣金额设置以免产生负数成本价

parent b65c86ca
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</el-form-item> </el-form-item>
<!-- 明佣+暗佣才显示 --> <!-- 明佣+暗佣才显示 -->
<el-form-item label="暗佣佣金" v-if="form.commissionType == 3"> <el-form-item label="暗佣佣金" v-if="form.commissionType == 3" prop="shadeCommissionAmount" :rules="{type: 'number', max: originPrice.toNumber(), message: '暗佣设置错误', trigger: 'blur'}">
<el-input v-model.number="form.shadeCommissionAmount" placeholder="" class="w-100"></el-input> <el-input v-model.number="form.shadeCommissionAmount" placeholder="" class="w-100"></el-input>
{{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }} {{ currencyMap[orderItem.seaFreightCurrency] }} / {{ unitMap[orderItem.seaFreightVolume] }}
</el-form-item> </el-form-item>
...@@ -113,6 +113,7 @@ import WorkFlow from '@/components/WorkFlow' ...@@ -113,6 +113,7 @@ import WorkFlow from '@/components/WorkFlow'
import {getDarkReturnCommission} from '@/api/ecw/customerCommission' import {getDarkReturnCommission} from '@/api/ecw/customerCommission'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import {cancelProcessInstance} from '@/api/bpm/processInstance' import {cancelProcessInstance} from '@/api/bpm/processInstance'
import { number } from "echarts/lib/export"
export default { export default {
name: "OrderSpecialCommission", name: "OrderSpecialCommission",
props: { props: {
...@@ -184,12 +185,12 @@ export default { ...@@ -184,12 +185,12 @@ export default {
// 成本价 // 成本价
costPrice(){ costPrice(){
if(!this.originPrice) return 0 if(!this.originPrice) return 0
return Decimal(this.originPrice).minus(this.form.shadeCommissionAmount) return Decimal(this.originPrice).minus(this.form.shadeCommissionAmount || 0)
}, },
// 销售价 // 销售价
salePrice(){ salePrice(){
if(!this.originPrice) return 0 if(!this.originPrice) return 0
return Decimal(this.originPrice).plus(this.form.lightCommissionAmount) return Decimal(this.originPrice).plus(this.form.lightCommissionAmount || 0)
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment