Compare commits
13 Commits
projects/l
...
projects/s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ade2dfcdc | ||
|
|
852a3f17a0 | ||
| cba14b1f61 | |||
|
|
33c00785df | ||
|
|
d8acff21e3 | ||
|
|
c0a38c568f | ||
| 6a8a9ed28d | |||
| a2213f4f7e | |||
| 0e1e813dc2 | |||
| c9c8f82910 | |||
| d859ba62c8 | |||
| 31bafae4aa | |||
| 67b6b88863 |
4
.env.dev
@@ -12,8 +12,8 @@ ENV = 'development'
|
||||
VUE_APP_TITLE = 智能监控分析系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
# VUE_APP_BASE_API = 'http://192.168.8.22:48080'
|
||||
VUE_APP_BASE_API = 'http://172.16.33.65:48082'
|
||||
VUE_APP_BASE_API = 'http://172.16.32.76:48080'
|
||||
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@@ -57,7 +57,66 @@ export function listByDeptId(id) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 作废计划
|
||||
export function disablePlan(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/disablePlan?id='+id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
// 同步节假日
|
||||
export function updateScheduleLater(data) {
|
||||
return request({
|
||||
url: '/base/group-holiday/updateScheduleLater',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
// 复制计划
|
||||
export function copyPlan(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/copyPlan?id='+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 列表草稿编辑
|
||||
export function draftEditing(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/draftEditing?id='+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 排班计划-详情
|
||||
export function getPlan(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/get?id='+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 弹窗-取消
|
||||
export function cancelStepThree(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/cancelStepThree?id='+id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
// 第三步确认并执行 检查计划时间是否冲突,如果有,返回冲突的计划列表
|
||||
export function checkPlan(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/checkPlan',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
// 第三步确认并执行 执行
|
||||
export function createStepFour(id) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/createStepFour',
|
||||
method: 'post',
|
||||
data:id
|
||||
})
|
||||
}
|
||||
// 班组班次下一步至获取预览
|
||||
export function createStepTwo(data) {
|
||||
return request({
|
||||
@@ -73,3 +132,12 @@ export function returnStepTwo(id) {
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
// 第三步获取预览
|
||||
export function getPerView(data) {
|
||||
return request({
|
||||
url: '/base/group-scheduling-plan/getPerView',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
18
src/api/group/calendar.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取部门及下级部门排班list
|
||||
export function getDeptSchedulingList(data) {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/getDeptSchedulingList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 某个班组的排班list
|
||||
export function getClassSchedulingList(data) {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/getClassSchedulingList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -2,19 +2,28 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-18 21:24:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-18 23:07:37
|
||||
* @LastEditTime: 2025-10-22 14:34:29
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得节假日基础信息分页
|
||||
export function deptHolidayList(query) {
|
||||
export function deptHolidayPage(query) {
|
||||
return request({
|
||||
url: '/base/group-holiday/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 获得部门节假日信息
|
||||
export function deptHolidayList(data) {
|
||||
return request({
|
||||
url: '/base/group-holiday/deptHolidayList',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 创建节假日基础信息
|
||||
export function createHoliday(data) {
|
||||
@@ -24,6 +33,14 @@ export function createHoliday(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 节假日操作后直接更新排班日历
|
||||
export function updateSchedule(data) {
|
||||
return request({
|
||||
url: '/base/group-holiday/updateSchedule',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新节假日基础信息
|
||||
export function updateHoliday(data) {
|
||||
@@ -33,14 +50,30 @@ export function updateHoliday(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 删除节假日基础信息前校验是否影响排班
|
||||
export function checkDeleteHoliday(id) {
|
||||
return request({
|
||||
url: '/base/group-holiday/checkDelete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function deleteHolidayn(id) {
|
||||
export function deleteHoliday(id) {
|
||||
return request({
|
||||
url: '/base/group-holiday/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得节假日基础信息
|
||||
export function getHoliday(id) {
|
||||
return request({
|
||||
url: '/base/group-holiday/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得节假日变动日志分页
|
||||
export function deptHolidayLogList(query) {
|
||||
return request({
|
||||
@@ -49,3 +82,11 @@ export function deptHolidayLogList(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得用户本人及以下的部门扁平化结构
|
||||
export function getEnableData() {
|
||||
return request({
|
||||
url: '/base/group-team-scheduling/getEnableData',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
9
src/api/visualization/visualization.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getLineEdgeLibraryList(data) {
|
||||
return request({
|
||||
url: '/wms/line-edge-library/list',
|
||||
method: 'get',
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
BIN
src/assets/img/ABN.png
Normal file
|
After Width: | Height: | Size: 461 B |
BIN
src/assets/img/ABNScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/DIS.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
src/assets/img/DISScale.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
src/assets/img/EP.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
src/assets/img/EPScale.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
src/assets/img/FP.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
src/assets/img/FPScale.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
src/assets/img/IDL.png
Normal file
|
After Width: | Height: | Size: 929 B |
BIN
src/assets/img/IDLScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/IT.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
src/assets/img/ITScale.png
Normal file
|
After Width: | Height: | Size: 261 B |
BIN
src/assets/img/LCK.png
Normal file
|
After Width: | Height: | Size: 416 B |
BIN
src/assets/img/LCKScale.png
Normal file
|
After Width: | Height: | Size: 305 B |
BIN
src/assets/img/OCC.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
src/assets/img/OCCScale.png
Normal file
|
After Width: | Height: | Size: 259 B |
BIN
src/assets/img/RES.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
src/assets/img/RESScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/Top1.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/img/Top2.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/Top3.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/Top4.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/img/Top5.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/agvCar.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/assets/img/agvItemBg.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
src/assets/img/alarmItemBg.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/assets/img/chargeBg.png
Normal file
|
After Width: | Height: | Size: 326 B |
BIN
src/assets/img/chargeCircle.png
Normal file
|
After Width: | Height: | Size: 622 B |
BIN
src/assets/img/cold-data-board-msg1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/img/cold-data-board-msg2.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/img/home-bg.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
src/assets/img/home-progress-bg.png
Normal file
|
After Width: | Height: | Size: 936 B |
BIN
src/assets/img/leftTable.png
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
src/assets/img/recycle.png
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
src/assets/img/rightTable.png
Normal file
|
After Width: | Height: | Size: 355 B |
BIN
src/assets/img/runBg.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
src/assets/img/runCircle.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
src/assets/img/ssdlLeftTitle.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/img/ssdlTitle.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/assets/img/standbyCircle.png
Normal file
|
After Width: | Height: | Size: 611 B |
BIN
src/assets/img/threeDimensionalChartBg.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
@@ -9,7 +9,7 @@ import { isRelogin } from '@/utils/request'
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
// 增加三方登陆 update by 芋艿
|
||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
const whiteList = ['/login', '/social-login','screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
@@ -25,9 +25,9 @@ router.beforeEach((to, from, next) => {
|
||||
// 获取字典数据 add by 芋艿
|
||||
store.dispatch('dict/loadDictDatas')
|
||||
// 判断当前用户是否已拉取完 user_info 信息
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
store.dispatch('GetInfo').then(userInfo => {
|
||||
isRelogin.show = false
|
||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||
// 根据 roles 权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
|
||||
@@ -28,223 +28,277 @@ Vue.use(Router)
|
||||
|
||||
// 公共路由
|
||||
export const constantRoutes = [
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: (resolve) => require(['@/views/redirect'], resolve)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: (resolve) => require(['@/views/login'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/sso',
|
||||
component: (resolve) => require(['@/views/sso'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/social-login',
|
||||
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/print-design',
|
||||
component: (resolve) => require(['@/views/print/design'], resolve),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: "",
|
||||
component: Layout,
|
||||
redirect: "index",
|
||||
children: [
|
||||
{
|
||||
path: "index",
|
||||
component: (resolve) => require(["@/views/home/index"], resolve),
|
||||
name: "首页",
|
||||
meta: { title: "首页", icon: "dashboard", affix: true },
|
||||
hidden: true
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [{
|
||||
path: 'profile',
|
||||
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}, {
|
||||
path: 'notify-message',
|
||||
component: (resolve) => require(['@/views/system/notify/my/index'], resolve),
|
||||
name: 'MyNotifyMessage',
|
||||
meta: { title: '我的站内信', icon: 'message' },
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/dict',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'type/data/:dictId(\\d+)',
|
||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||
name: 'SystemDictData',
|
||||
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/job',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'log',
|
||||
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
||||
name: 'InfraJobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/infra/job' }
|
||||
}
|
||||
]
|
||||
}, {
|
||||
path: '/codegen',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'edit/:tableId(\\d+)',
|
||||
component: (resolve) => require(['@/views/infra/codegen/editTable'], resolve),
|
||||
name: 'InfraCodegenEditTable',
|
||||
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [{
|
||||
path: 'oa/leave/create',
|
||||
component: (resolve) => require(['@/views/bpm/oa/leave/create'], resolve),
|
||||
name: 'BpmOALeaveCreate',
|
||||
meta: { title: '发起 OA 请假', icon: 'form', activeMenu: '/bpm/oa/leave' }
|
||||
}, {
|
||||
path: 'oa/leave/detail',
|
||||
component: (resolve) => require(['@/views/bpm/oa/leave/detail'], resolve),
|
||||
name: 'BpmOALeaveDetail',
|
||||
meta: { title: '查看 OA 请假', icon: 'view', activeMenu: '/bpm/oa/leave' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'manager/form/edit',
|
||||
component: (resolve) => require(['@/views/bpm/form/formEditor'], resolve),
|
||||
name: 'BpmFormEditor',
|
||||
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' }
|
||||
}, {
|
||||
path: 'manager/definition',
|
||||
component: (resolve) => require(['@/views/bpm/definition/index'], resolve),
|
||||
name: 'BpmProcessDefinition',
|
||||
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' }
|
||||
}, {
|
||||
path: 'manager/model/design',
|
||||
component: (resolve) => require(['@/views/bpm/model/modelEditor'], resolve),
|
||||
name: 'BpmModelEditor',
|
||||
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' }
|
||||
}, {
|
||||
path: 'process-instance/create',
|
||||
component: (resolve) => require(['@/views/bpm/processInstance/create'], resolve),
|
||||
name: 'BpmProcessInstanceCreate',
|
||||
meta: { title: '发起流程', activeMenu: '/bpm/task/my' }
|
||||
}, {
|
||||
path: 'process-instance/detail',
|
||||
component: (resolve) => require(['@/views/bpm/processInstance/detail'], resolve),
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
meta: { title: '流程详情', activeMenu: '/bpm/task/my' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/property',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'value/:propertyId(\\d+)',
|
||||
component: (resolve) => require(['@/views/mall/product/property/value'], resolve),
|
||||
name: 'ProductPropertyValue',
|
||||
meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/spu',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'edit/:spuId(\\d+)',
|
||||
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve),
|
||||
name: 'ProductSpuUpdate',
|
||||
meta: { title: '修改商品', activeMenu: '/product/spu' }
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve),
|
||||
name: 'ProductSpuCreate',
|
||||
meta: { title: '添加商品', activeMenu: '/product/spu' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/trade/order',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'detail',
|
||||
name: 'TradeOrderDetail',
|
||||
hidden: true,
|
||||
meta: { title: '订单详情' },
|
||||
component: (resolve) => require(['@/views/mall/trade/order/detail'], resolve)
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/pay',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [{
|
||||
path: 'order/submit',
|
||||
name: 'PayOrderSubmit',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '收银台',
|
||||
noCache: true
|
||||
},
|
||||
component: (resolve) => require(['@/views/pay/order/submit'], resolve)
|
||||
}]
|
||||
}
|
||||
]
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: (resolve) => require(['@/views/redirect'], resolve),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: (resolve) => require(['@/views/login'], resolve),
|
||||
// hidden: true,
|
||||
},
|
||||
|
||||
{
|
||||
path: '/sso',
|
||||
component: (resolve) => require(['@/views/sso'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/social-login',
|
||||
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '/print-design',
|
||||
component: (resolve) => require(['@/views/print/design'], resolve),
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: (resolve) => require(['@/views/home/index'], resolve),
|
||||
name: '首页',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true },
|
||||
hidden: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/screenbg',
|
||||
component: () =>
|
||||
import(
|
||||
/* webpackChunkName: "about" */ '@/views/productionVisualization/equipmentBoard'
|
||||
),
|
||||
name: 'screenbg',
|
||||
meta: { title: '大屏', icon: 'chart' },
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: (resolve) =>
|
||||
require(['@/views/system/user/profile/index'], resolve),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' },
|
||||
},
|
||||
{
|
||||
path: 'notify-message',
|
||||
component: (resolve) =>
|
||||
require(['@/views/system/notify/my/index'], resolve),
|
||||
name: 'MyNotifyMessage',
|
||||
meta: { title: '我的站内信', icon: 'message' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/dict',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'type/data/:dictId(\\d+)',
|
||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||
name: 'SystemDictData',
|
||||
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/job',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'log',
|
||||
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
||||
name: 'InfraJobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/infra/job' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/codegen',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'edit/:tableId(\\d+)',
|
||||
component: (resolve) =>
|
||||
require(['@/views/infra/codegen/editTable'], resolve),
|
||||
name: 'InfraCodegenEditTable',
|
||||
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'oa/leave/create',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/oa/leave/create'], resolve),
|
||||
name: 'BpmOALeaveCreate',
|
||||
meta: {
|
||||
title: '发起 OA 请假',
|
||||
icon: 'form',
|
||||
activeMenu: '/bpm/oa/leave',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'oa/leave/detail',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/oa/leave/detail'], resolve),
|
||||
name: 'BpmOALeaveDetail',
|
||||
meta: {
|
||||
title: '查看 OA 请假',
|
||||
icon: 'view',
|
||||
activeMenu: '/bpm/oa/leave',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/bpm',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'manager/form/edit',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/form/formEditor'], resolve),
|
||||
name: 'BpmFormEditor',
|
||||
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' },
|
||||
},
|
||||
{
|
||||
path: 'manager/definition',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/definition/index'], resolve),
|
||||
name: 'BpmProcessDefinition',
|
||||
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' },
|
||||
},
|
||||
{
|
||||
path: 'manager/model/design',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/model/modelEditor'], resolve),
|
||||
name: 'BpmModelEditor',
|
||||
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' },
|
||||
},
|
||||
{
|
||||
path: 'process-instance/create',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/processInstance/create'], resolve),
|
||||
name: 'BpmProcessInstanceCreate',
|
||||
meta: { title: '发起流程', activeMenu: '/bpm/task/my' },
|
||||
},
|
||||
{
|
||||
path: 'process-instance/detail',
|
||||
component: (resolve) =>
|
||||
require(['@/views/bpm/processInstance/detail'], resolve),
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
meta: { title: '流程详情', activeMenu: '/bpm/task/my' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/property',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'value/:propertyId(\\d+)',
|
||||
component: (resolve) =>
|
||||
require(['@/views/mall/product/property/value'], resolve),
|
||||
name: 'ProductPropertyValue',
|
||||
meta: {
|
||||
title: '商品属性值',
|
||||
icon: '',
|
||||
activeMenu: '/product/property',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/spu',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'edit/:spuId(\\d+)',
|
||||
component: (resolve) =>
|
||||
require(['@/views/mall/product/spu/save'], resolve),
|
||||
name: 'ProductSpuUpdate',
|
||||
meta: { title: '修改商品', activeMenu: '/product/spu' },
|
||||
},
|
||||
{
|
||||
path: 'add',
|
||||
component: (resolve) =>
|
||||
require(['@/views/mall/product/spu/save'], resolve),
|
||||
name: 'ProductSpuCreate',
|
||||
meta: { title: '添加商品', activeMenu: '/product/spu' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/trade/order',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'detail',
|
||||
name: 'TradeOrderDetail',
|
||||
hidden: true,
|
||||
meta: { title: '订单详情' },
|
||||
component: (resolve) =>
|
||||
require(['@/views/mall/trade/order/detail'], resolve),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/pay',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'order/submit',
|
||||
name: 'PayOrderSubmit',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: '收银台',
|
||||
noCache: true,
|
||||
},
|
||||
component: (resolve) => require(['@/views/pay/order/submit'], resolve),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// 防止连续点击多次路由报错
|
||||
let routerPush = Router.prototype.push;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {constantRoutes} from '@/router'
|
||||
import {getRouters} from '@/api/menu'
|
||||
import Layout from '@/layout/index'
|
||||
import ParentView from '@/components/ParentView';
|
||||
import {toCamelCase} from "@/utils";
|
||||
@@ -27,22 +26,25 @@ const permission = {
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
// 生成路由
|
||||
GenerateRoutes({commit}) {
|
||||
/**
|
||||
* 生成路由
|
||||
*
|
||||
* @param commit commit 函数
|
||||
* @param menus 路由参数
|
||||
*/
|
||||
GenerateRoutes({commit}, menus) {
|
||||
return new Promise(resolve => {
|
||||
// 向后端请求路由数据(菜单)
|
||||
getRouters().then(res => {
|
||||
const sdata = JSON.parse(JSON.stringify(res.data)) // 【重要】用于菜单中的数据
|
||||
const rdata = JSON.parse(JSON.stringify(res.data)) // 用于最后添加到 Router 中的数据
|
||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
||||
commit('SET_ROUTES', rewriteRoutes)
|
||||
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
|
||||
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
|
||||
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
||||
resolve(rewriteRoutes)
|
||||
})
|
||||
// 将 menus 菜单,转换为 route 路由数组
|
||||
const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据
|
||||
const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据
|
||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
||||
commit('SET_ROUTES', rewriteRoutes)
|
||||
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
|
||||
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
|
||||
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
||||
resolve(rewriteRoutes)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="background: #f2f4f9; height: 40px; width: 100%">
|
||||
<!-- <div style="background: #f2f4f9; height: 40px; width: 100%">
|
||||
<ButtonNav :menus="['按日期', '按规格']" @change="currentMenu">
|
||||
<template v-slot:tab1>
|
||||
<div>按日期</div>
|
||||
@@ -9,7 +9,7 @@
|
||||
<div>按规格</div>
|
||||
</template>
|
||||
</ButtonNav>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="app-container energyOverlimitLog">
|
||||
<div v-show="activeName === 'his'">
|
||||
<!-- 搜索工作栏 -->
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -86,32 +86,36 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'originArea',
|
||||
label: '原片下片面积',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'deepArea',
|
||||
label: '深加工下片面积',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'originPrice',
|
||||
label: '原片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'deepPrice',
|
||||
label: '深加工成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '总成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
@@ -244,19 +248,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
@@ -274,7 +271,7 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
@@ -334,12 +331,19 @@ export default {
|
||||
this.otherMethods(val);
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
let exportURL, title;
|
||||
if (this.activeName === 'his') {
|
||||
exportURL = exportCostSumExcel;
|
||||
title = '总成本统计-按日期';
|
||||
title = '总成本统计';
|
||||
} else {
|
||||
exportURL = exportRawStatisticsRealtimeExcel;
|
||||
title = '总成本统计-按规格';
|
||||
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name||null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.recTime = val.searchTime;
|
||||
this.handleExport();
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'energyTypeName',
|
||||
label: '能源类型',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '监控对象',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
{
|
||||
prop: 'meterName',
|
||||
label: '抄表名',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
// {
|
||||
// prop: 'bindObjectName',
|
||||
// label: '监控对象',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
// {
|
||||
// prop: 'meterName',
|
||||
// label: '抄表名',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '累计使用量',
|
||||
@@ -115,20 +118,24 @@ const tableProps = [
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'energyTypeName',
|
||||
label: '能源类型',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '监控对象',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
{
|
||||
prop: 'meter',
|
||||
label: '抄表名',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
// {
|
||||
// prop: 'bindObjectName',
|
||||
// label: '监控对象',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
// {
|
||||
// prop: 'meter',
|
||||
// label: '抄表名',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '累计使用量',
|
||||
@@ -207,13 +214,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -262,26 +272,18 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.energyTypeId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -292,13 +294,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.energyTypeId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -320,15 +327,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
if (this.listQuery.startTime) {
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'otherCostName',
|
||||
@@ -99,9 +102,14 @@ const tableProps = [
|
||||
prop: 'price',
|
||||
label: '总价(元)',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
// {
|
||||
// prop: 'remark',
|
||||
// label: '备注',
|
||||
// },
|
||||
{
|
||||
prop: 'otherCostName',
|
||||
label: '成本名称',
|
||||
@@ -110,6 +118,7 @@ const tableProps2 = [
|
||||
prop: 'price',
|
||||
label: '总价(元)',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -182,13 +191,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -237,26 +249,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -267,13 +273,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -295,15 +306,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
getRawOthercostSunPage(this.listQuery).then((response) => {
|
||||
|
||||
@@ -65,6 +65,7 @@ const tableProps = [
|
||||
prop: 'price',
|
||||
label: '成本金额',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
@@ -161,7 +162,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name||null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
@@ -174,7 +175,7 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name||null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<span>
|
||||
{{
|
||||
injectData.type == 1
|
||||
? `每天等价,${injectData.price}元`
|
||||
? `每天等价,${Number(injectData.price)}元`
|
||||
: injectData.type == 2
|
||||
? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
||||
? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -85,9 +85,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'productionLineName',
|
||||
@@ -100,22 +103,27 @@ const tableProps = [
|
||||
{
|
||||
prop: 'innum',
|
||||
label: '上片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outnum',
|
||||
label: '下片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'productionLineName',
|
||||
@@ -128,15 +136,17 @@ const tableProps2 = [
|
||||
{
|
||||
prop: 'innum',
|
||||
label: '进片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outnum',
|
||||
label: '出片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -170,13 +180,15 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -225,22 +237,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.productionLineId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
@@ -253,12 +258,12 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.productionLineId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
this.handleExport();
|
||||
break;
|
||||
@@ -309,10 +314,20 @@ export default {
|
||||
this.otherMethods(val);
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
const val = this.activeName === 'his' ? '产线良品率' : 'now';
|
||||
this.currentMenu(val);
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '时间',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
@@ -102,33 +105,42 @@ const tableProps = [
|
||||
{
|
||||
prop: 'inCount',
|
||||
label: '上片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outCount',
|
||||
label: '下片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costSum',
|
||||
label: '深加工成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costPiece',
|
||||
label: '单片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costArea',
|
||||
label: '每平米成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '产线',
|
||||
@@ -140,30 +152,35 @@ const tableProps2 = [
|
||||
{
|
||||
prop: 'inCount',
|
||||
label: '上片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outCount',
|
||||
label: '下片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costSum',
|
||||
label: '深加工成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costPiece',
|
||||
label: '单片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costArea',
|
||||
label: '每平米成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -225,13 +242,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -288,26 +308,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -318,13 +332,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -346,15 +365,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
if (this.listQuery.startTime) {
|
||||
|
||||
423
src/views/cost/index.vue
Normal file
@@ -0,0 +1,423 @@
|
||||
<template>
|
||||
<div class="home-page">
|
||||
<div class="date-tabs">
|
||||
<!-- @tab-click="handleClick" -->
|
||||
<el-tabs v-model="activeName" @tab-click="timedayChange" :stretch="true">
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002日\u2002\u2002'"
|
||||
name="日"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002周\u2002\u2002'"
|
||||
name="周"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002月\u2002\u2002'"
|
||||
name="月"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
:label="'\u2002\u2002年\u2002\u2002'"
|
||||
name="年"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="detail">
|
||||
<el-date-picker
|
||||
v-model="timeday"
|
||||
align="right"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
valueFormat="yyyy-MM-dd"
|
||||
:clearable="false"
|
||||
@change="timedayChange"
|
||||
placeholder="选择日期"
|
||||
:picker-options="pickerOptions"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<el-row class="main-top" :gutter="16">
|
||||
<el-col :span="24" style="position: relative">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="home-produce" />
|
||||
<span class="title-inner">生产总成本</span>
|
||||
</div>
|
||||
<el-row class="box">
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.priceS }}万元</div>
|
||||
<div class="unit-style">总计成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.matPriceS }}万元</div>
|
||||
<div class="unit-style">原料成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.energyPriceS }}万元</div>
|
||||
<div class="unit-style">能源成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.otherPriceS }}万元</div>
|
||||
<div class="unit-style">其他成本</div>
|
||||
</el-col>
|
||||
<!-- <el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.ratioS }}</div>
|
||||
<div class="unit-style">综合良品率/%</div>
|
||||
</el-col> -->
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.areaPriceS }}元</div>
|
||||
<div class="unit-style">综合每平米成本</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" style="position: relative">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="home-produce" />
|
||||
<span class="title-inner">原片成本</span>
|
||||
</div>
|
||||
<el-row class="box">
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.priceO }}万元</div>
|
||||
<div class="unit-style">原片总成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.matPriceO }}万元</div>
|
||||
<div class="unit-style">原料成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.energyPriceO }}万元</div>
|
||||
<div class="unit-style">能源成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.otherPriceO }}万元</div>
|
||||
<div class="unit-style">其他成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.ratioO }}</div>
|
||||
<div class="unit-style">原片良品率/%</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.areaPriceO }}元</div>
|
||||
<div class="unit-style">原片每平米成本</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="24" style="position: relative">
|
||||
<div class="title">
|
||||
<svg-icon icon-class="home-produce" />
|
||||
<span class="title-inner">深加工成本</span>
|
||||
</div>
|
||||
<el-row class="box">
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.priceD }}万元</div>
|
||||
<div class="unit-style">深加工总成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.energyPriceD }}万元</div>
|
||||
<div class="unit-style">能源成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.otherPriceD }}万元</div>
|
||||
<div class="unit-style">其他成本</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.ratioD }}</div>
|
||||
<div class="unit-style">深加工良品率/%</div>
|
||||
</el-col>
|
||||
<el-col :span="4" class="num-box shadow">
|
||||
<div class="num-style">{{ homeData.areaPriceD }}元</div>
|
||||
<div class="unit-style">深加工每平米成本</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row class="main-bottom" :gutter="16" v-if="false">
|
||||
<el-col :span="9">
|
||||
<div class="chart-wrapper">
|
||||
<line-chart :chart-data="lineChartData" />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<div class="chart-wrapper">
|
||||
<pie-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="chart-wrapper">
|
||||
<bar-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div
|
||||
class="main-footer"
|
||||
style="
|
||||
color: #c7c7c7;
|
||||
user-select: none;
|
||||
font-size: 14px;
|
||||
letter-spacing: 1px;
|
||||
height: 30px;
|
||||
display: grid;
|
||||
place-content: center;
|
||||
">
|
||||
© 中建材智能自动化研究院有限公司
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import LineChart from '../dashboard/LineChart';
|
||||
import PieChart from '../dashboard/PieChart';
|
||||
import BarChart from '../dashboard/BarChart';
|
||||
import PanelGroup from '../dashboard/PanelGroup';
|
||||
import { getData } from '@/api/cost/allCost';
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
|
||||
const lineChartData = {
|
||||
newVisitis: {
|
||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 145],
|
||||
},
|
||||
messages: {
|
||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||
actualData: [180, 160, 151, 106, 145, 150, 130],
|
||||
},
|
||||
purchases: {
|
||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||
actualData: [120, 90, 100, 138, 142, 130, 130],
|
||||
},
|
||||
shoppings: {
|
||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||
actualData: [120, 82, 91, 154, 162, 140, 130],
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Home',
|
||||
mixins: [tableHeightMixin],
|
||||
components: {
|
||||
LineChart,
|
||||
PieChart,
|
||||
PanelGroup,
|
||||
BarChart,
|
||||
},
|
||||
computed: {
|
||||
gradientBackground() {
|
||||
return {
|
||||
'background-image':
|
||||
'linear-gradient(90deg, #f0f0f0 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, #f0f0f0 50%, #f0f0f0 75%, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, 0))',
|
||||
'background-size': '100px 100px', // 调整条纹的大小
|
||||
};
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: '日',
|
||||
user: '',
|
||||
lineChartData: lineChartData.newVisitis,
|
||||
homeData: {},
|
||||
timeday: moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD'),
|
||||
startTime:
|
||||
moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD') +
|
||||
' 00:00:00',
|
||||
endTime:
|
||||
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
|
||||
' 00:00:00',
|
||||
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() + 3600 * 1000 * 24 > Date.now();
|
||||
},
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', new Date());
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', date);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '一周前',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', date);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
let listQuery = {
|
||||
//分页
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
|
||||
startTime: this.timeday + ' 00:00:00',
|
||||
};
|
||||
getData(listQuery).then((response) => {
|
||||
this.homeData = response.data;
|
||||
for (let i in this.homeData) {
|
||||
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
|
||||
}
|
||||
});
|
||||
},
|
||||
timedayChange() {
|
||||
let listQuery = {
|
||||
//分页
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
|
||||
startTime: this.timeday + ' 00:00:00',
|
||||
};
|
||||
getData(listQuery).then((response) => {
|
||||
this.homeData = response.data;
|
||||
for (let i in this.homeData) {
|
||||
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
|
||||
}
|
||||
});
|
||||
},
|
||||
goDetail() {
|
||||
this.$router.push({ path: 'indexDetail' });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.home-page::before {
|
||||
background-image: url('~@/assets/img/home-bg.png');
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.date-tabs {
|
||||
padding-left: 40px;
|
||||
padding-top: 20px;
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
:deep(.date-tabs) {
|
||||
.el-tabs__header {
|
||||
margin-bottom: 8px;
|
||||
display: inline-block;
|
||||
transform: translateY(-12px);
|
||||
}
|
||||
|
||||
.el-tabs__content {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0 !important;
|
||||
line-height: 36px !important;
|
||||
height: 36px;
|
||||
}
|
||||
.el-tabs__item.is-active {
|
||||
color: #0b58ff;
|
||||
}
|
||||
}
|
||||
.detail {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
left: 260px;
|
||||
top: 10px;
|
||||
}
|
||||
:deep(.detail) {
|
||||
.el-input__inner {
|
||||
background-color: transparent;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
// .current-date {
|
||||
// color: #fff;
|
||||
// font-size: 18px;
|
||||
// position: absolute;
|
||||
// left: 260px;
|
||||
// top: 14px;
|
||||
// }
|
||||
.current-time {
|
||||
color: #fff;
|
||||
font-size: 18px;
|
||||
position: absolute;
|
||||
right: 38px;
|
||||
top: 14px;
|
||||
}
|
||||
.main-top {
|
||||
width: 100%;
|
||||
padding: 0 20px 0 40px;
|
||||
.title {
|
||||
position: absolute;
|
||||
left: 34px;
|
||||
top: 20px;
|
||||
width: 180px;
|
||||
font-size: 32px;
|
||||
z-index: 10;
|
||||
.title-inner {
|
||||
position: absolute;
|
||||
left: 42px;
|
||||
top: 5px;
|
||||
font-size: calc(100vw * 20 / 1920);
|
||||
}
|
||||
}
|
||||
.box {
|
||||
background-color: #fff;
|
||||
border-radius: 24px;
|
||||
height: 192px;
|
||||
padding: 40px 24px 32px 24px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 8px 8px 0 gray;
|
||||
.num-box {
|
||||
height: 120px;
|
||||
padding-top: 26px;
|
||||
text-align: center;
|
||||
.num-style {
|
||||
color: #000;
|
||||
font-size: calc(100vw * 40 / 1920);
|
||||
}
|
||||
.unit-style {
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
font-size: calc(100vw * 18 / 1920);
|
||||
}
|
||||
}
|
||||
.shadow {
|
||||
background: linear-gradient(90deg, #ffffff 80%, #f2f4f9 100%);
|
||||
}
|
||||
}
|
||||
}
|
||||
.main-bottom {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
.chart-wrapper {
|
||||
margin-left: 10px;
|
||||
height: 425px;
|
||||
background: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 3px 3px 0 gray;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.home-page {
|
||||
.el-progress-bar__inner {
|
||||
background-image: url('~@/assets/img/home-progress-bg.png');
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
199
src/views/cost/indexDetail.vue
Normal file
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps1"
|
||||
:page="1"
|
||||
:limit="100"
|
||||
:table-data="tableData1"></base-table>
|
||||
<base-table
|
||||
:table-props="tableProps2"
|
||||
:page="1"
|
||||
:limit="100"
|
||||
:table-data="tableData2"></base-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDetailData } from '@/api/cost/allCost';
|
||||
import moment from 'moment';
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '成本项目-原片',
|
||||
},
|
||||
{
|
||||
prop: 'f1',
|
||||
label: '本期领用',
|
||||
children: [
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '数量',
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '单价',
|
||||
},
|
||||
{
|
||||
prop: 'sumPrice',
|
||||
label: '金额',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
prop: 'sprice',
|
||||
label: '单位成本',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '成本项目-加工',
|
||||
},
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '耗用数量',
|
||||
},
|
||||
{
|
||||
prop: 'price',
|
||||
label: '平均耗用单价',
|
||||
},
|
||||
{
|
||||
prop: 'sumPrice',
|
||||
label: '总成本',
|
||||
},
|
||||
{
|
||||
prop: 'sprice',
|
||||
label: '综合单位成本',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableProps1,
|
||||
tableData1: [],
|
||||
tableProps2,
|
||||
tableData2: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
statisticType: 1,
|
||||
},
|
||||
activeName: '日',
|
||||
startTime:
|
||||
moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD') +
|
||||
' 00:00:00',
|
||||
endTime:
|
||||
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
|
||||
' 00:00:00',
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '维度',
|
||||
selectOptions: [
|
||||
{ id: 1, name: '日' },
|
||||
{ id: 2, name: '周' },
|
||||
{ id: 3, name: '月' },
|
||||
{ id: 4, name: '年' },
|
||||
],
|
||||
param: 'statisticType',
|
||||
defaultSelect: 1, // 默认值,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
// 日期选择
|
||||
type: 'datePicker',
|
||||
// label: '日期',
|
||||
dateType: 'date',
|
||||
placeholder: '选择日期',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
param: 'timeday',
|
||||
clearable: false,
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return (time.getTime()+ 3600 * 1000 * 24) > Date.now();
|
||||
},
|
||||
shortcuts: [
|
||||
{
|
||||
text: '今天',
|
||||
onClick(picker) {
|
||||
picker.$emit('pick', new Date());
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', date);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '一周前',
|
||||
onClick(picker) {
|
||||
const date = new Date();
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', date);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '返回首页',
|
||||
name: 'back',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
this.listQuery.startTime = this.startTime;
|
||||
this.$refs.searchBarForm.formInline.timeday = this.startTime.substr(0, 10)
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
getDetailData(this.listQuery).then((response) => {
|
||||
this.tableData1 = response.data.odata;
|
||||
this.tableData2 = response.data.ddata;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
console.log(val.timeday)
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.timeday
|
||||
? val.timeday + ' 00:00:00'
|
||||
: null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'back':
|
||||
this.$router.go(-1)
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name||null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.recTime = val.searchTime;
|
||||
this.handleExport();
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'energyTypeName',
|
||||
label: '能源类型',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '监控对象',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
{
|
||||
prop: 'meterName',
|
||||
label: '抄表名',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
// {
|
||||
// prop: 'bindObjectName',
|
||||
// label: '监控对象',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
// {
|
||||
// prop: 'meterName',
|
||||
// label: '抄表名',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '累计使用量',
|
||||
@@ -115,20 +118,24 @@ const tableProps = [
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'energyTypeName',
|
||||
label: '能源类型',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '监控对象',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
{
|
||||
prop: 'meter',
|
||||
label: '抄表名',
|
||||
filter: (val) => (val != null ? val : '--'),
|
||||
},
|
||||
// {
|
||||
// prop: 'bindObjectName',
|
||||
// label: '监控对象',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
// {
|
||||
// prop: 'meter',
|
||||
// label: '抄表名',
|
||||
// filter: (val) => (val != null ? val : '--'),
|
||||
// },
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '累计使用量',
|
||||
@@ -207,13 +214,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -237,10 +247,11 @@ export default {
|
||||
activeName: 'his',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
tableBtn: [{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
@@ -262,26 +273,18 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.energyTypeId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -292,13 +295,16 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.energyTypeId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -320,15 +326,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList() {
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
if (this.listQuery.startTime) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-05 15:34:28
|
||||
* @LastEditTime: 2024-12-27 09:18:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -22,7 +22,7 @@
|
||||
placeholder="请输入原料名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="单价" prop="matPrice">
|
||||
<el-input
|
||||
v-model="dataForm.matPrice"
|
||||
@@ -31,7 +31,7 @@
|
||||
placeholder="请输入单价" />
|
||||
(元/吨)
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="累计用量" prop="quantity">
|
||||
<el-input-number
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'materialName',
|
||||
@@ -97,13 +100,13 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '累计使用量(吨)',
|
||||
},
|
||||
{
|
||||
prop: 'matPrice',
|
||||
label: '单价(元/吨)',
|
||||
align: 'right',
|
||||
label: '累计使用量(千克)',
|
||||
},
|
||||
// {
|
||||
// prop: 'matPrice',
|
||||
// label: '单价(元/千克)',
|
||||
// align: 'right',
|
||||
// },
|
||||
{
|
||||
prop: 'price',
|
||||
label: '总价(元)',
|
||||
@@ -111,6 +114,10 @@ const tableProps = [
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
// {
|
||||
// prop: 'remark',
|
||||
// label: '备注',
|
||||
// },
|
||||
{
|
||||
prop: 'materialName',
|
||||
label: '原料名称',
|
||||
@@ -123,13 +130,13 @@ const tableProps2 = [
|
||||
},
|
||||
{
|
||||
prop: 'quantity',
|
||||
label: '累计使用量(吨)',
|
||||
},
|
||||
{
|
||||
prop: 'materialPrice',
|
||||
label: '单价(元/吨)',
|
||||
align: 'right',
|
||||
label: '累计使用量(千克)',
|
||||
},
|
||||
// {
|
||||
// prop: 'materialPrice',
|
||||
// label: '单价(元/千克)',
|
||||
// align: 'right',
|
||||
// },
|
||||
{
|
||||
prop: 'price',
|
||||
label: '总价(元)',
|
||||
@@ -204,13 +211,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -234,10 +244,11 @@ export default {
|
||||
activeName: 'his',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
tableBtn: [{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
@@ -259,26 +270,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.materialId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -289,13 +294,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.materialId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -317,15 +327,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList() {
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
if (this.listQuery.startTime) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-09-05 15:33:16
|
||||
* @LastEditTime: 2025-06-13 10:59:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -15,7 +15,9 @@
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产线" prop="bindObjectName">
|
||||
<el-form-item
|
||||
:label="activeName === 'his' ? '产线' : '工段'"
|
||||
prop="bindObjectName">
|
||||
<el-input
|
||||
style="width: 100%"
|
||||
v-model="dataForm.bindObjectName"
|
||||
@@ -33,7 +35,7 @@
|
||||
placeholder="选择所属日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName === 'his'">
|
||||
<el-form-item label="厚度" prop="thick">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
@@ -43,7 +45,7 @@
|
||||
placeholder="请输入厚度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName === 'his'">
|
||||
<el-form-item label="在线速度" prop="speed">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
@@ -53,7 +55,7 @@
|
||||
placeholder="请输入在线速度" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" v-if="activeName === 'his'">
|
||||
<el-form-item label="掰边宽度" prop="width">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
@@ -64,25 +66,27 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="拉引量" prop="inArea">
|
||||
<el-form-item
|
||||
:label="activeName === 'his' ? '拉引量' : '进片数'"
|
||||
prop="inArea">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
style="width: 85%"
|
||||
v-model="dataForm.inArea"
|
||||
clearable
|
||||
placeholder="请输入拉引量" />
|
||||
(m²)
|
||||
clearable />
|
||||
{{ activeName === 'his' ? '(m²)' : '片' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="下片面积" prop="outArea">
|
||||
<el-form-item
|
||||
:label="activeName === 'his' ? '下片面积' : '出片数'"
|
||||
prop="outArea">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
style="width: 85%"
|
||||
v-model="dataForm.outArea"
|
||||
clearable
|
||||
placeholder="请输入下片面积" />
|
||||
(m²)
|
||||
clearable />
|
||||
{{ activeName === 'his' ? '(m²)' : '片' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -129,10 +133,12 @@ export default {
|
||||
recTime: undefined,
|
||||
},
|
||||
dataRule: {},
|
||||
activeName: 'his',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(val, statisticType) {
|
||||
init(val, statisticType, activeName) {
|
||||
this.activeName = activeName;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
@@ -148,17 +154,22 @@ export default {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
const udata = {
|
||||
let udata = {
|
||||
id: this.dataForm.id,
|
||||
statisticType: this.dataForm.statisticType,
|
||||
modifyThick: this.dataForm.thick,
|
||||
modifySpeed: this.dataForm.speed,
|
||||
modifyWidth: this.dataForm.width,
|
||||
modifyInArea: this.dataForm.inArea,
|
||||
modifyOutArea: this.dataForm.outArea,
|
||||
modifyRatio:
|
||||
this.dataForm.ratio >= 0 ? this.dataForm.ratio / 100 : '',
|
||||
};
|
||||
if (this.activeName === 'his') {
|
||||
udata = {
|
||||
...udata,
|
||||
modifyThick: this.dataForm.thick,
|
||||
modifySpeed: this.dataForm.speed,
|
||||
modifyWidth: this.dataForm.width,
|
||||
};
|
||||
}
|
||||
// 修改的提交
|
||||
this.urlOptions.updateURL(udata).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
|
||||
@@ -1,42 +1,71 @@
|
||||
<template>
|
||||
<div class="app-container energyOverlimitLog">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<base-table
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
:name-arr="formConfig[1].selectOptions"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
<div>
|
||||
<div style="background: #f2f4f9; height: 40px; width: 100%">
|
||||
<ButtonNav :menus="['产线良品率', '工段良品率']" @change="currentMenu">
|
||||
<template v-slot:tab1>
|
||||
<div>产线良品率</div>
|
||||
</template>
|
||||
<template v-slot:tab2>
|
||||
<div>工段良品率</div>
|
||||
</template>
|
||||
</ButtonNav>
|
||||
</div>
|
||||
<div class="app-container energyOverlimitLog">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<!-- 列表 -->
|
||||
<div v-if="activeName === 'his'">
|
||||
<base-table
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
<div v-if="activeName === 'now'">
|
||||
<base-table
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="tableData2"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
</div>
|
||||
<pagination
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
:name-arr="formConfig[1].selectOptions"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -44,16 +73,27 @@
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { getLinePage } from '@/api/base/productionLine';
|
||||
import { getcostOriginRatioHisPage,exportcostOriginRatioHisExcel } from '@/api/cost/costOriginRatioHis';
|
||||
import {
|
||||
getcostOriginRatioHisPage,
|
||||
getcostOriginWSRatioHisPage,
|
||||
exportcostOriginWSRatioHisExcel,
|
||||
exportcostOriginRatioHisExcel,
|
||||
} from '@/api/cost/costOriginRatioHis';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
width:130,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '产线',
|
||||
@@ -62,27 +102,67 @@ const tableProps = [
|
||||
{
|
||||
prop: 'thick',
|
||||
label: '厚度',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(1) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'speed',
|
||||
label: '在线速度',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'width',
|
||||
label: '掰边宽度',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'inArea',
|
||||
label: '拉引量/m²',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outArea',
|
||||
label: '下片面积/m²',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
width:130,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '工段',
|
||||
width:145,
|
||||
},
|
||||
{
|
||||
prop: 'spec',
|
||||
label: '规格',
|
||||
},
|
||||
{
|
||||
prop: 'inArea',
|
||||
label: '进片数',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outArea',
|
||||
label: '出片数',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -116,13 +196,15 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -143,23 +225,27 @@ export default {
|
||||
listQuery: {
|
||||
statisticType: 1,
|
||||
},
|
||||
activeName: 'his',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
tableBtn: [{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
tableData2: [],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
ButtonNav,
|
||||
},
|
||||
created() {
|
||||
const params ={
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
pdType: 1
|
||||
pdType: 0
|
||||
}
|
||||
getLinePage(params).then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data.list;
|
||||
@@ -167,36 +253,33 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
this.getDataList();
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
this.handleExport();
|
||||
break;
|
||||
@@ -204,23 +287,74 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
currentMenu(val) {
|
||||
this.activeName = val === '产线良品率' ? 'his' : 'now';
|
||||
if (this.activeName === 'his') {
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery.bindObjectId = null;
|
||||
this.listQuery.startTime = null;
|
||||
this.listQuery.endTime = null;
|
||||
this.listQuery.statisticType = 1;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery.bindObjectId = null;
|
||||
this.listQuery.startTime = null;
|
||||
this.listQuery.endTime = null;
|
||||
this.listQuery.statisticType = 1;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
getcostOriginWSRatioHisPage(this.listQuery).then((response) => {
|
||||
this.tableData2 = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === 'edit') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data, this.listQuery.statisticType);
|
||||
this.$refs.addOrUpdate.init(
|
||||
val.data,
|
||||
this.listQuery.statisticType,
|
||||
this.activeName
|
||||
);
|
||||
});
|
||||
} else {
|
||||
this.otherMethods(val);
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
let exportURL, title;
|
||||
if (this.activeName === 'his') {
|
||||
exportURL = exportcostOriginRatioHisExcel;
|
||||
title = '原片成本-原片良品率';
|
||||
title = '原片-产线良品率';
|
||||
} else {
|
||||
exportURL = exportcostOriginWSRatioHisExcel;
|
||||
title = '原片-工段良品率';
|
||||
}
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'otherCostName',
|
||||
@@ -102,6 +105,10 @@ const tableProps = [
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
// {
|
||||
// prop: 'remark',
|
||||
// label: '备注',
|
||||
// },
|
||||
{
|
||||
prop: 'otherCostName',
|
||||
label: '成本名称',
|
||||
@@ -182,13 +189,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -237,24 +247,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -265,13 +271,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -297,6 +308,13 @@ export default {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
getRawOthercostSunPage(this.listQuery).then((response) => {
|
||||
|
||||
@@ -65,6 +65,7 @@ const tableProps = [
|
||||
prop: 'price',
|
||||
label: '成本金额',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
@@ -161,7 +162,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name||null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
@@ -174,7 +175,7 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.name = val.name||null;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-12-05 13:45:59
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-04-15 17:12:03
|
||||
* @LastEditTime: 2024-12-25 16:20:38
|
||||
* @Description
|
||||
-->
|
||||
<template>
|
||||
@@ -10,9 +10,9 @@
|
||||
<span>
|
||||
{{
|
||||
injectData.type == 1
|
||||
? `每天等价,${injectData.price}元`
|
||||
? `每天等价,${Number(injectData.price)}元`
|
||||
: injectData.type == 2
|
||||
? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
||||
? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
||||
: '-'
|
||||
}}
|
||||
</span>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
@pagination="getNavDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'recTime',
|
||||
prop: 'time',
|
||||
label: '时间',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
@@ -98,32 +101,41 @@ const tableProps = [
|
||||
{
|
||||
prop: 'thick',
|
||||
label: '厚度',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(1) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'inArea',
|
||||
label: '拉引量/m²',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outArea',
|
||||
label: '下片面积/m²',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costSum',
|
||||
label: '原片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costArea',
|
||||
label: '每平米成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '产线',
|
||||
@@ -135,34 +147,40 @@ const tableProps2 = [
|
||||
{
|
||||
prop: 'inArea',
|
||||
label: '拉引量/m²',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outArea',
|
||||
label: '下片面积/m²',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'outCount',
|
||||
label: '下片数量',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'ratio',
|
||||
label: '良品率',
|
||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
||||
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costSum',
|
||||
label: '原片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costPiece',
|
||||
label: '单片成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
{
|
||||
prop: 'costArea',
|
||||
label: '每平米成本/元',
|
||||
align: 'right',
|
||||
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -224,13 +242,16 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间范围',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
defaultTime: ['08:30:00', '08:30:00'],
|
||||
param: 'searchTime',
|
||||
width: 350,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -287,26 +308,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
if (val.statisticType === 2) {
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年第{w}周');
|
||||
}else{
|
||||
this.tableProps[0].filter = (val) =>
|
||||
parseTime(val, '{y}年{m}月{d}日');
|
||||
}
|
||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
@@ -317,13 +332,18 @@ export default {
|
||||
break;
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
? val.searchTime[1]
|
||||
: null;
|
||||
if (this.activeName === 'his') {
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
: null;
|
||||
}
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
@@ -345,15 +365,26 @@ export default {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
||||
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
|
||||
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
|
||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||
this.listQuery.startTime,
|
||||
this.listQuery.endTime,
|
||||
];
|
||||
});
|
||||
this.listQuery.name = null;
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
getNavDataList(){
|
||||
if (this.activeName === 'his') {
|
||||
this.getDataList();
|
||||
} else {
|
||||
this.getDataList2();
|
||||
}
|
||||
},
|
||||
// 获取数据2列表
|
||||
getDataList2() {
|
||||
if (this.listQuery.startTime) {
|
||||
|
||||
83
src/views/group/Calendar/holidayLog.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-23 13:43:55
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-23 16:50:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div v-for="item in groupClassArr" :key="item.planId">
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
{{item.planName}}
|
||||
</small-title>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:table-data="
|
||||
tableData.filter((titem) => titem.schedulingPlanId == item.planId)
|
||||
"></base-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SmallTitle from '../Schedule/SmallTitle';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'classesName',
|
||||
label: '班次名称',
|
||||
},
|
||||
{
|
||||
prop: 'workTime',
|
||||
label: '班次时间',
|
||||
},
|
||||
{
|
||||
prop: 'teamName',
|
||||
label: '班组名称',
|
||||
},
|
||||
{
|
||||
prop: 'teamLeader',
|
||||
label: '组长',
|
||||
},
|
||||
{
|
||||
prop: 'teamLeaderPhone',
|
||||
label: '组长电话',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SmallTitle,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
tableData: [],
|
||||
groupClassArr: [],
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
init(det) {
|
||||
this.tableData = det;
|
||||
//返回计划名和id
|
||||
const arr = det.map((item) => {
|
||||
const obj = {
|
||||
planName: item.schedulingPlanName,
|
||||
planId: item.schedulingPlanId,
|
||||
};
|
||||
return obj;
|
||||
});
|
||||
//去重
|
||||
const map = new Map();
|
||||
arr.forEach((item) => {
|
||||
if (!map.has(item.planId)) {
|
||||
map.set(item.planId, item);
|
||||
}
|
||||
});
|
||||
this.groupClassArr = Array.from(map.values());
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
567
src/views/group/Calendar/index.vue
Normal file
@@ -0,0 +1,567 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-23 13:43:55
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-24 11:14:55
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-row :gutter="10" style="background-color: #f2f4f9">
|
||||
<!--部门数据-->
|
||||
<el-col :span="4">
|
||||
<div class="head-container">
|
||||
<el-tabs v-model="activeName" stretch @tab-click="tabsClick">
|
||||
<el-tab-pane label="部门" name="first"></el-tab-pane>
|
||||
<el-tab-pane label="班组" name="second"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div v-if="activeName == 'first'">
|
||||
<el-input
|
||||
v-model="deptName"
|
||||
placeholder="请输入部门名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px" />
|
||||
<el-tree
|
||||
:data="deptOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
@node-click="handleNodeClick" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-input
|
||||
v-model="groupName"
|
||||
placeholder="请输入班组名称"
|
||||
clearable
|
||||
size="small"
|
||||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px" />
|
||||
<el-tree
|
||||
:data="groupOptions"
|
||||
:props="defaultProps"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree1"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
@node-click="handleNodeClick1" />
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<div class="groupTeamScheduling">
|
||||
<div class="operationArea">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="月份选择">
|
||||
<el-date-picker
|
||||
v-model="startDay"
|
||||
type="month"
|
||||
placeholder="选择月"
|
||||
size="small"
|
||||
@change="selectMonth"
|
||||
:clearable="false"
|
||||
style="width: 120px"></el-date-picker>
|
||||
<span
|
||||
style="color: #909399; font-size: 12px"
|
||||
v-if="activeName == 'first'">
|
||||
提示:排班日历仅展示当前选中部门的节假日设置,若休假日中仍有排班,则表示下级组织已通过自定义假期进行排班。
|
||||
</span>
|
||||
<span v-else>
|
||||
组长:{{ showTeamName?.leaderName || '-' }} 组长电话:{{
|
||||
showTeamName?.leaderPhone || '-'
|
||||
}}
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right">
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="(startDay = new Date()), getHolidayPage()">
|
||||
跳转到今天
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 日历区域 -->
|
||||
<div class="calenderArea">
|
||||
<el-calendar v-model="startDay">
|
||||
<template slot="dateCell" slot-scope="{ data }">
|
||||
<div v-if="data.type === 'current-month'">
|
||||
<!-- 日期 -->
|
||||
<div class="dateStyle">
|
||||
<el-row :gutter="20">
|
||||
<!-- 公历和农历 -->
|
||||
<el-col :span="18">
|
||||
{{ Number(data.day.split('-')[2]) }}
|
||||
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
|
||||
</el-col>
|
||||
<!-- 显示假或班 -->
|
||||
<el-col :span="6">
|
||||
<div
|
||||
class="work-tip"
|
||||
:style="{
|
||||
backgroundColor: HolidayList[
|
||||
Number(data.day.split('-')[2]) - 1
|
||||
]?.isHoliday
|
||||
? '#67C23A'
|
||||
: '#409EFF',
|
||||
}">
|
||||
{{
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.isHoliday
|
||||
? '假'
|
||||
: '班'
|
||||
}}
|
||||
<!-- //变更节假日未更新排班计划的角标 -->
|
||||
<div
|
||||
class="subIcon"
|
||||
v-if="
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.isUpdate
|
||||
">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="本日节假日变更已影响当前排班计划,但尚未同步,请及时处理。"
|
||||
placement="top">
|
||||
<i
|
||||
class="el-icon-warning"
|
||||
style="color: #f56c6c"></i>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 显示排班 -->
|
||||
<div
|
||||
v-if="
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]?.det
|
||||
.length > 0
|
||||
">
|
||||
<el-col
|
||||
:span="24"
|
||||
v-for="(item, index) in HolidayList[
|
||||
Number(data.day.split('-')[2]) - 1
|
||||
]?.det.filter(
|
||||
(item) =>
|
||||
item.schedulingPlanId ==
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.schedulingPlanId
|
||||
)"
|
||||
:key="index">
|
||||
<el-tooltip
|
||||
effect="dark"
|
||||
content="点击展示全部排班计划"
|
||||
placement="top-start">
|
||||
<div
|
||||
class="holiday-div"
|
||||
:style="{
|
||||
backgroundColor:
|
||||
holidayDivColor[item?.classesCode],
|
||||
}"
|
||||
@click="
|
||||
holidayLog(
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.det,
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.date
|
||||
)
|
||||
"
|
||||
:title="
|
||||
item.classesName +
|
||||
' | ' +
|
||||
item.teamName +
|
||||
' | ' +
|
||||
item.workTime
|
||||
">
|
||||
{{
|
||||
item.classesName +
|
||||
' | ' +
|
||||
item.teamName +
|
||||
' | ' +
|
||||
item.workTime
|
||||
}}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
style="font-size: 20px; font-weight: 500; text-align: left">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
{{ Number(data.day.split('-')[2]) }}
|
||||
<span style="font-size: 12px">
|
||||
{{ getLunarDate(data.day) }}
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
</el-calendar>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<base-dialog
|
||||
:dialogTitle="dialogTitle"
|
||||
:dialogVisible="logVisible"
|
||||
@cancel="cancelLog"
|
||||
:before-close="cancelLog"
|
||||
:destroy-on-close="true"
|
||||
width="70%">
|
||||
<holiday-log ref="holidayLogRef"></holiday-log>
|
||||
<template #footer>
|
||||
<slot name="footer">
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="24">
|
||||
<el-button size="small" class="btnTextStyle" @click="cancelLog">
|
||||
取消
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</slot>
|
||||
</template>
|
||||
</base-dialog>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import { solarToLunar } from 'chinese-lunar';
|
||||
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
import { listByDeptId } from '@/api/group/Schedule';
|
||||
import { getEnableData } from '@/api/group/holidaySetting';
|
||||
import {
|
||||
getDeptSchedulingList,
|
||||
getClassSchedulingList,
|
||||
} from '@/api/group/calendar';
|
||||
import holidayLog from './holidayLog';
|
||||
|
||||
export default {
|
||||
name: '',
|
||||
components: {
|
||||
holidayLog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
startDay: '', // 查询参数
|
||||
HolidayList: [],
|
||||
// 选择的部门名称
|
||||
showDeptName: undefined,
|
||||
showTeamName: {},
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
groupOptions: undefined,
|
||||
// 查询的部门名称
|
||||
deptName: undefined,
|
||||
groupName: undefined,
|
||||
|
||||
topDept: {}, // 保存当前用户的部门id为最高级部门id
|
||||
deptId: undefined,
|
||||
teamId: undefined,
|
||||
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name',
|
||||
},
|
||||
logVisible: false,
|
||||
dialogTitle: '',
|
||||
holidayDivColor: ['#67c23a', '#69d983', '#f5c931', '#4fa6f0'],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
groupName(val) {
|
||||
this.$refs.tree1.filter(val);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.startDay = new Date();
|
||||
// 查询用户个人信息
|
||||
getUserProfile().then((response) => {
|
||||
this.showDeptName = response.data.dept.name || '';
|
||||
this.topDept = {
|
||||
name: response.data.dept.name || '',
|
||||
id: response.data.dept.id || '',
|
||||
}; // 保存当前用户的部门为最高级部门id
|
||||
this.deptId = response.data.dept.id || '';
|
||||
this.getHolidayPage();
|
||||
this.getTreeselect();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getHolidayPage() {
|
||||
const now = new Date(this.startDay);
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
const startTime = `${year}-${String(month + 1).padStart(2, '0')}-01`;
|
||||
const lastDate = new Date(year, month + 1, 0).getDate();
|
||||
const endTime = `${year}-${String(month + 1).padStart(2, '0')}-${String(
|
||||
lastDate
|
||||
).padStart(2, '0')}`;
|
||||
|
||||
this.HolidayList = [];
|
||||
if (this.activeName == 'first') {
|
||||
getDeptSchedulingList({
|
||||
deptId: this.deptId,
|
||||
startTime: Date.parse(startTime),
|
||||
endTime: Date.parse(endTime),
|
||||
}).then((res) => {
|
||||
this.HolidayList = res.data;
|
||||
});
|
||||
} else {
|
||||
getClassSchedulingList({
|
||||
teamId: this.teamId,
|
||||
startTime: Date.parse(startTime),
|
||||
endTime: Date.parse(endTime),
|
||||
}).then((res) => {
|
||||
this.HolidayList = res.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
// 切换月份
|
||||
selectMonth() {
|
||||
this.getHolidayPage();
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
getEnableData().then((response) => {
|
||||
// 处理 deptOptions 参数
|
||||
this.deptOptions = [];
|
||||
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||
});
|
||||
listByDeptId(this.topDept.id).then((response) => {
|
||||
this.groupOptions = [];
|
||||
this.groupOptions.push(...response.data);
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
tabsClick() {
|
||||
if (this.activeName == 'second' && this.groupOptions.length > 0) {
|
||||
this.teamId = this.groupOptions[0].id;
|
||||
this.showTeamName = {
|
||||
leaderName: this.groupOptions[0].leaderName || '-',
|
||||
leaderPhone: this.groupOptions[0].leaderPhone || '-',
|
||||
};
|
||||
} else if (this.activeName == 'first') {
|
||||
this.deptId = this.topDept.id;
|
||||
}
|
||||
this.getHolidayPage();
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.deptId = data.id;
|
||||
this.showDeptName = data.name;
|
||||
this.getHolidayPage();
|
||||
},
|
||||
handleNodeClick1(data) {
|
||||
this.teamId = data.id;
|
||||
this.showTeamName = {
|
||||
leaderName: data.leaderName || '-',
|
||||
leaderPhone: data.leaderPhone || '-',
|
||||
};
|
||||
this.getHolidayPage();
|
||||
},
|
||||
//获取农历
|
||||
getLunarDate(solarDate) {
|
||||
try {
|
||||
const [year, month, day] = solarDate.split('-').map(Number);
|
||||
|
||||
const date = new Date(year, month - 1, day);
|
||||
const lunar = solarToLunar(date);
|
||||
|
||||
// 将数字月份和日期转换为中文
|
||||
const monthMap = {
|
||||
1: '正',
|
||||
2: '二',
|
||||
3: '三',
|
||||
4: '四',
|
||||
5: '五',
|
||||
6: '六',
|
||||
7: '七',
|
||||
8: '八',
|
||||
9: '九',
|
||||
10: '十',
|
||||
11: '冬',
|
||||
12: '腊',
|
||||
};
|
||||
|
||||
const dayMap = {
|
||||
1: '初一',
|
||||
2: '初二',
|
||||
3: '初三',
|
||||
4: '初四',
|
||||
5: '初五',
|
||||
6: '初六',
|
||||
7: '初七',
|
||||
8: '初八',
|
||||
9: '初九',
|
||||
10: '初十',
|
||||
11: '十一',
|
||||
12: '十二',
|
||||
13: '十三',
|
||||
14: '十四',
|
||||
15: '十五',
|
||||
16: '十六',
|
||||
17: '十七',
|
||||
18: '十八',
|
||||
19: '十九',
|
||||
20: '二十',
|
||||
21: '廿一',
|
||||
22: '廿二',
|
||||
23: '廿三',
|
||||
24: '廿四',
|
||||
25: '廿五',
|
||||
26: '廿六',
|
||||
27: '廿七',
|
||||
28: '廿八',
|
||||
29: '廿九',
|
||||
30: '三十',
|
||||
};
|
||||
|
||||
// 返回 "三月初四" 格式
|
||||
return `${monthMap[lunar.month]}月${dayMap[lunar.day]}`;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return '';
|
||||
}
|
||||
},
|
||||
holidayLog(det, date) {
|
||||
this.dialogTitle = this.showDeptName + '-' + date + '-排班详情';
|
||||
this.logVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.holidayLogRef.init(det);
|
||||
});
|
||||
},
|
||||
cancelLog() {
|
||||
this.dialogTitle = '';
|
||||
this.logVisible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.head-container {
|
||||
padding: 20px 10px 0;
|
||||
background-color: #fff;
|
||||
min-height: calc(100vh - 120px - 8px);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.groupTeamScheduling {
|
||||
.operationArea {
|
||||
padding: 14px 10px 0 16px;
|
||||
margin-bottom: 8px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
.blue-block {
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.el-form-item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
// 日历
|
||||
.calenderArea {
|
||||
padding: 14px 10px 0 20px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
min-height: calc(100vh - 120px - 8px - 168px);
|
||||
.el-calendar__body {
|
||||
padding: 10px 16px 16px 0;
|
||||
}
|
||||
.el-calendar__header {
|
||||
display: none;
|
||||
}
|
||||
.el-calendar-table > thead {
|
||||
height: 48px;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
background-color: rgba(242, 244, 249, 1);
|
||||
}
|
||||
.el-calendar-table__row {
|
||||
height: 133px;
|
||||
.prev,
|
||||
.next {
|
||||
pointer-events: none;
|
||||
}
|
||||
.is-selected,
|
||||
.is-today {
|
||||
background-color: #e4f0fd;
|
||||
}
|
||||
.el-calendar-day {
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
:hover {
|
||||
background-color: #e4f0fd;
|
||||
}
|
||||
.dateStyle {
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
text-align: left;
|
||||
height: 133px;
|
||||
line-height: 28px;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
|
||||
.lunar-date {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
.work-tip {
|
||||
background: #87c1ff;
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
width: 30px;
|
||||
text-align: center;
|
||||
float: right;
|
||||
position: relative;
|
||||
.subIcon {
|
||||
position: absolute;
|
||||
top: -18px;
|
||||
right: -10px;
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
.holiday-div {
|
||||
background-color: #67c23a;
|
||||
border-radius: 3px;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
line-height: 24px;
|
||||
color: #fff;
|
||||
margin-bottom: 2px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-15 16:47:28
|
||||
* @LastEditTime: 2025-10-29 17:12:04
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -12,6 +12,9 @@
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
ref="groupTableRef"
|
||||
:id="'groupTableSelectRef'"
|
||||
row-key="id"
|
||||
:selectWidth="55"
|
||||
@selection-change="selectChange"
|
||||
:table-props="tableProps"
|
||||
@@ -46,6 +49,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -84,22 +88,52 @@ export default {
|
||||
name: '',
|
||||
},
|
||||
selectedList: [],
|
||||
deptId: undefined
|
||||
selectedArr: [], //已选的班组,从父组件传过来的
|
||||
deptId: undefined,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
init(id){
|
||||
this.deptId = id
|
||||
this.getDataList()
|
||||
},
|
||||
init(id, tableData) {
|
||||
this.deptId = id;
|
||||
this.selectedArr = tableData || [];
|
||||
this.$nextTick(() => {
|
||||
this.getDataList();
|
||||
});
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.urlOptions
|
||||
.getDataListURL(this.deptId)
|
||||
.then((response) => {
|
||||
this.tableData = response.data;
|
||||
this.urlOptions.getDataListURL(this.deptId).then((response) => {
|
||||
this.tableData = response.data;
|
||||
this.$nextTick(() => {
|
||||
if (this.selectedArr.length > 0) {
|
||||
this.setSelectedRows();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
setSelectedRows() {
|
||||
const table = this.$refs.groupTableRef.$children[0];
|
||||
|
||||
// 先清空选择
|
||||
table.clearSelection();
|
||||
|
||||
this.selectedArr.forEach((item) => {
|
||||
const rowInTable = this.tableData.find((i) => i.id === item.id);
|
||||
if (rowInTable) {
|
||||
//这里一定要用table.tableData,这样才是指向同一个数组
|
||||
this.$set(table.store.states, 'selection', [
|
||||
...table.store.states.selection,
|
||||
table.tableData.find((i) => i.id === item.id),
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
// 强制更新视图
|
||||
this.$nextTick(() => {
|
||||
table.$forceUpdate();
|
||||
this.$forceUpdate();
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
@@ -115,9 +149,25 @@ export default {
|
||||
selectChange(val) {
|
||||
this.selectedList = val;
|
||||
},
|
||||
// 判断两个数组是否有重复的 id
|
||||
hasDuplicateIds(arr1, arr2) {
|
||||
const idSet = new Set(arr1.map((item) => item.id));
|
||||
return arr2.some((item) => idSet.has(item.id));
|
||||
},
|
||||
|
||||
dataFormSubmit() {
|
||||
if (this.selectedList && this.selectedList.length > 0) {
|
||||
const haveData = this.hasDuplicateIds(
|
||||
this.selectedArr,
|
||||
this.selectedList
|
||||
);
|
||||
if (haveData) {
|
||||
this.$message('请不要重复添加数组');
|
||||
return;
|
||||
}
|
||||
this.$emit('refreshTableData', this.selectedList);
|
||||
} else if (this.selectedArr.length > 0) {
|
||||
this.$message('请不要重复添加数组');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 15:07:24
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-17 17:01:35
|
||||
* @LastEditTime: 2025-10-29 15:28:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -111,20 +111,12 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="6" v-if="dataForm.shiftType>1">
|
||||
<el-form-item label="同班次连排" prop="shiftSustainedNum">
|
||||
<el-input
|
||||
v-model="dataForm.shiftSustainedNum"
|
||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
||||
<el-select
|
||||
style="width: 80px"
|
||||
v-model="dataForm.shiftSustainedType"
|
||||
slot="append">
|
||||
<el-option label="日" :value="1"></el-option>
|
||||
<el-option label="周" :value="2"></el-option>
|
||||
<el-option label="月" :value="3"></el-option>
|
||||
<el-option label="季" :value="4"></el-option>
|
||||
</el-select>
|
||||
<span slot="append">日</span>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -176,7 +168,10 @@
|
||||
</base-table>
|
||||
</div>
|
||||
<div v-if="stepNum == 3">
|
||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||
<small-title
|
||||
style="margin: 16px 0; font-size: 16px"
|
||||
size="de"
|
||||
:no-padding="true">
|
||||
排班计划预览
|
||||
<span style="font-size: 14px; color: #ff1c15">
|
||||
系统将根据以下设置,按班组轮班顺序依次循环每日班次,生成正式排班计划,请确认。
|
||||
@@ -263,12 +258,38 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<small-title
|
||||
style="margin: 16px 0; font-size: 16px"
|
||||
size="de"
|
||||
:no-padding="true">
|
||||
预览周期
|
||||
<span>
|
||||
<el-select
|
||||
style="height: 20px"
|
||||
v-model="period"
|
||||
size="mini"
|
||||
@change="setPeriod"
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in periodArr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</span>
|
||||
</small-title>
|
||||
|
||||
<base-table
|
||||
v-if="tableProps3.length > 0"
|
||||
:table-props="tableProps3"
|
||||
:table-data="tableData3"></base-table>
|
||||
</div>
|
||||
<base-dialog
|
||||
:dialogTitle="'修改班次'"
|
||||
:dialogVisible="addOrUpdateVisible1"
|
||||
@cancel="cancel1"
|
||||
@confirm="handleConfirm1"
|
||||
:before-close="cancel1"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="40%">
|
||||
@@ -281,6 +302,7 @@
|
||||
:dialogVisible="addOrUpdateVisible2"
|
||||
@cancel="cancel2"
|
||||
@confirm="handleConfirm2"
|
||||
:before-close="cancel2"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="40%">
|
||||
@@ -293,6 +315,7 @@
|
||||
:dialogVisible="addOrUpdateVisible3"
|
||||
@cancel="cancel3"
|
||||
@confirm="handleConfirm3"
|
||||
:before-close="cancel3"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="50%">
|
||||
@@ -306,11 +329,24 @@
|
||||
<script>
|
||||
import deptSelect from './../deptSelect.vue';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import propfirstSpan from './propfirstSpan.vue';
|
||||
import propSpan from './propSpan.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import editClass from './edit-class.vue';
|
||||
import addGroup from './add-group.vue';
|
||||
import bindLine from './bind-line.vue';
|
||||
import { getCode, createStepOne, returnStepOne } from '@/api/group/Schedule';
|
||||
import {
|
||||
getCode,
|
||||
createStepOne,
|
||||
returnStepOne,
|
||||
createStepTwo,
|
||||
returnStepTwo,
|
||||
getPerView,
|
||||
draftEditing,
|
||||
cancelStepThree,
|
||||
checkPlan,
|
||||
createStepFour,
|
||||
} from '@/api/group/Schedule';
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
@@ -318,18 +354,18 @@ const tableProps1 = [
|
||||
label: '班次名称',
|
||||
},
|
||||
{
|
||||
prop: 'startDay',
|
||||
prop: 'startTime',
|
||||
label: '开始时间',
|
||||
// filter: (val) => {
|
||||
// parseTime(val, '{H}:{mm}');
|
||||
// },
|
||||
filter: (val) => {
|
||||
return val ? val.slice(0, -3) : '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'endDay',
|
||||
prop: 'endTime',
|
||||
label: '结束时间',
|
||||
// filter: (val) => {
|
||||
// parseTime(val, '{H}:{mm}');
|
||||
// },
|
||||
filter: (val) => {
|
||||
return val ? val.slice(0, -3) : '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
@@ -356,8 +392,9 @@ const tableProps2 = [
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'code1',
|
||||
prop: 'lineName',
|
||||
label: '产线及工段',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -368,6 +405,8 @@ export default {
|
||||
editClass,
|
||||
addGroup,
|
||||
bindLine,
|
||||
propfirstSpan,
|
||||
propSpan,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -383,6 +422,7 @@ export default {
|
||||
},
|
||||
],
|
||||
stepNum: 1, // 当前第几步
|
||||
shiftTypeEdit: undefined, //该值为编辑时获取的shiftType,到第二步,判断dataForm.shiftType是否改变,同时改变班次信息
|
||||
//第一步参数
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
@@ -474,6 +514,16 @@ export default {
|
||||
{
|
||||
type: 'bind',
|
||||
btnName: '绑定产线',
|
||||
showParam: {
|
||||
type: '&',
|
||||
data: [
|
||||
{
|
||||
type: 'equal',
|
||||
name: 'isProduction',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
@@ -527,41 +577,55 @@ export default {
|
||||
class2: 'B',
|
||||
},
|
||||
],
|
||||
period: 7, //预览周期
|
||||
periodArr: [
|
||||
{
|
||||
value: 7,
|
||||
label: '7天',
|
||||
},
|
||||
{
|
||||
value: 14,
|
||||
label: '14天',
|
||||
},
|
||||
{
|
||||
value: 30,
|
||||
label: '30天',
|
||||
},
|
||||
],
|
||||
tableProps3: [],
|
||||
tableData3: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//子组件获取的部门id
|
||||
setDeptId(val) {
|
||||
this.dataForm.deptId = val;
|
||||
},
|
||||
//详情时传给子组件的部门id
|
||||
setDataForm() {
|
||||
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||
},
|
||||
init() {
|
||||
init(id) {
|
||||
this.dataForm.id = id || undefined;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
getCode().then((res) => {
|
||||
this.dataForm.code = res.data;
|
||||
});
|
||||
if (this.dataForm.id) {
|
||||
draftEditing(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data?.stepOne;
|
||||
this.shiftTypeEdit = res.data?.stepOne.shiftType;
|
||||
this.setDataForm();
|
||||
this.tableData1 = res.data?.stepTwo.groupPlanClassesBaseVOList;
|
||||
this.tableData2 = res.data?.stepTwo.groupPlanTeamBaseVOList;
|
||||
this.tableData2.forEach((item, index) => {
|
||||
let lineName = '';
|
||||
lineName = this.setLineName(item.bindLineTree, lineName);
|
||||
this.$set(
|
||||
this.tableData2[index],
|
||||
'lineName',
|
||||
lineName.slice(0, -1)
|
||||
);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
getCode().then((res) => {
|
||||
this.dataForm.code = res.data;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClick1(val) {
|
||||
this.addOrUpdateVisible1 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.editClassRef.init(val.data);
|
||||
});
|
||||
},
|
||||
handleClick2(val) {
|
||||
if (val.type === 'bind') {
|
||||
this.addOrUpdateVisible3 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.bindLineRef.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === 'delete') {
|
||||
this.tableData2.splice(val.data._pageIndex - 1, 1);
|
||||
}
|
||||
},
|
||||
//上一步
|
||||
upSubmit() {
|
||||
if (this.stepNum == 2) {
|
||||
returnStepOne(this.dataForm.id).then((res) => {
|
||||
@@ -571,8 +635,14 @@ export default {
|
||||
this.setDataForm();
|
||||
});
|
||||
});
|
||||
} else if (this.stepNum == 3) {
|
||||
returnStepTwo(this.dataForm.id).then((res) => {
|
||||
this.stepNum -= 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
});
|
||||
}
|
||||
},
|
||||
//下一步
|
||||
nextSubmit() {
|
||||
if (this.stepNum == 1) {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
@@ -584,99 +654,216 @@ export default {
|
||||
this.$message('部门不能为空');
|
||||
return;
|
||||
}
|
||||
const compareDate = this.compareDates(this.dataForm.startDay,this.dataForm.endDay)
|
||||
|
||||
if (compareDate > 0 ) {
|
||||
this.$message('开始时间不能大于结束时间');
|
||||
return;
|
||||
}
|
||||
createStepOne(this.dataForm).then((res) => {
|
||||
this.dataForm.id = res.data;
|
||||
if (!this.dataForm.id) {
|
||||
this.dataForm.id = res.data;
|
||||
}
|
||||
this.stepNum += 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
this.setTWOclass(); // 第一步提交后,根据倒班方式设置第二部班次
|
||||
if (
|
||||
!this.dataForm.id ||
|
||||
this.dataForm.shiftType !== this.shiftTypeEdit
|
||||
) {
|
||||
this.setTWOclass(); // (新增时或者编辑时倒班方式变了)第一步提交后,根据倒班方式设置第二部班次
|
||||
}
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.stepNum == 2) {
|
||||
let data = {}
|
||||
data.planId = this.dataForm.id
|
||||
data.groupPlanClassesBaseVOList = [] //排班-班次信息list
|
||||
this.tableData1.forEach((item,index)=>{
|
||||
const obj = {
|
||||
sort: index+1,
|
||||
name : item.name,
|
||||
remark: item.remark,
|
||||
startTime: {
|
||||
hour:item.startDay.split(':')[0],
|
||||
minute:item.startDay.split(':')[1],
|
||||
},
|
||||
endTime: {
|
||||
hour:item.endDay.split(':')[0],
|
||||
minute:item.endDay.split(':')[1],
|
||||
}
|
||||
}
|
||||
data.groupPlanClassesBaseVOList.push(obj)
|
||||
})
|
||||
data.groupPlanTeamBaseVOList = [] //排班-班组信息list
|
||||
this.tableData2.forEach(item=>{
|
||||
const obj = {
|
||||
teamId:item.id,
|
||||
bindData: ''
|
||||
}
|
||||
data.groupPlanTeamBaseVOList.push(obj)
|
||||
})
|
||||
this.stepNum += 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
if (!this.tableData2 || this.tableData2.length == 0) {
|
||||
this.$message('班组不能为空');
|
||||
return;
|
||||
}
|
||||
|
||||
let isbindLine = false;
|
||||
this.tableData2.forEach((item) => {
|
||||
if (!item.bindLineTree || item.bindLineTree.length == 0) {
|
||||
isbindLine = true;
|
||||
}
|
||||
});
|
||||
if (isbindLine) {
|
||||
this.$message('生产班组必须绑定产线或工段');
|
||||
return;
|
||||
}
|
||||
|
||||
const ids = this.tableData2.map((item) => item.id);
|
||||
const uniqueIds = [...new Set(ids)];
|
||||
if (ids.length !== uniqueIds.length) {
|
||||
this.$message('存在重复的班组,请检查!');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.dataForm.shiftType == 1 && this.tableData2.length > 1) {
|
||||
this.$message('白班,班组数量仅支持 1个 班组');
|
||||
return;
|
||||
} else if (this.dataForm.shiftType == 2 && this.tableData2.length < 2) {
|
||||
this.$message('两班倒,班组数量至少 2个 班组');
|
||||
return;
|
||||
} else if (this.dataForm.shiftType == 3 && this.tableData2.length < 3) {
|
||||
this.$message('三班倒,班组数量至少 3个 班组');
|
||||
return;
|
||||
}
|
||||
|
||||
let data = {};
|
||||
data.planId = this.dataForm.id;
|
||||
data.groupPlanClassesBaseVOList = []; //排班-班次信息list
|
||||
this.tableData1.forEach((item, index) => {
|
||||
const obj = {
|
||||
sort: index + 1,
|
||||
name: item.name,
|
||||
remark: item.remark,
|
||||
startTime: item.startTime,
|
||||
endTime: item.endTime,
|
||||
daySpan: item.daySpan,
|
||||
};
|
||||
data.groupPlanClassesBaseVOList.push(obj);
|
||||
});
|
||||
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
|
||||
this.tableData2.forEach((item) => {
|
||||
const obj = {
|
||||
teamId: item.id,
|
||||
name: item.name,
|
||||
leaderName: item.leaderName,
|
||||
leaderPhone:item.leaderPhone,
|
||||
bindData: JSON.stringify(item.bindLineTree),
|
||||
};
|
||||
data.groupPlanTeamBaseVOList.push(obj);
|
||||
});
|
||||
createStepTwo(data).then((res) => {
|
||||
this.stepNum += 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
this.getThreeGroup(7); // 第三步,进来加载预览排班,默认7天预览周期
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.stepNum == 3) {
|
||||
this.stepNum = 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
let data = { planId: this.dataForm.id };
|
||||
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
|
||||
this.tableData2.forEach((item) => {
|
||||
const obj = {
|
||||
teamId: item.id,
|
||||
name: item.name,
|
||||
bindData: JSON.stringify(item.bindLineTree),
|
||||
};
|
||||
data.groupPlanTeamBaseVOList.push(obj);
|
||||
});
|
||||
checkPlan(data).then((RES) => {
|
||||
createStepFour(this.dataForm.id).then((res) => {
|
||||
this.$modal.msgSuccess('创建计划成功');
|
||||
this.stepNum = 1;
|
||||
this.$emit('setSN', this.stepNum);
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
//第一步
|
||||
//子组件获取的部门id
|
||||
setDeptId(val) {
|
||||
this.dataForm.deptId = val;
|
||||
},
|
||||
//详情时传给子组件的部门id
|
||||
setDataForm() {
|
||||
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||
},
|
||||
//比较时间,开始时间在结束时间前
|
||||
compareDates(date1, date2) {
|
||||
const d1 = date1;
|
||||
const d2 = date2;
|
||||
|
||||
if (d1 === d2) {
|
||||
return 0; // 日期相等
|
||||
} else if (d1 < d2) {
|
||||
return -1; // date1 在 date2 之前
|
||||
} else {
|
||||
return 1; // date1 在 date2 之后
|
||||
}
|
||||
},
|
||||
//第二步
|
||||
//设置第二部班次
|
||||
setTWOclass() {
|
||||
this.tableData1 = [];
|
||||
if (this.dataForm.shiftType == 1) {
|
||||
const obj = {
|
||||
name: '长白班',
|
||||
startDay: '8:00',
|
||||
endDay: '17:00',
|
||||
startTime: '08:00:00',
|
||||
endTime: '17:00:00',
|
||||
daySpan: 0, //是否跨天
|
||||
code: 1, //排版日历页面,根据这个字段显示颜色
|
||||
};
|
||||
this.tableData1.push(obj);
|
||||
} else if (this.dataForm.shiftType == 2) {
|
||||
const obj1 = {
|
||||
name: '白班',
|
||||
startDay: '8:00',
|
||||
endDay: '20:00',
|
||||
startTime: '08:00:00',
|
||||
endTime: '20:00:00',
|
||||
daySpan: 0,
|
||||
code: 1,
|
||||
};
|
||||
const obj2 = {
|
||||
name: '夜班',
|
||||
startDay: '20:00',
|
||||
endDay: '8:00',
|
||||
startTime: '20:00:00',
|
||||
endTime: '08:00:00',
|
||||
daySpan: 1,
|
||||
code: 3,
|
||||
};
|
||||
this.tableData1.push(obj1, obj2);
|
||||
} else if (this.dataForm.shiftType == 3) {
|
||||
const obj1 = {
|
||||
name: '早班',
|
||||
startDay: '8:00',
|
||||
endDay: '16:00',
|
||||
startTime: '08:00:00',
|
||||
endTime: '16:00:00',
|
||||
daySpan: 0,
|
||||
code: 1,
|
||||
};
|
||||
const obj2 = {
|
||||
name: '中班',
|
||||
startDay: '16:00',
|
||||
endDay: '00:00',
|
||||
startTime: '16:00:00',
|
||||
endTime: '00:00:00',
|
||||
daySpan: 1,
|
||||
code: 2,
|
||||
};
|
||||
const obj3 = {
|
||||
name: '夜班',
|
||||
startDay: '00:00',
|
||||
endDay: '8:00',
|
||||
startTime: '00:00:00',
|
||||
endTime: '08:00:00',
|
||||
daySpan: 0,
|
||||
code: 3,
|
||||
};
|
||||
this.tableData1.push(obj1, obj2, obj3);
|
||||
}
|
||||
},
|
||||
//编辑班次
|
||||
handleClick1(val) {
|
||||
this.addOrUpdateVisible1 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.editClassRef.init(val.data);
|
||||
});
|
||||
},
|
||||
//班组操作
|
||||
handleClick2(val) {
|
||||
if (val.type === 'bind') {
|
||||
this.addOrUpdateVisible3 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.bindLineRef.init(val.data);
|
||||
});
|
||||
} else if (val.type === 'delete') {
|
||||
this.tableData2.splice(val.data._pageIndex - 1, 1);
|
||||
}
|
||||
},
|
||||
// 新增班组
|
||||
addNewGroup() {
|
||||
this.addOrUpdateVisible2 = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addGroupRef.init(this.dataForm.deptId);
|
||||
this.$refs.addGroupRef.init(this.dataForm.deptId,this.tableData2);
|
||||
});
|
||||
},
|
||||
cancel1() {
|
||||
@@ -705,10 +892,93 @@ export default {
|
||||
this.tableData2.push(...val);
|
||||
this.cancel2();
|
||||
},
|
||||
refreshTableData3(val) {
|
||||
console.log(val);
|
||||
refreshTableData3(index, val) {
|
||||
this.tableData2[index].bindLineTree = val;
|
||||
let lineName = '';
|
||||
lineName = this.setLineName(val, lineName);
|
||||
if (lineName) {
|
||||
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
|
||||
}
|
||||
this.cancel3();
|
||||
},
|
||||
//提取绑定的产线工段名展示出来
|
||||
setLineName(val, lineName) {
|
||||
val.forEach((item) => {
|
||||
lineName += item.name + ':';
|
||||
if (item.children && item.children.length > 0) {
|
||||
const childName = this.setLineName(item.children, lineName);
|
||||
lineName = childName;
|
||||
}
|
||||
});
|
||||
return lineName;
|
||||
},
|
||||
//第三步
|
||||
// 进来加载预览排班
|
||||
getThreeGroup(day) {
|
||||
const data = {
|
||||
id: this.dataForm.id,
|
||||
count: day,
|
||||
};
|
||||
this.tableProps3 = [];
|
||||
this.tableData3 = [];
|
||||
getPerView(data).then((res) => {
|
||||
this.setThreeData(res.data);
|
||||
});
|
||||
},
|
||||
setPeriod(val) {
|
||||
this.getThreeGroup(val);
|
||||
},
|
||||
|
||||
setThreeData(data) {
|
||||
//表头第一个为班次名称
|
||||
const propfirst = {
|
||||
prop: 'name',
|
||||
label: '',
|
||||
align: 'center',
|
||||
fixed: true,
|
||||
subcomponent: propfirstSpan,
|
||||
};
|
||||
this.tableProps3.push(propfirst);
|
||||
data.forEach((item, index) => {
|
||||
//设置所有日期为表头
|
||||
const obj = {
|
||||
prop: 'daydata' + index,
|
||||
label: item.day,
|
||||
work: item.work,
|
||||
subcomponent: propSpan,
|
||||
};
|
||||
this.tableProps3.push(obj);
|
||||
item.det.forEach((sItem, sIndex) => {
|
||||
if (index === 0) {
|
||||
let sObj = {
|
||||
name: sItem.classesName + '/' + sItem.time,
|
||||
sort: sItem.sort,
|
||||
};
|
||||
sObj['daydata' + index] = item.work
|
||||
? sItem.teamName
|
||||
: item.holidayName;
|
||||
this.tableData3.push(sObj);
|
||||
} else {
|
||||
this.$set(
|
||||
this.tableData3[sIndex],
|
||||
'daydata' + index,
|
||||
item.work ? sItem.teamName : item.holidayName
|
||||
);
|
||||
this.$set(this.tableData3[sIndex], 'sort', sItem.sort);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
cancelStep() {
|
||||
if (this.stepNum > 1) {
|
||||
cancelStepThree(this.dataForm.id).then((res) => {
|
||||
this.$message('已取消计划');
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
} else {
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-16 16:37:40
|
||||
* @LastEditTime: 2025-10-30 10:47:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -16,7 +16,7 @@
|
||||
pid="pid"
|
||||
:defaultProps="{ label: 'name' }"
|
||||
height="450px"
|
||||
style="padding-bottom:20px"
|
||||
style="padding-bottom: 20px"
|
||||
:mode="mode"
|
||||
filter
|
||||
openAll></tree-transfer>
|
||||
@@ -31,7 +31,6 @@ export default {
|
||||
components: { treeTransfer },
|
||||
data() {
|
||||
return {
|
||||
groupId: undefined,
|
||||
title: ['待选', '已选'],
|
||||
mode: 'transfer',
|
||||
fromData: [], //左边内容
|
||||
@@ -39,30 +38,50 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
init(val) {
|
||||
this._pageIndex = val._pageIndex - 1;
|
||||
this.fromData = [];
|
||||
this.toData = [];
|
||||
this.groupId = id;
|
||||
getGroupPlanTree().then((res) => {
|
||||
this.fromData = res.data;
|
||||
this.fromData.forEach((item) => {
|
||||
item.productionLineId = 0;
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.toData = val.bindLineTree || [];
|
||||
this.getFilterLeftData(this.fromData, this.toData); //编辑时组件有bug,左边相同数据不消失
|
||||
});
|
||||
});
|
||||
},
|
||||
// 监听穿梭框组件添加
|
||||
add(fromData, toData, obj) {
|
||||
console.log('fromData:', fromData);
|
||||
console.log('toData:', toData,obj);
|
||||
console.log('toData:', toData, obj);
|
||||
},
|
||||
// 监听穿梭框组件移除
|
||||
remove(fromData, toData, obj) {
|
||||
console.log('fromData:', fromData);
|
||||
console.log('toData:', toData);
|
||||
},
|
||||
/** 消除组件左边与右边选中数据相同项 */
|
||||
// 处理过滤数据
|
||||
getFilterLeftData(data, selData) {
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
for (let j = selData.length - 1; j >= 0; j--) {
|
||||
if (data[i] && data[i].id === selData[j].id) {
|
||||
// 当id相等可以删除的情况 即:没有子级可以删除;
|
||||
if (!data[i].children || data[i].children.length == 0) {
|
||||
data.splice(i, 1);
|
||||
} else {
|
||||
this.getFilterLeftData(data[i].children, selData[j].children);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$emit('refreshTableData',this.toData);
|
||||
this.$emit('refreshTableData', this._pageIndex, this.toData);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
187
src/views/group/Schedule/detail.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-21 14:27:23
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-21 15:02:27
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div class="info-div">
|
||||
<div>
|
||||
<span class="title">计划编号:</span>
|
||||
{{ infoData.code }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">计划状态:</span>
|
||||
{{ ['', '草稿', '已确认', '已作废'][infoData.status] }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">计划名称:</span>
|
||||
{{ infoData.name }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">部门:</span>
|
||||
{{ infoData.deptName }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">开始时间:</span>
|
||||
{{ parseTime(infoData.startDay) }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">结束时间:</span>
|
||||
{{ parseTime(infoData.endDay) }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">周末休假方式:</span>
|
||||
{{ ['', '双休', '周六休', '周日休', '不休'][infoData.weekType] }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">倒班方式:</span>
|
||||
{{ ['', '长白班', '两班倒', '三班倒'][infoData.shiftType] }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">同班次连排:</span>
|
||||
{{ infoData.shiftSustainedNum }}日
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">创建人:</span>
|
||||
{{ infoData.creator }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">创建时间:</span>
|
||||
{{ parseTime(infoData.createTime) }}
|
||||
</div>
|
||||
<div v-if="infoData.status == 3">
|
||||
<span class="title">作废时间:</span>
|
||||
{{ parseTime(infoData.disableTime) }}
|
||||
</div>
|
||||
<div>
|
||||
<span class="title">备注:</span>
|
||||
{{ infoData.remark }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-tabs v-model="activeName" stretch>
|
||||
<el-tab-pane label="班次" name="first"></el-tab-pane>
|
||||
<el-tab-pane label="班组" name="second"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<base-table
|
||||
v-if="activeName == 'first'"
|
||||
:table-props="tableProps1"
|
||||
:page="1"
|
||||
:limit="10"
|
||||
:table-data="tableData1"></base-table>
|
||||
<base-table
|
||||
v-else
|
||||
:table-props="tableProps2"
|
||||
:page="1"
|
||||
:limit="10"
|
||||
:table-data="tableData2"></base-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { getPlan } from '@/api/group/Schedule';
|
||||
|
||||
const tableProps1 = [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班次名称',
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '开始时间',
|
||||
filter: (val) => {
|
||||
return val ? val.slice(0, -3) : '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '结束时间',
|
||||
filter: (val) => {
|
||||
return val ? val.slice(0, -3) : '-';
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '班组编号',
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称',
|
||||
},
|
||||
{
|
||||
prop: 'isProduction',
|
||||
label: '是否生产班组',
|
||||
filter: (val) => {
|
||||
return val ? '是' : '否';
|
||||
},
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线及工段',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
infoData: {},
|
||||
activeName: 'first',
|
||||
tableProps1,
|
||||
tableData1: [],
|
||||
tableProps2,
|
||||
tableData2: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.infoData = {};
|
||||
getPlan(id).then((res) => {
|
||||
this.infoData = res.data || {};
|
||||
console.log(res);
|
||||
this.tableData1 = res.data?.groupPlanClassesBaseVOList;
|
||||
this.tableData2 = res.data?.groupPlanTeamBaseVOList;
|
||||
this.tableData2.forEach((item, index) => {
|
||||
let lineName = '';
|
||||
lineName = this.setLineName(item.bindLineTree, lineName);
|
||||
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
|
||||
});
|
||||
});
|
||||
},
|
||||
//提取绑定的产线工段名展示出来
|
||||
setLineName(val, lineName) {
|
||||
val.forEach((item) => {
|
||||
lineName += item.name + ':';
|
||||
if (item.children && item.children.length > 0) {
|
||||
const childName = this.setLineName(item.children, lineName);
|
||||
lineName = childName;
|
||||
}
|
||||
});
|
||||
return lineName;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.info-div {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-15 16:31:11
|
||||
* @LastEditTime: 2025-10-20 10:23:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -32,22 +32,22 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始时间" prop="startDay">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-time-picker
|
||||
style="width: 100%"
|
||||
format="H:mm"
|
||||
value-format="H:mm"
|
||||
v-model="dataForm.startDay"
|
||||
value-format="HH:mm:ss"
|
||||
v-model="dataForm.startTime"
|
||||
placeholder="选择日期时间"></el-time-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间" prop="endDay">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-time-picker
|
||||
style="width: 100%"
|
||||
format="H:mm"
|
||||
value-format="H:mm"
|
||||
v-model="dataForm.endDay"
|
||||
value-format="HH:mm:ss"
|
||||
v-model="dataForm.endTime"
|
||||
placeholder="选择日期时间"></el-time-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -72,8 +72,8 @@ export default {
|
||||
id: undefined,
|
||||
index: undefined,
|
||||
name: undefined,
|
||||
startDay: undefined,
|
||||
endDay: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
remark: undefined,
|
||||
},
|
||||
_pageIndex: 1,
|
||||
@@ -82,10 +82,10 @@ export default {
|
||||
name: [
|
||||
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
startDay: [
|
||||
startTime: [
|
||||
{ required: true, message: '开始时间不能为空', trigger: 'change' },
|
||||
],
|
||||
endDay: [
|
||||
endTime: [
|
||||
{ required: true, message: '结束时间不能为空', trigger: 'change' },
|
||||
],
|
||||
},
|
||||
@@ -96,8 +96,8 @@ export default {
|
||||
this._pageIndex = val._pageIndex-1;
|
||||
this.dataForm.index = val._pageIndex || 1;
|
||||
this.dataForm.name = val.name || undefined;
|
||||
this.dataForm.startDay = val.startDay || undefined;
|
||||
this.dataForm.endDay = val.endDay || undefined;
|
||||
this.dataForm.startTime = val.startTime || undefined;
|
||||
this.dataForm.endTime = val.endTime || undefined;
|
||||
this.dataForm.remark = val.remark || undefined;
|
||||
},
|
||||
// 表单提交
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-15 16:42:28
|
||||
* @LastEditTime: 2025-10-29 14:50:16
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -59,12 +59,14 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-hasPermi="['base:group-scheduling-plan:query']"
|
||||
@click="buttonClick({ btnName: 'search' })">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span class="separateStyle"
|
||||
v-hasPermi="['base:group-scheduling-plan:query']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
||||
@@ -72,13 +74,15 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span class="separateStyle"
|
||||
v-hasPermi="['base:group-scheduling-plan:create']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
:plain="true"
|
||||
v-hasPermi="['base:group-scheduling-plan:create']"
|
||||
@click="buttonClick({ btnName: 'add' })">
|
||||
新增
|
||||
</el-button>
|
||||
@@ -95,7 +99,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
:width="270"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@@ -112,7 +116,7 @@
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
append-to-body
|
||||
width="60%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@@ -141,7 +145,7 @@
|
||||
class="btnTextStyle"
|
||||
size="small"
|
||||
plain
|
||||
@click="handleConfirm">
|
||||
@click="successSubmit">
|
||||
保存草稿
|
||||
</el-button>
|
||||
<el-button
|
||||
@@ -156,6 +160,30 @@
|
||||
</slot>
|
||||
</template>
|
||||
</base-dialog>
|
||||
<base-dialog
|
||||
:dialogTitle="'排班计划详情'"
|
||||
:dialogVisible="detailVisible"
|
||||
@cancel="detailCancel"
|
||||
:before-close="detailCancel"
|
||||
:destroy-on-close="true"
|
||||
append-to-body
|
||||
width="50%">
|
||||
<detail ref="detailRef"></detail>
|
||||
<template #footer>
|
||||
<slot name="footer">
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
<el-col :span="24">
|
||||
<el-button
|
||||
size="small"
|
||||
class="btnTextStyle"
|
||||
@click="detailCancel">
|
||||
取消
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</slot>
|
||||
</template>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -165,8 +193,15 @@ import deptSelect from './../deptSelect.vue';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import subSpan from './subSpan.vue';
|
||||
import subStatus from './subStatus.vue';
|
||||
import detail from './detail.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import { getGroupPlanPage, deleteGroupPlan } from '@/api/group/Schedule';
|
||||
import {
|
||||
getGroupPlanPage,
|
||||
deleteGroupPlan,
|
||||
copyPlan,
|
||||
disablePlan,
|
||||
updateScheduleLater,
|
||||
} from '@/api/group/Schedule';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -206,7 +241,7 @@ const tableProps = [
|
||||
subcomponent: subSpan,
|
||||
},
|
||||
{
|
||||
prop: 'deptId',
|
||||
prop: 'deptName',
|
||||
label: '部门',
|
||||
},
|
||||
{
|
||||
@@ -233,6 +268,7 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:update')?
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
@@ -246,7 +282,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@@ -260,7 +297,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:query')?
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '查看',
|
||||
@@ -274,7 +312,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
||||
{
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
@@ -288,7 +327,8 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-holiday:update')?
|
||||
{
|
||||
type: 'sync',
|
||||
btnName: '同步节假日',
|
||||
@@ -301,17 +341,18 @@ export default {
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
type: 'updateFlag',
|
||||
name: 'status',
|
||||
type: 'equal',
|
||||
name: 'updateFlag',
|
||||
value: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}:undefined,
|
||||
this.$auth.hasPermi('base:group-scheduling-plan:create')?
|
||||
{
|
||||
type: 'copy',
|
||||
btnName: '复制',
|
||||
},
|
||||
}:undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
options: [
|
||||
@@ -337,11 +378,13 @@ export default {
|
||||
status: '',
|
||||
},
|
||||
stepNum: 1, // 新增编辑时当前第几步
|
||||
detailVisible: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
deptSelect,
|
||||
detail
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
@@ -396,10 +439,15 @@ export default {
|
||||
setStepNum(val) {
|
||||
this.stepNum = val;
|
||||
},
|
||||
// dialog取消
|
||||
handleCancel() {
|
||||
successSubmit() {
|
||||
this.addOrUpdateVisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
this.stepNum = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// dialog取消
|
||||
handleCancel() {
|
||||
this.$refs.addOrUpdate.cancelStep();
|
||||
},
|
||||
handleConfirm(val) {
|
||||
if (val == 'up') {
|
||||
@@ -408,6 +456,41 @@ export default {
|
||||
this.$refs.addOrUpdate.nextSubmit();
|
||||
}
|
||||
},
|
||||
//tableBtn点击
|
||||
handleClick(val) {
|
||||
if (val.type === 'edit') {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === 'delete') {
|
||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex);
|
||||
} else if (val.type === 'detail') {
|
||||
this.detailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.detailRef.init(val.data.id);
|
||||
});
|
||||
} else if (val.type === 'cancel') {
|
||||
disablePlan(val.data.id).then((res) => {
|
||||
this.$modal.msgSuccess('作废成功');
|
||||
this.getDataList()
|
||||
});
|
||||
} else if (val.type === 'sync') {
|
||||
updateScheduleLater({ planId: val.data.id }).then((res) => {
|
||||
this.$modal.msgSuccess('同步节假日成功');
|
||||
this.getDataList()
|
||||
});
|
||||
} else if (val.type === 'copy') {
|
||||
copyPlan(val.data.id).then((res) => {
|
||||
this.$modal.msgSuccess('复制成功');
|
||||
this.getDataList()
|
||||
});
|
||||
}
|
||||
},
|
||||
detailCancel() {
|
||||
this.detailVisible = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -449,21 +532,21 @@ export default {
|
||||
margin: 4px 0;
|
||||
}
|
||||
body .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
body .el-dialog__header .titleStyle::before{
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
body .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
36
src/views/group/Schedule/propSpan.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-21 13:54:52
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
<el-tag
|
||||
v-if="injectData.work"
|
||||
size="small"
|
||||
:type="['', 'success', 'warning'][injectData.sort]">
|
||||
{{ injectData[injectData.prop] }}
|
||||
</el-tag>
|
||||
<el-tag v-else effect="dark" size="small" type="info">
|
||||
{{ injectData[injectData.prop] }}
|
||||
</el-tag>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
33
src/views/group/Schedule/propfirstSpan.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-20 10:13:26
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
{{ injectData.name.split('/')[0] }}
|
||||
</div>
|
||||
<div>
|
||||
{{ injectData.name.split('/')[1] }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
created() {},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
@@ -1,9 +1,16 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-13 16:18:41
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-20 10:13:26
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
{{
|
||||
injectData.shiftSustainedNum +
|
||||
(injectDatashiftSustainedType
|
||||
? ['', '日', '周', '月', '季'][injectDatashiftSustainedType]
|
||||
(injectData.shiftSustainedType
|
||||
? ['', '日', '周', '月', '季'][injectData.shiftSustainedType]
|
||||
: '')
|
||||
}}
|
||||
</span>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-13 15:44:18
|
||||
* @LastEditTime: 2025-10-29 14:47:33
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -33,7 +33,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门">
|
||||
<dept-select
|
||||
style="width: 200px"
|
||||
style="width: 100%"
|
||||
ref="deptSelect"
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
</el-form-item>
|
||||
@@ -41,8 +41,10 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="组长" prop="leaderId">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.leaderId"
|
||||
@change="setLeaderName"
|
||||
filterable
|
||||
placeholder="请选择组长">
|
||||
<el-option
|
||||
v-for="item in leaderArr"
|
||||
@@ -57,12 +59,14 @@
|
||||
<el-input
|
||||
v-model="dataForm.leaderPhone"
|
||||
clearable
|
||||
maxlength="11"
|
||||
placeholder="请输入组长电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班组人数" prop="num">
|
||||
<el-input-number
|
||||
style="width: 100%"
|
||||
v-model="dataForm.num"
|
||||
:step="1"
|
||||
:min="0"
|
||||
@@ -72,6 +76,7 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生产班组" prop="isProduction">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="dataForm.isProduction"
|
||||
placeholder="请选择是否为生产班组">
|
||||
<el-option
|
||||
@@ -157,6 +162,13 @@ export default {
|
||||
isProduction: [
|
||||
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
||||
],
|
||||
leaderPhone: [
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2025-10-11 14:27:37
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-13 14:44:29
|
||||
* @LastEditTime: 2025-10-29 14:44:41
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -25,7 +25,7 @@
|
||||
<dept-select
|
||||
style="width: 200px"
|
||||
ref="deptSelect"
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
@DeptId="setDeptId"></dept-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="name">
|
||||
<el-input
|
||||
@@ -45,12 +45,15 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-hasPermi="['base:group-team:query']"
|
||||
@click="buttonClick({ btnName: 'search' })">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span
|
||||
class="separateStyle"
|
||||
v-hasPermi="['base:group-team:query']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
||||
@@ -58,13 +61,16 @@
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle"></span>
|
||||
<span
|
||||
class="separateStyle"
|
||||
v-hasPermi="['base:group-team:create']"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
:plain="true"
|
||||
v-hasPermi="['base:group-team:create']"
|
||||
@click="buttonClick({ btnName: 'add' })">
|
||||
新增
|
||||
</el-button>
|
||||
@@ -97,7 +103,7 @@
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
:destroy-on-close="true"
|
||||
:destroy-on-close="true"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@@ -118,16 +124,16 @@ const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '班组编号',
|
||||
width: 140,
|
||||
width: 210,
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '班组名称',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
prop: 'deptId',
|
||||
prop: 'deptName',
|
||||
label: '所属部门',
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'leaderName',
|
||||
@@ -136,6 +142,7 @@ const tableProps = [
|
||||
{
|
||||
prop: 'leaderPhone',
|
||||
label: '组长电话',
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'num',
|
||||
@@ -145,12 +152,15 @@ const tableProps = [
|
||||
{
|
||||
prop: 'isProduction',
|
||||
label: '是否生产班组',
|
||||
filter: val=>{return val?'是':'否'},
|
||||
filter: (val) => {
|
||||
return val ? '是' : '否';
|
||||
},
|
||||
width: 110,
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -175,10 +185,12 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
this.$auth.hasPermi('base:group-team:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formInline: {
|
||||
@@ -231,9 +243,9 @@ export default {
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
setDeptId(val){
|
||||
this.formInline.deptId = val
|
||||
}
|
||||
setDeptId(val) {
|
||||
this.formInline.deptId = val;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,101 +2,143 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-19 00:09:11
|
||||
* @LastEditTime: 2025-10-23 13:29:58
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-position="top"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="节假日名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
clearable
|
||||
:disabled="detail"
|
||||
placeholder="请输入节假日名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日历类型" prop="calendarType">
|
||||
<el-select
|
||||
v-model="dataForm.calendarType"
|
||||
:disabled="detail"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日期类型" prop="dateType">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
:disabled="detail"
|
||||
v-model="dataForm.dateType">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日期" prop="dateTime">
|
||||
<el-date-picker
|
||||
:disabled="detail"
|
||||
style="width: 100%"
|
||||
<div>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-position="top"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="节假日名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
clearable
|
||||
:disabled="detail"
|
||||
placeholder="请输入节假日名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日历类型" prop="calendarType">
|
||||
<el-select
|
||||
v-model="dataForm.calendarType"
|
||||
:disabled="detail"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="日期类型" prop="dateType">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
:disabled="detail"
|
||||
v-model="dataForm.dateType">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
v-if="dataForm.dateType == 1"
|
||||
key="date"
|
||||
v-model="dataForm.dateDay"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
<el-date-picker
|
||||
:disabled="detail"
|
||||
style="width: 100%"
|
||||
v-else
|
||||
key="daterange"
|
||||
v-model="dataForm.dateDayArr"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否每年重复" prop="repeat">
|
||||
<el-select
|
||||
v-model="dataForm.repeat"
|
||||
:disabled="detail"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
label="日期"
|
||||
prop="dateDay">
|
||||
<el-date-picker
|
||||
:disabled="detail"
|
||||
style="width: 100%"
|
||||
key="date"
|
||||
v-model="dataForm.dateDay"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="--MM-dd"
|
||||
:picker-options="pickerOptions"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-else label="日期" prop="dateDayArr">
|
||||
<el-date-picker
|
||||
:disabled="detail"
|
||||
style="width: 100%"
|
||||
key="daterange"
|
||||
v-model="dataForm.dateDayArr"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="--MM-dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:picker-options="pickerOptions"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否每年重复" prop="repeat">
|
||||
<el-select
|
||||
v-model="dataForm.repeat"
|
||||
:disabled="detail"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="detail">
|
||||
<el-form-item label="来源" prop="inherited">
|
||||
<el-radio-group disabled v-model="dataForm.inherited">
|
||||
<el-radio :label="true">继承</el-radio>
|
||||
<el-radio :label="false">自定义</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-dialog
|
||||
title="删除确认"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
append-to-body>
|
||||
<span>
|
||||
确认删除该节假日吗?
|
||||
<br />
|
||||
该节假日已被排班计划使用,建议确认是否同步更新排班计划。
|
||||
<br />
|
||||
此操作不可恢复,请确认是否继续
|
||||
</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="onlyDelete">仅删除</el-button>
|
||||
<el-button type="primary" @click="deleteAndUpdate">
|
||||
删除并更新
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createHoliday, updateHoliday,deleteHolidayn } from '@/api/group/holidaySetting';
|
||||
import {
|
||||
createHoliday,
|
||||
updateHoliday,
|
||||
checkDeleteHoliday,
|
||||
deleteHoliday,
|
||||
updateSchedule,
|
||||
getHoliday,
|
||||
} from '@/api/group/holidaySetting';
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
@@ -110,6 +152,8 @@ export default {
|
||||
dateDay: undefined,
|
||||
dateDayArr: [],
|
||||
repeat: true,
|
||||
inherited: true, // 是否为继承
|
||||
deptId: undefined,
|
||||
},
|
||||
detail: false,
|
||||
options1: [
|
||||
@@ -166,41 +210,170 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < Date.now();
|
||||
},
|
||||
},
|
||||
dialogVisible: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id, detail) {
|
||||
init(deptId, id, detail) {
|
||||
this.dataForm.deptId = deptId || undefined;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.detail = detail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getHoliday(this.dataForm.id).then((res) => {
|
||||
this.dataForm = res.data;
|
||||
if (
|
||||
this.dataForm.dateType == 1 &&
|
||||
this.dataForm.calendarType == 1
|
||||
) {
|
||||
this.dataForm.dateDay = this.dataForm.oneDay;
|
||||
} else if (
|
||||
this.dataForm.dateType == 2 &&
|
||||
this.dataForm.calendarType == 1
|
||||
) {
|
||||
this.dataForm.dateDayArr = [
|
||||
this.dataForm.startDay,
|
||||
this.dataForm.endDay,
|
||||
];
|
||||
} else if (
|
||||
this.dataForm.dateType == 1 &&
|
||||
this.dataForm.calendarType == 2
|
||||
) {
|
||||
this.dataForm.dateDay = this.dataForm.oneDayChinese;
|
||||
} else if (
|
||||
this.dataForm.dateType == 2 &&
|
||||
this.dataForm.calendarType == 2
|
||||
) {
|
||||
this.dataForm.dateDayArr = [
|
||||
this.dataForm.startDayChinese,
|
||||
this.dataForm.endDayChinese,
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
editHoliday() {
|
||||
this.detail = false;
|
||||
},
|
||||
deleteHoliday() {
|
||||
//删除节假日基础信息前校验是否影响排班
|
||||
checkDeleteHoliday(this.dataForm.id).then((res) => {
|
||||
if (res.data) {
|
||||
this.dialogVisible = true;
|
||||
} else {
|
||||
this.$confirm(
|
||||
'确认删除该节假日吗?<br/>此操作不可恢复,请确认是否继续',
|
||||
'删除确认',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '确认删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteHoliday(this.dataForm.id).then((res) => {
|
||||
console.log(res);
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
this.$emit('refreshPage');
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消',
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onlyDelete() {
|
||||
deleteHoliday(this.dataForm.id).then((res) => {
|
||||
this.dialogVisible = false;
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
this.$emit('refreshPage');
|
||||
});
|
||||
},
|
||||
deleteAndUpdate() {
|
||||
deleteHoliday(this.dataForm.id).then((res) => {
|
||||
this.dialogVisible = false;
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
this.$emit('refreshPage');
|
||||
});
|
||||
});
|
||||
},
|
||||
editHoliday(){
|
||||
this.detail = false
|
||||
},
|
||||
deleteHoliday(){
|
||||
deleteHolidayn(this.dataForm.id).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
if (this.dataForm.dateType == 1 && this.dataForm.calendarType == 1) {
|
||||
this.dataForm.oneDay = this.dataForm.dateDay;
|
||||
} else if (
|
||||
this.dataForm.dateType == 2 &&
|
||||
this.dataForm.calendarType == 1
|
||||
) {
|
||||
this.dataForm.startDay = this.dataForm.dateDayArr[0];
|
||||
this.dataForm.endDay = this.dataForm.dateDayArr[1];
|
||||
} else if (
|
||||
this.dataForm.dateType == 1 &&
|
||||
this.dataForm.calendarType == 2
|
||||
) {
|
||||
this.dataForm.oneDayChinese = this.dataForm.dateDay;
|
||||
} else if (
|
||||
this.dataForm.dateType == 2 &&
|
||||
this.dataForm.calendarType == 2
|
||||
) {
|
||||
this.dataForm.startDayChinese = this.dataForm.dateDayArr[0];
|
||||
this.dataForm.endDayChinese = this.dataForm.dateDayArr[1];
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateHoliday(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshPage');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createHoliday(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshPage');
|
||||
createHoliday(this.dataForm).then((res) => {
|
||||
updateSchedule;
|
||||
if (!res.data.updateFlag) {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$emit('refreshPage');
|
||||
} else {
|
||||
this.$confirm(
|
||||
'新增节假日影响已有排班计划,是否立即更新?',
|
||||
'更新排班',
|
||||
{
|
||||
confirmButtonText: '立即更新',
|
||||
cancelButtonText: '暂不更新',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$emit('refreshPage');
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消',
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
:isFold="true"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2024-07-01 14:54:06
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-10-19 00:35:24
|
||||
* @LastEditTime: 2025-10-27 10:18:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -46,10 +46,14 @@
|
||||
size="small"
|
||||
type="primary"
|
||||
style="margin-right: 10px"
|
||||
v-hasPermi="['base:group-holiday:create']"
|
||||
@click="addHoliday">
|
||||
新增节假日
|
||||
</el-button>
|
||||
<el-button size="small" @click="holidayLog">
|
||||
<el-button
|
||||
size="small"
|
||||
v-hasPermi="['base:group-holiday-log:query']"
|
||||
@click="holidayLog">
|
||||
节假日变更记录
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -73,12 +77,13 @@
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="startDay = new Date()">
|
||||
@click="(startDay = new Date()), getHolidayPage()">
|
||||
跳转到今天
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-tag
|
||||
v-if="topDeptId == deptId"
|
||||
type="warning"
|
||||
closable
|
||||
style="margin-bottom: 10px; color: black">
|
||||
@@ -92,15 +97,61 @@
|
||||
<div class="calenderArea">
|
||||
<el-calendar v-model="startDay">
|
||||
<template slot="dateCell" slot-scope="{ data }">
|
||||
<div v-if="data.type === 'current-month'" @click="showDetail">
|
||||
<div v-if="data.type === 'current-month'">
|
||||
<!-- 日期 -->
|
||||
<div class="dateStyle">
|
||||
<el-row :gutter="20">
|
||||
<!-- 公历和农历 -->
|
||||
<el-col :span="18">
|
||||
{{ Number(data.day.split('-')[2]) }}
|
||||
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
|
||||
</el-col>
|
||||
<el-col :span="6"><div class="work-tip">班</div></el-col>
|
||||
<!-- 显示假或班 -->
|
||||
<el-col :span="6">
|
||||
<div
|
||||
class="work-tip"
|
||||
:style="{
|
||||
backgroundColor: HolidayList[
|
||||
Number(data.day.split('-')[2]) - 1
|
||||
]?.isHoliday
|
||||
? '#67C23A'
|
||||
: '#409EFF',
|
||||
}">
|
||||
{{
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.isHoliday
|
||||
? '假'
|
||||
: '班'
|
||||
}}
|
||||
</div>
|
||||
</el-col>
|
||||
<!-- 显示假期名和操作 -->
|
||||
<el-col
|
||||
:span="24"
|
||||
v-if="
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.isHoliday
|
||||
">
|
||||
<div
|
||||
class="holiday-div"
|
||||
@click="
|
||||
new Date(data.day).getTime() > Date.now() &&
|
||||
showDetail(
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
.holidayId
|
||||
)
|
||||
">
|
||||
{{
|
||||
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||
?.holidayName
|
||||
}}
|
||||
<span
|
||||
class="holiday-div-btn"
|
||||
v-if="new Date(data.day).getTime() > Date.now()">
|
||||
<i class="el-icon-more" style="color: #fff"></i>
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
@@ -126,11 +177,12 @@
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="cancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="cancel"
|
||||
:destroy-on-close="true"
|
||||
width="40%">
|
||||
<add-or-updata
|
||||
ref="addOrUpdataRef"
|
||||
@refreshPage="getHolidayPage"></add-or-updata>
|
||||
@refreshPage="successSubmit"></add-or-updata>
|
||||
<template #footer>
|
||||
<slot name="footer">
|
||||
<el-row slot="footer" type="flex" justify="end">
|
||||
@@ -155,6 +207,7 @@
|
||||
size="small"
|
||||
type="primary"
|
||||
class="btnTextStyle"
|
||||
v-hasPermi="['base:group-holiday:update']"
|
||||
@click="editHoliday">
|
||||
修改
|
||||
</el-button>
|
||||
@@ -162,6 +215,7 @@
|
||||
v-if="detail"
|
||||
class="btnTextStyle"
|
||||
size="small"
|
||||
v-hasPermi="['base:group-holiday:delete']"
|
||||
@click="deleteHoliday">
|
||||
删除
|
||||
</el-button>
|
||||
@@ -174,6 +228,7 @@
|
||||
dialogTitle="节假日变更记录"
|
||||
:dialogVisible="logVisible"
|
||||
@cancel="cancelLog"
|
||||
:before-close="cancelLog"
|
||||
:destroy-on-close="true"
|
||||
width="70%">
|
||||
<holiday-log ref="holidayLogRef"></holiday-log>
|
||||
@@ -196,9 +251,8 @@
|
||||
import moment from 'moment';
|
||||
import { solarToLunar } from 'chinese-lunar';
|
||||
|
||||
import { listSimpleDepts } from '@/api/system/dept';
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
import { deptHolidayList } from '@/api/group/holidaySetting';
|
||||
import { deptHolidayList, getEnableData } from '@/api/group/holidaySetting';
|
||||
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
import holidayLog from './holidayLog';
|
||||
@@ -212,12 +266,14 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
startDay: '', // 查询参数
|
||||
HolidayList: [],
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
// 查询的部门名称
|
||||
deptName: undefined,
|
||||
// 选择的部门名称
|
||||
showDeptName: undefined,
|
||||
topDeptId: undefined, // 保存当前用户的部门id为最高级部门id
|
||||
deptId: undefined,
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
@@ -240,6 +296,7 @@ export default {
|
||||
// 查询用户个人信息
|
||||
getUserProfile().then((response) => {
|
||||
this.showDeptName = response.data.dept.name || '';
|
||||
this.topDeptId = response.data.dept.id || ''; // 保存当前用户的部门id为最高级部门id
|
||||
this.deptId = response.data.dept.id || '';
|
||||
this.getHolidayPage();
|
||||
});
|
||||
@@ -247,16 +304,31 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getHolidayPage() {
|
||||
deptHolidayList({ deptId: this.deptId }).then((response) => {});
|
||||
const now = new Date(this.startDay);
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth();
|
||||
const startTime = `${year}-${String(month + 1).padStart(2, '0')}-01`;
|
||||
const lastDate = new Date(year, month + 1, 0).getDate();
|
||||
const endTime = `${year}-${String(month + 1).padStart(2, '0')}-${String(
|
||||
lastDate
|
||||
).padStart(2, '0')}`;
|
||||
|
||||
this.HolidayList = [];
|
||||
deptHolidayList({
|
||||
deptId: this.deptId,
|
||||
startTime: Date.parse(startTime),
|
||||
endTime: Date.parse(endTime),
|
||||
}).then((res) => {
|
||||
this.HolidayList = res.data;
|
||||
});
|
||||
},
|
||||
// 切换月份
|
||||
selectMonth() {
|
||||
console.log(this.startDay);
|
||||
this.getHolidayPage();
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getTreeselect() {
|
||||
listSimpleDepts().then((response) => {
|
||||
getEnableData().then((response) => {
|
||||
// 处理 deptOptions 参数
|
||||
this.deptOptions = [];
|
||||
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||
@@ -342,7 +414,7 @@ export default {
|
||||
this.detail = false;
|
||||
this.dialogTitle = '新增节假日';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdataRef.init();
|
||||
this.$refs.addOrUpdataRef.init(this.deptId);
|
||||
});
|
||||
},
|
||||
holidayLog() {
|
||||
@@ -352,8 +424,13 @@ export default {
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.getHolidayPage();
|
||||
this.addOrUpdateVisible = false;
|
||||
},
|
||||
successSubmit() {
|
||||
this.cancel();
|
||||
this.getHolidayPage();
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.addOrUpdataRef.dataFormSubmit();
|
||||
},
|
||||
@@ -362,7 +439,7 @@ export default {
|
||||
this.detail = true;
|
||||
this.dialogTitle = '节假日详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdataRef.init(id, true);
|
||||
this.$refs.addOrUpdataRef.init(this.deptId, id, true);
|
||||
});
|
||||
},
|
||||
editHoliday() {
|
||||
@@ -465,6 +542,20 @@ export default {
|
||||
text-align: center;
|
||||
float: right;
|
||||
}
|
||||
.holiday-div {
|
||||
background-color: #67c23a;
|
||||
border-radius: 3px;
|
||||
height: 25px;
|
||||
text-align: center;
|
||||
line-height: 24px;
|
||||
color: #fff;
|
||||
.holiday-div-btn {
|
||||
float: right;
|
||||
transform: rotate(90deg);
|
||||
font-size: 14px;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
border-radius: 100%;
|
||||
background: #26b9de;
|
||||
"></span>
|
||||
智能监控分析系统
|
||||
上上电缆
|
||||
</p>
|
||||
</div>
|
||||
<video
|
||||
@@ -103,7 +103,7 @@
|
||||
line-height: 54px;
|
||||
letter-spacing: 2px;
|
||||
">
|
||||
智能监控分析系统
|
||||
上上电缆
|
||||
</h3>
|
||||
</h2>
|
||||
|
||||
|
||||
114
src/views/product&recipe/product/add-or-updata.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-12 15:35:21
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
clearable
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
clearable
|
||||
placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品规格" prop="address">
|
||||
<el-input
|
||||
v-model="dataForm.address"
|
||||
clearable
|
||||
placeholder="请输入产品规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品类型" prop="name">
|
||||
<el-select
|
||||
v-model="dataForm.name"
|
||||
disabled
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择产品类型">
|
||||
<el-option
|
||||
v-for="item in typeArr"
|
||||
:key="item.name"
|
||||
:label="item.label"
|
||||
:value="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="启用状态" prop="enabled">
|
||||
<el-select
|
||||
:style="{ width: '100%' }" v-model="dataForm.enabled" placeholder="请选择启用状态">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import {
|
||||
createFactory,
|
||||
updateFactory,
|
||||
getFactory,
|
||||
getCode,
|
||||
} from '@/api/core/base/factory';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createFactory,
|
||||
updateURL: updateFactory,
|
||||
infoURL: getFactory,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
address: undefined,
|
||||
enabled:'1',
|
||||
remark: undefined,
|
||||
},
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
35
src/views/product&recipe/product/changeStatus.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<el-switch
|
||||
@change="changeStatus"
|
||||
size="small"
|
||||
v-model="list.enabled"
|
||||
:active-value="1"
|
||||
:inactive-value="0"></el-switch>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateGroup } from '@/api/group/groupSetting';
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeStatus(val) {
|
||||
const data = { ...this.injectData, enabled: val };
|
||||
updateGroup(data).then((res) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.$emit('emitData');
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
209
src/views/product&recipe/product/index.vue
Normal file
@@ -0,0 +1,209 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="90"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import changeStatus from './changeStatus.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import {
|
||||
deleteFactory,
|
||||
getFactoryPage,
|
||||
exportFactoryExcel,
|
||||
} from '@/api/core/base/factory';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '产品编码',
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产品名称',
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: '规格型号',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '产品分类',
|
||||
},
|
||||
{
|
||||
prop: 'remark1',
|
||||
label: '创建人',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '状态',
|
||||
subcomponent: changeStatus,
|
||||
width: 80,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getFactoryPage,
|
||||
deleteURL: deleteFactory,
|
||||
exportURL: exportFactoryExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:factory:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:factory:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '分类',
|
||||
selectOptions: [],
|
||||
param: 'val1',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: [
|
||||
{ id: 1, name: '正常' },
|
||||
{ id: 2, name: '停用' },
|
||||
],
|
||||
param: 'val2',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.val1 = val.val1;
|
||||
this.listQuery.val2 = val.val2;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
114
src/views/product&recipe/recipe/add-or-updata.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2025-11-12 15:35:21
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品编码" prop="code">
|
||||
<el-input
|
||||
v-model="dataForm.code"
|
||||
clearable
|
||||
placeholder="请输入产品编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品名称" prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
clearable
|
||||
placeholder="请输入产品名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品规格" prop="address">
|
||||
<el-input
|
||||
v-model="dataForm.address"
|
||||
clearable
|
||||
placeholder="请输入产品规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="产品类型" prop="name">
|
||||
<el-select
|
||||
v-model="dataForm.name"
|
||||
disabled
|
||||
:style="{ width: '100%' }"
|
||||
placeholder="请选择产品类型">
|
||||
<el-option
|
||||
v-for="item in typeArr"
|
||||
:key="item.name"
|
||||
:label="item.label"
|
||||
:value="item.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="启用状态" prop="enabled">
|
||||
<el-select
|
||||
:style="{ width: '100%' }" v-model="dataForm.enabled" placeholder="请选择启用状态">
|
||||
<el-option
|
||||
v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add';
|
||||
import {
|
||||
createFactory,
|
||||
updateFactory,
|
||||
getFactory,
|
||||
getCode,
|
||||
} from '@/api/core/base/factory';
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
isGetCode: true,
|
||||
codeURL: getCode,
|
||||
createURL: createFactory,
|
||||
updateURL: updateFactory,
|
||||
infoURL: getFactory,
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
address: undefined,
|
||||
enabled:'1',
|
||||
remark: undefined,
|
||||
},
|
||||
typeArr: [],
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '产品编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '产品名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
35
src/views/product&recipe/recipe/changeStatus.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<el-switch
|
||||
@change="changeStatus"
|
||||
size="small"
|
||||
v-model="list.enabled"
|
||||
:active-value="1"
|
||||
:inactive-value="0"></el-switch>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateGroup } from '@/api/group/groupSetting';
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData,
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
changeStatus(val) {
|
||||
const data = { ...this.injectData, enabled: val };
|
||||
updateGroup(data).then((res) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.$emit('emitData');
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
229
src/views/product&recipe/recipe/index.vue
Normal file
@@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="getDataList">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="90"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
width="50%">
|
||||
<add-or-update
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import changeStatus from './changeStatus.vue';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import {
|
||||
deleteFactory,
|
||||
getFactoryPage,
|
||||
exportFactoryExcel,
|
||||
} from '@/api/core/base/factory';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'code',
|
||||
label: '产品编码',
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产品名称',
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: '规格型号',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '产品分类',
|
||||
},
|
||||
{
|
||||
prop: 'remark1',
|
||||
label: '创建人',
|
||||
width: 90,
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '时间',
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '状态',
|
||||
subcomponent: changeStatus,
|
||||
width: 80,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getFactoryPage,
|
||||
deleteURL: deleteFactory,
|
||||
exportURL: exportFactoryExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`base:factory:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:factory:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '适用框绞线',
|
||||
selectOptions: [],
|
||||
param: 'val1',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '修改人',
|
||||
selectOptions: [],
|
||||
param: 'val2',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
selectOptions: [
|
||||
{ id: 1, name: '正常' },
|
||||
{ id: 2, name: '停用' },
|
||||
],
|
||||
param: 'val3',
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '最后修改时间',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
label: '产品编码',
|
||||
placeholder: '产品编码',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.val1 = val.val1;
|
||||
this.listQuery.val2 = val.val2;
|
||||
this.listQuery.val3 = val.val3;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case 'export':
|
||||
this.handleExport();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2022-06-14 14:28:55
|
||||
* @LastEditTime: 2023-08-15 15:48:39
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
*/
|
||||
const EventListener = {
|
||||
/**
|
||||
* Listen to DOM events during the bubble phase.
|
||||
*
|
||||
* @param {DOMEventTarget} target DOM element to register listener on.
|
||||
* @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
|
||||
* @param {function} callback Callback function.
|
||||
* @return {object} Object with a `remove` method.
|
||||
*/
|
||||
listen(target, eventType, callback) {
|
||||
if (target.addEventListener) {
|
||||
// console.log(1111)
|
||||
target.addEventListener(eventType, callback, false)
|
||||
return {
|
||||
remove() {
|
||||
target.removeEventListener(eventType, callback, false)
|
||||
}
|
||||
}
|
||||
} else if (target.attachEvent) {
|
||||
// console.log(222)
|
||||
target.attachEvent('on' + eventType, callback)
|
||||
return {
|
||||
remove() {
|
||||
target.detachEvent('on' + eventType, callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default EventListener
|
||||
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<header class="report-header">
|
||||
<!-- logo 放在最左侧 -->
|
||||
<!-- <img style="width: 221px;height: 31px;" src="" alt="benmaLogo" class="logo"> -->
|
||||
<!-- 标题居中显示 -->
|
||||
<!-- <h1>{{ topTitle }}</h1> -->
|
||||
<!-- 实时时间显示 -->
|
||||
<div class="header-right">
|
||||
<img style="width: 426px;height: 44px;" src="../../../../assets/img/ssdlLeftTitle.png" alt="">
|
||||
<!-- <div class="current-time">
|
||||
<div class="YMD">{{ YMD }}</div>
|
||||
<div class="time">{{ time }}</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<img style="width: 426px;height: 44px;" src="../../../../assets/img/ssdlTitle.png" alt="">
|
||||
<div class="current-time">
|
||||
<div class="YMD">{{ YMD }}</div>
|
||||
<div class="time">{{ time }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 全屏按钮保持在右侧 -->
|
||||
<el-button type="text" class="screen-btn" :title="isFullScreen ? '退出全屏' : '全屏'" @click="changeFullScreen">
|
||||
<svg-icon v-if="isFullScreen" icon-class="unFullScreenView" />
|
||||
<svg-icon v-else icon-class="fullScreenView" />
|
||||
</el-button>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Header',
|
||||
props: {
|
||||
isFullScreen: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
topTitle: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
time: '',
|
||||
YMD:'',
|
||||
timeTimer: null // 用于存储定时器
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeFullScreen() {
|
||||
this.$emit('screenfullChange')
|
||||
},
|
||||
exportPDF() {
|
||||
this.$emit('exportPDF')
|
||||
},
|
||||
// 更新当前时间
|
||||
updateTime() {
|
||||
const now = new Date()
|
||||
const hours = this.padZero(now.getHours())
|
||||
const minutes = this.padZero(now.getMinutes())
|
||||
// 新增:获取并格式化秒数
|
||||
const seconds = this.padZero(now.getSeconds())
|
||||
|
||||
const year = now.getFullYear()
|
||||
const month = this.padZero(now.getMonth() + 1) // 补充月份补零,避免单数字月份(如3月显示为"3")
|
||||
const day = this.padZero(now.getDate()) // 补充日期补零
|
||||
|
||||
// 时间格式更新为:时:分:秒
|
||||
this.time = `${hours}:${minutes}:${seconds}`
|
||||
// 日期格式优化:月份和日期补零(如2025.3.5 → 2025.03.05)
|
||||
this.YMD = `${year}.${month}.${day}`
|
||||
},
|
||||
// 补零函数保持不变(确保时分秒都是两位数)
|
||||
padZero(num) {
|
||||
return num < 10 ? '0' + num : num
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 初始化时间
|
||||
this.updateTime()
|
||||
// 设置定时器,每秒更新一次时间
|
||||
this.timeTimer = setInterval(this.updateTime, 1000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 组件销毁前清除定时器,防止内存泄漏
|
||||
if (this.timeTimer) {
|
||||
clearInterval(this.timeTimer)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.report-header {
|
||||
width: 1920px;
|
||||
height: 72px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 1px 4px 0px rgba(0, 21, 41, 0.12);
|
||||
display: flex;
|
||||
justify-content:space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
padding: 0 20px;
|
||||
|
||||
// .logo {
|
||||
// position: absolute;
|
||||
// left: 40px;
|
||||
// top: 15px;
|
||||
// height: auto;
|
||||
// object-fit: contain;
|
||||
// }
|
||||
.header-right{
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
}
|
||||
h1 {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 48px;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: 28px;
|
||||
text-shadow: 1px 7px 2px #002144;
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
// 实时时间样式
|
||||
.current-time {
|
||||
// position: absolute;
|
||||
// right: 100px; // 位于全屏按钮左侧
|
||||
// top: 20px;
|
||||
color: rgba(0, 0, 0, 0.85); // 假设使用白色文字,可根据实际设计调整
|
||||
// font-size: 22px; // 可根据需要调整大小
|
||||
font-weight: 600;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
letter-spacing: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.YMD{
|
||||
font-weight: 600;
|
||||
}
|
||||
.time{
|
||||
// width: 87px;
|
||||
// height: 14px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
color:rgba(0, 0, 0, 0.85);;
|
||||
// line-height: 14px;
|
||||
letter-spacing: 1px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.screen-btn {
|
||||
color: #00fff0;
|
||||
font-size: 26px;
|
||||
position: absolute;
|
||||
right: 21px;
|
||||
top: 85px;
|
||||
transform: translateY(-50%);
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,299 @@
|
||||
<template>
|
||||
<div style="flex: 1">
|
||||
<div class="agvStatusContent">
|
||||
<div class="title">AGV状态</div>
|
||||
<div class="agvDetailData">
|
||||
<div class="item" v-for="(agv, index) in agvList" :key="agv.id">
|
||||
<img class="car" src="../../../../assets/img/agvCar.png" alt="AGV小车">
|
||||
<div class="eqInfo">
|
||||
<div class="eqCode">
|
||||
<div class="num">{{ index + 1 }}</div>
|
||||
<div class="code">{{ agv.code }}</div>
|
||||
</div>
|
||||
<div class="eqStatusData">
|
||||
<!-- 状态图标 -->
|
||||
<img style="width: 16px; height: 16px; margin-right: 4px;" :src="require(`@/assets/img/${agv.statusImg}`)"
|
||||
:alt="agv.status">
|
||||
<!-- 状态文字(固定宽度) -->
|
||||
<div class="runningState" :style="getStatusColor(agv.status)">
|
||||
{{ agv.status }}
|
||||
</div>
|
||||
<!-- 动态栅格容器 -->
|
||||
<div class="charge" :class="{
|
||||
'charge--run': agv.status !== '充电中', // 运行中/待命用run背景
|
||||
'charge--charge': agv.status === '充电中' // 充电中用charge背景
|
||||
}">
|
||||
<div class="grid-item" :style="{ backgroundColor: getGridColor(agv.status) }"
|
||||
v-for="(grid, idx) in generateGridArray(getGridCount(agv.progress))" :key="idx"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qty">
|
||||
<div class="num">{{ agv.completed }}</div>
|
||||
<div class="qtyTitle">今日完成</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AGVStatus',
|
||||
components: {},
|
||||
props: {
|
||||
energyObj: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
electricComu: 0,
|
||||
steamComu: 0
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
agvList: [
|
||||
{
|
||||
id: 1,
|
||||
code: '设备编号1212121',
|
||||
status: '运行中',
|
||||
statusImg: 'runCircle.png',
|
||||
completed: 47,
|
||||
progress: 80 // 进度80% → 显示4个栅格
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
code: '设备编号3434343',
|
||||
status: '待命',
|
||||
statusImg: 'standbyCircle.png',
|
||||
completed: 23,
|
||||
progress: 40 // 进度40% → 显示2个栅格
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
code: '设备编号5656565',
|
||||
status: '充电中',
|
||||
statusImg: 'chargeCircle.png',
|
||||
completed: 15,
|
||||
progress: 100 // 进度100% → 显示5个栅格
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
code: '设备编号7878787',
|
||||
status: '充电中',
|
||||
statusImg: 'chargeCircle.png',
|
||||
completed: 31,
|
||||
progress: 60 // 进度60% → 显示3个栅格
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取状态文字颜色
|
||||
getStatusColor(status) {
|
||||
const baseStyle = {
|
||||
color: '', // 默认颜色
|
||||
letterSpacing: '0px' // 默认字间距
|
||||
};
|
||||
|
||||
switch (status) {
|
||||
case '运行中':
|
||||
baseStyle.color = '#0A4BFF';
|
||||
break;
|
||||
case '待命':
|
||||
baseStyle.color = 'rgba(245, 154, 36, 1)';
|
||||
baseStyle.letterSpacing = '8px'; // 待命状态单独加字间距(可调整数值)
|
||||
break;
|
||||
case '充电中':
|
||||
baseStyle.color = 'rgba(0, 225, 37, 1)';
|
||||
break;
|
||||
default:
|
||||
baseStyle.color = '';
|
||||
}
|
||||
|
||||
return baseStyle;
|
||||
},
|
||||
// 根据状态获取背景图
|
||||
getBgImage(status) {
|
||||
return status === '充电中' ? 'chargeBg.png' : 'run.png';
|
||||
},
|
||||
// 根据状态获取栅格颜色
|
||||
getGridColor(status) {
|
||||
return status === '充电中'
|
||||
? 'rgba(0, 225, 37, 1)'
|
||||
: 'rgba(120, 138, 221, 1)';
|
||||
},
|
||||
getGridCount(progress) {
|
||||
// 总栅格位置为5个,进度0%→0个,100%→5个,按比例取整
|
||||
const totalGrids = 5;
|
||||
return Math.ceil((progress / 100) * totalGrids);
|
||||
},
|
||||
|
||||
// 生成栅格数组(用于v-for遍历)
|
||||
generateGridArray(count) {
|
||||
// 生成 [1,2,...,count] 的数组,长度为count
|
||||
return Array.from({ length: count }, (_, i) => i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.agvStatusContent {
|
||||
width: 367px;
|
||||
height: 512px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 16px 18px 26px;
|
||||
|
||||
.title {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 16px;
|
||||
letter-spacing: 1px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #0A4BFF;
|
||||
border-radius: 1px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.agvDetailData {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
|
||||
.item {
|
||||
width: 332px;
|
||||
height: 101px;
|
||||
padding: 22px 0 0 10px;
|
||||
display: flex;
|
||||
background: url('../../../../assets/img/agvItemBg.png') no-repeat;
|
||||
background-size: cover;
|
||||
|
||||
.car {
|
||||
width: 66px;
|
||||
height: 57px;
|
||||
}
|
||||
|
||||
.eqInfo {
|
||||
margin-left: 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
|
||||
.eqCode {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.num {
|
||||
width: 21px;
|
||||
height: 24px;
|
||||
background: #0065FF;
|
||||
backdrop-filter: blur(1.5px);
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #FFFFFF;
|
||||
line-height: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.code {
|
||||
margin-left: 4px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #020203;
|
||||
line-height: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
.eqStatusData {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
// 状态文字固定宽度(确保三种状态宽度一致)
|
||||
.runningState {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
width: 48px; // 固定宽度,适配三种状态文字
|
||||
text-align: left; // 左对齐,避免空格填充
|
||||
}
|
||||
|
||||
// 栅格容器样式
|
||||
.charge {
|
||||
width: 73px;
|
||||
height: 27px;
|
||||
margin-left: 5px;
|
||||
background-size: 100% 100% !important;
|
||||
background-repeat: no-repeat !important;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
gap: 1px;
|
||||
padding: 5px 0px 4px 3px;
|
||||
|
||||
// 运行中/待命状态的背景图
|
||||
&.charge--run {
|
||||
background-image: url('../../../../assets/img/runBg.png');
|
||||
}
|
||||
|
||||
// 充电中状态的背景图
|
||||
&.charge--charge {
|
||||
background-image: url('../../../../assets/img/chargeBg.png');
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
width: 12px;
|
||||
height: 18px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.qty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 24px;
|
||||
gap: 12px;
|
||||
|
||||
.num {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 31px;
|
||||
color: #000000;
|
||||
line-height: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.qtyTitle {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: rgba(2, 2, 3, 0.6);
|
||||
line-height: 18px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<div style="flex: 1">
|
||||
<div class="agvStatusContent">
|
||||
<div class="title">异常报警</div>
|
||||
<div class="alarm-item" style="margin-top: 13px;">
|
||||
<div class="item">
|
||||
9:05:21|FMS|AGV-03顶升失败,任务TSK25-1004中断
|
||||
</div>
|
||||
<div class="item">
|
||||
9:05:21|FMS|AGV-03顶升失败,任务TSK25-1004中断
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import baseTable from './baseTable.vue'
|
||||
// import baseStatus from './baseStatus.vue'
|
||||
// import handingObject from './handingObject.vue'
|
||||
export default {
|
||||
name: 'AGVStatus',
|
||||
components: {},
|
||||
props: {
|
||||
// energyObj: {
|
||||
// type: Object,
|
||||
// default: () => ({
|
||||
// electricComu: 0,
|
||||
// steamComu: 0
|
||||
// })
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.agvStatusContent {
|
||||
width: 930px;
|
||||
height: 92px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 16px 18px 0 18px;
|
||||
|
||||
.title {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 16px;
|
||||
letter-spacing: 1px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #0A4BFF;
|
||||
border-radius: 1px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.alarm-item {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
|
||||
.item {
|
||||
width: 436px;
|
||||
height: 32px;
|
||||
border: 1px rgba(0, 0, 0, 0.3) dashed;
|
||||
background: url('../../../../assets/img/alarmItemBg.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
padding: 0 16px;
|
||||
color: #000000;
|
||||
line-height: 32px;
|
||||
letter-spacing: 1px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<div style="flex: 1">
|
||||
<div class="agvStatusContent">
|
||||
<div class="title">异常原因Top5</div>
|
||||
<div class="alarm-item" style="margin-top: 14px;">
|
||||
<div class="item top1">
|
||||
<dov class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
<div class="data-detail">
|
||||
<div class="data-title">
|
||||
放货有货
|
||||
</div>
|
||||
<div class="data-num">
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
<div class="item top2">
|
||||
<dov class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
<div class="data-detail">
|
||||
<div class="data-title">
|
||||
车辆故障
|
||||
</div>
|
||||
<div class="data-num">
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
<div class="item top3">
|
||||
<dov class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
<div class="data-detail">
|
||||
<div class="data-title">
|
||||
下发失败
|
||||
</div>
|
||||
<div class="data-num">
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
<div class="item top4">
|
||||
<dov class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
<div class="data-detail">
|
||||
<div class="data-title">
|
||||
取货无货
|
||||
</div>
|
||||
<div class="data-num">
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
<div class="item top5">
|
||||
<dov class="item-data">
|
||||
<div class="data-unit">
|
||||
单位/次
|
||||
</div>
|
||||
<div class="data-detail">
|
||||
<div class="data-title">
|
||||
通信中断
|
||||
</div>
|
||||
<div class="data-num">
|
||||
261,938,984
|
||||
</div>
|
||||
</div>
|
||||
</dov>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import baseTable from './baseTable.vue'
|
||||
// import baseStatus from './baseStatus.vue'
|
||||
// import handingObject from './handingObject.vue'
|
||||
export default {
|
||||
name: 'AGVStatus',
|
||||
components: {},
|
||||
props: {
|
||||
// energyObj: {
|
||||
// type: Object,
|
||||
// default: () => ({
|
||||
// electricComu: 0,
|
||||
// steamComu: 0
|
||||
// })
|
||||
// }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.agvStatusContent {
|
||||
width: 402px;
|
||||
height: 442px;
|
||||
background: #FFFFFF;
|
||||
border-radius: 8px;
|
||||
padding: 16px 24px;
|
||||
|
||||
.title {
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 16px;
|
||||
letter-spacing: 1px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #0A4BFF;
|
||||
border-radius: 1px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.alarm-item {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
flex-direction: column;
|
||||
|
||||
.item {
|
||||
width: 354px;
|
||||
height: 70px;
|
||||
background: url('../../../../assets/img/alarmItemBg.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
|
||||
.item-data {
|
||||
margin-left: 95px;
|
||||
margin-top: 14px;
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
flex-direction: column;
|
||||
|
||||
.data-unit {
|
||||
// width: 58px;
|
||||
// height: 17px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color:rgba(0, 0, 0, 0.7);
|
||||
line-height: 17px;
|
||||
letter-spacing: 2px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.data-detail {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
|
||||
.data-title {
|
||||
// width: 80px;
|
||||
// height: 17px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
line-height: 17px;
|
||||
letter-spacing: 1px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
.data-num{
|
||||
// width: 138px;
|
||||
// height: 17px;
|
||||
font-family: PingFangSC, PingFang SC;
|
||||
font-weight: 400;
|
||||
font-size: 24px;
|
||||
color: #000000;
|
||||
line-height: 12px;
|
||||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top1 {
|
||||
background: url('../../../../assets/img/Top1.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.top2 {
|
||||
background: url('../../../../assets/img/Top2.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.top3 {
|
||||
background: url('../../../../assets/img/Top3.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.top4 {
|
||||
background: url('../../../../assets/img/Top4.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.top5 {
|
||||
background: url('../../../../assets/img/Top5.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,294 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-09-16 18:52:57
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
class="base-container"
|
||||
:style="{ height: '100%', fontSize: 12 * beilv + 'px', padding: 12 * beilv + 'px' }"
|
||||
:class="{ 'no-padding': noPadding, 'border-none': !showLine }"
|
||||
>
|
||||
<!-- <div class="base-container" :style="{height: height * beilv + 'px', fontSize: 12 * beilv + 'px', padding: 12 * beilv + 'px'}"> -->
|
||||
<template v-if="showLine">
|
||||
<div class="line" />
|
||||
<div class="line line-vertical" />
|
||||
<div class="line line-right" />
|
||||
<div class="line line-right-vertical" />
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
</template>
|
||||
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title">
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
<span class="title">
|
||||
<!-- <svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" /> -->
|
||||
{{ title }}
|
||||
</span>
|
||||
<span class="colorBlock One" />
|
||||
<span class="colorBlock Two" />
|
||||
<span class="colorBlock Three" />
|
||||
<span class="colorBlock Four" />
|
||||
|
||||
</div>
|
||||
<div class="bar-content" :class="{ 'p-0': noContentPadding }">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseContainer',
|
||||
props: {
|
||||
showLine: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
noContentPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
titleIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
baseSize: {
|
||||
type: Number,
|
||||
default: 12
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
changeTab(num) {
|
||||
this.curIndex = num
|
||||
this.$emit('tabSelect', num)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
// opacity: 0.65;
|
||||
border-bottom: 2px solid;
|
||||
border-image: linear-gradient(90deg, rgba(195, 255, 251, 0), rgba(0, 255, 236, 1), rgba(144, 255, 246, 0)) 2 2;
|
||||
filter: blur(0px);
|
||||
filter: blur(0px);
|
||||
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 1px solid #52fff1;
|
||||
width: .8em;
|
||||
top: -0.1em;
|
||||
left: -0.1em;
|
||||
&-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
left: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-right {
|
||||
top: -0.1em;
|
||||
right: .01em;
|
||||
left: inherit;
|
||||
}
|
||||
|
||||
&-right-vertical {
|
||||
top: calc(-2em / 12);
|
||||
right: calc(-1em / 12);
|
||||
left: inherit;
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
bottom: 0.01em;
|
||||
left: -0.1em;
|
||||
}
|
||||
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(1em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
bottom: 0.01em;
|
||||
right: 0.01em;
|
||||
}
|
||||
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-1em / 12);
|
||||
bottom: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
|
||||
.bar-item {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bar-title {
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, rgba(75, 239, 255, 0.28) 0%, rgba(0, 169, 205, 0) 20%,), linear-gradient(180deg, rgba(75, 239, 255, 0.28) 0%,
|
||||
rgba(0, 169, 205, 0) 20%);
|
||||
backdrop-filter: blur(1.5px);
|
||||
color: #52fff1;
|
||||
.colorBlock{
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #31A6AE;
|
||||
opacity: 0.84;
|
||||
backdrop-filter: blur(1.5px);
|
||||
margin-left: 39em;
|
||||
// margin-top: 1.2em;
|
||||
}
|
||||
.Two{
|
||||
opacity: 0.55;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
.Three {
|
||||
opacity: 0.29;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
.Four {
|
||||
opacity: 0.16;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
font-size: 1.5em;
|
||||
height: 3em;
|
||||
position: relative;
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 1px solid #52fff1;
|
||||
width: .5em;
|
||||
// top: -0.1em;
|
||||
// left: -0.1em;
|
||||
|
||||
// &-vertical {
|
||||
// // top: calc(-5em / 12);
|
||||
// left: calc(-1em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
|
||||
// &-right {
|
||||
// top: -0.1em;
|
||||
// right: .01em;
|
||||
// left: inherit;
|
||||
// }
|
||||
|
||||
// &-right-vertical {
|
||||
// top: calc(-2em / 12);
|
||||
// right: calc(-1em / 12);
|
||||
// left: inherit;
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
bottom: 0.01em;
|
||||
left: -0.1em;
|
||||
}
|
||||
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(1em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
bottom: 0.01em;
|
||||
right: 0.01em;
|
||||
}
|
||||
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-0.1em / 12);
|
||||
bottom: calc(.1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
margin-left: 1.75em;
|
||||
margin-top: 1em;
|
||||
width: 7em;
|
||||
// height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
// padding: 0.67em;
|
||||
}
|
||||
|
||||
.bar-content {
|
||||
// padding: 1em;
|
||||
flex: 1 auto;
|
||||
}
|
||||
|
||||
.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&.border-none {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,294 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-09-16 10:04:49
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
class="base-container"
|
||||
:style="{ height: '100%', fontSize: 12 * beilv + 'px', padding: 12 * beilv + 'px' }"
|
||||
:class="{ 'no-padding': noPadding, 'border-none': !showLine }"
|
||||
>
|
||||
<!-- <div class="base-container" :style="{height: height * beilv + 'px', fontSize: 12 * beilv + 'px', padding: 12 * beilv + 'px'}"> -->
|
||||
<template v-if="showLine">
|
||||
<div class="line" />
|
||||
<div class="line line-vertical" />
|
||||
<div class="line line-right" />
|
||||
<div class="line line-right-vertical" />
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
</template>
|
||||
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title">
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
<span class="title">
|
||||
<!-- <svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" /> -->
|
||||
{{ title }}
|
||||
</span>
|
||||
<span class="colorBlock One" />
|
||||
<span class="colorBlock Two" />
|
||||
<span class="colorBlock Three" />
|
||||
<span class="colorBlock Four" />
|
||||
|
||||
</div>
|
||||
<div class="bar-content" :class="{ 'p-0': noContentPadding }">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BaseContainer',
|
||||
props: {
|
||||
showLine: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
noContentPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
titleIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
baseSize: {
|
||||
type: Number,
|
||||
default: 12
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curIndex: 0
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
changeTab(num) {
|
||||
this.curIndex = num
|
||||
this.$emit('tabSelect', num)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
// opacity: 0.65;
|
||||
border-bottom: 2px solid;
|
||||
border-image: linear-gradient(90deg, rgba(195, 255, 251, 0), rgba(0, 255, 236, 1), rgba(144, 255, 246, 0)) 2 2;
|
||||
filter: blur(0px);
|
||||
filter: blur(0px);
|
||||
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 1px solid #52fff1;
|
||||
width: .8em;
|
||||
top: -0.1em;
|
||||
left: -0.1em;
|
||||
&-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
left: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-right {
|
||||
top: -0.1em;
|
||||
right: .01em;
|
||||
left: inherit;
|
||||
}
|
||||
|
||||
&-right-vertical {
|
||||
top: calc(-2em / 12);
|
||||
right: calc(-1em / 12);
|
||||
left: inherit;
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
bottom: 0.01em;
|
||||
left: -0.1em;
|
||||
}
|
||||
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(1em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
bottom: 0.01em;
|
||||
right: 0.01em;
|
||||
}
|
||||
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-1em / 12);
|
||||
bottom: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
|
||||
.bar-item {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bar-title {
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, rgba(75, 239, 255, 0.28) 0%, rgba(0, 169, 205, 0) 20%,), linear-gradient(180deg, rgba(75, 239, 255, 0.28) 0%,
|
||||
rgba(0, 169, 205, 0) 20%);
|
||||
backdrop-filter: blur(1.5px);
|
||||
color: #52fff1;
|
||||
.colorBlock{
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #31A6AE;
|
||||
opacity: 0.84;
|
||||
backdrop-filter: blur(1.5px);
|
||||
margin-left: 14em;
|
||||
// margin-top: 1.2em;
|
||||
}
|
||||
.Two{
|
||||
opacity: 0.55;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
.Three {
|
||||
opacity: 0.29;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
.Four {
|
||||
opacity: 0.16;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
font-size: 1.5em;
|
||||
height: 3em;
|
||||
position: relative;
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 1px solid #52fff1;
|
||||
width: .5em;
|
||||
// top: -0.1em;
|
||||
// left: -0.1em;
|
||||
|
||||
// &-vertical {
|
||||
// // top: calc(-5em / 12);
|
||||
// left: calc(-1em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
|
||||
// &-right {
|
||||
// top: -0.1em;
|
||||
// right: .01em;
|
||||
// left: inherit;
|
||||
// }
|
||||
|
||||
// &-right-vertical {
|
||||
// top: calc(-2em / 12);
|
||||
// right: calc(-1em / 12);
|
||||
// left: inherit;
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
bottom: 0.01em;
|
||||
left: -0.1em;
|
||||
}
|
||||
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(1em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
bottom: 0.01em;
|
||||
right: 0.01em;
|
||||
}
|
||||
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-0.1em / 12);
|
||||
bottom: calc(.1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
margin-left: 1.75em;
|
||||
margin-top: 1em;
|
||||
width: 6em;
|
||||
// height: 100%;
|
||||
display: inline-block;
|
||||
}
|
||||
// padding: 0.67em;
|
||||
}
|
||||
|
||||
.bar-content {
|
||||
// padding: 1em;
|
||||
flex: 1 auto;
|
||||
}
|
||||
|
||||
.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&.border-none {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,348 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-12-12 14:37:29
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div
|
||||
class="base-container"
|
||||
:style="{ height: '100%', fontSize: 12 * beilv + 'px', padding: 12 * beilv + 'px' }"
|
||||
:class="{ 'no-padding': noPadding, 'border-none': !showLine }"
|
||||
>
|
||||
<!-- <div class="base-container" :style="{height: height * beilv + 'px', fontSize: 12 * beilv + 'px', padding: 12 * beilv + 'px'}"> -->
|
||||
<template v-if="showLine">
|
||||
<div class="line" />
|
||||
<div class="line line-vertical" />
|
||||
<div class="line line-right" />
|
||||
<div class="line line-right-vertical" />
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
</template>
|
||||
|
||||
<div class="bar-item">
|
||||
<div v-if="title" class="bar-title">
|
||||
<div class="line line-bottom" />
|
||||
<div class="line line-bottom-vertical" />
|
||||
<div class="line line-bottom-right" />
|
||||
<div class="line line-bottom-right-vertical" />
|
||||
<div>
|
||||
<div class="title">
|
||||
<!-- <svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" /> -->
|
||||
{{ title }}
|
||||
</div>
|
||||
<span :class="curIndex === 1 ? 'num' : 'numTwo'" @click="changeTab(1)">
|
||||
芯片数量
|
||||
<!-- <top-radio-group :data-type="0" @change-time-range="handleChangeOptions('产出数量图', $event)" /> -->
|
||||
</span>
|
||||
<span :class="curIndex === 2 ? 'num' : 'numTwo'" @click="changeTab(2)">
|
||||
组件数量
|
||||
<!-- <top-radio-group :data-type="0" @change-time-range="handleChangeOptions('产出数量图', $event)" /> -->
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="bar-content" :class="{ 'p-0': noContentPadding }">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import TopRadioGroup from '../topRadioGroup'
|
||||
export default {
|
||||
name: 'BaseContainer',
|
||||
// components: {
|
||||
// TopRadioGroup
|
||||
// },
|
||||
props: {
|
||||
showLine: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
noContentPadding: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
titleIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
height: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
baseSize: {
|
||||
type: Number,
|
||||
default: 12
|
||||
},
|
||||
beilv: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
curIndex: 1
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
changeTab(num) {
|
||||
this.curIndex = num
|
||||
this.$emit('tabSelect', num)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.base-container {
|
||||
color: #fff;
|
||||
width: 100%;
|
||||
background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
// opacity: 0.65;
|
||||
border-bottom: 2px solid;
|
||||
border-image: linear-gradient(90deg, rgba(195, 255, 251, 0), rgba(0, 255, 236, 1), rgba(144, 255, 246, 0)) 2 2;
|
||||
filter: blur(0px);
|
||||
filter: blur(0px);
|
||||
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 1px solid #52fff1;
|
||||
width: .8em;
|
||||
top: -0.1em;
|
||||
left: -0.1em;
|
||||
&-vertical {
|
||||
// top: calc(-5em / 12);
|
||||
left: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-right {
|
||||
top: -0.1em;
|
||||
right: .01em;
|
||||
left: inherit;
|
||||
}
|
||||
|
||||
&-right-vertical {
|
||||
top: calc(-2em / 12);
|
||||
right: calc(-1em / 12);
|
||||
left: inherit;
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
bottom: 0.01em;
|
||||
left: -0.1em;
|
||||
}
|
||||
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(1em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
bottom: 0.01em;
|
||||
right: 0.01em;
|
||||
}
|
||||
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-1em / 12);
|
||||
bottom: calc(-1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
|
||||
.bar-item {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bar-title {
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, rgba(75, 239, 255, 0.28) 0%, rgba(0, 169, 205, 0) 20%,), linear-gradient(180deg, rgba(75, 239, 255, 0.28) 0%,
|
||||
rgba(0, 169, 205, 0) 20%);
|
||||
backdrop-filter: blur(1.5px);
|
||||
color: #52fff1;
|
||||
.colorBlock{
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #31A6AE;
|
||||
opacity: 0.84;
|
||||
backdrop-filter: blur(1.5px);
|
||||
margin-left: 14em;
|
||||
// margin-top: 1.2em;
|
||||
}
|
||||
.Two{
|
||||
opacity: 0.55;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
.Three {
|
||||
opacity: 0.29;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
.Four {
|
||||
opacity: 0.16;
|
||||
margin-left: 0.375em;
|
||||
}
|
||||
font-size: 1.5em;
|
||||
height: 3em;
|
||||
position: relative;
|
||||
.line {
|
||||
position: absolute;
|
||||
border-top: 1px solid #52fff1;
|
||||
width: .5em;
|
||||
// top: -0.1em;
|
||||
// left: -0.1em;
|
||||
|
||||
// &-vertical {
|
||||
// // top: calc(-5em / 12);
|
||||
// left: calc(-1em / 12);
|
||||
// transform: rotate(90deg);
|
||||
// transform-origin: left;
|
||||
// }
|
||||
|
||||
// &-right {
|
||||
// top: -0.1em;
|
||||
// right: .01em;
|
||||
// left: inherit;
|
||||
// }
|
||||
|
||||
// &-right-vertical {
|
||||
// top: calc(-2em / 12);
|
||||
// right: calc(-1em / 12);
|
||||
// left: inherit;
|
||||
// transform: rotate(-90deg);
|
||||
// transform-origin: right;
|
||||
// }
|
||||
|
||||
&-bottom {
|
||||
top: inherit;
|
||||
bottom: 0.01em;
|
||||
left: -0.1em;
|
||||
}
|
||||
|
||||
&-bottom-vertical {
|
||||
top: inherit;
|
||||
left: calc(-1em / 12);
|
||||
bottom: calc(1em / 12);
|
||||
transform: rotate(-90deg);
|
||||
transform-origin: left;
|
||||
}
|
||||
|
||||
&-bottom-right {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
bottom: 0.01em;
|
||||
right: 0.01em;
|
||||
}
|
||||
|
||||
&-bottom-right-vertical {
|
||||
top: inherit;
|
||||
left: inherit;
|
||||
right: calc(-0.1em / 12);
|
||||
bottom: calc(.1em / 12);
|
||||
transform: rotate(90deg);
|
||||
transform-origin: right;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
margin-left: 1.75em;
|
||||
margin-top: 1em;
|
||||
width: 6em;
|
||||
float: left;
|
||||
// height: 100%;
|
||||
// display: inline-block;
|
||||
}
|
||||
// padding: 0.67em;
|
||||
}
|
||||
|
||||
.bar-content {
|
||||
// padding: 1em;
|
||||
flex: 1 auto;
|
||||
}
|
||||
|
||||
.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&.border-none {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
.num{
|
||||
font-size: 12px;
|
||||
display: inline-block;
|
||||
margin-top: 14px;
|
||||
margin-left: 0.5em;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 18px;
|
||||
}
|
||||
.num:after {
|
||||
content: '';
|
||||
// bottom: 20%;
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
display: inline-block;
|
||||
// margin-left: 24px;
|
||||
margin-bottom: 4px;
|
||||
box-shadow: 0px 0px 2px 0px rgba(82, 255, 241, 0.34);
|
||||
border: 1px solid;
|
||||
border-image: linear-gradient(90deg, rgba(138, 255, 249, 0), rgba(112, 255, 245, 1), rgba(82, 255, 241, 0)) 2 2;
|
||||
}
|
||||
.numTwo{
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 18px;
|
||||
opacity: .39;
|
||||
margin-left: .5em;
|
||||
}
|
||||
.numTwo:after {
|
||||
content: '';
|
||||
// bottom: 20%;
|
||||
width: 100%;
|
||||
// height: 1px;
|
||||
// border-bottom: 1px solid #ccc;
|
||||
display: inline-block;
|
||||
// margin-left: 24px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||