Commit 3bca5b87 authored by dragondean@qq.com's avatar dragondean@qq.com

优惠单位和翻译

parent 9f34301e
......@@ -3550,5 +3550,15 @@
"固定": "fixed",
"动态标题": "Dynamic Title",
"保存配置": "Save",
"重置配置": "Reset"
}
"重置配置": "Reset",
"选择联系人": "Choose Contact",
"快速新建客户": "Quick Create Customer",
"表单错误": "Form error",
"快递ID": "Express No",
"请输入快递ID": "Enter Express No",
"请输入备注-中文": "Enter Remark",
"渠道ID": "Channel ID",
"预计时间(天)": "Estimate Days",
"注意:运费/清关费 方案二选一": "Note: choose one of the two freight/customs clearance schemes",
"暂无优惠": "No discount"
}
\ No newline at end of file
......@@ -122,7 +122,7 @@ Vue.prototype.$showFormValidateErrors = (errors) => {
let createElement = vm.$createElement
let fieldList = Object.values(errors)
Element.Notification({
title: '表单错误',
title: this.$t('表单错误'),
type: 'warning',
duration: 3000,
message: createElement('div', fieldList.map(function (errorList) {
......
......@@ -53,7 +53,7 @@
</el-form-item>
<el-form-item :label="$t('运费')" v-if="[2,3,4,5,6,7].indexOf(form.type) > -1">
<span slot="label"><span style="color: red">*</span>{{ $t('运费') }}</span>
<span slot="label"><span style="color: red">*</span>{{$t('运费')}}</span>
<div class="fee-item" v-for="(item, index) in fee[1]" :key="index">
<template v-if="[1,2,3,4,5].indexOf(form.type) > -1">
{{$t('')}}
......@@ -61,8 +61,8 @@
<!-- <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].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 || form.type == 5" v-model="item.combUnit" @input="checkReduceCurrency(item)" :options="combUnitList" label-field="label" value-field="value" defaultable style="width:100px" />
<!-- <selector v-if="[4].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="[2,4,5].indexOf(form.type) > -1" 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>
<span v-if="[4].indexOf(form.type) > -1">{{$t('折扣率')}}</span>
......@@ -75,8 +75,13 @@
<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" />{{ $t('') }}<el-input v-model="item.endAmount" @keyup.native="checkPositive(item, 'endAmount')" style="width:100px" />
<selector v-model="item.startAndEndCurrencyId" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
> <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" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
-->
<selector v-model="item.combUnit" @input="checkReduceCurrency(item)" :options="combUnitList" label-field="label" value-field="value" defaultable style="width:100px" />
{{$t('价格')}}
</template>
......@@ -95,7 +100,7 @@
</template>
<!-- <div class="red-tips" v-if="errTips[1] && errTips[1][index]">{{errTips[1][index]}}</div> -->
<span style="color:red; margin-left: 10px;" v-if="index == 0 && (form.type == 2 || form.type == 4)">注意:运费/清关费 方案二选一</span>
<span style="color:red; margin-left: 10px;" v-if="index == 0 && [2,3,4,5].indexOf(form.type) > -1">{{$t('注意:运费/清关费 方案二选一')}}</span>
</div>
</el-form-item>
......@@ -104,7 +109,8 @@
<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="checkReduceCurrency(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="[2,4,5].indexOf(form.type) > -1" v-model="item.combUnit" @input="checkReduceCurrency(item)" :options="combUnitList" label-field="label" value-field="value" 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>
......@@ -118,8 +124,10 @@
<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" />{{ $t('') }}<el-input v-model="item.endAmount" @keyup.native="checkPositive(item, 'endAmount')" style="width:100px" />
<Selector v-model="item.startAndEndCurrencyId" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
> <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" @input="checkReduceCurrency(item)" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" /> -->
<selector v-model="item.combUnit" @input="checkReduceCurrency(item)" :options="combUnitList" label-field="label" value-field="value" defaultable style="width:100px" />
{{$t('价格')}}
</template>
......@@ -370,11 +378,6 @@ export default {
},
watch:{
'form.type'(val){
// 方数满减3和特价6、优惠5 需要单位
if((val == 3 || val == 6 || val == 2 || val == 5) && !this.unitList.length){
this.getUnitList()
}
// 非优惠券则查询优惠券列表
if(val && val != 1){
this.getCouponSelect()
......@@ -430,6 +433,7 @@ export default {
if(this.$route.query.readonly == 1){
this.readonly = true
}
this.getUnitList()
getCurrencyList().then(res => this.currencyList = res.data)
if (this.$route.query.id) {
this.initing = true
......@@ -621,37 +625,21 @@ export default {
let discountDetailedVOs = this.costType == 3 ? this.fee[3] : this.fee[1].concat(this.fee[2]).filter(item => item.netReceiptsAmount || item.fullAmount)
discountDetailedVOs.map(item => {
// 目前只有满减(1)和优惠(5)使用组合单位
if((this.form.type == 2 || this.form.type == 5) && item.combUnit){
if([2,4,5,7].indexOf(this.form.type) > -1 && item.combUnit){
// 满减需要 先删除单位,防止编辑的时候切换单位导致两个同时存在
delete item.fullCurrencyId
delete item.prodUnit
let tmp = item.combUnit.split('_')
/* if(this.form.type == 5){
item['fullCurrencyId'] =
} */
/* if(this.form.type == 7){
item.startAndEndCurrencyId =
} */
// 这里目前只能是满减,优惠会提示 “优惠劵满减货币不能为空”
item[tmp[0]] = tmp[1]
}
/* // 满减,折扣 则需要填写 满多少(fullAmount)减多少(reduceAmount)
// 优惠,满多少(fullAmount)收多少(netReceiptsAmount)
// 特价 netReceiptsAmount
// 区间价 startAmount 到 endAmount
const fields = {
2: ['fullAmount', 'reduceAmount'],
3: ['fullAmount', 'netReceiptsAmount'],
4: ['netReceiptsAmount'],
5: ['startAmount', 'endAmount', 'netReceiptsAmount']
}[this.form.type];
let err = false
if(fields){
fields.forEach(field => {
if(!item[field] || +item[field] <= 0){
err = true
this.$message.error((item.type == 1 ? this.$t('运费') : '清关费') + '不能为空且大于0')
this.errTips[item.type]
}
})
}
if(err) return false */
})
......
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