Browse Source

修改登录逻辑

master
parent
commit
3b4d0fd3e0
  1. 116
      App.vue
  2. 11
      api/enterprise/index.js
  3. 2
      api/enterprise/prove.js
  4. 4
      main.js
  5. 38
      pages/enterprise.vue
  6. 896
      pages/index.vue
  7. 115
      pages/login.vue
  8. 54
      pages/owner.vue
  9. 7
      pages/task.vue
  10. 45
      static/echarts.esm.min.mjs
  11. BIN
      static/favicon.png
  12. BIN
      static/images/owner/edit.png
  13. BIN
      static/images/owner/list.png
  14. BIN
      static/images/owner/message.png
  15. BIN
      static/images/owner/phone.png
  16. BIN
      static/images/task/position.png
  17. 1
      static/scss/global.scss
  18. 1
      store/modules/user.js
  19. 44
      sub/common/waiting.vue
  20. 30
      sub/enterprise/detail.vue
  21. 109
      sub/invite/addEnterprise.vue
  22. 4
      sub/invite/enterpriseTags.vue
  23. 59
      sub/invite/index.vue
  24. 60
      sub/invite/prove.vue
  25. 49
      sub/owner/edit.vue
  26. 70
      sub/task/enforce.vue
  27. 45
      sub/task/locate.vue
  28. 2
      uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue
  29. 62
      utils/permission.js
  30. 30
      utils/request.js
  31. 24
      utils/ruoyi.js

116
App.vue

