Compare commits

...

6 Commits

Author SHA1 Message Date
1d5af53e1a 权限跳转修改+预算填报修改 2026-03-10 08:53:03 +08:00
d379d7bb5b 预算填报页面添加字段 2026-03-09 15:35:58 +08:00
418c29095b 页面权限 2026-03-09 15:02:09 +08:00
ef230b3836 登录后跳转到打标页面 2026-03-06 09:28:06 +08:00
9f2f7036fd 增加退出登录 2026-03-05 16:09:07 +08:00
2f3586e2f2 预算&指标填报 2026-03-05 11:12:34 +08:00
77 changed files with 1108 additions and 534 deletions

View File

@@ -9,7 +9,12 @@ VUE_APP_TITLE = 洛玻集团驾驶舱
# VUE_APP_BASE_API = 'http://172.16.32.95:7070' # VUE_APP_BASE_API = 'http://172.16.32.95:7070'
# VUE_APP_BASE_API = 'http://172.16.33.83:7070' # VUE_APP_BASE_API = 'http://172.16.33.83:7070'
VUE_APP_BASE_API = 'http://192.168.0.35:7070' # 杨姗姗
VUE_APP_BASE_API = 'http://172.16.20.218:7070'
# 小田
# VUE_APP_BASE_API = 'http://172.16.19.232:7070'
# 测试
# VUE_APP_BASE_API = 'http://192.168.0.35:8080'
# 路由懒加载 # 路由懒加载

1
.gitignore vendored
View File

@@ -20,3 +20,4 @@ selenium-debug.log
*.local *.local
package-lock.json package-lock.json
sync_luobo.bat

View File

@@ -117,6 +117,22 @@ export function updateDataBackUpDetail(data) {
}); });
} }
export function copyLastMonthData(data) {
return request({
url: "/lb/index-target-month/copyLastMonth",
method: "post",
data: data,
});
}
export function copyLastYearData(data) {
return request({
url: "/lb/index-target-year/copyLastYear",
method: "post",
data: data,
});
}
export function getSalesRevenueGroupData(data) { export function getSalesRevenueGroupData(data) {
return request({ return request({
@@ -254,6 +270,13 @@ export function getCalendar(data) {
data: data, data: data,
}); });
} }
export function getCalendarYear(data) {
return request({
url: "lb/index-target-year/getCalendarYear",
method: "post",
data: data,
});
}
export function getLevelStruc(data) { export function getLevelStruc(data) {
return request({ return request({
url: "/lb/index-target-month/getLevelStruc", url: "/lb/index-target-month/getLevelStruc",

View File

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<g id="组_1" data-name="组 1" transform="translate(-970 -281.875)">
<g id="编辑备份" transform="translate(970 281.5)">
<rect id="矩形" width="16" height="16" transform="translate(0 0.375)" opacity="0"/>
<path id="形状" d="M12.281,5.406a.512.512,0,0,0,1.023,0V2.559A2.559,2.559,0,0,0,10.746,0H2.559A2.559,2.559,0,0,0,0,2.559v8.188A2.559,2.559,0,0,0,2.559,13.3H5.415a.512.512,0,1,0,0-1.023H2.559a1.535,1.535,0,0,1-1.535-1.535V2.559A1.535,1.535,0,0,1,2.559,1.023h8.188a1.535,1.535,0,0,1,1.535,1.535Z" transform="translate(1.535 1.535)" fill="#3d7aff"/>
</g>
<g id="移出" transform="translate(978 290.608)">
<path id="形状结合" d="M0,2.821a.746.746,0,0,0,.529.73l.118.011,3.68-.011L3.459,4.4a.656.656,0,0,0,.816,1.02l.1-.083L6.146,3.6a1.107,1.107,0,0,0,.321-.634l.012-.2,0-.026a.61.61,0,0,0-.015-.125,1.106,1.106,0,0,0-.189-.455l-.107-.129L4.39.2a.656.656,0,0,0-1.022.814L4.23,2.108.654,2.1l-.125.011A.88.88,0,0,0,0,2.821Z" transform="translate(0 0)" fill="#3d7aff"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,14 +1,14 @@
<template> <template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <div v-if="collapse" key="collapse" class="sidebar-logo-link">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link> </div>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <div v-else key="expand" class="sidebar-logo-link">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link> </div>
</transition> </transition>
</div> </div>
</template> </template>

View File

@@ -8,6 +8,38 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false })
/**
* 从菜单树中查找 jumpFlag===1 的默认跳转路径
* 若打标在父节点则取其下第一个可见叶子路径;若在叶子则直接返回该路径
*/
function findDefaultPathFromMenus(menus) {
if (!Array.isArray(menus) || menus.length === 0) return null
function dfs(list, parentPath = '') {
for (const item of list) {
if (item.visible === false) continue
const rawPath = item.path || ''
const currentPath = rawPath.startsWith('/')
? rawPath
: `${parentPath}/${rawPath}`.replace(/\/+/g, '/')
if (item.jumpFlag === 1) {
if (item.children && item.children.length > 0) {
const childPath = dfs(item.children, currentPath)
return childPath != null ? childPath : currentPath
}
return currentPath
}
if (item.children && item.children.length > 0) {
const found = dfs(item.children, currentPath)
if (found != null) return found
}
}
return null
}
return dfs(menus)
}
// 增加三方登陆 update by 芋艿 // 增加三方登陆 update by 芋艿
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee'] const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
@@ -17,13 +49,15 @@ router.beforeEach((to, from, next) => {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title) to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/ /* has token*/
if (to.path === '/login') { if (to.path === '/login') {
next({ path: '/' }) next({ path: store.getters.defaultPath || '/' })
NProgress.done() NProgress.done()
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
isRelogin.show = true isRelogin.show = true
// 获取字典数据 add by 芋艿 // 获取字典数据 add by 芋艿
store.dispatch('dict/loadDictDatas') store.dispatch('dict/loadDictDatas')
// 获取部门权限
store.dispatch('GetLevel')
// 判断当前用户是否已拉取完 user_info 信息 // 判断当前用户是否已拉取完 user_info 信息
store.dispatch('GetInfo').then(userInfo => { store.dispatch('GetInfo').then(userInfo => {
isRelogin.show = false isRelogin.show = false
@@ -31,7 +65,14 @@ router.beforeEach((to, from, next) => {
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => { store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
// 根据 roles 权限生成可访问的路由表 // 根据 roles 权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/'
store.dispatch('SetDefaultPath', defaultPath)
// 仅当目标为根路径 '/' 时跳默认页;否则保持当前路径(含刷新场景),避免刷新被误判为“未匹配”而跳到默认页
if (to.path === '/') {
next({ path: defaultPath, replace: true })
} else {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成当前页刷新时保留 to 的路径
}
}) })
}).catch(err => { }).catch(err => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
@@ -39,10 +80,15 @@ router.beforeEach((to, from, next) => {
next({ path: '/' }) next({ path: '/' })
}) })
}) })
} else {
if (to.path === '/') {
const defaultPath = store.getters.defaultPath || '/'
next({ path: defaultPath, replace: true })
} else { } else {
next() next()
} }
} }
}
} else { } else {
// 没有token // 没有token
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {

View File

@@ -64,13 +64,13 @@ export const constantRoutes = [
component: (resolve) => require(["@/views/error/401"], resolve), component: (resolve) => require(["@/views/error/401"], resolve),
hidden: true, hidden: true,
}, },
{ // {
path: "/", // path: "/",
// component: () => import('@/views/choicePart'), // // component: () => import('@/views/choicePart'),
component: () => import("@/views/home"), // component: () => import("@/views/home"),
hidden: true, // hidden: true,
meta: { requireToken: true }, // meta: { requireToken: true },
}, // },
// { // {
// path: "/operatingRevenue", // path: "/operatingRevenue",
// // component: () => import('@/views/choicePart'), // // component: () => import('@/views/choicePart'),

View File

@@ -17,7 +17,10 @@ const getters = {
topbarRouters:state => state.permission.topbarRouters, topbarRouters:state => state.permission.topbarRouters,
defaultRoutes:state => state.permission.defaultRoutes, defaultRoutes:state => state.permission.defaultRoutes,
sidebarRouters:state => state.permission.sidebarRouters, sidebarRouters:state => state.permission.sidebarRouters,
defaultPath: state => state.permission.defaultPath,
// 数据字典 // 数据字典
dict_datas: state => state.dict.dictDatas dict_datas: state => state.dict.dictDatas,
// 部门层级
levelList: state => state.user.levelList
} }
export default getters export default getters

