|
@@ -41,7 +41,7 @@
|
|
<el-form-item label="可配置数量:">
|
|
<el-form-item label="可配置数量:">
|
|
{{ seatNum }}
|
|
{{ seatNum }}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="已配置数据:">
|
|
|
|
|
|
+ <el-form-item label="已配置数量:">
|
|
{{ configStockNum }}
|
|
{{ configStockNum }}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="未配置数量:">
|
|
<el-form-item label="未配置数量:">
|
|
@@ -74,6 +74,7 @@
|
|
v-model="form.chennelListForm[chennelAtion].stockType"
|
|
v-model="form.chennelListForm[chennelAtion].stockType"
|
|
@change="setStockType"
|
|
@change="setStockType"
|
|
>
|
|
>
|
|
|
|
+ <el-radio :label="-1">不限</el-radio>
|
|
<el-radio :label="0">根据数量</el-radio>
|
|
<el-radio :label="0">根据数量</el-radio>
|
|
<el-radio :label="1">根据座位</el-radio>
|
|
<el-radio :label="1">根据座位</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
@@ -264,6 +265,7 @@ export default {
|
|
this.chennelAtion = null
|
|
this.chennelAtion = null
|
|
this.open = true
|
|
this.open = true
|
|
this.activeName = '01';
|
|
this.activeName = '01';
|
|
|
|
+ this.countBySeatTypList = []
|
|
this.configStockNumObj = {}
|
|
this.configStockNumObj = {}
|
|
if(this.channelTypeList.length<0) {
|
|
if(this.channelTypeList.length<0) {
|
|
await this.channelTypeFun()
|
|
await this.channelTypeFun()
|
|
@@ -312,10 +314,11 @@ export default {
|
|
"channelType":item.dictValue,
|
|
"channelType":item.dictValue,
|
|
"channelName":item.dictLabel,
|
|
"channelName":item.dictLabel,
|
|
"stockType": this.getStockType(item,obj),
|
|
"stockType": this.getStockType(item,obj),
|
|
- "stockNum": this.getStockAllNum(item,obj),
|
|
|
|
|
|
+ "stockNum": '',
|
|
"seatTypeList": [],
|
|
"seatTypeList": [],
|
|
"chennelSeatList": []
|
|
"chennelSeatList": []
|
|
})
|
|
})
|
|
|
|
+ list[index].stockNum = this.getStockAllNum(list[index],obj)
|
|
list[index].seatTypeList = this.getSeatTypeList(list[index],obj)
|
|
list[index].seatTypeList = this.getSeatTypeList(list[index],obj)
|
|
list[index].chennelSeatList = this.getChennelSeatList(list[index],obj)
|
|
list[index].chennelSeatList = this.getChennelSeatList(list[index],obj)
|
|
})
|
|
})
|
|
@@ -323,7 +326,7 @@ export default {
|
|
},
|
|
},
|
|
/** 获取模式 */
|
|
/** 获取模式 */
|
|
getStockType(obj,data){
|
|
getStockType(obj,data){
|
|
- let stockType = 0
|
|
|
|
|
|
+ let stockType = -1
|
|
if(data.chennelList && data.chennelList.length>0) {
|
|
if(data.chennelList && data.chennelList.length>0) {
|
|
for(let i = 0;i < data.chennelList.length;i++) {
|
|
for(let i = 0;i < data.chennelList.length;i++) {
|
|
if(obj.dictValue == data.chennelList[i].channelType) {
|
|
if(obj.dictValue == data.chennelList[i].channelType) {
|
|
@@ -338,14 +341,18 @@ export default {
|
|
getStockAllNum(obj,data) {
|
|
getStockAllNum(obj,data) {
|
|
let num = 0
|
|
let num = 0
|
|
let flog = false
|
|
let flog = false
|
|
- if(data.chennelList && data.chennelList.length>0) {
|
|
|
|
- data.chennelList.forEach((item,index)=>{
|
|
|
|
- if(obj.dictValue == item.channelType) {
|
|
|
|
- flog = true
|
|
|
|
- num = num + item.stockNum
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ if(obj.stockType != -1){
|
|
|
|
+ if(data.chennelList && data.chennelList.length>0) {
|
|
|
|
+ data.chennelList.forEach((item,index)=>{
|
|
|
|
+ if(obj.channelType == item.channelType) {
|
|
|
|
+ flog = true
|
|
|
|
+ num = num + item.stockNum
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ console.log("dsfsdfsdf===",obj,flog)
|
|
if(flog) {
|
|
if(flog) {
|
|
return num
|
|
return num
|
|
}else {
|
|
}else {
|
|
@@ -432,7 +439,7 @@ export default {
|
|
if(this.form.chennelListForm[i].stockType == 0) {
|
|
if(this.form.chennelListForm[i].stockType == 0) {
|
|
if(this.form.chennelListForm[i].seatTypeList && this.form.chennelListForm[i].seatTypeList.length>0) {
|
|
if(this.form.chennelListForm[i].seatTypeList && this.form.chennelListForm[i].seatTypeList.length>0) {
|
|
for(let j = 0;j< this.form.chennelListForm[i].seatTypeList.length;j++) {
|
|
for(let j = 0;j< this.form.chennelListForm[i].seatTypeList.length;j++) {
|
|
- if(this.form.chennelListForm[i].seatTypeList[j].stockNum) {
|
|
|
|
|
|
+ if(this.form.chennelListForm[i].seatTypeList[j].stockNum ||this.form.chennelListForm[i].seatTypeList[j].stockNum === 0) {
|
|
postMap.chennelList.push({
|
|
postMap.chennelList.push({
|
|
...obj,
|
|
...obj,
|
|
"seatTypeId": this.form.chennelListForm[i].seatTypeList[j].seatTypeId,
|
|
"seatTypeId": this.form.chennelListForm[i].seatTypeList[j].seatTypeId,
|
|
@@ -579,26 +586,16 @@ export default {
|
|
})
|
|
})
|
|
this.form.chennelListForm.forEach((item,index)=>{
|
|
this.form.chennelListForm.forEach((item,index)=>{
|
|
stockNum = 0
|
|
stockNum = 0
|
|
- if(!item.stockType && item.seatTypeList && item.seatTypeList.length>0) {
|
|
|
|
|
|
+ if( item.stockType == -1 ){
|
|
|
|
+ stockNum = '不限'
|
|
|
|
+ }else if(!item.stockType && item.seatTypeList && item.seatTypeList.length>0) {
|
|
item.seatTypeList.forEach((item1,index1)=>{
|
|
item.seatTypeList.forEach((item1,index1)=>{
|
|
if(item1.stockNum) {
|
|
if(item1.stockNum) {
|
|
stockNum = stockNum + item1.stockNum
|
|
stockNum = stockNum + item1.stockNum
|
|
stockTotal = stockTotal + item1.stockNum
|
|
stockTotal = stockTotal + item1.stockNum
|
|
- // if(!flog) {
|
|
|
|
- // obj['seatNum_'+item1.seatTypeId].stockYes = item1.stockNum
|
|
|
|
- // flog = true
|
|
|
|
- // }else {
|
|
|
|
- // obj['seatNum_'+item1.seatTypeId].stockYes = obj['seatNum_'+item1.seatTypeId].stockYes + item1.stockNum
|
|
|
|
- // }
|
|
|
|
obj['seatNum_'+item1.seatTypeId].stockYes = obj['seatNum_'+item1.seatTypeId].stockYes + item1.stockNum
|
|
obj['seatNum_'+item1.seatTypeId].stockYes = obj['seatNum_'+item1.seatTypeId].stockYes + item1.stockNum
|
|
}
|
|
}
|
|
if(item1.stockNum && this.chennelAtion == index){
|
|
if(item1.stockNum && this.chennelAtion == index){
|
|
- // if(!flog) {
|
|
|
|
- // obj['seatNum_'+item1.seatTypeId].stockYes = 0 - item1.stockNum
|
|
|
|
- // flog = true
|
|
|
|
- // }else {
|
|
|
|
- // obj['seatNum_'+item1.seatTypeId].stockYes = obj['seatNum_'+item1.seatTypeId].stockYes - item1.stockNum
|
|
|
|
- // }
|
|
|
|
obj['seatNum_'+item1.seatTypeId].stockYes = obj['seatNum_'+item1.seatTypeId].stockYes - item1.stockNum
|
|
obj['seatNum_'+item1.seatTypeId].stockYes = obj['seatNum_'+item1.seatTypeId].stockYes - item1.stockNum
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -608,22 +605,10 @@ export default {
|
|
stockNum = stockNum + item.chennelSeatList[item1].length
|
|
stockNum = stockNum + item.chennelSeatList[item1].length
|
|
stockTotal = stockTotal + item.chennelSeatList[item1].length
|
|
stockTotal = stockTotal + item.chennelSeatList[item1].length
|
|
console.log("item1====",item1,item1.replace('seat_',''))
|
|
console.log("item1====",item1,item1.replace('seat_',''))
|
|
- // if(!flog) {
|
|
|
|
- // obj[item1.replace('seat_','seatNum_')].stockYes = item.chennelSeatList[item1].length
|
|
|
|
- // flog = true
|
|
|
|
- // }else {
|
|
|
|
- // obj[item1.replace('seat_','seatNum_')].stockYes = obj[item1.replace('seat_','seatNum_')].stockYes + item.chennelSeatList[item1].length
|
|
|
|
- // }
|
|
|
|
obj[item1.replace('seat_','seatNum_')].stockYes = obj[item1.replace('seat_','seatNum_')].stockYes + item.chennelSeatList[item1].length
|
|
obj[item1.replace('seat_','seatNum_')].stockYes = obj[item1.replace('seat_','seatNum_')].stockYes + item.chennelSeatList[item1].length
|
|
}
|
|
}
|
|
|
|
|
|
if(this.chennelAtion == index && item.chennelSeatList[item1]){
|
|
if(this.chennelAtion == index && item.chennelSeatList[item1]){
|
|
- // if(!flog) {
|
|
|
|
- // obj[item1.replace('seat_','seatNum_')].stockYes = 0 - item.chennelSeatList[item1].length
|
|
|
|
- // flog = true
|
|
|
|
- // }else {
|
|
|
|
- // obj[item1.replace('seat_','seatNum_')].stockYes = obj[item1.replace('seat_','seatNum_')].stockYes - item.chennelSeatList[item1].length
|
|
|
|
- // }
|
|
|
|
obj[item1.replace('seat_','seatNum_')].stockYes = obj[item1.replace('seat_','seatNum_')].stockYes - item.chennelSeatList[item1].length
|
|
obj[item1.replace('seat_','seatNum_')].stockYes = obj[item1.replace('seat_','seatNum_')].stockYes - item.chennelSeatList[item1].length
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -639,15 +624,20 @@ export default {
|
|
setStockType(value) {
|
|
setStockType(value) {
|
|
console.log('选择模式===',value)
|
|
console.log('选择模式===',value)
|
|
this.form.chennelListForm[this.chennelAtion].stockNum = 0
|
|
this.form.chennelListForm[this.chennelAtion].stockNum = 0
|
|
- if(value == 1) {
|
|
|
|
|
|
+ if(value == -1) {
|
|
|
|
+ this.form.chennelListForm[this.chennelAtion].stockNum = '不限'
|
|
|
|
+ this.form.chennelListForm[this.chennelAtion].chennelSeatList = null
|
|
|
|
+ this.form.chennelListForm[this.chennelAtion].seatTypeList.forEach((item,index)=>{
|
|
|
|
+ this.form.chennelListForm[this.chennelAtion].seatTypeList[index].stockNum = undefined
|
|
|
|
+ })
|
|
|
|
+ }else if(value == 1) {
|
|
this.form.chennelListForm[this.chennelAtion].seatTypeList.forEach((item,index)=>{
|
|
this.form.chennelListForm[this.chennelAtion].seatTypeList.forEach((item,index)=>{
|
|
this.form.chennelListForm[this.chennelAtion].seatTypeList[index].stockNum = undefined
|
|
this.form.chennelListForm[this.chennelAtion].seatTypeList[index].stockNum = undefined
|
|
})
|
|
})
|
|
this.getSeatSelectById()
|
|
this.getSeatSelectById()
|
|
- }else {
|
|
|
|
|
|
+ }else if(value === 0){
|
|
this.form.chennelListForm[this.chennelAtion].chennelSeatList = null
|
|
this.form.chennelListForm[this.chennelAtion].chennelSeatList = null
|
|
}
|
|
}
|
|
-
|
|
|
|
},
|
|
},
|
|
/** 获取座位 */
|
|
/** 获取座位 */
|
|
async getSeatSelectById() {
|
|
async getSeatSelectById() {
|
|
@@ -725,7 +715,11 @@ export default {
|
|
let stockNum = 0
|
|
let stockNum = 0
|
|
let stockTotal= 0
|
|
let stockTotal= 0
|
|
this.form.chennelListForm.forEach((item,index)=>{
|
|
this.form.chennelListForm.forEach((item,index)=>{
|
|
- stockNum = 0
|
|
|
|
|
|
+ if(item.stockType == -1) {
|
|
|
|
+ stockNum = "不限"
|
|
|
|
+ }else {
|
|
|
|
+ stockNum = 0
|
|
|
|
+ }
|
|
if(item.seatTypeList && item.seatTypeList.length>0) {
|
|
if(item.seatTypeList && item.seatTypeList.length>0) {
|
|
item.seatTypeList.forEach((item1,index1)=>{
|
|
item.seatTypeList.forEach((item1,index1)=>{
|
|
if(item1.stockNum) {
|
|
if(item1.stockNum) {
|