@ -1,41 +1,28 @@
<script>
import config from './config'
import store from '@/store'
import config from './config.js'
import { getAccessToken, setOpenId, getOpenId } from '@/utils/auth'
export default {
data() {
return {
invateId: ''
}
return {}
},
onLaunch: function (options) {
if (options.query.invateId) {
this.invateId = options.query.invateId
}
this.initApp()
async onLaunch(options) {
await this.initApp()
},
methods: {
//
async initApp() {
await uni.hideTabBar()
uni.hideTabBar({
animation: false
})
initApp() {
uni.hideTabBar()
//
await this.initConfig()
this.initConfig()
if (!getOpenId()) {
this.applogin()
return
}
//
this.checkLogin()
// this.checkLogin()
},
async initConfig() {
initConfig() {
this.globalData.config = config
uni.requestSubscribeMessage({
//ID
tmplIds: ['E8RK91cPLMios6ZHoKx6FJOV4H2kodx6yPWYp7jpLJY'],
success(res) {
console.log('requestSubscribeMessage', res)
}
})
uni.getSystemInfoAsync({
success: res => {
uni.setStorageSync('MOBILE', res.model)
@ -49,79 +36,18 @@ export default {
},
checkLogin() {
if (!getAccessToken()) {
this.login()
} else {
this.loginSuccess()
this.$tab.reLaunch('/pages/login')
}
},
login() {
console.log('-------' + getOpenId())
if (getOpenId()) {
const data = {
type: 34,
code: getOpenId(),
state: 'default',
userType: this.getUserType()
async applogin() {
uni.login({
success: res => {
setOpenId(res.code)
},
fail: err => {
console.log('getOpenIdFail', err)
}
//
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()
})
} else {
uni.login({
success: res => {
const data = {
type: 34,
code: res.code,
state: 'default',
userType: this.getUserType()
}
setOpenId(res.code)
//
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()
})
}
})
}
},
getUserType() {
//
if (this.invateId) return 2
// if (this.type == 'internal') return 3
// return 1
return 3
},
loginSuccess() {
this.$store.dispatch('GetInfo').then(res => {
this.handlerNavigateTo(res.data.user)
})
},
handlerNavigateTo(user) {
//
// if (this.invateId) {
// uni.navigateTo({
// url: `/sub/enterprise/edit?invateId=${this.invateId}`
// })
// return
// }
//
if (user.audit == 1) {
uni.navigateTo({
url: '/sub/common/waiting'
})
return
}
//
if (user.audit == null) {
//
uni.navigateTo({
url: '/sub/owner/edit'
})
return
}
}
}
}

11
api/enterprise/index.js

@ -74,4 +74,15 @@ export function getTaskLog(id) {
url: `/system/inspections-log/appList?inspectionsId=${id}`,
method: 'GET',
})
}
/**
* 更新企业
*/
export function updateEnterprise(data) {
return request({
url: `/system/enterprise/update`,
method: 'PUT',
data
})
}

2
api/enterprise/prove.js

@ -31,7 +31,7 @@ export function updateProve(data) {
*/
export function getProveList(data) {
return request({
url: `/system/enterprise-qualification/page`,
url: `/system/enterprise-qualification/pageEnterprise`,
method: 'GET',
data
})

4
main.js

@ -10,9 +10,9 @@ import * as roles from '@/utils/permission.js'
import uView from '@/uni_modules/uview-ui'
import mpShare from '@/uni_modules/uview-ui/libs/mixin/mpShare.js'
import TencentMap from '@/static/js/qqmap-wx-jssdk.min.js'
Vue.mixin(mpShare)
Vue.mixin(mpShare).use(uView)
// 挂载全局对象
Vue.use(plugins).use(uView)
Vue.use(plugins)
Vue.config.productionTip = false
const map = new TencentMap({

38
pages/enterprise.vue

@ -4,17 +4,18 @@
<van-search
:value="queryParams.enterprisesName"
placeholder="输入企业名称或类型查询"
@sreach="handleSearch"
@clear="resetQuery('enterpriseName')"
id="sreach"
@change="handleSearch"
/>
<van-dropdown-menu safe-area-tab-bar active-color="#17C653">
<van-dropdown-item
:value="queryParams.qy"
:options="getDropdownOption('qy')"
:value="queryParams.region"
:options="getDropdownOption('enterprises_area')"
@change="
v => {
querySelect(v, 'qy')
querySelect(v, 'region')
}
"
/>
@ -111,7 +112,12 @@
待审核
</view>
</view>
<u-loadmore :status="load" marginTop="12" marginBottom="12" />
<u-loadmore
:status="load"
marginTop="12"
marginBottom="12"
v-if="load == 'nomore'"
/>
</scroll-view>
</view>
</cs-page>
@ -130,7 +136,7 @@ export default {
queryParams: {
pageSize: 10,
pageNo: 1,
qy: '',
region: '',
hy: '',
st: '',
wr: '',
@ -206,11 +212,25 @@ export default {
getDropdownOption(key) {
if (!this.dictMap[key]) return []
const keyMap = {
qy: '区域',
enterprises_area: '区域',
hy: '行业',
st: '生态',
wr: '污染'
}
if (['enterprises_area'].includes(key)) {
return [
...this.dictMap[key].map(i => {
return {
value: i.value,
text: i.label
}
}),
{
value: '',
text: keyMap[key]
}
]
}
const data = this.dictMap[key].map(d => {
return {
value: d.id,
@ -229,18 +249,16 @@ export default {
this.queryEnterprise()
},
handleSearch(e) {
if(e.detail && e.detail.length > 1){
if (e.detail && e.detail.length > 1) {
this.queryParams.pageNo = 1 //
this.queryParams.enterprisesName = e.detail //
this.queryEnterprise()
}
},
queryEnterprise() {
this.load = 'loadmore'
this.list = []
this.queryParams.tagList = [
this.queryParams.qy,
this.queryParams.hy,
this.queryParams.st,
this.queryParams.wr
@ -276,7 +294,7 @@ export default {
this.queryParams = {
pageSize: 10,
pageNo: 1,
qy: '',
region: '',
hy: '',
st: '',
wr: '',

896
pages/index.vue

@ -1,461 +1,451 @@
<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="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>
<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; padding: 24rpx"
>
<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="people-name">{{ 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: [],
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)
}
},
},
}
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
})
console.log('init', data)
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'])) {
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;
}
.people-name {
max-width: 4rem;
max-height: 1rem;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.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>

115
pages/login.vue

@ -2,8 +2,8 @@
<view class="container">
<u--image
src="/static/favicon.png"
width="180px"
height="80px"
width="288rpx"
height="288rpx"
mode="aspectFit"
:fade="true"
duration="450"
@ -13,40 +13,62 @@
</template>
<script>
import { getAccessToken, setOpenId, getOpenId } from '@/utils/auth'
export default {
name: 'Login',
data() {
return {
invateId: ''
inviteId: '',
timer: null
}
},
onLoad(res) {
if (res.invateId) {
this.invateId = res.invateId
onLoad(options) {
if (options.inviteId) {
this.inviteId = options.inviteId
}
this.init()
this.initApp()
},
methods: {
init() {
uni.login({
success: res => {
const data = {
type: 34,
code: res.code,
state: 'default',
userType: this.getUserType()
}
//
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()
})
}
//
async initApp() {
await uni.hideTabBar()
uni.hideTabBar({
animation: false
})
//
this.checkLogin()
},
checkLogin() {
console.log('accessToken', getAccessToken())
if (!getAccessToken()) {
this.login()
} else {
this.loginSuccess()
}
},
login() {
console.log('openId', getOpenId())
if (getOpenId()) {
clearTimeout(this.timer)
const data = {
type: 34,
code: getOpenId(),
state: 'default',
userType: this.getUserType()
}
this.$store.dispatch('Login', data).then(() => {
this.loginSuccess()
})
} else {
this.timer && clearTimeout(this.timer)
this.timer = setTimeout(() => {
this.login()
}, 200)
}
},
getUserType() {
//
if (this.invateId) return 2
if (this.inviteId) return 2
// if (this.type == 'internal') return 3
// return 1
return 3
@ -57,33 +79,39 @@ export default {
})
},
handlerNavigateTo(user) {
if (this.redirect) {
uni.reLaunch({
url: this.redirect
})
return
}
//
if (this.invateId) {
uni.navigateTo({
url: `/sub/enterprise/edit?invateId=${this.invateId}`
if (this.inviteId) {
uni.reLaunch({
url: `/sub/invite/index?inviteId=${this.inviteId}`
})
return
}
//
if (user.audit == 1) {
uni.navigateTo({
uni.reLaunch({
url: '/sub/common/waiting'
})
return
}
//
if (user.audit == 2) {
uni.switchTab({
url: '/pages/index'
//
if (user.audit == null) {
//
uni.reLaunch({
url: '/sub/owner/edit'
})
return
}
//
uni.navigateTo({
url: '/sub/owner/edit'
uni.switchTab({
url: '/pages/index'
})
}
}
@ -99,17 +127,18 @@ export default {
align-items: center;
flex-flow: column nowrap;
gap: 20px;
background: linear-gradient(180deg, #02815b 0%, #114636 100%);
.icon {
width: 40vw;
filter: drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.12));
}
background: var(--LightMode-Success-Success, #17c653);
.title {
color: #fff;
text-shadow: 0px 2px 2px rgba(0, 0, 0, 0.12);
font-size: 30px;
color: var(--LightMode-Light-Light, #fff);
text-align: center;
text-shadow: 0px 2px 2px rgba(255, 255, 255, 0.12);
font-family: ShiShangJianTi;
font-size: 80rpx;
font-style: normal;
font-weight: 400;
letter-spacing: 2px;
line-height: normal;
letter-spacing: 4rpx;
}
}
</style>

54
pages/owner.vue

@ -47,7 +47,7 @@
</view> -->
<view
class="wd-flex wd-flex-row wd-items-center"
style="gap: 8px"
style="gap: 16rpx"
@click="openSubMessage"
>
<text>点击开启</text>
@ -78,7 +78,7 @@
class="section wd-flex wd-flex-row wd-justify-between"
@click="btnPolicy"
>
<view class="wd-flex wd-flex-row" style="gap: 8px">
<view class="wd-flex wd-flex-row" style="gap: 16rpx">
<u--image
src="/static/images/owner/list.png"
width="20px"
@ -87,7 +87,10 @@
></u--image>
<text class="wd-font-800">政策法规</text>
</view>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<view
class="wd-flex wd-flex-row wd-items-center"
style="gap: 16rpx"
>
<u-count-to
:startVal="0"
:endVal="policyTotal"
@ -97,28 +100,32 @@
<u-icon name="arrow-right"></u-icon>
</view>
</view>
<view
<button
class="section wd-flex wd-flex-row wd-justify-between"
open-type="share"
@click="invite"
>
<view class="wd-flex wd-flex-row" style="gap: 8px">
<view class="wd-flex wd-flex-row" style="gap: 16rpx">
<u--image
src="/static/images/owner/list.png"
src="/static/images/owner/edit.png"
width="20px"
height="20px"
mode="aspectFit"
></u--image>
<text class="wd-font-800">企业入驻</text>
</view>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<view
class="wd-flex wd-flex-row wd-items-center"
style="gap: 16rpx"
>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</button>
<view
class="section wd-flex wd-flex-row wd-justify-between"
@click="callPhone"
>
<view class="wd-flex wd-flex-row" style="gap: 8px">
<view class="wd-flex wd-flex-row" style="gap: 16rpx">
<u--image
src="/static/images/owner/phone.png"
width="20px"
@ -127,7 +134,10 @@
></u--image>
<text class="wd-font-800">内部专线</text>
</view>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<view
class="wd-flex wd-flex-row wd-items-center"
style="gap: 16rpx"
>
<text>点击呼叫</text>
<u-icon name="arrow-right"></u-icon>
</view>
@ -145,13 +155,20 @@ export default {
data() {
return {
user: {},
policyTotal: 0
policyTotal: 0,
share: {}
}
},
computed: {},
onShow() {
this.init()
},
onShareAppMessage() {
return this.share
},
onShareTimeline() {
return this.share
},
methods: {
btnPolicy() {
uni.navigateTo({
@ -184,14 +201,16 @@ export default {
})
},
invite() {
uni.navigateTo({
url: '/sub/owner/invite'
// url: '/sub/enterprise/edit'
})
this.share = {
title: '邀请企业入驻', //
path: `/pages/login?inviteId=${this.$store.getters.userId}`,
imageUrl:
'http://82.156.141.150:9001/api/v1/download-shared-object/aHR0cDovL2xvY2FsaG9zdDo5MDAwL2h1YW5iYW8vbWluaWFwcC9pbnZhdGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUQxODY1RVA2NEczMEdEUUhDVTglMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMDcyMDI0WiZYLUFtei1FeHBpcmVzPTQzMTk5JlgtQW16LVNlY3VyaXR5LVRva2VuPWV5SmhiR2NpT2lKSVV6VXhNaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpoWTJObGMzTkxaWGtpT2lKQlJERTROalZGVURZMFJ6TXdSMFJSU0VOVk9DSXNJbVY0Y0NJNk1UY3pPVGt3TmpJME55d2ljR0Z5Wlc1MElqb2lZV1J0YVc0aWZRLmp6djBhdEY5QVBYXzVjYWg4c18yeXhVV3oxek9BekFzSVdzemVrUmZwcXlHd0RPWkptazlUSGJRUnBDdVNmLVMyU0otWTI1cldUd2hpNUlrY0xBSThRJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZ2ZXJzaW9uSWQ9bnVsbCZYLUFtei1TaWduYXR1cmU9MjcxZTkzOTE1MDkwYzUzYmRjYTg0MjQ1MTJhYjk3ZWQxZWMyN2QzM2MwM2U3NGUwYmRhNTBmYjQyNWI0N2MyOQ'
}
},
callPhone() {
uni.makePhoneCall({
phoneNumber: ''
phoneNumber: '04167230123'
})
}
}
@ -215,7 +234,8 @@ export default {
border-radius: $cs-border-radius;
background: #fff;
margin-bottom: $cs-gap;
padding: 24px;
padding: 48rpx;
font-size: 28rpx;
}
.moblie {
color: $uni-text-color-grey;

7
pages/task.vue

@ -124,7 +124,12 @@
></cs-dict-tag>
</view>
</view>
<u-loadmore :status="load" marginTop="12" marginBottom="12" />
<u-loadmore
:status="load"
marginTop="12"
marginBottom="12"
v-if="load == 'nomore'"
/>
</scroll-view>
</view>
</cs-page>

45
static/echarts.esm.min.mjs

File diff suppressed because one or more lines are too long

BIN
static/favicon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 21 KiB

BIN
static/images/owner/edit.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/images/owner/list.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 989 B

BIN
static/images/owner/message.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 B

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
static/images/owner/phone.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
static/images/task/position.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 69 KiB

1
static/scss/global.scss

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

1
store/modules/user.js

@ -42,6 +42,7 @@ const user = {
},
SET_ROLES: (state, roles) => {
state.roles = roles
storage.remove(constant.roles)
storage.set(constant.roles, roles)
},
SET_DEPTID: (state, deptId) => {

44
sub/common/waiting.vue

@ -1,23 +1,14 @@
<template>
<view class="waiting" >
<view class="waiting">
<u--image
src="/static/favicon.png"
width="144px"
height="144px"
width="288rpx"
height="288rpx"
mode="aspectFit"
:fade="true"
duration="200"
></u--image>
<button
class="login"
@click="login"
:loading="loading"
loadingText="授权中..."
v-if="!isLogin"
>
授权登录
</button>
<text v-else class="title">登录成功</text>
<button class="login" @click="login">授权登录</button>
</view>
</template>
@ -28,9 +19,7 @@ import { qrLogin } from '@/api/login'
export default {
data() {
return {
scene: '',
loading: false,
isLogin: false
scene: ''
}
},
methods: {
@ -49,14 +38,19 @@ export default {
})
})
} else {
this.loading = true
uni.showLoading({
title: '登陆中。。。'
})
qrLogin({
code: this.scene,
openid: getAccessToken()
}).then(res => {
this.loading = false
this.isLogin = true
uni.exitMiniProgram()
setTimeout(() => {
uni.hideLoading()
uni.switchTab({
url: '/pages/index'
})
}, 3000)
})
}
}
@ -79,22 +73,22 @@ export default {
gap: 40px;
.login {
display: flex;
padding: var(--Number-12px, 12px) var(--Number-40px, 40px);
padding: var(--Number-12px, 24rpx) var(--Number-40px, 80rpx);
justify-content: center;
align-items: center;
border-radius: var(--Number-120px, 120px);
border-radius: var(--Number-120px, 240rpx);
background: var(--LightMode-Light-Light, #fff);
box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.03);
box-shadow: 0px 6rpx 8rpx 0px rgba(0, 0, 0, 0.03);
color: var(--LightMode-Success-Success, #17c653);
font-family: 'PingFang SC';
font-size: 16px;
font-size: 32rpx;
font-style: normal;
font-weight: 500;
line-height: normal;
}
.title {
font-family: 'PingFang SC';
font-size: 16px;
font-size: 32rpx;
font-style: normal;
font-weight: 500;
line-height: normal;

30
sub/enterprise/detail.vue

@ -50,12 +50,12 @@
color="#4B5675"
:value="detail.introduction"
></cs-text-more>
<view class="status">
<!-- <view class="status">
<cs-dict-tag
:dict="dictMap.enterprises_status"
:value="detail.enterprisesStatus"
></cs-dict-tag>
</view>
</view> -->
</view>
<view
@ -107,7 +107,7 @@
</view>
</view>
<cs-bottom-wrapper>
<cs-bottom-wrapper v-if="isView">
<view class="operation">
<view
class="btn green"
@ -127,6 +127,13 @@
</view>
</cs-bottom-wrapper>
<cs-bottom-wrapper v-else>
<view class="operation">
<view class="btn green" v-if="isChange">认领该企业</view>
<view class="btn red" v-else>删除该企业</view>
</view>
</cs-bottom-wrapper>
<u-modal
:show="showModel"
confirmText="返回"
@ -164,13 +171,22 @@ export default {
},
showModel: false,
dictMap: {},
total: 0
total: 0,
isView: true,
isChange: false
}
},
onLoad(res) {
if (res.id) {
this.detail.id = res.id
}
if (res.view) {
this.isView = false
}
if (res.change) {
this.isView = false
this.isChange = true
}
this.getDict()
this.init()
},
@ -332,6 +348,10 @@ export default {
align-items: center;
justify-content: center;
gap: 12px;
.red {
background: var(--LightMode-Danger-Danger-Light, #ffeef3);
color: var(--LightMode-Danger-Danger, #f8285a);
}
.btn {
flex: 1;
border-radius: 8px;
@ -349,4 +369,4 @@ export default {
color: #99a1b7;
}
}
</style>
</style>

109
sub/invite/addEnterprise.vue

@ -15,6 +15,8 @@
@blur="proofName"
:clearable="false"
:autoHeight="true"
:adjust-position="true"
cursorSpacing="32"
ref="nameRef"
></uni-easyinput>
<u-icon name="arrow-right"></u-icon>
@ -82,12 +84,12 @@
</view>
<view class="block">
<view style="">
<view class="label">
<text style="color: #f8285a; margin-right: 4px">*</text>
企业标签
</view>
<view class="value" @tap="goTags">
<view class="input-textarea" v-if="Object.keys(form.tags).length">
<view class="value" style="width: 50%" @tap="goTags">
<view class="input-value" v-if="Object.keys(form.tags).length">
{{
Object.values(form.tags)
.map(tag => tag.name)
@ -114,6 +116,8 @@
v-model="form.contactName"
:clearable="false"
:autoHeight="true"
:adjust-position="true"
cursorSpacing="32"
></uni-easyinput>
<u-icon name="arrow-right"></u-icon>
</view>
@ -134,6 +138,9 @@
@blur="proofphone"
:clearable="false"
:autoHeight="true"
:adjust-position="true"
cursorSpacing="32"
ref="phoneRef"
></uni-easyinput>
<u-icon name="arrow-right"></u-icon>
</view>
@ -170,8 +177,13 @@
>
<image
:src="p.photo[0].url"
style="width: 90px; height: 70px"
mode="widthFix"
style="
width: 180rpx;
height: 144rpx;
flex-shrink: 0;
border-radius: 8rpx;
"
mode="aspectFill"
></image>
<view class="info">
<view class="wd-flex" style="gap: 8px; align-items: center">
@ -187,7 +199,15 @@
</view>
<view class="wd-flex" style="gap: 8px; align-items: center">
<text class="label">资质编号</text>
<view class="wd-font-800">
<view
class="wd-font-800"
style="
white-space: nowrap;
text-overflow: ellipsis;
max-width: 8rem;
overflow: hidden;
"
>
{{ p.enterpriseAuth }}
</view>
</view>
@ -215,8 +235,10 @@ import { getDictBatchByType } from '@/api/system/dict.js'
import {
createEnterPrise,
vertifyName,
getEnterPrise
getEnterPrise,
updateEnterprise
} from '@/api/enterprise/index.js'
import { getProveList } from '@/api/enterprise/prove.js'
export default {
data() {
return {
@ -237,12 +259,12 @@ export default {
}
},
onLoad(res) {
this.getDict()
this.inviteId = res.inviteId
if (res.id) {
this.form.id = res.id
this.init()
}
this.getDict()
},
onShow() {
uni.$on('enterpriseIntroduce', data => {
@ -252,7 +274,11 @@ export default {
this.form.tags = data
})
uni.$on('prove', data => {
this.prove.push(data)
if (this.form.id) {
this.getProve()
} else {
this.prove.push(data)
}
})
},
methods: {
@ -264,7 +290,8 @@ export default {
vertifyName({
pageSize: -1,
pageNo: 1,
onlyEnterprisesName: v.detail.value
onlyEnterprisesName: v.detail.value,
excludeEnterpriseId: this.form.id
}).then(res => {
if (res.data.total > 0) {
uni.showToast({
@ -272,6 +299,7 @@ export default {
icon: 'none'
})
this.form.enterprisesName = ''
this.$refs.nameRef.onClear()
} else {
this.form.enterprisesName = v.detail.value
}
@ -287,13 +315,42 @@ export default {
icon: 'none'
})
this.form.environmentalContactPhone = ''
this.$refs.phoneRef.onClear()
} else {
this.form.environmentalContactPhone = v.detail.value
}
},
init() {
getEnterPrise(this.form.id).then(res => {
console.log(res)
async init() {
const enterprise = await getEnterPrise(this.form.id)
this.form = enterprise.data
this.form.photo = enterprise.data.files
const tag = {}
enterprise.data.tagObjList.forEach(t => {
tag[t.tagCode] = {
name: t.tagName,
value: t.id
}
})
tag.qy = {
name: this.$dict.echoDicValue(
this.dictMap.enterprises_area,
enterprise.data.region
),
value: enterprise.data.region
}
this.form.tags = tag
this.getProve()
},
async getProve() {
const load = this.$util.loading()
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')
}
})
},
/**
@ -301,7 +358,7 @@ export default {
*/
async getDict() {
const dict = await getDictBatchByType({
type: ['enterprise_qua'].join(',')
type: ['enterprise_qua', 'enterprises_area'].join(',')
})
this.dictMap = {
...dict.data
@ -369,7 +426,7 @@ export default {
},
addProve() {
uni.navigateTo({
url: '/sub/invite/prove'
url: `/sub/invite/prove?enterpriseId=${this.form.id}`
})
},
editProve(prove) {
@ -382,7 +439,6 @@ export default {
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
@ -393,10 +449,19 @@ export default {
files: i.photo.map(f => f.id)
}
})
const load = this.$util.loading('上传中...')
if (this.form.id) {
updateEnterprise(data).then(res => {
load.close()
uni.showToast({
icon: 'none',
title: '操作成功'
})
uni.navigateBack()
})
} else {
console.log(data)
createEnterPrise(data).then(res => {
load.close()
uni.showToast({
icon: 'none',
title: '操作成功'
@ -419,7 +484,10 @@ export default {
}
const msg = []
Object.keys(this.form).forEach(i => {
if (!this.form[i] && i != 'id') {
if (!Object.hasOwn(msgMap, i)) {
return false
}
if (!this.form[i]) {
msg.push(msgMap[i])
}
if (typeof this.form[i] == 'Object' && this.form[i].length == 0) {
@ -462,6 +530,11 @@ export default {
justify-content: space-between;
align-items: center;
gap: 12px;
.label {
font-family: UICTFontTextStyleBody;
height: 1.4rem;
min-height: 1.4rem;
}
.value {
flex: 1;
display: flex;

4
sub/invite/enterpriseTags.vue

@ -108,10 +108,10 @@ export default {
}
},
onLoad(res) {
this.getDict()
if (res.tags) {
this.form = JSON.parse(res.tags)
}
this.getDict()
},
methods: {
async getDict() {
@ -126,7 +126,7 @@ export default {
//
const children = t.children.map(child => ({
name: child.tagName,
value: child.id
value: child.id.toString()
}))
tagMap[t.tagCode] = children
})

59
sub/invite/index.vue

@ -1,5 +1,9 @@
<template>
<view class="view">
<scroll-view
class="view-container"
direction="vertical"
:show-scrollbar="false"
>
<view class="emty" v-if="list.length == 0">
<image
src="/static/images/emty.png"
@ -14,14 +18,14 @@
v-for="enterprise in list"
:key="enterprise.id"
>
<view class="info">
<view class="info" @tap="goDetail(enterprise.id)">
<view>
{{ enterprise.enterprisesName }}
</view>
<view class="wd-flex" style="gap: 8px">
<u-avatar
:src="enterprise.files[0].url"
shape="cricle"
shape="square"
style="width: 53px; height: 53px"
></u-avatar>
<view class="">
@ -68,7 +72,13 @@
</view>
</view>
<view class="opera">
<view class="box-btn red">变更管理人</view>
<button
class="box-btn red"
open-type="share"
@tap="shareEntprise(enterprise.id)"
>
变更管理人
</button>
<view class="box-btn green" @tap="editEnterprise(enterprise.id)">
编辑该企业
</view>
@ -87,7 +97,7 @@
<button class="btn green" @tap="addEnterprise">新增企业</button>
</view>
</cs-bottom-wrapper>
</view>
</scroll-view>
</template>
<script>
@ -98,7 +108,12 @@ export default {
return {
inviteId: '',
list: [],
dictMap: {}
dictMap: {},
share: {
title: '企业变更管理', //
path: `/sub/invite/index?inviteId=${this.$store.getters.userId}`,
imageUrl: ''
}
}
},
onLoad(res) {
@ -108,6 +123,9 @@ export default {
this.getDict()
this.getList()
},
onShareAppMessage() {
return this.share
},
methods: {
getList() {
uni.showLoading({
@ -143,21 +161,32 @@ export default {
uni.navigateTo({
url: `/sub/invite/addEnterprise?inviteId=${this.inviteId}&id=${id}`
})
},
goDetail(id) {
uni.navigateTo({
url: `/sub/enterprise/detail?id=${id}&view=true`
})
},
shareEntprise(id) {
this.share = {
title: '企业变更管理', //
path: `/sub/enterprise/detail?id=${id}&view=true&change=true`,
imageUrl: ''
}
}
}
}
</script>
<style lang="scss" scoped>
.view {
padding: 12px;
.view-container {
padding: 0 24rpx;
display: flex;
flex-flow: column nowrap;
gap: 12px;
overflow: hidden;
overflow-y: scroll;
max-height: 100vh;
padding-bottom: 12vh;
padding-bottom: 13vh;
&::-webkit-scrollbar {
display: none;
}
}
.emty {
border-radius: 8px;
@ -190,7 +219,6 @@ export default {
}
}
.enterprise {
padding: 12px;
border-radius: var(--Number-12px, 12px);
border: 1px solid var(--LightMode-Grey-Grey-200, #f1f1f4);
background: #fff;
@ -199,9 +227,9 @@ export default {
flex-direction: column;
align-items: flex-start;
gap: var(--Number-16px, 16px);
align-self: stretch;
position: relative;
overflow: hidden;
margin-top: 24rpx;
.audit {
position: absolute;
right: -19px;
@ -249,6 +277,7 @@ export default {
align-items: center;
gap: var(--Number-12px, 12px);
flex: 1 0 0;
font-size: 14px;
}
.red {
background: var(--LightMode-Orange-Orange-Light, #fff5ef);

60
sub/invite/prove.vue

@ -33,6 +33,8 @@
<input
class="input-value"
type="text"
:adjust-position="true"
cursorSpacing="32"
placeholder-class="txt"
placeholder="请输入资质编号"
v-model="prove.enterpriseAuth"
@ -124,9 +126,11 @@
<script>
import { uploadFile } from '@/api/system/file.js'
import { getDictBatchByType } from '@/api/system/dict.js'
import { updateProve, createProve } from '@/api/enterprise/prove.js'
export default {
data() {
return {
enterpriseId: '',
prove: {
id: '',
qualificationName: '',
@ -150,15 +154,17 @@ export default {
}
},
onLoad(res) {
this.getDict()
uni.setNavigationBarTitle({
title: res.prove ? '编辑资质' : '新增资质'
})
if (res.enterpriseId) {
this.enterpriseId = res.enterpriseId
}
if (res.prove) {
this.prove = JSON.parse(res.prove)
}
this.getDict()
},
onShow() {},
methods: {
/**
* 获取字典
@ -241,7 +247,6 @@ export default {
*/
confirmCalendar(e) {
this.prove[this.calendar.key] = e.fulldate
this.closeCalendar()
},
/**
@ -255,8 +260,48 @@ export default {
async submit() {
const valide = await this.verifyForm()
if (!valide) return
uni.$emit('prove', this.prove)
uni.navigateBack()
if (this.prove.id) {
uni.showLoading({
title: '更新中...'
})
const data = { ...this.prove }
data.files = this.prove.photo.map(p => p.id)
data.expiryDate = new Date(this.prove.expiryDate).getTime()
updateProve(data).then(res => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '操作成功'
})
uni.$emit('prove', this.prove)
uni.navigateBack()
})
} else if (this.enterpriseId) {
uni.showLoading({
title: '更新中...'
})
const data = { ...this.prove }
data.files = this.prove.photo.map(p => p.id)
data.expiryDate = new Date(this.prove.expiryDate).getTime()
data.enterpriseId = this.enterpriseId
createProve(data).then(res => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '操作成功'
})
uni.$emit('prove', this.prove)
uni.navigateBack()
})
} else {
uni.$emit('prove', this.prove)
uni.navigateBack()
}
},
async hanlderApi() {
if (this.prove.id) {
} else {
}
},
async verifyForm() {
const msgMap = {
@ -266,7 +311,10 @@ export default {
photo: '请上传资质照片'
}
const keys = Object.keys(this.prove).filter(i => {
if (!this.prove[i] && i != 'id') return i
if (!Object.hasOwn(msgMap, i)) {
return false
}
if (!this.prove[i] && i) return i
if (typeof this.prove[i] == 'object' && this.prove[i].length == 0)
return i
})

49
sub/owner/edit.vue

@ -1,7 +1,11 @@
<template>
<cs-page isCustom>
<template #header>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px" @click="goBack">
<view
class="wd-flex wd-flex-row wd-items-center"
style="gap: 8px"
@click="goBack"
>
<view class="icon-box" v-if="form.audit">
<u-icon name="arrow-left" size="12"></u-icon>
</view>
@ -10,7 +14,9 @@
</template>
<view class="container">
<!-- 我的头像 -->
<view class="section wd-flex wd-flex-row wd-justify-between wd-items-center">
<view
class="section wd-flex wd-flex-row wd-justify-between wd-items-center"
>
<text class="wd-font-800">我的头像</text>
<button
class="wd-flex wd-flex-row wd-items-center avatarBtn"
@ -24,7 +30,9 @@
</button>
</view>
<!-- 真实姓名 -->
<view class="section wd-flex wd-flex-row wd-justify-between wd-items-center">
<view
class="section wd-flex wd-flex-row wd-justify-between wd-items-center"
>
<text class="wd-font-800">姓名</text>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<input
@ -44,13 +52,22 @@
>
<text class="wd-font-800">性别</text>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<text v-if="form.sex">{{ $dict.echoDicValue(dictMap.system_user_sex, form.sex.toString()) }}</text>
<text v-if="form.sex">
{{
$dict.echoDicValue(
dictMap.system_user_sex,
form.sex.toString()
)
}}
</text>
<text class="placeholder" v-else>请选择性别</text>
<u-icon name="arrow-right" color="#99A1B7" size="16"></u-icon>
</view>
</view>
<!-- 手机号码 -->
<view class="section wd-flex wd-flex-row wd-justify-between wd-items-center">
<view
class="section wd-flex wd-flex-row wd-justify-between wd-items-center"
>
<text class="wd-font-800">手机号码</text>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<input
@ -64,17 +81,19 @@
</view>
</view>
<!-- 所属部门 -->
<view
<!-- <view
class="section wd-flex wd-flex-row wd-justify-between wd-items-center"
@click="showPicker('dept', 'deptId')"
>
<text class="wd-font-800">部门</text>
<view class="wd-flex wd-flex-row wd-items-center" style="gap: 8px">
<text v-if="form.deptId">{{ $dict.echoDicValue(dictMap.dept, form.deptId) }}</text>
<text v-if="form.deptId">
{{ $dict.echoDicValue(dictMap.dept, form.deptId) }}
</text>
<text class="placeholder" v-else>请选择部门</text>
<u-icon name="arrow-right" color="#99A1B7" size="16"></u-icon>
</view>
</view>
</view> -->
<view class="button-box">
<button class="button audit" v-if="form.audit == 1">
{{ $dict.echoDicValue(dictMap.user_audit_type, form.audit) }}
@ -143,7 +162,9 @@ export default {
})
},
async getDict() {
const dict = await getDictBatchByType({ type: ['system_user_sex', 'user_audit_type'].join(',') })
const dict = await getDictBatchByType({
type: ['system_user_sex', 'user_audit_type'].join(',')
})
const dept = await getDeptTree()
this.dictMap = {
@ -183,11 +204,11 @@ export default {
{
key: 'mobile',
message: '手机号码不能为空'
},
{
key: 'deptId',
message: '请选择所属部门'
}
// {
// key: 'deptId',
// message: ''
// }
]
for (const field of requiredFields) {
@ -251,7 +272,6 @@ export default {
.section {
border-radius: 16rpx;
background: #fff;
box-shadow: 0 0 4px 2px $cs-shadow-color;
margin-bottom: 32rpx;
padding: 24px;
height: 140rpx;
@ -270,7 +290,6 @@ export default {
height: 40px;
line-height: 40px;
box-sizing: border-box;
box-shadow: 0px 3px 4px 0px rgba(0, 0, 0, 0.1);
}
.submit {
color: #fff;

70
sub/task/enforce.vue

@ -11,17 +11,35 @@
</view>
<text style="color: #78829d">最多500字符</text>
</view>
<uni-easyinput
type="textarea"
v-model="form.advice"
placeholder="请输入..."
:maxlength="500"
:autoHeight="true"
:styles="{
backgroundColor: '#F9F9F9',
borderColor: '#F1F1F4'
}"
></uni-easyinput>
<view
class=""
style="
background-color: #f9f9f9;
border: 1px solid #f1f1f4;
border-radius: 24rpx;
padding: 16rpx;
"
>
<uni-easyinput
type="textarea"
v-model="form.advice"
placeholder="请输入..."
placeholderStyle="font-size:28rpx"
:maxlength="500"
:input-border="false"
:adjust-position="true"
:autoHeight="true"
cursorSpacing="32"
:styles="{
backgroundColor: 'transparent',
borderColor: 'none'
}"
></uni-easyinput>
<view style="color: #78829d; text-align: right">
{{ form.advice.length }}/500
</view>
</view>
<view
class="wd-flex"
style="justify-content: space-between; align-items: center"
@ -103,9 +121,9 @@ export default {
data() {
return {
form: {
state: undefined,
inspectionsId: undefined,
advice: undefined,
state: '',
inspectionsId: '',
advice: '',
photo: [],
date: ''
},
@ -215,27 +233,29 @@ export default {
<style lang="scss" scoped>
.view-container {
padding: 12px;
padding: 24rpx;
height: 100vh;
position: relative;
overflow-y: scroll;
padding-bottom: 13vh;
.box {
padding: 12px;
border: 1px solid #f9f9f9;
border-radius: 12px;
padding: 24rpx;
border: 2rpx solid #f9f9f9;
border-radius: 24rpx;
background-color: #fff;
margin-bottom: 12px;
margin-bottom: 24rpx;
}
.operation {
padding: 12px;
padding: 24rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
.btn {
flex: 1;
border-radius: 8px;
border-radius: 16rpx;
display: flex;
padding: 12px 0;
padding: 24rpx 0;
align-items: center;
justify-content: center;
}
@ -253,7 +273,7 @@ export default {
min-height: 400rpx;
}
::v-deep .u-upload__button {
border-radius: 8px !important;
border-radius: 16rpx !important;
border: 1px solid #f1f1f4;
background-color: #f9f9f9 !important;
}
@ -262,10 +282,10 @@ export default {
.u-upload__wrap__preview {
width: 192rpx;
height: 192rpx;
border-radius: 8px !important;
border-radius: 16rpx !important;
overflow: visible !important;
.u-upload__wrap__preview__image {
border-radius: 8px !important;
border-radius: 16rpx !important;
}
.u-upload__deletable {
border-radius: 100% !important;

45
sub/task/locate.vue

@ -155,7 +155,7 @@ export default {
enterpriseGps: '',
location: {},
distance: 10000,
radius: 100, //
radius: 1000, //
showTip: false,
list: [],
loading: false,
@ -170,7 +170,7 @@ export default {
time: 0
}
},
onLoad(res) {
async onLoad(res) {
if (res.scene) {
const data = decodeURIComponent(res.scene)
const obj = {}
@ -190,7 +190,7 @@ export default {
imageUrl:
'http://82.156.141.150:9001/api/v1/download-shared-object/aHR0cDovL2xvY2FsaG9zdDo5MDAwL2h1YW5iYW8vbWluaWFwcC9pbnZhdGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUQxODY1RVA2NEczMEdEUUhDVTglMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMDcyMDI0WiZYLUFtei1FeHBpcmVzPTQzMTk5JlgtQW16LVNlY3VyaXR5LVRva2VuPWV5SmhiR2NpT2lKSVV6VXhNaUlzSW5SNWNDSTZJa3BYVkNKOS5leUpoWTJObGMzTkxaWGtpT2lKQlJERTROalZGVURZMFJ6TXdSMFJSU0VOVk9DSXNJbVY0Y0NJNk1UY3pPVGt3TmpJME55d2ljR0Z5Wlc1MElqb2lZV1J0YVc0aWZRLmp6djBhdEY5QVBYXzVjYWg4c18yeXhVV3oxek9BekFzSVdzemVrUmZwcXlHd0RPWkptazlUSGJRUnBDdVNmLVMyU0otWTI1cldUd2hpNUlrY0xBSThRJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZ2ZXJzaW9uSWQ9bnVsbCZYLUFtei1TaWduYXR1cmU9MjcxZTkzOTE1MDkwYzUzYmRjYTg0MjQ1MTJhYjk3ZWQxZWMyN2QzM2MwM2U3NGUwYmRhNTBmYjQyNWI0N2MyOQ'
}
this.init()
await this.init()
},
onShareAppMessage() {
return this.share
@ -257,7 +257,6 @@ export default {
} else {
this.isLocate = false
}
console.log(this.isLocate, this.isLeadLocate)
this.list = res.data
},
useAuth() {
@ -295,12 +294,11 @@ export default {
uni.getLocation({
type: 'gcj02',
success: res => {
console.log('location', res)
console.log('location', res.latitude, res.longitude)
that.location = {
latitude: res.latitude,
longitude: res.longitude
}
that.getDistance()
},
fail: err => {
@ -322,17 +320,30 @@ export default {
}
})
},
getDistance() {
const that = this
this.$map.calculateDistance({
mode: 'straight',
form: this.location,
to: this.enterpriseGps,
success: res => {
that.distance = res.result.elements[0].distance
console.log('distance', that.distance)
}
})
async getDistance() {
if (this.enterpriseGps) {
uni.showLoading({
title: '正在计算位置...'
})
const that = this
this.$map.calculateDistance({
mode: 'straight',
form: this.location,
to: this.enterpriseGps,
success: res => {
that.distance = res.result.elements[0].distance
console.log('distance', that.distance)
uni.hideLoading()
},
fail: err => {
console.log('获取定位失败', err)
uni.hideLoading()
}
})
} else {
await this.init()
this.getDistance()
}
},
refresh() {
this.getDistance()

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

@ -535,7 +535,7 @@ export default {
},
_Focus(event) {
this.focusShow = true
// this.focusShow = true
this.$emit('focus', event)
},

62
utils/permission.js

@ -6,23 +6,23 @@ import store from '@/store'
* @returns {Boolean}
*/
export function checkPermi(value) {
if (value && value instanceof Array && value.length > 0) {
const permissions = store.getters && store.getters.permissions
const permissionDatas = value
const all_permission = "*:*:*"
if (value && value instanceof Array && value.length > 0) {
const permissions = store.getters && store.getters.permissions
const permissionDatas = value
const all_permission = "*:*:*"
const hasPermission = permissions.some(permission => {
return all_permission === permission || permissionDatas.includes(permission)
})
const hasPermission = permissions.some(permission => {
return all_permission === permission || permissionDatas.includes(permission)
})
if (!hasPermission) {
return false
}
return true
} else {
console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
return false
}
if (!hasPermission) {
return false
}
return true
} else {
console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`)
return false
}
}
/**
@ -31,21 +31,21 @@ export function checkPermi(value) {
* @returns {Boolean}
*/
export function checkRole(value) {
if (value && value instanceof Array && value.length > 0) {
const roles = store.getters && store.getters.roles
const permissionRoles = value
const super_admin = "admin"
if (value && value instanceof Array && value.length > 0) {
const roles = store.getters && store.getters.roles
console.log(roles);
const permissionRoles = value
const super_admin = "admin"
const hasRole = roles.some(role => {
return super_admin === role || permissionRoles.includes(role)
})
const hasRole = roles.some(role => {
return super_admin === role || permissionRoles.includes(role)
})
if (!hasRole) {
return false
}
return true
} else {
console.error(`need roles! Like checkRole="['admin','editor']"`)
return false
}
if (!hasRole) {
return false
}
return true
} else {
console.error(`need roles! Like checkRole="['admin','editor']"`)
return false
}
}

30
utils/request.js

@ -12,7 +12,7 @@ import {
let timeout = 10000
const baseUrl = config.baseUrl + config.baseApi;
let timer = null
const request = config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false
@ -47,20 +47,20 @@ const request = config => {
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
// showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
// if (res.confirm) {
// store.dispatch('LogOut').then(res => {
// uni.reLaunch({
// url: '/pages/login'
// })
// })
// }
// })
store.dispatch('LogOut').then(res => {
uni.reLaunch({
url: '/pages/login'
})
})
const curRoute = getCurrentPages()
if (curRoute[0].$page.fullPath == '/pages/login') {
return
} else {
timer && clearTimeout(timer)
timer = setTimeout(() => {
store.dispatch('LogOut').then(res => {
uni.reLaunch({
url: `/pages/login`
})
})
}, 500)
}
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)

24
utils/ruoyi.js

@ -92,16 +92,22 @@ export function viewPosition({
})
}
/**
* 打开地图获取位置
* @param {number} lat 经度
* @param {number} lng 纬度
* @param {string} name 地址名称
* 加载
*/
export function choosePosition({
lat,
lng,
name = ''
}) {
export function loading(title = '加载中') {
uni.showLoading({
mask: true,
title
})
function close() {
uni.hideLoading()
}
return {
close
}
}
Loading…
Cancel
Save