View File

@@ -11,8 +11,12 @@ const permission = {
addRoutes: [], addRoutes: [],
sidebarRouters: [], // 左侧边菜单的路由,被 Sidebar/index.vue 使用 sidebarRouters: [], // 左侧边菜单的路由,被 Sidebar/index.vue 使用
topbarRouters: [], // 顶部菜单的路由,被 TopNav/index.vue 使用 topbarRouters: [], // 顶部菜单的路由,被 TopNav/index.vue 使用
defaultPath: '/', // 登录后默认跳转路径(由菜单 jumpFlag===1 决定)
}, },
mutations: { mutations: {
SET_DEFAULT_PATH: (state, path) => {
state.defaultPath = path || '/'
},
SET_ROUTES: (state, routes) => { SET_ROUTES: (state, routes) => {
state.addRoutes = routes state.addRoutes = routes
state.routes = constantRoutes.concat(routes) state.routes = constantRoutes.concat(routes)
@@ -48,6 +52,9 @@ const permission = {
commit('SET_TOPBAR_ROUTES', sidebarRoutes) commit('SET_TOPBAR_ROUTES', sidebarRoutes)
resolve(rewriteRoutes) resolve(rewriteRoutes)
}) })
},
SetDefaultPath({commit}, path) {
commit('SET_DEFAULT_PATH', path)
} }
} }
} }

View File

