This commit is contained in:
余同学 2024-09-01 17:33:10 +08:00
parent b691702778
commit 7375f33dcf
3 changed files with 29 additions and 14 deletions

View File

@ -118,13 +118,6 @@ export default {
></el-input-number> ></el-input-number>
<span> 提示 请输入9.9数字 :8=售价*0.8</span> <span> 提示 请输入9.9数字 :8=售价*0.8</span>
</div> </div>
// <el-input
// type="number"
// min={0}
// max={9.9}
// v-model={this.modalData.discount}
// placeholder="9.9 :8=*0.8"
// ></el-input>
); );
}, },
}, },
@ -133,7 +126,7 @@ export default {
prop: "limitCount", prop: "limitCount",
type: "Input", type: "Input",
width: "300px", width: "300px",
// rules: { required: true, message: "" }, rules: { required: true, message: "请输入价格" },
type: "jsx", type: "jsx",
render: () => { render: () => {
return ( return (

View File

@ -288,6 +288,8 @@ export default {
}, },
// //
getSpecs(tableData, AttributeData, salePrice, stockNum) { getSpecs(tableData, AttributeData, salePrice, stockNum) {
console.log(tableData);
this.modalData.specType = 1; this.modalData.specType = 1;
let AttributeList = AttributeData.map((item) => { let AttributeList = AttributeData.map((item) => {
return { return {

View File

@ -189,6 +189,7 @@ export default {
this.AttributeData[index].attributeValue.indexOf(tag), this.AttributeData[index].attributeValue.indexOf(tag),
1 1
); );
this.calculation();
}, },
// //
showInput(index) { showInput(index) {
@ -230,13 +231,31 @@ export default {
for (let i = 0; i < this.AttributeData.length; i++) { for (let i = 0; i < this.AttributeData.length; i++) {
if (i == 0) { if (i == 0) {
data = this.AttributeData[i].attributeValue.map((item) => { data = this.AttributeData[i].attributeValue.map((item) => {
return this.AttributeData[i].attributeName + item; return {
attributeList: [
{
attributeName: this.AttributeData[i].attributeName,
attributeValue: item,
},
],
name: item,
};
}); });
} else { } else {
data.forEach((it) => { data.forEach((it) => {
this.AttributeData[i].attributeValue.forEach((e) => { this.AttributeData[i].attributeValue.forEach((e) => {
let name = this.AttributeData[i].attributeName; console.log(it.attributeList);
list.push(it + "/" + name + e); let attributeList = JSON.parse(JSON.stringify(it.attributeList));
attributeList.push({
attributeName: this.AttributeData[i].attributeName,
attributeValue: e,
});
list.push({
attributeList,
name: it.name + e,
});
console.log(list);
// list.push(it + e);
}); });
}); });
data = list; data = list;
@ -245,7 +264,8 @@ export default {
} }
this.tableData = data.map((item) => { this.tableData = data.map((item) => {
return { return {
attributeValue: item, attributeList: item.attributeList,
attributeValue: item.name,
salePrice: 0, salePrice: 0,
costPrice: 0, costPrice: 0,
stockNum: 0, stockNum: 0,
@ -398,8 +418,8 @@ export default {
disabled: () => this.tableData.length <= 0, disabled: () => this.tableData.length <= 0,
// submit: true, // submit: true,
handle: () => { handle: () => {
let volume = "" // let volume = ""; //
let weight = "" // let weight = ""; //
let salePrice = ""; // let salePrice = ""; //
let stockNum = ""; // let stockNum = ""; //
let minSalePrice = Math.min.apply( let minSalePrice = Math.min.apply(