领导履职上传优化
This commit is contained in:
parent
598000adc7
commit
319419fbda
|
|
@ -106,20 +106,21 @@ const contentStyle = computed(() => {
|
|||
|
||||
// 模块列表配置
|
||||
const moduleList = ref([
|
||||
// 原有模块
|
||||
// 施工端和监督段模块汇总
|
||||
{ type: 'contract-review', label: '电子合同审核', sort: '' },
|
||||
{ type: 'contract-sign', label: '电子合同签署', sort: '' },
|
||||
{ type: 'wage-view', label: '工资查看', sort: '' },
|
||||
{ type: 'entry-management', label: '入场管理', sort: '' },
|
||||
{ type: 'contract', label: '电子合同', sort: '' },
|
||||
{ type: 'wage-card', label: '工资卡见证', sort: '' },
|
||||
{ type: 'worker-entry-review', label: '施工人员入场审核', sort: '' },
|
||||
// 注释掉的暂时为隐藏状态,不展示,客户暂时不使用
|
||||
// { type: 'wage-complaint', label: '欠薪维权申诉', sort: '' },
|
||||
// 新增模块
|
||||
// { type: 'entrust-manage', label: '委托人管理', sort: '' },
|
||||
// { type: 'subcontractor-entry', label: '分包商入场' },
|
||||
{ type: 'worker-entry-review', label: '施工人员入场审核', sort: '' },
|
||||
// { type: 'worker-like', label: '施工人员点赞', sort: '' },
|
||||
// 新增模块
|
||||
|
||||
// 自有人员模块汇总
|
||||
{ type: 'own-attendance-punch', label: '自有考勤打卡', sort: '' },
|
||||
{ type: 'own-attendance-statistics', label: '自有考勤统计', sort: '' },
|
||||
{ type: 'own-electronic-contract', label: '自有电子合同', sort: '' },
|
||||
|
|
@ -252,6 +253,11 @@ const checkFromRedirect = () => {
|
|||
|
||||
// 模块权限
|
||||
const showModule = (label) => {
|
||||
// 当权限为空数组时,显示自有人员模块(label以"自有"开头的)
|
||||
if (!memberStore.realNameUserPermissions || memberStore.realNameUserPermissions.length === 0) {
|
||||
return label.startsWith('自有')
|
||||
}
|
||||
|
||||
memberStore.realNameUserPermissions.forEach((item) => {
|
||||
moduleList.value.forEach((module) => {
|
||||
if (item.name === module.label) {
|
||||
|
|
|
|||
|
|
@ -320,6 +320,7 @@ import ReviewEmptyState from '@/components/ReviewEmptyState/index.vue'
|
|||
import CommonPicker from '@/components/CommonPicker/index.vue'
|
||||
import { getContentStyle } from '@/utils/safeArea'
|
||||
import { useMemberStore } from '@/stores'
|
||||
import { leaderHttp } from '@/utils/leaderHttp'
|
||||
import {
|
||||
getLeaveTypeListApi,
|
||||
getApproverListApi,
|
||||
|
|
@ -657,38 +658,28 @@ const handleApproverConfirm = (e) => {
|
|||
* @param {String} filePath - 文件路径
|
||||
* @returns {Promise<String>} 返回文件URL
|
||||
*/
|
||||
const uploadFilePromise = (filePath) => {
|
||||
const uploadFilePromise = async (filePath) => {
|
||||
console.log(filePath, 'filePath')
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
try {
|
||||
const res = await leaderHttp.uploadFile({
|
||||
url: '/common/upload',
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
formData: {
|
||||
user: 'test',
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
try {
|
||||
const data = JSON.parse(res.data)
|
||||
if (data.code === 200) {
|
||||
const fileName = data.fileName || data.data
|
||||
resolve(fileName)
|
||||
} else {
|
||||
reject(new Error(data.msg || '上传失败'))
|
||||
}
|
||||
} catch (err) {
|
||||
reject(new Error('解析响应失败'))
|
||||
}
|
||||
} else {
|
||||
reject(new Error('上传失败'))
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err)
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
// leaderHttp.uploadFile 已经返回了解析后的数据
|
||||
if (res && res.code === 200) {
|
||||
const fileName = res.fileName || res.data
|
||||
return fileName
|
||||
} else {
|
||||
throw new Error(res?.msg || '上传失败')
|
||||
}
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ import ChecklistItem from './components/ChecklistItem.vue'
|
|||
import { getContentStyle } from '@/utils/safeArea'
|
||||
import { submitSafetyPerformanceApi } from '@/services/leader/safety-performance.js'
|
||||
import { getManualPreviewDetailApi } from '@/services/leader/manual-preview'
|
||||
import { leaderHttp } from '@/utils/leaderHttp'
|
||||
|
||||
/**
|
||||
* 安全履职表单页面
|
||||
|
|
@ -384,9 +385,9 @@ const handleAttachmentUpload = async (e, index) => {
|
|||
* @param {String} filePath - 文件路径
|
||||
* @returns {Promise<String>} 返回文件URL
|
||||
*/
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
const uploadFilePromise = async (filePath) => {
|
||||
try {
|
||||
const res = await leaderHttp.uploadFile({
|
||||
url: '/common/upload',
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
|
|
@ -394,28 +395,19 @@ const uploadFilePromise = (filePath) => {
|
|||
formData: {
|
||||
user: 'test',
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
try {
|
||||
const data = JSON.parse(res.data)
|
||||
if (data.code === 200) {
|
||||
const fileName = data.fileName || data.data
|
||||
resolve(fileName)
|
||||
} else {
|
||||
reject(new Error(data.msg || '上传失败'))
|
||||
}
|
||||
} catch (err) {
|
||||
reject(new Error('解析响应失败'))
|
||||
}
|
||||
} else {
|
||||
reject(new Error('上传失败'))
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err)
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
console.log('上传文件成功:', res)
|
||||
// leaderHttp.uploadFile 已经返回了解析后的数据
|
||||
if (res && res.code === 200) {
|
||||
const fileName = res.fileName || res.data
|
||||
return fileName
|
||||
} else {
|
||||
throw new Error(res?.msg || '上传失败')
|
||||
}
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ import { onLoad } from '@dcloudio/uni-app'
|
|||
import NavBarModal from '@/components/NavBarModal/index.vue'
|
||||
import { getContentStyle } from '@/utils/safeArea'
|
||||
import { getManualPreviewDetailApi } from '@/services/leader/manual-preview'
|
||||
import { leaderHttp } from '@/utils/leaderHttp'
|
||||
|
||||
/**
|
||||
* 发现问题详情页面
|
||||
|
|
@ -220,9 +221,9 @@ const handlePhotoUpload = async (e, index) => {
|
|||
* @param {String} filePath - 文件路径
|
||||
* @returns {Promise<String>} 返回文件URL
|
||||
*/
|
||||
const uploadFilePromise = (filePath) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
const uploadFilePromise = async (filePath) => {
|
||||
try {
|
||||
const res = await leaderHttp.uploadFile({
|
||||
url: '/common/upload',
|
||||
filePath: filePath,
|
||||
name: 'file',
|
||||
|
|
@ -230,28 +231,18 @@ const uploadFilePromise = (filePath) => {
|
|||
formData: {
|
||||
user: 'test',
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
try {
|
||||
const data = JSON.parse(res.data)
|
||||
if (data.code === 200) {
|
||||
const fileName = data.fileName || data.data
|
||||
resolve(fileName)
|
||||
} else {
|
||||
reject(new Error(data.msg || '上传失败'))
|
||||
}
|
||||
} catch (err) {
|
||||
reject(new Error('解析响应失败'))
|
||||
}
|
||||
} else {
|
||||
reject(new Error('上传失败'))
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err)
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
// leaderHttp.uploadFile 已经返回了解析后的数据
|
||||
if (res && res.code === 200) {
|
||||
const fileName = res.fileName || res.data
|
||||
return fileName
|
||||
} else {
|
||||
throw new Error(res?.msg || '上传失败')
|
||||
}
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ const roleList = [
|
|||
{
|
||||
label: '自有人员',
|
||||
value: '自有人员',
|
||||
phone: '15116456419',
|
||||
phone: '13955858075',
|
||||
},
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ export default defineConfig({
|
|||
// 实名制系统代理规则
|
||||
'/bmw': {
|
||||
// target: 'http://192.168.0.234:1917/hnAma/', // 方
|
||||
target: 'http://192.168.0.14:1917/hnAma/', // 原测试环境
|
||||
// target: 'http://192.168.0.38:18080/bnscloud/realnameapp/', // 网关 郝
|
||||
// target: 'http://192.168.0.14:1917/hnAma/', // 原测试环境
|
||||
target: 'http://192.168.0.38:18080/bnscloud/realnameapp/', // 网关 郝
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => {
|
||||
return path.replace(/\/bmw/, '')
|
||||
|
|
|
|||
Loading…
Reference in New Issue