Commit c680b113 by zhangxw

多规格商品 校验价格修改

1 parent 4ff8630b
......@@ -272,17 +272,17 @@
<td :style="{ width: specsWidth }">
<el-input placeholder="成本"
size="small"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': filterEmpty(subItem.shopPrice) && subItem.shopPriceEmpty }"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.shopPrice) || formatPrice(subIndex)) && subItem.shopPriceEmpty }"
v-model="subItem.shopPrice"
@input="handleShopPrice($event, subIndex)"
@blur="handleShopPriceBlur($event, subIndex)">
<el-popover v-show="filterEmpty(subItem.shopPrice) && subItem.shopPriceEmpty"
<el-popover v-show="(filterEmpty(subItem.shopPrice) || formatPrice(subIndex)) && subItem.shopPriceEmpty"
slot="suffix"
placement="top"
title
width="90"
trigger="hover"
content="成本是必填项">
:content="formatPrice(subIndex) ? '成本价需≤零售价,成本价需≤最低价' : '成本是必填项'">
<i class="el-icon-warning color-red"
slot="reference" />
</el-popover>
......@@ -311,16 +311,16 @@
<el-input placeholder="零售"
size="small"
v-model="subItem.upgradePrice"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.upgradePrice) || Number(subItem.upgradePrice) < Number(subItem.shopPrice)) && subItem.upgradePriceEmpty }"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.upgradePrice) || formatPrice(subIndex)) && subItem.upgradePriceEmpty }"
@input="handleUpgradePrice($event, subIndex)"
@blur="handleUpgradePriceBlur($event, subIndex)">
<el-popover v-show="(filterEmpty(subItem.upgradePrice) || Number(subItem.upgradePrice) < Number(subItem.shopPrice)) && subItem.upgradePriceEmpty"
<el-popover v-show="(filterEmpty(subItem.upgradePrice) || formatPrice(subIndex)) && subItem.upgradePriceEmpty"
slot="suffix"
placement="top"
title
width="90"
trigger="hover"
:content="subItem.upgradePrice && Number(subItem.upgradePrice) < Number(subItem.shopPrice) ? '零售价需要大于或等于产品成本' : '零售是必填项'">
:content="formatPrice(subIndex) ? '零售价需≥成本,零售价需≥最低价' : '零售是必填项'">
<i class="el-icon-warning color-red"
slot="reference" />
</el-popover>
......@@ -330,16 +330,16 @@
<el-input placeholder="最低价"
size="small"
v-model="subItem.shopMinPrice"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.shopMinPrice) || Number(subItem.shopMinPrice) < Number(subItem.shopPrice)) && subItem.shopMinPriceEmpty }"
:class="{ 'w-80-per': true, 'w-100-per': true, 'border-red': (filterEmpty(subItem.shopMinPrice) || formatPrice(subIndex)) && subItem.shopMinPriceEmpty }"
@input="handleShopMinPrice($event, subIndex)"
@blur="handleShopMinPriceBlur($event, subIndex)">
<el-popover v-show="(filterEmpty(subItem.shopMinPrice) || Number(subItem.shopMinPrice) < Number(subItem.shopPrice)) && subItem.shopMinPriceEmpty"
<el-popover v-show="(filterEmpty(subItem.shopMinPrice) || formatPrice(subIndex)) && subItem.shopMinPriceEmpty"
slot="suffix"
placement="top"
title
width="90"
trigger="hover"
:content="subItem.shopMinPrice && Number(subItem.shopMinPrice) < Number(subItem.shopPrice) ? '最低价需要大于等于产品成本' : '最低价是必填项'">
:content="formatPrice(subIndex) ? '最低价需≥产品成本,最低价需≤零售价' : '最低价是必填项'">
<i class="el-icon-warning color-red"
slot="reference" />
</el-popover>
......@@ -915,7 +915,7 @@ export default {
handleUpgradePriceBlur(e, index) {
const newValue = e.target.value
if (this.formatPrice(index) || !newValue) {
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'upgradePriceSub', true)
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'upgradePriceEmpty', true)
}
},
// 选择服务项目
......@@ -955,7 +955,7 @@ export default {
handleShopPriceBlur(e, index) {
const newValue = e.target.value
if (this.formatPrice(index) || !newValue) {
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'shopPriceSub', true)
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'shopPriceEmpty', true)
}
},
// 校验采购价
......@@ -981,7 +981,7 @@ export default {
handleShopMinPriceBlur(e, index) {
const newValue = e.target.value
if (this.formatPrice(index) || !newValue) {
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'shopMinPriceSub', true)
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'shopMinPriceEmpty', true)
}
},
// 库存预警
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!