Browse Source

反馈详情

master
parent
commit
94e812385a
  1. 11
      api/enterprise/index.js
  2. 29
      api/inspections/index.js
  3. 2
      components/cs-bottom-wrapper/index.vue
  4. 4
      components/cs-dict-tag/index.vue
  5. 11
      pages.json
  6. 33
      pages/enterprise.vue
  7. 1
      static/scss/global.scss
  8. 323
      sub/enterprise/detail.vue
  9. 8
      sub/task/detail.vue
  10. 184
      sub/task/enforce.vue
  11. 34
      sub/task/locate.vue
  12. 113
      sub/task/log.vue
  13. 100
      sub/task/record.vue
  14. 13
      utils/dict.js
  15. 11
      utils/ruoyi.js

11
api/enterprise/index.js

@ -33,4 +33,15 @@ export function getEnterPrise(id) {
url: `/system/enterprise/get?id=${id}`,
method: 'GET',
})
}
/**
* 审核企业
* @param {Object} id
*/
export function checkEnterprise(id) {
return request({
url: `/system/enterprise/audit?id=${id}`,
method: 'PUT',
})
}

29
api/inspections/index.js

@ -12,15 +12,7 @@ export const InspectionsApi = {
params
})
},
/**
* 获取详情
*/
getDetail: (id) => {
return request({
url: `/system/enterprise-inspections/appGet?id=${id}`,
method: 'GET',
})
},
/**
* 获取反馈结果
*/
@ -68,5 +60,24 @@ export const InspectionsApi = {
method: 'PUT',
data
})
},
/**
* 执法反馈
*/
feeback: data => {
return request({
url: `/system/inspections-log/inspectionsAudit`,
method: 'POST',
data
})
},
/**
* 反馈详情
*/
feedBackDetail: id => {
return request({
url: `/system/inspections-log/get?id=${id}`,
method: 'GET',
})
}
}

2
components/cs-bottom-wrapper/index.vue

@ -21,7 +21,7 @@ export default {
<style lang="scss" scoped>
.view {
position: absolute;
position: fixed;
bottom: 0;
left: 0;
width: 100%;

4
components/cs-dict-tag/index.vue

@ -88,6 +88,10 @@ export default {
color: #f8285a;
background-color: #ffeef3;
}
.danger {
color: #f8285a;
background-color: #ffeef3;
}
.info {
background-color: #f1f1f4;
color: #99a1b7;

11
pages.json

@ -83,7 +83,10 @@
}, {
"path": "enterprise/detail",
"style": {
"navigationBarTitleText": "企业详情"
"navigationBarTitleText": "企业详情",
"componentPlaceholder": {
"u-modal": "view"
}
}
}, {
"path": "chat/index",
@ -137,6 +140,12 @@
"uni-easyinput": "view"
}
}
},
{
"path": "task/log",
"style": {
"navigationBarTitleText": "结果反馈"
}
}
]
}],

33
pages/enterprise.vue

