Browse Source

优化页面结构和样式,调整各个组件的布局和样式,提升用户体验

master
parent
commit
31f74b1c06
  1. 40
      pages.json
  2. 4
      static/scss/global.scss
  3. 169
      sub/enterprise/detail.vue
  4. 61
      sub/inspection/record.vue
  5. 283
      sub/invite/addEnterprise.vue
  6. 166
      sub/invite/prove.vue
  7. 275
      sub/task/detail.vue
  8. 79
      sub/task/log.vue
  9. 205
      sub/task/record.vue

40
pages.json

@ -1,12 +1,14 @@
{ {
"pages": [{ "pages": [
{
"path": "pages/login", "path": "pages/login",
"style": { "style": {
"navigationBarTitleText": "登录", "navigationBarTitleText": "登录",
"navigationStyle": "custom", "navigationStyle": "custom",
"disableScroll": true "disableScroll": true
} }
}, { },
{
"path": "pages/index", "path": "pages/index",
"style": { "style": {
"navigationBarTitleText": "首页", "navigationBarTitleText": "首页",
@ -68,14 +70,17 @@
"^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue"
} }
}, },
"subPackages": [{ "subPackages": [
{
"root": "sub", "root": "sub",
"pages": [{ "pages": [
{
"path": "owner/edit", "path": "owner/edit",
"style": { "style": {
"navigationBarTitleText": "个人信息" "navigationBarTitleText": "个人信息"
} }
}, { },
{
"path": "owner/invite", "path": "owner/invite",
"style": { "style": {
"navigationBarTitleText": "邀请企业" "navigationBarTitleText": "邀请企业"
@ -121,19 +126,20 @@
"componentPlaceholder": {} "componentPlaceholder": {}
} }
}, },
{ {
"path": "enterprise/edit", "path": "enterprise/edit",
"style": { "style": {
"navigationBarTitleText": "企业填报" "navigationBarTitleText": "企业填报"
} }
}, { },
{
"path": "common/waiting", "path": "common/waiting",
"style": { "style": {
"navigationBarTitleText": "", "navigationBarTitleText": "",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, { },
{
"path": "enterprise/detail", "path": "enterprise/detail",
"style": { "style": {
"navigationBarTitleText": "档案详情", "navigationBarTitleText": "档案详情",
@ -141,12 +147,14 @@
"u-modal": "view" "u-modal": "view"
} }
} }
}, { },
{
"path": "chat/index", "path": "chat/index",
"style": { "style": {
"navigationBarTitleText": "智慧生态" "navigationBarTitleText": "智慧生态"
} }
}, { },
{
"path": "task/detail", "path": "task/detail",
"style": { "style": {
"navigationBarTitleText": "执法记录", "navigationBarTitleText": "执法记录",
@ -252,7 +260,10 @@
{ {
"path": "invite/prove", "path": "invite/prove",
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": "",
"componentPlaceholder": {
"u-switch": "view"
}
} }
}, },
{ {
@ -263,9 +274,11 @@
} }
} }
] ]
}], }
],
"tabBar": { "tabBar": {
"list": [{ "list": [
{
"pagePath": "pages/index" "pagePath": "pages/index"
}, },
{ {
@ -287,6 +300,5 @@
"navigationBarTitleText": "智慧生态", "navigationBarTitleText": "智慧生态",
"navigationBarBackgroundColor": "#FFF", "navigationBarBackgroundColor": "#FFF",
"backgroundColor": "#FFF" "backgroundColor": "#FFF"
} }
} }

4
static/scss/global.scss

@ -1,6 +1,7 @@
@font-face { @font-face {
font-family: 'Tahoma'; font-family: 'Tahoma';
src: url('https://hb.jzce.com/Tahoma.ttf') format('truetype'); src: url('https://hb.jzce.com/Tahoma.ttf')
format('truetype');
} }
page { page {
@ -46,5 +47,6 @@ button {
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
line-height: normal; line-height: normal;
white-space: nowrap;
} }
} }

169
sub/enterprise/detail.vue

@ -1,13 +1,26 @@
<template> <template>
<scroll-view class="detail-container" scroll-y> <scroll-view
class="detail-container"
scroll-y
>
<view class="box detail"> <view class="box detail">
<view> <view>
<text class="wd-font-800 wd-text-16" style="margin-bottom: 8rpx"> <text
class="wd-font-800 wd-text-16"
style="margin-bottom: 8rpx"
>
{{ detail.enterprisesName }} {{ detail.enterprisesName }}
</text> </text>
</view> </view>
<view class="address" @click="goView(detail)"> <view
<u-icon name="map" size="28rpx" color="#17C653"></u-icon> class="address"
@click="goView(detail)"
>
<u-icon
name="map"
size="28rpx"
color="#17C653"
></u-icon>
<text <text
style=" style="
text-decoration: underline; text-decoration: underline;
@ -37,22 +50,37 @@
{{ tag }} {{ tag }}
</view> </view>
</view> </view>
<view class="wd-flex" style="align-items: center"> <view
<text class="address" style="margin-right: 24rpx">环保负责人</text> class="wd-flex"
style="align-items: center"
>
<text
class="address"
style="margin-right: 24rpx"
>环保负责人</text
>
<text style="margin-right: 24rpx; color: #071437"> <text style="margin-right: 24rpx; color: #071437">
{{ detail.contactName }} {{ detail.contactName }}
</text> </text>
<text class="address" style="margin-right: 24rpx">联系方式</text> <text
class="address"
style="margin-right: 24rpx"
>联系方式</text
>
<text <text
style="text-decoration: underline; color: #071437" style="text-decoration: underline; color: #071437"
@click="callPhone(detail.environmentalContactPhone)" @click="
callPhone(detail.environmentalContactPhone)
"
> >
{{ detail.environmentalContactPhone }} {{ detail.environmentalContactPhone }}
</text> </text>
</view> </view>
<view <view
class="images-box" class="images-box"
@click="$util.perviewImage(detail.files.map(i => i.url))" @click="
$util.perviewImage(detail.files.map(i => i.url))
"
> >
<image <image
v-for="(src, index) in detail.files" v-for="(src, index) in detail.files"
@ -62,7 +90,9 @@
class="image" class="image"
></image> ></image>
</view> </view>
<cs-text-more :value="detail.introduction"></cs-text-more> <cs-text-more
:value="detail.introduction"
></cs-text-more>
<!-- <view class="status"> <!-- <view class="status">
<cs-dict-tag <cs-dict-tag
:dict="dictMap.enterprises_status" :dict="dictMap.enterprises_status"
@ -76,7 +106,10 @@
v-for="prove in detail.qualificationList" v-for="prove in detail.qualificationList"
:key="prove.id" :key="prove.id"
> >
<view class="wd-flex" style="gap: 18rpx; position: relative"> <view
class="wd-flex"
style="gap: 18rpx; position: relative"
>
<image <image
:src="prove.files[0].url" :src="prove.files[0].url"
style="width: 180rpx; height: 140rpx" style="width: 180rpx; height: 140rpx"
@ -87,8 +120,15 @@
style="flex: 1; justify-content: space-between" style="flex: 1; justify-content: space-between"
class="wd-flex wd-flex-col" class="wd-flex wd-flex-col"
> >
<view class="wd-flex" style="gap: 18rpx; align-items: center"> <view
<text class="label" style="color: #78829d">资质名称</text> class="wd-flex"
style="gap: 18rpx; align-items: center"
>
<text
class="label"
style="color: #78829d"
>资质名称</text
>
<view style="color: #071437"> <view style="color: #071437">
{{ {{
$dict.echoDicValue( $dict.echoDicValue(
@ -98,25 +138,37 @@
}} }}
</view> </view>
</view> </view>
<view class="wd-flex" style="gap: 18rpx; align-items: center"> <view
class="wd-flex"
style="gap: 18rpx; align-items: center"
>
<text class="label">资质编号</text> <text class="label">资质编号</text>
<view style="color: #071437"> <view style="color: #071437">
{{ prove.enterpriseAuth }} {{ prove.enterpriseAuth }}
</view> </view>
</view> </view>
<view class="wd-flex" style="gap: 18rpx; align-items: center"> <view
class="wd-flex"
style="gap: 18rpx; align-items: center"
>
<text class="label">资质时限</text> <text class="label">资质时限</text>
<view style="color: #071437"> <view style="color: #071437">
{{ {{
prove.qualificationName == 99 !prove.expiryDate
? '永久' ? '长期有效'
: $util.formatDate(prove.expiryDate, 'YYYY/M/D') : $util.formatDate(
prove.expiryDate,
'YYYY/M/D'
)
}} }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="status" v-if="prove.status != 1"> <view
class="status"
v-if="prove.status != 1"
>
<cs-dict-tag <cs-dict-tag
:dict="dictMap.enterprise_qualification_status" :dict="dictMap.enterprise_qualification_status"
:value="prove.status" :value="prove.status"
@ -160,8 +212,17 @@
@confirm="showModel = false" @confirm="showModel = false"
@cancel="postApi" @cancel="postApi"
> >
<view class="wd-flex wd-flex-col wd-flex-center" style="gap: 10px"> <view
<view style="font-size: 32rpx; color: #071437; font-weight: 800"> class="wd-flex wd-flex-col wd-flex-center"
style="gap: 10px"
>
<view
style="
font-size: 32rpx;
color: #071437;
font-weight: 800;
"
>
是否审核? 是否审核?
</view> </view>
<view class="">请确保企业信息真实性</view> <view class="">请确保企业信息真实性</view>
@ -171,25 +232,25 @@
</template> </template>
<script> <script>
import { import {
getEnterPrise, getEnterPrise,
checkEnterprise, checkEnterprise,
getTaskList getTaskList,
} from '@/api/enterprise/index.js' } from '@/api/enterprise/index.js'
import { getDictBatchByType } from '@/api/system/dict.js' import { getDictBatchByType } from '@/api/system/dict.js'
export default { export default {
data() { data() {
return { return {
detail: { detail: {
id: '', id: '',
type: '', type: '',
region: '' region: '',
}, },
showModel: false, showModel: false,
dictMap: {}, dictMap: {},
total: 0, total: 0,
isView: true, isView: true,
isChange: false isChange: false,
} }
}, },
onLoad(res) { onLoad(res) {
@ -217,16 +278,16 @@ export default {
'enterprises_area', 'enterprises_area',
'enterprises_status', 'enterprises_status',
'enterprise_qualification_status', 'enterprise_qualification_status',
'enterprise_qua' 'enterprise_qua',
].join(',') ].join(','),
}) })
this.dictMap = { this.dictMap = {
...dict.data ...dict.data,
} }
}, },
callPhone(number) { callPhone(number) {
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: number phoneNumber: number,
}) })
}, },
async init() { async init() {
@ -236,14 +297,14 @@ export default {
}, },
goBack() { goBack() {
uni.switchTab({ uni.switchTab({
url: '/pages/enterprise' url: '/pages/enterprise',
}) })
}, },
goView(enterprise) { goView(enterprise) {
if (!enterprise.gpsLocation) { if (!enterprise.gpsLocation) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '暂无gps信息' title: '暂无gps信息',
}) })
return return
} }
@ -252,14 +313,14 @@ export default {
lat: position[0], lat: position[0],
lng: position[1], lng: position[1],
name: enterprise.enterprisesName, name: enterprise.enterprisesName,
address: enterprise.address address: enterprise.address,
}) })
}, },
postApi() { postApi() {
checkEnterprise(this.detail.id).then(() => { checkEnterprise(this.detail.id).then(() => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功',
}) })
this.showModel = false this.showModel = false
this.init() this.init()
@ -269,7 +330,7 @@ export default {
const data = { const data = {
enterpriseId: this.detail.id, enterpriseId: this.detail.id,
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
} }
getTaskList(data).then(res => { getTaskList(data).then(res => {
this.total = res.data.total this.total = res.data.total
@ -278,18 +339,19 @@ export default {
goInspections() { goInspections() {
if (this.total > 0) { if (this.total > 0) {
uni.navigateTo({ uni.navigateTo({
url: `/sub/inspection/detail?enterprisesId=${this.detail.id}&enterprisesName=${this.detail.enterprisesName}` url: `/sub/inspection/detail?enterprisesId=${this.detail.id}&enterprisesName=${this.detail.enterprisesName}`,
}) })
} }
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-container { .detail-container {
padding: 24rpx; padding: 24rpx;
position: relative; position: relative;
padding-bottom: 200rpx;
.box { .box {
margin-bottom: 24rpx; margin-bottom: 24rpx;
background-color: #fff; background-color: #fff;
@ -325,7 +387,8 @@ export default {
position: absolute; position: absolute;
right: -38rpx; right: -38rpx;
top: 12rpx; top: 12rpx;
transform: rotateZ(45deg) translateX(40rpx) translateY(-40rpx); transform: rotateZ(45deg) translateX(40rpx)
translateY(-40rpx);
transform-origin: 50% 50%; transform-origin: 50% 50%;
padding: 8rpx 40rpx; padding: 8rpx 40rpx;
font-size: 24rpx; font-size: 24rpx;
@ -339,7 +402,8 @@ export default {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
transform: rotateZ(45deg) translateX(60rpx) translateY(-41rpx); transform: rotateZ(45deg) translateX(60rpx)
translateY(-41rpx);
transform-origin: 50% 50%; transform-origin: 50% 50%;
} }
} }
@ -354,23 +418,26 @@ export default {
flex-shrink: 0; flex-shrink: 0;
} }
} }
} }
.label { .label {
color: $uni-text-color-grey; color: $uni-text-color-grey;
} }
.icon-box { .icon-box {
position: absolute; position: absolute;
left: 0; left: 0;
} }
.operation { .operation {
padding: 24rpx; padding: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 24rpx; gap: 24rpx;
.red { .red {
background: var(--LightMode-Danger-Danger-Light, #ffeef3); background: var(
--LightMode-Danger-Danger-Light,
#ffeef3
);
color: var(--LightMode-Danger-Danger, #f8285a); color: var(--LightMode-Danger-Danger, #f8285a);
} }
.btn { .btn {
@ -390,5 +457,5 @@ export default {
background: #f1f1f4; background: #f1f1f4;
color: #99a1b7; color: #99a1b7;
} }
} }
</style> </style>

61
sub/inspection/record.vue

@ -1,18 +1,31 @@
<template> <template>
<scroll-view scroll-y flex-enable class="view-container"> <scroll-view
<view class="box" v-for="log in list" :key="log.id"> scroll-y
<view class="wd-flex" style="gap: 10px; align-items: center"> flex-enable
class="view-container"
>
<view
class="box"
v-for="log in list"
:key="log.id"
>
<view
class="wd-flex"
style="gap: 10px; align-items: center"
>
<view <view
:style="{ :style="{
color: $dict.echoDictOption( color: $dict.echoDictOption(
dictMap.inspections_mark, dictMap.inspections_mark,
log.status log.status
).remark ).remark,
}" }"
> >
{{ {{
$dict.echoDictOption(dictMap.inspections_mark, log.status) $dict.echoDictOption(
.label dictMap.inspections_mark,
log.status
).label
}} }}
</view> </view>
<view class=""> <view class="">
@ -41,7 +54,10 @@
size="80rpx" size="80rpx"
shape="circle" shape="circle"
></u-avatar> ></u-avatar>
<view class="wd-flex wd-flex-col" style="gap: 2px"> <view
class="wd-flex wd-flex-col"
style="gap: 2px"
>
<text>{{ people.realName }}</text> <text>{{ people.realName }}</text>
<text>{{ people.deptName }}</text> <text>{{ people.deptName }}</text>
</view> </view>
@ -64,21 +80,21 @@
</template> </template>
<script> <script>
import { getDictBatchByType } from '@/api/system/dict.js' import { getDictBatchByType } from '@/api/system/dict.js'
import { getTaskLog } from '@/api/enterprise/index.js' import { getTaskLog } from '@/api/enterprise/index.js'
export default { export default {
data() { data() {
return { return {
queryParams: { queryParams: {
taskId: '' taskId: '',
}, },
list: [], list: [],
dictMap: {} dictMap: {},
} }
}, },
onLoad(res) { onLoad(res) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.taskName title: res.taskName,
}) })
this.queryParams.taskId = res.taskId this.queryParams.taskId = res.taskId
this.getDict() this.getDict()
@ -96,31 +112,33 @@ export default {
*/ */
async getDict() { async getDict() {
const dict = await getDictBatchByType({ const dict = await getDictBatchByType({
type: ['inspections_mark'].join(',') type: ['inspections_mark'].join(','),
}) })
this.dictMap = { this.dictMap = {
...dict.data ...dict.data,
} }
}, },
async getList() { async getList() {
uni.showToast({ uni.showToast({
title: '加载中', title: '加载中',
mask: true, mask: true,
icon: 'loading' icon: 'loading',
}) })
const res = await getTaskLog(this.queryParams.taskId) const res = await getTaskLog(
this.queryParams.taskId
)
this.list = res.data this.list = res.data
uni.hideToast() uni.hideToast()
}, },
previewImage(url) { previewImage(url) {
this.$util.perviewImage(url.map(i => i.url)) this.$util.perviewImage(url.map(i => i.url))
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.view-container { .view-container {
padding: 24rpx; padding: 24rpx;
flex-direction: column; flex-direction: column;
gap: 24rpx; gap: 24rpx;
@ -135,6 +153,7 @@ export default {
margin-bottom: 24rpx; margin-bottom: 24rpx;
.imageList { .imageList {
display: flex; display: flex;
flex-wrap: wrap;
gap: 24rpx; gap: 24rpx;
.image { .image {
width: 192rpx; width: 192rpx;
@ -144,5 +163,5 @@ export default {
} }
} }
} }
} }
</style> </style>

283
sub/invite/addEnterprise.vue

@ -2,7 +2,9 @@
<view class="view"> <view class="view">
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
企业名称 企业名称
</view> </view>
<view class="value"> <view class="value">
@ -25,14 +27,31 @@
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
所属区域 所属区域
</view> </view>
<view class="value" @tap="picker.show = true"> <view
<view class="input-textarea" v-if="form.region"> class="value"
{{ $dict.echoDicValue(dictMap.enterprises_area, form.region) }} @tap="picker.show = true"
>
<view
class="input-textarea"
v-if="form.region"
>
{{
$dict.echoDicValue(
dictMap.enterprises_area,
form.region
)
}}
</view> </view>
<view class="input-textarea" style="color: #999999" v-else> <view
class="input-textarea"
style="color: #999999"
v-else
>
请选择所属区域 请选择所属区域
</view> </view>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
@ -41,14 +60,26 @@
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
企业地址 企业地址
</view> </view>
<view class="value" @tap="chooseAddress"> <view
<view class="input-textarea" v-if="form.address"> class="value"
@tap="chooseAddress"
>
<view
class="input-textarea"
v-if="form.address"
>
{{ form.address }} {{ form.address }}
</view> </view>
<view class="input-textarea" style="color: #999999" v-else> <view
class="input-textarea"
style="color: #999999"
v-else
>
请选择企业地址 请选择企业地址
</view> </view>
<u-icon name="map"></u-icon> <u-icon name="map"></u-icon>
@ -57,14 +88,27 @@
<view class="block"> <view class="block">
<view class="label"> <view class="label">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
行业类别 行业类别
</view> </view>
<view class="value" style="width: 50%" @tap="goTags"> <view
<view class="input-value" v-if="form.hy.length > 0"> class="value"
style="width: 50%"
@tap="goTags"
>
<view
class="input-value"
v-if="form.hy.length > 0"
>
{{ form.hy.map(i => i.label).join('、') }} {{ form.hy.map(i => i.label).join('、') }}
</view> </view>
<view class="input-textarea" style="color: #999999" v-else> <view
class="input-textarea"
style="color: #999999"
v-else
>
请选择企业标签 请选择企业标签
</view> </view>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
@ -73,14 +117,26 @@
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
企业介绍 企业介绍
</view> </view>
<view class="value" @tap="goIntruduce"> <view
<view class="input-textarea" v-if="form.introduction"> class="value"
@tap="goIntruduce"
>
<view
class="input-textarea"
v-if="form.introduction"
>
{{ form.introduction }} {{ form.introduction }}
</view> </view>
<view class="input-textarea" style="color: #999999" v-else> <view
class="input-textarea"
style="color: #999999"
v-else
>
请输入企业介绍 请输入企业介绍
</view> </view>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
@ -97,7 +153,9 @@
" "
> >
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
企业照片 企业照片
</view> </view>
<view style="color: #999999">最多可传3张</view> <view style="color: #999999">最多可传3张</view>
@ -115,7 +173,9 @@
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
企业负责人 企业负责人
</view> </view>
<view class="value"> <view class="value">
@ -135,7 +195,9 @@
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
负责人电话 负责人电话
</view> </view>
<view class="value"> <view class="value">
@ -166,15 +228,25 @@
" "
> >
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
相关资质 相关资质
</view> </view>
<view <view
class="wd-flex" class="wd-flex"
style="color: #17c653; gap: 4px; align-items: center" style="
color: #17c653;
gap: 4px;
align-items: center;
"
@tap="addProve" @tap="addProve"
> >
<u-icon name="plus-circle" color="#17C653" size="14"></u-icon> <u-icon
name="plus-circle"
color="#17C653"
size="14"
></u-icon>
<text style="line-height: 1rem">新增资质</text> <text style="line-height: 1rem">新增资质</text>
</view> </view>
</view> </view>
@ -196,7 +268,10 @@
mode="aspectFill" mode="aspectFill"
></image> ></image>
<view class="info"> <view class="info">
<view class="wd-flex" style="gap: 8px; align-items: center"> <view
class="wd-flex"
style="gap: 8px; align-items: center"
>
<text class="label">资质名称</text> <text class="label">资质名称</text>
<view class="wd-font-800"> <view class="wd-font-800">
{{ {{
@ -207,7 +282,10 @@
}} }}
</view> </view>
</view> </view>
<view class="wd-flex" style="gap: 8px; align-items: center"> <view
class="wd-flex"
style="gap: 8px; align-items: center"
>
<text class="label">资质编号</text> <text class="label">资质编号</text>
<view <view
class="wd-font-800" class="wd-font-800"
@ -221,13 +299,19 @@
{{ p.enterpriseAuth }} {{ p.enterpriseAuth }}
</view> </view>
</view> </view>
<view class="wd-flex" style="gap: 8px; align-items: center"> <view
class="wd-flex"
style="gap: 8px; align-items: center"
>
<text class="label">资质到期</text> <text class="label">资质到期</text>
<view class="wd-font-800"> <view class="wd-font-800">
{{ {{
p.qualificationName == 99 !p.expiryDate
? '永久' ? '长期有效'
: $util.formatDate(p.expiryDate, 'YYYY/M/D') : $util.formatDate(
p.expiryDate,
'YYYY/M/D'
)
}} }}
</view> </view>
</view> </view>
@ -251,23 +335,28 @@
<cs-bottom-wrapper> <cs-bottom-wrapper>
<view class="operation"> <view class="operation">
<button class="btn green" @tap="submit">提交审核</button> <button
class="btn green"
@tap="submit"
>
提交审核
</button>
</view> </view>
</cs-bottom-wrapper> </cs-bottom-wrapper>
</view> </view>
</template> </template>
<script> <script>
import { uploadFile } from '@/api/system/file.js' import { uploadFile } from '@/api/system/file.js'
import { getDictBatchByType } from '@/api/system/dict.js' import { getDictBatchByType } from '@/api/system/dict.js'
import { import {
createEnterPrise, createEnterPrise,
vertifyName, vertifyName,
getEnterPrise, getEnterPrise,
updateEnterprise updateEnterprise,
} from '@/api/enterprise/index.js' } from '@/api/enterprise/index.js'
import { getProveList } from '@/api/enterprise/prove.js' import { getProveList } from '@/api/enterprise/prove.js'
export default { export default {
data() { data() {
return { return {
form: { form: {
@ -281,7 +370,7 @@ export default {
contactName: '', contactName: '',
id: '', id: '',
region: '', region: '',
hy: [] hy: [],
}, },
// //
picker: { picker: {
@ -289,11 +378,11 @@ export default {
// //
key: null, key: null,
defaultIndex: [0], defaultIndex: [0],
data: [] data: [],
}, },
dictMap: {}, dictMap: {},
prove: [], prove: [],
inviteId: '' inviteId: '',
} }
}, },
async onLoad(res) { async onLoad(res) {
@ -328,18 +417,18 @@ export default {
proofName(v) { proofName(v) {
if (v.detail.value == '') return if (v.detail.value == '') return
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中',
}) })
vertifyName({ vertifyName({
pageSize: -1, pageSize: -1,
pageNo: 1, pageNo: 1,
onlyEnterprisesName: v.detail.value, onlyEnterprisesName: v.detail.value,
excludeEnterpriseId: this.form.id excludeEnterpriseId: this.form.id,
}).then(res => { }).then(res => {
if (res.data.total > 0) { if (res.data.total > 0) {
uni.showToast({ uni.showToast({
title: '企业名已存在', title: '企业名已存在',
icon: 'none' icon: 'none',
}) })
this.form.enterprisesName = '' this.form.enterprisesName = ''
this.$refs.nameRef.onClear() this.$refs.nameRef.onClear()
@ -355,12 +444,13 @@ export default {
if (!mobilePattern.test(v.detail.value)) { if (!mobilePattern.test(v.detail.value)) {
uni.showToast({ uni.showToast({
title: '请输入有效的手机号', title: '请输入有效的手机号',
icon: 'none' icon: 'none',
}) })
this.form.environmentalContactPhone = '' this.form.environmentalContactPhone = ''
this.$refs.phoneRef.onClear() this.$refs.phoneRef.onClear()
} else { } else {
this.form.environmentalContactPhone = v.detail.value this.form.environmentalContactPhone =
v.detail.value
} }
}, },
async init() { async init() {
@ -370,26 +460,31 @@ export default {
return { return {
...i, ...i,
status: 'success', status: 'success',
message: '' message: '',
} }
}) })
this.form.hy = enterprise.data.tagObjList.map(t => { this.form.hy = enterprise.data.tagObjList.map(t => {
return { return {
label: t.tagName, label: t.tagName,
value: t.id value: t.id,
} }
}) })
this.getProve() this.getProve()
}, },
async getProve() { async getProve() {
const load = this.$util.loading() const load = this.$util.loading()
const prove = await getProveList({ enterpriseId: this.form.id }) const prove = await getProveList({
enterpriseId: this.form.id,
})
load.close() load.close()
this.prove = prove.data.list.map(p => { this.prove = prove.data.list.map(p => {
return { return {
...p, ...p,
photo: p.files, photo: p.files,
expiryDate: this.$util.formatDate(p.expiryDate, 'YYYY-MM-DD') expiryDate: this.$util.formatDate(
p.expiryDate,
'YYYY-MM-DD'
),
} }
}) })
}, },
@ -398,38 +493,41 @@ export default {
*/ */
async getDict() { async getDict() {
const dict = await getDictBatchByType({ const dict = await getDictBatchByType({
type: ['enterprise_qua', 'enterprises_area'].join(',') type: ['enterprise_qua', 'enterprises_area'].join(
','
),
}) })
this.dictMap = { this.dictMap = {
...dict.data ...dict.data,
} }
this.picker.data = [ this.picker.data = [
dict.data.enterprises_area.map(i => { dict.data.enterprises_area.map(i => {
return { return {
name: i.label, name: i.label,
value: i.value value: i.value,
} }
}) }),
] ]
}, },
chooseAddress() { chooseAddress() {
uni.chooseLocation({ uni.chooseLocation({
success: res => { success: res => {
this.form.address = res.address this.form.address = res.address
this.form.gpsLocation = res.latitude + ',' + res.longitude this.form.gpsLocation =
} res.latitude + ',' + res.longitude
},
}) })
}, },
goIntruduce() { goIntruduce() {
uni.navigateTo({ uni.navigateTo({
url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduction}` url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduction}`,
}) })
}, },
goTags() { goTags() {
uni.navigateTo({ uni.navigateTo({
url: `/sub/invite/enterpriseTags?tags=${JSON.stringify( url: `/sub/invite/enterpriseTags?tags=${JSON.stringify(
this.form.hy this.form.hy
)}` )}`,
}) })
}, },
/** /**
@ -438,24 +536,27 @@ export default {
*/ */
async addEnterprisePhoto(e) { async addEnterprisePhoto(e) {
uni.showLoading({ uni.showLoading({
title: '上传中...' title: '上传中...',
}) })
e.file.forEach(p => { e.file.forEach(p => {
this.form.photo.push({ this.form.photo.push({
...p, ...p,
status: 'uploading', status: 'uploading',
message: '上传中' message: '上传中',
}) })
}) })
// 使promise.all() // 使promise.all()
await Promise.all( await Promise.all(
this.form.photo.map(async (p, i) => { this.form.photo.map(async (p, i) => {
if (p.status == 'uploading') { if (p.status == 'uploading') {
const res = await uploadFile({ name: `file`, filePath: p.url }) const res = await uploadFile({
name: `file`,
filePath: p.url,
})
return { return {
...res.data, ...res.data,
status: 'success', status: 'success',
message: '' message: '',
} }
} }
return p return p
@ -476,12 +577,14 @@ export default {
}, },
addProve() { addProve() {
uni.navigateTo({ uni.navigateTo({
url: `/sub/invite/prove?enterpriseId=${this.form.id}` url: `/sub/invite/prove?enterpriseId=${this.form.id}`,
}) })
}, },
editProve(prove) { editProve(prove) {
uni.navigateTo({ uni.navigateTo({
url: `/sub/invite/prove?prove=${JSON.stringify(prove)}` url: `/sub/invite/prove?prove=${JSON.stringify(
prove
)}`,
}) })
}, },
async submit() { async submit() {
@ -495,7 +598,7 @@ export default {
return { return {
...i, ...i,
expiryDate: new Date(i.expiryDate).getTime(), expiryDate: new Date(i.expiryDate).getTime(),
files: i.photo.map(f => f.id) files: i.photo.map(f => f.id),
} }
}) })
const load = this.$util.loading('上传中...') const load = this.$util.loading('上传中...')
@ -505,7 +608,7 @@ export default {
load.close() load.close()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功',
}) })
uni.navigateBack() uni.navigateBack()
}) })
@ -514,7 +617,7 @@ export default {
load.close() load.close()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功',
}) })
uni.navigateBack() uni.navigateBack()
}) })
@ -529,7 +632,7 @@ export default {
photo: '最少上传一张企业照片', photo: '最少上传一张企业照片',
prove: '请填写企业资质', prove: '请填写企业资质',
environmentalContactPhone: '请输入企业负责人', environmentalContactPhone: '请输入企业负责人',
contactName: '请输入负责人电话' contactName: '请输入负责人电话',
} }
const msg = [] const msg = []
Object.keys(this.form).forEach(i => { Object.keys(this.form).forEach(i => {
@ -539,7 +642,10 @@ export default {
if (!this.form[i]) { if (!this.form[i]) {
msg.push(msgMap[i]) msg.push(msgMap[i])
} }
if (typeof this.form[i] == 'Object' && this.form[i].length == 0) { if (
typeof this.form[i] == 'Object' &&
this.form[i].length == 0
) {
msg.push(msgMap[i]) msg.push(msgMap[i])
} }
}) })
@ -549,14 +655,14 @@ export default {
if (msg.length > 0) { if (msg.length > 0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: msg.join('\n') title: msg.join('\n'),
}) })
return false return false
} }
if (this.form.photo.length == 0) { if (this.form.photo.length == 0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请上传企业照片' title: '请上传企业照片',
}) })
return false return false
} }
@ -577,13 +683,13 @@ export default {
*/ */
closePicker() { closePicker() {
this.picker.show = false this.picker.show = false
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.view { .view {
padding: 12px; padding: 12px;
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
@ -592,8 +698,8 @@ export default {
overflow-y: scroll; overflow-y: scroll;
max-height: 100vh; max-height: 100vh;
padding-bottom: 12vh; padding-bottom: 12vh;
} }
.block { .block {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
background-color: #fff; background-color: #fff;
@ -643,11 +749,12 @@ export default {
overflow: hidden; overflow: hidden;
} }
} }
} }
.prove { .prove {
border-radius: var(--Number-12px, 12px); border-radius: var(--Number-12px, 12px);
border: 1px solid var(--LightMode-Grey-Grey-100, #f9f9f9); border: 1px solid
var(--LightMode-Grey-Grey-100, #f9f9f9);
background: var(--LightMode-Light-Light, #fff); background: var(--LightMode-Light-Light, #fff);
display: flex; display: flex;
padding: var(--Number-12px, 12px); padding: var(--Number-12px, 12px);
@ -661,18 +768,18 @@ export default {
flex-flow: column nowrap; flex-flow: column nowrap;
justify-content: space-between; justify-content: space-between;
} }
} }
.upload-wrapper { .upload-wrapper {
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
background-color: #fff; background-color: #fff;
padding: 12px; padding: 12px;
border-radius: 8px; border-radius: 8px;
gap: 12px; gap: 12px;
} }
::v-deep .uni-easyinput__content-input { ::v-deep .uni-easyinput__content-input {
flex: 1; flex: 1;
text-align: right; text-align: right;
white-space: nowrap; white-space: nowrap;
@ -684,8 +791,8 @@ export default {
min-height: 1.4rem; min-height: 1.4rem;
overflow: hidden; overflow: hidden;
padding-right: 0; padding-right: 0;
} }
::v-deep .uni-easyinput__placeholder-class { ::v-deep .uni-easyinput__placeholder-class {
flex: 1; flex: 1;
text-align: right; text-align: right;
white-space: nowrap; white-space: nowrap;
@ -697,8 +804,8 @@ export default {
min-height: 1.4rem; min-height: 1.4rem;
font-size: 14px; font-size: 14px;
overflow: hidden; overflow: hidden;
} }
.operation { .operation {
padding: 12px; padding: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -716,5 +823,5 @@ export default {
background-color: $cs-color-main; background-color: $cs-color-main;
color: #fff; color: #fff;
} }
} }
</style> </style>

166
sub/invite/prove.vue

@ -2,14 +2,21 @@
<view class="view"> <view class="view">
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
资质名称 资质名称
</view> </view>
<view <view
class="value" class="value"
@tap="showPicker('enterprise_qua', 'qualificationName')" @tap="
showPicker('enterprise_qua', 'qualificationName')
"
>
<view
class="input-textarea"
v-if="prove.qualificationName"
> >
<view class="input-textarea" v-if="prove.qualificationName">
{{ {{
$dict.echoDicValue( $dict.echoDicValue(
dictMap.enterprise_qua, dictMap.enterprise_qua,
@ -17,7 +24,11 @@
) )
}} }}
</view> </view>
<view class="input-textarea" style="color: #808080" v-else> <view
class="input-textarea"
style="color: #808080"
v-else
>
请选择资质名称 请选择资质名称
</view> </view>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
@ -26,7 +37,9 @@
<view class="block"> <view class="block">
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
资质编号 资质编号
</view> </view>
<view class="value"> <view class="value">
@ -58,17 +71,46 @@
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
</view> </view>
</view> --> </view> -->
<view class="block">
<view style="">
<text style="color: #f8285a; margin-right: 4px"
>*</text
>
长期有效
</view>
<view
class="value"
style="flex-direction: row-reverse"
>
<u-switch v-model="prove.isLong"></u-switch>
</view>
</view>
<view class="block" v-if="prove.qualificationName != 99"> <view
class="block"
v-if="!prove.isLong"
>
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
到期时间 到期时间
</view> </view>
<view class="value" @tap="showCalendar('expiryDate')"> <view
<view class="input-textarea" v-if="prove.expiryDate"> class="value"
@tap="showCalendar('expiryDate')"
>
<view
class="input-textarea"
v-if="prove.expiryDate"
>
{{ prove.expiryDate }} {{ prove.expiryDate }}
</view> </view>
<view class="input-textarea" style="color: #808080" v-else> <view
class="input-textarea"
style="color: #808080"
v-else
>
请选择到期时间 请选择到期时间
</view> </view>
<u-icon name="arrow-right"></u-icon> <u-icon name="arrow-right"></u-icon>
@ -85,7 +127,9 @@
" "
> >
<view style=""> <view style="">
<text style="color: #f8285a; margin-right: 4px">*</text> <text style="color: #f8285a; margin-right: 4px"
>*</text
>
资质照片 资质照片
</view> </view>
<view style="color: #808080">要求清晰有效</view> <view style="color: #808080">要求清晰有效</view>
@ -102,7 +146,12 @@
<cs-bottom-wrapper> <cs-bottom-wrapper>
<view class="operation"> <view class="operation">
<button class="btn green" @tap="submit">保存</button> <button
class="btn green"
@tap="submit"
>
保存
</button>
</view> </view>
</cs-bottom-wrapper> </cs-bottom-wrapper>
<u-picker <u-picker
@ -124,10 +173,13 @@
</template> </template>
<script> <script>
import { uploadFile } from '@/api/system/file.js' import { uploadFile } from '@/api/system/file.js'
import { getDictBatchByType } from '@/api/system/dict.js' import { getDictBatchByType } from '@/api/system/dict.js'
import { updateProve, createProve } from '@/api/enterprise/prove.js' import {
export default { updateProve,
createProve,
} from '@/api/enterprise/prove.js'
export default {
data() { data() {
return { return {
enterpriseId: '', enterpriseId: '',
@ -136,7 +188,8 @@ export default {
qualificationName: '', qualificationName: '',
expiryDate: '', expiryDate: '',
enterpriseAuth: '', enterpriseAuth: '',
photo: [] photo: [],
isLong: false,
}, },
dictMap: {}, dictMap: {},
// //
@ -144,19 +197,19 @@ export default {
show: false, show: false,
// //
key: null, key: null,
data: [] data: [],
}, },
// //
calendar: { calendar: {
// //
key: null key: null,
} },
} }
}, },
onLoad(res) { onLoad(res) {
this.getDict() this.getDict()
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.prove ? '编辑资质' : '新增资质' title: res.prove ? '编辑资质' : '新增资质',
}) })
if (res.enterpriseId) { if (res.enterpriseId) {
this.enterpriseId = res.enterpriseId this.enterpriseId = res.enterpriseId
@ -171,10 +224,10 @@ export default {
*/ */
async getDict() { async getDict() {
const dict = await getDictBatchByType({ const dict = await getDictBatchByType({
type: ['enterprise_qua'].join(',') type: ['enterprise_qua'].join(','),
}) })
this.dictMap = { this.dictMap = {
...dict.data ...dict.data,
} }
}, },
/** /**
@ -183,19 +236,22 @@ export default {
*/ */
async addPhoto(e) { async addPhoto(e) {
uni.showLoading({ uni.showLoading({
title: '正在上传...' title: '正在上传...',
}) })
this.prove.photo.push({ this.prove.photo.push({
...e.file, ...e.file,
status: 'uploading', status: 'uploading',
message: '上传中' message: '上传中',
}) })
uploadFile({ name: `file`, filePath: e.file.url }).then(res => { uploadFile({
name: `file`,
filePath: e.file.url,
}).then(res => {
this.prove.photo = [] this.prove.photo = []
this.prove.photo.push({ this.prove.photo.push({
...res.data, ...res.data,
status: 'success', status: 'success',
message: '' message: '',
}) })
uni.hideLoading() uni.hideLoading()
}) })
@ -223,7 +279,7 @@ export default {
this.picker = { this.picker = {
show: false, show: false,
key: '', key: '',
data: [] data: [],
} }
}, },
showPicker(dict, key) { showPicker(dict, key) {
@ -238,7 +294,7 @@ export default {
showCalendar(key) { showCalendar(key) {
this.$refs.calendarRef.open() this.$refs.calendarRef.open()
this.calendar = { this.calendar = {
key key,
} }
}, },
/** /**
@ -254,7 +310,7 @@ export default {
*/ */
closeCalendar() { closeCalendar() {
this.calendar = { this.calendar = {
key: null key: null,
} }
}, },
async submit() { async submit() {
@ -262,33 +318,37 @@ export default {
if (!valide) return if (!valide) return
if (this.prove.id) { if (this.prove.id) {
uni.showLoading({ uni.showLoading({
title: '更新中...' title: '更新中...',
}) })
const data = { ...this.prove } const data = { ...this.prove }
data.files = this.prove.photo.map(p => p.id) data.files = this.prove.photo.map(p => p.id)
data.expiryDate = new Date(this.prove.expiryDate).getTime() data.expiryDate = new Date(
this.prove.expiryDate
).getTime()
updateProve(data).then(res => { updateProve(data).then(res => {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功',
}) })
uni.$emit('prove', this.prove) uni.$emit('prove', this.prove)
uni.navigateBack() uni.navigateBack()
}) })
} else if (this.enterpriseId) { } else if (this.enterpriseId) {
uni.showLoading({ uni.showLoading({
title: '更新中...' title: '更新中...',
}) })
const data = { ...this.prove } const data = { ...this.prove }
data.files = this.prove.photo.map(p => p.id) data.files = this.prove.photo.map(p => p.id)
data.expiryDate = new Date(this.prove.expiryDate).getTime() data.expiryDate = new Date(
this.prove.expiryDate
).getTime()
data.enterpriseId = this.enterpriseId data.enterpriseId = this.enterpriseId
createProve(data).then(res => { createProve(data).then(res => {
uni.hideLoading() uni.hideLoading()
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '操作成功' title: '操作成功',
}) })
uni.$emit('prove', this.prove) uni.$emit('prove', this.prove)
uni.navigateBack() uni.navigateBack()
@ -308,16 +368,19 @@ export default {
qualificationName: '请填写资质名称', qualificationName: '请填写资质名称',
expiryDate: '请选择到期日期', expiryDate: '请选择到期日期',
enterpriseAuth: '请填写资质编号', enterpriseAuth: '请填写资质编号',
photo: '请上传资质照片' photo: '请上传资质照片',
} }
const keys = Object.keys(this.prove).filter(i => { const keys = Object.keys(this.prove).filter(i => {
if (!Object.hasOwn(msgMap, i)) { if (!Object.hasOwn(msgMap, i)) {
return false return false
} }
if (i == 'expiryDate' && this.prove.qualificationName == 99) if (i == 'expiryDate' && this.prove.isLong)
return false return false
if (!this.prove[i] && i) return i if (!this.prove[i] && i) return i
if (typeof this.prove[i] == 'object' && this.prove[i].length == 0) if (
typeof this.prove[i] == 'object' &&
this.prove[i].length == 0
)
return i return i
}) })
if (keys.length > 0) { if (keys.length > 0) {
@ -328,18 +391,21 @@ export default {
.join('\n') .join('\n')
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: msg title: msg,
}) })
return false return false
} }
return true return true
},
async changeIsLong(e) {
this.prove.isLong = !this.prove.isLong
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.view { .view {
padding: 12px; padding: 12px;
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
@ -348,8 +414,8 @@ export default {
overflow-y: scroll; overflow-y: scroll;
max-height: 100vh; max-height: 100vh;
padding-bottom: 12vh; padding-bottom: 12vh;
} }
.block { .block {
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
background-color: #fff; background-color: #fff;
@ -383,18 +449,18 @@ export default {
word-break: break-all; word-break: break-all;
} }
} }
} }
.upload-wrapper { .upload-wrapper {
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
background-color: #fff; background-color: #fff;
padding: 12px; padding: 12px;
border-radius: 8px; border-radius: 8px;
gap: 12px; gap: 12px;
} }
.operation { .operation {
padding: 12px; padding: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
@ -412,5 +478,5 @@ export default {
background-color: $cs-color-main; background-color: $cs-color-main;
color: #fff; color: #fff;
} }
} }
</style> </style>

275
sub/task/detail.vue

@ -3,20 +3,30 @@
<view <view
class="detail-container" class="detail-container"
:style="{ :style="{
paddingBottom: isSelect.length > 0 ? '140rpx' : '40rpx' paddingBottom:
isSelect.length > 0 ? '140rpx' : '40rpx',
}" }"
> >
<view class="box detail"> <view class="box detail">
<text class="wd-font-800 wd-text-16" style="color: #071437"> <text
class="wd-font-800 wd-text-16"
style="color: #071437; padding-right: 40rpx"
>
{{ detail.title }} {{ detail.title }}
</text> </text>
<view class="tagList"> <view class="tagList">
<view class="tag" v-if="detail.deptName"> <view
class="tag"
v-if="detail.deptName"
>
{{ detail.deptName }} {{ detail.deptName }}
</view> </view>
<view class="tag"> <view class="tag">
{{ {{
$dict.echoDicValue(dictMap.task_priority, detail.priority) $dict.echoDicValue(
dictMap.task_priority,
detail.priority
)
}} }}
</view> </view>
<view <view
@ -31,8 +41,15 @@
class="wd-flex wd-text-13" class="wd-flex wd-text-13"
style="justify-content: space-between" style="justify-content: space-between"
> >
<view class="wd-flex" style="align-items: center; gap: 8rpx"> <view
<u-icon name="calendar" color="#17C653" size="16" /> class="wd-flex"
style="align-items: center; gap: 8rpx"
>
<u-icon
name="calendar"
color="#17C653"
size="16"
/>
<text <text
class="wd-text-13" class="wd-text-13"
style="font-weight: bold; margin-right: 8rpx" style="font-weight: bold; margin-right: 8rpx"
@ -41,23 +58,38 @@
`${$util.formatDate( `${$util.formatDate(
detail.startDate, detail.startDate,
'YYYY年M月D日' 'YYYY年M月D日'
)} ${$util.formatDate(detail.endDate, 'YYYY年M月D日')}` )} ${$util.formatDate(
detail.endDate,
'YYYY年M月D日'
)}`
}} }}
</text> </text>
</view> </view>
</view> </view>
<cs-text-more :value="detail.description" /> <cs-text-more :value="detail.description" />
<view class="file-list" v-if="files && files.length > 0"> <view
class="file-list"
v-if="files && files.length > 0"
>
<view <view
class="file" class="file"
v-for="(file, index) in files" v-for="(file, index) in files"
:key="index" :key="index"
@click="openFile(file)" @click="openFile(file)"
> >
<u-icon name="attach" color="#17C653" size="16" /> <u-icon
name="attach"
color="#17C653"
size="16"
/>
<text <text
class="name" class="name"
style="var(--LightMode-Grey-Grey-900, #071437);" style="
color: var(
--LightMode-Grey-Grey-900,
#071437
);
"
> >
{{ file.name }} {{ file.name }}
</text> </text>
@ -74,12 +106,15 @@
<view <view
:class="[ :class="[
'options-container', 'options-container',
OptionsOffset.isTop ? 'isTop' : '' OptionsOffset.isTop ? 'isTop' : '',
]" ]"
ref="optionRef" ref="optionRef"
id="options" id="options"
> >
<van-dropdown-menu active-color="#17C653" style="flex: 1"> <van-dropdown-menu
active-color="#17C653"
style="flex: 1"
>
<van-dropdown-item <van-dropdown-item
v-if="showItem(['director'])" v-if="showItem(['director'])"
:value="queryParams.departmentId" :value="queryParams.departmentId"
@ -113,7 +148,9 @@
/> />
</van-dropdown-menu> </van-dropdown-menu>
<view style="flex: 0 0 120rpx"> <view style="flex: 0 0 120rpx">
<text style="color: #17c653">{{ list.length }}</text> <text style="color: #17c653">{{
list.length
}}</text>
条记录 条记录
</view> </view>
</view> </view>
@ -127,14 +164,23 @@
<view <view
:class="{ :class="{
select: true, select: true,
isSelect: isSelect.includes(record.id) isSelect: isSelect.includes(record.id),
}" }"
@tap.native.stop="select(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="16" color="#fff"></u-icon> <u-icon
name="checkbox-mark"
size="16"
color="#fff"
></u-icon>
</view> </view>
<view class="disable" v-else></view> <view
class="disable"
v-else
></view>
<view class="info"> <view class="info">
<view class="name"> <view class="name">
{{ record.enterpriseName }} {{ record.enterpriseName }}
@ -152,7 +198,10 @@
> >
{{ record.enterpriseAddress }} {{ record.enterpriseAddress }}
</view> </view>
<view class="tagList" style="margin-top: 16rpx"> <view
class="tagList"
style="margin-top: 16rpx"
>
<view <view
v-for="(item, index) in record.tagList" v-for="(item, index) in record.tagList"
:key="index" :key="index"
@ -162,7 +211,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="audit" v-show="record.inspectionStatus"> <view
class="audit"
v-show="record.inspectionStatus"
>
<cs-dict-tag <cs-dict-tag
:dict="dictMap.Inspections_status" :dict="dictMap.Inspections_status"
:value="record.inspectionStatus" :value="record.inspectionStatus"
@ -175,8 +227,14 @@
marginBottom="12" marginBottom="12"
v-if="load != 'nomore'" v-if="load != 'nomore'"
/> />
<view class="btn-box" v-if="isSelect.length > 0"> <view
<view class="confirm-btn" @tap="replay"> class="btn-box"
v-if="isSelect.length > 0"
>
<view
class="confirm-btn"
@tap="replay"
>
已选择({{ isSelect.length }}) 已选择({{ isSelect.length }})
</view> </view>
</view> </view>
@ -186,11 +244,16 @@
@close="closeModel" @close="closeModel"
borderRadius="32rpx" borderRadius="32rpx"
> >
<view class="wd-flex wd-flex-col" style="gap: 20px"> <view
class="wd-flex wd-flex-col"
style="gap: 20px"
>
<view class="header"> <view class="header">
<view class="row-1"> <view class="row-1">
已选择 已选择
<text class="num">{{ isSelect.length }}项记录</text> <text class="num"
>{{ isSelect.length }}项记录</text
>
转移给 转移给
</view> </view>
<view class="row-2">每次只能选择一人</view> <view class="row-2">每次只能选择一人</view>
@ -202,7 +265,9 @@
:key="staff.userId" :key="staff.userId"
:style="{ :style="{
'--select-color': '--select-color':
model.isSelect == staff.userId ? '#17c653' : '#f1f1f4' model.isSelect == staff.userId
? '#17c653'
: '#f1f1f4',
}" }"
@click="selectUser(staff.userId)" @click="selectUser(staff.userId)"
> >
@ -212,8 +277,12 @@
:src="staff.avatar" :src="staff.avatar"
></u-avatar> ></u-avatar>
<view class="info"> <view class="info">
<view class="name">{{ staff.realName }}</view> <view class="name">{{
<view class="dept">{{ staff.roleName[0] }}</view> staff.realName
}}</view>
<view class="dept">{{
staff.roleName[0]
}}</view>
</view> </view>
<view class="isSelect"> <view class="isSelect">
<u-icon <u-icon
@ -227,7 +296,11 @@
</view> </view>
<template #confirmButton> <template #confirmButton>
<view class="wd-flex wd-flex-center"> <view class="wd-flex wd-flex-center">
<view class="confirm-btn" @tap="submitReplay">转移给TA</view> <view
class="confirm-btn"
@tap="submitReplay"
>转移给TA</view
>
</view> </view>
</template> </template>
</u-modal> </u-modal>
@ -236,17 +309,20 @@
</template> </template>
<script> <script>
import { getDeptTree, getDictBatchByType } from '@/api/system/dict.js' import {
import { TaskApi } from '@/api/task/index.js' getDeptTree,
import { InspectionsApi } from '@/api/inspections/index.js' getDictBatchByType,
import { getUserList } from '@/api/system/user.js' } from '@/api/system/dict.js'
export default { import { TaskApi } from '@/api/task/index.js'
import { InspectionsApi } from '@/api/inspections/index.js'
import { getUserList } from '@/api/system/user.js'
export default {
data() { data() {
return { return {
// //
detail: { detail: {
id: '', id: '',
description: '' description: '',
}, },
// //
files: [], files: [],
@ -259,7 +335,7 @@ export default {
//u-sticky //u-sticky
OptionsOffset: { OptionsOffset: {
top: 0, top: 0,
isTop: false isTop: false,
}, },
// //
queryParams: { queryParams: {
@ -267,26 +343,26 @@ export default {
inspectionsStatus: '', inspectionsStatus: '',
pageSize: 8, pageSize: 8,
pageNo: 1, pageNo: 1,
userId: '' userId: '',
}, },
load: 'loadmore', load: 'loadmore',
model: { model: {
show: false, show: false,
list: [], list: [],
isSelect: '' isSelect: '',
}, },
userList: [ userList: [
{ {
value: '', value: '',
text: '按人员' text: '按人员',
} },
], ],
// //
dropOption: { dropOption: {
dept: [], dept: [],
userList: [], userList: [],
status: [] status: [],
} },
} }
}, },
async onLoad(res) { async onLoad(res) {
@ -294,7 +370,8 @@ export default {
await this.getDict() await this.getDict()
}, },
onPageScroll(e) { onPageScroll(e) {
this.OptionsOffset.isTop = e.scrollTop + 10 > this.OptionsOffset.top this.OptionsOffset.isTop =
e.scrollTop + 10 > this.OptionsOffset.top
}, },
onReady() { onReady() {
this.getOptionOffset() this.getOptionOffset()
@ -321,14 +398,17 @@ export default {
fail(err) { fail(err) {
uni.showToast({ uni.showToast({
title: '文件打开失败', title: '文件打开失败',
icon: 'none' icon: 'none',
}) })
} },
}) })
}, },
fail(err) { fail(err) {
uni.showToast({ title: '文件下载失败', icon: 'none' }) uni.showToast({
} title: '文件下载失败',
icon: 'none',
})
},
}) })
}, },
getOptionOffset() { getOptionOffset() {
@ -348,47 +428,49 @@ export default {
*/ */
async getDict() { async getDict() {
const dict = await getDictBatchByType({ const dict = await getDictBatchByType({
type: ['task_state', 'Inspections_status', 'task_priority'].join( type: [
',' 'task_state',
) 'Inspections_status',
'task_priority',
].join(','),
}) })
const dept = await getDeptTree() const dept = await getDeptTree()
this.dictMap = { this.dictMap = {
...dict.data, ...dict.data,
dept: dept.data dept: dept.data,
} }
this.dropOption = { this.dropOption = {
dept: [ dept: [
{ {
value: '', value: '',
text: '按部门' text: '按部门',
}, },
...dept.data.map(d => { ...dept.data.map(d => {
return { return {
value: d.id, value: d.id,
text: d.name text: d.name,
} }
}) }),
], ],
status: [ status: [
{ {
value: '', value: '',
text: '按状态' text: '按状态',
}, },
...dict.data.task_state.map(d => { ...dict.data.task_state.map(d => {
return { return {
...d, ...d,
value: d.value, value: d.value,
text: d.label text: d.label,
} }
}) }),
] ],
} }
}, },
getDropdownOption(key) { getDropdownOption(key) {
const keyMap = { const keyMap = {
dept: '按部门', dept: '按部门',
Inspections_status: '按状态' Inspections_status: '按状态',
} }
if (!this.dictMap[key]) return [] if (!this.dictMap[key]) return []
@ -399,13 +481,13 @@ export default {
return { return {
...d, ...d,
value: d.id, value: d.id,
text: d.name text: d.name,
} }
}), }),
{ {
value: '', value: '',
text: keyMap[key] text: keyMap[key],
} },
] ]
} }
@ -413,13 +495,13 @@ export default {
...this.dictMap[key].map(d => { ...this.dictMap[key].map(d => {
return { return {
value: d.value, value: d.value,
text: d.label text: d.label,
} }
}), }),
{ {
value: '', value: '',
text: keyMap[key] text: keyMap[key],
} },
] ]
}, },
querySelect(v, key) { querySelect(v, key) {
@ -435,22 +517,25 @@ export default {
this.files = res.data.fileList this.files = res.data.fileList
}, },
async getUser() { async getUser() {
const res = await getUserList(this.queryParams.departmentId) const res = await getUserList(
this.queryParams.departmentId
)
return res.data return res.data
}, },
async getList() { async getList() {
if (!this.$roles.checkRole(['director'])) { if (!this.$roles.checkRole(['director'])) {
this.queryParams.departmentId = this.$store.getters.deptId this.queryParams.departmentId =
this.$store.getters.deptId
} }
uni.showToast({ uni.showToast({
title: '加载中', title: '加载中',
mask: true, mask: true,
icon: 'loading' icon: 'loading',
}) })
this.load = 'loading' this.load = 'loading'
const { data } = await InspectionsApi.getList({ const { data } = await InspectionsApi.getList({
...this.queryParams, ...this.queryParams,
taskId: this.detail.id taskId: this.detail.id,
}) })
this.list.push(...data.list) this.list.push(...data.list)
this.load = 'loadmore' this.load = 'loadmore'
@ -466,29 +551,29 @@ export default {
this.userList = [ this.userList = [
{ {
value: '', value: '',
text: '按人员' text: '按人员',
}, },
...res.map(i => { ...res.map(i => {
return { return {
...i, ...i,
value: i.userId, value: i.userId,
text: i.realName text: i.realName,
} }
}) }),
] ]
detail.callback(true) detail.callback(true)
}) })
}, },
goBack() { goBack() {
uni.switchTab({ uni.switchTab({
url: '/pages/task' url: '/pages/task',
}) })
}, },
loadMore() { loadMore() {
if (this.load == 'nomore') { if (this.load == 'nomore') {
uni.showToast({ uni.showToast({
title: '没有更多了', title: '没有更多了',
icon: 'none' icon: 'none',
}) })
return return
} }
@ -508,7 +593,7 @@ export default {
Inspections_status: '', Inspections_status: '',
pageSize: 8, pageSize: 8,
pageNo: 1, pageNo: 1,
userId: '' userId: '',
} }
await this.queryList() await this.queryList()
}, },
@ -528,7 +613,7 @@ export default {
this.model = { this.model = {
show: false, show: false,
list: [], list: [],
isSelect: '' isSelect: '',
} }
}, },
selectUser(id) { selectUser(id) {
@ -540,28 +625,28 @@ export default {
}, },
goRecord(record) { goRecord(record) {
uni.navigateTo({ uni.navigateTo({
url: `/sub/task/record?taskId=${record.taskId}&recordId=${record.id}&enterpriseId=${record.enterpriseId}` url: `/sub/task/record?taskId=${record.taskId}&recordId=${record.id}&enterpriseId=${record.enterpriseId}`,
}) })
}, },
submitReplay() { submitReplay() {
InspectionsApi.replay({ InspectionsApi.replay({
inspectionsId: this.isSelect, inspectionsId: this.isSelect,
userId: this.model.isSelect userId: this.model.isSelect,
}).then(res => { }).then(res => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '任务转移成功' title: '任务转移成功',
}) })
this.closeModel() this.closeModel()
this.reset() this.reset()
}) })
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-container { .detail-container {
position: relative; position: relative;
color: $cs-color-grey; color: $cs-color-grey;
@ -583,7 +668,8 @@ export default {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
transform: translateX(58rpx) translateY(24rpx) rotateZ(45deg); transform: translateX(58rpx) translateY(24rpx)
rotateZ(45deg);
transform-origin: 50% 50%; transform-origin: 50% 50%;
} }
@ -625,7 +711,8 @@ export default {
padding: 24rpx 32rpx; padding: 24rpx 32rpx;
align-items: center; align-items: center;
border-radius: var(--Number-8px, 8px); border-radius: var(--Number-8px, 8px);
border: 2rpx solid var(--LightMode-Grey-Grey-100, #f9f9f9); border: 2rpx solid
var(--LightMode-Grey-Grey-100, #f9f9f9);
margin: 24rpx; margin: 24rpx;
margin-top: 0; margin-top: 0;
position: relative; position: relative;
@ -636,12 +723,14 @@ export default {
right: 0; right: 0;
top: 0; top: 0;
transform-origin: 50% 50%; transform-origin: 50% 50%;
transform: translateX(64rpx) translateY(18rpx) rotateZ(45deg); transform: translateX(64rpx) translateY(18rpx)
rotateZ(45deg);
} }
.select { .select {
width: 44rpx; width: 44rpx;
height: 44rpx; height: 44rpx;
min-width: 44rpx;
border: 4rpx solid $cs-color-main; border: 4rpx solid $cs-color-main;
border-radius: 12rpx; border-radius: 12rpx;
display: flex; display: flex;
@ -655,6 +744,7 @@ export default {
width: 44rpx; width: 44rpx;
height: 44rpx; height: 44rpx;
border: 4rpx solid #dbdfe9; border: 4rpx solid #dbdfe9;
min-width: 44rpx;
margin-right: 32rpx; margin-right: 32rpx;
border-radius: 100%; border-radius: 100%;
position: relative; position: relative;
@ -665,7 +755,8 @@ export default {
inset: 0; inset: 0;
border-left: 4rpx solid #dbdfe9; border-left: 4rpx solid #dbdfe9;
transform-origin: 0 50%; transform-origin: 0 50%;
transform: translateX(calc(50% - 2rpx)) rotateZ(45deg); transform: translateX(calc(50% - 2rpx))
rotateZ(45deg);
} }
} }
@ -675,7 +766,7 @@ export default {
.info { .info {
font-size: 26rpx; font-size: 26rpx;
overflow: hidden;
.name { .name {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
@ -781,9 +872,9 @@ export default {
} }
} }
} }
} }
.options-container { .options-container {
overflow: hidden; overflow: hidden;
margin: 12px; margin: 12px;
border-radius: 8px; border-radius: 8px;
@ -811,14 +902,14 @@ export default {
} }
} }
} }
} }
.isTop { .isTop {
margin: 12px 0; margin: 12px 0;
border-radius: 0px; border-radius: 0px;
} }
::v-deep .u-popup__content { ::v-deep .u-popup__content {
border-radius: 32rpx; border-radius: 32rpx;
} }
</style> </style>

