|
@@ -238,7 +238,7 @@ export default {
|
|
|
|
|
|
deviceGoodsList(1, businessType, deviceIds.join(",")).then((res) => {
|
|
deviceGoodsList(1, businessType, deviceIds.join(",")).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
-
|
|
|
|
|
|
+ console.log("获取到流量套餐:", this.form.freeActivityId);
|
|
// 如果返回的数据为空数组,确保freeOptions也为空数组而不是null或undefined
|
|
// 如果返回的数据为空数组,确保freeOptions也为空数组而不是null或undefined
|
|
this.freeOptions = res.data || [];
|
|
this.freeOptions = res.data || [];
|
|
// console.log("获取到流量套餐:", this.freeOptions.length, this.form.freeActivityId);
|
|
// console.log("获取到流量套餐:", this.freeOptions.length, this.form.freeActivityId);
|
|
@@ -249,7 +249,7 @@ export default {
|
|
this.form.freeActivityId = null;
|
|
this.form.freeActivityId = null;
|
|
}
|
|
}
|
|
// 如果freeOptions有值且freeActivityId有值,检查是否存在对应的选项
|
|
// 如果freeOptions有值且freeActivityId有值,检查是否存在对应的选项
|
|
- else if (this.form.freeActivityId !== null) {
|
|
|
|
|
|
+ else if (!(this.form.freeActivityId === null || this.form.freeActivityId === undefined)) {
|
|
const exists = this.freeOptions.some(item => {
|
|
const exists = this.freeOptions.some(item => {
|
|
// console.log("item.id:", item.id, "freeActivityId:", this.form.freeActivityId);
|
|
// console.log("item.id:", item.id, "freeActivityId:", this.form.freeActivityId);
|
|
return String(item.id) === String(this.form.freeActivityId);
|
|
return String(item.id) === String(this.form.freeActivityId);
|