|
|
@@ -4,18 +4,23 @@
|
|
|
<view v-if="!$util.isEmpty(itemList)" style="margin-top:20upx;">
|
|
|
<block v-for="(item, index) in itemList" :key="index">
|
|
|
<view style="text-align:center;margin-bottom:10upx;" v-if="item.xhUnitType == 0">
|
|
|
- <text style="font-size:30upx;">{{item.name}} 已退{{item.xhNum}}{{item.xhUnitName}}</text>
|
|
|
+ <text style="font-size:32upx;">
|
|
|
+ {{item.name}} 已退{{item.xhNum}}{{item.xhUnitName}}
|
|
|
+ <text v-if="Number(item.xhWasteNum)>0" style="margin-left:12upx;color:green;">
|
|
|
+ 已报损{{item.xhWasteNum}}{{item.xhUnitName}}
|
|
|
+ </text>
|
|
|
+ </text>
|
|
|
<button class="admin-button-com middle" style="margin:10upx auto 0 auto;" @click="beginWastage(item)">报损</button>
|
|
|
</view>
|
|
|
</block>
|
|
|
</view>
|
|
|
|
|
|
- <modal-module :show="wastageLabelShow" @click="confirmWastage" :maskClosable="true" title="数量" padding="30rpx 30rpx" >
|
|
|
+ <modal-module :show="wastageShow" @click="confirmWastage" :maskClosable="true" title="数量" padding="30rpx 30rpx" >
|
|
|
<template v-slot:content>
|
|
|
<div class="app-modal-input-wrap">
|
|
|
<div class="inp-list-line">
|
|
|
<div class="line-input">
|
|
|
- <input type="number" ref="input" style="width:61.8%;text-align:center;" @blur="blur" v-model="wastageNum" :adjust-position="false" class="inp-input" />
|
|
|
+ <input type="number" ref="input" style="width:61.8%;text-align:center;" v-model="wastageNum" :adjust-position="false" class="inp-input" @focus="wastageNum=''" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -40,17 +45,17 @@ export default {
|
|
|
info:[],
|
|
|
itemList:[],
|
|
|
wastageItemId:0,
|
|
|
- wastagePtItemId:0,
|
|
|
- wastageLabelShow:false,
|
|
|
- wastageNum:0
|
|
|
+ wastageShow:false,
|
|
|
+ wastageNum:0,
|
|
|
+ refundItemId:0
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
beginWastage(item){
|
|
|
- this.wastageLabelShow = true
|
|
|
+ this.wastageShow = true
|
|
|
this.wastageNum = item.xhNum
|
|
|
this.wastageItemId = item.productId
|
|
|
- this.wastagePtItemId = item.itemId
|
|
|
+ this.refundItemId = item.id
|
|
|
},
|
|
|
init(){
|
|
|
let that = this
|
|
|
@@ -63,21 +68,20 @@ export default {
|
|
|
uni.navigateBack({})
|
|
|
},
|
|
|
hideWaste(){
|
|
|
- this.wastageLabelShow = false
|
|
|
+ this.wastageShow = false
|
|
|
this.wastageNum = 0
|
|
|
this.wastageItemId = 0
|
|
|
- this.wastagePtItemId = 0
|
|
|
},
|
|
|
confirmWastage(val){
|
|
|
if (val.index === 0) {
|
|
|
- this.cancelWaste()
|
|
|
+ this.hideWaste()
|
|
|
return false
|
|
|
}
|
|
|
let that = this
|
|
|
- let product = [{"productId":this.wastageItemId,"bigNum":this.wastageNum,"smallNum":0,"classId":0,"itemId":this.wastagePtItemId,"ratio":0}]
|
|
|
- refundWaste({product:JSON.stringify(product),remark:'退货时报损'}).then(res=>{
|
|
|
+ refundWaste({wasteProductId:this.wastageItemId,wasteNum:this.wastageNum,remark:'退货时报损',refundItemId:this.refundItemId}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
that.hideWaste()
|
|
|
+ that.init()
|
|
|
}
|
|
|
})
|
|
|
}
|