Commit 996db3dd authored by 邓春圆's avatar 邓春圆

阶梯价修改

parent 0e5d8f9d
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
watch:{ watch:{
'value1.priceStepClearanceList':{ 'value1.priceStepClearanceList':{
handler(val){ handler(val){
if(val.length === 0){ if(val && val.length === 0){
this.addInterval(); this.addInterval();
} }
this.$emit('input', this.value1) this.$emit('input', this.value1)
......
...@@ -225,8 +225,9 @@ export default { ...@@ -225,8 +225,9 @@ export default {
if (this.$route.query.id) { if (this.$route.query.id) {
getChannel(this.$route.query.id).then((res) => { getChannel(this.$route.query.id).then((res) => {
this.$set(this, 'form', {... res.data}) this.$set(this, 'form', {... res.data})
if(!this.form.channelPackagingList === null ){ if(this.form.channelPackagingList === null ){
this.form.channelPackagingList = []; this.form.channelPackagingList = [];
this.addPackaging()
} }
if(this.form.attrId){ if(this.form.attrId){
this.form.attrId = this.form.attrId.split(',').map(i => +i) this.form.attrId = this.form.attrId.split(',').map(i => +i)
...@@ -235,7 +236,7 @@ export default { ...@@ -235,7 +236,7 @@ export default {
} }
this.form.channelPackagingList.forEach(item =>{ this.form.channelPackagingList.forEach(item =>{
item.packagingTypes = item.packagingTypes.split(',') || [] item.packagingTypes = item.packagingTypes && item.packagingTypes.length !== 0 ? item.packagingTypes.split(',') : []
}) })
if(this.form.warehouseIds.length){ if(this.form.warehouseIds.length){
this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item) this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item)
...@@ -271,9 +272,12 @@ export default { ...@@ -271,9 +272,12 @@ export default {
this.form.channelPackagingList = []; this.form.channelPackagingList = [];
this.dialogVisible = false; this.dialogVisible = false;
getChannel(val).then((res) => { getChannel(val).then((res) => {
console.log(res.data,'data')
res.data.channelPackagingList.forEach((item,index) =>{ res.data.channelPackagingList.forEach((item,index) =>{
if(!this.form.channelPackagingList[index]){ if(!this.form.channelPackagingList[index]){
this.form.channelPackagingList[index] = { airWeightLimit:undefined, packagingTypes:[], channelPriceStepClearanceList:[],} this.form.channelPackagingList[index] = { airWeightLimit:item.airWeightLimit, packagingTypes:[], channelPriceStepClearanceList:[],}
}else {
this.form.channelPackagingList[index] = { airWeightLimit:item.airWeightLimit, packagingTypes: [], channelPriceStepClearanceList:[],}
} }
item.channelPriceStepClearanceList.forEach((itemm, indexx) => { item.channelPriceStepClearanceList.forEach((itemm, indexx) => {
let p = { let p = {
...@@ -293,6 +297,7 @@ export default { ...@@ -293,6 +297,7 @@ export default {
this.form.channelPackagingList[index].channelPriceStepClearanceList[indexx] = {...p,...it,clearancePrice:itemm.clearancePrice,clearancePriceUnit:itemm.clearancePriceUnit,clearanceVolumeUnit:itemm.clearanceVolumeUnit} ; this.form.channelPackagingList[index].channelPriceStepClearanceList[indexx] = {...p,...it,clearancePrice:itemm.clearancePrice,clearancePriceUnit:itemm.clearancePriceUnit,clearanceVolumeUnit:itemm.clearanceVolumeUnit} ;
}) })
}) })
this.$forceUpdate()
}); });
}, },
deleteFn(index){ deleteFn(index){
......
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