|
|
@@ -1,86 +1,103 @@
|
|
|
<template>
|
|
|
<view class="app-content">
|
|
|
- <view class="flex refund-item">
|
|
|
- <view class="refund-label">退款方式:</view>
|
|
|
- <view class="flex list">
|
|
|
- <view class="flex" @tap="refundType=1" >
|
|
|
- <view class="flex-center radioBtn" :class="refundType==1?'active':''">
|
|
|
- </view>退货并退款</view>
|
|
|
- <view style="margin-left: 30upx" class="flex" @tap="refundType=2">
|
|
|
- <view class="flex-center radioBtn" :class="refundType==1?'':'active'">
|
|
|
- </view>仅退款</view>
|
|
|
+ <view style="padding:30upx 30upx 140upx 30upx;">
|
|
|
+ <view class="flex refund-item">
|
|
|
+ <view class="refund-label">退款方式:</view>
|
|
|
+ <view class="flex list">
|
|
|
+ <view class="flex" @tap="refundType=1" >
|
|
|
+ <view class="flex-center radioBtn" :class="refundType==1?'active':''">
|
|
|
+ </view>退货并退款</view>
|
|
|
+ <view style="margin-left:50upx" class="flex" @tap="refundType=2">
|
|
|
+ <view class="flex-center radioBtn" :class="refundType==1?'':'active'">
|
|
|
+ </view>只退款</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="refund-item-list" v-if="refundType==1">
|
|
|
- <view class="refund-label"><text></text>选择商品:</view>
|
|
|
- <view>
|
|
|
- <view class="list" v-for="(res,i) in product" :key="i">
|
|
|
- <view class="flex list-title" >
|
|
|
- <text class="product-name">{{res.name}}</text>
|
|
|
- <text class="product-num">{{ `${parseFloat(res.xhNum)}` }}{{res.xhUnitName}}</text>
|
|
|
- <text class="product-price">{{`${parseFloat(res.xhUnitPrice)}`}}元/{{res.xhUnitName}}</text>
|
|
|
+ <view class="refund-item-list" v-if="refundType==1">
|
|
|
+ <view class="refund-label"><text></text>选择商品:</view>
|
|
|
+ <view>
|
|
|
+ <view class="list" v-for="(res,i) in product" :key="i">
|
|
|
+ <view class="flex list-title" >
|
|
|
+ <text class="product-name">{{res.name}}</text>
|
|
|
+ <text class="product-num">{{ `${parseFloat(res.xhNum)}` }}{{res.xhUnitName}}</text>
|
|
|
+ <text class="product-price">{{`${parseFloat(res.xhUnitPrice)}`}}元/{{res.xhUnitName}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex list-val" style="font-size:26upx;font-weight:bold;">
|
|
|
+ <input type="number" placeholder="填退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" />
|
|
|
+ <text style="margin-left:10upx;">{{res.xhUnitName}}</text>
|
|
|
+ <text style="color:green;margin-left:20upx;">可退{{Number(res.xhNum)-Number(res.refundNum)}}{{res.xhUnitName}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="flex list-val" style="font-size:26upx;font-weight:bold;">
|
|
|
- <input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" />
|
|
|
- <text style="margin-left:10upx;">{{res.xhUnitName}}</text>
|
|
|
- <text style="color:green;margin-left:20upx;">可退{{Number(res.xhNum)-Number(res.refundNum)}}{{res.xhUnitName}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex refund-item">
|
|
|
+ <view class="refund-label">订单金额:</view>
|
|
|
+ <view class="list">
|
|
|
+ ¥{{parseFloat(orderInfo.orderPrice)||0}}
|
|
|
+ <text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="flex refund-item">
|
|
|
+ <view class="refund-label">可退金额:</view>
|
|
|
+ <view class="list">¥{{couldRefundPrice}}</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="flex refund-item">
|
|
|
- <view class="refund-label">订单金额:</view>
|
|
|
- <view class="list">
|
|
|
- ¥{{parseFloat(orderInfo.orderPrice)||0}}
|
|
|
- <text style="margin-left:25upx;font-size:25upx;color:green;" v-if="Number(orderInfo.tkPrice)>0">已退¥{{orderInfo.tkPrice ? parseFloat(orderInfo.tkPrice) : 0}}</text>
|
|
|
+ <view class="flex refund-item">
|
|
|
+ <view class="refund-label">合计退款:</view>
|
|
|
+ <view class="list">¥{{refundPrice}}</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="flex refund-item">
|
|
|
- <view class="refund-label">可退金额:</view>
|
|
|
- <view class="list">¥{{couldRefundPrice}}</view>
|
|
|
- </view>
|
|
|
- <view class="flex refund-item">
|
|
|
- <view class="refund-label">合计退款:</view>
|
|
|
- <view class="list">¥{{refundPrice}}</view>
|
|
|
- </view>
|
|
|
- <view class="flex refund-item">
|
|
|
- <view class="refund-label"><text></text>实际退款:</view>
|
|
|
- <input type="digit" v-model="refundMoney">
|
|
|
- </view>
|
|
|
- <view class="refund-item">
|
|
|
- <view class="refund-label">备注:</view>
|
|
|
- <textarea v-model="remark" />
|
|
|
- </view>
|
|
|
- <view style="padding:20upx 0 20upx 0;font-size:32upx;font-weight:bold;">
|
|
|
- <text v-if="orderInfo.onlinePay == 2" style="color:green;">此单线上付款,提交后,钱会原路自动退回给客户</text>
|
|
|
- <block v-else>
|
|
|
- <text v-if="Number(orderInfo.debtPrice)>0" style="color:#3385ff;">
|
|
|
- 此单为欠款单,提交后,欠款金额会自动减少
|
|
|
- </text>
|
|
|
- <text v-else style="color:red;">此单线下付款,提交后钱不会原路退回,请线下转账给客户</text>
|
|
|
- </block>
|
|
|
- </view>
|
|
|
- <view class="flex-center btn-box" style="margin-bottom:50upx;margin-top:20upx;padding-bottom:10upx;">
|
|
|
- <view class="flex-center btn" @tap="cancelRefund">取消</view>
|
|
|
- <view class="flex-center btn active" @tap="confirmRefund" style="margin-left: 80upx">确定</view>
|
|
|
- </view>
|
|
|
+ <view class="flex refund-item">
|
|
|
+ <view class="refund-label"><text></text>实际退款:</view>
|
|
|
+ <input type="digit" v-model="refundMoney" @focus="refundMoney=''">
|
|
|
+ </view>
|
|
|
+ <view class="refund-item">
|
|
|
+ <view class="refund-label">备注说明:</view>
|
|
|
+ <textarea v-model="remark" style="height:100upx;"></textarea>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <form>
|
|
|
+ <div class="module-com input-line-wrap">
|
|
|
+ <div class="module-com input-line-wrap goods-wrap">
|
|
|
+ <div class="module-tit" style="padding-left:0upx;">
|
|
|
+ <span>售后图片:</span>
|
|
|
+ <span class="app-color-3" style="color:red;font-weight:bold;text-decoration: underline;float: right;" @click="getRule()">★上传图片规范(必看)</span>
|
|
|
+ </div>
|
|
|
+ <div class="module-det">
|
|
|
+ <htz-image-upload :max="9" :compress="true" v-model="refundImgData" :headers="headers"
|
|
|
+ @uploadSuccess="imgUploadSuccess" :quality="60" @imgDelete="imgDeleteFn" :action="getLoginInfo.imgUploadApi">
|
|
|
+ </htz-image-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </view>
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <view class="flex refund-item">
|
|
|
+ <view class="refund-label">审核结果:</view>
|
|
|
+ <view class="list">
|
|
|
+ <button class="admin-button-com big default" @click="noticeMe()" v-if="needNotice == 0">点我开启通知</button>
|
|
|
+ <button class="admin-button-com big blue" v-else>已经开启通知</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- #endif -->
|
|
|
|
|
|
- <view style="font-size:32upx;z-index:9999;color:red;text-align:center;font-weight:bold;margin-bottom:30upx;"
|
|
|
- v-if="!$util.isEmpty(unClear)" @click="goClear(unClear)">
|
|
|
- <text>有一个待结账单 ¥{{unClear.actPrice?parseFloat(unClear.actPrice):0}}</text>
|
|
|
- <text style="font-weight:bold;margin-left:15upx;">查看</text>
|
|
|
</view>
|
|
|
-
|
|
|
+ <view class="app-footer">
|
|
|
+ <button class="admin-button-com big default" @click="cancelRefund()">取消</button>
|
|
|
+ <button class="admin-button-com big blue" formType="submit" @click="confirmRefund">提交申请</button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { mapGetters } from "vuex"
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
-import { getDetail,refund } from "@/api/order/index";
|
|
|
-import { getUnClear } from "@/api/clear"
|
|
|
+import { getFullInfo } from "@/api/purchase";
|
|
|
+import { createRefund } from "@/api/cg-refund";
|
|
|
+//图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
|
|
|
+import htzImageUpload from '@/components/htz-image-upload/htz-image-upload.vue'
|
|
|
export default {
|
|
|
- name: "orderDetail",
|
|
|
+ name: "refund",
|
|
|
components: {
|
|
|
- TuiListCell
|
|
|
+ TuiListCell,
|
|
|
+ htzImageUpload
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -90,12 +107,19 @@ export default {
|
|
|
remark:'',
|
|
|
orderInfo:{},
|
|
|
couldRefundPrice:0,
|
|
|
- unClear:[]
|
|
|
+ unClear:[],
|
|
|
+ refundImgData:[],
|
|
|
+ uploadRefundImg:[],
|
|
|
+ headers:{token:''},
|
|
|
+ needNotice:0
|
|
|
};
|
|
|
},
|
|
|
- onShow() {
|
|
|
+ onLoad() {
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
+ this.headers.token = token
|
|
|
},
|
|
|
computed:{
|
|
|
+ ...mapGetters(["getLoginInfo","getDictionariesInfo"]),
|
|
|
refundPrice(){
|
|
|
let price = 0
|
|
|
if(this.product){
|
|
|
@@ -116,6 +140,35 @@ export default {
|
|
|
watch:{
|
|
|
},
|
|
|
methods: {
|
|
|
+ noticeMe(){
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ let that = this
|
|
|
+ if(this.getDictionariesInfo && this.getDictionariesInfo.subscribeMessage && this.getDictionariesInfo.subscribeMessage == 1 && this.getDictionariesInfo.hdMiniMessage && this.getDictionariesInfo.hdMiniMessage.afterSale){
|
|
|
+ uni.requestSubscribeMessage({
|
|
|
+ tmplIds: [this.getDictionariesInfo.hdMiniMessage.afterSale.msgId],
|
|
|
+ success(res) {
|
|
|
+ if(res[that.getDictionariesInfo.hdMiniMessage.afterSale.msgId] && res[that.getDictionariesInfo.hdMiniMessage.afterSale.msgId] == 'accept'){
|
|
|
+ that.needNotice = 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ console.log(err)
|
|
|
+ },
|
|
|
+ complete() {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ },
|
|
|
+ getRule(){
|
|
|
+ this.$util.pageTo({url:'/pagesPurchase/afterSale'})
|
|
|
+ },
|
|
|
+ imgUploadSuccess(res) {
|
|
|
+ var _res = JSON.parse(res.data)
|
|
|
+ if(_res.code == 1){
|
|
|
+ this.refundImgData.push(_res.data.smallUrl)
|
|
|
+ this.uploadRefundImg.push(_res.data.shortUrl)
|
|
|
+ }
|
|
|
+ },
|
|
|
cancelRefund(){
|
|
|
uni.navigateBack({delta: 1});
|
|
|
},
|
|
|
@@ -129,7 +182,7 @@ export default {
|
|
|
let hasRefundNum = ele.refundNum ? Number(ele.refundNum) : 0
|
|
|
let couldRefundNum = Number(currentNum) - Number(hasRefundNum)
|
|
|
if(Number(currentRefundCont) > Number(couldRefundNum)){
|
|
|
- uni.showToast({title:ele.name+'超过可退数量',icon:'none'})
|
|
|
+ uni.showToast({title:ele.name+' 超过可退数量',icon:'none'})
|
|
|
hasError = true;
|
|
|
return false
|
|
|
}
|
|
|
@@ -151,27 +204,31 @@ export default {
|
|
|
uni.showToast({title:'请选择商品',icon:'none'})
|
|
|
return;
|
|
|
}
|
|
|
+ let imgData = JSON.stringify(this.uploadRefundImg)
|
|
|
let refundParams = {
|
|
|
id:this.option.id,
|
|
|
product:JSON.stringify(product),
|
|
|
price:this.refundMoney,
|
|
|
remark:this.remark,
|
|
|
refundType:this.refundType,
|
|
|
- getOriginalItem:1
|
|
|
+ getOriginalItem:1,
|
|
|
+ imgList:imgData
|
|
|
};
|
|
|
- that.$util.confirmModal({content:'确认退款?'},() => {
|
|
|
+ that.$util.confirmModal({content:'确认提交?'},() => {
|
|
|
uni.showLoading({title: "提交中",mask:true})
|
|
|
- refund(refundParams).then(res => {
|
|
|
+ createRefund(refundParams).then(res => {
|
|
|
if(res.code == 1){
|
|
|
- uni.hideLoading()
|
|
|
- this.$util.pageTo({url: '/pagesOrder/refundSuccess?id='+res.data.id,type:2})
|
|
|
+ that.$msg('操作成功')
|
|
|
+ setTimeout(function(){
|
|
|
+ that.$util.pageTo({url: '/pagesPurchase/refundDetail?id='+res.data.id,type:2})
|
|
|
+ },1200)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
async init() {
|
|
|
//getOriginalItem 取原有的花材结构(小菊的花材结构有变化)
|
|
|
- const res = await getDetail({ id: this.option.id,getOriginalItem:1 })
|
|
|
+ const res = await getFullInfo({ id: this.option.id,getOriginalItem:1 })
|
|
|
this.orderInfo = res.data
|
|
|
|
|
|
this.couldRefundPrice = Number(res.data.orderPrice) - Number(res.data.tkPrice)
|
|
|
@@ -181,27 +238,25 @@ export default {
|
|
|
this.product = res.data.product.map(ele=>{
|
|
|
return {...ele,refundCount:null}
|
|
|
})
|
|
|
-
|
|
|
- let customId = res.data.customId ? res.data.customId : 0
|
|
|
- if(Number(customId)>0){
|
|
|
- getUnClear({customId:customId}).then(res=>{
|
|
|
- if(res.code == 1){
|
|
|
- this.unClear = res.data.info
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- goClear(item){
|
|
|
- this.$util.pageTo({url:'/admin/clear/customInfo?id='+item.id})
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
+.module-com {
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ background-color: #fff;
|
|
|
+ color: $fontColor2;
|
|
|
+ .module-tit {
|
|
|
+ padding: 20upx 30upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ }
|
|
|
+ .module-det {
|
|
|
+ padding: 0 30upx;
|
|
|
+ }
|
|
|
+}
|
|
|
.app-content{
|
|
|
height: calc(100vh - 30upx * 2);
|
|
|
- padding: 30upx;
|
|
|
background: #FFFFFF;
|
|
|
font-size: 30upx;
|
|
|
.radioBtn{
|
|
|
@@ -236,7 +291,9 @@ export default {
|
|
|
text{color: red;}
|
|
|
}
|
|
|
.list{
|
|
|
- margin-bottom: 10upx;
|
|
|
+ margin-bottom:18upx;
|
|
|
+ border-bottom:1upx solid #CCCCCC;
|
|
|
+ padding-bottom:14upx;
|
|
|
.list-title{
|
|
|
height: 60upx;
|
|
|
padding-bottom: 20upx;
|
|
|
@@ -308,4 +365,11 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.app-footer {
|
|
|
+ justify-content: space-evenly;
|
|
|
+ z-index: 9999;
|
|
|
+ .admin-button-com {
|
|
|
+ width: 46%;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|