页面修改

This commit is contained in:
zmj 2023-11-09 17:48:23 +08:00
parent b25199e9f0
commit 83ef4f1e40
10 changed files with 751 additions and 17 deletions

View File

@ -20,3 +20,8 @@ export function getUserInfo() {
export function setUserInfo(params: any) {
return request.post({ url: '/auth.admin/editSelf', params })
}
// 用户信息
export function getUserInfoByID(params:any) {
return request.get({ url: '/auth.menu/model_menu_lists' , params })
}

View File

@ -1,18 +1,32 @@
<template>
<div class="menu-li">
<div class="flex items-center px-2 pointer">
菜单信息1
</div>
<div class="flex items-center px-2 pointer">
菜单信息2
</div>
<div class="flex items-center px-2 pointer">
菜单信息3
<div class="menu-li">
<div class="flex items-center px-2 pointer" @click="menuClick(item.id)" v-for="(item,index) in menuList" v-show="item.paths !='workbench'">
{{ item.name }}
</div>
</div>
</template>
<script setup>
import {getUserInfoByID,getUserInfo} from "@/api/user"
import useUserStore from '@/stores/modules/user'
const userStore = useUserStore()
const menuList=reactive([])
getUserInfo().then(res=>{
res.menu.forEach(item => {
menuList.push(item)
});
})
const menuClick=(id)=>{
userStore.getUserInfoByID(id)
// console.log(id)
}
</script>

View File

@ -50,7 +50,6 @@
const handleChange = (fullPath: any) => {
const tabItem = tabsStore.tasMap[fullPath];
router.push(getRouteParams(tabItem));
console.log(tabsStore.tasMap[fullPath]);
};
const handleChanges = (fullPath: any) => {
const tabItem = tabsStore.tasMap[fullPath];

View File

@ -1,5 +1,8 @@
<template>
<template v-if="!route.meta?.hidden">
<!-- {{ routePath }} -->
<app-link v-if="!hasShowChild" :to="`${routePath}?${queryStr}`">
<el-menu-item :index="routePath">
<icon

View File

@ -1,6 +1,6 @@
<template>
<div
class="menu flex-1 min-h-0"
class="flex-1 min-h-0 menu"
:class="themeClass"
:style="isCollapsed ? '' : `--aside-width: ${width}px`"
>
@ -57,6 +57,7 @@ const props = defineProps({
defineEmits(['select'])
const route = useRoute()
const activeMenu = computed<string>(() => route.meta?.activeMenu || route.path)
const themeClass = computed(() => `theme-${props.theme}`)
</script>

View File

@ -3,7 +3,7 @@
*/
import NProgress from 'nprogress'
import router, { findFirstValidRoute } from './router'
import router, { findFirstValidRoute,filterAsyncRoutes } from './router'
import 'nprogress/nprogress.css'
import { isExternal } from './utils/validate'
import useUserStore from './stores/modules/user'
@ -12,6 +12,8 @@ import { PageEnum } from './enums/pageEnum'
import useTabsStore from './stores/modules/multipleTabs'
import { clearAuthInfo } from './utils/auth'
import config from './config'
import { getUserInfo, login, logout,getUserInfoByID } from '@/api/user'
// NProgress配置
NProgress.configure({ showSpinner: false })
@ -41,7 +43,15 @@ router.beforeEach(async (to, from, next) => {
} else {
try {
await userStore.getUserInfo()
const routes = userStore.routes
let data=await getUserInfo()
// console.log(filterAsyncRoutes(data.menu))
// console.log(userStore.routes)
const routes = filterAsyncRoutes(data.menu)
// 找到第一个有效路由
const routeName = findFirstValidRoute(routes)
// 没有有效路由跳转到403页面

View File

@ -1,7 +1,7 @@
import { defineStore } from 'pinia'
import cache from '@/utils/cache'
import type { RouteRecordRaw } from 'vue-router'
import { getUserInfo, login, logout } from '@/api/user'
import { getUserInfo, login, logout,getUserInfoByID } from '@/api/user'
import router, { filterAsyncRoutes } from '@/router'
import { TOKEN_KEY } from '@/enums/cacheEnums'
import { PageEnum } from '@/enums/pageEnum'
@ -68,13 +68,26 @@ const useUserStore = defineStore({
.then((data) => {
this.userInfo = data.user
this.perms = data.permissions
this.routes = filterAsyncRoutes(data.menu)
this.routes = filterAsyncRoutes(data.menu.splice(0,1))
resolve(data)
})
.catch((error) => {
reject(error)
})
})
},
getUserInfoByID(id:number) {
return new Promise((resolve, reject) => {
getUserInfoByID({id})
.then((data) => {
data.forEach(item=>{ item.paths=item.model_name+'/'+item.paths })
this.routes = filterAsyncRoutes(data)
resolve(data)
})
.catch((error) => {
reject(error)
})
})
}
}
})

View File

@ -0,0 +1,368 @@
<template>
<div>
<el-row :gutter="10">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
<el-card>
<div class="tit">客户基本资料</div>
<el-row>
<el-col :span="8">
<el-form-item label="客户姓名" prop="field101">
<el-input v-model="formData.field101" placeholder="请输入本文行单客户姓名" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="客户属性" prop="field103">
<el-select v-model="formData.field103" placeholder="请选择客户属性" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in field103Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="上级公司" prop="field104">
<el-input v-model="formData.field104" placeholder="请输入上级公司" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="电话" prop="field105">
<el-input v-model="formData.field105" placeholder="请输入电话" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="信用度" prop="field106">
<el-radio-group v-model="formData.field106" size="medium">
<el-radio v-for="(item, index) in field106Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="客户地址" prop="field107">
<el-select v-model="formData.field107" placeholder="请选择客户地址" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in field107Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="field108">
<el-input v-model="formData.field108" type="textarea" placeholder="请输入备注"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<div class="tit">主要负责人</div>
<el-row>
<el-col :span="8">
<el-form-item label="姓名" prop="field109">
<el-input v-model="formData.field109" placeholder="请输入姓名" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="职位" prop="field110">
<el-input v-model="formData.field110" placeholder="请输入职位" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="手机" prop="field111">
<el-input v-model="formData.field111" placeholder="请输入手机" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮箱" prop="field112">
<el-input v-model="formData.field112" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="电话" prop="field113">
<el-input v-model="formData.field113" placeholder="请输入电话" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="field114">
<el-input v-model="formData.field114" placeholder="请输入备注" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<div class="tit">其他联系人</div>
<el-row>
<el-col :span="6">
<el-form-item label="姓名" prop="field116">
<el-input v-model="formData.field116" placeholder="请输入姓名" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="职位" prop="field117">
<el-input v-model="formData.field117" placeholder="请输入职位" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="手机" prop="field118">
<el-input v-model="formData.field118" placeholder="请输入手机" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="电话" prop="field119">
<el-input v-model="formData.field119" placeholder="请输入电话" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="邮箱" prop="field120">
<el-input v-model="formData.field120" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="9">
<el-form-item label="备注" prop="field121">
<el-input v-model="formData.field121" placeholder="请输入备注" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="附件" prop="field122">
<el-upload ref="field122" :file-list="field122fileList" :action="field122Action"
:before-upload="field122BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-card>
<el-card>
<div class="tit">开票信息</div>
<el-row>
<el-col :span="8">
<el-form-item label="开票公司" prop="field123">
<el-input v-model="formData.field123" placeholder="请输入开票公司" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="纳税人识别" prop="field124">
<el-input v-model="formData.field124" placeholder="请输入纳税人识别" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址" prop="field125">
<el-input v-model="formData.field125" placeholder="请输入开户地址" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="电话" prop="field126">
<el-input v-model="formData.field126" placeholder="请输入电话" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开户地址" prop="field127">
<el-input v-model="formData.field127" placeholder="请输入开户地址" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="银行账号" prop="field128">
<el-input v-model="formData.field128" placeholder="请输入银行账号" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-card>
</el-form>
</el-row>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field103: undefined,
field104: undefined,
field105: undefined,
field106: undefined,
field107: undefined,
field108: undefined,
field109: undefined,
field110: undefined,
field111: undefined,
field112: undefined,
field113: undefined,
field114: undefined,
field116: undefined,
field117: undefined,
field118: undefined,
field119: undefined,
field120: undefined,
field121: undefined,
field122: null,
field123: undefined,
field124: undefined,
field125: undefined,
field126: undefined,
field127: undefined,
field128: undefined,
},
rules: {
field101: [{
required: true,
message: '请输入本文行单客户姓名',
trigger: 'blur'
}],
field103: [],
field104: [],
field105: [{
required: true,
message: '请输入电话',
trigger: 'blur'
}],
field106: [],
field107: [],
field108: [],
field109: [{
required: true,
message: '请输入姓名',
trigger: 'blur'
}],
field110: [],
field111: [],
field112: [],
field113: [],
field114: [],
field116: [],
field117: [],
field118: [],
field119: [],
field120: [],
field121: [],
field123: [],
field124: [],
field125: [],
field126: [],
field127: [{
required: true,
message: '请输入开户地址',
trigger: 'blur'
}],
field128: [],
},
field122Action: 'https://jsonplaceholder.typicode.com/posts/',
field122fileList: [],
field103Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
field106Options: [{
"label": "良好",
"value": 1
}, {
"label": "一般",
"value": 2
}, {
"label": "较差",
"value": ""
}],
field107Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field122BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}
.tit {
font-size: 17px;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,323 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px" label-position="left">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="合同名称" prop="field101">
<el-input v-model="formData.field101" placeholder="点击选择合同" :disabled='true' clearable
suffix-icon='el-icon-search' :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同编号" prop="field102">
<el-input v-model="formData.field102" placeholder="点击选择合同编号" :disabled='true' clearable
suffix-icon='el-icon-search' :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目名称" prop="field103">
<el-input v-model="formData.field103" placeholder="点击选择项目名称" :disabled='true' clearable
suffix-icon='el-icon-search' :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="field104">
<el-input v-model="formData.field104" placeholder="系统自动填写" :disabled='true' clearable
suffix-icon='el-icon-search' :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同类型" prop="field107">
<el-select v-model="formData.field107" placeholder="系统自动填写" :disabled='true' clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in field107Options" :key="index" :label="item.label"
:value="item.value" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="合同计价方式" prop="field105">
<el-input v-model="formData.field105" placeholder="系统自动获取" :disabled='true' clearable
suffix-icon='el-icon-search' :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="签约日期" prop="field106">
<el-date-picker v-model="formData.field106" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
:style="{ width: '100%' }" placeholder="请输入签约日期" clearable
:disabled='true'></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务负责人" prop="field108">
<el-input v-model="formData.field108" placeholder="点击选择" :disabled='true' clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="治商单位名称" prop="field109">
<el-input v-model="formData.field109" placeholder="请输入治商单位名称" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="治商编号" prop="field110">
<el-input v-model="formData.field110" placeholder="系统自动获取" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="治商金额" prop="field111">
<el-input v-model="formData.field111" placeholder="请输入治商金额" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="治商类别" prop="field135">
<el-radio-group v-model="formData.field135" size="medium">
<el-radio v-for="(item, index) in field135Options" :key="index" :label="item.value"
:disabled="item.disabled">{{ item.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成本金额(人工)" prop="field136">
<el-input v-model="formData.field136" placeholder="请输入成本金额(人工)" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成本金额(材料)" prop="field137">
<el-input v-model="formData.field137" placeholder="请输入成本金额(材料)" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="治商质保金额" prop="field138">
<el-input v-model="formData.field138" placeholder="请输入治商质保金额" clearable
:style="{ width: '100%' }">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="治商质保到期时间" prop="field139" label-width="130px">
<el-input v-model="formData.field139" placeholder="请输入治商质保到期时间" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="利润" prop="field140">
<el-input v-model="formData.field140" placeholder="请输入利润" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="利润率" prop="field141">
<el-input v-model="formData.field141" placeholder="请输入利润率" :disabled='true' clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="治商内容" prop="field142">
<el-input v-model="formData.field142" type="textarea" placeholder="请输入治商内容"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="具体说明" prop="field143">
<el-input v-model="formData.field143" type="textarea" placeholder="请输入具体说明"
:autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="签证报价表" prop="field144">
<el-upload ref="field144" :file-list="field144fileList" :action="field144Action"
:before-upload="field144BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="治商依据" prop="field145">
<el-upload ref="field145" :file-list="field145fileList" :action="field145Action"
:before-upload="field145BeforeUpload">
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
components: {},
props: [],
data() {
return {
formData: {
field101: undefined,
field102: undefined,
field103: undefined,
field104: undefined,
field107: undefined,
field105: undefined,
field106: undefined,
field108: undefined,
field109: undefined,
field110: undefined,
field111: undefined,
field135: 1,
field136: undefined,
field137: undefined,
field138: undefined,
field139: undefined,
field140: undefined,
field141: undefined,
field142: undefined,
field143: undefined,
field144: null,
field145: null,
},
rules: {
field101: [{
required: true,
message: '点击选择合同',
trigger: 'blur'
}],
field102: [{
required: true,
message: '点击选择合同编号',
trigger: 'blur'
}],
field103: [{
required: true,
message: '点击选择项目名称',
trigger: 'blur'
}],
field104: [{
required: true,
message: '系统自动填写',
trigger: 'blur'
}],
field107: [{
required: true,
message: '系统自动填写',
trigger: 'change'
}],
field105: [{
required: true,
message: '系统自动获取',
trigger: 'blur'
}],
field106: [{
required: true,
message: '请输入签约日期',
trigger: 'change'
}],
field108: [{
required: true,
message: '点击选择',
trigger: 'blur'
}],
field109: [{
required: true,
message: '请输入治商单位名称',
trigger: 'blur'
}],
field110: [],
field111: [{
required: true,
message: '请输入治商金额',
trigger: 'blur'
}],
field135: [],
field136: [],
field137: [],
field138: [],
field139: [],
field140: [],
field141: [],
field142: [],
field143: [],
},
field144Action: 'https://jsonplaceholder.typicode.com/posts/',
field144fileList: [],
field145Action: 'https://jsonplaceholder.typicode.com/posts/',
field145fileList: [],
field107Options: [{
"label": "选项一",
"value": 1
}, {
"label": "选项二",
"value": 2
}],
field108Options: [{
"label": "总价合同",
"value": 1
}, {
"label": "清单计价",
"value": 2
}],
field135Options: [{
"label": "设计变更",
"value": 1
}, {
"label": "现场变更",
"value": 2
}, {
"label": "补充协议",
"value": 3
}],
}
},
computed: {},
watch: {},
created() { },
mounted() { },
methods: {
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
})
},
resetForm() {
this.$refs['elForm'].resetFields()
},
field144BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
field145BeforeUpload(file) {
let isRightSize = file.size / 1024 / 1024 < 2
if (!isRightSize) {
this.$message.error('文件大小超过 2MB')
}
return isRightSize
},
}
}
</script>
<style>
.el-upload__tip {
line-height: 1.2;
}</style>

View File

@ -1,8 +1,6 @@
<template>
<div>
<el-card>
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px" label-position="left">
<el-row :gutter="10">