|
@@ -55,14 +55,14 @@
|
|
|
</div>
|
|
|
<div class="ruleDescList" v-if="form.gateType==='FIXED_AMOUNT'">
|
|
|
购买每满
|
|
|
- <a-input-number v-model="form.gateValue" :max="999999" :min="0" :precision="form.regularUnit==='YUAN'?2:0" size="small"/>
|
|
|
- <a-select default-value="YUAN" v-model="form.regularUnit" style="width: 50px;margin-left:5px;" size="small" @change="handleUnit">
|
|
|
- <a-select-option value="YUAN">
|
|
|
- 元
|
|
|
- </a-select-option>
|
|
|
+ <a-input-number v-model="form.gateValue" :max="999999" :min="0" :precision="form.regularUnit=='YUAN'?2:0" size="small"/>
|
|
|
+ <a-select default-value="GE" v-model="form.regularUnit" style="width: 50px;margin-left:5px;" size="small" @change="handleUnit">
|
|
|
<a-select-option value="GE">
|
|
|
个
|
|
|
</a-select-option>
|
|
|
+ <a-select-option value="YUAN">
|
|
|
+ 元
|
|
|
+ </a-select-option>
|
|
|
</a-select>
|
|
|
门槛产品,可采购
|
|
|
<a-input-number v-model="form.quotaAmount" :max="999999" :min="0" :precision="0" size="small"/>
|
|
@@ -148,19 +148,20 @@
|
|
|
:min="0"
|
|
|
:step="1"
|
|
|
:precision="2"
|
|
|
- :max="record.provinceValue||999999"
|
|
|
+ :max="999999"
|
|
|
placeholder="请输入"
|
|
|
@blur="handleCityPrice"/>
|
|
|
</template>
|
|
|
<template slot="specialPrice" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
- v-model="record.specialValue"
|
|
|
+ :value="record.specialValue"
|
|
|
:min="0"
|
|
|
:step="1"
|
|
|
:precision="2"
|
|
|
- :max="record.cityValue||999999"
|
|
|
- placeholder="请输入"/>
|
|
|
+ :max="999999"
|
|
|
+ placeholder="请输入"
|
|
|
+ @blur="handleSpecialPrice"/>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</a-form-model-item>
|
|
@@ -254,7 +255,7 @@ export default {
|
|
|
gateFlag: '0', // 门槛
|
|
|
gateType: undefined,
|
|
|
gateValue: undefined,
|
|
|
- regularUnit: 'YUAN',
|
|
|
+ regularUnit: 'GE',
|
|
|
quotaAmount: undefined,
|
|
|
discountType: '0', // 特价规则
|
|
|
gateInfo: undefined,
|
|
@@ -300,13 +301,13 @@ export default {
|
|
|
},
|
|
|
handleProvincePrice (e) {
|
|
|
this.setTableData[0].provinceValue = Number(e.target.value)
|
|
|
- if (this.setTableData[0].cityValue) {
|
|
|
- this.setTableData[0].cityValue = Number(e.target.value)
|
|
|
- }
|
|
|
},
|
|
|
handleCityPrice (e) {
|
|
|
this.setTableData[0].cityValue = Number(e.target.value)
|
|
|
},
|
|
|
+ handleSpecialPrice (e) {
|
|
|
+ this.setTableData[0].specialValue = Number(e.target.value)
|
|
|
+ },
|
|
|
// 特价规则切换时清空数据
|
|
|
handleDiscountType (val) {
|
|
|
this.form.discountType = val
|
|
@@ -357,6 +358,13 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ // 判断特价规则必填
|
|
|
+ if (_this.form.discountType != '0' && _this.setTableData) {
|
|
|
+ if (!_this.setTableData[0].provinceValue || !_this.setTableData[0].cityValue || !_this.setTableData[0].specialValue) {
|
|
|
+ _this.$message.warning('特价规则条件不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
if (form.gateFlag === '1') {
|
|
|
form.gateProductList = _this.$refs.cillProduct.getResultVal()
|
|
@@ -383,16 +391,21 @@ export default {
|
|
|
form.gateType = undefined
|
|
|
}
|
|
|
form.specialProductList = _this.$refs.specialProduct.getResultVal()
|
|
|
- // 为空判断
|
|
|
- const isTypeEmpty = form.specialProductList.some(item => (item.productTypeList && item.productTypeList.length == 0) && (item.productBrandList && item.productBrandList.length == 0))
|
|
|
- if (isTypeEmpty) {
|
|
|
- _this.$message.warning('产品分类或品牌不能为空!')
|
|
|
- return
|
|
|
- }
|
|
|
- const isNumEmpty = form.specialProductList.some(item => (!item.unitType || !item.unitQty))
|
|
|
- if (isNumEmpty) {
|
|
|
- _this.$message.warning('订单起订量设置不能为空!')
|
|
|
+ if (form.specialProductList.length == 0) {
|
|
|
+ _this.$message.warning('请添加特价产品!')
|
|
|
return
|
|
|
+ } else {
|
|
|
+ // 为空判断
|
|
|
+ const isTypeEmpty = form.specialProductList.some(item => (item.productTypeList && item.productTypeList.length == 0) && (item.productBrandList && item.productBrandList.length == 0))
|
|
|
+ if (isTypeEmpty) {
|
|
|
+ _this.$message.warning('产品分类或品牌不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const isNumEmpty = form.specialProductList.some(item => (!item.unitType || !item.unitQty))
|
|
|
+ if (isNumEmpty) {
|
|
|
+ _this.$message.warning('订单起订量设置不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
if (form.discountType === '0') { // 手动输入
|
|
|
const isCountEmpty = _this.isNumEmpty(form.specialProductList)
|
|
@@ -498,7 +511,7 @@ export default {
|
|
|
gateFlag: '0', // 门槛
|
|
|
gateType: undefined,
|
|
|
gateValue: undefined,
|
|
|
- regularUnit: 'YUAN',
|
|
|
+ regularUnit: 'GE',
|
|
|
quotaAmount: undefined,
|
|
|
discountType: '0', // 特价规则
|
|
|
gateProductList: undefined,
|