Commit 7d821fca authored by dragondean@qq.com's avatar dragondean@qq.com

修复阶梯价设置异常

parent db7fc613
......@@ -54,7 +54,7 @@
/
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.weightUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1">
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1" :key="`transportPrice-${index}`">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
......@@ -65,7 +65,7 @@
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
</el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1">
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1" :key="`allPrice-${index}`">
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w100 mr10" />
<selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w100" />
......@@ -278,9 +278,25 @@ export default {
// 判断阶梯价是否设置不完整
isStepPriceOk(){
return (stepPrice) => {
console.log({
stepPrice,
startNum: this.isEmpty(stepPrice.startNum),
endNum:this.isEmpty(stepPrice.endNum),
allPrice: this.isEmpty(stepPrice.allPrice),
allPriceUnit: this.isEmpty(stepPrice.allPriceUnit),
allVolumeUnit: this.isEmpty(stepPrice.allVolumeUnit),
transportPrice: this.isEmpty(stepPrice.transportPrice),
transportPriceUnit: this.isEmpty(stepPrice.transportPriceUnit),
transportVolumeUnit: this.isEmpty(stepPrice.transportVolumeUnit),
priceType: this.form.priceType
})
if(this.isEmpty(stepPrice.startNum) || this.isEmpty(stepPrice.endNum)) return false
if(this.form.priceType == 1 && (this.isEmpty(stepPrice.allPrice) || this.isEmpty(stepPrice.allPriceUnit) || this.isEmpty(stepPrice.allVolumeUnit))) return false
else if(this.isEmpty(stepPrice.transportPrice) || this.isEmpty(stepPrice.transportPriceUnit)){ // 清关费可能为0或者空
if(this.form.priceType == 1 && (this.isEmpty(stepPrice.allPrice) || this.isEmpty(stepPrice.allPriceUnit) || this.isEmpty(stepPrice.allVolumeUnit))){
console.log('全包价设置不完整')
return false
}
else if(this.form.priceType != 1 && (this.isEmpty(stepPrice.transportPrice) || this.isEmpty(stepPrice.transportPriceUnit) || this.isEmpty(stepPrice.transportVolumeUnit))){ // 清关费可能为0或者空
console.log('非全报价,未设置完整')
return false
}
return true
......@@ -323,7 +339,7 @@ export default {
'form.needBook'(val){
if(val) this.$set(this.form, 'dayLimit', 10000)
else delete this.form.dayLimit
}
},
},
async created() {
getCurrencyList().then(res => this.currencyList = res.data)
......
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