@@ -1,5 +1,6 @@
import {login, logout, getInfo, socialLogin, smsLogin} from '@/api/login' import {login, logout, getInfo, socialLogin, smsLogin} from '@/api/login'
import {setToken, removeToken} from '@/utils/auth' import {setToken, removeToken} from '@/utils/auth'
import {getLevelStruc} from '@/api/cockpit'
const user = { const user = {
state: { state: {
@@ -7,7 +8,8 @@ const user = {
name: '', name: '',
avatar: '', avatar: '',
roles: [], roles: [],
permissions: [] permissions: [],
levelList:[]
}, },
mutations: { mutations: {
@@ -28,6 +30,9 @@ const user = {
}, },
SET_PERMISSIONS: (state, permissions) => { SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions state.permissions = permissions
},
SET_LEVEL_LIST: (state, levelList) => {
state.levelList = levelList
} }
}, },
@@ -122,7 +127,21 @@ const user = {
}) })
}) })
}, },
// 获取层级
GetLevel({ commit, state }) {
return new Promise((resolve, reject) => {
getLevelStruc().then(res => {
// 如果未加载到数据,则直接返回
if (!res || !res.data) {
return;
}
commit('SET_LEVEL_LIST', res.data)
resolve()
})
}).catch(error => {
reject(error)
})
},
// 退出系统 // 退出系统
LogOut({ commit, state }) { LogOut({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View File

@@ -81,6 +81,9 @@ export const DICT_TYPE = {
PROMOTION_COUPON_TAKE_TYPE: 'promotion_coupon_take_type', // 优惠劵的领取方式 PROMOTION_COUPON_TAKE_TYPE: 'promotion_coupon_take_type', // 优惠劵的领取方式
PROMOTION_ACTIVITY_STATUS: 'promotion_activity_status', // 优惠活动的状态 PROMOTION_ACTIVITY_STATUS: 'promotion_activity_status', // 优惠活动的状态
PROMOTION_CONDITION_TYPE: 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_CONDITION_TYPE: 'promotion_condition_type', // 营销的条件类型枚举
// ========== 模块 ==========
LB_DW: 'lb_dw'
} }
/** /**
@@ -139,3 +142,15 @@ export function getDictDataLabel(dictType, value) {
const dict = getDictData(dictType, value); const dict = getDictData(dictType, value);
return dict ? dict.label : ''; return dict ? dict.label : '';
} }
// table中用来过滤字典
export function publicFormatter(dictTable) {
const dictDatas = getDictDatas(dictTable)
return function (val) {
const arr = {}
dictDatas.map((item) => {
arr[item.value] = item.label
})
return arr?.[val]
}
}

View File

@@ -16,8 +16,8 @@
gap: 12px; gap: 12px;
grid-template-columns:416px 1192px; grid-template-columns:416px 1192px;
"> ">
<indicatorCalendar :calendarList="calendarList" /> <indicatorCalendar :timeType="timeType" :calendarObj='calendarObj'/>
<indicatorDetails :timeType="timeType" /> <indicatorDetails :timeType="timeType" @updateLeft='getData' @updateLevel='getLevel'/>
</div> </div>
</div> </div>
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px"> <!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
@@ -53,8 +53,9 @@ import { mapState } from "vuex";
// import operatingLineChart from "../operatingComponents/operatingLineChart"; // import operatingLineChart from "../operatingComponents/operatingLineChart";
// import operatingLineChartCumulative from "../operatingComponents/operatingLineChartCumulative.vue"; // import operatingLineChartCumulative from "../operatingComponents/operatingLineChartCumulative.vue";
import { getSalesRevenueGroupData, getCalendar } from '@/api/cockpit' import { getSalesRevenueGroupData } from '@/api/cockpit'
import moment from "moment"; import moment from "moment";
import {getCalendar, getCalendarYear} from '@/api/cockpit';
export default { export default {
name: "DayReport", name: "DayReport",
components: { components: {
@@ -78,7 +79,8 @@ export default {
selectDate:{}, selectDate:{},
monthData: {}, monthData: {},
ytdData: {}, ytdData: {},
calendarList:{}, calendarObj:{},
levelId: null
}; };
}, },
@@ -144,37 +146,29 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.getData() // this.getData()
}, },
methods: { methods: {
// sortChange(value) {
// this.sort = value
// this.getData()
// },
getData() { getData() {
getCalendar().then((res) => { if(this.timeType == 'month'){
console.log(res, 'res'); getCalendar({levelId: this.levelId}).then((res) => {
this.calendarList = res.data this.calendarObj = res.data
// this.monthData = res.data.month
// this.ytdData = res.data.ytd
}) })
// getSalesRevenueGroupData({ }else{
// startTime: this.dateData.startTime, getCalendarYear({levelId: this.levelId}).then((res) => {
// endTime: this.dateData.endTime, this.calendarObj = res.data
// sort: this.sort, })
// index: undefined, }
// factory: undefined },
// // timeDim: obj.mode // 层级变动
// }).then((res) => { getLevel(id) {
// console.log(res); this.levelId = id
// this.monthData= res.data.month this.getData()
// this.ytdData = res.data.ytd
// })
}, },
handleTimeChange(obj) { handleTimeChange(obj) {
console.log(obj, 'obj'); console.log(obj, 'obj');
this.timeType = obj this.timeType = obj
// this.getData() this.getData()
}, },
handleClickOutside() { handleClickOutside() {
this.$store.dispatch("app/closeSideBar", { withoutAnimation: false }); this.$store.dispatch("app/closeSideBar", { withoutAnimation: false });

View File

@@ -8,6 +8,15 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'">
<svg-icon style="color: #0B58FF;" icon-class="logout" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item>
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" class="screen-btn" @click="changeHomeSider"> <el-button type="text" class="screen-btn" @click="changeHomeSider">
<svg-icon style="color: #0B58FF;" v-if="openSider" icon-class="closeSider" /> <svg-icon style="color: #0B58FF;" v-if="openSider" icon-class="closeSider" />
<svg-icon style="color: #0B58FF;" v-else icon-class="openSider" /> <svg-icon style="color: #0B58FF;" v-else icon-class="openSider" />
@@ -36,6 +45,7 @@
<script> <script>
import moment from 'moment' import moment from 'moment'
import {getPath} from "@/utils/ruoyi";
export default { export default {
name: 'Header', name: 'Header',
props: { props: {
@@ -139,6 +149,19 @@ export default {
const timeRange = this.calculateTimeRange(); const timeRange = this.calculateTimeRange();
this.$emit('timeRangeChange', timeRange); this.$emit('timeRangeChange', timeRange);
console.log('触发时间范围变化:', timeRange); console.log('触发时间范围变化:', timeRange);
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}).catch(() => {});
},
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
} }
}, },
watch: { watch: {
@@ -325,10 +348,11 @@ export default {
.right-content { .right-content {
display: flex; display: flex;
margin-bottom: 60px; margin-top: 12px;
margin-right: 16px; margin-right: 16px;
justify-content: flex-end; justify-content: flex-end;
gap: 10px; gap: 21px;
height: 35px;
} }
.current-time { .current-time {
@@ -345,6 +369,15 @@ export default {
color: #00fff0; color: #00fff0;
font-size: 26px; font-size: 26px;
padding: 0; padding: 0;
margin: 0;
}
.logout-btn {
width: 30px;
height: 30px;
font-size: 30px;
padding: 0;
margin-top: 2px;
} }
} }

View File

@@ -11,10 +11,10 @@
style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;"> style="display: flex; gap: 16px; flex-wrap: wrap; align-content: flex-start; row-gap: 8px;">
<!-- 循环生成12个月通过判断当前月份索引添加current类 --> <!-- 循环生成12个月通过判断当前月份索引添加current类 -->
<div class="monthItem" :class="{ <div class="monthItem" :class="{
'has-data': month.haveData, 'has-data': calendar.haveData,
'current': index === currentMonthIndex // 本月匹配current样式 'current': calendar.isActive // 本月匹配current样式
}" v-for="(month, index) in monthList" :key="index"> }" v-for="(calendar, index) in calendarList" :key="index">
{{ month.name }} {{ calendar.name }}
</div> </div>
</div> </div>
</div> </div>
@@ -25,49 +25,35 @@
<script> <script>
import Container from './container.vue' import Container from './container.vue'
// import * as echarts from 'echarts'
// import topItem from './operating-item.vue'
export default { export default {
name: 'ProductionStatus', name: 'ProductionStatus',
components: { Container }, components: { Container },
// mixins: [resize], // mixins: [resize],
props: { props: {
calendarList: { // 接收父组件传递的年月状态对象 timeType: {
type: String,
default: 'month', // 默认月份维度
},
calendarObj: { // 接收父组件传递的年月状态对象
type: Object, // 注意父组件传递的是对象不是数组修正props类型 type: Object, // 注意父组件传递的是对象不是数组修正props类型
default: () => ({}) // 默认空对象,避免报错 default: () => ({}) // 默认空对象,避免报错
}, },
}, },
data() { data() {
return { return {
chart: null, calendarList:[],// 日历列表
// 初始化12个月的列表可根据实际需求修改haveData默认值
monthList: [
{ name: '1月', haveData: false, isActive: false },
{ name: '2月', haveData: false, isActive: false },
{ name: '3月', haveData: false, isActive: false },
{ name: '4月', haveData: false, isActive: false },
{ name: '5月', haveData: false, isActive: false },
{ name: '6月', haveData: false, isActive: false },
{ name: '7月', haveData: false, isActive: false },
{ name: '8月', haveData: false, isActive: false },
{ name: '9月', haveData: false, isActive: false },
{ name: '10月', haveData: false, isActive: false },
{ name: '11月', haveData: false, isActive: false },
{ name: '12月', haveData: false, isActive: false }
],
}
},
computed: {
// 计算属性获取当前月份对应的索引0-11对应1月-12月
currentMonthIndex() {
// new Date().getMonth() 返回 0(1月) - 11(12月)正好匹配monthList索引
return new Date().getMonth();
} }
}, },
watch: { watch: {
// 监听calendarList变化实时更新monthList的haveData状态 // 监听calendarList变化实时更新monthList的haveData状态
calendarList: { // timeType: {
// immediate: true, // 组件挂载时立即执行一次
// deep: true, // 深度监听对象内部属性变化
// handler() {
// this.updateMonthHaveData();
// }
// },
calendarObj:{
immediate: true, // 组件挂载时立即执行一次 immediate: true, // 组件挂载时立即执行一次
deep: true, // 深度监听对象内部属性变化 deep: true, // 深度监听对象内部属性变化
handler(newVal) { handler(newVal) {
@@ -75,28 +61,24 @@ export default {
} }
} }
}, },
mounted() { mounted() {},
// 初始化图表(若需展示图表,需在模板中添加对应 DOM
// this.$nextTick(() => this.updateChart())
},
methods: { methods: {
// 根据calendarList更新monthList的haveData状态 // 根据月或者年维度,获取不同的接口,拿到数据,更新左侧日历框
updateMonthHaveData(calendarObj) { updateMonthHaveData(calendarObj) {
if (!calendarObj || typeof calendarObj !== 'object') return; if(this.timeType == 'month'){
const keys = Object.keys(calendarObj);
// 遍历12个月匹配对应年月 this.calendarList = []
this.monthList.forEach((month, index) => { for(let i = 0; i < keys.length; i++) {
// 获取月份数字(索引+1补两位如1→0110→10 this.calendarList.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()})
const monthNum = (index + 1).toString().padStart(2, '0'); }
// 拼接成calendarList中的键格式如2025-01 }else{
const yearMonthKey = `2025-${monthNum}`; // 若年份不固定可改为props传递年份 const keys = Object.keys(calendarObj);
this.calendarList = []
// 判断calendarObj中该键对应的值1→true0→false无该键则保持默认false for(let i = 0; i < keys.length; i++) {
if (calendarObj.hasOwnProperty(yearMonthKey)) { this.calendarList.push({name:keys[i]+'年',haveData:calendarObj[keys[i]],isActive:keys[i]==new Date().getFullYear()})
month.haveData = calendarObj[yearMonthKey] === 1; }
}
} }
});
},
} }
} }
</script> </script>
@@ -119,7 +101,6 @@ export default {
line-height: 42px; line-height: 42px;
text-align: center; text-align: center;
font-style: normal; font-style: normal;
cursor: pointer; // 鼠标悬浮手型
transition: all 0.2s ease; // 过渡效果,样式切换更平滑 transition: all 0.2s ease; // 过渡效果,样式切换更平滑
border: 2px solid transparent; // 透明边框,避免选中时布局偏移 border: 2px solid transparent; // 透明边框,避免选中时布局偏移
margin: 0; // 清除默认外边距,进一步缩小缝隙 margin: 0; // 清除默认外边距,进一步缩小缝隙
@@ -140,5 +121,3 @@ export default {
border: 2px solid #0B58FF !important; border: 2px solid #0B58FF !important;
} }
</style> </style>
<style></style>

View File

@@ -22,7 +22,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button> <el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
<!-- <el-button type="primary" plain size="medium">导入</el-button> --> <el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@@ -53,12 +53,12 @@ font-style: normal;">指标详情</div>
<div <div
style="width: 58px;height: 16px;font-family: PingFangSC, PingFang SC;font-weight: 400;font-size: 14px;color: rgba(0,0,0,0.85);line-height: 16px;text-align: right;font-style: normal;"> style="width: 58px;height: 16px;font-family: PingFangSC, PingFang SC;font-weight: 400;font-size: 14px;color: rgba(0,0,0,0.85);line-height: 16px;text-align: right;font-style: normal;">
快捷操作</div> 快捷操作</div>
<!-- <el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="onSubmit">复制上月</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium" <el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="onSubmit">全部上调5%</el-button> @click="copyLastMonth">复制上月/</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium" <el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="onSubmit">全部调5%</el-button> --> @click="allUp">全部调5%</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="allDown">全部下调5%</el-button>
<el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium" <el-button style="height: 32px;line-height: 10px;" type="primary" plain size="medium"
@click="handleClear">清空配置</el-button> @click="handleClear">清空配置</el-button>
<el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary" <el-button style="background-color: #0B58FF;height: 32px;line-height: 10px;" type="primary"
@@ -69,23 +69,23 @@ font-style: normal;">指标详情</div>
<!-- 表格组件添加key属性强制刷新绑定所有必要属性 --> <!-- 表格组件添加key属性强制刷新绑定所有必要属性 -->
<base-table style="height: 700px;" :maxHeight=" '700' " @emitFun="inputChange" class="right-aside" <base-table style="height: 700px;" :maxHeight=" '700' " @emitFun="inputChange" class="right-aside"
:table-props="tableProps" :page="form.pageNo" :limit="form.pageSize" :table-data="tableData" ref="baseTable" :table-props="tableProps" :page="form.pageNo" :limit="form.pageSize" :table-data="tableData" ref="baseTable" id='calendarTable'
:key="`base-table-${isDetail}-${timeType}`"></base-table> :key="tableKey"></base-table>
</div> </div>
</div> </div>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" action="#" :disabled="upload.isUploading"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-change="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip"> <div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span> <span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" </div>
@click="importTemplate">下载模板</el-link> <div class="el-upload__tip" slot="tip">
<el-radio-group v-model="upload.timeDim">
<el-radio :label="2">月预算</el-radio>
<el-radio :label="3">年预算</el-radio>
</el-radio-group>
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@@ -99,9 +99,11 @@ font-style: normal;">指标详情</div>
<script> <script>
import Container from './container.vue' import Container from './container.vue'
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData, getDictListData } from '@/api/cockpit' import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData,copyLastMonthData, copyLastYearData} from '@/api/cockpit'
import inputArea from './inputArea.vue' // 导入输入组件 import inputArea from './inputArea.vue' // 导入输入组件
import { getBaseHeader } from "@/utils/request"; import { publicFormatter } from '@/utils/dict';
import {getAccessToken, getTenantId} from '@/utils/auth'
import axios from 'axios';
export default { export default {
name: 'ProductionStatus', name: 'ProductionStatus',
components: { components: {
@@ -118,34 +120,33 @@ export default {
data() { data() {
return { return {
form: { form: {
levelId: 1, levelId: undefined,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
date: undefined, // 统一存储日期(月份/年份) date: undefined, // 统一存储日期(月份/年份)
startTime: undefined, // 起始时间戳 startTime: undefined, // 起始时间戳
endTime: undefined // 结束时间戳 endTime: undefined // 结束时间戳
}, },
dictData: [],
upload: { upload: {
// 是否显示弹出层(用户导入) // 是否显示弹出层
open: false, open: false,
// 弹出层标题(用户导入) // 弹出层标题
title: "", title: "预算填报导入",
// 是否禁用上传 // 是否禁用上传
isUploading: false, isUploading: false,
// 是否更新已经存在的用户数据 fileList:[],
updateSupport: 0, currentFile:null,
// 设置上传的请求头部 timeDim: 2
headers: getBaseHeader(),
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/admin-api/system/user/import'
}, },
getDataList: null, // 动态切换的查询接口 getDataList: null, // 动态切换的查询接口
updateData: null, // 动态切换的更新接口 updateData: null, // 动态切换的更新接口
isDetail: false, // 编辑状态标识false=只读true=编辑 isDetail: false, // 编辑状态标识false=只读true=编辑
tableData: [], // 表格数据 tableData: [], // 表格数据
levelLList: [], // 所属层级下拉数据 levelLList: [], // 所属层级下拉数据
tableProps: [] // 表格列配置 tableProps: [], // 表格列配置
tableKey:0,// 强制表格更新
allUpBtn: false, // 全部上调按钮状态
allDownBtn: false // 全部下调按钮状态
} }
}, },
watch: { watch: {
@@ -182,7 +183,6 @@ export default {
this.initDefaultDate(); this.initDefaultDate();
// 2. 计算对应时间戳 // 2. 计算对应时间戳
this.calculateTimeStamp(); this.calculateTimeStamp();
this.getDictData()
// 3. 先初始化表格配置(优先于数据请求,避免表格空配置渲染) // 3. 先初始化表格配置(优先于数据请求,避免表格空配置渲染)
this.initTableProps(this.isDetail); this.initTableProps(this.isDetail);
// 4. 等待配置就绪后,再请求数据,避免异步冲突 // 4. 等待配置就绪后,再请求数据,避免异步冲突
@@ -191,14 +191,175 @@ export default {
}); });
}, },
methods: { methods: {
getDictData() { // 清空配置
getDictListData({ pageNo: 1, pageSize: 100, dictType: 'lb_dw' }).then((res) => { handleClear() {
this.dictData = res.data.list // 清空target
this.tableData.forEach(item => {
item.target = null;
}) })
this.tableKey++;
this.allDownBtn = false;
this.allUpBtn = false;
},
//复制上月/上年数据(调用接口不同)
copyLastMonth() {
if(this.timeType === 'month') {
this.$modal.confirm('是否确认复制上月数据?').then(() => {
this.copyLastMonthDataPage()
}).then(() => {
this.$modal.msgSuccess("复制成功");
}).catch(() => { });
}else{
this.$modal.confirm('是否确认复制上年数据?').then(() => {
this.copyLastYearDataPage()
}).then(() => {
this.$modal.msgSuccess("复制成功");
}).catch(() => { });
}
},
copyLastMonthDataPage() {
copyLastMonthData({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item
};
});
this.tableKey++;
this.allDownBtn = false;
this.allUpBtn = false;
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
},
copyLastYearDataPage() {
copyLastYearData({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item
};
});
this.tableKey++;
this.allDownBtn = false;
this.allUpBtn = false;
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
},
//全部上调5%
allUp() {
if(this.allUpBtn || this.allDownBtn) {
this.$modal.msgWarning("数据已调整,请先保存数据");
return
}
for(let i = 0; i < this.tableData.length; i++) {
this.tableData[i].target = (this.tableData[i].target * 1.05).toFixed(2)
}
// 强制表格组件刷新
this.tableKey++;
this.allUpBtn = true;
},
// 全部下调5%
allDown() {
if(this.allUpBtn || this.allDownBtn) {
this.$modal.msgWarning("数据已调整,请先保存数据");
return;
}
for(let i = 0; i < this.tableData.length; i++) {
this.tableData[i].target = (this.tableData[i].target * 0.95).toFixed(2)
}
// 强制表格组件刷新
this.tableKey++;
this.allDownBtn = true;
},
// 查询按钮
onSubmit() {
// 清空原有表格数据,重新请求
this.tableData = [];
this.$nextTick(() => {
this.getDataPage();
});
},
// 切换到编辑模式
handleEdit() {
this.isDetail = true;
// 先更新表格配置,再强制表格刷新
this.initTableProps(this.isDetail);
this.tableKey++;
},
// 保存数据使用动态切换的updateData接口
handleSave() {
this.$modal.confirm('是否确认保存数据?').then(() => {
return this.updateData(this.tableData)
}).then(() => {
this.isDetail = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getDataPage();
});
this.$modal.msgSuccess("保存成功");
this.$emit('updateLeft')
}).catch(() => { });
},
// 请求下拉数据和表格数据使用动态切换的getDataList接口
getData() {
if (!this.getDataList) {
console.warn('当前时间维度异常,无法获取数据');
return;
}
// 1. 请求所属层级下拉数据
getLevelStruc().then((res) => {
this.levelLList = res.data || [];
this.form.levelId = this.levelLList[0].id;
this.$emit('updateLevel', this.levelLList[0].id)
this.getDataPage()
}).catch(err => {
console.error('获取所属层级失败:', err);
this.levelLList = [];
});
this.$emit('updateLeft')
},
getDataPage() {
// 2. 请求表格分页数据(使用动态接口)
this.getDataList({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
console.log('表格数据:', res);
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item
};
});
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
}, },
// 表格单元格数据变更回调 // 表格单元格数据变更回调
inputChange(val) { inputChange(val) {
console.log('修改的数据:', val);
// 安全修改:判断索引是否存在,避免数组越界 // 安全修改:判断索引是否存在,避免数组越界
if (this.tableData[val._pageIndex - 1]) { if (this.tableData[val._pageIndex - 1]) {
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]; this.tableData[val._pageIndex - 1][val.prop] = val[val.prop];
@@ -206,19 +367,29 @@ export default {
this.tableData[val._pageIndex - 1].status = 1; this.tableData[val._pageIndex - 1].status = 1;
} }
}, },
// 取消编辑,恢复只读模式
handleCancel() {
this.isDetail = false;
this.allUpBtn = false;
this.allDownBtn = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
});
},
// 初始化表格列配置核心精准控制inputArea挂载 // 初始化表格列配置核心精准控制inputArea挂载
initTableProps(isEdit) { initTableProps(isEdit) {
console.log('当前编辑状态:', isEdit, '当前时间维度:', this.timeType); console.log('当前编辑状态:', isEdit, '当前时间维度:', this.timeType);
// 基础表格列配置(只读模式使用) // 基础表格列配置(只读模式使用)
const baseTableProps = [ const baseTableProps = [
{ prop: 'type', label: '指标类型', align: 'center' }, { prop: 'type', label: '指标类型', align: 'center' },
{ prop: 'name', label: '指标名称', align: 'center' }, { prop: 'name', label: '指标名称', align: 'center' },
{ prop: 'unit', label: '单位', align: 'center' }, { prop: 'unit', label: '单位', align: 'center', filter: publicFormatter('lb_dw') },
{ prop: 'target', label: '预估值', align: 'center' }, { prop: 'target', label: '预估值', align: 'center' },
]; ];
if (isEdit) { if (isEdit) {
// 编辑模式仅给「预估值」列添加inputArea精准挂载避免无效配置 // 编辑模式仅给「预估值」列添加inputArea精准挂载避免无效配置
this.tableProps = baseTableProps.map(item => { this.tableProps = baseTableProps.map(item => {
@@ -232,75 +403,16 @@ export default {
}); });
} else { } else {
// 只读模式:深拷贝基础配置,避免引用污染 // 只读模式:深拷贝基础配置,避免引用污染
this.tableProps = JSON.parse(JSON.stringify(baseTableProps)); // this.tableProps = JSON.parse(JSON.stringify(baseTableProps));
this.tableProps = baseTableProps;
} }
console.log('表格配置:', this.tableProps); console.log('表格配置:', this.tableProps);
}, },
// 切换到编辑模式
handleEdit() {
this.isDetail = true;
// 先更新表格配置,再强制表格刷新(双重保障)
this.initTableProps(this.isDetail);
this.$nextTick(() => {
if (this.$refs.baseTable) {
this.$refs.baseTable.$forceUpdate(); // 强制表格组件刷新
}
});
},
// 保存数据使用动态切换的updateData接口
handleSave() {
// if (!this.updateData) {
// this.$modal.msgWarning('当前时间维度异常,无法保存');
// return;
// }
this.$modal.confirm('是否确认保存数据?').then(() => {
return this.updateData(this.tableData)
}).then(() => {
this.isDetail = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
});
this.$modal.msgSuccess("保存成功");
}).catch(() => { });
},
// 取消编辑,恢复只读模式
handleCancel() {
this.isDetail = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
});
console.log('已取消编辑,恢复原始数据');
},
// 清空配置
handleClear() {
this.isDetail = false;
// 重置表格配置
this.initTableProps(this.isDetail);
// 清空并重新请求数据,恢复原始状态
this.$nextTick(() => {
this.tableData = [];
this.getData();
});
},
// 初始化默认日期根据timeType // 初始化默认日期根据timeType
initDefaultDate() { initDefaultDate() {
const currentDate = new Date(); const currentDate = new Date();
this.form.date = currentDate; this.form.date = currentDate;
}, },
// 计算时间戳根据timeType切换月/年) // 计算时间戳根据timeType切换月/年)
calculateTimeStamp(selectDate) { calculateTimeStamp(selectDate) {
let targetDate = selectDate || this.form.date; let targetDate = selectDate || this.form.date;
@@ -330,7 +442,6 @@ export default {
this.form.endTime = endDatePrecise.getTime(); this.form.endTime = endDatePrecise.getTime();
} }
}, },
// 日期选择器变更事件(统一处理月/年变更) // 日期选择器变更事件(统一处理月/年变更)
handleDateChange(val) { handleDateChange(val) {
if (!val) { if (!val) {
@@ -342,62 +453,61 @@ export default {
// 计算选中日期对应的时间戳 // 计算选中日期对应的时间戳
this.calculateTimeStamp(val); this.calculateTimeStamp(val);
}, },
getUnitLabel(unitCode) { // 导入
// 若字典为空或无匹配编码,返回原编码或空字符串 importExcel() {
if (!this.dictData || this.dictData.length === 0) { this.upload.open = true
return unitCode || '';
}
// 查找匹配的字典项
const matchItem = this.dictData.find(item => item.value == unitCode);
// 返回匹配的label无匹配则返回原unit编码
return matchItem ? matchItem.label : (unitCode || '');
}, },
// 请求下拉数据和表格数据使用动态切换的getDataList接口 // 文件上传中处理
getData() { handleFileUploadProgress(file, fileList) {
if (!this.getDataList) { console.log('文件上传中:',file, fileList)
console.warn('当前时间维度异常,无法获取数据'); this.upload.isUploading = true;
return; this.upload.fileList = fileList;
} this.upload.currentFile = file.raw;
// 1. 请求所属层级下拉数据
getLevelStruc().then((res) => {
console.log('所属层级数据:', res);
this.levelLList = res.data || [];
}).catch(err => {
console.error('获取所属层级失败:', err);
this.levelLList = [];
});
// 2. 请求表格分页数据(使用动态接口)
this.getDataList({
levelId: this.form.levelId,
startTime: this.form.startTime,
endTime: this.form.endTime,
pageSize: this.form.pageSize,
pageNo: this.form.pageNo
}).then((res) => {
console.log('表格数据:', res);
this.tableData = res.data.map(item => {
// 新增unitLabel字段存储匹配后的显示名称
return {
...item,
unitLabel: this.getUnitLabel(item.unit)
};
});
}).catch(err => {
console.error('获取表格数据失败:', err);
this.tableData = [];
});
}, },
handleFileSuccess() {},
// 查询按钮点击事件(可根据需求扩展逻辑) importTemplate() {},
onSubmit() { // 提交上传文件
// 清空原有表格数据,重新请求 async submitFileForm() {
this.tableData = []; try {
this.$nextTick(() => { if (!this.upload.currentFile) {
this.getData(); return this.$message.error('请先选择要上传的文件!')
});
} }
const formData = new FormData()
formData.append('file', this.upload.currentFile) // 文件字段
formData.append('timeDim', this.upload.timeDim) // 年月维度字段
formData.append('reportDate', this.form.endTime) // 时间维度字段
formData.append('levelId', this.form.levelId) // 层级维度字段
const response = await axios({
url: process.env.VUE_APP_BASE_API + '/admin-api/lb/index-target-month/import',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': "Bearer " + getAccessToken(),
'tenant-id': getTenantId(),
},
timeout: 30000
})
// 4. 处理响应结果
if (response.data.code === 0) {
this.$message.success('文件上传成功!')
// 重置表单
this.upload.fileList = []
this.upload.timeDim = 2
this.upload.currentFile = null
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles();
this.getData()
} else {
this.$message.error(`上传失败:${response.data.msg || '未知错误'}`)
}
} catch (error) {
// 5. 异常处理
console.error('文件上传出错:', error)
this.$message.error('上传失败!')
}
},
} }
} }
</script> </script>

View File

@@ -7,6 +7,15 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'">
<svg-icon style="color: #0B58FF;" icon-class="logout" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item>
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn"> <el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" /> <svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
</el-button> </el-button>
@@ -35,7 +44,7 @@
<script> <script>
import moment from 'moment'; // 引入moment import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi";
export default { export default {
name: 'Header', name: 'Header',
props: { props: {
@@ -75,6 +84,18 @@ export default {
handleReturn() { handleReturn() {
this.$router.go(-1); this.$router.go(-1);
}, },
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}).catch(() => {});
},
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
},
exportPDF() { exportPDF() {
this.$emit('exportPDF'); this.$emit('exportPDF');
}, },
@@ -300,6 +321,7 @@ export default {
margin-top: 12px; margin-top: 12px;
margin-right: 10px; margin-right: 10px;
gap: 21px; gap: 21px;
height: 35px;
} }
// .current-time { // .current-time {
@@ -326,6 +348,7 @@ export default {
color: #00fff0; color: #00fff0;
font-size: 26px; font-size: 26px;
padding: 0; padding: 0;
margin: 0;
} }
.return-btn { .return-btn {
@@ -336,6 +359,13 @@ export default {
font-size: 26px; font-size: 26px;
padding: 0; padding: 0;
} }
.logout-btn {
width: 28px;
height: 28px;
font-size: 28px;
padding: 0;
}
} }
/* 自定义下拉框样式(替换原有日期选择器样式) */ /* 自定义下拉框样式(替换原有日期选择器样式) */

View File

@@ -1,8 +1,8 @@
<template> <template>
<div class="changeBase"> <div class="changeBase">
<div class="base-item" @click="handleClick(index)" v-for="(item, index) in buttonList" :key="item" <div class="base-item" @click="handleClick(item.id)" v-for="(item) in buttonLevelList" :key="item.id"
:style="{ zIndex: activeButton === index ? 10 : 1 }"> :style="{ zIndex: activeButton === item.id ? 10 : 1 }">
<img :src="activeButton === index ? imgMap.bgBase[item] : imgMap.base[item]" :alt="`${item}基地`" :title="item"> <img :src="activeButton === item.id ? item.bgImg : item.img" :alt="`${item.name}基地`" :title="item.name">
</div> </div>
</div> </div>
</template> </template>
@@ -33,80 +33,69 @@ export default {
props: { props: {
factory: { factory: {
type: [String, Number], type: [String, Number],
default: 5, // 新映射中“宜兴”对应序号7 default: undefined,
validator: (val) => [5, 2, 7, 3, 8, 9, 10].includes(val) // 校验序号范围匹配新的baseNameToIndexMap validator: (val) => [5, 2, 7, 3, 8, 9, 10, 6].includes(val) // 校验序号范围匹配新的baseNameToIndexMap
}
},
// 计算属性响应式levelList变化时会自动更新
computed: {
buttonLevelList() {
// 核心:通过$store.getters获取定义的getter
let arr = []
this.$store.getters.levelList.forEach(item => {
this.buttonList.forEach(item2 => {
if (item2.id === item.id) {
arr.push(item2)
}
})
})
this.activeButton = arr[0].id
return arr
} }
}, },
data() { data() {
return { return {
activeButton: 5, // 初始化默认选中索引2对应buttonList中的“宜兴” activeButton: undefined,
buttonList: ['合肥', '桐城', '宜兴', '自贡', '漳州', '洛阳', '秦皇岛', '宿迁'], // 匹配截图顺序 buttonList:[
imgMap: { {id: 5, name: '合肥', img: baseHefei, bgImg: bgBaseHefei},
base: { {id: 2, name: '桐城', img: baseTongcheng, bgImg: bgBaseTongcheng},
合肥: baseHefei, {id: 7, name: '宜兴', img: baseYixing, bgImg: bgBaseYixing},
桐城: baseTongcheng, {id: 3, name: '自贡', img: baseZigong, bgImg: bgBaseZigong},
宜兴: baseYixing, {id: 8, name: '漳州', img: baseZhangzhou, bgImg: bgBaseZhangzhou},
自贡: baseZigong, {id: 9, name: '洛阳', img: baseLuoyang, bgImg: bgBaseLuoyang},
漳州: baseZhangzhou, {id: 10, name: '秦皇岛', img: baseQinhuangdao, bgImg: bgBaseQinhuangdao},
洛阳: baseLuoyang, {id: 6, name: '宿迁', img: baseSuqian, bgImg: bgBaseSuqian}
秦皇岛: baseQinhuangdao, ],
宿迁: baseSuqian
},
bgBase: {
合肥: bgBaseHefei,
桐城: bgBaseTongcheng,
宜兴: bgBaseYixing,
自贡: bgBaseZigong,
漳州: bgBaseZhangzhou,
洛阳: bgBaseLuoyang,
秦皇岛: bgBaseQinhuangdao,
宿迁: bgBaseSuqian
}
},
baseNameToIndexMap: { // 新的名称→序号映射
宜兴: 7,
漳州: 8,
自贡: 3,
桐城: 2,
洛阳: 9,
合肥: 5,
秦皇岛: 10, // 补充
宿迁: 6 // 补充
}
}; };
}, },
watch: { watch: {
// 监听父组件传递的factory变化同步本地选中索引 // 监听父组件传递的factory变化同步本地选中索引
factory: { factory: {
handler(newVal) { handler(newVal) {
// 根据新的baseNameToIndexMap找到对应的基地名称 console.log('watch factory=======================:', newVal);
const targetName = Object.keys(this.baseNameToIndexMap).find(name => this.baseNameToIndexMap[name] === newVal); if (newVal) {
// 根据名称找到buttonList中的索引 this.activeButton = newVal;
const targetIndex = this.buttonList.indexOf(targetName); }
// 合法索引则更新,否则默认选中宜兴 // // 根据新的baseNameToIndexMap找到对应的基地名称
this.activeButton = targetIndex > -1 ? targetIndex : 2; // const targetName = Object.keys(this.baseNameToIndexMap).find(name => this.baseNameToIndexMap[name] === newVal);
console.log('当前选中基地:', this.buttonList[this.activeButton], '序号:', newVal); // // 根据名称找到buttonList中的索引
// const targetIndex = this.buttonList.indexOf(targetName);
// // 合法索引则更新,否则默认选中宜兴
// this.activeButton = targetIndex > -1 ? targetIndex : 2;
// console.log('当前选中基地:', this.buttonList[this.activeButton], '序号:', newVal);
}, },
immediate: true // 初始化立即执行 // immediate: true // 初始化立即执行
},
// 监听本地选中索引变化,向父组件发送事件
activeButton(newVal) {
const selectedName = this.buttonList[newVal];
const selectedIndex = this.baseNameToIndexMap[selectedName] || 5; // 默认返回宜兴的序号7
this.$emit('baseChange', selectedIndex);
} }
}, },
methods: { methods: {
handleClick(index) { handleClick(id) {
this.activeButton = index; this.activeButton = id;
}, this.$emit('baseChange', id);
getIndexByName(name) {
return this.baseNameToIndexMap[name] || 5;
} }
}, },
mounted() { mounted() {
// 初始化时触发事件传递默认选中的宜兴序号7 // 初始化时触发事件传递默认选中的宜兴序号7
this.$emit('baseChange', 5); // this.$emit('baseChange', 5);
} }
}; };
</script> </script>