79
sub/task/log.vue

@ -3,26 +3,42 @@
<view class="box"> <view class="box">
<view <view
class="wd-flex" class="wd-flex"
style="justify-content: space-between; align-items: center" style="
justify-content: space-between;
align-items: center;
"
> >
<view style="font-weight: bold"> <view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 8rpx">*</text> <text style="color: #f8285a; margin-right: 8rpx"
>*</text
>
处理意见 处理意见
</view> </view>
</view> </view>
<view style="color: #071437">{{ detail.feedBack }}</view> <view style="color: #071437">{{
detail.feedBack
}}</view>
<view <view
class="wd-flex" class="wd-flex"
style="justify-content: space-between; align-items: center" style="
justify-content: space-between;
align-items: center;
"
> >
<view style="font-weight: bold"> <view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 8rpx">*</text> <text style="color: #f8285a; margin-right: 8rpx"
>*</text
>
上传证明 上传证明
</view> </view>
</view> </view>
<view <view
class="imageList" class="imageList"
@tap="$util.perviewImage(detail.fileList.map(i => i.url))" @tap="
$util.perviewImage(
detail.fileList.map(i => i.url)
)
"
> >
<image <image
:src="photo.url" :src="photo.url"
@ -34,18 +50,34 @@
</view> </view>
</view> </view>
<view class="box" v-if="detail.status == 3"> <view
class="box"
v-if="detail.status == 3"
>
<view <view
class="wd-flex" class="wd-flex"
style="justify-content: space-between; align-items: center" style="
justify-content: space-between;
align-items: center;
"
> >
<view style="font-weight: bold"> <view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 8rpx">*</text> <text style="color: #f8285a; margin-right: 8rpx"
>*</text
>
截止日期 截止日期
</view> </view>
<view class="wd-flex" style="gap: 8rpx; align-items: center"> <view
class="wd-flex"
style="gap: 8rpx; align-items: center"
>
<text style="color: #f8285a"> <text style="color: #f8285a">
{{ $util.formatDate(detail.correctionTime, 'YYYY年M月D日') }} {{
$util.formatDate(
detail.correctionTime,
'YYYY年M月D日'
)
}}
</text> </text>
</view> </view>
</view> </view>
@ -54,9 +86,9 @@
</template> </template>
<script> <script>
import { getDictBatchByType } from '@/api/system/dict.js' import { getDictBatchByType } from '@/api/system/dict.js'
import { InspectionsApi } from '@/api/inspections/index.js' import { InspectionsApi } from '@/api/inspections/index.js'
export default { export default {
data() { data() {
return { detail: {}, dictMap: {} } return { detail: {}, dictMap: {} }
}, },
@ -69,27 +101,29 @@ export default {
}, },
methods: { methods: {
getDetail() { getDetail() {
InspectionsApi.feedBackDetail(this.detail.id).then(res => { InspectionsApi.feedBackDetail(this.detail.id).then(
res => {
this.detail = res.data this.detail = res.data
}) }
)
}, },
/** /**
* 获取字典 * 获取字典
*/ */
async getDict() { async getDict() {
const dict = await getDictBatchByType({ const dict = await getDictBatchByType({
type: ['inspections_mark'].join(',') type: ['inspections_mark'].join(','),
}) })
this.dictMap = { this.dictMap = {
...dict.data ...dict.data,
}
} }
},
},
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.view-container { .view-container {
padding: 24rpx; padding: 24rpx;
display: flex; display: flex;
gap: 24rpx; gap: 24rpx;
@ -104,6 +138,7 @@ export default {
.imageList { .imageList {
display: flex; display: flex;
flex-wrap: wrap;
gap: 24rpx; gap: 24rpx;
.image { .image {
width: 192rpx; width: 192rpx;
@ -113,5 +148,5 @@ export default {
} }
} }
} }
} }
</style> </style>

205
sub/task/record.vue

@ -1,12 +1,29 @@
<template> <template>
<scroll-view class="view-container" scroll-y> <scroll-view
<view class="box detail" style="margin-bottom: 12px"> class="view-container"
<text class="wd-font-800 wd-text-16"> scroll-y
>
<view
class="box detail"
style="margin-bottom: 12px"
>
<text
class="wd-font-800 wd-text-16"
style="padding-right: 100rpx"
>
{{ detail.title }} {{ detail.title }}
</text> </text>
<view class="tagList"> <view class="tagList">
<view class="tag" v-if="detail.priority"> <view
{{ $dict.echoDicValue(dictMap.task_priority, detail.priority) }} class="tag"
v-if="detail.priority"
>
{{
$dict.echoDicValue(
dictMap.task_priority,
detail.priority
)
}}
</view> </view>
<view <view
v-for="(tag, index) in detail.tagList" v-for="(tag, index) in detail.tagList"
@ -20,19 +37,30 @@
class="wd-flex wd-text-13" class="wd-flex wd-text-13"
style="justify-content: space-between" style="justify-content: space-between"
> >
<view class="wd-flex" style="align-items: center; gap: 8rpx"> <view
<u-icon name="calendar" color="#17C653" /> class="wd-flex"
style="align-items: center; gap: 8rpx"
>
<u-icon
name="calendar"
color="#17C653"
/>
<text class="wd-text-13 wd-ml-4px wd-font-800"> <text class="wd-text-13 wd-ml-4px wd-font-800">
{{ {{
`${$util.formatDate( `${$util.formatDate(
detail.startDate, detail.startDate,
'YYYY年M月D日' 'YYYY年M月D日'
)} ${$util.formatDate(detail.endDate, 'YYYY年M月D日')}` )} ${$util.formatDate(
detail.endDate,
'YYYY年M月D日'
)}`
}} }}
</text> </text>
</view> </view>
</view> </view>
<cs-text-more :value="detail.description"></cs-text-more> <cs-text-more
:value="detail.description"
></cs-text-more>
<view <view
class="wd-flex wd-items-center enterprise" class="wd-flex wd-items-center enterprise"
@tap="goEnterprise(detail.enterprise)" @tap="goEnterprise(detail.enterprise)"
@ -42,13 +70,26 @@
shape="square" shape="square"
size="64" size="64"
></u-avatar> ></u-avatar>
<view class="wd-flex wd-flex-col" style="overflow: hidden"> <view
class="wd-flex wd-flex-col"
style="overflow: hidden"
>
<text class="wd-font-800 wd-text-15"> <text class="wd-font-800 wd-text-15">
{{ detail.enterprise.enterprisesName }} {{ detail.enterprise.enterprisesName }}
</text> </text>
<view class="wd-flex" style="margin-top: 4rpx"> <view
<u-icon name="map" size="28rpx" color="#17C653"></u-icon> class="wd-flex"
<text class="address wd-text-12" style="margin-left: 8rpx"> style="margin-top: 4rpx"
>
<u-icon
name="map"
size="28rpx"
color="#17C653"
></u-icon>
<text
class="address wd-text-12"
style="margin-left: 8rpx"
>
{{ {{
`${$dict.echoDicValue( `${$dict.echoDicValue(
dictMap.enterprises_area, dictMap.enterprises_area,
@ -57,10 +98,14 @@
}} }}
</text> </text>
</view> </view>
<view class="tagList" style="margin-top: 16rpx"> <view
class="tagList"
style="margin-top: 16rpx"
>
<view <view
class="tag" class="tag"
v-for="(tag, index) in detail.enterprise.tagList" v-for="(tag, index) in detail.enterprise
.tagList"
:key="index" :key="index"
> >
{{ tag }} {{ tag }}
@ -92,15 +137,23 @@
color: $dict.echoDictOption( color: $dict.echoDictOption(
dictMap.Inspections_status, dictMap.Inspections_status,
item.status item.status
).remark ).remark,
}" }"
> >
{{ {{
$dict.echoDicValue(dictMap.Inspections_status, item.status) $dict.echoDicValue(
dictMap.Inspections_status,
item.status
)
}} }}
</text> </text>
<text> <text>
{{ $util.formatDate(item.createTime, 'YYYY/M/D h:m') }} {{
$util.formatDate(
item.createTime,
'YYYY/M/D h:m'
)
}}
</text> </text>
</view> </view>
<scroll-view <scroll-view
@ -111,27 +164,41 @@
class="row" class="row"
v-for="people in item.userList" v-for="people in item.userList"
:key="people.userId" :key="people.userId"
style="display: inline-flex; gap: 24rpx; margin-right: 24rpx" style="
display: inline-flex;
gap: 24rpx;
margin-right: 24rpx;
"
> >
<u-avatar <u-avatar
:src="people.avtar" :src="people.avtar"
size="80rpx" size="80rpx"
shape="circle" shape="circle"
></u-avatar> ></u-avatar>
<view class="wd-flex wd-flex-col" style="gap: 4rpx"> <view
class="wd-flex wd-flex-col"
style="gap: 4rpx"
>
<text>{{ people.realName }}</text> <text>{{ people.realName }}</text>
<text>{{ people.deptName }}</text> <text>{{ people.deptName }}</text>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="emty" v-if="list.length == 0"> <view
class="emty"
v-if="list.length == 0"
>
<image <image
class="image" class="image"
src="/static/images/emty.png" src="/static/images/emty.png"
mode="aspectFill" mode="aspectFill"
></image> ></image>
<text class="wd-text-14" style="color: #99a1b7">暂无处理结果</text> <text
class="wd-text-14"
style="color: #99a1b7"
>暂无处理结果</text
>
</view> </view>
<view class="audit"> <view class="audit">
<cs-dict-tag <cs-dict-tag
@ -148,13 +215,31 @@
class="operation" class="operation"
v-if="[null, 0, 3].includes(inspectionsState)" v-if="[null, 0, 3].includes(inspectionsState)"
> >
<view class="btn green" @tap="locate">执法签到</view> <view
class="btn green"
@tap="locate"
>执法签到</view
>
</view> </view>
<view class="operation" v-else-if="inspectionsState == 1"> <view
<view class="btn red" @tap="tackle(3)">整改处理</view> class="operation"
<view class="btn green" @tap="tackle(2)">审批通过</view> v-else-if="inspectionsState == 1"
>
<view
class="btn red"
@tap="tackle(3)"
>整改处理</view
>
<view
class="btn green"
@tap="tackle(2)"
>审批通过</view
>
</view> </view>
<view class="operation" v-else> <view
class="operation"
v-else
>
<view class="btn grey">任务完成</view> <view class="btn grey">任务完成</view>
</view> </view>
</cs-bottom-wrapper> </cs-bottom-wrapper>
@ -162,11 +247,14 @@
</template> </template>
<script> <script>
import { getDeptTree, getDictBatchByType } from '@/api/system/dict.js' import {
import { TaskApi } from '@/api/task/index.js' getDeptTree,
import { getEnterPrise } from '@/api/enterprise/index.js' getDictBatchByType,
import { InspectionsApi } from '../../api/inspections' } from '@/api/system/dict.js'
export default { import { TaskApi } from '@/api/task/index.js'
import { getEnterPrise } from '@/api/enterprise/index.js'
import { InspectionsApi } from '../../api/inspections'
export default {
data() { data() {
return { return {
dictMap: {}, dictMap: {},
@ -177,8 +265,8 @@ export default {
priority: '', priority: '',
enterprise: { enterprise: {
region: '', region: '',
type: '' type: '',
} },
}, },
// //
isShowAllText: false, isShowAllText: false,
@ -186,10 +274,10 @@ export default {
queryParams: { queryParams: {
taskId: '', taskId: '',
recordId: '', recordId: '',
enterpriseId: '' enterpriseId: '',
}, },
list: [], list: [],
inspectionsState: null inspectionsState: null,
} }
}, },
onLoad(res) { onLoad(res) {
@ -214,21 +302,25 @@ export default {
'inspections_mark', 'inspections_mark',
'enterprises_type', 'enterprises_type',
'enterprises_area', 'enterprises_area',
'task_priority' 'task_priority',
].join(',') ].join(','),
}) })
const dept = await getDeptTree() const dept = await getDeptTree()
this.dictMap = { this.dictMap = {
...dict.data, ...dict.data,
dept: dept.data dept: dept.data,
} }
}, },
async init() { async init() {
const res = await TaskApi.getDetail(this.queryParams.taskId) const res = await TaskApi.getDetail(
const enterprise = await getEnterPrise(this.queryParams.enterpriseId) this.queryParams.taskId
)
const enterprise = await getEnterPrise(
this.queryParams.enterpriseId
)
this.detail = { this.detail = {
...res.data, ...res.data,
enterprise: enterprise.data enterprise: enterprise.data,
} }
const feedBack = await InspectionsApi.getFeedBack( const feedBack = await InspectionsApi.getFeedBack(
this.queryParams.recordId this.queryParams.recordId
@ -239,7 +331,7 @@ export default {
}, },
goEnterprise(enterprise) { goEnterprise(enterprise) {
uni.navigateTo({ uni.navigateTo({
url: `/sub/enterprise/detail?id=${enterprise.id}` url: `/sub/enterprise/detail?id=${enterprise.id}`,
}) })
}, },
viewPosition(enterprise) { viewPosition(enterprise) {
@ -250,40 +342,40 @@ export default {
lat: position[0], lat: position[0],
lng: position[1], lng: position[1],
name: enterprise.enterprisesName, name: enterprise.enterprisesName,
address: enterprise.address address: enterprise.address,
}) })
}, },
locate() { locate() {
uni.navigateTo({ uni.navigateTo({
url: `/sub/task/locate?inspectionsId=${this.queryParams.recordId}&enterpriseId=${this.queryParams.enterpriseId}` url: `/sub/task/locate?inspectionsId=${this.queryParams.recordId}&enterpriseId=${this.queryParams.enterpriseId}`,
}) })
}, },
setColor(status) { setColor(status) {
const colorMap = { const colorMap = {
1: '#F6B100', 1: '#F6B100',
2: '#17C653', 2: '#17C653',
3: '#F8285A' 3: '#F8285A',
} }
return colorMap[status] return colorMap[status]
}, },
tackle(state) { tackle(state) {
uni.navigateTo({ uni.navigateTo({
url: `/sub/task/enforce?state=${state}&inspectionsId=${this.queryParams.recordId}` url: `/sub/task/enforce?state=${state}&inspectionsId=${this.queryParams.recordId}`,
}) })
}, },
goLog(record) { goLog(record) {
if ([2, 3].includes(record.status)) { if ([2, 3].includes(record.status)) {
uni.navigateTo({ uni.navigateTo({
url: `/sub/task/log?id=${record.id}` url: `/sub/task/log?id=${record.id}`,
}) })
} }
},
},
} }
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.view-container { .view-container {
padding: 0 24rpx; padding: 0 24rpx;
position: relative; position: relative;
padding-bottom: 200rpx; padding-bottom: 200rpx;
@ -327,7 +419,8 @@ export default {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
transform: translateX(36rpx) translateY(32rpx) rotateZ(45deg); transform: translateX(36rpx) translateY(32rpx)
rotateZ(45deg);
transform-origin: 50% 50%; transform-origin: 50% 50%;
} }
} }
@ -344,7 +437,8 @@ export default {
align-items: center; align-items: center;
gap: 24rpx; gap: 24rpx;
border-radius: 16rpx; border-radius: 16rpx;
border: 2rpx solid var(--LightMode-Grey-Grey-100, #f9f9f9); border: 2rpx solid
var(--LightMode-Grey-Grey-100, #f9f9f9);
padding: 48rpx 24rpx; padding: 48rpx 24rpx;
border-radius: 16rpx; border-radius: 16rpx;
.image { .image {
@ -356,7 +450,8 @@ export default {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
transform: translateX(68rpx) translateY(19rpx) rotateZ(45deg); transform: translateX(68rpx) translateY(19rpx)
rotateZ(45deg);
transform-origin: 50% 50%; transform-origin: 50% 50%;
} }
} }
@ -393,5 +488,5 @@ export default {
color: #99a1b7; color: #99a1b7;
} }
} }
} }
</style> </style>

Loading…
Cancel
Save