Commit 2713e0f4 authored by 邓春圆's avatar 邓春圆

阶梯定价,总量单位和币种统一

parent a3a387e7
<template> <template>
<div style="width: 100%;min-width: 100px"> <div style="width: 100%;min-width: 100px">
<el-select v-model="val"> <el-select @change="(e) =>{$emit('change', e)}" :disabled="disabled" v-model="val">
<el-option :value="item.id" :label="$l(item, 'title') + item.fuhao" v-for="(item) in options"></el-option> <el-option :value="item.id" :label="$l(item, 'title') + item.fuhao" v-for="(item) in options"></el-option>
</el-select> </el-select>
</div> </div>
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
export default { export default {
name: "currency-select", name: "currency-select",
props:{ props:{
disabled:{
type:Boolean,
default:false
},
options:{ options:{
type:Array, type:Array,
default:()=>[] default:()=>[]
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<el-col :span="9"> <el-col :span="9">
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<el-input v-model="item.startNum"></el-input> - <el-input v-model="item.endNum" ></el-input > / <el-input v-model="item.startNum"></el-input> - <el-input v-model="item.endNum" ></el-input > /
<weight-select v-model="item.weightUnit" :options="unitList"></weight-select> <weight-select @change="changeWeight" :disabled="index > 0" v-model="item.weightUnit" :options="unitList"></weight-select>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
<el-col :span="9"> <el-col :span="9">
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<el-input v-model="item.clearancePrice"></el-input> <el-input v-model="item.clearancePrice"></el-input>
<currency-select :options="currencyList" v-model="item.clearancePriceUnit"></currency-select> <currency-select @change="setCurrency" :disabled="index > 0" :options="currencyList" v-model="item.clearancePriceUnit"></currency-select>
/ <weight-select :options="unitList" v-model="item.clearanceVolumeUnit"></weight-select> / <weight-select :disabled="index > 0" @change="setAirFreightWeight" :options="unitList" v-model="item.clearanceVolumeUnit"></weight-select>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
...@@ -91,16 +91,31 @@ export default { ...@@ -91,16 +91,31 @@ export default {
}) })
}, },
methods:{ methods:{
changeWeight(e){
this.value1[this.keyArr].forEach(item => {
item.weightUnit = e
})
},
setCurrency(e){
this.value1[this.keyArr].forEach(item => {
item.clearancePriceUnit = e
})
},
setAirFreightWeight(e){
this.value1[this.keyArr].forEach(item => {
item.clearanceVolumeUnit = e
})
},
addInterval(){ addInterval(){
let p = { let p = {
"channelId":'', "channelId":'',
"clearancePrice":'', "clearancePrice":'',
"clearancePriceUnit":'', "clearancePriceUnit": this.value1[this.keyArr].length && this.value1[this.keyArr][0].clearancePriceUnit ? this.value1[this.keyArr][0].clearancePriceUnit : '',
"clearanceVolumeUnit":6, "clearanceVolumeUnit":this.value1[this.keyArr].length ? this.value1[this.keyArr][0].clearanceVolumeUnit : 6,
"endNum":'', "endNum":'',
"packagingId":'', "packagingId":'',
"startNum":'', "startNum":'',
"weightUnit":6 "weightUnit": this.value1[this.keyArr].length ? this.value1[this.keyArr][0].weightUnit : 6
} }
this.value1[this.keyArr].push(p) this.value1[this.keyArr].push(p)
this.$forceUpdate(); this.$forceUpdate();
......
<template> <template>
<div style="min-width: 100px;width: 100%;"> <div style="min-width: 100px;width: 100%;">
<el-select v-model="val"> <el-select @change="(e) =>{$emit('change',e)}" :disabled="disabled" v-model="val">
<el-option v-for="(item, index) in options" :value="item.id" :key="index" :label="$l(item ,'title')" ></el-option> <el-option v-for="(item, index) in options" :value="item.id" :key="index" :label="$l(item ,'title')" ></el-option>
</el-select> </el-select>
</div> </div>
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
export default { export default {
name: "weight-select", name: "weight-select",
props:{ props:{
disabled:{
type:Boolean,
default:false
},
options:{ options:{
type:Array, type:Array,
default:()=>[] default:()=>[]
......
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