|
|
|
@ -117,7 +117,7 @@ |
|
|
|
</ul> |
|
|
|
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index"> |
|
|
|
<view class="shop-checkList-box"> |
|
|
|
{{item.name}} |
|
|
|
<text style="padding-right:40rpx;">{{item.name}}</text> 库存数:{{item.productNum}} |
|
|
|
</view> |
|
|
|
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" /> |
|
|
|
</view> |
|
|
|
@ -159,7 +159,7 @@ |
|
|
|
placeholder="请输入挂单名称" cancelText="删除" @confirm="setDetail" @close="dialogDel"> |
|
|
|
</uni-popup-dialog> |
|
|
|
</uni-popup> |
|
|
|
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此分类?'" showCancelButton="true" @cancel="show = false" @confirm="delItemModal"></u-modal> |
|
|
|
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此条挂单?'" showCancelButton="true" @cancel="show = false" @confirm="delItemModal"></u-modal> |
|
|
|
<!-- 查看大图弹出层 --> |
|
|
|
<uni-popup ref="imgPopup" background-color="#fff"> |
|
|
|
<view class="img-popup-content"> |
|
|
|
@ -206,7 +206,9 @@ |
|
|
|
zNum: 0, |
|
|
|
storageType: 0, |
|
|
|
hangId: '', |
|
|
|
bigImg: '' |
|
|
|
bigImg: '', |
|
|
|
productId:'', |
|
|
|
productNum:0, |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
@ -312,7 +314,8 @@ |
|
|
|
//扫一扫功能 |
|
|
|
scanCodeAdd(item) { |
|
|
|
uni.scanCode({ |
|
|
|
success: (res) => { |
|
|
|
success: (res) => { |
|
|
|
this.productId = res.result |
|
|
|
this.hangId = item.id |
|
|
|
if (item.saleDetailDTOList) { |
|
|
|
for (let i = 0; i < item.saleDetailDTOList.length; i++) { |
|
|
|
@ -329,7 +332,8 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
//点击规格选择后,下方出现所选规格和库存数 |
|
|
|
attrNameChange(index, index1) { |
|
|
|
this.goodsDetail.attributeList[index].value.forEach(item => { |
|
|
|
item.isChecked = false; |
|
|
|
@ -357,36 +361,49 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.goodsDetail.attributeList.length == jishuqi) { |
|
|
|
this.attributeList = { |
|
|
|
attributeList: JSON.stringify(obj), |
|
|
|
productCount: this.temporaryNum, |
|
|
|
name: name, |
|
|
|
price: this.purchasePrice |
|
|
|
} |
|
|
|
|
|
|
|
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { |
|
|
|
this.goodsDetail.attributeList[i].isChecked = false; |
|
|
|
for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { |
|
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.temporaryList.length == 0) { |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
} else { |
|
|
|
for (var i = 0; i < this.temporaryList.length; i++) { |
|
|
|
if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { |
|
|
|
if (this.temporaryList.length == (i + 1)) { |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
return |
|
|
|
} |
|
|
|
this.tui.request("/app/stock/productCount", "post", { |
|
|
|
productId: this.productId, |
|
|
|
// productId: "1718617874370793472", |
|
|
|
attributeList: JSON.stringify(obj) |
|
|
|
// attributeList: '{\"颜色\":\"黑色\",\"尺码\":\"S码\",\"类别\":\"童装\"}' |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.productNum = res.result |
|
|
|
this.attributeList = { |
|
|
|
attributeList: JSON.stringify(obj), |
|
|
|
productCount: this.temporaryNum, |
|
|
|
productNum:this.productNum, |
|
|
|
name: name, |
|
|
|
price: this.purchasePrice |
|
|
|
} |
|
|
|
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) { |
|
|
|
this.goodsDetail.attributeList[i].isChecked = false; |
|
|
|
for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) { |
|
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.temporaryList.length == 0) { |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
} else { |
|
|
|
this.temporaryList[i] = this.attributeList |
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
for (var i = 0; i < this.temporaryList.length; i++) { |
|
|
|
if (this.temporaryList[i].name.indexOf(this.attributeList.name) == -1 || this.temporaryList[i].name.indexOf(this.attributeList.name) == 1) { |
|
|
|
if (this.temporaryList.length == (i + 1)) { |
|
|
|
this.temporaryList.push(this.attributeList); |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.temporaryList[i] = this.attributeList |
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
this.tui.toast(res.message) |
|
|
|
} |
|
|
|
}).catch((res) => {}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|