|
|
@@ -4,23 +4,30 @@
|
|
|
<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;">
|
|
|
- <text style="font-size:32upx;">
|
|
|
- {{item.name}} 已退{{item.xhNum}}{{item.xhUnitName}}
|
|
|
- <text v-if="Number(item.xhWasteNum)>0" style="margin-left:12upx;color:green;">
|
|
|
+ <text style="font-size:32upx;" @click="beginReduce(item)">
|
|
|
+ {{item.name}} <text style="color:#3385FF;margin-left:8upx;">已退{{item.xhNum}}{{item.xhUnitName}}</text>
|
|
|
+ </text>
|
|
|
+ <view style="margin-top:10upx;" v-if="Number(item.xhWasteNum)>0">
|
|
|
+ <text style="margin-left:12upx;color:red;font-size:30upx;font-weight:bold;">
|
|
|
已报损{{item.xhWasteNum}}{{item.xhUnitName}}
|
|
|
</text>
|
|
|
- </text>
|
|
|
+ </view>
|
|
|
+ <view style="margin-top:10upx;" v-if="Number(item.xhReduceNum)>0">
|
|
|
+ <text style="margin-left:12upx;color:red;font-size:30upx;font-weight:bold;">
|
|
|
+ 已减库存{{item.xhReduceNum}}{{item.xhUnitName}}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
<view style="margin-top:10upx;margin-bottom:10upx;color:#ad760d;font-size:30upx;" v-if="item.refundOptionId!=0">{{ item.refundOptionName }}</view>
|
|
|
- <view style="width:420upx;">
|
|
|
- <button class="admin-button-com middle" style="width:200upx;" @click="beginWastage(item)" v-if="item.xhUnitType == 0">报损</button>
|
|
|
- <button class="admin-button-com middle" style="width:200upx;" @click="pageTo({url:'/admin/item/detail?id='+item.productId})" v-else>去损报</button>
|
|
|
- <button class="admin-button-com middle" style="margin-left:10upx;width:200upx;" @click="selOption(item)">售后原因</button>
|
|
|
+ <view style="width:100%;">
|
|
|
+ <button class="admin-button-com middle" style="width:160upx;" @click="selOption(item)">售后原因</button>
|
|
|
+ <button class="admin-button-com middle" style="width:150upx;margin-left:10upx;" @click="beginWastage(item)" v-if="item.xhUnitType == 0">报损</button>
|
|
|
+ <button class="admin-button-com middle" style="width:150upx;margin-left:10upx;" @click="pageTo({url:'/admin/item/detail?id='+item.productId})" v-else>去损报</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</block>
|
|
|
</view>
|
|
|
|
|
|
- <modal-module :show="wastageShow" @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">
|
|
|
@@ -32,6 +39,18 @@
|
|
|
</template>
|
|
|
</modal-module>
|
|
|
|
|
|
+ <modal-module :show="reduceShow" @click="confirmReduce" :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;" v-model="reduceNum" :adjust-position="false" class="inp-input" @focus="reduceNum=''" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </modal-module>
|
|
|
+
|
|
|
<uni-popup ref="optionRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
<view style="max-height:90vh;overflow: scroll;">
|
|
|
<view style="margin-left:30upx;margin-top:19upx;font-size:27upx;font-weight:bold;">请选择:</view>
|
|
|
@@ -56,7 +75,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import appResult from "@/components/app-result";
|
|
|
-import { refundDetail,refundWaste,changeRefundOption } from "@/api/refund";
|
|
|
+import { refundDetail,refundWaste,changeRefundOption,refundReduce } from "@/api/refund";
|
|
|
import ModalModule from "@/components/plugin/modal"
|
|
|
export default {
|
|
|
name: "commonSuccess",
|
|
|
@@ -69,15 +88,40 @@ export default {
|
|
|
title:'操作成功',
|
|
|
info:[],
|
|
|
itemList:[],
|
|
|
- wastageItemId:0,
|
|
|
wastageShow:false,
|
|
|
wastageNum:0,
|
|
|
refundItemId:0,
|
|
|
refundOption:[],
|
|
|
- currentInfo:{}
|
|
|
+ currentInfo:{},
|
|
|
+ reduceItemId:0,
|
|
|
+ reduceShow:false,
|
|
|
+ reduceNum:0,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ beginReduce(item){
|
|
|
+ this.reduceShow = true
|
|
|
+ this.reduceNum = item.xhNum
|
|
|
+ this.refundItemId = item.id
|
|
|
+ },
|
|
|
+ confirmReduce(val){
|
|
|
+ if (val.index === 0) {
|
|
|
+ this.hideReduce()
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let that = this
|
|
|
+ refundReduce({reduceNum:this.reduceNum,refundItemId:this.refundItemId}).then(res=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ that.hideReduce()
|
|
|
+ that.init()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ hideReduce(){
|
|
|
+ this.reduceShow = false
|
|
|
+ this.reduceNum = 0
|
|
|
+ this.reduceItemId = 0
|
|
|
+ },
|
|
|
selOption(info){
|
|
|
this.$refs.optionRef.open('center')
|
|
|
this.currentInfo = info
|
|
|
@@ -97,7 +141,6 @@ export default {
|
|
|
beginWastage(item){
|
|
|
this.wastageShow = true
|
|
|
this.wastageNum = item.xhNum
|
|
|
- this.wastageItemId = item.productId
|
|
|
this.refundItemId = item.id
|
|
|
},
|
|
|
init(){
|
|
|
@@ -114,7 +157,6 @@ export default {
|
|
|
hideWaste(){
|
|
|
this.wastageShow = false
|
|
|
this.wastageNum = 0
|
|
|
- this.wastageItemId = 0
|
|
|
},
|
|
|
confirmWastage(val){
|
|
|
if (val.index === 0) {
|
|
|
@@ -122,7 +164,7 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
let that = this
|
|
|
- refundWaste({wasteProductId:this.wastageItemId,wasteNum:this.wastageNum,remark:'退货时报损',refundItemId:this.refundItemId}).then(res=>{
|
|
|
+ refundWaste({wasteNum:this.wastageNum,remark:'退货时报损',refundItemId:this.refundItemId}).then(res=>{
|
|
|
if(res.code == 1){
|
|
|
that.hideWaste()
|
|
|
that.init()
|