Browse Source

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

master
parent
commit
31f74b1c06
  1. 40
      pages.json
  2. 4
      static/scss/global.scss
  3. 145
      sub/enterprise/detail.vue
  4. 51
      sub/inspection/record.vue
  5. 243
      sub/invite/addEnterprise.vue
  6. 144
      sub/invite/prove.vue
  7. 251
      sub/task/detail.vue
  8. 69
      sub/task/log.vue
  9. 193
      sub/task/record.vue

40
pages.json

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

4
static/scss/global.scss

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

145
sub/enterprise/detail.vue

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

51
sub/inspection/record.vue

@ -1,18 +1,31 @@
<template>
<scroll-view scroll-y 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">
<scroll-view
scroll-y
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
:style="{
color: $dict.echoDictOption(
dictMap.inspections_mark,
log.status
).remark
).remark,
}"
>
{{
$dict.echoDictOption(dictMap.inspections_mark, log.status)
.label
$dict.echoDictOption(
dictMap.inspections_mark,
log.status
).label
}}
</view>
<view class="">
@ -41,7 +54,10 @@
size="80rpx"
shape="circle"
></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.deptName }}</text>
</view>
@ -70,15 +86,15 @@ export default {
data() {
return {
queryParams: {
taskId: ''
taskId: '',
},
list: [],
dictMap: {}
dictMap: {},
}
},
onLoad(res) {
uni.setNavigationBarTitle({
title: res.taskName
title: res.taskName,
})
this.queryParams.taskId = res.taskId
this.getDict()
@ -96,26 +112,28 @@ export default {
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['inspections_mark'].join(',')
type: ['inspections_mark'].join(','),
})
this.dictMap = {
...dict.data
...dict.data,
}
},
async getList() {
uni.showToast({
title: '加载中',
mask: true,
icon: 'loading'
icon: 'loading',
})
const res = await getTaskLog(this.queryParams.taskId)
const res = await getTaskLog(
this.queryParams.taskId
)
this.list = res.data
uni.hideToast()
},
previewImage(url) {
this.$util.perviewImage(url.map(i => i.url))
}
}
},
},
}
</script>
@ -135,6 +153,7 @@ export default {
margin-bottom: 24rpx;
.imageList {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
.image {
width: 192rpx;

243
sub/invite/addEnterprise.vue

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

144
sub/invite/prove.vue

@ -2,14 +2,21 @@
<view class="view">
<view class="block">
<view style="">
<text style="color: #f8285a; margin-right: 4px">*</text>
<text style="color: #f8285a; margin-right: 4px"
>*</text
>
资质名称
</view>
<view
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(
dictMap.enterprise_qua,
@ -17,7 +24,11 @@
)
}}
</view>
<view class="input-textarea" style="color: #808080" v-else>
<view
class="input-textarea"
style="color: #808080"
v-else
>
请选择资质名称
</view>
<u-icon name="arrow-right"></u-icon>
@ -26,7 +37,9 @@
<view class="block">
<view style="">
<text style="color: #f8285a; margin-right: 4px">*</text>
<text style="color: #f8285a; margin-right: 4px"
>*</text
>
资质编号
</view>
<view class="value">
@ -58,17 +71,46 @@
<u-icon name="arrow-right"></u-icon>
</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="">
<text style="color: #f8285a; margin-right: 4px">*</text>
<text style="color: #f8285a; margin-right: 4px"
>*</text
>
到期时间
</view>
<view class="value" @tap="showCalendar('expiryDate')">
<view class="input-textarea" v-if="prove.expiryDate">
<view
class="value"
@tap="showCalendar('expiryDate')"
>
<view
class="input-textarea"
v-if="prove.expiryDate"
>
{{ prove.expiryDate }}
</view>
<view class="input-textarea" style="color: #808080" v-else>
<view
class="input-textarea"
style="color: #808080"
v-else
>
请选择到期时间
</view>
<u-icon name="arrow-right"></u-icon>
@ -85,7 +127,9 @@
"
>
<view style="">
<text style="color: #f8285a; margin-right: 4px">*</text>
<text style="color: #f8285a; margin-right: 4px"
>*</text
>
资质照片
</view>
<view style="color: #808080">要求清晰有效</view>
@ -102,7 +146,12 @@
<cs-bottom-wrapper>
<view class="operation">
<button class="btn green" @tap="submit">保存</button>
<button
class="btn green"
@tap="submit"
>
保存
</button>
</view>
</cs-bottom-wrapper>
<u-picker
@ -126,7 +175,10 @@
<script>
import { uploadFile } from '@/api/system/file.js'
import { getDictBatchByType } from '@/api/system/dict.js'
import { updateProve, createProve } from '@/api/enterprise/prove.js'
import {
updateProve,
createProve,
} from '@/api/enterprise/prove.js'
export default {
data() {
return {
@ -136,7 +188,8 @@ export default {
qualificationName: '',
expiryDate: '',
enterpriseAuth: '',
photo: []
photo: [],
isLong: false,
},
dictMap: {},
//
@ -144,19 +197,19 @@ export default {
show: false,
//
key: null,
data: []
data: [],
},
//
calendar: {
//
key: null
}
key: null,
},
}
},
onLoad(res) {
this.getDict()
uni.setNavigationBarTitle({
title: res.prove ? '编辑资质' : '新增资质'
title: res.prove ? '编辑资质' : '新增资质',
})
if (res.enterpriseId) {
this.enterpriseId = res.enterpriseId
@ -171,10 +224,10 @@ export default {
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['enterprise_qua'].join(',')
type: ['enterprise_qua'].join(','),
})
this.dictMap = {
...dict.data
...dict.data,
}
},
/**
@ -183,19 +236,22 @@ export default {
*/
async addPhoto(e) {
uni.showLoading({
title: '正在上传...'
title: '正在上传...',
})
this.prove.photo.push({
...e.file,
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.push({
...res.data,
status: 'success',
message: ''
message: '',
})
uni.hideLoading()
})
@ -223,7 +279,7 @@ export default {
this.picker = {
show: false,
key: '',
data: []
data: [],
}
},
showPicker(dict, key) {
@ -238,7 +294,7 @@ export default {
showCalendar(key) {
this.$refs.calendarRef.open()
this.calendar = {
key
key,
}
},
/**
@ -254,7 +310,7 @@ export default {
*/
closeCalendar() {
this.calendar = {
key: null
key: null,
}
},
async submit() {
@ -262,33 +318,37 @@ export default {
if (!valide) return
if (this.prove.id) {
uni.showLoading({
title: '更新中...'
title: '更新中...',
})
const data = { ...this.prove }
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 => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '操作成功'
title: '操作成功',
})
uni.$emit('prove', this.prove)
uni.navigateBack()
})
} else if (this.enterpriseId) {
uni.showLoading({
title: '更新中...'
title: '更新中...',
})
const data = { ...this.prove }
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
createProve(data).then(res => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '操作成功'
title: '操作成功',
})
uni.$emit('prove', this.prove)
uni.navigateBack()
@ -308,16 +368,19 @@ export default {
qualificationName: '请填写资质名称',
expiryDate: '请选择到期日期',
enterpriseAuth: '请填写资质编号',
photo: '请上传资质照片'
photo: '请上传资质照片',
}
const keys = Object.keys(this.prove).filter(i => {
if (!Object.hasOwn(msgMap, i)) {
return false
}
if (i == 'expiryDate' && this.prove.qualificationName == 99)
if (i == 'expiryDate' && this.prove.isLong)
return false
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
})
if (keys.length > 0) {
@ -328,13 +391,16 @@ export default {
.join('\n')
uni.showToast({
icon: 'none',
title: msg
title: msg,
})
return false
}
return true
}
}
},
async changeIsLong(e) {
this.prove.isLong = !this.prove.isLong
},
},
}
</script>

