This commit is contained in:
qiaopengfei 2024-07-26 13:43:42 +08:00
parent a266434c05
commit 2d03273085
2 changed files with 8 additions and 8 deletions

View File

@ -213,7 +213,7 @@ const submitForm = () => {
return ElMessage.warning("没有添加任何规格属性!"); return ElMessage.warning("没有添加任何规格属性!");
if (!specification_list.value.every((item) => item.valueGrop.length)) if (!specification_list.value.every((item) => item.valueGrop.length))
return ElMessage.warning("添加规格后至少添加一个属性值!"); return ElMessage.warning("添加规格后至少添加一个属性值!");
$emit("specificationSubmit", specification_list); $emit("specificationSubmit", specification_list.value);
specificationClose(); specificationClose();
}; };
const specificationClose = () => { const specificationClose = () => {

View File

@ -951,7 +951,7 @@ const specificationClose = () => {
}; };
const specificationSubmit = (row) => { const specificationSubmit = (row) => {
ruleFormRef.value.resetFields(); ruleFormRef.value.resetFields();
if (!row._value) return; if (!row) return;
const specification_list = []; const specification_list = [];
const tabelList = []; const tabelList = [];
priceList.fixPrice = [ priceList.fixPrice = [
@ -970,7 +970,7 @@ const specificationSubmit = (row) => {
label: "编辑", label: "编辑",
handler: () => { handler: () => {
priceList.specificationDialogVisible = true; priceList.specificationDialogVisible = true;
priceList.specification_arr = row._value; priceList.specification_arr = row;
}, },
}, },
{ {
@ -1023,13 +1023,13 @@ const specificationSubmit = (row) => {
{ {
type: "el-table", type: "el-table",
label: "销售规格", label: "销售规格",
tableData: generateCombinations(row._value), tableData: generateCombinations(row),
new_tableData: generateCombinations(row._value), new_tableData: generateCombinations(row),
tabelList: [ tabelList: [
{ {
label: "售价", label: "售价",
params: "price", params: "price",
keydown: (e, data,el) => { keydown: (e, data, el) => {
if (e.key !== "Enter") return; if (e.key !== "Enter") return;
data.tableData.forEach((item) => { data.tableData.forEach((item) => {
item.price = el.search; item.price = el.search;
@ -1066,7 +1066,7 @@ const specificationSubmit = (row) => {
options: [{ label: "888", value: 6 }], options: [{ label: "888", value: 6 }],
}, },
]; ];
row._value.forEach((item) => { row.forEach((item) => {
specification_list.push({ key: item.label, value: item.valueGrop }); specification_list.push({ key: item.label, value: item.valueGrop });
tabelList.push({ tabelList.push({
@ -1121,7 +1121,7 @@ const specificationSubmit = (row) => {
priceList.fixPrice.map((item) => { priceList.fixPrice.map((item) => {
console.log(item, "itemmm"); console.log(item, "itemmm");
if (item.type === "edit") { if (item.type === "edit") {
item.specification_list =specification_list; item.specification_list = specification_list;
} else if (item.type === "el-table") { } else if (item.type === "el-table") {
item.tabelList = [...tabelList, ...item.tabelList]; item.tabelList = [...tabelList, ...item.tabelList];
} }