|
|
@@ -1016,6 +1016,10 @@ onMounted(async () => {
|
|
|
} else {
|
|
|
ElMessage.warning("请完成商家入驻后再进行新建团购");
|
|
|
}
|
|
|
+ // if (!getGroupCombination()) {
|
|
|
+ // ElMessage.warning("请完成商家入驻后重新登录再进行新建团购");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
let params = {
|
|
|
year: new Date().getFullYear(),
|
|
|
page: 1,
|
|
|
@@ -1023,24 +1027,22 @@ onMounted(async () => {
|
|
|
openFlag: 1,
|
|
|
holidayName: ""
|
|
|
};
|
|
|
- let res = await getHolidayList(params);
|
|
|
+ let res: any = await getHolidayList(params);
|
|
|
if (res && res.code == 200) {
|
|
|
holidayList.value = res.data.records;
|
|
|
}
|
|
|
if (type.value != "add") {
|
|
|
let res: any = await getStoreDetail({ id: id.value } as any);
|
|
|
- storeInfoModel.value = res.data as any;
|
|
|
+ storeInfoModel.value = { ...storeInfoModel.value, ...res.data.lifeGroupBuyMain };
|
|
|
let imageList: any[] = [];
|
|
|
handleImageParam((res.data as any).businessLicenseAddress || [], imageList);
|
|
|
storeInfoModel.value.imageList = imageList;
|
|
|
+ storeInfoModel.value.expirationDateList = storeInfoModel.value.expirationDateList.split(";");
|
|
|
+ storeInfoModel.value.invoiceInformation = storeInfoModel.value.invoiceType.split(";");
|
|
|
// 确保星期和节日字段存在
|
|
|
- if (!storeInfoModel.value.unavailableWeekdays) {
|
|
|
- storeInfoModel.value.unavailableWeekdays = [];
|
|
|
- }
|
|
|
- if (!storeInfoModel.value.unavailableHolidays) {
|
|
|
- storeInfoModel.value.unavailableHolidays = [];
|
|
|
- }
|
|
|
- // 确保套餐内容字段存在
|
|
|
+ const listVal = storeInfoModel.value.disableDateValue.split(";");
|
|
|
+ storeInfoModel.value.unavailableWeekdays = listVal[0].split(",");
|
|
|
+ storeInfoModel.value.unavailableHolidays = listVal[1].split(",");
|
|
|
if (res.data.lifeGroupBuyThalis && res.data.lifeGroupBuyThalis.length > 0) {
|
|
|
lifeGroupBuyThalis.value = res.data.lifeGroupBuyThalis;
|
|
|
// 确保每个分组都有必要的字段
|
|
|
@@ -1083,17 +1085,9 @@ onMounted(async () => {
|
|
|
storeInfoModel.value.disableDateList = [null];
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- // 新增模式下,如果默认选择自定义不可用日期,确保disableDateList至少有一个元素
|
|
|
- if (storeInfoModel.value.disableDateType === 2) {
|
|
|
- if (!storeInfoModel.value.disableDateList || storeInfoModel.value.disableDateList.length === 0) {
|
|
|
- storeInfoModel.value.disableDateList = [null];
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
});
|
|
|
// ==================== 事件处理函数 ====================
|
|
|
-
|
|
|
/**
|
|
|
* 返回上一页
|
|
|
*/
|