|
|
@@ -0,0 +1,148 @@
|
|
|
+<template>
|
|
|
+ <view>
|
|
|
+ <view class="bg-base padding" >
|
|
|
+ <view class="text-xxl ">
|
|
|
+ <text v-if="dataDetail.handleStatus==-1">已撤销</text>
|
|
|
+ <text v-else-if="dataDetail.handleStatus==0">待处理</text>
|
|
|
+ <text v-else-if="dataDetail.handleStatus==1">已处理</text>
|
|
|
+ </view>
|
|
|
+ <view class="text-df padding-top-xs">
|
|
|
+ <text v-if="dataDetail.handleStatus==-1">当前工单已取消</text>
|
|
|
+ <text v-else-if="dataDetail.handleStatus==0">当前工单待处理</text>
|
|
|
+ <text v-else-if="dataDetail.handleStatus==1">当前工单已完成</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="margin-top bg-white padding solid-bottom">
|
|
|
+ <view class="flex justify-between">
|
|
|
+ <view class="text-black">
|
|
|
+ <text>工单编号:{{dataDetail.repairNo}}</text>
|
|
|
+ <text class="text-blue padding-left-sm" @click="copy(dataDetail.repairNo)">复制</text>
|
|
|
+ </view>
|
|
|
+ <view class="text-red">
|
|
|
+ <text v-if="dataDetail.handleStatus==-1">已撤销</text>
|
|
|
+ <text v-else-if="dataDetail.handleStatus==0">待处理</text>
|
|
|
+ <text v-else-if="dataDetail.handleStatus==1">已处理</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-cell-group>
|
|
|
+ <u-cell-item :arrow="false" icon="home" title="所在小区" :value="dataDetail.residentialName"></u-cell-item>
|
|
|
+ <u-cell-item :arrow="false" icon="map" title="维修位置" :value="dataDetail.reportPosition"></u-cell-item>
|
|
|
+ <u-cell-item :arrow="false" icon="clock" title="创建时间" :value="dataDetail.createTime"></u-cell-item>
|
|
|
+ <u-cell-item v-if="dataDetail.handleStatus==1" :arrow="false" icon="clock" title="完成时间" :value="dataDetail.handleTime"></u-cell-item>
|
|
|
+ </u-cell-group>
|
|
|
+ <view class="cu-card dynamic no-card bg-white" style="padding: 30rpx;">
|
|
|
+ <view class="cu-item shadow">
|
|
|
+ <view class=" grid flex-sub col-4 grid-square" >
|
|
|
+ <view @click="previewPic(index,picArr)" v-for="(item,index) in picArr" :key="index" class="bg-img" :style="{backgroundImage: 'url(' + item + ')'}">
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="padding-top-20">
|
|
|
+ <text>故障描述:</text>
|
|
|
+ <text class="content">
|
|
|
+ {{dataDetail.reportDetail}}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="dataDetail.handleStatus==1&&dataDetail.estimateStatus==1" class="margin-top-sm margin-bottom-sm padding bg-white flex" style="box-sizing: border-box;">
|
|
|
+ <view class="">
|
|
|
+ <text class="">工单评价:</text>
|
|
|
+ </view>
|
|
|
+ <view class="flex-sub" >
|
|
|
+ <text class="">{{dataDetail.comment}}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="dataDetail.handleStatus==0" class="footer-fixed padding-sm bg-white flex justify-end margin-right-30" style="box-sizing: border-box;z-index: 999;">
|
|
|
+ <!-- 待处理,取消工单 -->
|
|
|
+ <view class="cu-btn line-red round " @click="cancel()">
|
|
|
+ 取消工单
|
|
|
+ </view>
|
|
|
+ <!-- 已撤销工单,删除工单 -->
|
|
|
+ <view style="margin: 0 10rpx;" @click="handleRepair()" class="cu-btn line-base round " >
|
|
|
+ 处理工单
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ var app=getApp()
|
|
|
+ var that=this
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ //报修编号
|
|
|
+ id:'',
|
|
|
+ content:'',
|
|
|
+ dataDetail:{},
|
|
|
+ picArr:[]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ that=this
|
|
|
+ this.id=options.id
|
|
|
+ this.fetchDataDetail()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ fetchDataDetail(){
|
|
|
+ this.$api.residential.findEstateRepairById(this.id).then(res=>{
|
|
|
+ this.dataDetail=res.data
|
|
|
+ this.picArr=this.dataDetail.pic.split(',')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ previewPic(index,picArr){
|
|
|
+ console.log(index);
|
|
|
+ uni.previewImage({
|
|
|
+ urls:picArr,
|
|
|
+ current:index
|
|
|
+ })
|
|
|
+ },
|
|
|
+ copy(data){
|
|
|
+ uni.setClipboardData({
|
|
|
+ data:data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleRepair(){
|
|
|
+ this.$showModel('确定把该工单置为已处理状态?').then(res=>{
|
|
|
+ let params=this.dataDetail
|
|
|
+ params.handleStatus=1
|
|
|
+ params.estimateStatus=0
|
|
|
+ this.$api.residential.addOrEditEstateRepair(params).then(res=>{
|
|
|
+ this.$showModel('操作成功',false).then(res=>{
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancel(){
|
|
|
+ let that=this
|
|
|
+ uni.showModal({
|
|
|
+ title:"提示",
|
|
|
+ showCancel:true,
|
|
|
+ content:'确定要取消该工单吗?',
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.confirm);
|
|
|
+ if (res.confirm) {
|
|
|
+ that.dataDetail.handleStatus=-1
|
|
|
+ that.$api.residential.addOrEditEstateRepair(that.dataDetail).then(res=>{
|
|
|
+ that.$showModel('操作成功',false).then(res=>{
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+</style>
|