Commit 91d0f7d9 by Jaxon

feat:【销售退单】销售退款流程优化

1 parent cdc53c63
...@@ -2,30 +2,30 @@ import api from "~/utils/request/request.js"; ...@@ -2,30 +2,30 @@ import api from "~/utils/request/request.js";
module.exports = { module.exports = {
// 退款申请流程状态栏 // 退款申请流程状态栏
getRefundStatusAPI(data) { getRefundStatusAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.audit.select', data) return api.post("dj.api.smartcarlife.refundApplyRecord.audit.select", data);
}, },
// 标记订单子订单详情查询 // 标记订单子订单详情查询
getSubOrderInfoAPI(data) { getSubOrderInfoAPI(data) {
return api.post('dj.api.smartcarlife.goodsOrder.goodsSubOrder.list', data) return api.post("dj.api.smartcarlife.goodsOrder.goodsSubOrder.list", data);
}, },
// 退款详情明细查询 // 退款详情明细查询
getRefundDetailInfoAPI(data) { getRefundDetailInfoAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.detail.select', data) return api.post("dj.api.smartcarlife.refundApplyRecord.detail.select", data);
}, },
// 发起退款申请 // 发起退款申请
applyRefundAPI(data) { applyRefundAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.add', data) return api.post("dj.api.smartcarlife.refundApplyRecord.add", data);
}, },
// 退款审核 // 退款审核
auditRefundAllpyAPI(data) { auditRefundAllpyAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.audit.update', data) return api.post("dj.api.smartcarlife.refundApplyRecord.audit.update", data);
}, },
// 根据主订单号获取退款成功记录 // 根据主订单号获取退款成功记录
getRefundLogByOrderCodeAPI(data) { getRefundLogByOrderCodeAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list', data) return api.post("dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list", data);
}, },
// 门店收款订单标记退款 // 门店收款订单标记退款
markAsRefundedAPI(data) { markAsRefundedAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.offlinePay.add', data)
}
}
\ No newline at end of file \ No newline at end of file
return api.post("dj.api.smartcarlife.refundApplyRecord.offlinePay.add", data);
},
};
// tabWorkOrder/pages/refundApply/components/dialogInput.js
const EDIT_ICON = "/tabWorkOrder/images/editIcon.png";
Component({
properties: {
name: {
type: String,
value: "",
},
label: {
type: String,
value: "",
},
value: {
type: String,
value: "",
observer(nextValue) {
this.syncLocalValue(nextValue);
},
},
compareValue: {
type: String,
value: "",
observer(nextValue) {
this.syncCompareValue(nextValue);
},
},
placeholder: {
type: String,
value: "点击输入",
},
defaultTips: {
type: String,
value: "姓名自动带入工单完整姓名,如需修改可点击编辑",
},
warningTips: {
type: String,
value: "收款人与工单车主姓名不一致,若不一致请提供收款人付款凭证(如微信截图)",
},
tips: {
type: String,
value: "",
},
required: {
type: Boolean,
value: false,
},
disabled: {
type: Boolean,
value: false,
},
showBorder: {
type: Boolean,
value: true,
},
showEditIcon: {
type: Boolean,
value: true,
},
maxlength: {
type: Number,
value: 50,
},
type: {
type: String,
value: "text",
},
},
data: {
popupVisible: false,
localValue: "",
tempValue: "",
editBaseValue: "",
hasConfirmedEdit: false,
showChangedTips: false,
dialogValueChanged: false,
editIcon: EDIT_ICON,
},
lifetimes: {
attached() {
this.syncLocalValue(this.data.value);
this.syncCompareValue(this.data.compareValue);
},
},
methods: {
syncLocalValue(value) {
const normalizedValue = this.normalizeValue(value);
this.setData({
localValue: normalizedValue,
showChangedTips: this.data.hasConfirmedEdit ? normalizedValue !== this.data.editBaseValue : false,
});
},
normalizeValue(value) {
return value === undefined || value === null ? "" : String(value);
},
syncCompareValue(compareValue) {
const normalizedCompareValue = this.normalizeValue(compareValue);
this.setData({
editBaseValue: normalizedCompareValue,
showChangedTips: this.data.hasConfirmedEdit ? this.data.localValue !== normalizedCompareValue : false,
dialogValueChanged: this.data.popupVisible && this.data.tempValue !== normalizedCompareValue,
});
},
buildDetail(value) {
return {
name: this.data.name,
label: this.data.label,
value,
};
},
handleActivateEdit() {
if (this.data.disabled) return;
this.setData({
popupVisible: true,
tempValue: this.data.localValue,
dialogValueChanged: this.data.localValue !== this.data.editBaseValue,
});
this.triggerEvent("edit", this.buildDetail(this.data.localValue));
},
handleEditIconTap() {
this.handleActivateEdit();
},
handleDialogInput(e) {
const value = this.normalizeValue(e.detail.value);
this.setData({
tempValue: value,
dialogValueChanged: value !== this.data.editBaseValue,
});
},
noScroll() {},
handleClosePopup() {
this.setData({
popupVisible: false,
tempValue: this.data.localValue,
dialogValueChanged: false,
});
},
handleConfirmChange() {
const value = this.normalizeValue(this.data.tempValue).trim();
if (this.data.required && !value) {
const message = `${this.data.label || "当前字段"}不能为空`;
if (wx?.$util?.showToast) {
wx.$util.showToast(message);
} else {
wx.showToast({
title: message,
icon: "none",
});
}
return;
}
this.setData({
popupVisible: false,
hasConfirmedEdit: true,
localValue: value,
tempValue: value,
showChangedTips: value !== this.data.editBaseValue,
// Keep the dialog warning state until the popup fully closes
// to avoid a visual flicker on the confirm click.
dialogValueChanged: value !== this.data.editBaseValue,
});
this.triggerEvent("confirm", this.buildDetail(value));
},
},
});
{
"component": true,
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"van-icon": "@vant/weapp/icon/index"
}
}
/* tabWorkOrder/pages/refundApply/components/dialogInput.wxss */
.dialog-input {
padding: var(--fontSize24) var(--fontSize40);
background: #ffffff;
box-sizing: border-box;
&--border {
border-bottom: 1px solid #eff0f2;
}
&__content {
display: flex;
flex-direction: column;
}
&__title {
display: flex;
align-items: center;
margin-bottom: var(--fontSize12);
}
&__label {
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize40);
}
&__required {
margin-left: var(--fontSize8);
color: #f00;
font-size: var(--fontSize20);
line-height: 1;
}
&__field {
display: flex;
align-items: center;
height: var(--fontSize72);
padding: 0 var(--fontSize24);
border: 1px solid #eff0f2;
border-radius: var(--fontSize16);
background: #ffffff;
box-sizing: border-box;
}
&__field--disabled {
background: #f7f8fa;
}
&__text {
flex: 1;
min-width: 0;
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize40);
}
&__text {
display: block;
line-height: var(--fontSize72);
word-break: break-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__text--placeholder {
color: #999ea8;
}
&__placeholder {
color: #999ea8;
font-size: var(--fontSize28);
}
&__icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-left: var(--fontSize12);
flex-shrink: 0;
}
&__tips {
margin-top: var(--fontSize12);
color: #999ea8;
font-size: var(--fontSize24);
font-weight: 400;
line-height: var(--fontSize32);
}
&__dialog-title {
padding: 0 0 var(--fontSize40);
color: #292d33;
font-size: var(--fontSize32);
font-weight: 500;
line-height: var(--fontSize48);
text-align: center;
}
&__dialog-body {
padding: var(--fontSize48);
border-top: 1px solid #ebedf0;
border-bottom: 1px solid #ebedf0;
}
&__dialog-form {
display: flex;
flex-direction: column;
gap: var(--fontSize12);
}
&__dialog-label-row {
display: flex;
align-items: center;
gap: var(--fontSize8);
}
&__dialog-label {
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize40);
}
&__dialog-required {
color: #ef4444;
font-size: var(--fontSize20);
line-height: 1;
}
&__dialog-input-wrap {
display: flex;
align-items: center;
height: var(--fontSize72);
padding: 0 var(--fontSize24);
background: #ffffff;
border: 1px solid #eff0f2;
border-radius: var(--fontSize16);
box-sizing: border-box;
}
&__dialog-input {
width: 100%;
height: 100%;
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize72);
}
&__dialog-alert {
display: flex;
align-items: flex-start;
padding: var(--fontSize10) var(--fontSize24);
background: #fff7ed;
border-radius: var(--fontSize12);
box-sizing: border-box;
}
&__outer-alert {
margin-top: var(--fontSize12);
}
&__dialog-alert-icon {
position: relative;
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize8);
flex-shrink: 0;
border-radius: 50%;
background: #f59e0b;
}
&__dialog-alert-line {
position: absolute;
top: 6px;
left: 50%;
width: 2px;
height: 8px;
background: #ffffff;
border-radius: 1px;
transform: translateX(-50%);
}
&__dialog-alert-dot {
position: absolute;
bottom: 5px;
left: 50%;
width: 3px;
height: 3px;
background: #ffffff;
border-radius: 50%;
transform: translateX(-50%);
}
&__dialog-alert-text {
flex: 1;
flex-shrink: 0;
color: #f59e0b;
font-size: var(--fontSize24);
line-height: var(--fontSize32);
word-break: break-all;
margin-left: var(--fontSize8);
}
&__dialog-footer-btn {
flex: 1;
flex-shrink: 0;
height: var(--fontSize96);
color: #3b82f6;
font-size: var(--fontSize32);
font-weight: 500;
line-height: var(--fontSize96);
text-align: center;
}
&__dialog-footer-btn--close {
color: #292d33;
font-weight: 400;
}
}
<view class="dialog-input {{ showBorder ? 'dialog-input--border' : '' }}">
<view class="dialog-input__content">
<view class="dialog-input__title">
<text class="dialog-input__label">{{ label }}</text><text wx:if="{{ required }}" class="dialog-input__required">*</text>
</view>
<view class="dialog-input__field {{ disabled ? 'dialog-input__field--disabled' : '' }}">
<text class="dialog-input__text {{ !localValue ? 'dialog-input__text--placeholder' : '' }}">{{ localValue || placeholder }}</text>
<image wx:if="{{ showEditIcon && !disabled }}"
class="dialog-input__icon"
src="{{ editIcon }}"
mode="aspectFit"
catchtap="handleEditIconTap" />
</view>
<view wx:if="{{ showChangedTips && warningTips }}"
class="dialog-input__dialog-alert dialog-input__outer-alert">
<van-icon name="warning" color="#FF9D0A" /><text class="dialog-input__dialog-alert-text">{{ warningTips }}</text>
</view>
<text wx:else class="dialog-input__tips">{{ defaultTips }}</text>
</view>
</view>
<van-dialog use-slot
use-title-slot
use-confirm-button-slot
use-cancel-button-slot
show-cancel-button
show="{{ popupVisible }}"
width="var(--fontSize622)"
custom-class="dialog-input__van-dialog"
lock-scroll
catchtouchmove="noScroll"
close-on-click-overlay="{{ false }}"
bind:close="handleClosePopup">
<view slot="title" class="dialog-input__dialog-title">
修改{{ label }}
</view>
<view class="dialog-input__dialog-body">
<view class="dialog-input__dialog-form">
<view class="dialog-input__dialog-label-row">
<text class="dialog-input__dialog-label">{{ label }}</text><text wx:if="{{ required }}" class="dialog-input__dialog-required">*</text>
</view>
<view class="dialog-input__dialog-input-wrap">
<input class="dialog-input__dialog-input"
type="{{ type }}"
value="{{ tempValue }}"
maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}"
placeholder-class="dialog-input__placeholder"
focus
bindinput="handleDialogInput"
always-embed />
</view>
<view wx:if="{{ dialogValueChanged && warningTips }}"
class="dialog-input__dialog-alert">
<van-icon name="warning" color="#FF9D0A" /><text class="dialog-input__dialog-alert-text">{{ warningTips }}</text>
</view>
</view>
</view>
<view slot="cancel-button"
class="dialog-input__dialog-footer-btn dialog-input__dialog-footer-btn--close"
bindtap="handleClosePopup">
关闭
</view>
<view slot="confirm-button"
class="dialog-input__dialog-footer-btn"
bindtap="handleConfirmChange">
确认修改
</view>
</van-dialog>
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
"usingComponents": { "usingComponents": {
"review-status": "./components/reviewStatus/reviewStatus", "review-status": "./components/reviewStatus/reviewStatus",
"van-loading": "@vant/weapp/loading/index", "van-loading": "@vant/weapp/loading/index",
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index",
"van-image": "@vant/weapp/image/index",
"dialog-input": "./components/dialogInput/dialogInput",
"label-refund-status": "./components/labelRefundStatus/labelRefundStatus" "label-refund-status": "./components/labelRefundStatus/labelRefundStatus"
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!