View File

@@ -13,7 +13,7 @@
<div class="monthItem" :class="{ <div class="monthItem" :class="{
'has-data': month.haveData, 'has-data': month.haveData,
'current': index === currentMonthIndex // 本月匹配current样式 'current': index === currentMonthIndex // 本月匹配current样式
}" v-for="(month, index) in monthList" :key="index"> }" v-for="(month, index) in list" :key="index">
{{ month.name }} {{ month.name }}
</div> </div>
</div> </div>
@@ -41,21 +41,7 @@ export default {
data() { data() {
return { return {
chart: null, chart: null,
// 初始化12个月的列表可根据实际需求修改haveData默认值 list:[]
monthList: [
{ name: '1月', haveData: false, isActive: false },
{ name: '2月', haveData: false, isActive: false },
{ name: '3月', haveData: false, isActive: false },
{ name: '4月', haveData: false, isActive: false },
{ name: '5月', haveData: false, isActive: false },
{ name: '6月', haveData: false, isActive: false },
{ name: '7月', haveData: false, isActive: false },
{ name: '8月', haveData: false, isActive: false },
{ name: '9月', haveData: false, isActive: false },
{ name: '10月', haveData: false, isActive: false },
{ name: '11月', haveData: false, isActive: false },
{ name: '12月', haveData: false, isActive: false }
],
} }
}, },
computed: { computed: {
@@ -83,19 +69,15 @@ export default {
// 根据calendarList更新monthList的haveData状态 // 根据calendarList更新monthList的haveData状态
updateMonthHaveData(calendarObj) { updateMonthHaveData(calendarObj) {
if (!calendarObj || typeof calendarObj !== 'object') return; if (!calendarObj || typeof calendarObj !== 'object') return;
const keys = Object.keys(calendarObj);
// 遍历12个月匹配对应年月 if(keys.length == 0){
this.monthList.forEach((month, index) => { return
// 获取月份数字(索引+1补两位如1→0110→10 }
const monthNum = (index + 1).toString().padStart(2, '0'); console.log('calendarObj',calendarObj)
// 拼接成calendarList中的键格式如2025-01 this.list = []
const yearMonthKey = `2025-${monthNum}`; // 若年份不固定可改为props传递年份 for(let i = 0; i < keys.length; i++) {
this.list.push({name:i+1+'月',haveData:calendarObj[keys[i]],isActive:i==new Date().getMonth()})
// 判断calendarObj中该键对应的值1→true0→false无该键则保持默认false
if (calendarObj.hasOwnProperty(yearMonthKey)) {
month.haveData = calendarObj[yearMonthKey] === 1;
} }
});
}, },
} }
} }

