|
|
@ -4,7 +4,7 @@ |
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="120px" :rules="rules"> |
|
|
|
<el-form :disabled="view" ref="form" :model="form" label-width="120px" :rules="rules"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="用户名称" prop="province"> |
|
|
|
<el-form-item label="客户名称" prop="province"> |
|
|
|
<el-select |
|
|
|
<el-select |
|
|
|
style="width: 100%" |
|
|
|
style="width: 100%" |
|
|
|
v-model="form.clientIds" |
|
|
|
v-model="form.clientIds" |
|
|
@ -99,6 +99,7 @@ |
|
|
|
:show-all-levels="false" |
|
|
|
:show-all-levels="false" |
|
|
|
style="width: 100%" |
|
|
|
style="width: 100%" |
|
|
|
v-model="form.category" |
|
|
|
v-model="form.category" |
|
|
|
|
|
|
|
@change="categoryChange" |
|
|
|
></el-cascader> |
|
|
|
></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
@ -314,6 +315,8 @@ export default { |
|
|
|
DryWarehouseDistributionBID: '', //仓库ID |
|
|
|
DryWarehouseDistributionBID: '', //仓库ID |
|
|
|
DryWarehouseDistributionCID: '', //配送ID |
|
|
|
DryWarehouseDistributionCID: '', //配送ID |
|
|
|
clientOptions: [], //客户集合 |
|
|
|
clientOptions: [], //客户集合 |
|
|
|
|
|
|
|
categoryData:[],//品类数据 |
|
|
|
|
|
|
|
categoryDataID:[],//品类数据的ID |
|
|
|
activeName: 'second', |
|
|
|
activeName: 'second', |
|
|
|
// 分页信息 |
|
|
|
// 分页信息 |
|
|
|
page: { |
|
|
|
page: { |
|
|
@ -359,13 +362,20 @@ export default { |
|
|
|
lazy: true, |
|
|
|
lazy: true, |
|
|
|
multiple: true, |
|
|
|
multiple: true, |
|
|
|
checkStrictly: true, |
|
|
|
checkStrictly: true, |
|
|
|
lazyLoad(node, resolve) { |
|
|
|
lazyLoad:(node, resolve)=> { |
|
|
|
|
|
|
|
console.log(this,'this'); |
|
|
|
|
|
|
|
let _this=this |
|
|
|
const { level } = node; |
|
|
|
const { level } = node; |
|
|
|
setTimeout(async () => { |
|
|
|
setTimeout(async () => { |
|
|
|
// console.log("node/////////",node); |
|
|
|
// console.log("node/////////",node); |
|
|
|
const parentId = node.level === 0 ? 1 : node.data.value; |
|
|
|
const parentId = node.level === 0 ? 1 : node.data.value; |
|
|
|
// console.log("par",parentId); |
|
|
|
// console.log("par",parentId); |
|
|
|
let shuju = await getDeptLazyTree(parentId); |
|
|
|
let shuju = await getDeptLazyTree(parentId); |
|
|
|
|
|
|
|
console.log(shuju,'品类数据'); |
|
|
|
|
|
|
|
shuju.data.data.forEach((item=>{ |
|
|
|
|
|
|
|
_this.categoryData.push(item) |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
console.log(_this.categoryData,'categoryData'); |
|
|
|
// console.log(")))))))))))",shuju); |
|
|
|
// console.log(")))))))))))",shuju); |
|
|
|
const nodes = Array.from(shuju.data.data).map(item => ({ |
|
|
|
const nodes = Array.from(shuju.data.data).map(item => ({ |
|
|
|
value: item.id, |
|
|
|
value: item.id, |
|
|
@ -478,7 +488,23 @@ export default { |
|
|
|
// this.form.details = this.DryWarehouseDistributionB; |
|
|
|
// this.form.details = this.DryWarehouseDistributionB; |
|
|
|
this.form.details = [].concat(...this.DryWarehouseDistributionA, ...this.DryWarehouseDistributionB, ...this.DryWarehouseDistributionC); |
|
|
|
this.form.details = [].concat(...this.DryWarehouseDistributionA, ...this.DryWarehouseDistributionB, ...this.DryWarehouseDistributionC); |
|
|
|
console.log('提交的数据》》》', this.form); |
|
|
|
console.log('提交的数据》》》', this.form); |
|
|
|
|
|
|
|
console.log(this.categoryDataID,'id'); |
|
|
|
|
|
|
|
console.log(this.categoryData,'名字'); |
|
|
|
|
|
|
|
let matchedData = this.categoryDataID.map(subArray => { |
|
|
|
|
|
|
|
// subArray 应该包含一个元素,即 id |
|
|
|
|
|
|
|
if (subArray.length === 1) { |
|
|
|
|
|
|
|
let idToMatch = subArray[0]; |
|
|
|
|
|
|
|
// 在 datas 中寻找匹配的 id |
|
|
|
|
|
|
|
let matched = this.categoryData.find(data => data.id === idToMatch); |
|
|
|
|
|
|
|
// 如果找到匹配,则返回对应的对象 |
|
|
|
|
|
|
|
if (matched) { |
|
|
|
|
|
|
|
return matched; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
}).filter(item => item !== null); // 过滤掉任何未匹配的值(null) |
|
|
|
|
|
|
|
console.log(matchedData,'筛选出来的值'); |
|
|
|
|
|
|
|
return |
|
|
|
add(this.form).then(() => { |
|
|
|
add(this.form).then(() => { |
|
|
|
this.$store.commit('DEL_TAG_CURRENT'); //关闭当前页面 |
|
|
|
this.$store.commit('DEL_TAG_CURRENT'); //关闭当前页面 |
|
|
|
this.$router.push('/basicdata/brand/basicdataFreight'); //添加成功跳转到列表 |
|
|
|
this.$router.push('/basicdata/brand/basicdataFreight'); //添加成功跳转到列表 |
|
|
@ -727,6 +753,20 @@ export default { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
categoryChange(val,a){ |
|
|
|
|
|
|
|
console.log(val,a); |
|
|
|
|
|
|
|
let newArray = val.map(subArray => { |
|
|
|
|
|
|
|
// 如果内层数组长度大于 1,则只取最后一个元素组成新的数组 |
|
|
|
|
|
|
|
if (subArray.length > 1) { |
|
|
|
|
|
|
|
return [subArray[subArray.length - 1]]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 否则,直接保留这个数组 |
|
|
|
|
|
|
|
return subArray; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.categoryDataID=newArray |
|
|
|
|
|
|
|
console.log(this.categoryDataID,'data中的数据'); |
|
|
|
|
|
|
|
console.log(newArray,'重新组织的'); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleCheckedCitiesChange(value, index) { |
|
|
|
handleCheckedCitiesChange(value, index) { |
|
|
|
//费用选择 |
|
|
|
//费用选择 |
|
|
@ -873,6 +913,7 @@ export default { |
|
|
|
// console.log("字典》》》",res); |
|
|
|
// console.log("字典》》》",res); |
|
|
|
this.delivery = res.data.data; |
|
|
|
this.delivery = res.data.data; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|