dingdong-master/pages/order-manage/modal/agree-after-sale.vue

158 lines
5.0 KiB
Vue
Raw Normal View History

2022-09-26 02:30:57 +08:00
<template>
<view class="cu-modal" :class="show?'show':''">
<view class="cu-dialog bg-white">
<view class="cu-bar">
<view class="content">同意售后</view>
<view class="action" data-modal="agreeAfterSale" @click="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding text-left">
<view class="text-lg">
2022-10-07 02:26:02 +08:00
<text>退款金额</text>
2022-10-09 23:17:12 +08:00
<text class="text-price text-red">{{data.afterServiceRecordList[0].refund ? data.afterServiceRecordList[0].refund : data.payMoney}}</text>
2022-09-26 02:30:57 +08:00
</view>
<view v-if="!data.isOnlyServ && data.afterServiceRecordList[0].refund && data.payMoney < data.afterServiceRecordList[0].refund" class="padding-top text-red">
警报该单关联其它订单客户申请的退款金额有效有疑问可先沟通派单公司详情处电话如确认同意最大退款额以本单接单额原路退回其余需退的或你仍有收益则由派单公司处理如更改退单额需先协商一致余额部分完单后计入你账户
</view>
2022-09-26 23:51:22 +08:00
<view class="text-lg padding-top flex justify-start align-center">
2022-10-07 02:26:02 +08:00
<text>更改退款金额</text>
<input type="digit" class="radius-input inline-input" v-model="agreedRefund"></input>
2022-09-26 02:30:57 +08:00
<text class="margin-left-xs"></text>
</view>
<view class="padding-top">
<view class="flex justify-start">
<view>原因选择</view>
<radio-group @change="changeReasonRadio">
<label class="radio margin-right-sm">
<radio style="transform:scale(0.7)" class="main-color" value="1" :checked="data.reasonType === 1"/>
<text>客户原因</text>
</label>
<label class="radio">
<radio style="transform:scale(0.7)" class="main-color" value="2" :checked="data.reasonType === 2"/>
<text>师傅原因</text>
</label>
<label class="radio">
<radio style="transform:scale(0.7)" class="main-color" value="3" :checked="data.reasonType === 3"/>
<text>其他</text>
</label>
</radio-group>
</view>
<view class="margin-top">
<textarea style="width: 100%; height: 200rpx;" fixed="true" class="solid radius text-left padding-sm"
2022-09-26 02:30:57 +08:00
v-model="remark" maxlength="-1"
placeholder="请输入同意原因或更改金额原因(更改退单金额需与客户协商一致,或请订单详情处“派单公司”介入,否则可能被拒绝或引起客诉升级)"></textarea>
2022-09-26 02:30:57 +08:00
</view>
</view>
</view>
<view class="cu-bar solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="agreeAfterSale" @click="hideModal">取消</view>
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="agreeAfterSale"
2023-05-07 23:07:29 +08:00
@click="showNotice">确认</view>
2022-09-26 02:30:57 +08:00
</view>
</view>
2023-05-07 23:07:29 +08:00
<confirm-modal ref="notice" :content="'本单款项银联确认已发起支付,款项已到达或即将到达您所绑定帐户,需退款的同意后您线下与客户操作退款,系统无法提供原路返回退款!'" :confirmMsg="'同意'" @confirm="noticeConfirm" @cancel="noticeCancel"></confirm-modal>
2022-09-26 02:30:57 +08:00
</view>
</template>
<script>
export default {
name: 'agreeAfterSale',
props: {
show: {
type: Boolean,
default: false
},
data: {
type: Object,
default: {}
}
},
data() {
return {
agreedRefund: null,
reasonType: null,
remark: null
}
},
methods: {
hideModal(e) {
this.resetData();
2024-03-04 10:04:10 +08:00
this.$emit('close', e);
2022-09-26 02:30:57 +08:00
},
resetData() {
2023-05-07 23:07:29 +08:00
// this.data = null;
2022-09-26 02:30:57 +08:00
this.agreedRefund = null;
this.reasonType = null;
this.remark = null;
},
changeReasonRadio(e) {
this.reasonType = e.detail.value;
},
2023-05-07 23:07:29 +08:00
showNotice(e) {
if (this.data.drawCashStatus != null && this.data.drawCashStatus >= 1) {
this.$refs.notice.showModal();
} else {
this.submit(e);
}
},
noticeConfirm() {
this.submit({
currentTarget: {
dataset: {
modal: 'agreeAfterSale'
}
}
});
},
noticeCancel() {
this.hideModal({
currentTarget: {
dataset: {
modal: 'agreeAfterSale'
}
}
});
},
2022-09-26 02:30:57 +08:00
async submit(e) {
2022-10-10 22:47:53 +08:00
let agreedRefund = this.agreedRefund;
if (!agreedRefund && this.data.afterServiceRecordList[0].refund != null) {
agreedRefund = this.data.afterServiceRecordList[0].refund;
2022-10-15 01:44:49 +08:00
} else if (!agreedRefund) {
2022-10-10 22:47:53 +08:00
agreedRefund = this.data.payMoney;
}
2022-09-26 02:30:57 +08:00
let res = await this.$request.editAfterServiceRecord({
id: this.data.afterServiceRecordList[0].id,
workerFeedbackReasonType: this.reasonType,
2022-10-10 22:47:53 +08:00
agreedRefund: agreedRefund,
2022-09-26 02:30:57 +08:00
workerFeedbackReason: this.remark,
2022-09-26 23:51:22 +08:00
workerFeedbackResult: 1,
2022-09-26 02:30:57 +08:00
updateBy: 2
});
if (res && res.code === 0) {
uni.showToast({
icon: 'success',
2022-10-10 22:47:53 +08:00
title: '提交成功',
2022-09-26 02:30:57 +08:00
duration: 1000
})
2022-10-15 01:44:49 +08:00
this.hideModal(e);
this.$emit('confirmFeedback');
2022-09-26 02:30:57 +08:00
return;
}
uni.showToast({
icon: 'error',
2022-10-10 22:47:53 +08:00
duration: 1000,
title: '提交失败',
2022-09-26 02:30:57 +08:00
})
}
},
}
</script>
<style scoped>
.inline-input {
flex-basis: 25%;
}
</style>