View File

@@ -20,7 +20,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button> <el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
<!-- <el-button type="primary" plain size="medium">导入</el-button> --> <el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@@ -64,6 +64,22 @@ font-style: normal;">指标详情</div>
></base-table> ></base-table>
</div> </div>
</div> </div>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" action="#" :disabled="upload.isUploading"
:on-change="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
</div>
<div class="el-upload__tip" slot="tip">
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</Container> </Container>
</div> </div>
</template> </template>
@@ -72,7 +88,8 @@ font-style: normal;">指标详情</div>
import Container from './container.vue' import Container from './container.vue'
import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit' import { getLevelStruc, getRealMonthPage, updateRealMonthData, getDictListData, } from '@/api/cockpit'
import inputArea from './inputArea.vue' // 导入输入组件 import inputArea from './inputArea.vue' // 导入输入组件
import {getAccessToken, getTenantId} from '@/utils/auth'
import axios from 'axios';
export default { export default {
name: 'ProductionStatus', name: 'ProductionStatus',
components: { components: {
@@ -85,7 +102,7 @@ export default {
data() { data() {
return { return {
form: { form: {
levelId: 1, levelId: undefined,
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
month: undefined, month: undefined,
@@ -96,7 +113,17 @@ export default {
isDetail: false, // 编辑状态标识false=只读true=编辑 isDetail: false, // 编辑状态标识false=只读true=编辑
tableData: [], // 表格数据 tableData: [], // 表格数据
levelLList: [], // 所属层级下拉数据 levelLList: [], // 所属层级下拉数据
tableProps: [] // 表格列配置 tableProps: [], // 表格列配置
upload: {
// 是否显示弹出层
open: false,
// 弹出层标题
title: "指标填报导入",
// 是否禁用上传
isUploading: false,
fileList:[],
currentFile:null
}
} }
}, },
watch: { watch: {
@@ -261,13 +288,16 @@ export default {
getData() { getData() {
// 1. 请求所属层级下拉数据 // 1. 请求所属层级下拉数据
getLevelStruc().then((res) => { getLevelStruc().then((res) => {
console.log('所属层级数据:', res);
this.levelLList = res.data || []; this.levelLList = res.data || [];
this.form.levelId = this.levelLList[0].id;
this.getDataPage()
}).catch(err => { }).catch(err => {
console.error('获取所属层级失败:', err); console.error('获取所属层级失败:', err);
this.levelLList = []; this.levelLList = [];
}); });
this.$emit('updateLeft')
},
getDataPage() {
// 2. 请求表格分页数据 // 2. 请求表格分页数据
getRealMonthPage({ getRealMonthPage({
levelId: this.form.levelId, levelId: this.form.levelId,
@@ -288,6 +318,7 @@ export default {
console.error('获取表格数据失败:', err); console.error('获取表格数据失败:', err);
this.tableData = []; this.tableData = [];
}); });
}, },
// 查询按钮点击事件(可根据需求扩展逻辑) // 查询按钮点击事件(可根据需求扩展逻辑)
@@ -295,8 +326,61 @@ export default {
// 清空原有表格数据,重新请求 // 清空原有表格数据,重新请求
this.tableData = []; this.tableData = [];
this.$nextTick(() => { this.$nextTick(() => {
this.getData(); this.getDataPage();
}); });
},
// 导入
importExcel() {
this.upload.open = true
},
// 文件上传中处理
handleFileUploadProgress(file, fileList) {
console.log('文件上传中:',file, fileList)
this.upload.isUploading = true;
this.upload.fileList = fileList;
this.upload.currentFile = file.raw;
},
handleFileSuccess() {},
importTemplate() {},
// 提交上传文件
async submitFileForm() {
try {
if (!this.upload.currentFile) {
return this.$message.error('请先选择要上传的文件!')
}
const formData = new FormData()
formData.append('file', this.upload.currentFile) // 文件字段
formData.append('reportDate', this.form.endTime) // 时间维度字段
formData.append('levelId', this.form.levelId) // 层级维度字段
const response = await axios({
url: process.env.VUE_APP_BASE_API + '/admin-api/lb/index-real-month/actualIndicatorImport',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
'Authorization': "Bearer " + getAccessToken(),
'tenant-id': getTenantId(),
},
timeout: 30000
})
// 4. 处理响应结果
if (response.data.code === 0) {
this.$message.success('文件上传成功!')
// 重置表单
this.upload.fileList = []
this.upload.currentFile = null
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles();
this.getData()
} else {
this.$message.error(`上传失败:${response.data.msg || '未知错误'}`)
}
} catch (error) {
// 5. 异常处理
console.error('文件上传出错:', error)
this.$message.error('上传失败!')
}
} }
} }
} }

View File

@@ -7,6 +7,15 @@
<!-- 右侧区域全屏按钮 --> <!-- 右侧区域全屏按钮 -->
<div class="right-content"> <div class="right-content">
<el-dropdown trigger="click">
<el-button type="text" class="logout-btn" :title="'退出'">
<svg-icon style="color: #0B58FF;" icon-class="logout" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native='logout'>退出登录</el-dropdown-item>
<el-dropdown-item @click.native='handleToggle'>切换账号</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn"> <el-button type="text" class="return-btn" :title="'返回'" @click="handleReturn">
<svg-icon style="color: #0B58FF;" icon-class="returnIcon" /> <svg-icon style="color: #0B58FF;" icon-class="returnIcon" />
</el-button> </el-button>
@@ -31,7 +40,7 @@
<script> <script>
import moment from 'moment'; // 引入moment import moment from 'moment'; // 引入moment
import {getPath} from "@/utils/ruoyi";
export default { export default {
name: 'Header', name: 'Header',
props: { props: {
@@ -100,6 +109,18 @@ export default {
this.$router.go(-1); this.$router.go(-1);
} }
}, },
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
}).catch(() => {});
},
handleToggle() {
this.$store.dispatch('LogOut').then(() => {
location.href = getPath('/index');
})
},
/** /**
* 计算时间范围(时间戳格式) * 计算时间范围(时间戳格式)
* 固定为月维度当月1日00:00:00 → 当月最后一天23:59:59 * 固定为月维度当月1日00:00:00 → 当月最后一天23:59:59
@@ -297,6 +318,7 @@ export default {
margin-top: 12px; margin-top: 12px;
margin-right: 10px; margin-right: 10px;
gap: 21px; gap: 21px;
height: 35px;
} }
.screen-btn { .screen-btn {
@@ -305,6 +327,7 @@ export default {
color: #00fff0; color: #00fff0;
font-size: 26px; font-size: 26px;
padding: 0; padding: 0;
margin: 0;
} }
.home-btn { .home-btn {
@@ -322,6 +345,14 @@ export default {
font-size: 26px; font-size: 26px;
padding: 0; padding: 0;
} }
.logout-btn {
width: 28px;
height: 28px;
font-size: 28px;
padding: 0;
}
} }
/* 日期选择器自定义样式 */ /* 日期选择器自定义样式 */

View File

@@ -99,7 +99,7 @@ export default {
grid: { grid: {
top: 35, top: 35,
bottom: 20, bottom: 20,
right: 25, right: 13,
}, },
xAxis: [ xAxis: [
{ {
@@ -222,11 +222,11 @@ export default {
/* (你的样式代码保持不变) */ /* (你的样式代码保持不变) */
.legend { .legend {
position: absolute; position: absolute;
right: 10px; right: 12px;
top: -5px; top: 0px;
display: flex; display: flex;
/* 使用 flex 布局让两个图例项并排且对齐 */ /* 使用 flex 布局让两个图例项并排且对齐 */
gap: 20px; gap: 5px;
} }
.legend-item-line { .legend-item-line {
@@ -237,7 +237,7 @@ export default {
text-align: left; text-align: left;
font-style: normal; font-style: normal;
position: relative; position: relative;
padding-left: 20px; padding-left: 24px;
/* 为圆点和线条留出空间 */ /* 为圆点和线条留出空间 */
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -121,7 +121,7 @@ export default {
.lineFour { .lineFour {
top: 5px; top: 5px;
left: 268px; left: 252px;
} }
.item-button { .item-button {

View File

@@ -71,7 +71,7 @@ export default {
// 定义一个映射关系,将后端字段名与前端显示信息关联起来 // 定义一个映射关系,将后端字段名与前端显示信息关联起来
const dataMap = [ const dataMap = [
{ {
key: 'processCost', key: 'totalCost',
unit: '制造成本·元/㎡', unit: '制造成本·元/㎡',
route: '/productionCostAnalysis/productionCostAnalysis' route: '/productionCostAnalysis/productionCostAnalysis'
}, },

View File

@@ -114,6 +114,7 @@ export default {
monthAnalysis: [], monthAnalysis: [],
ytdAnalysis: [], ytdAnalysis: [],
trend: [], trend: [],
factory:null
}; };
}, },
@@ -185,7 +186,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -89,7 +89,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
this.$router.push({ this.$router.push({
path: 'expenseAnalysisBase', path: 'expenseAnalysisBase',
query: { // 使用query传递参数推荐也可使用params query: { // 使用query传递参数推荐也可使用params

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -174,7 +174,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -91,7 +91,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'fullCostAnalysisBase', path: 'fullCostAnalysisBase',

View File

@@ -111,7 +111,7 @@ export default {
dateData:{}, dateData:{},
levelId:undefined, levelId:undefined,
index: '毛利率', index: '毛利率',
factory: 1, factory: null,
monthData: {}, monthData: {},
ytdData: {}, ytdData: {},
monthAnalysis: [], monthAnalysis: [],
@@ -188,7 +188,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'grossMarginBase', path: 'grossMarginBase',

View File

@@ -45,7 +45,7 @@ import { getOperateCockpit, getOrderDetail } from '@/api/cockpit'
import { Sidebar } from "../../layout/components"; import { Sidebar } from "../../layout/components";
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
name: 'DayReport', name: 'JtHome',
components: { ReportHeader, coreSalesKPIs, keyProductionIndicators, coreBottomLeft, keyWork, orderProgress, financeCosts, Sidebar }, components: { ReportHeader, coreSalesKPIs, keyProductionIndicators, coreBottomLeft, keyWork, orderProgress, financeCosts, Sidebar },
data() { data() {
return { return {

View File

@@ -17,7 +17,7 @@
grid-template-columns:416px 1192px; grid-template-columns:416px 1192px;
"> ">
<indicatorCalendar :calendarList="calendarList" /> <indicatorCalendar :calendarList="calendarList" />
<indicatorDetails /> <indicatorDetails @updateLeft='getData'/>
</div> </div>
</div> </div>
<!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px"> <!-- <div class="top" style="margin-top: -20px; display: flex; gap: 16px">
@@ -146,27 +146,11 @@ export default {
this.getData() this.getData()
}, },
methods: { methods: {
// sortChange(value) {
// this.sort = value
// this.getData()
// },
getData() { getData() {
getRealMonthCalendar().then((res) => { getRealMonthCalendar().then((res) => {
console.log(res, 'res'); console.log(res, 'res');
this.calendarList = res.data this.calendarList = res.data
}) })
// getSalesRevenueGroupData({
// startTime: this.dateData.startTime,
// endTime: this.dateData.endTime,
// sort: this.sort,
// index: undefined,
// factory: undefined
// // timeDim: obj.mode
// }).then((res) => {
// console.log(res);
// this.monthData= res.data.month
// this.ytdData = res.data.ytd
// })
}, },
handleTimeChange(obj) { handleTimeChange(obj) {
console.log(obj, 'obj'); console.log(obj, 'obj');

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
index: '加工成品率', index: '加工成品率',
monthData: undefined, monthData: undefined,
@@ -184,7 +184,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
relatedMon: {}, relatedMon: {},
@@ -178,7 +178,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'netPriceAnalysisBase', path: 'netPriceAnalysisBase',

View File

@@ -91,8 +91,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: 'operatingRevenueBase', path: 'operatingRevenueBase',

View File

@@ -101,7 +101,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -174,7 +174,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -91,6 +91,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -108,7 +108,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory:0, factory:null,
dateData:{}, dateData:{},
index: '营业收入', index: '营业收入',
monthData: undefined, monthData: undefined,
@@ -157,7 +157,7 @@ export default {
transformOrigin: "left top", transformOrigin: "left top",
// overflow: hidden; // overflow: hidden;
}; };
}, }
}, },
watch: { watch: {
clientWidth(val) { clientWidth(val) {
@@ -188,7 +188,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
console.log('this.$route.query.dateData', this.$route.query.dateData); console.log('this.$route.query.dateData', this.$route.query.dateData);
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },

View File

@@ -101,7 +101,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -173,7 +173,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -92,7 +92,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -183,7 +183,13 @@ export default {
})(); })();
}; };
console.log(this.$route.query.name, 'name'); console.log(this.$route.query.name, 'name');
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -183,7 +183,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -183,7 +183,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -88,7 +88,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -166,7 +166,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -184,7 +184,13 @@ export default {
})(); })();
}; };
console.log('this.$route.query.factory', this.$route.query.factory); console.log('this.$route.query.factory', this.$route.query.factory);
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -168,6 +168,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,6 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -104,7 +104,7 @@ export default {
timer: null, timer: null,
beilv: 1, beilv: 1,
month: '', month: '',
factory: 5, factory: null,
value: 100, value: 100,
dateData: {}, dateData: {},
trendName: '加工燃料成本', trendName: '加工燃料成本',
@@ -184,7 +184,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
trendName: '加工制造费用成本', trendName: '加工制造费用成本',
monData: {}, monData: {},
@@ -176,7 +176,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -168,7 +168,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -185,7 +185,13 @@ export default {
}; };
console.log('this.$route.query.factory', this.$route.query.factory); console.log('this.$route.query.factory', this.$route.query.factory);
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -103,7 +103,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
trendName: '加工燃料成本', trendName: '加工燃料成本',
monData: {}, monData: {},
@@ -176,7 +176,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -168,7 +168,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -105,7 +105,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -179,7 +179,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -88,7 +88,7 @@ export default {
beilv: 1, beilv: 1,
month:'', month:'',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -160,7 +160,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -102,7 +102,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -98,7 +98,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({
path: this.baseUrl, path: this.baseUrl,

View File

@@ -107,7 +107,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
index: '原片成品率', index: '原片成品率',
monthData: undefined, monthData: undefined,
@@ -187,7 +187,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -87,7 +87,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -178,7 +178,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -104,7 +104,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -178,7 +178,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -101,7 +101,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
totalData: {}, totalData: {},
@@ -173,7 +173,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -90,7 +90,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -175,7 +175,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -87,7 +87,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -109,7 +109,7 @@ export default {
beilv: 1, beilv: 1,
month: '', month: '',
value: 100, value: 100,
factory: 5, factory: null,
dateData: {}, dateData: {},
monData: {}, monData: {},
relatedMon: {}, relatedMon: {},
@@ -182,7 +182,13 @@ export default {
this.beilv = _this.clientWidth / 1920; this.beilv = _this.clientWidth / 1920;
})(); })();
}; };
this.factory = this.$route.query.factory ? Number(this.$route.query.factory) : 5 if(this.$route.query.factory){
this.factory =Number(this.$route.query.factory)
}else if(this.$store.getters.levelList.length > 0 && this.$store.getters.levelList[0].id !== 1) {
this.factory = this.$store.getters.levelList[0].id
}else{
this.factory = this.$store.getters.levelList[1].id
}
this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined this.dateData = this.$route.query.dateData ? this.$route.query.dateData : undefined
}, },
methods: { methods: {

View File

@@ -89,7 +89,9 @@ export default {
const baseIndex = this.baseNameToIndexMap[itemName] || 0; const baseIndex = this.baseNameToIndexMap[itemName] || 0;
console.log(`你点击了【${itemName}】(序号:${baseIndex})`); console.log(`你点击了【${itemName}】(序号:${baseIndex})`);
if (itemName === undefined) {
return;
}
// 路由跳转时携带序号(或名称+序号) // 路由跳转时携带序号(或名称+序号)
this.$router.push({ this.$router.push({

View File

@@ -297,7 +297,6 @@ export default {
) )
.then(() => { .then(() => {
console.log(this.redirect, this.$route.query.redirect, 'this.redirect'); console.log(this.redirect, this.$route.query.redirect, 'this.redirect');
this.$router.push({ path: this.redirect || '/' }).catch(() => { }); this.$router.push({ path: this.redirect || '/' }).catch(() => { });
}) })
.catch(() => { .catch(() => {

View File

@@ -75,7 +75,7 @@
<el-table-column label="用户编号" align="center" key="id" prop="id" v-if="columns[0].visible" /> <el-table-column label="用户编号" align="center" key="id" prop="id" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="username" prop="username" v-if="columns[1].visible" :show-overflow-tooltip="true" /> <el-table-column label="用户名称" align="center" key="username" prop="username" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickname" prop="nickname" v-if="columns[2].visible" :show-overflow-tooltip="true" /> <el-table-column label="用户昵称" align="center" key="nickname" prop="nickname" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.name" v-if="columns[3].visible" :show-overflow-tooltip="true" /> <el-table-column label="部门" align="center" key="deptName" prop="deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="mobile" prop="mobile" v-if="columns[4].visible" width="120" /> <el-table-column label="手机号码" align="center" key="mobile" prop="mobile" v-if="columns[4].visible" width="120" />
<el-table-column label="状态" key="status" v-if="columns[5].visible" align="center"> <el-table-column label="状态" key="status" v-if="columns[5].visible" align="center">
<template v-slot="scope"> <template v-slot="scope">