123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <template>
- <div class="repair-detail-box">
- <div
- :class="[
- 'repair-content',
- detailStatus === 'processed' ? 'fixed-page-content' : 'page-content',
- ]"
- >
- <div class="white-box page-1">
- <div class="cell-item">
- <p class="label">当前企业</p>
- <p class="tit">{{ detail.companyName }}</p>
- </div>
- <div class="cell-item">
- <p class="label">您是想</p>
- <div class="tit">{{ detail.type==='1'?'报事':'咨询' }}</div>
- </div>
- <div class="cell-item">
- <p class="label">快捷选择</p>
- <div class="tit">{{ detail.serviceType }}</div>
- </div>
- <div class="block-cell-item">
- <p class="label">报事报修描述</p>
- <div class="tit">
- <div class="textarea">
- {{detail.description}}
- </div>
- </div>
- </div>
- </div>
- <div class="white-box page-2">
- <div class="cell-item">
- <p class="label">位置</p>
- <div class="tit">{{ detail.position==='1'?'室内':'公区' }}</div>
- </div>
- <div class="block-cell-item">
- <p class="label">补充说明</p>
- <div class="tit">
- <ul class="annex-list-box">
- <li
- class="annex-item"
- v-for="(item, index) in explainAnnexList"
- :key="index"
- >
- <img :src="item.url" alt="" v-if="item.type === 'image'" />
- <video
- :src="item.url"
- v-if="item.type === 'video'"
- width="100%"
- height="100%"
- ></video>
- </li>
- </ul>
- </div>
- </div>
- <div class="cell-item flex-item">
- <p class="label">报事人</p>
- <p class="tit tel-box">
- <span>{{ detail.userPhone }}</span>
- <TelNum :num="detail.phone" :showTel="false" />
- </p>
- </div>
- <div class="cell-item">
- <p class="label">报事时间</p>
- <p class="tit">{{ detail.createdAt }}</p>
- </div>
- </div>
- <div class="white-box page-3">
- <div class="custom-item-tit">
- <p class="tit">处理情况</p>
- </div>
- <div class="block-cell-item">
- <p class="label">处理进展</p>
- <div class="tit">
- <van-steps :active="stepActive" :active-color="'#6600FF'">
- <van-step v-for="(item, index) in processSteps" :key="index">{{
- item.label
- }}</van-step>
- </van-steps>
- </div>
- </div>
- <div class="block-cell-item">
- <p class="label">
- 处理后拍照<span class="tips">(支持图片上传限20M内,最多6张)</span>
- </p>
- <div class="tit">
- <ul class="annex-list-box">
- <li
- class="annex-item"
- v-for="(item, index) in processedAnnexList"
- :key="index"
- >
- <img :src="item.url" alt="" v-if="item.type === 'image'" />
- <video
- :src="item.url"
- v-if="item.type === 'video'"
- width="100%"
- height="100%"
- ></video>
- </li>
- </ul>
- </div>
- </div>
- <div class="cell-item flex-item">
- <p class="label">结案人</p>
- <p class="tit tel-box">
- <span>{{ detail.handleUserId }}</span>
- <TelNum :num="detail.hanleUserPhone" :showTel="false" />
- </p>
- </div>
- <div class="cell-item">
- <p class="label">结案时间</p>
- <p class="tit">{{detail.handleTime}}</p>
- </div>
- </div>
- <div class="white-box page-4" v-if="detailStatus === 'processed'||detailStatus === 'evaluated'">
- <div class="custom-item-tit">
- <p class="tit">服务评价</p>
- </div>
- <div class="custom-white-box-content">
- <div class="evaluate-box">
- <p class="evaluate-left">您对本次服务的评价</p>
- <div class="evaluate-right">
- <van-rate v-model="evaluateVal" color="#ffd21e" :readonly="detailStatus !== 'processed'"/>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="repair-bottom bottom-button" v-if="detailStatus === 'processed'">
- <button class="btn" @click="onConfirm">评价提交</button>
- </div>
- </div>
- </template>
- <script>
- import TelNum from '@/components/tel-number'
- import { getById } from '../../service/api_repair'
- import Base from '@/pages/base/base'
- import { editRepair } from '@/service/api_repair'
- import { Toast } from 'vant'
- export default {
- components: {
- TelNum
- },
- data() {
- return {
- dc_key: ['QUICK_SELECTION', 'REPAIR_STATUS'],
- detailId: '', // 详情id
- detailStatus: '', // 详情状态:0、待受理 1、已受理 2、已处理 3、已评价
- explainAnnexList: [
- // {
- // type: 'image',
- // url: require('../../assets/image/reportRepair/shuibiao.jpeg')
- // }
- ], // 说明附件 type image、图片 video、视频
- processedAnnexList: [
- // {
- // type: 'image',
- // url: require('../../assets/image/reportRepair/shuibiao.jpeg')
- // }
- ], // 附件 type image、图片 video、视频
- stepActive: 0, // 当前处理到哪一步
- processSteps: [
- {
- id: 1,
- status: 1,
- label: '上报'
- },
- {
- id: 2,
- status: 1,
- label: '已受理'
- },
- {
- id: 3,
- status: 1,
- label: '已处理'
- },
- {
- id: 4,
- status: 0,
- label: '评价'
- }
- ], // 处理流程
- evaluateVal: 0, // 评分
- id: '',
- detail: {},
- fileUrlList: [],
- params: {
- id: '',
- evaluateNum: '',
- score: ''
- }
- }
- },
- mixins: [Base],
- mounted() {
- this.id = this.$route.query.id
- this.initDict(this.dc_key).then((res) => {
- this.getDetailById()
- })
- },
- methods: {
- onConfirm(value) {
- this.params.evaluateNum = this.params.evaluateNum + 1
- this.params.score = this.params.score + this.evaluateVal
- this.params.status = 'evaluated'
- editRepair(this.params).then((res) => {
- Toast.success('评价成功')
- this.$router.push({ path: 'repairRecord',
- query: { type: this.detail.type }
- })
- })
- },
- getDetailById() {
- const _this = this
- getById({ id: _this.id }).then((res) => {
- console.log(res.data)
- if (res.data) {
- const det = _this.getItemJson(res.data)
- this.detail = det
- this.explainAnnexList = det.fileUrlList
- this.processedAnnexList = det.handleUrlList
- this.detailStatus = det.status
- this.params = {
- id: det.id,
- evaluateNum: det.evaluateNum,
- score: det.score
- }
- this.evaluateVal = ((det.score == null ? 0 : det.score) / (det.evaluateNum == null ? 1 : det.evaluateNum))
- }
- // const item = _this.getItemJson(res)
- })
- },
- getItemJson: function(item) {
- item.releaseTime = this.$common.transDate(item.releaseTime)
- item.createdAt = this.$common.transDate(item.createdAt)
- item.serviceType = this.dc_map.QUICK_SELECTION[item.serviceType]
- if (item.userId) {
- const user = item.userId.split('-')
- item.userPhone = user[1] + '-' + user[2]
- item.phone = user[2]
- }
- if (item.handleUserId) {
- const test = item.handleUserId.split('-')
- item.handleUserId = test[1] + '-' + test[2]
- item.hanleUserPhone = test[2]
- }
- item.handleTime = this.$common.transDate(item.handleTime)
- switch (item.status) {
- case 'unAcceptance':
- this.stepActive = 0
- break
- case 'acceptance':
- this.stepActive = 1
- break
- case 'evaluated':
- this.stepActive = 3
- break
- case 'processed':
- this.stepActive = 2
- break
- }
- const fileUrls = this.$common.castEval(item.fileUrl)
- const fileUrl = []
- if (fileUrls !== null && fileUrls.length > 0) {
- fileUrls.forEach(item => {
- if (item.url) {
- const ul = {
- type: 'image',
- url: item.url.replace('/server', '/smartParkH5Server')
- }
- fileUrl.push(ul)
- }
- })
- }
- item.fileUrlList = fileUrl
- const handleUrls = this.$common.castEval(item.handleUrl)
- const handleUrl = []
- if (handleUrls !== null && handleUrls.length > 0) {
- handleUrls.forEach(item => {
- if (item.url) {
- const ul = {
- type: 'image',
- url: item.url.replace('/server', '/smartParkH5Server')
- }
- handleUrl.push(ul)
- }
- })
- }
- item.handleUrlList = handleUrl
- return item
- },
- /**
- *
- */
- quickSelect(item) {
- if (this.quickSleced.val && this.quickSleced.val === item.val) {
- this.quickSleced = {}
- } else {
- this.quickSleced = item
- }
- },
- /**
- * 上传文件
- */
- afterRead(file) {
- console.log(file)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .repair-detail-box {
- width: 100%;
- height: 100%;
- .page-1 {
- .textarea {
- padding: 20px;
- border-radius: 10px;
- background: $page-color-base;
- box-sizing: border-box;
- }
- }
- .page-4 {
- .evaluate-box {
- padding: 20px 30px;
- background: $page-color-base;
- border: 1px solid #ebedf0;
- border-radius: 100px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- }
- }
- .annex-list-box {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- &::after {
- display: block;
- content: "";
- width: 30%;
- height: 0px;
- }
- .annex-item {
- width: 30%;
- height: 180px;
- border: 1px solid $text4;
- margin-bottom: 20px;
- position: relative;
- overflow: hidden;
- > img {
- width: 100%;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: auto;
- display: block;
- }
- video {
- width: 100%;
- height: 100%;
- }
- }
- }
- .tel-box {
- display: flex;
- align-items: center;
- /deep/ .custom-tel-component {
- margin-left: 20px;
- }
- }
- }
- </style>
|