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

174 lines
4.9 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="rejectAfterSale" @click="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding text-left">
<view>
<view class="flex justify-start">
2026-03-13 14:27:07 +08:00
<view><text class="text-red">*</text>原因选择</view>
2022-09-26 02:30:57 +08:00
<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;" class="solid radius text-left padding-sm"
v-model="remark" maxlength="-1"
2026-03-13 14:27:07 +08:00
placeholder="拒绝原因:发生纠纷,建议了解清楚客户诉求,积极协商和平处理(让客户撤单更佳)。否则升级重大客诉可能被平台处罚!确实属客户问题且无法协商请输入具体情况!"></textarea>
2022-09-26 02:30:57 +08:00
</view>
</view>
<!-- 上传图片 -->
<view class="padding-top">
<view class="grid col-3 grid-square flex-sub margin-top-sm">
<view class="bg-img" v-for="(item,index) in imgList" :key="index"
@tap="viewImage($event, imgList)" :data-url="item">
<image :src="item" mode="aspectFill"></image>
<view class="cu-tag bg-red" @tap.stop="delImg($event, imgList)" :data-index="index">
<text class='cuIcon-close'></text>
</view>
</view>
2026-03-13 14:27:07 +08:00
<view class="solids" @click.stop="chooseImgList(e, imgList)" v-if="imgList.length < 3">
2022-09-26 02:30:57 +08:00
<text class='cuIcon-cameraadd'></text>
</view>
</view>
</view>
</view>
<view class="cu-bar solid-top">
<view class="action margin-0 flex-sub text-black" data-modal="rejectAfterSale" @click="hideModal">取消</view>
<view class="action margin-0 flex-sub text-main-color solid-left" data-modal="rejectAfterSale"
@click="submit">确认</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'rejectAfterSale',
props: {
show: {
type: Boolean,
default: false
},
data: {
type: Object,
2026-03-13 14:27:07 +08:00
default: () => {}
2022-09-26 02:30:57 +08:00
}
},
data() {
return {
reasonType: null,
remark: null,
imgList: []
}
},
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() {
this.data = null;
this.reasonType = null;
this.remark = null;
},
changeReasonRadio(e) {
this.reasonType = e.detail.value;
},
chooseImgList(e, imgList) {
2023-11-29 22:05:04 +08:00
uni.chooseMedia({
2022-09-26 02:30:57 +08:00
count: 3 - imgList.length, //默认9
2023-11-29 22:05:04 +08:00
mediaType: ['image'],
2022-09-26 02:30:57 +08:00
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: (res) => {
uni.showLoading({
title: '上传中',
mask: true
});
2023-11-29 22:05:04 +08:00
res.tempFiles.forEach((fileObj, index) => {
this.$request.uploadFile(fileObj.tempFilePath).then((url) => {
2022-09-26 02:30:57 +08:00
imgList.push(url);
2023-11-29 22:05:04 +08:00
if (index === res.tempFiles.length - 1) {
2022-09-26 02:30:57 +08:00
uni.hideLoading();
}
});
});
}
});
},
viewImage(e, imgList) {
uni.previewImage({
urls: imgList,
current: e.currentTarget.dataset.url
});
},
delImg(e, imgList) {
uni.showModal({
title: '',
content: '确定要删除这张图片吗?',
cancelText: '取消',
confirmText: '确定',
success: res => {
if (res.confirm) {
imgList.splice(e.currentTarget.dataset.index, 1)
}
}
})
},
async submit(e) {
2026-03-13 14:27:07 +08:00
if(!this.remark) {
uni.showToast({
icon: 'none',
duration: 3000,
title: '请输入拒绝原因'
2022-09-26 02:30:57 +08:00
})
2026-03-13 14:27:07 +08:00
return
}
2022-09-26 02:30:57 +08:00
let res = await this.$request.editAfterServiceRecord({
id: this.data.afterServiceRecordList[0].id,
workerFeedbackReasonType: this.reasonType,
workerFeedbackReason: this.remark,
2022-09-26 23:51:22 +08:00
workerFeedbackResult: 0,
2026-03-13 14:27:07 +08:00
workerFeedbackImages: this.imgList.length ? this.imgList.toString() : '',
2022-09-26 02:30:57 +08:00
updateBy: 2
});
if (res && res.code === 0) {
uni.showToast({
icon: 'success',
duration: 1000
})
this.hideModal(e);
this.$emit('confirmFeedback');
return;
}
uni.showToast({
icon: 'error',
duration: 1000
})
}
},
}
</script>
<style scoped>
.inline-input {
flex-basis: 25%;
}
</style>