154 lines
4.1 KiB
Vue
154 lines
4.1 KiB
Vue
<template>
|
||
<!-- popup -->
|
||
<view>
|
||
<uni-popup ref="reFinishPopup" type="bottom" @change="changePopup">
|
||
<view class="text-bold text-gray text-lg text-center left-top-sm-bar" data-popup="reFinishPopup" @click="closePopup"><text
|
||
class="cuIcon-close"></text></view>
|
||
<view class="bg-white padding" style="padding-top: 74rpx; min-height: 1000rpx;">
|
||
<view class="text-xxl text-center">上门重做补做提交</view>
|
||
<view class="text-lg text-left">本次售后必须确认已与客户协商一致,并已处理到位,严禁出现再次客诉!现提交给客户验收并结单?</view>
|
||
<view>
|
||
<div class="grid col-3 grid-square">
|
||
<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>
|
||
<view class="solids" @tap="chooseImage" v-if="imgList.length < 6">
|
||
<text class='cuIcon-cameraadd'></text>
|
||
</view>
|
||
</div>
|
||
</view>
|
||
<view style="margin-bottom: 10rpx;">
|
||
<textarea style="width: 100%;box-sizing: border-box;" class="custom-input radius-input" placeholder="请输入理由或备注" cols="30" rows="10" v-model="form.redoCompleteRemark"></textarea>
|
||
</view>
|
||
<view class="cu-bar bg-white solid-top">
|
||
<view class="action margin-0 flex-sub text-black" @tap="closePopup">取消</view>
|
||
<view class="action margin-0 flex-sub text-main-color solid-left" @click="Submit">确认</view>
|
||
</view>
|
||
</view>
|
||
</uni-popup>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
emits: ['confirmFeedback', 'close'],
|
||
props: {
|
||
show: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
curOrder: {
|
||
type: Object,
|
||
default: () => {}
|
||
}
|
||
},
|
||
watch: {
|
||
show: {
|
||
handler(newVal) {
|
||
if(newVal) {
|
||
this.$nextTick(() => {
|
||
this.$refs.reFinishPopup.open()
|
||
})
|
||
}
|
||
},
|
||
immediate: true
|
||
}
|
||
},
|
||
data() {
|
||
return {
|
||
form: {
|
||
redoCompleteRemark: '',
|
||
redoCompleteImages: '',
|
||
},
|
||
imgList: [],
|
||
}
|
||
},
|
||
methods: {
|
||
chooseImage(e) {
|
||
uni.chooseMedia({
|
||
count: 1, //默认9
|
||
mediaType: ['image'],
|
||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||
sourceType: ['album'], //从相册选择
|
||
success: (res) => {
|
||
uni.showLoading({
|
||
title: '上传中',
|
||
mask: true
|
||
});
|
||
res.tempFiles.forEach((fileObj, index) => {
|
||
this.$request.uploadFile(fileObj.tempFilePath).then((url) => {
|
||
this.imgList.push(url);
|
||
if (index === res.tempFiles.length - 1) {
|
||
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)
|
||
}
|
||
}
|
||
})
|
||
},
|
||
changePopup(e) {
|
||
console.log(e);
|
||
if(!e.show) {
|
||
this.closePopup()
|
||
}
|
||
},
|
||
closePopup() {
|
||
this.$emit('close')
|
||
},
|
||
changeRadio(e) {
|
||
this.form.deliveryType = e.target.value
|
||
},
|
||
async Submit() {
|
||
const updateOrderParams = {
|
||
id: this.curOrder.afterServiceRecordList[0].id,
|
||
workerFeedbackResult: 3,
|
||
redoCompleteRemark: this.form.redoCompleteRemark,
|
||
redoCompleteImages: this.imgList.length ? this.imgList.toString() : ''
|
||
}
|
||
|
||
let res = await this.$request.editAfterServiceRecord(updateOrderParams)
|
||
|
||
if (res.code === 0) {
|
||
uni.showToast({
|
||
icon: 'success',
|
||
title: '提交成功',
|
||
duration: 1000
|
||
})
|
||
this.$emit('confirmFeedback')
|
||
} else {
|
||
uni.showToast({
|
||
title: '操作失败',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
}
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
</style> |