Commit c680b113 by zhangxw

多规格商品 校验价格修改

1 parent 4ff8630b
...@@ -272,17 +272,17 @@ ...@@ -272,17 +272,17 @@
<td :style="{ width: specsWidth }"> <td :style="{ width: specsWidth }">
<el-input placeholder="成本" <el-input placeholder="成本"
size="small" 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" v-model="subItem.shopPrice"
@input="handleShopPrice($event, subIndex)" @input="handleShopPrice($event, subIndex)"
@blur="handleShopPriceBlur($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" slot="suffix"
placement="top" placement="top"
title title
width="90" width="90"
trigger="hover" trigger="hover"
content="成本是必填项"> :content="formatPrice(subIndex) ? '成本价需≤零售价,成本价需≤最低价' : '成本是必填项'">
<i class="el-icon-warning color-red" <i class="el-icon-warning color-red"
slot="reference" /> slot="reference" />
</el-popover> </el-popover>
...@@ -311,16 +311,16 @@ ...@@ -311,16 +311,16 @@
<el-input placeholder="零售" <el-input placeholder="零售"
size="small" size="small"
v-model="subItem.upgradePrice" 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)" @input="handleUpgradePrice($event, subIndex)"
@blur="handleUpgradePriceBlur($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" slot="suffix"
placement="top" placement="top"
title title
width="90" width="90"
trigger="hover" trigger="hover"
:content="subItem.upgradePrice && Number(subItem.upgradePrice) < Number(subItem.shopPrice) ? '零售价需要大于或等于产品成本' : '零售是必填项'"> :content="formatPrice(subIndex) ? '零售价需≥成本,零售价需≥最低价' : '零售是必填项'">
<i class="el-icon-warning color-red" <i class="el-icon-warning color-red"
slot="reference" /> slot="reference" />
</el-popover> </el-popover>
...@@ -330,16 +330,16 @@ ...@@ -330,16 +330,16 @@
<el-input placeholder="最低价" <el-input placeholder="最低价"
size="small" size="small"
v-model="subItem.shopMinPrice" 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)" @input="handleShopMinPrice($event, subIndex)"
@blur="handleShopMinPriceBlur($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" slot="suffix"
placement="top" placement="top"
title title
width="90" width="90"
trigger="hover" trigger="hover"
:content="subItem.shopMinPrice && Number(subItem.shopMinPrice) < Number(subItem.shopPrice) ? '最低价需要大于等于产品成本' : '最低价是必填项'"> :content="formatPrice(subIndex) ? '最低价需≥产品成本,最低价需≤零售价' : '最低价是必填项'">
<i class="el-icon-warning color-red" <i class="el-icon-warning color-red"
slot="reference" /> slot="reference" />
</el-popover> </el-popover>
...@@ -915,7 +915,7 @@ export default { ...@@ -915,7 +915,7 @@ export default {
handleUpgradePriceBlur(e, index) { handleUpgradePriceBlur(e, index) {
const newValue = e.target.value const newValue = e.target.value
if (this.formatPrice(index) || !newValue) { 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 { ...@@ -955,7 +955,7 @@ export default {
handleShopPriceBlur(e, index) { handleShopPriceBlur(e, index) {
const newValue = e.target.value const newValue = e.target.value
if (this.formatPrice(index) || !newValue) { 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 { ...@@ -981,7 +981,7 @@ export default {
handleShopMinPriceBlur(e, index) { handleShopMinPriceBlur(e, index) {
const newValue = e.target.value const newValue = e.target.value
if (this.formatPrice(index) || !newValue) { 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!