| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <appResult :title="title">
- <button class="admin-button-com big blue" style="width:80%;" @click="goBack">返回</button>
- <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: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="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;" v-model="wastageNum" :adjust-position="false" class="inp-input" @focus="wastageNum=''" />
- </div>
- </div>
- </div>
- </template>
- </modal-module>
- </appResult>
- </template>
- <script>
- import appResult from "@/components/app-result";
- import { refundDetail,refundWaste } from "@/api/refund";
- import ModalModule from "@/components/plugin/modal"
- export default {
- name: "commonSuccess",
- components: {
- appResult,
- ModalModule
- },
- data() {
- return {
- title:'操作成功',
- info:[],
- itemList:[],
- wastageItemId:0,
- wastageShow:false,
- wastageNum:0,
- refundItemId:0
- };
- },
- methods: {
- beginWastage(item){
- this.wastageShow = true
- this.wastageNum = item.xhNum
- this.wastageItemId = item.productId
- this.refundItemId = item.id
- },
- init(){
- let that = this
- refundDetail({ id: this.option.id }).then(res=>{
- that.info = res.data.info ? res.data.info : []
- that.itemList = res.data.itemList ? res.data.itemList : []
- })
- },
- goBack() {
- uni.navigateBack({})
- },
- hideWaste(){
- this.wastageShow = false
- this.wastageNum = 0
- this.wastageItemId = 0
- },
- confirmWastage(val){
- if (val.index === 0) {
- this.hideWaste()
- return false
- }
- let that = this
- refundWaste({wasteProductId:this.wastageItemId,wasteNum:this.wastageNum,remark:'退货时报损',refundItemId:this.refundItemId}).then(res=>{
- if(res.code == 1){
- that.hideWaste()
- that.init()
- }
- })
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- .admin-button-com {
- margin-bottom: 20upx;
- width: 100%;
- }
- </style>
|