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

阶梯价修改

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