问题fix

This commit is contained in:
donqi 2022-10-06 03:06:21 +08:00
parent b877f7417e
commit ed06392a80
3 changed files with 103 additions and 46 deletions

View File

@ -603,6 +603,19 @@ export default {
})
return res[1].data;
},
async delAfterServiceRecord(ids) {
let res = await uni.request({
url: '/worker/record/remove',
method: 'POST',
data: {
ids: ids
},
header: {
'content-type': 'application/x-www-form-urlencoded'
}
})
return res[1].data;
},
async getOrderAfterServiceRecords(params = {}) {
let res = await uni.request({
url: '/worker/record/app/list',
@ -622,5 +635,13 @@ export default {
}
})
return res[1].data;
}
},
async getChangeOrderPrice(params = {}) {
let res = await uni.request({
url: '/order/detail/app/getChangePrice',
method: 'POST',
data: params
})
return res[1].data;
},
}

View File

@ -20,9 +20,13 @@
v-model="customerReasonType">
</my-uni-combox>
</view>
<view class="margin-top-sm flex justify-start align-center margin-top-sm">
<view class="margin-top-sm flex justify-start align-center margin-top-sm" v-if="afterServiceType === 1">
<text>最大可退款金额</text>
<text class="text-price text-red">{{detailObj ? detailObj.payMoney : 0}}</text>
</view>
<view class="margin-top-sm flex justify-start align-center margin-top-sm" v-if="afterServiceType === 1">
<view>退款金额</view>
<input class="radius-input inline-input" v-model="refund" style="flex-basis: 70%;"></input>
<input type="digit" class="radius-input inline-input" v-model="refund" style="flex-basis: 70%;"></input>
</view>
<view class="margin-top-sm flex justify-start margin-top-sm">
<view>具体原因</view>
@ -152,7 +156,30 @@
}
})
},
validData() {
let errMsg = null;
if (!this.detailObj) {
errMsg = "请选择子单";
} else if (this.refund == null) {
errMsg = "退款金额不能为空";
} else if (this.refund > this.detailObj.payMoney) {
errMsg = "不可超出最大退款金额";
}
if (errMsg) {
uni.showToast({
title: errMsg,
duration: 1500,
icon: 'none'
})
return false;
}
return true;
},
async apply() {
if (!this.validData()) {
return;
}
let imgObjList = [];
this.imgList.forEach(url => {
imgObjList.push({
@ -181,8 +208,9 @@
}
if (updateStatusRes && updateStatusRes.code === 0) {
uni.showToast({
icon: 'success',
duration: 1000
title: '已发起售后,进度可在订单详情内查看',
icon: 'none',
duration: 2000
})
this.hideModal();
this.$emit('confirmFeedback');

View File

@ -94,7 +94,7 @@
v-for="(item, index) in servDetail.orderStandardDetailList">
<view class="cu-bar solid-bottom">
<view class="action bar-first-action">
<text class="cuIcon-titles text-main-color"></text> 施工记录
<text class="cuIcon-titles text-main-color"></text> 服务记录
</view>
<view class='cu-tag bg-purple radius light margin-right-sm'>编码:{{item.orderDetailCode}}</view>
</view>
@ -133,7 +133,10 @@
<view v-for="(afterServiceRecord, afterServiceRecordIndex) in item.afterServiceRecordList">
<view v-if="afterServiceRecord.createBy == 1" class="padding-tb solid-top">
<view class='cu-tag bg-main-color radius light'>客户发起</view>
<button class="cu-btn sm bg-yellow margin-left" v-show="afterServiceRecord.customerFinalCheck !== 1"
@click="cancelAfterService(afterServiceRecord.id)">撤销</button>
<view v-if="afterServiceRecord.operType === 1">
<view class="text-gray text-sm margin-bottom-xs">退单退款已提交至商家其最大时限24小时内需完成操作</view>
<view class="flex justify-start align-end">
<text>退款申请</text>
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
@ -160,6 +163,7 @@
</view>
</view>
<view v-else-if="afterServiceRecord.operType === 2">
<view class="text-gray text-sm margin-bottom-xs">售后已提交至商家其最大时限24小时内需完成操作</view>
<view class="flex justify-start align-end">
<text>待处理售后</text>
<uni-countdown :show-colon="false" :backgroundColor="'#eee'"
@ -233,8 +237,7 @@
</view>
</view>
</view>
<view class="flex justify-end align-end margin-tb-sm"
v-if="afterServiceRecord.updateBy && afterServiceRecord.customerFinalCheck == null">
<view class="flex justify-end align-end margin-tb-sm">
<button class="cu-btn sm bg-yellow margin-right-sm"
@click="afterServiceFinalCheck(afterServiceRecord.id, 1)">同意</button>
<button class="cu-btn sm bg-yellow margin-right-sm"
@ -269,24 +272,22 @@
<!-- <view class="bg-main-color submit">立即上门</view> -->
</view>
<uni-popup ref="orderManage" type="bottom" @change="changePopupState">
<view class="cu-bar tabbar bg-white">
<view class="bg-white text-center" style="width: 100%; z-index: 99;">
<view v-if="servDetail.orderStatus < 2" class="padding solid-bottom" @click="decideIfCancelOrder">
取消订单
</view>
<view v-if="servDetail.orderStatus < 4" class="padding solid-bottom" @click="applyAfterService">
发起投诉
</view>
<view v-if="servDetail.orderStatus >= 4" class="padding solid-bottom" @click="applyAfterService">
发起售后/投诉
</view>
<view v-if="servDetail.orderStatus >= 2 || servDetail.orderStatus < 5" class="padding solid-bottom"
@click="applyForRefund">
退单退款
</view>
<view class="bg-white text-center tabbar" style="z-index: 99;">
<view v-if="servDetail.orderStatus < 2" class="padding solid-bottom" @click="decideIfCancelOrder" style="z-index: 99;">
取消订单
</view>
<view v-if="servDetail.orderStatus < 3" class="padding solid-bottom" @click="applyAfterService" style="z-index: 99;">
发起投诉
</view>
<view v-if="servDetail.orderStatus >= 3" class="padding solid-bottom" @click="applyAfterService" style="z-index: 99;">
发起投诉/售后
</view>
<view v-if="servDetail.orderStatus >= 2 || servDetail.orderStatus < 5" class="padding solid-bottom" style="z-index: 99;"
@click="applyForRefund">
退单退款
</view>
<view class="bg-white fixed-bottom-popup"></view>
</view>
<view class="fixed-bottom-bar cu-bar bg-white" style="z-index: 98;"></view>
</uni-popup>
<!-- 模态框 -->
<urgent-msg :show="sendUrgentMsgModal" @hideModal="hideModal"></urgent-msg>
@ -314,7 +315,7 @@
servDetail: {},
finishRecord4Show: [],
servingColumnHeaders: ['购买型号', '购买量', '待服务'],
servedColumnHeaders: ['购买型号', '购买量', '已服务'],
servedColumnHeaders: ['购买型号', '待服务', '已服务'],
servingValFields: ['standardName', 'standardNum', 'waitServerNum'],
servedValFields: ['standardName', 'standardNum', 'serverNum'],
process: '',
@ -400,11 +401,11 @@
customerFinalCheck: agreeStatus
});
if (res && res.code === 0) {
this.loadData(this.servDetail.orderMasterId);
uni.showToast({
icon: 'success',
duration: 1000
})
this.loadData(this.servDetail.orderMasterId);
return;
}
uni.showToast({
@ -426,7 +427,24 @@
},
showModalByRef(refName, curOrder, params) {
this.$refs[refName].showModal(curOrder, params);
}
},
async cancelAfterService(id) {
let res = await this.$request.delAfterServiceRecord(id);
if (res && res.code === 0) {
this.loadData(this.servDetail.orderMasterId);
uni.showToast({
icon: 'success',
title: '撤销成功',
duration: 1000
})
} else {
uni.showToast({
icon: 'error',
title: '撤销失败',
duration: 1000
})
}
},
}
}
</script>
@ -437,16 +455,6 @@
font-size: 30rpx !important;
}
.fixed-bottom-popup {
position: fixed !important;
width: 100% !important;
bottom: 0 !important;
margin-bottom: 0 !important;
z-index: 98;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.cu-bar.tabbar .action {
font-size: 22rpx;
position: relative;