|
|
|
@ -130,9 +130,6 @@ |
|
|
|
@change="GoodsNumChange($event,value,values[0])" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="values[1].isPoint" style="text-align: center;background: #eee;height: 80rpx;line-height: 100rpx;color:red;"> |
|
|
|
↑↑ 改动在这里 ↑↑ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -791,9 +788,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount |
|
|
|
} |
|
|
|
|
|
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
@ -810,9 +805,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount |
|
|
|
} |
|
|
|
|
|
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
@ -834,9 +827,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount |
|
|
|
} |
|
|
|
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -871,9 +862,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum != undefined?this.carList1[i].saleDetailQueryDTO[m].productNum : this.carList1[i].saleDetailQueryDTO[m].stockCount |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
|
|
|
|
@ -957,9 +946,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1) |
|
|
|
obj.productCount += this.carList1[i].stockLogList1[m].productCount |
|
|
|
@ -976,9 +963,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList.get(this.carList1[i].productId).stockLogList.get(this.carList1[i].stockLogList1[m].attributeList).productCount + this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount |
|
|
|
} |
|
|
|
|
|
|
|
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1) |
|
|
|
@ -987,9 +972,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount |
|
|
|
} |
|
|
|
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -1025,9 +1008,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: this.carList1[i].stockLogList1[m].productCount, |
|
|
|
name: this.sliceMsg(this.carList1[i].stockLogList1[m].attributeList), |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:this.carList1[i].stockLogList1[m].stockCount |
|
|
|
} |
|
|
|
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1) |
|
|
|
|
|
|
|
@ -1147,70 +1128,48 @@ |
|
|
|
this.$refs.getaPopup.open() |
|
|
|
}, |
|
|
|
//点击某一个规格,可修改 |
|
|
|
changeSpec(item){ |
|
|
|
async changeSpec(item){ |
|
|
|
let that = this; |
|
|
|
if(item == ''){ |
|
|
|
this.tui.toast('请输入要修改的规格值') |
|
|
|
return; |
|
|
|
} |
|
|
|
let data = this.temporary |
|
|
|
let specMap = new Map() //新的临时存放值那个更改过的值的数组 |
|
|
|
let similar = '' |
|
|
|
this.carList.get(data[0]).stockLogList.forEach(function(value, key) { |
|
|
|
value.isPoint = false |
|
|
|
let specMap = new Map() //新的临时存放值那个更改过的值的map |
|
|
|
await this.carList.get(data[0]).stockLogList.forEach(function(value, key) { |
|
|
|
if(key == data[1]){ |
|
|
|
let stringKey = key.replace(data[3],item) //拿到了更改过的key |
|
|
|
if(specMap.has(stringKey)== true){ |
|
|
|
data[1] = stringKey |
|
|
|
|
|
|
|
specMap.get(stringKey).name = that.sliceMsg(stringKey) |
|
|
|
specMap.get(stringKey).productCount += value.productCount |
|
|
|
}else{ |
|
|
|
data[1] = stringKey |
|
|
|
|
|
|
|
specMap.set(stringKey,value) |
|
|
|
specMap.get(stringKey).name = that.sliceMsg(stringKey) |
|
|
|
} |
|
|
|
that.tui.request("/app/stock/productCount", "post", { |
|
|
|
productId: that.carList.get(data[0]).productId, |
|
|
|
attributeList: stringKey |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
value.productNum = res.result |
|
|
|
if(specMap.has(stringKey) == true){ //当前的数据中有相同的值 |
|
|
|
similar = specMap.get(stringKey).uuid |
|
|
|
specMap.get(stringKey).isPoint = true |
|
|
|
specMap.get(stringKey).productCount += value.productCount |
|
|
|
}else{ |
|
|
|
value.uuid = 'A'+generateUUID(); |
|
|
|
value.isPoint = true |
|
|
|
specMap.set(stringKey,value) //name的值没有改,所有的数组都放在这个下面 |
|
|
|
} |
|
|
|
that.$forceUpdate() |
|
|
|
that.carList.get(data[0]).stockLogList.delete(data[1]) |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
that.$nextTick(()=>{ |
|
|
|
setTimeout(res => { |
|
|
|
if(similar != ''){ |
|
|
|
that.currentAnchor = '#'+similar; |
|
|
|
}else{ |
|
|
|
that.currentAnchor = '#'+value.uuid; |
|
|
|
} |
|
|
|
|
|
|
|
}, 200) |
|
|
|
}) |
|
|
|
that.$nextTick(()=>{ |
|
|
|
setTimeout(res => { |
|
|
|
that.currentAnchor = "" |
|
|
|
similar = '' |
|
|
|
|
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
specMap.set(key,value) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(this.carList.get(data[0]).stockLogList.size > 0){ |
|
|
|
this.carList.get(data[0]).stockLogList.forEach(function(value, key) { |
|
|
|
specMap.set(key,value) |
|
|
|
}) |
|
|
|
} |
|
|
|
this.carList.get(data[0]).stockLogList = specMap |
|
|
|
setTimeout(res => { |
|
|
|
|
|
|
|
await that.$nextTick(()=>{ |
|
|
|
this.carList.get(data[0]).stockLogList = specMap |
|
|
|
this.$forceUpdate() |
|
|
|
this.$refs.getaPopup.close() |
|
|
|
}, 200) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
//销售员列表 |
|
|
|
@ -2023,9 +1982,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
} |
|
|
|
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
@ -2035,44 +1992,29 @@ |
|
|
|
carList1 = [] |
|
|
|
|
|
|
|
} else { //当前页有数据 |
|
|
|
console.log(carList1) |
|
|
|
console.log(this.carList) |
|
|
|
for (let i = 0; i < carList1.length; i++) { |
|
|
|
if(this.carList.has(carList1[i].id) == true){ |
|
|
|
this.carList.get(carList1[i].id).stockLogList = new Map() |
|
|
|
} |
|
|
|
if (this.carList.has(carList1[i].id) == true) { //商品相同 |
|
|
|
this.carList.get(carList1[i].id).productCount = 0 |
|
|
|
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) { |
|
|
|
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i] |
|
|
|
.saleDetailQueryDTO[ |
|
|
|
m].attributeList) == true) { //规格相同 |
|
|
|
// var data1 = { |
|
|
|
// productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
// name: this.carList1[i].saleDetailQueryDTO[m].name |
|
|
|
// } |
|
|
|
|
|
|
|
// this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
|
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
} |
|
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, data1) |
|
|
|
// this.carList.get(carList1[i].id).stockLogList.set(carList1[i] |
|
|
|
// .saleDetailQueryDTO[ |
|
|
|
// m].attributeList, this.carList.get(carList1[i].id).stockLogList.get( |
|
|
|
// carList1[i].saleDetailQueryDTO[m].attributeList) + carList1[i] |
|
|
|
// .saleDetailQueryDTO[m].productCount) |
|
|
|
|
|
|
|
} else { //规格不同 |
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
} |
|
|
|
this.carList.get(carList1[i].id).stockLogList.set(carList1[i].saleDetailQueryDTO[ |
|
|
|
m].attributeList, data1) |
|
|
|
@ -2107,9 +2049,7 @@ |
|
|
|
var data1 = { |
|
|
|
productCount: carList1[i].saleDetailQueryDTO[m].productCount, |
|
|
|
name: carList1[i].saleDetailQueryDTO[m].name, |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum, |
|
|
|
uuid:'A'+generateUUID(), |
|
|
|
isPoint:false |
|
|
|
productNum:carList1[i].saleDetailQueryDTO[m].productNum |
|
|
|
} |
|
|
|
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1) |
|
|
|
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount |
|
|
|
|