@ -78,6 +78,22 @@
</text>
</view>
<view class="tagList">
<view class="tag">
{{
$dict.echoDicValue(
dictMap.enterprises_type,
enterprise.type
)
}}
</view>
<view class="tag">
{{
$dict.echoDicValue(
dictMap.enterprises_area,
enterprise.region
)
}}
</view>
<view
class="tag"
v-for="(tag, index) in enterprise.tagList"
@ -89,15 +105,10 @@
</view>
<view
class="audit"
v-if="enterprise.audit != 2"
:style="{
color: enterprise.audit == 1 ? '#F6B100' : '#ea000c',
backgroundColor: '#FFF8DD'
}"
v-if="!isAudit"
style="color: #f6b100; background-color: #fff8dd"
>
{{
$dict.echoDicValue(dictMap.user_audit_type, enterprise.audit)
}}
待审核
</view>
</view>
<u-loadmore :status="load" marginTop="12" marginBottom="12" />
@ -177,7 +188,11 @@ export default {
async getDict() {
const tags = await getTagData(['qy', ' hy', 'st', 'wr'].join(','))
const dict = await getDictBatchByType({
type: ['user_audit_type'].join(',')
type: [
'user_audit_type',
'enterprises_type',
'enterprises_area'
].join(',')
})
let tagMap = {}
tags.data.forEach(t => {

1
static/scss/global.scss

@ -1,6 +1,7 @@
page {
background-color: #f9f9f9;
position: relative;
color: #071437;
}
button {

323
sub/enterprise/detail.vue

@ -1,115 +1,154 @@
<template>
<cs-page isCustom>
<template #header>
<view
class="wd-flex wd-flex-row wd-flex-center"
style="position: relative"
@click="goBack"
>
<view class="icon-box">
<u-icon name="arrow-left" size="12"></u-icon>
</view>
<view class="wd-font-800 wd-text-16">企业档案</view>
<scroll-view class="detail-container" scroll-y>
<view class="box detail">
<view>
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">
{{ detail.enterprisesName }}
</text>
</view>
</template>
<view class="detail-container">
<view class="box detail">
<view>
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">
{{ detail.enterprisesName }}
</text>
</view>
<view class="address">
<u-icon name="map" size="14" color="#17C653"></u-icon>
<text style="text-decoration: underline">
{{ detail.address }}
</text>
<view class="address" @click="goView(detail)">
<u-icon name="map" size="14" color="#17C653"></u-icon>
<text style="text-decoration: underline">
{{ detail.address }}
</text>
</view>
<view class="tagList">
<view class="tag">
{{ $dict.echoDicValue(dictMap.enterprises_type, detail.type) }}
</view>
<view class="wd-flex" style="align-items: center">
<text class="address" style="margin-right: 8px">环保负责人</text>
<text style="margin-right: 16px">
{{ detail.enterprisesName }}
</text>
<text class="address" style="margin-right: 8px">联系方式</text>
<text style="text-decoration: underline">
{{ detail.environmentalContactPhone }}
</text>
<view class="tag">
{{ $dict.echoDicValue(dictMap.enterprises_area, detail.region) }}
</view>
<view class="images-box">
<image
v-for="(src, index) in detail.files"
:key="index"
:src="src.url"
mode="widthFix"
class="image"
></image>
<view
class="tag"
v-for="(tag, index) in detail.tagList"
:key="index"
>
{{ tag }}
</view>
<text class="address">{{ detail.introduction }}</text>
</view>
<view class="wd-flex" style="align-items: center">
<text class="address" style="margin-right: 8px">环保负责人</text>
<text style="margin-right: 16px">
{{ detail.enterprisesName }}
</text>
<text class="address" style="margin-right: 8px">联系方式</text>
<text style="text-decoration: underline">
{{ detail.environmentalContactPhone }}
</text>
</view>
<view class="images-box">
<image
v-for="(src, index) in detail.files"
:key="index"
:src="src.url"
mode="widthFix"
class="image"
></image>
</view>
<text class="address">{{ detail.introduction }}</text>
<view class="status">
<cs-dict-tag
:dict="dictMap.enterprises_status"
:value="detail.enterprisesStatus"
></cs-dict-tag>
</view>
</view>
<view
class="box wd-text-12"
v-for="prove in detail.qualificationList"
:key="prove.id"
>
<view class="wd-flex" style="gap: 8px">
<image
src="@/static/images/enterprise/zz.png"
style="width: 90px; height: 70px"
mode="widthFix"
></image>
<view
style="flex: 1; justify-content: space-between"
class="wd-flex wd-flex-col"
>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质名称</text>
<view>
{{
$dict.echoDicValue(
dictMap.enterprise_qua,
prove.qualificationName.toString()
)
}}
</view>
<view
class="box wd-text-12 prove"
v-for="prove in detail.qualificationList"
:key="prove.id"
>
<view class="wd-flex" style="gap: 8px; position: relative">
<image
src="@/static/images/enterprise/zz.png"
style="width: 90px; height: 70px"
mode="widthFix"
></image>
<view
style="flex: 1; justify-content: space-between"
class="wd-flex wd-flex-col"
>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质名称</text>
<view>
{{
$dict.echoDicValue(
dictMap.enterprise_qua,
prove.qualificationName.toString()
)
}}
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质编号</text>
<view>
{{ prove.enterpriseAuth }}
</view>
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质编号</text>
<view>
{{ prove.enterpriseAuth }}
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质时限</text>
<view>
{{ $util.formatDate(prove.handleDate, 'YYYY/M/D') }}~
{{ $util.formatDate(prove.expiryDate, 'YYYY/M/D') }}
</view>
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质时限</text>
<view>
{{ $util.formatDate(prove.handleDate, 'YYYY/M/D') }} ~
{{ $util.formatDate(prove.expiryDate, 'YYYY/M/D') }}
</view>
</view>
</view>
</view>
<view class="status">
<cs-dict-tag
:dict="dictMap.enterprise_qualification_status"
:value="prove.status"
></cs-dict-tag>
</view>
</view>
<view class="box">
<view class="wd-font-800">执法记录</view>
<cs-bottom-wrapper>
<view class="operation">
<view
class="btn green"
@tap="showModel = true"
v-if="!detail.isAudit"
>
确认审核
</view>
<view :class="['btn', 'grey']">执法记录</view>
</view>
</cs-bottom-wrapper>
<view class="button-box">
<view class="button">确认审核</view>
<u-modal
:show="showModel"
confirmText="返回"
showCancelButton
cancel-text="确认"
cancel-color="#17C653"
confirm-color="#071437"
@confirm="showModel = false"
@cancel="postApi"
>
<view class="wd-flex wd-flex-col wd-flex-center" style="gap: 10px">
<view style="font-size: 18px; color: #071437; font-weight: 800">
是否审核?
</view>
<view class="">请确保企业信息真实性</view>
</view>
</view>
</cs-page>
</u-modal>
</scroll-view>
</template>
<script>
import { getEnterPrise } from '@/api/enterprise/index.js'
import { getEnterPrise, checkEnterprise } from '@/api/enterprise/index.js'
import { getDictBatchByType } from '@/api/system/dict.js'
export default {
data() {
return {
detail: {
id: ''
id: '',
type: '',
region: ''
},
showModel: false,
dictMap: {}
}
},
@ -126,7 +165,12 @@ export default {
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['enterprises_type', 'enterprise_qua'].join(',')
type: [
'enterprises_type',
'enterprises_area',
'enterprises_status',
'enterprise_qualification_status'
].join(',')
})
this.dictMap = {
...dict.data
@ -140,6 +184,30 @@ export default {
uni.switchTab({
url: '/pages/enterprise'
})
},
goView(enterprise) {
if (!enterprise.gpsLocation) {
uni.showToast({
icon: 'none',
title: '暂无gps信息'
})
return
}
const position = enterprise.gpsLocation.split(',')
this.$util.viewPosition({
lat: position[0],
lng: position[1],
name: enterprise.enterprisesName
})
},
postApi() {
checkEnterprise(this.detail.id).then(() => {
uni.showToast({
icon: 'none',
title: '操作成功'
})
this.showModel = false
})
}
}
}
@ -165,8 +233,46 @@ export default {
gap: 5px;
color: $uni-text-color-grey;
}
.tagList {
display: flex;
gap: 4px;
color: $uni-text-color-grey;
display: flex;
.tag {
font-size: 12px;
display: flex;
padding: 2px 6px;
justify-content: center;
align-items: center;
border-radius: 2px;
background: #f9f9f9;
}
}
.status {
position: absolute;
right: -19px;
top: 6px;
transform: rotateZ(45deg) translateX(20px) translateY(-20px);
transform-origin: 50% 50%;
padding: 4px 20px;
font-size: 12px;
text-align: center;
}
}
.prove {
position: relative;
overflow: hidden;
.status {
position: absolute;
right: -19px;
top: 6px;
transform: rotateZ(45deg) translateX(20px) translateY(-20px);
transform-origin: 50% 50%;
padding: 4px 20px;
font-size: 12px;
text-align: center;
}
}
.images-box {
display: flex;
flex-flow: row nowrap;
@ -178,6 +284,7 @@ export default {
}
}
}
.label {
color: $uni-text-color-grey;
}
@ -185,33 +292,27 @@ export default {
position: absolute;
left: 0;
}
.button-box {
width: 100%;
bottom: 0;
position: fixed;
background-color: #fff;
.operation {
padding: 12px;
display: flex;
left: 0;
padding: var(--Number-12px, 12px);
padding-bottom: 25px;
align-items: center;
gap: var(--Number-12px, 12px);
.button {
justify-content: center;
gap: 12px;
.btn {
flex: 1;
border-radius: 8px;
display: flex;
padding: var(--Number-12px, 12px) 0px;
justify-content: center;
padding: 12px 0;
align-items: center;
gap: var(--Number-12px, 12px);
flex: 1 0 0;
background: #17c653;
border-radius: var(--Number-4px, 4px);
background: var(--LightMode-Success-Success-Light, #eafff1);
color: var(--LightMode-Success-Success, #17c653);
text-align: center;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: normal;
justify-content: center;
}
.green {
background-color: $cs-color-main;
color: #fff;
}
.grey {
background: #f1f1f4;
color: #99a1b7;
}
}
</style>

8
sub/task/detail.vue

@ -137,7 +137,7 @@
isSelect: isSelect.includes(record.id)
}"
@tap.native.stop="select(record.id)"
v-if="[3, null].includes(record.inspectionStatus)"
v-if="['3', null].includes(record.inspectionStatus)"
>
<u-icon name="checkbox-mark" size="16px" color="#fff"></u-icon>
</view>
@ -684,6 +684,12 @@ export default {
box-shadow: none;
--dropdown-menu-title-font-size: 13px;
--dropdown-menu-title-text-color: #071437;
.van-dropdown-menu__item {
flex: 0;
.van-dropdown-menu__title {
width: 80px;
}
}
}
}
.isTop {

184
sub/task/enforce.vue

@ -32,38 +32,180 @@
</view>
</view>
<u-upload
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
:fileList="form.photo"
@afterRead="addPhoto"
@delete="delPhoto"
multiple
:maxCount="10"
:maxCount="3"
width="96px"
height="96px"
></u-upload>
</view>
<view class="box" v-if="form.state == 3">
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
@tap="showCalender"
>
<view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 4px">*</text>
截止日期
</view>
<view class="wd-flex" style="gap: 4px; align-items: center">
<text style="color: #f8285a">
{{ $util.formatDate(form.date, 'YYYY年M月D日') }}
</text>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
<cs-bottom-wrapper>
<view class="operation">
<view :class="['btn', form.state == 2 ? 'green' : 'red']">
<view
:class="['btn', form.state == 2 ? 'green' : 'red']"
@tap="submit"
>
{{ form.state == 2 ? '审批通过' : '整改处理' }}
</view>
</view>
</cs-bottom-wrapper>
<uni-calendar
ref="calendarRef"
:insert="false"
@confirm="confirmCalendar"
/>
<u-modal
:show="showModel"
confirmText="返回"
showCancelButton
:cancel-text="form.state == 2 ? '通过' : '整改'"
:cancel-color="form.state == 2 ? '#17C653' : '#F8285A'"
confirm-color="#071437"
@confirm="showModel = false"
@cancel="postApi"
>
<view class="wd-flex wd-flex-col wd-flex-center" style="gap: 10px">
<view style="font-size: 18px; color: #071437; font-weight: 800">
{{ form.state == 2 ? '是否通过?' : '是否整改?' }}
</view>
<view class="">确认后不可再次修改</view>
</view>
</u-modal>
</view>
</template>
<script>
import { uploadFile } from '@/api/system/file.js'
import { InspectionsApi } from '@/api/inspections/index.js'
export default {
data() {
return {
form: {
state: undefined,
inspectionsId: undefined,
advice: undefined
}
advice: undefined,
photo: undefined,
date: ''
},
showModel: false
}
},
onLoad(res) {
this.form.state = res.state
this.inspectionsId = res.inspectionsId
this.form.inspectionsId = res.inspectionsId
},
methods: {
/**
* 选择图片并上传
* @param {Object} e
*/
async addPhoto(e) {
this.form.photo = e.file.map(p => {
return {
...p,
status: 'uploading',
message: '上传中'
}
})
// 使promise.all()
await Promise.all(
this.form.photo.map(async (p, i) => {
const res = await uploadFile({ name: `file`, filePath: p.url })
return {
...res.data,
status: 'success',
message: ''
}
})
).then(res => {
this.form.photo = res
})
},
/**
* 删除图片
* @param {Object} e
*/
delPhoto(e) {
this.form.photo.splice(e.index, 1)
},
confirmCalendar(e) {
this.form.date = e.fulldate
},
showCalender() {
this.$refs.calendarRef.open()
},
postApi() {
const data = {
...this.form,
status: this.form.state,
feedBack: this.form.advice,
fileIds: this.form.photo.map(i => i.file_id),
correctionTime: new Date(this.form.date).getTime()
}
InspectionsApi.feeback(data).then(res => {
uni.showToast({
icon: 'none',
title: '操作成功'
})
uni.navigateBack()
})
},
async submit() {
const validate = await this.validate()
if (validate.msg) {
uni.showToast({
icon: 'error',
title: validate.msg
})
return
}
this.showModel = true
},
validate() {
return new Promise(resolve => {
if (!this.form.advice) {
resolve({
state: false,
msg: '请填写处理意见'
})
}
if (!this.form.photo) {
resolve({
state: false,
msg: '请上传证明'
})
}
if (!this.form.date && this.form.state == 3) {
resolve({
state: false,
msg: '请选择日期'
})
}
resolve(true)
})
}
}
}
</script>
@ -78,6 +220,7 @@ export default {
border: 1px solid #f9f9f9;
border-radius: 12px;
background-color: #fff;
margin-bottom: 12px;
}
.operation {
padding: 12px;
@ -106,4 +249,29 @@ export default {
::v-deep .uni-easyinput__content-textarea {
min-height: 400rpx;
}
::v-deep .u-upload__button {
border-radius: 8px !important;
border: 1px solid #f1f1f4;
background-color: #f9f9f9 !important;
}
::v-deep .u-upload__wrap {
.u-upload__wrap__preview {
width: 192rpx;
height: 192rpx;
border-radius: 8px !important;
overflow: visible !important;
.u-upload__wrap__preview__image {
border-radius: 8px !important;
}
.u-upload__deletable {
border-radius: 100% !important;
background-color: #f8285a !important;
transform: translateX(50%) translateY(-50%);
.u-upload__deletable__icon {
position: relative;
}
}
}
}
</style>

34
sub/task/locate.vue

@ -211,6 +211,17 @@ export default {
this.timer && clearInterval(this.timer)
return false
},
watch: {
list: {
handler: function (val) {
if (val.length >= 2) {
this.timer && clearInterval(this.timer)
}
},
immediate: true,
deep: true
}
},
methods: {
async init() {
const miniCode = await getMiniCode({
@ -331,18 +342,19 @@ export default {
},
echoQueset() {
const timeout = 3 * 60 * 1000
// const timeout = 10 * 1000
this.timer && clearInterval(this.timer)
// this.timer = setInterval(() => {
// this.getLocateList()
// this.time += 5000
// if (this.time > timeout) {
// console.log('timeout')
// clearInterval(this.timer)
// uni.navigateBack({
// delta: 1
// })
// }
// }, 5 * 1000)
this.timer = setInterval(() => {
this.getLocateList()
this.time += 5000
if (this.time > timeout) {
console.log('timeout')
clearInterval(this.timer)
uni.navigateBack({
delta: 1
})
}
}, 5 * 1000)
},
goNext() {
InspectionsApi.beginEnforce({

113
sub/task/log.vue

@ -0,0 +1,113 @@
<template>
<view class="view-container">
<view class="box">
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
>
<view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 4px">*</text>
处理意见
</view>
</view>
<view style="color: #071437">{{ detail.feedBack }}</view>
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
>
<view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 4px">*</text>
上传证明
</view>
</view>
<view class="imageList">
<image
:src="photo.url"
v-for="photo in detail.fileList"
:key="photo.id"
mode="aspectFill"
class="image"
></image>
</view>
</view>
<view class="box" v-if="detail.status == 3">
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
>
<view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 4px">*</text>
截止日期
</view>
<view class="wd-flex" style="gap: 4px; align-items: center">
<text style="color: #f8285a">
{{ $util.formatDate(detail.correctionTime, 'YYYY年M月D日') }}
</text>
</view>
</view>
</view>
</view>
</template>
<script>
import { getDictBatchByType } from '@/api/system/dict.js'
import { InspectionsApi } from '@/api/inspections/index.js'
export default {
data() {
return { detail: {}, dictMap: {} }
},
async onLoad(res) {
this.detail.id = res.id
await this.getDict()
},
onShow() {
this.getDetail()
},
methods: {
getDetail() {
InspectionsApi.feedBackDetail(this.detail.id).then(res => {
this.detail = res.data
})
},
/**
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['inspections_mark'].join(',')
})
this.dictMap = {
...dict.data
}
}
}
}
</script>
<style lang="scss" scoped>
.view-container {
padding: 12px;
display: flex;
gap: 12px;
flex-direction: column;
.box {
padding: 12px;
border-radius: 8px;
background-color: #fff;
display: flex;
flex-flow: column nowrap;
gap: 12px;
.imageList {
display: flex;
gap: 12px;
.image {
width: 192rpx;
height: 192rpx;
border-radius: 8px;
}
}
}
}
</style>

100
sub/task/record.vue

@ -1,10 +1,13 @@
<template>
<view class="view-container">
<view class="box detail">
<scroll-view class="view-container" scroll-y>
<view class="box detail" style="margin-bottom: 12px">
<text class="wd-font-800 wd-text-16" style="margin-bottom: 4px">
{{ detail.title }}
</text>
<view class="tagList">
<view class="tag" v-if="detail.priority">
{{ $dict.echoDicValue(dictMap.task_priority, detail.priority) }}
</view>
<view
v-for="(tag, index) in detail.tagList"
:key="index"
@ -83,6 +86,22 @@
</text>
</view>
<view class="tagList">
<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>
<view
class="tag"
v-for="(tag, index) in detail.enterprise.tagList"
@ -102,19 +121,25 @@
</view>
<view class="box record">
<view class="wd-text-14 wd-font-800 wd-pb-12">结果反馈</view>
<view class="row" v-for="item in list" :key="item.id">
<view class="wd-text-14 wd-font-800">结果反馈</view>
<view
class="row log"
v-for="item in list"
:key="item.id"
@tap="goLog(item)"
>
<view style="margin-bottom: 12px">
<text
:style="{
marginRight: '10px',
fontWeight: 'bold',
color: setColor(item.status)
color: $dict.echoDictOption(
dictMap.inspections_mark,
item.status
).remark
}"
>
{{
$dict.echoDicValue(dictMap.Inspections_status, item.status)
}}
{{ $dict.echoDicValue(dictMap.inspections_mark, item.status) }}
</text>
<text>
{{ $util.formatDate(item.createTime, 'YYYY/M/D h:m') }}
@ -158,7 +183,10 @@
</view>
<cs-bottom-wrapper>
<view class="" v-if="[null, 3].includes(inspectionsState)">
<view
class="operation"
v-if="[null, 0, 3].includes(inspectionsState)"
>
<view class="btn green" @tap="locate">执法签到</view>
</view>
<view class="operation" v-else-if="inspectionsState == 1">
@ -169,7 +197,7 @@
<view class="btn grey">任务完成</view>
</view>
</cs-bottom-wrapper>
</view>
</scroll-view>
</template>
<script>
@ -184,7 +212,12 @@ export default {
//
detail: {
id: '',
description: ''
description: '',
priority: '',
enterprise: {
region: '',
type: ''
}
},
//
isShowAllText: false,
@ -214,7 +247,14 @@ export default {
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['Inspections_status', 'task_state'].join(',')
type: [
'Inspections_status',
'task_state',
'inspections_mark',
'enterprises_type',
'enterprises_area',
'task_priority'
].join(',')
})
const dept = await getDeptTree()
this.dictMap = {
@ -232,9 +272,8 @@ export default {
const feedBack = await InspectionsApi.getFeedBack(
this.queryParams.recordId
)
this.list = feedBack.data.list
this.inspectionsState = this.list[0].status
this.list = feedBack.data
this.inspectionsState = this.list[this.list.length - 1].status
},
goEnterprise(enterprise) {
uni.navigateTo({
@ -257,13 +296,24 @@ export default {
})
},
setColor(status) {
if (status == 1) return '#F6B100'
if (status == 3) return '#F8285A'
const colorMap = {
1: '#F6B100',
2: '#17C653',
3: '#F8285A'
}
return colorMap[status]
},
tackle(state) {
uni.navigateTo({
url: `/sub/task/enforce?state=${state}&inspectionsId=${this.queryParams.recordId}`
})
},
goLog(record) {
if ([2, 3].includes(record.status)) {
uni.navigateTo({
url: `/sub/task/log?id=${record.id}`
})
}
}
}
}
@ -272,15 +322,14 @@ export default {
<style lang="scss" scoped>
.view-container {
height: 100vh;
padding: 12px;
display: flex;
flex-flow: column nowrap;
gap: 12px;
padding: 0 12px;
position: relative;
padding-bottom: 100px;
.box {
background-color: #fff;
border-radius: $cs-border-radius;
padding: 16px;
margin-top: 12px;
}
.row {
border-radius: $cs-border-radius;
@ -367,6 +416,9 @@ export default {
.record {
position: relative;
overflow: hidden;
display: flex;
flex-flow: column nowrap;
gap: 12px;
.emty {
display: flex;
flex-direction: column;
@ -389,7 +441,11 @@ export default {
transform-origin: 50% 50%;
}
}
.log {
&:active {
background-color: $cs-color-touch;
}
}
.operation {
padding: 12px;
display: flex;

13
utils/dict.js

@ -4,11 +4,20 @@
* @param {Object} value
*/
export function echoDicValue(dict, value) {
if (!dict) return ''
if (!value) return ''
if (!dict || !value) return ''
return dict.find(d => d.value == value).label || ''
}
/**
* 回显字典项
* @param {Object} dict
* @param {Object} value
*/
export function echoDictOption(dict, value) {
if (!dict || !value) return ''
return dict.find(d => d.value == value) || {}
}
/**
* 构造树型结构数据
*

11
utils/ruoyi.js

@ -83,10 +83,11 @@ export function viewPosition({
name = ''
}) {
uni.openLocation({
latitude: lat,
longitude: lng,
address: lat,
lng,
name
latitude: Number(lat),
longitude: Number(lng),
name,
fail: (err) => {
console.log(err);
}
})
}
Loading…
Cancel
Save