251
sub/task/detail.vue

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

69
sub/task/log.vue

@ -3,26 +3,42 @@
<view class="box">
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
style="
justify-content: space-between;
align-items: center;
"
>
<view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 8rpx">*</text>
<text style="color: #f8285a; margin-right: 8rpx"
>*</text
>
处理意见
</view>
</view>
<view style="color: #071437">{{ detail.feedBack }}</view>
<view style="color: #071437">{{
detail.feedBack
}}</view>
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
style="
justify-content: space-between;
align-items: center;
"
>
<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="imageList"
@tap="$util.perviewImage(detail.fileList.map(i => i.url))"
@tap="
$util.perviewImage(
detail.fileList.map(i => i.url)
)
"
>
<image
:src="photo.url"
@ -34,18 +50,34 @@
</view>
</view>
<view class="box" v-if="detail.status == 3">
<view
class="box"
v-if="detail.status == 3"
>
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
style="
justify-content: space-between;
align-items: center;
"
>
<view style="font-weight: bold">
<text style="color: #f8285a; margin-right: 8rpx">*</text>
<text style="color: #f8285a; margin-right: 8rpx"
>*</text
>
截止日期
</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">
{{ $util.formatDate(detail.correctionTime, 'YYYY年M月D日') }}
{{
$util.formatDate(
detail.correctionTime,
'YYYY年M月D日'
)
}}
</text>
</view>
</view>
@ -69,22 +101,24 @@ export default {
},
methods: {
getDetail() {
InspectionsApi.feedBackDetail(this.detail.id).then(res => {
InspectionsApi.feedBackDetail(this.detail.id).then(
res => {
this.detail = res.data
})
}
)
},
/**
* 获取字典
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['inspections_mark'].join(',')
type: ['inspections_mark'].join(','),
})
this.dictMap = {
...dict.data
}
}
...dict.data,
}
},
},
}
</script>
@ -104,6 +138,7 @@ export default {
.imageList {
display: flex;
flex-wrap: wrap;
gap: 24rpx;
.image {
width: 192rpx;

193
sub/task/record.vue

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

Loading…
Cancel
Save