|
@@ -217,6 +217,7 @@ export default {
|
|
this.model = mode
|
|
this.model = mode
|
|
this.loading = true
|
|
this.loading = true
|
|
this.loadingText = '获取数据中...'
|
|
this.loadingText = '获取数据中...'
|
|
|
|
+ this.title = title
|
|
this.chennelAtion = null
|
|
this.chennelAtion = null
|
|
this.open = true
|
|
this.open = true
|
|
this.activeName = '01';
|
|
this.activeName = '01';
|
|
@@ -225,10 +226,8 @@ export default {
|
|
await this.channelTypeFun()
|
|
await this.channelTypeFun()
|
|
}
|
|
}
|
|
if (obj){
|
|
if (obj){
|
|
- this.title = "编辑库存模板";
|
|
|
|
await this.getSelectByIdApi(obj)
|
|
await this.getSelectByIdApi(obj)
|
|
}else{
|
|
}else{
|
|
- this.title = "添加库存模板";
|
|
|
|
this.form = {
|
|
this.form = {
|
|
chennelListForm: this.setDataTree({})
|
|
chennelListForm: this.setDataTree({})
|
|
}
|
|
}
|
|
@@ -338,11 +337,15 @@ export default {
|
|
if(obj.channelType == data.chennelList[i].channelType) {
|
|
if(obj.channelType == data.chennelList[i].channelType) {
|
|
if(data.chennelList[i].chennelSeatList) {
|
|
if(data.chennelList[i].chennelSeatList) {
|
|
let srt = 'seat_'+ data.chennelList[i].seatTypeId
|
|
let srt = 'seat_'+ data.chennelList[i].seatTypeId
|
|
- seat[srt] ? seat[srt].push(...data.chennelList[i].chennelSeatList): seat[srt] = [...data.chennelList[i].chennelSeatList]
|
|
|
|
- console.log("seat_",seat,data.chennelList[i].chennelSeatList)
|
|
|
|
|
|
+ if(seat[srt]) {
|
|
|
|
+ seat[srt] = seat[srt].concat(data.chennelList[i].chennelSeatList)
|
|
|
|
+ }else {
|
|
|
|
+ seat[srt] = [...data.chennelList[i].chennelSeatList]
|
|
|
|
+ }
|
|
|
|
+ console.log("seat_",srt,seat,data.chennelList[i].chennelSeatList)
|
|
}
|
|
}
|
|
//list = data.chennelList[i].chennelSeatList ? JSON.parse(JSON.stringify(data.chennelList[i].chennelSeatList)):[]
|
|
//list = data.chennelList[i].chennelSeatList ? JSON.parse(JSON.stringify(data.chennelList[i].chennelSeatList)):[]
|
|
- break;
|
|
|
|
|
|
+ // break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -415,6 +418,10 @@ export default {
|
|
}
|
|
}
|
|
delete postMap.chennelListForm
|
|
delete postMap.chennelListForm
|
|
console.log("postMap=====",postMap)
|
|
console.log("postMap=====",postMap)
|
|
|
|
+ if(!postMap.chennelList || postMap.chennelList.length==0) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ return
|
|
|
|
+ }
|
|
let res = await saveAndEdit(postMap)
|
|
let res = await saveAndEdit(postMap)
|
|
this.loading = false
|
|
this.loading = false
|
|
if(res.code) {
|
|
if(res.code) {
|
|
@@ -517,7 +524,7 @@ export default {
|
|
let list1 = []
|
|
let list1 = []
|
|
if(this.form.chennelListForm[this.chennelAtion].chennelSeatList) {
|
|
if(this.form.chennelListForm[this.chennelAtion].chennelSeatList) {
|
|
Object.keys(this.form.chennelListForm[this.chennelAtion].chennelSeatList).forEach((item)=>{
|
|
Object.keys(this.form.chennelListForm[this.chennelAtion].chennelSeatList).forEach((item)=>{
|
|
- list1.push(...this.form.chennelListForm[this.chennelAtion].chennelSeatList[item])
|
|
|
|
|
|
+ list1 = list1.concat(this.form.chennelListForm[this.chennelAtion].chennelSeatList[item])
|
|
})
|
|
})
|
|
list = this.dataList.filter((item,index)=>{
|
|
list = this.dataList.filter((item,index)=>{
|
|
if(list1.includes(item.id)){
|
|
if(list1.includes(item.id)){
|