Commit 8c507e00 authored by dragondean@qq.com's avatar dragondean@qq.com

优惠

parent 3d00dadf
......@@ -61,7 +61,7 @@
<!-- <el-select v-model="item.fullCurrencyId" style="width:100px" >
<el-option v-for="item in currencyList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select> -->
<selector v-if="[4,5].indexOf(form.type) > -1" v-model="item.fullCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="[4,5].indexOf(form.type) > -1" v-model="item.fullCurrencyId" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="form.type == 2" v-model="item.combUnit" @input="checkReduceCurrency(item)" :options="combUnitList" label-field="label" value-field="value" defaultable style="width:100px" />
<span v-if="[2].indexOf(form.type) > -1">{{$t('')}}</span>
......@@ -77,12 +77,12 @@
<template v-if="form.type==7">
> <el-input v-model="item.startAmount" @keyup.native="checkPositive(item, 'startAmount')" style="width:100px" />
<el-input v-model="item.endAmount" @keyup.native="checkPositive(item, 'endAmount')" style="width:100px" />
<selector v-model="item.startAndEndCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-model="item.startAndEndCurrencyId" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
{{$t('价格')}}
</template>
<el-input v-if="[5,6,7].indexOf(form.type) > -1" @keyup.native="checkPositive(item, 'netReceiptsAmount')" v-model="item.netReceiptsAmount" style="width:100px" />
<selector v-if="[5,6,7].indexOf(form.type) > -1" v-model="item.netReceiptsCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="[5,6,7].indexOf(form.type) > -1" v-model="item.netReceiptsCurrencyId" :disabled="!!item.reduceCurrencyDisabled" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<template v-if="form.type == 6">
/
......@@ -100,7 +100,7 @@
<template v-if="[1,2,3,4,5].indexOf(form.type) > -1">
{{$t('')}}
<el-input v-model="item.fullAmount" @keyup.native="checkPositive(item, 'fullAmount')" style="width:100px" />
<selector v-if="[2,4,5].indexOf(form.type) > -1" v-model="item.fullCurrencyId" @input="syncClearanceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="[2,4,5].indexOf(form.type) > -1" v-model="item.fullCurrencyId" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="form.type == 3" v-model="item.prodUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<span v-if="[2].indexOf(form.type) > -1">{{$t('')}}</span>
......@@ -110,18 +110,18 @@
<el-input v-if="[2,3,4].indexOf(form.type) > -1" @keyup.native="checkPositive(item, 'reduceAmount')" v-model="item.reduceAmount" style="width:100px" />
<selector v-if="[2,3].indexOf(form.type) > -1" v-model="item.reduceCurrencyId" :disabled="form.type==2" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="[2,3].indexOf(form.type) > -1" v-model="item.reduceCurrencyId" :disabled="!!item.reduceCurrencyDisabled" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<span v-if="[4].indexOf(form.type) > -1">%</span>
</template>
<template v-if="form.type==7">
> <el-input v-model="item.startAmount" @keyup.native="checkPositive(item, 'startAmount')" style="width:100px" />
<el-input v-model="item.endAmount" @keyup.native="checkPositive(item, 'endAmount')" style="width:100px" />
<Selector v-model="item.startAndEndCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<Selector v-model="item.startAndEndCurrencyId" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
{{$t('价格')}}
</template>
<el-input v-if="[5,6,7].indexOf(form.type) > -1" @keyup.native="checkPositive(item, 'netReceiptsAmount')" v-model="item.netReceiptsAmount" style="width:100px" />
<selector v-if="[5,6,7].indexOf(form.type) > -1" v-model="item.netReceiptsCurrencyId" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-if="[5,6,7].indexOf(form.type) > -1" v-model="item.netReceiptsCurrencyId" :disabled="!!item.reduceCurrencyDisabled" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<template v-if="form.type == 6">
/
......@@ -130,7 +130,7 @@
<el-button class="el-icon-plus" size="mini" type="primary" @click="fee[2].push({type:2})" />
<el-button v-if="fee[2].length > 1" class="el-icon-minus" size="mini" type="danger" @click="fee[2].splice(index,1)" />
<div class="red-tips" v-if="errTips[2] && errTips[1][index]">{{errTips[2][index]}}</div>
<!-- <div class="red-tips" v-if="errTips[2] && errTips[1][index]">{{errTips[2][index]}}</div> -->
</div>
</el-form-item>
......@@ -281,7 +281,7 @@ export default {
readonly: false,
// 表单参数
form: {
status: 1,
status: 1
},
// 表单校验
rules: {
......@@ -372,12 +372,19 @@ export default {
this.getCouponSelect()
// 非优惠券给默认数据
this.$set(this.form, 'documentDeclarationArr', ["1"])
this.$set(this.form, 'isCargoControlArr', ["0"])
this.$set(this.form, 'documentDeclarationArr', ["1", "2", "3"])
this.$set(this.form, 'isCargoControlArr', ["0", "1"])
this.$set(this.form, 'orderAttrArr', ["2","3","1"])
this.$set(this.form, 'brandArr', ["0","1"])
this.$set(this.form, 'brandArr', ["0","1", "2"])
this.$set(this.form, 'suitableLineType', 0)
}
// 过一遍费用,禁用/启用、同步 部分货币单位
[1,2].forEach(index => {
this.fee[index].forEach(item => {
this.checkReduceCurrency(item)
})
})
},
'form.isSimilarSuperposition'(val){
if(val){
......@@ -478,16 +485,28 @@ export default {
// 满减活动如果选择的满多少金额减,则在选择满货币后需要同步减的货币,且禁用减的货币修改
checkReduceCurrency(item){
// 金额满减
if(this.form.type == 2 && item.combUnit.split('_')[0] == 'fullCurrencyId'){
this.$set(item, 'reduceCurrencyDisabled', true)
this.$set(item, 'reduceCurrencyId', +item.combUnit.split('_')[1])
if(this.form.type == 2){
// 只要不是按产品单位满减
if(!item.combUnit || item.combUnit.split('_')[0] != 'prodUnit'){
this.$set(item, 'reduceCurrencyDisabled', true)
this.$set(item, 'reduceCurrencyId', +item.fullCurrencyId || +item.combUnit.split('_')[1])
}
return
}
// 优惠
if(this.form.type == 5){
this.$set(item, 'reduceCurrencyDisabled', true)
this.$set(item, 'reduceCurrencyId', +item.fullCurrencyId)
this.$set(item, 'netReceiptsCurrencyId', +item.fullCurrencyId)
return
}
// 区间价
if(this.form.type== 7){
this.$set(item, 'reduceCurrencyDisabled', true)
this.$set(item, 'netReceiptsCurrencyId', +item.startAndEndCurrencyId)
return
}
......
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