|
@@ -209,6 +209,17 @@ var vm = new Vue({
|
|
|
getInputArr:function(){
|
|
|
let uuidLink = []
|
|
|
var arr = []
|
|
|
+ function pushArr (arr, uuidLink , inputVal) {
|
|
|
+ let item = vm.inputArr.find(item => item.uuidLink === uuidLink)
|
|
|
+ console.log(item)
|
|
|
+ if (item) {
|
|
|
+ arr.push(item)
|
|
|
+ } else {
|
|
|
+ arr.push(Object.assign(inputVal,{
|
|
|
+ uuidLink
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ }
|
|
|
this.ggContent.forEach(function (item){
|
|
|
uuidLink = []
|
|
|
|
|
@@ -220,28 +231,21 @@ var vm = new Vue({
|
|
|
sub.subItems.forEach(function(last){
|
|
|
uuidLink[2] = last.uuid
|
|
|
if (!last.subItems) {
|
|
|
- arr.push(Object.assign({},{
|
|
|
- uuidLink:uuidLink.join('_')
|
|
|
- },last.inputVal))
|
|
|
+ pushArr(arr, uuidLink.join('_'), last.inputVal)
|
|
|
uuidLink.pop()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
else{
|
|
|
- arr.push(Object.assign({},{
|
|
|
- uuidLink:uuidLink.join('_')
|
|
|
- },sub.inputVal))
|
|
|
+ pushArr(arr, uuidLink.join('_'), sub.inputVal)
|
|
|
uuidLink.pop()
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
- arr.push(Object.assign({},{
|
|
|
- uuidLink:uuidLink.join('_')
|
|
|
- },item.inputVal))
|
|
|
+ pushArr(arr, uuidLink.join('_'), item.inputVal)
|
|
|
uuidLink.pop()
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
this.inputArr = arr
|
|
|
},
|
|
|
showArrsds:function () {
|
|
@@ -312,13 +316,14 @@ var vm = new Vue({
|
|
|
let itm = []
|
|
|
let goodsSpecificationList = []
|
|
|
this.ggname = []
|
|
|
+ console.log(this.guigeArr)
|
|
|
this.guigeArr.forEach(function(item,idx){
|
|
|
itm = []
|
|
|
item.val.forEach(function(sub,i){
|
|
|
let tt= {
|
|
|
value:sub.name,
|
|
|
picUrl:sub.picUrl||'',
|
|
|
- uuid:sub.uuid||((idx+1)+'-'+(i+1)),
|
|
|
+ uuid: sub.uuid||((idx+1)+'-'+(i+1)),
|
|
|
specificationId: item.specificationId,
|
|
|
inputVal:{
|
|
|
goodsNumber:'',
|
|
@@ -347,7 +352,6 @@ var vm = new Vue({
|
|
|
}
|
|
|
|
|
|
})
|
|
|
-
|
|
|
this.ggContent = tmp[0]
|
|
|
this.goodsSpecificationList = goodsSpecificationList
|
|
|
this.getInputArr()
|
|
@@ -678,12 +682,11 @@ var vm = new Vue({
|
|
|
var productList = r.goods.productList.sort(function(a, b) {
|
|
|
var a_uuid_sort = vm.countProductSort(a.uuidLink)
|
|
|
var b_uuid_sort = vm.countProductSort(b.uuidLink)
|
|
|
- console.log(a_uuid_sort, b_uuid_sort)
|
|
|
return a_uuid_sort - b_uuid_sort
|
|
|
|
|
|
})
|
|
|
vm.inputArr = productList
|
|
|
-
|
|
|
+ vm.goodsSpecificationList = r.goods.goodsSpecificationList
|
|
|
vm.guigeArr = JSON.parse(r.goods.guigeArr) || []
|
|
|
vm.ggContent = JSON.parse(r.goods.ggContent)
|
|
|
vm.ggname = []
|