|
@@ -453,21 +453,25 @@ export default {
|
|
|
onSubmit() {
|
|
|
this.pickCategory = []
|
|
|
this.frontCategory = []
|
|
|
- this.dataList.map(k => {
|
|
|
- this.categoryArr.map(i => {
|
|
|
- if (i === k.id) {
|
|
|
- if (k.isFront) {
|
|
|
- this.frontCategory.push(i)
|
|
|
+ if (this.categoryArr.length) {
|
|
|
+ for (let i = 0; i < this.dataList.length; i++) {
|
|
|
+ const item = this.dataList[i]
|
|
|
+ for (let j = 0; j < this.categoryArr.length; j++) {
|
|
|
+ const category = this.categoryArr[j]
|
|
|
+ if (category === item.id) {
|
|
|
+ if (item.isFront) {
|
|
|
+ this.frontCategory.push(category)
|
|
|
+ }
|
|
|
+ if (item.isPick) {
|
|
|
+ this.pickCategory.push(category)
|
|
|
+ }
|
|
|
}
|
|
|
- if (k.isPick) {
|
|
|
- this.pickCategory.push(i)
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$errorMsg('必须选择产品类别')
|
|
|
- return
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$errorMsg('必须选择产品类别')
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
updatePick({
|
|
|
id: this.detailsId,
|