Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ElectricitySheep
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄媛媛
ElectricitySheep
Commits
4e584b59
Commit
4e584b59
authored
Jun 22, 2020
by
zhangjianguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详情
parent
e97b24b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
164 additions
and
66 deletions
+164
-66
goodsListEdit.vue
src/components/CommodityMan/goodsListEdit.vue
+164
-66
No files found.
src/components/CommodityMan/goodsListEdit.vue
View file @
4e584b59
...
...
@@ -1246,7 +1246,7 @@
</div>
<el-table
ref=
"table"
:data=
"disList2"
:data=
"disList2
.length>0?disList2:[]
"
border
style=
"width: 100%"
@
selection-change=
"TbaleSelectionChange3"
...
...
@@ -2019,12 +2019,6 @@
this
.
GoodsId
=
this
.
$route
.
query
.
GoodsId
;
this
.
getData
();
}
// this.getTree();
// this.getService();
// this.getRule();
// this.getSpeciList();
// this.getDistributor();
// this.gethuiyList();
},
methods
:
{
...
...
@@ -2079,6 +2073,7 @@
this
.
Error
(
"已开始和平分销,请在和平分销里面配置!"
);
this
.
addMsg
.
SeparateDistribution
=
0
;
}
},
//
HySet
()
{
...
...
@@ -2214,6 +2209,8 @@
butionType
(
val
)
{},
// 删除规格模板
DeleteggModule
(
item
,
index
)
{
this
.
ComTreeList
=
[];
this
.
memberList2
=
[];
this
.
SpecificationList
.
splice
(
index
,
1
);
if
(
this
.
SpecificationList
.
length
==
0
)
{
this
.
addMsg
.
SeparateDistributionType
=
1
;
...
...
@@ -2247,10 +2244,13 @@
// 添加规格模板
addggxm
()
{
let
that
=
this
;
let
obj
=
{
Name
:
""
,
SpecificationValueList
:
[],
Sort
:
that
.
SpecificationList
.
length
Sort
:
that
.
SpecificationList
.
length
+
1
,
Id
:
0
,
EnabledImage
:
2
};
this
.
SpecificationList
.
push
(
obj
);
},
...
...
@@ -2263,13 +2263,22 @@
Sort
:
item
.
SpecificationValueList
.
length
+
1
};
this
.
SpecificationList
[
index
].
SpecificationValueList
.
push
(
obj
);
},
// 修改规格值
ggzChange
()
{
this
.
$forceUpdate
();
this
.
ComTreeList
=
[];
this
.
memberList2
=
[];
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
},
// 值
ggzChange2
()
{
// this.$forceUpdate();
// this.skuList = [];
// this.getSkuData([], 0, this.SpecificationValueList.);
},
chooseSpecificationValueList
()
{
if
(
!
this
.
SpecificationList
)
{
this
.
SpecificationList
=
[];
...
...
@@ -2291,34 +2300,39 @@
list
.
Sort
=
index2
;
});
});
this
.
ComTreeList
=
[];
this
.
memberList2
=
[]
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
this
.
speciDig
=
false
;
},
getSkuData
(
skuArr
=
[],
i
,
list
)
{
if
(
list
[
i
])
{
for
(
let
j
=
0
;
j
<
list
[
i
].
SpecificationValueList
.
length
;
j
++
)
{
skuArr
[
i
]
=
{};
if
(
i
<
list
.
length
-
1
)
{
skuArr
[
i
].
SName
=
list
[
i
].
Name
;
skuArr
[
i
].
SVName
=
list
[
i
].
SpecificationValueList
[
j
].
Name
;
skuArr
[
i
].
SVId
=
list
[
i
].
SpecificationValueList
[
j
].
Sort
;
this
.
getSkuData
(
skuArr
,
i
+
1
,
list
);
// 递归循环
}
else
{
skuArr
[
i
].
SName
=
list
[
i
].
Name
;
skuArr
[
i
].
SVName
=
list
[
i
].
SpecificationValueList
[
j
].
Name
;
skuArr
[
i
].
SVId
=
list
[
i
].
SpecificationValueList
[
j
].
Sort
;
this
.
skuList
.
push
([...
skuArr
]);
// 扩展运算符,连接两个数组
const
testyunx
=
(
skuArr
=
[],
i
,
list
)
=>
{
if
(
list
[
i
])
{
for
(
let
j
=
0
;
j
<
list
[
i
].
SpecificationValueList
.
length
;
j
++
)
{
skuArr
[
i
]
=
{};
if
(
i
<
list
.
length
-
1
)
{
skuArr
[
i
].
SName
=
list
[
i
].
Name
;
skuArr
[
i
].
SVName
=
list
[
i
].
SpecificationValueList
[
j
].
Name
;
skuArr
[
i
].
SVId
=
list
[
i
].
SpecificationValueList
[
j
].
Sort
;
testyunx
(
skuArr
,
i
+
1
,
list
);
// 递归循环
}
else
{
skuArr
[
i
].
SName
=
list
[
i
].
Name
;
skuArr
[
i
].
SVName
=
list
[
i
].
SpecificationValueList
[
j
].
Name
;
skuArr
[
i
].
SVId
=
list
[
i
].
SpecificationValueList
[
j
].
Sort
;
this
.
skuList
.
push
([...
skuArr
]);
// 扩展运算符,连接两个数组
}
}
}
}
testyunx
(
skuArr
,
i
,
list
)
this
.
calcList
(
this
.
skuList
,
this
.
SpecificationList
);
},
calcList
(
list
,
calist
)
{
let
oldArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
SpecificationPriceList
))
this
.
SpecificationPriceList
=
[];
let
arrList
=
[];
list
.
forEach
(
item
=>
{
item
.
AttrList
=
[];
...
...
@@ -2346,6 +2360,7 @@
list
.
forEach
((
item
,
i
)
=>
{
let
obj
=
{};
obj
=
{
isNoExite
:
true
,
AttrList
:
item
.
AttrList
,
SpecificationSort
:
item
.
SpecificationSort
,
GoodsNumbers
:
item
.
GoodsNumbers
,
...
...
@@ -2353,10 +2368,14 @@
InventoryNum
:
item
.
InventoryNum
,
SellingPrice
:
item
.
SellingPrice
};
oldArr
.
forEach
(
val
=>
{
// console.log(val.SpecificationSort,item.SpecificationSort)
if
(
val
.
SpecificationSort
==
item
.
SpecificationSort
){
obj
=
{
isNoExite
:
false
,
AttrList
:
item
.
AttrList
,
// Id:0,
SpecificationSort
:
val
.
SpecificationSort
,
GoodsNumbers
:
val
.
GoodsNumbers
,
GoodsWeight
:
val
.
GoodsWeight
,
...
...
@@ -2366,6 +2385,7 @@
}
})
this
.
SpecificationPriceList
.
push
(
obj
);
let
obj1
=
{
...
...
@@ -2376,48 +2396,126 @@
};
arrList
.
push
(
obj1
);
});
this
.
calcdis
(
JSON
.
parse
(
JSON
.
stringify
(
arrList
)));
},
calcdis
(
dislist
)
{
let
memberList
2
=
JSON
.
parse
(
JSON
.
stringify
(
dislist
));
let
memberList
array
=
JSON
.
parse
(
JSON
.
stringify
(
dislist
));
let
ComTreeList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
ComTreeList
));
this
.
ComTreeList
=
[];
dislist
.
forEach
(
item
=>
{
item
.
GradeCommissionList
=
[];
for
(
let
i
=
0
;
i
<
this
.
DropdownList
.
length
;
i
++
)
{
// this.ComTreeList=[];//无法添加 报错 暂时注释掉
for
(
let
i
=
0
;
i
<
dislist
.
length
;
i
++
){
if
(
this
.
addMsg
.
SeparateDistributionType
==
2
&&
this
.
ComTreeList
.
length
>
0
){
//this.ComTreeList.length为0 的时候 全部为空
if
(
i
<
ComTreeList
.
length
){
// dislist[i].GradeCommissionList = [];
ComTreeList
.
forEach
((
val
,
z
)
=>
{
if
(
val
.
SpecificationSort
==
dislist
[
i
].
SpecificationSort
){
dislist
[
i
].
GradeCommissionList
=
[];
dislist
[
i
].
GradeCommissionList
=
val
.
GradeCommissionList
;
}
ComTreeList
.
forEach
(
val
=>
{
})
}
else
{
for
(
let
j
=
0
;
j
<
this
.
DropdownList
.
length
;
j
++
)
{
let
obj
=
{
SpecificationSort
:
dislist
[
i
].
SpecificationSort
,
DistributorGrade
:
this
.
DropdownList
[
j
].
Id
,
OneCommission
:
0
,
TwoCommission
:
0
,
ThreeCommission
:
0
,
Name
:
dislist
[
i
].
Name
};
dislist
[
i
].
GradeCommissionList
.
push
(
obj
);
}
}
}
else
{
for
(
let
j
=
0
;
j
<
this
.
DropdownList
.
length
;
j
++
)
{
let
obj
=
{
SpecificationSort
:
item
.
SpecificationSort
,
DistributorGrade
:
this
.
DropdownList
[
i
].
Id
,
SpecificationSort
:
dislist
[
i
]
.
SpecificationSort
,
DistributorGrade
:
this
.
DropdownList
[
j
].
Id
,
OneCommission
:
0
,
TwoCommission
:
0
,
ThreeCommission
:
0
,
Name
:
item
.
Name
Name
:
dislist
[
i
]
.
Name
};
item
.
GradeCommissionList
.
push
(
obj
);
if
(
val
.
SpecificationSort
==
item
.
SpecificationSort
){
item
.
GradeCommissionList
=
[];
item
.
GradeCommissionList
=
val
.
GradeCommissionList
;
}
})
dislist
[
i
].
GradeCommissionList
.
push
(
obj
);
}
}
});
memberList2
.
forEach
(
item
=>
{
item
.
GradePriceList
=
[];
for
(
let
i
=
0
;
i
<
this
.
huiyList
.
length
;
i
++
)
{
let
obj
=
{
MemberGrade
:
this
.
huiyList
[
i
].
Grade
,
MemberPrice
:
""
};
item
.
GradePriceList
.
push
(
obj
);
}
//以前的逻辑 暂时保留 6.22
// dislist.forEach(item => {
// item.GradeCommissionList = [];
// // for (let i = 0; i
<
this
.
DropdownList
.
length
;
i
++
)
{
// // let obj = {
// // SpecificationSort:item.SpecificationSort,
// // DistributorGrade: this.DropdownList[i].Id,
// // OneCommission: 0,
// // TwoCommission: 0,
// // ThreeCommission: 0,
// // Name: item.Name
// // };
// // item.GradeCommissionList.push(obj);
// ComTreeList.forEach(val=>{
//
// // if(val.SpecificationSort==item.SpecificationSort){
// // item.GradeCommissionList=[];
// // item.GradeCommissionList=val.GradeCommissionList;
// // }
// })
//
// // }
// });
// console.log('memberListarray',memberListarray)
// console.log('this.memberList2',this.memberList2)
// console.log('this.huiyList',this.huiyList)
for
(
let
i
=
0
;
i
<
memberListarray
.
length
;
i
++
){
memberListarray
[
i
].
GradePriceList
=
[];
if
(
this
.
addMsg
.
EnjoyMember
==
1
&&
this
.
memberList2
.
length
>
0
){
if
(
i
<
this
.
memberList2
.
length
){
this
.
memberList2
.
forEach
(
val
=>
{
if
(
val
.
SpecificationSort
==
memberListarray
[
i
].
SpecificationSort
){
memberListarray
[
i
].
GradePriceList
=
[];
memberListarray
[
i
].
GradePriceList
=
val
.
GradePriceList
;
}
})
}
else
{
for
(
let
j
=
0
;
j
<
this
.
huiyList
.
length
;
j
++
)
{
let
obj
=
{
MemberGrade
:
this
.
huiyList
[
j
].
Grade
,
MemberPrice
:
0
};
memberListarray
[
i
].
GradePriceList
.
push
(
obj
);
}
}
}
else
{
for
(
let
j
=
0
;
j
<
this
.
huiyList
.
length
;
j
++
)
{
let
obj
=
{
MemberGrade
:
this
.
huiyList
[
j
].
Grade
,
MemberPrice
:
0
};
memberListarray
[
i
].
GradePriceList
.
push
(
obj
);
}
}
});
}
// memberListarray.forEach(item => {
// item.GradePriceList = [];
// for (let i = 0; i
<
this
.
huiyList
.
length
;
i
++
)
{
// let obj = {
// MemberGrade: this.huiyList[i].Grade,
// MemberPrice: 0
// };
// item.GradePriceList.push(obj);
// }
// });
this
.
disList2
=
JSON
.
parse
(
JSON
.
stringify
(
dislist
));
console
.
log
(
"this.disList2 "
,
this
.
disList2
)
this
.
memberList2
=
JSON
.
parse
(
JSON
.
stringify
(
memberList2
));
this
.
memberList2
=
JSON
.
parse
(
JSON
.
stringify
(
memberListarray
));
},
addggModeule
()
{
this
.
speciDig
=
true
;
...
...
@@ -2454,17 +2552,16 @@
}
else
{
this
.
addMsg
.
DistributionCommissionList
=
this
.
disList2
;
}
if
(
this
.
addMsg
.
SeparateSetMember
==
1
&&
this
.
SpecificationList
.
length
==
0
)
{
if
(
this
.
addMsg
.
SeparateSetMember
==
1
&&
this
.
SpecificationList
.
length
==
0
)
{
this
.
addMsg
.
MemberPriceList
=
this
.
memberList1
;
this
.
addMsg
.
MemberPriceTreeList
=
this
.
memberList1
;
}
if
(
this
.
addMsg
.
SeparateSetMember
==
1
&&
this
.
SpecificationList
.
length
>
0
)
{
if
(
this
.
addMsg
.
SeparateSetMember
==
1
&&
this
.
SpecificationList
.
length
>
0
)
{
this
.
addMsg
.
MemberPriceList
=
this
.
memberList2
;
this
.
addMsg
.
MemberPriceTreeList
=
this
.
memberList2
;
}
if
(
this
.
SupplierId
==
''
){
this
.
Error
(
'请选择供应商'
);
...
...
@@ -2474,6 +2571,7 @@
}
this
.
addMsg
.
SpecificationPriceList
=
this
.
SpecificationPriceList
;
this
.
addMsg
.
SpecificationList
=
this
.
SpecificationList
;
this
.
apipost
(
"/api/product/SetProductGoodsInfo"
,
this
.
addMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
Success
(
res
.
data
.
message
);
...
...
@@ -2688,7 +2786,6 @@
this
.
initShareSettings
();
this
.
SpecificationPriceList
=
this
.
addMsg
.
SpecificationPriceList
;
this
.
ComTreeList
=
this
.
addMsg
.
DistributionCommissionTreeList
;
// console.log(this.SpecificationPriceList)
this
.
SpecificationList
=
this
.
addMsg
.
SpecificationList
;
if
(
this
.
addMsg
.
SeparateDistributionType
==
1
)
{
this
.
disList1
=
this
.
addMsg
.
DistributionCommissionTreeList
;
...
...
@@ -2696,10 +2793,10 @@
this
.
GradeCommissionList
=
this
.
addMsg
.
DistributionCommissionTreeList
[
0
].
GradeCommissionList
;
}
}
if
(
this
.
addMsg
.
SeparateDistributionType
==
2
)
{
// this.disList2 = this.addMsg.DistributionCommissionTreeList;
this
.
getDistributor
();
}
this
.
memberList2
=
this
.
addMsg
.
MemberPriceTreeList
;
// if (this.addMsg.SeparateDistributionType == 2) {
//
this.getDistributor();
//
}
this
.
thisType
=
1
;
this
.
disList1
=
[];
...
...
@@ -2772,6 +2869,7 @@
});
},
getDistributor
()
{
this
.
loading
=
true
;
this
.
apipost
(
"/api/user/GetDistributorBasicsInfo"
,
{},
res
=>
{
this
.
loading
=
false
;
...
...
@@ -2793,7 +2891,7 @@
Id
:
0
,
Grade
:
0
,
Name
:
""
,
Enabled
:
0
Enabled
:
1
};
this
.
apipost
(
"/api/user/GetDistributorGradeDropdownList"
,
msg
,
res
=>
{
this
.
DropdownList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
data
));
...
...
@@ -2821,10 +2919,12 @@
}
});
this
.
DropdownList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
DropdownList
));
if
(
!
this
.
$route
.
query
.
GoodsId
||
this
.
addMsg
.
DistributionCommissionTreeList
.
length
==
0
||
this
.
thisType
==
1
)
{
this
.
GradeCommissionList
=
[];
this
.
DropdownList
.
forEach
(
item
=>
{
let
obj2
=
{
...
...
@@ -2855,14 +2955,12 @@
};
this
.
disList1
.
push
(
objNew
);
}
console
.
log
(
"this.disList1"
,
this
.
disList1
)
this
.
skuList
=
[];
this
.
getSkuData
([],
0
,
this
.
SpecificationList
);
}
});
},
changeSupplier
(
val
){
console
.
log
(
val
)
},
getSupplierList
(){
this
.
apipost
(
"/api/Supplier/GetSupplierAllList"
,
{},
res
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment