Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pages/enterprise.vue
master
DX 1 month ago
parent
commit
118de3fec3
  1. 11
      api/enterprise/index.js
  2. 51
      api/taglibrary/index.js
  3. 5
      package.json
  4. 737
      pages/enterprise.vue
  5. 883
      pages/index.vue
  6. 13
      pages/owner.vue
  7. 4
      pages/task.vue
  8. 3
      sub/chat/index.vue
  9. 2
      sub/enterprise/detail.vue
  10. 115
      sub/enterprise/edit.vue
  11. 309
      sub/invite/addEnterprise.vue
  12. 168
      sub/invite/enterpriseTags.vue
  13. 46
      sub/invite/index.vue
  14. 43
      sub/invite/prove.vue
  15. 4
      sub/owner/policy-detail.vue
  16. 2
      sub/task/enforce.vue
  17. 2
      uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

11
api/enterprise/index.js

@ -23,7 +23,16 @@ export function getEnterPriseList(params) {
params
})
}
/**
* 校验企业名
*/
export function vertifyName(params) {
return request({
url: `/system/enterprise/page`,
method: 'GET',
params
})
}
/**
* 获取企业详情
* @param {Object} id

51
api/taglibrary/index.js

@ -0,0 +1,51 @@
import request from '@/utils/request'
// 企业标签 API
export const TagLibraryApi = {
// 查询企业标签分页
getTagLibraryPage(params) {
return request({
method: 'get',
url: '/system/tag-library/page',
params: params
})
},
// 查询企业标签详情
getTagLibrary(id) {
return request({
method: 'get',
url: '/system/tag-library/get?id=' + id
})
},
// 新增企业标签
createTagLibrary(data) {
return request({
method: 'post',
url: '/system/tag-library/create',
data: data
})
},
// 修改企业标签
updateTagLibrary(data) {
return request({
method: 'put',
url: '/system/tag-library/update',
data: data
})
},
// 删除企业标签
deleteTagLibrary(id) {
return request({
method: 'delete',
url: '/system/tag-library/delete?id=' + id
})
},
}

5
package.json

@ -0,0 +1,5 @@
{
"dependencies": {
"crypto-js": "^4.0.0"
}
}

737
pages/enterprise.vue

@ -1,398 +1,357 @@
<template>
<cs-page
:selected="3"
title="企业档案"
isTab
>
<view
class="page-container"
id="page"
>
<van-search
:value="queryParams.enterprisesName"
placeholder="输入企业名称或类型查询"
@sreach="handleSearch"
@clear="resetQuery('enterpriseName')"
id="sreach"
/>
<van-dropdown-menu
safe-area-tab-bar
active-color="#17C653"
>
<van-dropdown-item
:value="queryParams.qy"
:options="getDropdownOption('enterprises_area')"
@change="
v => {
querySelect(v, 'region')
}
"
/>
<van-dropdown-item
:value="queryParams.hy"
:options="getDropdownOption('hy')"
@change="
v => {
querySelect(v, 'hy')
}
"
/>
<van-dropdown-item
:value="queryParams.st"
:options="getDropdownOption('st')"
@change="
v => {
querySelect(v, 'st')
}
"
/>
<van-dropdown-item
:value="queryParams.wr"
:options="getDropdownOption('wr')"
@change="
v => {
querySelect(v, 'wr')
}
"
/>
</van-dropdown-menu>
<scroll-view
scroll-y="true"
:refresher-enabled="true"
@refresherrefresh="refresherrefresh"
:refresher-triggered="refresherTriggered"
@refresherpulling="refresherpulling"
@scrolltolower="loadMore"
class="list"
:style="{ maxHeight: `${listHeight - sreachHeight}px` }"
>
<view
v-for="enterprise in list"
:key="enterprise.id"
class="wd-flex wd-items-center enterprise"
@click="goDetail(enterprise.id)"
>
<u-avatar
:src="enterprise.files[0].url"
shape="square"
size="64"
></u-avatar>
<view
class="wd-flex wd-flex-col"
style="gap: 4px"
>
<text class="wd-font-800 wd-text-15">
{{ enterprise.enterprisesName }}
</text>
<view class="wd-flex wd-pb-8px">
<u-icon
name="map"
size="14"
color="#17C653"
></u-icon>
<text
class="address wd-text-12"
style="margin-left: 4px"
>
{{ enterprise.address }}
</text>
</view>
<view class="tagList">
<view class="tag">
{{
$dict.echoDicValue(
dictMap.enterprises_type,
enterprise.type
)
}}
</view>
<view class="tag">
{{
$dict.echoDicValue(
dictMap.enterprises_area,
enterprise.region
)
}}
</view>
<view
class="tag"
v-for="(tag, index) in enterprise.tagList"
:key="index"
>
{{ tag }}
</view>
</view>
</view>
<view
class="audit"
v-if="!enterprise.isAudit"
style="color: #f6b100; background-color: #fff8dd"
>
待审核
</view>
</view>
<u-loadmore
:status="load"
marginTop="12"
marginBottom="12"
/>
</scroll-view>
</view>
</cs-page>
<cs-page :selected="3" title="企业档案" isTab>
<view class="page-container" id="page">
<van-search
:value="queryParams.enterprisesName"
placeholder="输入企业名称或类型查询"
@sreach="handleSearch"
@clear="resetQuery('enterpriseName')"
id="sreach"
/>
<van-dropdown-menu safe-area-tab-bar active-color="#17C653">
<van-dropdown-item
:value="queryParams.qy"
:options="getDropdownOption('qy')"
@change="
v => {
querySelect(v, 'qy')
}
"
/>
<van-dropdown-item
:value="queryParams.hy"
:options="getDropdownOption('hy')"
@change="
v => {
querySelect(v, 'hy')
}
"
/>
<van-dropdown-item
:value="queryParams.st"
:options="getDropdownOption('st')"
@change="
v => {
querySelect(v, 'st')
}
"
/>
<van-dropdown-item
:value="queryParams.wr"
:options="getDropdownOption('wr')"
@change="
v => {
querySelect(v, 'wr')
}
"
/>
</van-dropdown-menu>
<scroll-view
scroll-y="true"
:refresher-enabled="true"
@refresherrefresh="refresherrefresh"
:refresher-triggered="refresherTriggered"
@refresherpulling="refresherpulling"
@scrolltolower="loadMore"
class="list"
:style="{ height: `${listHeight - sreachHeight}px` }"
>
<view
v-for="enterprise in list"
:key="enterprise.id"
class="wd-flex wd-items-center enterprise"
@click="goDetail(enterprise.id)"
>
<u-avatar
:src="enterprise.files[0].url"
shape="square"
size="64"
></u-avatar>
<view class="wd-flex wd-flex-col" style="gap: 4px">
<text class="wd-font-800 wd-text-15">
{{ enterprise.enterprisesName }}
</text>
<view class="wd-flex wd-pb-8px">
<u-icon name="map" size="14" color="#17C653"></u-icon>
<text class="address wd-text-12" style="margin-left: 4px">
{{ enterprise.address }}
</text>
</view>
<view class="tagList">
<view class="tag">
{{
$dict.echoDicValue(
dictMap.enterprises_type,
enterprise.type
)
}}
</view>
<view class="tag">
{{
$dict.echoDicValue(
dictMap.enterprises_area,
enterprise.region
)
}}
</view>
<view
class="tag"
v-for="(tag, index) in enterprise.tagList"
:key="index"
>
{{ tag }}
</view>
</view>
</view>
<view
class="audit"
v-if="!enterprise.isAudit"
style="color: #f6b100; background-color: #fff8dd"
>
待审核
</view>
</view>
<u-loadmore :status="load" marginTop="12" marginBottom="12" />
</scroll-view>
</view>
</cs-page>
</template>
<script>
import { getEnterPriseList } from '@/api/enterprise/index.js'
import {
getDictBatchByType,
getDeptTree,
getTagData,
} from '@/api/system/dict.js'
export default {
data() {
return {
queryParams: {
pageSize: 10,
pageNo: 1,
qy: '',
hy: '',
st: '',
wr: '',
enterprisesName: '',
tagList: '',
},
listHeight: 0,
sreachHeight: 0,
refresherTriggered: false,
list: [],
load: 'loadmore',
dictMap: {},
}
},
async onLoad() {
await this.getDict()
},
onShow() {
this.queryEnterprise()
},
onReady() {
this.getPageHeight()
},
methods: {
getPageHeight() {
const query = uni.createSelectorQuery().in(this)
query
.select('#sreach')
.boundingClientRect(data => {
this.sreachHeight = data.height
})
.exec()
query
.select('#page')
.boundingClientRect(data => {
this.listHeight = data.height - 35
})
.exec()
},
async getList() {
uni.showToast({
title: '加载中',
mask: true,
icon: 'loading',
})
this.load = 'loading'
const res = await getEnterPriseList(this.queryParams)
this.list.push(...res.data.list)
this.load = 'loadmore'
if (this.list.length == res.data.total) {
this.load = 'nomore'
}
uni.hideToast()
},
async getDict() {
const tags = await getTagData(
['qy', ' hy', 'st', 'wr'].join(',')
)
const dict = await getDictBatchByType({
type: [
'user_audit_type',
'enterprises_type',
'enterprises_area',
].join(','),
})
let tagMap = {}
tags.data.forEach(t => {
tagMap[t.tagCode] = t.children
})
console.log(tagMap)
this.dictMap = {
...tagMap,
...dict.data,
}
},
getDropdownOption(key) {
if (!this.dictMap[key]) return []
const keyMap = {
enterprises_area: '区域',
hy: '行业',
st: '生态',
wr: '污染',
}
if (['enterprises_area'].includes(key)) {
const data = this.dictMap[key].map(d => {
return {
value: d.value,
text: d.label,
}
})
data.push({
value: '',
text: keyMap[key],
})
return data
}
const data = this.dictMap[key].map(d => {
return {
value: d.id,
text: d.tagName,
}
})
data.push({
value: '',
text: keyMap[key],
})
return data
},
querySelect(v, key) {
this.queryParams[key] = v.detail
this.queryEnterprise()
},
handleSearch(e) {
this.queryParams.pageNum = 1 //
this.queryParams.name = e.detail //
this.getPolicyList()
},
queryEnterprise() {
this.queryParams.pageNo = 1
this.load = 'loadmore'
this.list = []
this.queryParams.tagList = [
this.queryParams.qy,
this.queryParams.hy,
this.queryParams.st,
this.queryParams.wr,
]
.filter(i => i != '')
.join()
this.getList()
},
loadMore() {
if (this.load == 'nomore') {
uni.showToast({
title: '没有更多了',
icon: 'none',
})
return
}
this.queryParams.pageNo++
this.getList()
},
refresherpulling() {
const that = this
if (!this.refresherTriggered) {
this.refresherTriggered = true
setTimeout(() => {
that.refresherTriggered = false
}, 1000)
}
},
refresherrefresh() {
this.resetQuery()
},
async resetQuery() {
this.queryParams = {
pageSize: 10,
pageNo: 1,
qy: '',
hy: '',
st: '',
wr: '',
enterprisesName: '',
tagList: '',
}
await this.queryEnterprise()
},
goDetail(id) {
uni.navigateTo({
url: `/sub/enterprise/detail?id=${id}`,
})
},
},
}
import { getEnterPriseList } from '@/api/enterprise/index.js'
import {
getDictBatchByType,
getDeptTree,
getTagData
} from '@/api/system/dict.js'
export default {
data() {
return {
queryParams: {
pageSize: 10,
pageNo: 1,
qy: '',
hy: '',
st: '',
wr: '',
enterprisesName: '',
tagList: ''
},
listHeight: 0,
sreachHeight: 0,
refresherTriggered: false,
list: [],
load: 'loadmore',
dictMap: {}
}
},
async onLoad() {
await this.getDict()
},
onShow() {
this.queryEnterprise()
},
onReady() {
this.getPageHeight()
},
methods: {
getPageHeight() {
const query = uni.createSelectorQuery().in(this)
query
.select('#sreach')
.boundingClientRect(data => {
this.sreachHeight = data.height
})
.exec()
query
.select('#page')
.boundingClientRect(data => {
this.listHeight = data.height - 35 - 25
})
.exec()
},
async getList() {
uni.showToast({
title: '加载中',
mask: true,
icon: 'loading'
})
this.load = 'loading'
const res = await getEnterPriseList(this.queryParams)
this.list.push(...res.data.list)
this.load = 'loadmore'
if (this.list.length == res.data.total) {
this.load = 'nomore'
}
uni.hideToast()
},
async getDict() {
const tags = await getTagData(['qy', ' hy', 'st', 'wr'].join(','))
const dict = await getDictBatchByType({
type: [
'user_audit_type',
'enterprises_type',
'enterprises_area'
].join(',')
})
let tagMap = {}
tags.data.forEach(t => {
tagMap[t.tagCode] = t.children
})
this.dictMap = {
...tagMap,
...dict.data
}
},
getDropdownOption(key) {
if (!this.dictMap[key]) return []
const keyMap = {
qy: '区域',
hy: '行业',
st: '生态',
wr: '污染'
}
const data = this.dictMap[key].map(d => {
return {
value: d.id,
text: d.tagName
}
})
data.push({
value: '',
text: keyMap[key]
})
return data
},
querySelect(v, key) {
this.queryParams[key] = v.detail
this.queryEnterprise()
},
handleSearch(e) {
this.queryParams.pageNum = 1 //
this.queryParams.name = e.detail //
this.getPolicyList()
},
queryEnterprise() {
this.queryParams.pageNo = 1
this.load = 'loadmore'
this.list = []
this.queryParams.tagList = [
this.queryParams.qy,
this.queryParams.hy,
this.queryParams.st,
this.queryParams.wr
]
.filter(i => i != '')
.join()
this.getList()
},
loadMore() {
if (this.load == 'nomore') {
uni.showToast({
title: '没有更多了',
icon: 'none'
})
return
}
this.queryParams.pageNo++
this.getList()
},
refresherpulling() {
const that = this
if (!this.refresherTriggered) {
this.refresherTriggered = true
setTimeout(() => {
that.refresherTriggered = false
}, 1000)
}
},
refresherrefresh() {
this.resetQuery()
},
async resetQuery() {
this.queryParams = {
pageSize: 10,
pageNo: 1,
qy: '',
hy: '',
st: '',
wr: '',
enterprisesName: '',
tagList: ''
}
await this.queryEnterprise()
},
goDetail(id) {
uni.navigateTo({
url: `/sub/enterprise/detail?id=${id}`
})
}
}
}
</script>
<style lang="scss" scoped>
.page-container {
height: 100%;
overflow: hidden;
}
.list {
display: flex;
flex-flow: column nowrap;
gap: 12px;
padding: 0 12px;
}
.enterprise {
padding: 12px;
background-color: #fff;
border-radius: $cs-border-radius;
gap: 12px;
margin-top: 12px;
position: relative;
overflow: hidden;
font-size: 12px;
.address {
color: $uni-text-color-grey;
}
&:active {
background-color: $cs-color-touch;
}
.tagList {
margin-top: 8px;
display: flex;
gap: 4px;
color: $uni-text-color-grey;
display: flex;
.tag {
font-size: 12px;
display: flex;
padding: 2px 6px;
justify-content: center;
align-items: center;
border-radius: 2px;
background: #f9f9f9;
}
}
.audit {
position: absolute;
right: -19px;
top: 6px;
transform: rotateZ(45deg);
transform-origin: 50% 50%;
padding: 4px 20px;
font-size: 12px;
text-align: center;
}
}
::v-deep .van-dropdown-menu {
box-shadow: none;
height: 35px;
font-size: 13px;
border-bottom: 1px solid #f1f1f4;
}
.page-container {
height: 100%;
overflow: hidden;
}
.list {
display: flex;
flex-flow: column nowrap;
gap: 12px;
padding: 0 12px;
}
.enterprise {
padding: 12px;
background-color: #fff;
border-radius: $cs-border-radius;
gap: 12px;
margin-top: 12px;
position: relative;
overflow: hidden;
font-size: 12px;
.address {
color: $uni-text-color-grey;
}
&:active {
background-color: $cs-color-touch;
}
.tagList {
margin-top: 8px;
display: flex;
gap: 4px;
color: $uni-text-color-grey;
display: flex;
.tag {
font-size: 12px;
display: flex;
padding: 2px 6px;
justify-content: center;
align-items: center;
border-radius: 2px;
background: #f9f9f9;
}
}
.audit {
position: absolute;
right: -19px;
top: 6px;
transform: rotateZ(45deg);
transform-origin: 50% 50%;
padding: 4px 20px;
font-size: 12px;
text-align: center;
}
}
::v-deep .van-dropdown-menu {
box-shadow: none;
height: 35px;
font-size: 13px;
border-bottom: 1px solid #f1f1f4;
}
::v-deep .u-list {
padding: 12px;
}
::v-deep .u-list {
padding: 12px;
}
</style>

883
pages/index.vue

@ -1,438 +1,461 @@
<template>
<cs-page :selected="0" title="智慧生态" isTab>
<view class="view-container">
<van-dropdown-menu safe-area-tab-bar active-color="#17C653">
<van-dropdown-item
:value="queryParams.deptId"
:options="getDropdownOption('dept')"
@change="
v => {
querySelect(v, 'deptId')
}
"
/>
<van-dropdown-item
:value="queryParams.selectWeek"
:options="getDropdownOption('select_week')"
@change="
v => {
querySelect(v, 'selectWeek')
}
"
/>
</van-dropdown-menu>
<scroll-view
:scroll-y="true"
:style="{ maxHeight: `${viewHeigth}px` }"
class="view"
:refresher-enabled="true"
@refresherrefresh="refresherrefresh"
:refresher-triggered="refresherTriggered"
@refresherpulling="refresherpulling"
>
<view class="box row-1">
<view class="wd-flex" style="justify-content: space-around">
<view
class="wd-flex wd-flex-col wd-flex-center"
style="gap: 4px"
>
<u-count-to
:start-val="0"
:end-val="detail.taskCount"
bold
font-size="24"
color="#071437"
></u-count-to>
<view class="">任务数量</view>
</view>
<view
class="wd-flex wd-flex-col wd-flex-center"
style="gap: 4px"
>
<u-count-to
:start-val="0"
:end-val="detail.inspectionsCount"
bold
font-size="24"
color="#071437"
></u-count-to>
<view class="">执法记录</view>
</view>
<view
class="wd-flex wd-flex-col wd-flex-center"
style="gap: 4px"
>
<u-count-to
:start-val="0"
:end-val="detail.enterpriseCount"
bold
font-size="24"
color="#071437"
></u-count-to>
<view class="">企业数量</view>
</view>
</view>
<qiun-data-charts
type="ring"
:opts="opts"
:chartData="chartData"
:canvas2d="true"
style="height: 144px"
></qiun-data-charts>
<view class="wd-flex" style="gap: 12px; flex-wrap: wrap">
<view
class="wd-flex wd-flex-col wd-flex-center"
v-for="item in detail.legendData"
:key="item"
style="
border: 1px solid #f9f9f9;
width: calc(100% / 3 - 8px);
padding: 12px;
gap: 4px;
border-radius: 4px;
"
>
<view class="wd-flex wd-flex-col" style="gap: 4px">
<view
class="wd-flex"
style="align-items: center; gap: 4px"
>
<view
:style="{
width: '8px',
height: '4px',
borderRadius: '4px',
backgroundColor: item.color
}"
></view>
<view class="">{{ item.name }}</view>
</view>
<view class="wd-flex wd-flex-center">
<u-count-to
:start-val="0"
:end-val="Number(item.value)"
bold
font-size="16"
color="#071437"
></u-count-to>
%
</view>
</view>
</view>
</view>
</view>
<view class="box row-1">
<view
class="wd-flex"
style="margin-top: 12px; justify-content: center"
>
<view
style="
background-color: #f9f9f9;
display: inline-flex;
padding: 4px;
"
>
<view
class="tab"
v-for="(item, index) in tabs"
:key="index"
:style="{
'--index': tabs.findIndex(
i => i.type == queryParams.type
)
}"
@tap="changeTab(item.type)"
>
<view
class="name"
:style="{
color:
queryParams.type == item.type ? '#071437' : '#78829d'
}"
>
{{ item.name }}
</view>
</view>
</view>
</view>
<view class="">
<view
v-for="(item, index) in list"
:key="index"
class="wd-flex"
style="justify-content: space-between; padding: 12px"
>
<view class="wd-font-800">{{ item.name }}</view>
<view class="wd-font-800" style="color: #ff6f1e">
<view>
<u-count-to
:start-val="0"
:end-val="item.count"
bold
font-size="14"
color="#FF6F1E"
></u-count-to>
<text>{{ queryParams.type == 1 ? '天' : '次' }}</text>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</cs-page>
<cs-page
:selected="0"
title="智慧生态"
isTab
>
<view class="view-container">
<van-dropdown-menu
safe-area-tab-bar
active-color="#17C653"
>
<van-dropdown-item
:value="queryParams.deptId"
:options="dropOption.dept"
use-before-toggle
@before-toggle="dorpToggle"
@change="
v => {
querySelect(v, 'deptId')
}
"
/>
<van-dropdown-item
:value="queryParams.selectWeek"
:options="dropOption.select_week"
@change="
v => {
querySelect(v, 'selectWeek')
}
"
/>
</van-dropdown-menu>
<scroll-view
:scroll-y="true"
:style="{ maxHeight: `${viewHeigth}px` }"
class="view"
:refresher-enabled="true"
@refresherrefresh="refresherrefresh"
:refresher-triggered="refresherTriggered"
@refresherpulling="refresherpulling"
>
<view class="box row-1">
<view
class="wd-flex"
style="justify-content: space-around"
>
<view
class="wd-flex wd-flex-col wd-flex-center"
style="gap: 4px"
>
<u-count-to
:start-val="0"
:end-val="detail.taskCount"
bold
font-size="24"
color="#071437"
></u-count-to>
<view class="">任务数量</view>
</view>
<view
class="wd-flex wd-flex-col wd-flex-center"
style="gap: 4px"
>
<u-count-to
:start-val="0"
:end-val="detail.inspectionsCount"
bold
font-size="24"
color="#071437"
></u-count-to>
<view class="">执法记录</view>
</view>
<view
class="wd-flex wd-flex-col wd-flex-center"
style="gap: 4px"
>
<u-count-to
:start-val="0"
:end-val="detail.enterpriseCount"
bold
font-size="24"
color="#071437"
></u-count-to>
<view class="">企业数量</view>
</view>
</view>
<qiun-data-charts
type="ring"
:opts="opts"
:chartData="chartData"
:canvas2d="true"
style="height: 144px"
></qiun-data-charts>
<view
class="wd-flex"
style="gap: 12px; flex-wrap: wrap"
>
<view
class="wd-flex wd-flex-col wd-flex-center"
v-for="item in detail.legendData"
:key="item"
style="
border: 1px solid #f9f9f9;
width: calc(100% / 3 - 8px);
padding: 12px;
gap: 4px;
border-radius: 4px;
"
>
<view
class="wd-flex wd-flex-col"
style="gap: 4px"
>
<view
class="wd-flex"
style="align-items: center; gap: 4px"
>
<view
:style="{
width: '8px',
height: '4px',
borderRadius: '4px',
backgroundColor: item.color,
}"
></view>
<view class="">{{ item.name }}</view>
</view>
<view class="wd-flex wd-flex-center">
<u-count-to
:start-val="0"
:end-val="Number(item.value)"
bold
font-size="16"
color="#071437"
></u-count-to>
%
</view>
</view>
</view>
</view>
</view>
<view class="box row-1">
<view
class="wd-flex"
style="margin-top: 12px; justify-content: center"
>
<view
style="
background-color: #f9f9f9;
display: inline-flex;
padding: 4px;
"
>
<view
class="tab"
v-for="(item, index) in tabs"
:key="index"
:style="{
'--index': tabs.findIndex(i => i.type == queryParams.type),
}"
@tap="changeTab(item.type)"
>
<view
class="name"
:style="{
color:
queryParams.type == item.type ? '#071437' : '#78829d',
}"
>
{{ item.name }}
</view>
</view>
</view>
</view>
<view style="min-height: 220px">
<view
v-for="(item, index) in list"
:key="index"
class="wd-flex"
style="justify-content: space-between; padding: 12px"
>
<view class="wd-font-800">{{ item.name }}</view>
<view
class="wd-font-800"
style="color: #ff6f1e"
>
<view>
<u-count-to
:start-val="0"
:end-val="item.count"
bold
font-size="14"
color="#FF6F1E"
></u-count-to>
<text>{{ queryParams.type == 1 ? '天' : '次' }}</text>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</cs-page>
</template>
<script>
import { getDictBatchByType, getDeptTree } from '@/api/system/dict.js'
import { HomeApi } from '@/api/common/home.js'
export default {
data() {
return {
dictMap: {},
queryParams: {
selectWeek: '',
deptId: '',
type: 1
},
detail: {},
opts: {},
chartData: {},
viewHeigth: 0,
tabs: [
{
name: '资质逾期',
type: 1
},
{
name: '整改次数',
type: 2
}
],
refresherTriggered: false,
list: [],
color: ['#1B84FF', '#7239EA', '#F6B100', '#F8285A', '#17C653']
}
},
onLoad: async function () {
await uni.hideTabBar()
uni.hideTabBar({
animation: false
})
this.getDict()
this.init()
},
onReady() {
this.$nextTick(() => {
this.getPageHeight()
})
},
onShow() {
this.init()
},
methods: {
getPageHeight() {
const query = uni.createSelectorQuery().in(this)
query
.select('.view-container')
.boundingClientRect(data => {
this.viewHeigth = data.height - 35 - 25
})
.exec()
},
async getDict() {
const dict = await getDictBatchByType({
type: ['select_week'].join(',')
})
const dept = await getDeptTree()
this.dictMap = {
...dict.data,
dept: dept.data
}
},
getDropdownOption(key) {
if (!this.dictMap[key]) return []
const keyMap = {
select_week: '周期',
dept: '部门'
}
if (key == 'dept') {
const data = [
...this.dictMap[key].map(d => {
return {
value: d.id,
text: d.name
}
})
]
if (!this.$roles.checkRole(['director'])) {
this.queryParams.deptId = this.$store.getters.deptId
return [...data]
}
return [...data, { value: '', text: keyMap[key] }]
}
return [
...this.dictMap[key].map(d => {
return {
value: d.value,
text: d.label
}
}),
{ value: '', text: keyMap[key] }
]
},
async init() {
if (!this.$roles.checkRole(['director'])) {
this.queryParams.deptId = this.$store.getters.deptId
}
const res = await HomeApi.getPieData(this.queryParams)
this.detail = res.data
let curIndex = 0
const data = this.detail.completionRate.map((item, index) => {
const res = { ...item, color: this.color[curIndex] }
curIndex > this.color.length ? 0 : curIndex++
return res
})
this.detail.legendData = data
this.setPieData(data, this.detail.taskCompletionRate)
this.getList()
},
async getList() {
const res = await HomeApi.getListData(this.queryParams)
this.list = res.data
},
setPieData(data, max) {
const pieData = data.map(i => {
return {
name: i.name,
value: Number(i.pieValue)
}
})
if (Number(max) < 100) {
pieData.push({
name: '',
value: 100 - Number(max),
color: '#fff'
})
}
this.opts = {
legend: {
show: false
},
color: this.color,
rotate: false,
rotateLock: false,
padding: [0, 0, 0, 0],
dataLabel: false,
enableScroll: false,
title: {
name: `${max}%`,
fontSize: 24,
color: '#071437',
fontWeight: 'bold'
},
subtitle: {
name: '完成率',
fontSize: 14,
color: '#78829D'
},
extra: {
ring: {
ringWidth: 15,
activeOpacity: 0.5,
offsetAngle: 90,
labelWidth: 15,
border: false,
borderColor: '#FFFFFF',
linearType: 'none'
}
}
}
this.chartData = {
series: [
{
data: pieData
}
]
}
},
sectionChange(index) {
this.queryParams.enterprise = index
},
querySelect(v, key) {
this.queryParams[key] = v.detail
this.init()
},
changeTab(type) {
this.queryParams.type = type
this.getList()
},
refresherpulling() {
const that = this
if (!this.refresherTriggered) {
this.refresherTriggered = true
setTimeout(() => {
that.refresherTriggered = false
}, 1000)
}
},
refresherrefresh() {
this.init()
}
}
}
import { getDictBatchByType, getDeptTree } from '@/api/system/dict.js'
import { HomeApi } from '@/api/common/home.js'
export default {
data() {
return {
dictMap: {},
queryParams: {
selectWeek: '',
deptId: '',
type: 1,
},
detail: {},
opts: {},
chartData: {},
viewHeigth: 0,
tabs: [
{
name: '资质逾期',
type: 1,
},
{
name: '整改次数',
type: 2,
},
],
refresherTriggered: false,
list: [],
dropOption: {},
color: ['#1B84FF', '#7239EA', '#F6B100', '#F8285A', '#17C653'],
}
},
onLoad: async function () {
await uni.hideTabBar()
uni.hideTabBar({
animation: false,
})
this.getDict()
if (!this.$roles.checkRole(['director'])) {
this.queryParams.deptId = this.$store.getters.deptId
}
this.init()
},
onReady() {
this.$nextTick(() => {
this.getPageHeight()
})
},
onShow() {
this.init()
},
methods: {
getPageHeight() {
const query = uni.createSelectorQuery().in(this)
query
.select('.view-container')
.boundingClientRect(data => {
this.viewHeigth = data.height - 35 - 25
})
.exec()
},
async getDict() {
const dict = await getDictBatchByType({
type: ['select_week'].join(','),
})
const dept = await getDeptTree()
this.dropOption.dept = [
...dept.data.map(i => {
return {
value: i.id,
text: i.name,
}
}),
{
value: '',
text: '全部',
},
]
this.dropOption.select_week = [
...dict.data.select_week.map(i => {
return {
value: i.value,
text: i.label,
}
}),
{
value: '',
text: '全部',
},
]
},
async init() {
// if (!this.$roles.checkRole(['director'])) {
// this.queryParams.deptId = this.$store.getters.deptId
// }
const res = await HomeApi.getPieData(this.queryParams)
this.detail = res.data
let curIndex = 0
const data = this.detail.completionRate.map((item, index) => {
const res = { ...item, color: this.color[curIndex] }
curIndex > this.color.length ? 0 : curIndex++
return res
})
this.detail.legendData = data
this.setPieData(data, this.detail.taskCompletionRate)
this.getList()
},
async getList() {
const res = await HomeApi.getListData(this.queryParams)
this.list = res.data
},
setPieData(data, max) {
const pieData = data.map(i => {
return {
name: i.name,
value: Number(i.pieValue),
}
})
if (Number(max) < 100) {
pieData.push({
name: '',
value: 100 - Number(max),
color: '#fff',
})
}
this.opts = {
legend: {
show: false,
},
color: this.color,
rotate: false,
rotateLock: false,
padding: [0, 0, 0, 0],
dataLabel: false,
enableScroll: false,
title: {
name: `${max}%`,
fontSize: 24,
color: '#071437',
fontWeight: 'bold',
},
subtitle: {
name: '完成率',
fontSize: 14,
color: '#78829D',
},
extra: {
ring: {
ringWidth: 15,
activeOpacity: 0.5,
offsetAngle: 90,
labelWidth: 15,
border: false,
borderColor: '#FFFFFF',
linearType: 'none',
},
},
}
this.chartData = {
series: [
{
data: pieData,
},
],
}
},
sectionChange(index) {
this.queryParams.enterprise = index
},
querySelect(v, key) {
this.queryParams[key] = v.detail
this.init()
},
changeTab(type) {
this.queryParams.type = type
this.getList()
},
refresherpulling() {
const that = this
if (!this.refresherTriggered) {
this.refresherTriggered = true
setTimeout(() => {
that.refresherTriggered = false
}, 1000)
}
},
refresherrefresh() {
this.init()
},
dorpToggle(e) {
if (!this.$roles.checkRole(['director'])) {
uni.showToast({
icon: 'none',
title: '暂无权限',
})
e.detail.callback(false)
} else {
e.detail.callback(true)
}
},
},
}
</script>
<style lang="scss" scoped>
.view-container {
height: 100%;
}
.view {
padding: 0 12px;
padding-bottom: 12px;
display: flex;
gap: 12px;
flex-flow: column nowrap;
.box {
padding: 12px;
background-color: #fff;
border: 1px solid #f9f9f9;
border-radius: 12px;
margin-top: 12px;
&:last-child {
margin-bottom: 12px;
}
}
.row-1 {
display: flex;
flex-flow: column nowrap;
gap: 12px;
}
.tab {
position: relative;
padding: 4px 16px;
.name {
z-index: 2;
position: inherit;
font-weight: bold;
}
&:first-child::before {
content: '';
position: absolute;
inset: 0;
background-color: #fff;
border-radius: 2px;
transform: translateX(calc(var(--index) * 100%));
transition: 0.2s all;
z-index: 1;
}
}
}
::v-deep .van-dropdown-menu {
box-shadow: none;
height: 35px !important;
font-size: 13px;
border-bottom: 1px solid #f1f1f4;
}
.view-container {
height: 100%;
}
.view {
padding: 0 12px;
padding-bottom: 12px;
display: flex;
gap: 12px;
flex-flow: column nowrap;
.box {
padding: 12px;
background-color: #fff;
border: 1px solid #f9f9f9;
border-radius: 12px;
margin-top: 12px;
&:last-child {
margin-bottom: 12px;
}
}
.row-1 {
display: flex;
flex-flow: column nowrap;
gap: 12px;
}
.tab {
position: relative;
padding: 4px 16px;
.name {
z-index: 2;
position: inherit;
font-weight: bold;
}
&:first-child::before {
content: '';
position: absolute;
inset: 0;
background-color: #fff;
border-radius: 2px;
transform: translateX(calc(var(--index) * 100%));
transition: 0.2s all;
z-index: 1;
}
}
}
::v-deep .van-dropdown-menu {
box-shadow: none;
height: 35px !important;
font-size: 13px;
border-bottom: 1px solid #f1f1f4;
}
</style>

13
pages/owner.vue

@ -54,7 +54,7 @@
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="section wd-flex wd-flex-row wd-justify-between">
<!-- <view class="section wd-flex wd-flex-row wd-justify-between">
<view class="wd-flex wd-flex-row" style="gap: 8px">
<u--image
src="/static/images/owner/edit.png"
@ -73,8 +73,11 @@
></u-count-to>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view class="section wd-flex wd-flex-row wd-justify-between">
</view> -->
<view
class="section wd-flex wd-flex-row wd-justify-between"
@click="btnPolicy"
>
<view class="wd-flex wd-flex-row" style="gap: 8px">
<u--image
src="/static/images/owner/list.png"
@ -84,7 +87,7 @@
></u--image>
<text class="wd-font-800">政策法规</text>
</view>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px" @click="btnPolicy">
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<u-count-to
:startVal="0"
:endVal="policyTotal"
@ -163,7 +166,7 @@ export default {
pageNum: 1,
pageSize: 10
}).then(res => {
this.policyTotal = res.data.total
this.policyTotal = res.data.total
})
},
openSubMessage() {

4
pages/task.vue

@ -48,7 +48,7 @@
@scrolltolower="loadMore"
class="list"
:enable-flex="true"
:style="{ maxHeight: `${listHeight}px` }"
:style="{ height: `${listHeight}px` }"
>
<view
v-for="task in list"
@ -169,7 +169,7 @@ export default {
query
.select('.page')
.boundingClientRect(data => {
this.listHeight = data.height - 55
this.listHeight = data.height - 55 - 25
})
.exec()
},

3
sub/chat/index.vue

@ -1,5 +1,6 @@
<template>
<web-view src="https://mb.jzce.com/chat/f07644a8e53c750a"></web-view>
<!-- <web-view src="https://mb.jzce.com/chat/f07644a8e53c750a"></web-view> -->
<web-view src="https://chat.deepseek.com/"></web-view>
</template>
<script>

2
sub/enterprise/detail.vue

@ -30,7 +30,7 @@
<view class="wd-flex" style="align-items: center">
<text class="address" style="margin-right: 8px">环保负责人</text>
<text style="margin-right: 16px">
{{ detail.enterprisesName }}
{{ detail.contactName }}
</text>
<text class="address" style="margin-right: 8px">联系方式</text>
<text style="text-decoration: underline">

115
sub/enterprise/edit.vue

@ -188,22 +188,22 @@
<text class="placeholder" v-else>请选择到期日期</text>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<!-- 企业照片 -->
<u-form-item
label="资质照片"
prop="photo"
borderBottom
labelPosition="top"
labelWidth="80"
>
<u-upload
:fileList="prove.form.photo"
@afterRead="addEnterpriseProvePhoto"
@delete="delEnterpriseProvePhoto"
multiple
:maxCount="3"
></u-upload>
</u-form-item>
<!-- 企业照片 -->
<u-form-item
label="资质照片"
prop="photo"
borderBottom
labelPosition="top"
labelWidth="80"
>
<u-upload
:fileList="prove.form.photo"
@afterRead="addEnterpriseProvePhoto"
@delete="delEnterpriseProvePhoto"
multiple
:maxCount="3"
></u-upload>
</u-form-item>
<u-form-item
label="描述"
prop="qualificationDescription"
@ -386,21 +386,21 @@ export default {
qualificationDescription: '',
handleDate: '',
enterpriseAuth: '',
photo: []
photo: []
}
}
}
},
onLoad(res) {
if (res.invateId) {
console.log(res)
console.log(res)
this.invateId = res.invateId
}
this.getDict()
},
onReady() {
this.step.active == 0 &&
this.$refs.infoFormRef.setRules(this.info.rules)
this.$refs.infoFormRef.setRules(this.info.rules)
this.initProveList()
},
methods: {
@ -450,44 +450,43 @@ export default {
delEnterpriseProvePhoto(e) {
this.prove.form.photo.splice(e.index, 1)
},
/**
* 选择图片并上传
* @param {Object} e
*/
async addEnterprisePhoto(e) {
this.info.form.photo = e.file.map(p => {
console.log(p.url)
return {
...p,
status: 'uploading',
message: '上传中'
}
})
// 使promise.all()
await Promise.all(
this.info.form.photo.map(async (p, i) => {
const res = await uploadFile({ name: `file`, filePath: p.url })
return {
...res.data,
status: 'success',
message: ''
}
})
).then(res => {
this.info.form.photo = res
console.log('pthoto3', this.info.form.photo)
})
},
/**
* 删除图片
* @param {Object} e
*/
delEnterprisePhoto(e) {
this.info.form.photo.splice(e.index, 1)
},
/**
* 选择图片并上传
* @param {Object} e
*/
async addEnterprisePhoto(e) {
this.info.form.photo = e.file.map(p => {
console.log(p.url)
return {
...p,
status: 'uploading',
message: '上传中'
}
})
// 使promise.all()
await Promise.all(
this.info.form.photo.map(async (p, i) => {
const res = await uploadFile({ name: `file`, filePath: p.url })
return {
...res.data,
status: 'success',
message: ''
}
})
).then(res => {
this.info.form.photo = res
console.log('pthoto3', this.info.form.photo)
})
},
/**
* 删除图片
* @param {Object} e
*/
delEnterprisePhoto(e) {
this.info.form.photo.splice(e.index, 1)
},
/**
* 弹出选择器
* @param {String} type 字典类型
@ -629,7 +628,7 @@ export default {
let prove
let data = this.prove.form
data.enterpriseId = this.info.form.id
data.files = this.prove.form.photo.map(p => p.id)
data.files = this.prove.form.photo.map(p => p.id)
if (data.id) {
prove = await updateProve(data)
} else {

309
sub/invite/addEnterprise.vue

@ -6,14 +6,17 @@
企业名称
</view>
<view class="value">
<input
class="input-value"
<uni-easyinput
type="text"
placeholder-class="txt"
placeholder="请输入企业名称"
v-model="form.enterpriseName"
:inputBorder="false"
style="text-align: center"
:value="form.enterprisesName"
@blur="proofName"
/>
:clearable="false"
:autoHeight="true"
ref="nameRef"
></uni-easyinput>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
@ -42,8 +45,8 @@
企业介绍
</view>
<view class="value" @tap="goIntruduce">
<view class="input-textarea" v-if="form.introduce">
{{ form.introduce }}
<view class="input-textarea" v-if="form.introduction">
{{ form.introduction }}
</view>
<view class="input-textarea" style="color: #808080" v-else>
请输入企业介绍
@ -84,8 +87,12 @@
企业标签
</view>
<view class="value" @tap="goTags">
<view class="input-textarea" v-if="form.introduce">
{{ form.tags }}
<view class="input-textarea" v-if="Object.keys(form.tags).length">
{{
Object.values(form.tags)
.map(tag => tag.name)
.join('、')
}}
</view>
<view class="input-textarea" style="color: #808080" v-else>
请选择企业标签
@ -100,13 +107,14 @@
企业负责人
</view>
<view class="value">
<input
class="input-value"
<uni-easyinput
type="text"
placeholder-class="txt"
placeholder="请输入企业负责人"
:inputBorder="false"
v-model="form.contactName"
/>
:clearable="false"
:autoHeight="true"
></uni-easyinput>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
@ -117,14 +125,16 @@
负责人电话
</view>
<view class="value">
<input
class="input-value"
<uni-easyinput
type="text"
placeholder-class="txt"
placeholder="请输入负责人电话"
v-model="form.environmentalContactPhone"
@blur="proofName"
/>
:inputBorder="false"
style="text-align: center"
:value="form.environmentalContactPhone"
@blur="proofphone"
:clearable="false"
:autoHeight="true"
></uni-easyinput>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
@ -150,44 +160,41 @@
<u-icon name="plus-circle" color="#17C653" size="14"></u-icon>
<text style="line-height: 1rem">新增资质</text>
</view>
<view
class="wd-flex"
style="justify-content: space-between"
v-for="(p, index) in prove"
:key="index"
v-if="prove.length > 0"
>
<image
src="@/static/images/enterprise/zz.png"
style="width: 90px; height: 70px"
mode="widthFix"
></image>
<view
style="flex: 1; justify-content: space-between"
class="wd-flex wd-flex-col"
>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质名称</text>
<view>
{{
$dict.echoDicValue(
dictMap.enterprise_qua,
prove.qualificationName.toString()
)
}}
</view>
</view>
<view
class="prove"
v-for="(p, index) in prove"
:key="index"
v-if="prove.length > 0"
@tap="editProve(p)"
>
<image
:src="p.photo[0].url"
style="width: 90px; height: 70px"
mode="widthFix"
></image>
<view class="info">
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质名称</text>
<view class="wd-font-800">
{{
$dict.echoDicValue(
dictMap.enterprise_qua,
p.qualificationName.toString()
)
}}
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质编号</text>
<view>
{{ prove.enterpriseAuth }}
</view>
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质编号</text>
<view class="wd-font-800">
{{ p.enterpriseAuth }}
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质到期</text>
<view>
{{ $util.formatDate(prove.expiryDate, 'YYYY/M/D') }}
</view>
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质到期</text>
<view class="wd-font-800">
{{ $util.formatDate(p.expiryDate, 'YYYY/M/D') }}
</view>
</view>
</view>
@ -196,7 +203,7 @@
<cs-bottom-wrapper>
<view class="operation">
<button class="btn green">提交审核</button>
<button class="btn green" @tap="submit">提交审核</button>
</view>
</cs-bottom-wrapper>
</view>
@ -205,20 +212,28 @@
<script>
import { uploadFile } from '@/api/system/file.js'
import { getDictBatchByType } from '@/api/system/dict.js'
import {
createEnterPrise,
vertifyName,
c
} from '@/api/enterprise/index.js'
export default {
data() {
return {
form: {
enterpiseName: undefined,
address: undefined,
gpsLocation: undefined,
introduce: '',
enterprisesName: '',
address: '',
gpsLocation: '',
introduction: '',
photo: [],
tags: {}
tags: {},
environmentalContactPhone: '',
contactName: '',
id: ''
},
dictMap: {},
prove: [],
inviteId: undefined
inviteId: ''
}
},
onLoad(res) {
@ -227,7 +242,7 @@ export default {
},
onShow() {
uni.$on('enterpriseIntroduce', data => {
this.form.introduce = data.introduce
this.form.introduction = data.introduce
})
uni.$on('enterpriseTag', data => {
this.form.tags = data
@ -238,7 +253,39 @@ export default {
},
methods: {
proofName(v) {
console.log(v.detail.value)
if (v.detail.value == '') return
uni.showLoading({
title: '加载中'
})
vertifyName({
pageSize: -1,
pageNo: 1,
onlyEnterprisesName: v.detail.value
}).then(res => {
if (res.data.total > 0) {
uni.showToast({
title: '企业名已存在',
icon: 'none'
})
this.form.enterprisesName = ''
} else {
this.form.enterprisesName = v.detail.value
}
uni.hideLoading()
})
},
proofphone(v) {
//
const mobilePattern = /^1[3-9]\d{9}$/ //
if (!mobilePattern.test(v.detail.value)) {
uni.showToast({
title: '请输入有效的手机号',
icon: 'none'
})
this.form.environmentalContactPhone = ''
} else {
this.form.environmentalContactPhone = v.detail.value
}
},
/**
* 获取字典
@ -261,12 +308,14 @@ export default {
},
goIntruduce() {
uni.navigateTo({
url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduce}`
url: `/sub/invite/enterpriseIntroduce?introduce=${this.form.introduction}`
})
},
goTags() {
uni.navigateTo({
url: `/sub/invite/enterpriseTags?tags=${this.form.tags}`
url: `/sub/invite/enterpriseTags?tags=${JSON.stringify(
this.form.tags
)}`
})
},
/**
@ -274,6 +323,9 @@ export default {
* @param {Object} e
*/
async addEnterprisePhoto(e) {
uni.showLoading({
title: '上传中...'
})
e.file.forEach(p => {
this.form.photo.push({
...p,
@ -296,6 +348,7 @@ export default {
})
).then(res => {
this.form.photo = res
uni.hideLoading()
})
},
/**
@ -309,6 +362,73 @@ export default {
uni.navigateTo({
url: '/sub/invite/prove'
})
},
editProve(prove) {
uni.navigateTo({
url: `/sub/invite/prove?prove=${JSON.stringify(prove)}`
})
},
async submit() {
const valide = await this.verifyForm()
if (!valide) return
const data = { ...this.form }
data.region = data.tags.qy.id
// data.type = data.tags.qy.id
data.tagIds = [data.tags.hy.id, data.tags.st.id, data.tags.wr.id]
data.fileIds = data.photo.map(i => i.id)
// data.userId = this.inviteId
data.userId = 162
data.qualis = this.prove.map(i => {
return {
...i,
expiryDate: new Date(i.expiryDate).getTime(),
files: i.photo.map(f => f.id)
}
})
if (this.form.id) {
} else {
console.log(data)
createEnterPrise(data).then(res => {
uni.showToast({
icon: 'none',
title: '操作成功'
})
uni.navigateBack()
})
}
},
async verifyForm() {
const msgMap = {
enterprisesName: '请输入企业名',
address: '请选择企业地址',
gpsLocation: '请选择企业地址',
introduction: '请填写企业介绍',
photo: '最少上传一张企业照片',
tags: '请选择企业标签',
prove: '请填写企业资质',
environmentalContactPhone: '请输入企业负责人',
contactName: '请输入负责人电话'
}
const msg = []
Object.keys(this.form).forEach(i => {
if (!this.form[i] && i != 'id') {
msg.push(msgMap[i])
}
if (typeof this.form[i] == 'Object' && this.form[i].length == 0) {
msg.push(msgMap[i])
}
})
if (this.prove.length == 0) {
msg.push(msgMap.prove)
}
if (msg.length > 0) {
uni.showToast({
icon: 'none',
title: msg.join('\n')
})
return false
}
return true
}
}
}
@ -345,6 +465,12 @@ export default {
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
cursor: auto;
display: block;
font-family: UICTFontTextStyleBody;
height: 1.4rem;
min-height: 1.4rem;
overflow: hidden;
}
.input-textarea {
flex: 1;
@ -352,15 +478,38 @@ export default {
overflow: hidden;
text-align: right;
max-height: 3rem;
line-height: 1rem;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
word-break: break-all;
cursor: auto;
display: block;
font-family: UICTFontTextStyleBody;
height: 1.4rem;
min-height: 1.4rem;
overflow: hidden;
}
}
}
.prove {
border-radius: var(--Number-12px, 12px);
border: 1px solid var(--LightMode-Grey-Grey-100, #f9f9f9);
background: var(--LightMode-Light-Light, #fff);
display: flex;
padding: var(--Number-12px, 12px);
align-items: center;
gap: var(--Number-12px, 12px);
font-size: 28rpx;
flex-flow: row nowrap;
.info {
height: 72px;
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
}
}
.upload-wrapper {
display: flex;
flex-flow: column nowrap;
@ -370,6 +519,32 @@ export default {
gap: 12px;
}
::v-deep .uni-easyinput__content-input {
flex: 1;
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
cursor: auto;
display: block;
font-family: UICTFontTextStyleBody;
height: 1.4rem;
min-height: 1.4rem;
overflow: hidden;
padding-right: 0;
}
::v-deep .uni-easyinput__placeholder-class {
flex: 1;
text-align: right;
white-space: nowrap;
text-overflow: ellipsis;
cursor: auto;
display: block;
font-family: UICTFontTextStyleBody;
height: 1.4rem;
min-height: 1.4rem;
font-size: 14px;
overflow: hidden;
}
.operation {
padding: 12px;
display: flex;

168
sub/invite/enterpriseTags.vue

@ -1,20 +1,72 @@
<template>
<view class="view">
<view class="block" v-for="(tag, index) in data" :key="index">
<view style="">
<view class="block">
<view>
<text style="color: #f8285a; margin-right: 4px">*</text>
{{ tag.name }}
所在区域
</view>
<view class="value" @click="showPicker(tag)">
<view class="input-value" v-if="form[tag.name]">
{{ form[tag.name].name }}
<view class="value" @click="showPicker('qy')">
<view class="input-value" v-if="form.qy">
{{ form.qy.name }}
</view>
<view class="input-value" style="color: #808080" v-else>
{{ `请选择${tag.name}` }}
请选择所在区域
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 行业类型 -->
<view class="block">
<view>
<text style="color: #f8285a; margin-right: 4px">*</text>
行业类型
</view>
<view class="value" @click="showPicker('hy')">
<view class="input-value" v-if="form.hy">
{{ form.hy.name }}
</view>
<view class="input-value" style="color: #808080" v-else>
请选择行业类型
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 省厅类型 -->
<view class="block">
<view>
<text style="color: #f8285a; margin-right: 4px">*</text>
所属生态
</view>
<view class="value" @click="showPicker('st')">
<view class="input-value" v-if="form.st">
{{ form.st.name }}
</view>
<view class="input-value" style="color: #808080" v-else>
请选择所属生态
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<!-- 污染类型 -->
<view class="block">
<view>
<text style="color: #f8285a; margin-right: 4px">*</text>
污染类型
</view>
<view class="value" @click="showPicker('wr')">
<view class="input-value" v-if="form.wr">
{{ form.wr.name }}
</view>
<view class="input-value" style="color: #808080" v-else>
请选择污染类型
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<u-picker
:show="picker.show"
:columns="picker.data"
@ -27,18 +79,25 @@
></u-picker>
<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>
</template>
<script>
import { getTagData, getDictBatchByType } from '@/api/system/dict.js'
export default {
data() {
return {
data: [],
form: {},
form: {
qy: '',
hy: '',
st: '',
wr: ''
},
dictMap: {},
//
picker: {
show: false,
@ -49,35 +108,58 @@ export default {
}
},
onLoad(res) {
this.getData()
if (res.tags) {
this.form = JSON.parse(res.tags)
}
this.getDict()
},
methods: {
getData() {
this.data = new Array(5).fill(1).map((i, index) => {
this.form[`Tag${index + 1}`] = ''
return {
name: `Tag${index + 1}`,
label: `标签${index + 1}`,
value: index,
children: new Array(10).fill(1).map((c, cIndex) => {
async getDict() {
try {
const tags = await getTagData(['qy', 'hy', 'st', 'wr'].join(','))
const dict = await getDictBatchByType({
type: ['enterprises_area'].join(',')
})
if (tags.code === 0 && tags.data) {
let tagMap = {}
tags.data.forEach(t => {
//
const children = t.children.map(child => ({
name: child.tagName,
value: child.id
}))
tagMap[t.tagCode] = children
})
tagMap.qy = dict.data.enterprises_area.map(i => {
return {
name: `subTag${cIndex + 1}`,
value: cIndex * 10
name: i.label,
value: i.value
}
})
this.dictMap = tagMap
}
})
console.log(this.data)
} catch (error) {
uni.showToast({
title: '获取数据失败',
icon: 'none'
})
}
},
/**
* 选择器确认回调
* @param {Object} e
*/
confirmPicker(e) {
const { value } = e
this.form[this.picker.key] = value[0].value
//
this.form[this.picker.key] = {
name: value[0].name,
id: value[0].value
}
this.closePicker()
},
/**
* 关闭选择器
*/
@ -88,26 +170,40 @@ export default {
data: []
}
},
showPicker(tag) {
this.picker.data.push(tag.children)
this.picker.key = tag.name
showPicker(type) {
this.picker.data = [this.dictMap[type] || []]
this.picker.key = type
this.picker.show = true
},
submit() {
const msg = Object.keys(this.form).filter(k => {
if (this.form[k] == '') {
return this.data.find(d => d.name == k).label
}
})
if (msg.length > 0) {
//
if (
!this.form.qy ||
!this.form.hy ||
!this.form.st ||
!this.form.wr
) {
const emptyFields = []
if (!this.form.qy) emptyFields.push('所在区域')
if (!this.form.hy) emptyFields.push('行业类型')
if (!this.form.st) emptyFields.push('所属生态')
if (!this.form.wr) emptyFields.push('污染类型')
uni.showToast({
icon: 'none',
title: `${msg.join('\n')}不能为空`
title: `请选择${emptyFields.join('、')}`,
icon: 'none'
})
return
}
uni.$emit('enterpriseTag', this.form)
console.log(this.form)
//
const submitData = {
qy: this.form.qy,
hy: this.form.hy,
st: this.form.st,
wr: this.form.wr
}
uni.$emit('enterpriseTag', submitData)
uni.navigateBack()
}
}

46
sub/invite/index.vue

@ -1,6 +1,14 @@
<template>
<view>
<scroll-view direction="vertical"></scroll-view>
<view class="view">
<view class="emty">
<image
src="/static/images/emty.png"
style="width: 79px; height: 79px"
mode="widthFix"
></image>
<text>暂无数据</text>
</view>
<cs-bottom-wrapper>
<view class="operation">
<button class="btn green" @tap="addEnterprise">新增企业</button>
@ -10,19 +18,28 @@
</template>
<script>
import { vertifyName } from '@/api/enterprise/index.js'
export default {
data() {
return {
inviteId: ''
inviteId: '',
list: []
}
},
onLoad(res) {
console.log(res)
if (res.inviteId) {
this.inviteId = res.inviteId
}
this.getList()
},
methods: {
getList() {
vertifyName({ enterpriseUserId: this.$store.getters.userId }).then(
res => {
this.list = res.list
}
)
},
addEnterprise() {
uni.navigateTo({
url: `/sub/invite/addEnterprise?inviteId=${this.inviteId}`
@ -33,6 +50,27 @@ export default {
</script>
<style lang="scss" scoped>
.view {
padding: 12px;
display: flex;
flex-flow: column nowrap;
gap: 12px;
overflow: hidden;
overflow-y: scroll;
max-height: 100vh;
padding-bottom: 12vh;
}
.emty {
border-radius: 8px;
height: 550rpx;
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
background-color: #fff;
gap: 12px;
color: #99a1b7;
}
.operation {
padding: 12px;
display: flex;

43
sub/invite/prove.vue

@ -18,7 +18,7 @@
}}
</view>
<view class="input-textarea" style="color: #808080" v-else>
输入资质名称
选择资质名称
</view>
<u-icon name="arrow-right"></u-icon>
</view>
@ -151,8 +151,11 @@ export default {
},
onLoad(res) {
uni.setNavigationBarTitle({
title: !res ? '编辑资质' : '新增资质'
title: res.prove ? '编辑资质' : '新增资质'
})
if (res.prove) {
this.prove = JSON.parse(res.prove)
}
this.getDict()
},
onShow() {},
@ -173,28 +176,22 @@ export default {
* @param {Object} e
*/
async addPhoto(e) {
e.file.forEach(p => {
this.prove.photo.push({
...p,
status: 'uploading',
message: '上传中'
})
uni.showLoading({
title: '正在上传...'
})
// 使promise.all()
await Promise.all(
this.prove.photo.map(async (p, i) => {
if (p.status == 'uploading') {
const res = await uploadFile({ name: `file`, filePath: p.url })
return {
...res.data,
status: 'success',
message: ''
}
}
return p
this.prove.photo.push({
...e.file,
status: 'uploading',
message: '上传中'
})
uploadFile({ name: `file`, filePath: e.file.url }).then(res => {
this.prove.photo = []
this.prove.photo.push({
...res.data,
status: 'success',
message: ''
})
).then(res => {
this.prove.photo = res
uni.hideLoading()
})
},
/**
@ -202,7 +199,7 @@ export default {
* @param {Object} e
*/
delPhoto(e) {
this.prove.photo.splice(e.index, 1)
this.prove.photo = []
},
/**
* 选择器确认回调

4
sub/owner/policy-detail.vue

@ -77,9 +77,9 @@ export default {
<style lang="scss">
.policy-detail {
min-height: 100vh;
height: 100vh;
background: #fff;
overflow-y: auto;
.nav-bar {
position: fixed;

2
sub/task/enforce.vue

@ -106,7 +106,7 @@ export default {
state: undefined,
inspectionsId: undefined,
advice: undefined,
photo: undefined,
photo: [],
date: ''
},
showModel: false

2
uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue

@ -419,7 +419,7 @@ export default {
const paddingRight =
this.type === 'password' || this.clearable || this.prefixIcon
? ''
: '10px'
: '0px'
return obj2strStyle({
'padding-right': paddingRight,
'padding-left': this.prefixIcon ? '' : '10px'

Loading…
Cancel
Save