|
|
@ -2,7 +2,7 @@ |
|
|
|
<div class='pages' v-if="detail"> |
|
|
|
<section> |
|
|
|
<div class="card m-top12"> |
|
|
|
<div class="m-top5 flex flex-center font-bold" v-if="this.selfObj.source === 1"> |
|
|
|
<div class="m-top5 flex flex-center font-pingfangB" v-if="this.selfObj.source === 1"> |
|
|
|
{{ this.detail.title || '--' }}<br> |
|
|
|
</div> |
|
|
|
<div class="m-top5 flex flex-center"> |
|
|
@ -10,11 +10,13 @@ |
|
|
|
{{ detail.serviceTargetName || '--' }} {{ detail.serviceTargetMobile }}<br> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="opacity5 font-size13 m-top5" style="margin-left: 29px;" v-if="selfObj.source != 1">{{ detail.serviceTargetAddress }} |
|
|
|
<div class="opacity5 font-size13 m-top5" style="margin-left: 29px;" v-if="selfObj.source == 4">{{ |
|
|
|
detail.serviceTargetAddress }} |
|
|
|
</div> |
|
|
|
<div class="opacity5 font-size13 m-top5" style="margin-left: 29px;" v-else>{{ detail.serviceTargetAddresses.join(',') }} |
|
|
|
<div class="opacity5 font-size13 m-top5" style="margin-left: 29px;" v-else>{{ |
|
|
|
detail.serviceTargetAddresses.join(',') }} |
|
|
|
</div> |
|
|
|
<div class="m-top5 flex flex-center" v-if="selfObj.source != 1"> |
|
|
|
<div class="m-top5 flex flex-center" v-if="selfObj.source === 4"> |
|
|
|
<img src="@/assets/images/icon/time.png" class="small_img m-right7"> |
|
|
|
<div> |
|
|
|
{{ detail.serviceStartTime || '--' }} |
|
|
@ -22,8 +24,8 @@ |
|
|
|
</div> |
|
|
|
<div class="m-top5 flex flex-center" v-else> |
|
|
|
<img src="@/assets/images/icon/time.png" class="small_img m-right7"> |
|
|
|
<div style="font-size: 15px;"> |
|
|
|
{{ detail.serviceTimeStart || '--' }} 至 {{detail.serviceTimeEnd || '--'}} |
|
|
|
<div style="font-size: 15px;"> |
|
|
|
{{ detail.serviceTimeStart || '--' }} 至 {{ detail.serviceTimeEnd || '--' }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="m-top5 "> |
|
|
@ -37,13 +39,23 @@ |
|
|
|
|
|
|
|
<div class="card m-top12" style="padding: 5px;"> |
|
|
|
<van-cell title="服务类型" :value="sourceName" /> |
|
|
|
<van-cell title="需求分类" :value="detail.categoryName" /> |
|
|
|
<van-cell :title="source === 4 ?'需求分类':'服务类别'" :value="detail.categoryName" /> |
|
|
|
<van-cell title="上报人" :value="detail.serviceTargetName + detail.serviceTargetMobile" |
|
|
|
v-if="selfObj.source != 1" /> |
|
|
|
<van-cell title="上报时间" :value="detail.reportTime" v-if="selfObj.source != 1" /> |
|
|
|
<van-cell title="创建时间" :value="detail.createdTime" v-if="selfObj.source == 1 && selfObj.processStatus === 10" /> |
|
|
|
<van-cell title="指派时间" :value="detail.assignTime" v-if="selfObj.source == 1 && (selfObj.processStatus === 30 ||selfObj.processStatus === 20 )"/> |
|
|
|
<van-cell title="完成时间" :value="detail.assignTime" v-if="selfObj.source == 1 && selfObj.processStatus === 30"/> |
|
|
|
v-if="selfObj.source == 4" /> |
|
|
|
<van-cell title="上报时间" :value="detail.reportTime" v-if="selfObj.source == 4" /> |
|
|
|
<van-cell title="实际服务时间" :value="`${detail.serviceStartTime} 至 ${detail.serviceEndTime}`" |
|
|
|
v-if="selfObj.source == 4" /> |
|
|
|
<van-cell title="评分" v-if="selfObj.source == 4" > |
|
|
|
<template #default> |
|
|
|
<van-rate v-model="detail.score" readonly color="#ffd21e"/> |
|
|
|
</template> |
|
|
|
</van-cell> |
|
|
|
<van-cell title="创建时间" :value="detail.createdTime" |
|
|
|
v-if="selfObj.source != 4 && selfObj.processStatus === 10" /> |
|
|
|
<van-cell title="指派时间" :value="detail.assignTime" |
|
|
|
v-if="selfObj.source != 4 && (selfObj.processStatus === 30 || selfObj.processStatus === 20)" /> |
|
|
|
<van-cell title="完成时间" :value="detail.serviceTimeEnd" |
|
|
|
v-if="selfObj.source != 4 && selfObj.processStatus === 30" /> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
<div class="bto_btn flex flex-center" style="justify-content: end;"> |
|
|
@ -51,9 +63,9 @@ |
|
|
|
<!--processStatus: 10待接单/待指派;20待处理;30已完成 --> |
|
|
|
|
|
|
|
<van-button size="small" type="info" class="m-left12 rounded-corner m-top5-bottom" |
|
|
|
v-if="selfObj.processStatus === 10 && selfObj.source === 1" @click="showScope = true">接单</van-button> |
|
|
|
v-if="selfObj.processStatus === 10 && selfObj.source !== 4" @click="showScope = true">接单</van-button> |
|
|
|
<van-button size="small" type="info" class="m-left12 rounded-corner m-top5-bottom" |
|
|
|
v-if="selfObj.processStatus === 20 && selfObj.source === 1 && selfObj.confirmedFlag === 1" |
|
|
|
v-if="selfObj.processStatus === 20 && selfObj.source !== 4 && selfObj.confirmedFlag === 1" |
|
|
|
@click="handelClickComplete">完成服务</van-button> |
|
|
|
|
|
|
|
<van-button size="small" type="info" class="m-left12 rounded-corner m-top5-bottom" |
|
|
@ -76,23 +88,27 @@ |
|
|
|
</van-dialog> |
|
|
|
<!-- 个性需求完成弹框 --> |
|
|
|
<van-dialog v-model="showComplete" title="我已完成需求人的需求" show-cancel-button :before-close="onBeforeClose"> |
|
|
|
<p>服务开始时间</p> |
|
|
|
<p class="required">服务开始时间</p> |
|
|
|
<span @click="showStart = true, showPopup = true" class="font-size13">{{ actualServiceStartTime || '服务开始时间' |
|
|
|
}}</span><span class="tag-date">至</span><span @click="showEnd = true, showPopup = true" |
|
|
|
class="font-size13">{{ actualServiceEndTime || '服务结束时间' }}</span> |
|
|
|
<p>完成情况</p> |
|
|
|
<p class="required">完成情况</p> |
|
|
|
<van-radio-group v-model="rdFinishResult"> |
|
|
|
<van-radio name="resolved">已解决</van-radio> |
|
|
|
<van-radio name="unresolved">未解决</van-radio> |
|
|
|
</van-radio-group> |
|
|
|
<p>评价</p> |
|
|
|
<van-rate |
|
|
|
v-model="rdScore" |
|
|
|
:size="25" |
|
|
|
color="#ffd21e" |
|
|
|
void-icon="star" |
|
|
|
void-color="#eee" |
|
|
|
/> |
|
|
|
<p>上传图片</p> |
|
|
|
<div class="block"> |
|
|
|
<template> |
|
|
|
<van-uploader v-model="fileList" :after-read="afterRead" :max-count="3" |
|
|
|
:max-size="10 * 1024 * 1024" /> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
<p class="required">评价</p> |
|
|
|
<van-rate v-model="rdScore" :size="25" color="#ffd21e" void-icon="star" void-color="#eee" /> |
|
|
|
<p>备注</p> |
|
|
|
<van-field v-model="rdFinishDesc" rows="2" autosize type="textarea" placeholder="请输入备注" /> |
|
|
|
|
|
|
|
</van-dialog> |
|
|
|
<van-popup v-model="showPopup" position="bottom"> |
|
|
|
<van-datetime-picker v-if="showStart" v-model="serviceTimeStart" type="datetime" title="开始时间" |
|
|
@ -108,6 +124,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { receiveService, getListMyIdentities, getServiceScopeTree, serviceComplete, serviceConfirm } from '@/api/service' |
|
|
|
import { uploadvariedfile } from '@/api/basic' |
|
|
|
import { Dialog } from 'vant'; |
|
|
|
export default { |
|
|
|
data() { |
|
|
@ -132,9 +149,11 @@ export default { |
|
|
|
showRole: false, |
|
|
|
actualServiceStartTime: null,//实际完成时间 |
|
|
|
actualServiceEndTime: null,//实际完成时间 |
|
|
|
showComplete: false, |
|
|
|
rdFinishResult:null, |
|
|
|
rdScore:5 |
|
|
|
showComplete: false,//完成弹框 |
|
|
|
rdFinishResult: null,//是否解决 |
|
|
|
rdScore: 5,//评分 |
|
|
|
fileList: [],//图片上传 |
|
|
|
rdFinishDesc: null,//备注 |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -149,6 +168,21 @@ export default { |
|
|
|
this.sourceName = this.typeList[this.source] |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
afterRead(file) { |
|
|
|
file.status = 'uploading' |
|
|
|
file.message = '上传中...' |
|
|
|
uploadvariedfile(file.file) |
|
|
|
.then(res => { |
|
|
|
file.status = '' |
|
|
|
file.message = '上传成功' |
|
|
|
file.url = res.data.url |
|
|
|
console.log(this.fileList) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
file.status = 'failed' |
|
|
|
file.message = '上传失败' |
|
|
|
}) |
|
|
|
}, |
|
|
|
async confirmService() { |
|
|
|
let { data, code, msg } = await serviceConfirm({ id: this.id }) |
|
|
|
if (code === 0) { |
|
|
@ -166,10 +200,27 @@ export default { |
|
|
|
this.$tips.warning('请选择服务结束时间') |
|
|
|
return done(false) |
|
|
|
} |
|
|
|
this.serviceComplete(this.selfObj.source, this.selfObj.id, this.actualServiceStartTime, this.actualServiceEndTime) |
|
|
|
if (!this.rdScore) { |
|
|
|
this.$tips.warning('请进行评价') |
|
|
|
return done(false) |
|
|
|
} |
|
|
|
if (!this.rdFinishResult) { |
|
|
|
this.$tips.warning('请选择完成情况') |
|
|
|
return done(false) |
|
|
|
} |
|
|
|
let parm = { |
|
|
|
source: this.selfObj.source, |
|
|
|
id: this.selfObj.id, |
|
|
|
actualServiceStartTime: this.actualServiceStartTime, |
|
|
|
actualServiceEndTime: this.actualServiceEndTime, |
|
|
|
rdScore: this.rdScore, |
|
|
|
rdFinishResult: this.rdFinishResult, |
|
|
|
rdFinishAttachments: this.fileList.map(item => ({ originFileName: item.file.name, type: item.file.type, format: 'image', url: item.url })), |
|
|
|
rdFinishDesc: this.rdFinishDesc |
|
|
|
} |
|
|
|
this.serviceComplete(parm) |
|
|
|
done(true) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 点击了取消按钮 |
|
|
|
else { |
|
|
@ -178,19 +229,19 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handelClickComplete() { |
|
|
|
if (this.selfObj.source === 1) { |
|
|
|
if (this.selfObj.source != 4) { |
|
|
|
Dialog.confirm({ |
|
|
|
message: `确定已完成${this.detail.title}服务吗?`, |
|
|
|
message: `确定已完成“${this.detail.title}”服务吗?`, |
|
|
|
}).then(() => { |
|
|
|
this.serviceComplete(this.selfObj.source, this.selfObj.id) |
|
|
|
this.serviceComplete(this.selfObj) |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
async serviceComplete(source, id, actualServiceStartTime, actualServiceEndTime) { |
|
|
|
let { code } = await serviceComplete({ source, id, actualServiceStartTime, actualServiceEndTime }) |
|
|
|
async serviceComplete(parm) { |
|
|
|
let { code } = await serviceComplete(parm) |
|
|
|
if (code === 0) { |
|
|
|
this.$toast.success('服务完成') |
|
|
|
this.$tips.success('服务完成') |
|
|
|
this.$router.go(-1) |
|
|
|
} |
|
|
|
}, |
|
|
@ -222,7 +273,7 @@ export default { |
|
|
|
console.log(parm); |
|
|
|
let { data, code, msg } = await receiveService(parm) |
|
|
|
if (code === 0) { |
|
|
|
this.$toast.success('接单成功') |
|
|
|
this.$tips.success('接单成功') |
|
|
|
this.showRole = false; |
|
|
|
this.showScope = false; |
|
|
|
this.$router.back() |
|
|
|