移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

405 lines
10 KiB

2 months ago
<template>
2 months ago
<scroll-view class="view-container" scroll-y>
<view class="box detail" style="margin-bottom: 12px">
3 weeks ago
<text class="wd-font-800 wd-text-16">
2 months ago
{{ detail.title }}
</text>
<view class="tagList">
2 months ago
<view class="tag" v-if="detail.priority">
{{ $dict.echoDicValue(dictMap.task_priority, detail.priority) }}
</view>
2 months ago
<view
v-for="(tag, index) in detail.tagList"
:key="index"
class="tag"
>
{{ tag }}
</view>
</view>
<view
class="wd-flex wd-text-13"
style="justify-content: space-between"
>
3 weeks ago
<view class="wd-flex" style="align-items: center; gap: 8rpx">
2 months ago
<u-icon name="calendar" color="#17C653" />
2 months ago
<text class="wd-text-13 wd-ml-4px wd-font-800">
2 months ago
{{
`${$util.formatDate(
detail.startDate,
'YYYY年M月D日'
)} ${$util.formatDate(detail.endDate, 'YYYY年M月D日')}`
2 months ago
}}
</text>
</view>
</view>
3 weeks ago
<cs-text-more :value="detail.description"></cs-text-more>
2 months ago
<view
class="wd-flex wd-items-center enterprise"
@tap="goEnterprise(detail.enterprise)"
>
<u-avatar
:src="detail.enterprise.files[0].url"
shape="square"
size="64"
></u-avatar>
3 weeks ago
<view class="wd-flex wd-flex-col">
2 months ago
<text class="wd-font-800 wd-text-15">
{{ detail.enterprise.enterprisesName }}
</text>
3 weeks ago
<view class="wd-flex" style="margin-top: 4rpx">
<u-icon name="map" size="28rpx" color="#17C653"></u-icon>
<text class="address wd-text-12" style="margin-left: 8rpx">
2 months ago
{{ detail.enterprise.address }}
</text>
</view>
3 weeks ago
<view class="tagList" style="margin-top: 16rpx">
2 months ago
<view class="tag" v-if="detail.enterprise.region">
{{
$dict.echoDicValue(
dictMap.enterprises_area,
detail.enterprise.region
)
}}
</view>
<view class="tag" v-if="detail.enterprise.type">
{{
$dict.echoDicValue(
dictMap.enterprises_type,
detail.enterprise.type
)
}}
</view>
2 months ago
<view
class="tag"
v-for="(tag, index) in detail.enterprise.tagList"
:key="index"
>
{{ tag }}
</view>
</view>
</view>
</view>
<view class="audit">
<cs-dict-tag
:dict="dictMap.task_state"
:value="detail.status"
></cs-dict-tag>
</view>
</view>
2 months ago
<view class="box record">
2 months ago
<view class="wd-text-14 wd-font-800">结果反馈</view>
<view
class="row log"
v-for="item in list"
:key="item.id"
@tap="goLog(item)"
>
3 weeks ago
<view style="margin-bottom: 24rpx">
2 months ago
<text
:style="{
3 weeks ago
marginRight: '20rpx',
2 months ago
fontWeight: 'bold',
2 months ago
color: $dict.echoDictOption(
3 weeks ago
dictMap.Inspections_status,
2 months ago
item.status
).remark
2 months ago
}"
>
3 weeks ago
{{
$dict.echoDicValue(dictMap.Inspections_status, item.status)
}}
2 months ago
</text>
<text>
{{ $util.formatDate(item.createTime, 'YYYY/M/D h:m') }}
</text>
</view>
1 month ago
<scroll-view
scroll-x="true"
style="flex-flow: row nowrap; white-space: nowrap"
>
2 months ago
<view
class="row"
v-for="people in item.userList"
:key="people.userId"
3 weeks ago
style="display: inline-flex; gap: 24rpx; margin-right: 24rpx"
2 months ago
>
<u-avatar
:src="people.avtar"
3 weeks ago
size="80rpx"
2 months ago
shape="circle"
></u-avatar>
3 weeks ago
<view class="wd-flex wd-flex-col" style="gap: 4rpx">
2 months ago
<text>{{ people.realName }}</text>
<text>{{ people.deptName }}</text>
</view>
</view>
</scroll-view>
</view>
<view class="emty" v-if="list.length == 0">
2 months ago
<image
class="image"
src="/static/images/emty.png"
mode="aspectFill"
></image>
<text class="wd-text-14" style="color: #99a1b7">暂无处理结果</text>
</view>
2 months ago
<view class="audit">
<cs-dict-tag
3 weeks ago
:dict="dictMap.inspections_mark"
2 months ago
:value="inspectionsState"
color="#fff"
:bgColor="setColor(inspectionsState)"
></cs-dict-tag>
</view>
2 months ago
</view>
<cs-bottom-wrapper>
2 months ago
<view
class="operation"
v-if="[null, 0, 3].includes(inspectionsState)"
>
2 months ago
<view class="btn green" @tap="locate">执法签到</view>
</view>
<view class="operation" v-else-if="inspectionsState == 1">
<view class="btn red" @tap="tackle(3)">整改处理</view>
<view class="btn green" @tap="tackle(2)">审批通过</view>
</view>
<view class="operation" v-else>
<view class="btn grey">任务完成</view>
2 months ago
</view>
</cs-bottom-wrapper>
2 months ago
</scroll-view>
2 months ago
</template>
<script>
import { getDeptTree, getDictBatchByType } from '@/api/system/dict.js'
import { TaskApi } from '@/api/task/index.js'
import { getEnterPrise } from '@/api/enterprise/index.js'
2 months ago
import { InspectionsApi } from '../../api/inspections'
2 months ago
export default {
data() {
return {
dictMap: {},
// 任务详情
detail: {
id: '',
2 months ago
description: '',
priority: '',
enterprise: {
region: '',
type: ''
}
2 months ago
},
// 是否展开文本
isShowAllText: false,
// 查询条件
queryParams: {
taskId: '',
2 months ago
recordId: '',
enterpriseId: ''
2 months ago
},
2 months ago
list: [],
inspectionsState: null
2 months ago
}
},
onLoad(res) {
this.queryParams.taskId = res.taskId
this.queryParams.recordId = res.recordId
this.queryParams.enterpriseId = res.enterpriseId
this.getDict()
this.init()
},
2 months ago
onShow() {
this.init()
},
2 months ago
methods: {
/**
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({
2 months ago
type: [
'Inspections_status',
'task_state',
'inspections_mark',
'enterprises_type',
'enterprises_area',
'task_priority'
].join(',')
2 months ago
})
const dept = await getDeptTree()
this.dictMap = {
...dict.data,
dept: dept.data
}
},
async init() {
const res = await TaskApi.getDetail(this.queryParams.taskId)
const enterprise = await getEnterPrise(this.queryParams.enterpriseId)
this.detail = {
...res.data,
enterprise: enterprise.data
}
2 months ago
const feedBack = await InspectionsApi.getFeedBack(
this.queryParams.recordId
)
2 months ago
this.list = feedBack.data
1 month ago
this.inspectionsState =
this.list[this.list.length - 1]?.status || null
2 months ago
},
goEnterprise(enterprise) {
uni.navigateTo({
url: `/sub/enterprise/detail?id=${enterprise.id}`
2 months ago
})
},
2 months ago
viewPosition(enterprise) {
const position = enterprise.gpsLocation
.split(',')
.map(i => Number(i))
this.$util.viewPosition({
lat: position[0],
lng: position[1],
name: enterprise.enterprisesName,
address: enterprise.address
2 months ago
})
},
2 months ago
locate() {
2 months ago
uni.navigateTo({
2 months ago
url: `/sub/task/locate?inspectionsId=${this.queryParams.recordId}&enterpriseId=${this.queryParams.enterpriseId}`
2 months ago
})
2 months ago
},
setColor(status) {
2 months ago
const colorMap = {
1: '#F6B100',
2: '#17C653',
3: '#F8285A'
}
return colorMap[status]
2 months ago
},
tackle(state) {
uni.navigateTo({
url: `/sub/task/enforce?state=${state}&inspectionsId=${this.queryParams.recordId}`
})
2 months ago
},
goLog(record) {
if ([2, 3].includes(record.status)) {
uni.navigateTo({
url: `/sub/task/log?id=${record.id}`
})
}
2 months ago
}
}
}
</script>
<style lang="scss" scoped>
.view-container {
3 weeks ago
padding: 0 24rpx;
2 months ago
position: relative;
3 weeks ago
padding-bottom: 200rpx;
2 months ago
.box {
background-color: #fff;
border-radius: $cs-border-radius;
3 weeks ago
padding: 32rpx;
margin-top: 24rpx;
2 months ago
}
2 months ago
.row {
border-radius: $cs-border-radius;
3 weeks ago
padding: 24rpx;
border: 2rpx solid #f9f9f9;
2 months ago
}
2 months ago
.detail {
display: flex;
flex-flow: column nowrap;
3 weeks ago
gap: 24rpx;
2 months ago
position: relative;
overflow: hidden;
3 weeks ago
2 months ago
.enterprise {
3 weeks ago
border: 2rpx solid #f9f9f9;
padding: 24rpx;
2 months ago
border-radius: $cs-border-radius;
3 weeks ago
gap: 24rpx;
2 months ago
position: relative;
overflow: hidden;
3 weeks ago
font-size: 24rpx;
2 months ago
.address {
color: $uni-text-color-grey;
}
&:active {
background-color: $cs-color-touch;
}
}
.audit {
position: absolute;
right: 0;
top: 0;
3 weeks ago
transform: translateX(36rpx) translateY(32rpx) rotateZ(45deg);
2 months ago
transform-origin: 50% 50%;
}
}
2 months ago
.record {
2 months ago
position: relative;
overflow: hidden;
2 months ago
display: flex;
flex-flow: column nowrap;
3 weeks ago
gap: 24rpx;
2 months ago
.emty {
display: flex;
flex-direction: column;
align-items: center;
3 weeks ago
gap: 24rpx;
border-radius: 16rpx;
border: 2rpx solid var(--LightMode-Grey-Grey-100, #f9f9f9);
padding: 48rpx 24rpx;
border-radius: 16rpx;
2 months ago
.image {
3 weeks ago
width: 128rpx;
height: 128rpx;
2 months ago
}
}
2 months ago
.audit {
position: absolute;
right: 0;
top: 0;
3 weeks ago
transform: translateX(60rpx) translateY(16rpx) rotateZ(45deg);
2 months ago
transform-origin: 50% 50%;
}
2 months ago
}
2 months ago
.log {
&:active {
background-color: $cs-color-touch;
}
}
2 months ago
.operation {
3 weeks ago
padding: 24rpx;
2 months ago
display: flex;
align-items: center;
justify-content: center;
3 weeks ago
gap: 24rpx;
2 months ago
.btn {
flex: 1;
3 weeks ago
border-radius: 16rpx;
2 months ago
display: flex;
3 weeks ago
padding: 24rpx 0;
2 months ago
align-items: center;
justify-content: center;
2 months ago
}
.green {
2 months ago
background-color: $cs-color-main;
color: #fff;
}
2 months ago
.red {
background-color: #f8285a;
color: #fff;
}
.grey {
background-color: #f1f1f4;
color: #99a1b7;
}
2 months ago
}
2 months ago
}
</style>