From bad27514f380b9270ceeafb933746fed4ac1affc Mon Sep 17 00:00:00 2001
From: duan <1004387497@qq.com>
Date: Mon, 24 Feb 2025 09:44:05 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/product/indexconfig/addgoods.vue | 62 +++++++++++++---------
1 file changed, 37 insertions(+), 25 deletions(-)
diff --git a/src/views/product/indexconfig/addgoods.vue b/src/views/product/indexconfig/addgoods.vue
index f356059..02880a5 100644
--- a/src/views/product/indexconfig/addgoods.vue
+++ b/src/views/product/indexconfig/addgoods.vue
@@ -137,7 +137,7 @@
- 添加套餐组
+ 添加套餐组
@@ -335,11 +335,11 @@ interface RuleForm {
coverImg: string,
images: string[],
type: string,
- specId: string,
+ specId: any,
groupType: string,
skuList: string[],
- weight: Number,
- isAllowTempModifyPrice: Number,
+ weight: any,
+ isAllowTempModifyPrice: any,
days: string[],
useTime: string[],
startTime: string,
@@ -347,10 +347,11 @@ interface RuleForm {
isSale: string,
isStock: string,
isHot: string,
- stockNumber: Number,
- packFee: Number,
+ stockNumber: any,
+ packFee: any,
sort: Number,
proGroupVo: any[],
+ selectSpecInfo: any
}
const ruleFormRef = ref()
const ruleForm = reactive({
@@ -404,6 +405,7 @@ const ruleForm = reactive({
packFee: 0,
// 排序值
sort: 1,
+ selectSpecInfo: {}
})
const rules = reactive>({
name: [
@@ -509,14 +511,14 @@ function selectShopRes(res: Array) {
// this.form.proGroupVo[this.addGroupIndex].count = newres.length
// this.form.proGroupVo[this.addGroupIndex].goods = newres
// } else {
- // let arr = [...this.form.proGroupVo]
- // arr.push({
- // title: '',
- // count: newres.length,
- // number: '',
- // goods: newres
- // })
- // this.form.proGroupVo = [...arr]
+ let arr = [...ruleForm.proGroupVo]
+ arr.push({
+ title: '',
+ count: newres.length,
+ number: '',
+ goods: newres
+ })
+ ruleForm.proGroupVo = [...arr]
// }
}
}
@@ -544,7 +546,10 @@ function createSkuHeader() {
}
datas.specTableHeaders = headers;
}
-
+// 可选套餐弹窗
+function addtaocan() {
+ (shopListRef.value as any)?.opens()
+}
// 生成多规格表体
function createSkuBody() {
let bodys = [];
@@ -615,19 +620,20 @@ function changeTypeEnum(item: string) {
}
}
// 笛卡尔积算法
-function cartesian(arr: any) {
+function cartesian(arr: any[]) {
if (arr.length < 2) return arr[0] || [];
- return [].reduce.call(arr, (col, set) => {
- let res = [];
- col.forEach((c) => {
- set.forEach((s) => {
- let t = [].concat(Array.isArray(c) ? c : [c]);
+ return [].reduce.call(arr, (col: any, set: any, index) => {
+ let res = [];
+ col.forEach((c: any) => {
+ set.forEach((s: any) => {
+ let arr: any = Array.isArray(c) ? c : [c]
+ let t: any[] = [].concat(arr);
t.push(s);
res.push(t);
});
});
return res;
- });
+ }, []);
}
// 套餐类型切换
function typeChange() {
@@ -671,10 +677,10 @@ const submitForm = async (formEl: FormInstance | undefined) => {
ruleForm.startTime = ruleForm.useTime[0]
ruleForm.endTime = ruleForm.useTime[1]
// 拿到sku数据
- ruleForm.skuList = specificationAttributeRef.value.getdata()
+ ruleForm.skuList = (specificationAttributeRef.value as any)?.getdata()
// 多规格 selectSpecInfo 添加
if (ruleForm.type == 'sku') {
- let obj = {}
+ let obj: any = {}
datas.selectSpeclist.forEach((item: any) => {
obj[item.name] = item.selectSpecResult
})
@@ -717,7 +723,7 @@ function closeSelectedTag(view: TagView) {
// 规格id过滤
const specIdFunction = (type: string) => {
if (type === 'single') {
- return null
+ return ''
} else if (type === '2') {
return 2
} else if (type === '3') {
@@ -781,4 +787,10 @@ const resetForm = (formEl: FormInstance | undefined) => {
}
}
}
+
+.group_wrap {
+ padding: 20px;
+ background-color: #F7F7FA;
+ margin-bottom: 20px;
+}
\ No newline at end of file