Compare commits
	
		
			10 Commits
		
	
	
		
			projects/z
			...
			projects/r
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					1b56696da9 | ||
| bbd9972761 | |||
| 8e9b2f6444 | |||
| c83a7afadb | |||
| b43876fe67 | |||
| f143c5e2d9 | |||
| 0b03e6d44b | |||
| 19dbe38458 | |||
| 43ba33062b | |||
| ca390fd764 | 
							
								
								
									
										13
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						@@ -1,7 +1,7 @@
 | 
				
			|||||||
###
 | 
					###
 | 
				
			||||||
 # @Author: Do not edit
 | 
					 # @Author: Do not edit
 | 
				
			||||||
 # @Date: 2023-08-29 09:40:39
 | 
					 # @Date: 2023-08-29 09:40:39
 | 
				
			||||||
 # @LastEditTime: 2025-03-05 16:46:35
 | 
					 # @LastEditTime: 2024-11-25 14:31:39
 | 
				
			||||||
 # @LastEditors: zwq
 | 
					 # @LastEditors: zwq
 | 
				
			||||||
 # @Description:
 | 
					 # @Description:
 | 
				
			||||||
###
 | 
					###
 | 
				
			||||||
@@ -9,16 +9,11 @@
 | 
				
			|||||||
ENV = 'development'
 | 
					ENV = 'development'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 页面标题
 | 
					# 页面标题
 | 
				
			||||||
VUE_APP_TITLE = 成本管理系统
 | 
					VUE_APP_TITLE = 智能监控分析系统
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 芋道管理系统/开发环境
 | 
					# 芋道管理系统/开发环境
 | 
				
			||||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48080'
 | 
					# VUE_APP_BASE_API = 'http://192.168.8.22:48080'
 | 
				
			||||||
# VUE_APP_BASE_API = 'http://line-sczg.kszny.picaiba.com'
 | 
					VUE_APP_BASE_API = 'http://172.16.32.79:48082'
 | 
				
			||||||
VUE_APP_BASE_API = 'http://100.64.0.45:48080'
 | 
					 | 
				
			||||||
# VUE_APP_BASE_API = 'http://172.16.33.10:48080'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# ws地址
 | 
					 | 
				
			||||||
VUE_APP_WS_API = 'ws://100.64.0.45:48080'
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 路由懒加载
 | 
					# 路由懒加载
 | 
				
			||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
 | 
					VUE_CLI_BABEL_TRANSPILE_MODULES = true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,14 +2,14 @@
 | 
				
			|||||||
 # @Author: zwq
 | 
					 # @Author: zwq
 | 
				
			||||||
 # @Date: 2024-03-27 15:49:55
 | 
					 # @Date: 2024-03-27 15:49:55
 | 
				
			||||||
 # @LastEditors: zwq
 | 
					 # @LastEditors: zwq
 | 
				
			||||||
 # @LastEditTime: 2025-03-05 16:30:45
 | 
					 # @LastEditTime: 2024-10-30 11:08:47
 | 
				
			||||||
 # @Description:
 | 
					 # @Description:
 | 
				
			||||||
###
 | 
					###
 | 
				
			||||||
# 生产环境配置
 | 
					# 生产环境配置
 | 
				
			||||||
ENV = 'production'
 | 
					ENV = 'production'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 页面标题
 | 
					# 页面标题
 | 
				
			||||||
VUE_APP_TITLE = 成本管理系统
 | 
					VUE_APP_TITLE = 智能监控分析系统
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 芋道管理系统/生产环境
 | 
					# 芋道管理系统/生产环境
 | 
				
			||||||
# VUE_APP_BASE_API = '/prod-api'
 | 
					# VUE_APP_BASE_API = '/prod-api'
 | 
				
			||||||
@@ -20,9 +20,6 @@ VUE_APP_BASE_API = ''
 | 
				
			|||||||
# PUBLIC_PATH = 'http://192.168.0.33:8888/'
 | 
					# PUBLIC_PATH = 'http://192.168.0.33:8888/'
 | 
				
			||||||
PUBLIC_PATH = ''
 | 
					PUBLIC_PATH = ''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ws地址
 | 
					 | 
				
			||||||
VUE_APP_WS_API = 'ws://10.1.17.10:48080'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# 二级部署路径
 | 
					# 二级部署路径
 | 
				
			||||||
VUE_APP_APP_NAME ='yudao-admin'
 | 
					VUE_APP_APP_NAME ='yudao-admin'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						@@ -20,6 +20,4 @@ selenium-debug.log
 | 
				
			|||||||
*.local
 | 
					*.local
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package-lock.json
 | 
					package-lock.json
 | 
				
			||||||
echarts.js
 | 
					echarts.js
 | 
				
			||||||
sync_line_sczg_prod.bat
 | 
					 | 
				
			||||||
sync_line_sczg_aliyun.bat
 | 
					 | 
				
			||||||
@@ -1,3 +1,10 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * @Author: zwq
 | 
				
			||||||
 | 
					 * @Date: 2024-10-29 09:47:40
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-02-26 16:27:48
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
import request from '@/utils/request'
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 创建实时数据采集配置
 | 
					// 创建实时数据采集配置
 | 
				
			||||||
@@ -52,3 +59,11 @@ export function exportEquipmentPlcExcel(query) {
 | 
				
			|||||||
    responseType: 'blob'
 | 
					    responseType: 'blob'
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得code
 | 
				
			||||||
 | 
					export function getCode() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/equipment-group/getCode',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,10 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * @Author: zwq
 | 
				
			||||||
 | 
					 * @Date: 2024-10-29 09:47:40
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-02-12 09:25:11
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
import request from '@/utils/request'
 | 
					import request from '@/utils/request'
 | 
				
			||||||
// 获得工厂产线工段设备树形结构
 | 
					// 获得工厂产线工段设备树形结构
 | 
				
			||||||
export function getTree() {
 | 
					export function getTree() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -51,6 +51,13 @@ export function getCode() {
 | 
				
			|||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得可用的班次列表
 | 
				
			||||||
 | 
					export function listClassesEnabled() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-classes/listEnable',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
// 导出班次基础信息 Excel
 | 
					// 导出班次基础信息 Excel
 | 
				
			||||||
export function exportGroupClassesExcel(query) {
 | 
					export function exportGroupClassesExcel(query) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										125
									
								
								src/api/base/groupSchedulingPlan.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,125 @@
 | 
				
			|||||||
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 创建排班计划配置基础信息
 | 
				
			||||||
 | 
					export function createGroupPlan(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/create',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 更新排班计划配置基础信息
 | 
				
			||||||
 | 
					export function updateGroupPlan(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/update',
 | 
				
			||||||
 | 
					    method: 'put',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 删除排班计划配置基础信息
 | 
				
			||||||
 | 
					export function deleteGroupPlan(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/delete?id=' + id,
 | 
				
			||||||
 | 
					    method: 'delete'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得排班计划配置基础信息
 | 
				
			||||||
 | 
					export function getGroupPlan(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/get?id=' + id,
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得排班计划配置基础信息分页
 | 
				
			||||||
 | 
					export function getGroupPlanPage(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/page',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得所有排班计划列表
 | 
				
			||||||
 | 
					export function groupPlanList() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/listAll',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 获得排班计划相关班组列表
 | 
				
			||||||
 | 
					export function groupPlanTeamList(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan-team/teamListByPlanId?planId=' + id,
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 获得排班计划相关班次列表
 | 
				
			||||||
 | 
					export function groupPlanClassesList(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan-classes/classesListByPlanId?planId=' + id,
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 获取code
 | 
				
			||||||
 | 
					export function getCode() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/getCode',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 导出排班计划配置基础信息 Excel
 | 
				
			||||||
 | 
					export function exportGroupPlanExcel(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/export-excel',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query,
 | 
				
			||||||
 | 
					    responseType: 'blob'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得产线工段树形结构
 | 
				
			||||||
 | 
					export function getGroupPlanTree() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan/getLineSectionTree',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 创建排班计划产线工段
 | 
				
			||||||
 | 
					export function createGroupPlanLine(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan-line-section/createPlanLineSection',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 更新排班计划产线工段
 | 
				
			||||||
 | 
					export function updateGroupPlanLine(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan-line-section/updatePlanLineSection',
 | 
				
			||||||
 | 
					    method: 'put',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得排班计划配置基础信息
 | 
				
			||||||
 | 
					export function getGroupPlanLine(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan-line-section/getLineSectionByPlanId?planId=' + id,
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得当前登录用户所在部门id
 | 
				
			||||||
 | 
					export function getLoginUserDeptId() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-plan-line-section/getLoginUserDeptId',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										60
									
								
								src/api/base/groupSchedulingRule.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,60 @@
 | 
				
			|||||||
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 创建排班规则基础信息
 | 
				
			||||||
 | 
					export function createGroupRule(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/create',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 作废排班规则
 | 
				
			||||||
 | 
					export function disableGroupRule(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/disable?id=' + id,
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 更新排班规则基础信息
 | 
				
			||||||
 | 
					export function updateGroupRule(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/update',
 | 
				
			||||||
 | 
					    method: 'put',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 删除排班规则基础信息
 | 
				
			||||||
 | 
					export function deleteGroupRule(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/delete?id=' + id,
 | 
				
			||||||
 | 
					    method: 'delete'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得排班规则基础信息
 | 
				
			||||||
 | 
					export function getGroupRule(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/get?id=' + id,
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得排班规则基础信息分页
 | 
				
			||||||
 | 
					export function getGroupRulePage(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/page',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 导出排班规则基础信息 Excel
 | 
				
			||||||
 | 
					export function exportGroupRuleExcel(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-scheduling-rule/export-excel',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query,
 | 
				
			||||||
 | 
					    responseType: 'blob'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -58,3 +58,49 @@ export function listEnabled() {
 | 
				
			|||||||
    method: 'get'
 | 
					    method: 'get'
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得班组组员信息分页
 | 
				
			||||||
 | 
					export function groupTeamPage(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-det/page',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得班组组员信息
 | 
				
			||||||
 | 
					export function groupTeamDet(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-det/get',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 创建班组组员信息
 | 
				
			||||||
 | 
					export function teamDetCreate(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-det/create',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 更新班组组员信息
 | 
				
			||||||
 | 
					export function teamDetUpdate(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-det/update',
 | 
				
			||||||
 | 
					    method: 'put',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 删除班组组员信息
 | 
				
			||||||
 | 
					export function teamDetDelete(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-det/delete',
 | 
				
			||||||
 | 
					    method: 'delete',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,14 @@ export function getPreset(query) {
 | 
				
			|||||||
    params: query
 | 
					    params: query
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					// 获取某月预排班
 | 
				
			||||||
 | 
					export function getScheduling(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-scheduling/getScheduling',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
// 批量创建-更新排班信息
 | 
					// 批量创建-更新排班信息
 | 
				
			||||||
export function createOrUpdateList(data) {
 | 
					export function createOrUpdateList(data) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
@@ -25,4 +32,23 @@ export function autoSet(query) {
 | 
				
			|||||||
    method: 'get',
 | 
					    method: 'get',
 | 
				
			||||||
    params: query
 | 
					    params: query
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得排班信息分页
 | 
				
			||||||
 | 
					export function schedulingPage(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-scheduling/page',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 导出Excel
 | 
				
			||||||
 | 
					export function exportSchedulingExcel(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-scheduling/export-excel',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query,
 | 
				
			||||||
 | 
					    responseType: 'blob'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										26
									
								
								src/api/base/worker.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					// 获得所有员工列表
 | 
				
			||||||
 | 
					export function getWorkerList() {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/core-worker/listAll',
 | 
				
			||||||
 | 
					    method: 'get'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得员工
 | 
				
			||||||
 | 
					export function getWorker(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/core-worker/get',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得该班组其他可选组员列表(除去现有组员)
 | 
				
			||||||
 | 
					export function otherWorkerList(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/group-team-det/otherWorkerList',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * @Author: zhp
 | 
					 * @Author: zhp
 | 
				
			||||||
 * @Date: 2023-09-12 14:07:04
 | 
					 * @Date: 2023-09-12 14:07:04
 | 
				
			||||||
 * @LastEditTime: 2023-09-13 09:53:45
 | 
					 * @LastEditTime: 2025-01-08 15:47:17
 | 
				
			||||||
 * @LastEditors: zhp
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
import request from '@/utils/request'
 | 
					import request from '@/utils/request'
 | 
				
			||||||
@@ -22,3 +22,26 @@ export function getCT(data) {
 | 
				
			|||||||
    data: data
 | 
					    data: data
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					// 获取产线平衡分析数据(new)
 | 
				
			||||||
 | 
					export function getNewCTNow(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/analysis/production-analysis/getNewCTNow',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 获取产线平衡分析数据趋势图(new)
 | 
				
			||||||
 | 
					export function getNewCTCharts(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/analysis/production-analysis/getNewCTCharts',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 获取产线平衡分析数据设备list(new)
 | 
				
			||||||
 | 
					export function getNewCTDet(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/analysis/production-analysis/getNewCTDet?lineId='+id,
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,3 +58,12 @@ export function exportFactoryExcel(query) {
 | 
				
			|||||||
    responseType: 'blob'
 | 
					    responseType: 'blob'
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					// 获取产线设备状态
 | 
				
			||||||
 | 
					export function getLineEqStatus(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/production-line/getLineEqStatus',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										28
									
								
								src/api/core/base/lineBindProcess.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 切换工艺
 | 
				
			||||||
 | 
					export function switchLineBindProcess(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/line-bind-process/switch',
 | 
				
			||||||
 | 
					    method: 'put',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// 获得产线工艺目前生产工艺
 | 
				
			||||||
 | 
					export function getLineBindProcessPage(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/line-bind-process/nowList',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得产线工艺log分页
 | 
				
			||||||
 | 
					export function getLineBindProcessLogPage(query) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/line-bind-process/logPage',
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					    params: query
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -16,6 +16,14 @@ export function switchLineBindProduct(data) {
 | 
				
			|||||||
    data: data
 | 
					    data: data
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					// 切换产线是否可以自动
 | 
				
			||||||
 | 
					export function switchAutoProduct(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/line-bind-product/switchAuto',
 | 
				
			||||||
 | 
					    method: 'put',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
// 更新产线目前生产产品表 主要为更新
 | 
					// 更新产线目前生产产品表 主要为更新
 | 
				
			||||||
export function updateLineBindProduct(data) {
 | 
					export function updateLineBindProduct(data) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * @Author: Do not edit
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 * @Date: 2023-09-12 09:44:53
 | 
					 * @Date: 2023-09-12 09:44:53
 | 
				
			||||||
 * @LastEditTime: 2023-09-13 16:11:41
 | 
					 * @LastEditTime: 2025-01-07 09:57:36
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @Description: 
 | 
					 * @Description:
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
import request from '@/utils/request'
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -17,9 +17,52 @@ export function getPdlAutoReport(data) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 获得所有工厂产线列表
 | 
					// 获得所有工厂产线列表
 | 
				
			||||||
export function getPdList() {
 | 
					export function getPdList(id) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
    url: '/base/production-line/listAll',
 | 
					    url: '/base/production-line/listAll' + (id ? '?id=' + id : ''),
 | 
				
			||||||
    method: 'get'
 | 
					    method: 'get'
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					// 获得产线自动报表
 | 
				
			||||||
 | 
					export function getLineAuto(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/monitoring/production-monitor/getPdlAutoReportNew',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 获得产品自动报表
 | 
				
			||||||
 | 
					export function getProductAuto(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/monitoring/production-monitor/getProcessAutoReportNew',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 班组自动报表分页
 | 
				
			||||||
 | 
					export function getTeamReportPage(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
							url: '/monitoring/group-off-record/page',
 | 
				
			||||||
 | 
							method: 'post',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 班组自动报表分页详细
 | 
				
			||||||
 | 
					export function getTeamReportPageDet(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/monitoring/group-off-record/get?id=' + id,
 | 
				
			||||||
 | 
					    method: 'get',
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function exportGroupProductReportExcel(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
							url: '/monitoring/group-off-record/export-det-excel',
 | 
				
			||||||
 | 
							method: 'get',
 | 
				
			||||||
 | 
							params: data,
 | 
				
			||||||
 | 
							responseType: 'blob',
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * @Author: Do not edit
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 * @Date: 2023-09-12 09:44:53
 | 
					 * @Date: 2023-09-12 09:44:53
 | 
				
			||||||
 * @LastEditTime: 2023-09-14 10:25:46
 | 
					 * @LastEditTime: 2025-03-03 10:43:34
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @Description: 
 | 
					 * @Description:
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
import request from '@/utils/request'
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -22,4 +22,22 @@ export function getPdList() {
 | 
				
			|||||||
    url: '/base/production-line/listAll',
 | 
					    url: '/base/production-line/listAll',
 | 
				
			||||||
    method: 'get'
 | 
					    method: 'get'
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					// 产线统计数据查询-历史
 | 
				
			||||||
 | 
					export function getPdlAutoReportNewSearch(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/monitoring/production-monitor/getPdlAutoReportNewSearch',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 产线统计数据查询-当前
 | 
				
			||||||
 | 
					export function getPdlAutoReportNewSearchNow(data) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/monitoring/production-monitor/getPdlAutoReportNewSearchNow',
 | 
				
			||||||
 | 
					    method: 'post',
 | 
				
			||||||
 | 
					    data: data,
 | 
				
			||||||
 | 
					    timeout: 60000,
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2024-04-18 16:53:17
 | 
					 * @Date: 2024-04-18 16:53:17
 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2025-02-17 15:47:58
 | 
					 * @LastEditTime: 2024-09-06 14:35:13
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,21 +52,3 @@ export function exportRawCostStatisticsHisExcel(query) {
 | 
				
			|||||||
    responseType: 'blob'
 | 
					    responseType: 'blob'
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
// 获得成本首页 -获取首页数据
 | 
					 | 
				
			||||||
export function getData(query) {
 | 
					 | 
				
			||||||
  return request({
 | 
					 | 
				
			||||||
    url: '/monitoring/cost-homepage/getData',
 | 
					 | 
				
			||||||
    method: 'get',
 | 
					 | 
				
			||||||
    params: query
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 获得成本首页 -详细首页数据
 | 
					 | 
				
			||||||
export function getDetailData(query) {
 | 
					 | 
				
			||||||
  return request({
 | 
					 | 
				
			||||||
    url: '/monitoring/cost-homepage/getDetailData',
 | 
					 | 
				
			||||||
    method: 'get',
 | 
					 | 
				
			||||||
    params: query
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -15,7 +15,7 @@ export function updatecostOriginRatioHis(data) {
 | 
				
			|||||||
    data: data
 | 
					    data: data
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// 获得原片产线良品率
 | 
					// 获得原片良品率
 | 
				
			||||||
export function getcostOriginRatioHisPage(query) {
 | 
					export function getcostOriginRatioHisPage(query) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
    url: '/monitoring/cost-origin-ratio-his/page',
 | 
					    url: '/monitoring/cost-origin-ratio-his/page',
 | 
				
			||||||
@@ -24,15 +24,6 @@ export function getcostOriginRatioHisPage(query) {
 | 
				
			|||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 获得原片工段良品率
 | 
					 | 
				
			||||||
export function getcostOriginWSRatioHisPage(query) {
 | 
					 | 
				
			||||||
  return request({
 | 
					 | 
				
			||||||
    url: '/monitoring/cost-origin-ratio-his/page-ws',
 | 
					 | 
				
			||||||
    method: 'get',
 | 
					 | 
				
			||||||
    params: query
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 导出原片良品率 Excel
 | 
					// 导出原片良品率 Excel
 | 
				
			||||||
export function exportcostOriginRatioHisExcel(query) {
 | 
					export function exportcostOriginRatioHisExcel(query) {
 | 
				
			||||||
  return request({
 | 
					  return request({
 | 
				
			||||||
@@ -43,14 +34,3 @@ export function exportcostOriginRatioHisExcel(query) {
 | 
				
			|||||||
  })
 | 
					  })
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
// 导出原片良品率 工段Excel
 | 
					 | 
				
			||||||
export function exportcostOriginWSRatioHisExcel(query) {
 | 
					 | 
				
			||||||
  return request({
 | 
					 | 
				
			||||||
    url: '/monitoring/cost-origin-ratio-his/export-excel-ws',
 | 
					 | 
				
			||||||
    method: 'get',
 | 
					 | 
				
			||||||
    params: query,
 | 
					 | 
				
			||||||
    responseType: 'blob'
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,19 +0,0 @@
 | 
				
			|||||||
import request from '@/utils/request'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 获得环保数据历史分页
 | 
					 | 
				
			||||||
export function getCostEnviHisPage(query) {
 | 
					 | 
				
			||||||
  return request({
 | 
					 | 
				
			||||||
    url: '/monitoring/cost-envi-his/page',
 | 
					 | 
				
			||||||
    method: 'get',
 | 
					 | 
				
			||||||
    params: query
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 获得余热发电page
 | 
					 | 
				
			||||||
export function yurepage(query) {
 | 
					 | 
				
			||||||
  return request({
 | 
					 | 
				
			||||||
    url: '/base/energy-quantity-day/yurepage',
 | 
					 | 
				
			||||||
    method: 'get',
 | 
					 | 
				
			||||||
    params: query
 | 
					 | 
				
			||||||
  })
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										18
									
								
								src/api/material/issue.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					// 获得工厂分页
 | 
				
			||||||
 | 
					export function getMaterialReceiptIssuePageData(data) {
 | 
				
			||||||
 | 
						return request({
 | 
				
			||||||
 | 
							url: '/base/material-warehouse-his/page',
 | 
				
			||||||
 | 
							method: 'post',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function createMaterialIssue(data) {
 | 
				
			||||||
 | 
						return request({
 | 
				
			||||||
 | 
							url: '/base/material-warehouse-his/create',
 | 
				
			||||||
 | 
							method: 'post',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										45
									
								
								src/api/order/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,45 @@
 | 
				
			|||||||
 | 
					import request from '@/utils/request'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function getOrderPage(data) {
 | 
				
			||||||
 | 
						return request({
 | 
				
			||||||
 | 
							url: '/base/core-work-order/page',
 | 
				
			||||||
 | 
							method: 'post',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function updateOrderData(data) {
 | 
				
			||||||
 | 
						return request({
 | 
				
			||||||
 | 
							url: '/base/core-work-order/updatee',
 | 
				
			||||||
 | 
							method: 'put',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function createOrderData(data) {
 | 
				
			||||||
 | 
						return request({
 | 
				
			||||||
 | 
							url: '/base/core-work-order/create',
 | 
				
			||||||
 | 
							method: 'post',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					export function getOrderData(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
							url: '/base/core-work-order/get?id=' + id,
 | 
				
			||||||
 | 
							method: 'get',
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					export function getOrderCode(data) {
 | 
				
			||||||
 | 
						return request({
 | 
				
			||||||
 | 
							url: '/base/core-work-order/getCode',
 | 
				
			||||||
 | 
							method: 'get',
 | 
				
			||||||
 | 
							data: data,
 | 
				
			||||||
 | 
						});
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function deleteOrder(id) {
 | 
				
			||||||
 | 
					  return request({
 | 
				
			||||||
 | 
					    url: '/base/core-work-order/delete?id=' + id,
 | 
				
			||||||
 | 
					    method: 'delete'
 | 
				
			||||||
 | 
					  })
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,4 +0,0 @@
 | 
				
			|||||||
@font-face {
 | 
					 | 
				
			||||||
  font-family: '站酷庆科黄油体';
 | 
					 | 
				
			||||||
  src: url('./站酷庆科黄油体.ttf') format('truetype');;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,22 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>切片</title>
 | 
					 | 
				
			||||||
    <defs>
 | 
					 | 
				
			||||||
        <linearGradient x1="91.384997%" y1="100%" x2="25.4330364%" y2="7.84095011e-14%" id="linearGradient-1">
 | 
					 | 
				
			||||||
            <stop stop-color="#4BFFC8" offset="0%"></stop>
 | 
					 | 
				
			||||||
            <stop stop-color="#45F2EC" offset="100%"></stop>
 | 
					 | 
				
			||||||
        </linearGradient>
 | 
					 | 
				
			||||||
        <linearGradient x1="91.384997%" y1="100%" x2="25.4330364%" y2="7.84095011e-14%" id="linearGradient-2">
 | 
					 | 
				
			||||||
            <stop stop-color="#FFFFFF" offset="0%"></stop>
 | 
					 | 
				
			||||||
            <stop stop-color="#FFFFFF" offset="100%"></stop>
 | 
					 | 
				
			||||||
        </linearGradient>
 | 
					 | 
				
			||||||
    </defs>
 | 
					 | 
				
			||||||
    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="成本看板" transform="translate(-64.000000, -290.000000)" fill-rule="nonzero">
 | 
					 | 
				
			||||||
            <g id="成本" transform="translate(64.000000, 290.000000)">
 | 
					 | 
				
			||||||
                <rect id="矩形" fill="#FFFFFF" opacity="0" x="0" y="0" width="32" height="32"></rect>
 | 
					 | 
				
			||||||
                <path d="M24.8336138,7.21888656 C25.307557,7.21888656 25.7025096,7.62700427 25.6893445,8.08778234 L25.6893445,25.768495 C25.6893445,26.5452352 25.2417316,26.6505559 24.859944,26.6505559 L7.17923134,26.6505559 C6.6921231,26.6505559 6.31033556,26.2556033 6.31033556,25.7816601 L6.31033556,8.10094743 C6.31033556,7.61383919 6.70528819,7.23205165 7.17923134,7.23205165 L10.3915127,7.23205165 L10.3915127,9.00933847 C10.3915127,9.41745619 10.733805,9.75974847 11.1419227,9.75974847 L20.8709225,9.75974847 C21.2790402,9.75974847 21.6213325,9.43062128 21.6213325,9.00933847 L21.6213325,7.21888656 Z M21.3580307,13.7224398 C21.0289035,13.3933127 20.5154651,13.3933127 20.1863379,13.7224398 L14.5385153,19.3702624 L11.7738469,16.6319242 C11.4447197,16.302797 10.9312813,16.302797 10.6021541,16.6319242 C10.2730269,16.9610514 10.2730269,17.4744898 10.6021541,17.803617 L13.9460864,21.1475493 C14.2752136,21.4766764 14.788652,21.4766764 15.1177792,21.1475493 L21.3711958,14.9072977 C21.5423419,14.7361516 21.6213325,14.5386753 21.6213325,14.3148688 C21.6213325,14.0910623 21.5291768,13.893586 21.3580307,13.7224398 Z M19.896706,5.34944412 C20.1863379,5.34944412 20.4364746,5.59958078 20.4364746,5.88921271 L20.4364746,8.10094743 C20.4364746,8.39057936 20.1863379,8.64071602 19.896706,8.64071602 L12.1161392,8.64071602 L12.1161392,8.6670462 C11.8265073,8.6670462 11.5763706,8.41690953 11.5763706,8.1272776 L11.5763706,5.88921271 C11.5763706,5.59958078 11.8265073,5.34944412 12.1161392,5.34944412 L19.896706,5.34944412 Z" id="形状结合" fill="url(#linearGradient-2)"></path>
 | 
					 | 
				
			||||||
            </g>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 2.7 KiB  | 
@@ -1,12 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>切片</title>
 | 
					 | 
				
			||||||
    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="成本看板" transform="translate(-64.000000, -633.000000)" fill="#FFFFFF" fill-rule="nonzero">
 | 
					 | 
				
			||||||
            <g id="近期成本" transform="translate(64.000000, 633.000000)">
 | 
					 | 
				
			||||||
                <rect id="矩形" opacity="0" x="0" y="0" width="32" height="32"></rect>
 | 
					 | 
				
			||||||
                <path d="M26,23 L18.2,27.8 C17.6,28.2 17,27.8 17,27 L17,15.8 C17,15.6 17.2,15.2 17.4,15 L25.2,10.2 C25.8,9.8 26.4,10.2 26.4,11 L26.4,22.4 C26.4,22.6 26.2,23 26,23 Z M6,23 L13.8,27.8 C14.4,28.2 15,27.8 15,27 L15,15.8 C15,15.6 14.8,15.2 14.6,15 L6.8,10.2 C6.4,10 5.6,10.4 5.6,11 L5.6,22.4 C5.6,22.6 5.8,23 6,23 Z M15.8,4 L6.8,7.4 C6.4,7.6 6.4,8.2 6.8,8.4 L15.8,14 C16,14 16.2,14 16.2,14 L25.4,8.4 C25.8,8.2 25.8,7.6 25.4,7.4 L16.2,4 C16,4 16,4 15.8,4 Z" id="形状"></path>
 | 
					 | 
				
			||||||
            </g>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 1.1 KiB  | 
@@ -1,22 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="24.3417579px" height="24.000009px" viewBox="0 0 24.3417579 24.000009" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>统计</title>
 | 
					 | 
				
			||||||
    <defs>
 | 
					 | 
				
			||||||
        <linearGradient x1="99.4683184%" y1="100%" x2="20.6346149%" y2="7.84095011e-14%" id="linearGradient-1">
 | 
					 | 
				
			||||||
            <stop stop-color="#4BFFC8" offset="0%"></stop>
 | 
					 | 
				
			||||||
            <stop stop-color="#45F2EC" offset="100%"></stop>
 | 
					 | 
				
			||||||
        </linearGradient>
 | 
					 | 
				
			||||||
        <linearGradient x1="99.4683184%" y1="100%" x2="20.6346149%" y2="7.84095011e-14%" id="linearGradient-2">
 | 
					 | 
				
			||||||
            <stop stop-color="#FFFFFF" offset="0%"></stop>
 | 
					 | 
				
			||||||
            <stop stop-color="#FFFFFF" offset="100%"></stop>
 | 
					 | 
				
			||||||
        </linearGradient>
 | 
					 | 
				
			||||||
    </defs>
 | 
					 | 
				
			||||||
    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="成本看板" transform="translate(-1327.000000, -636.000000)" fill-rule="nonzero">
 | 
					 | 
				
			||||||
            <g id="统计" transform="translate(1327.000000, 636.000000)">
 | 
					 | 
				
			||||||
                <rect id="矩形" fill="#FFFFFF" opacity="0" x="0" y="1.29865498e-07" width="23.9999981" height="23.9999981"></rect>
 | 
					 | 
				
			||||||
                <path d="M21.0417425,10.2952681 L19.5753585,10.2952681 L19.5753585,5.90037875 C19.5730113,5.34644149 19.1232931,4.89862885 18.5693508,4.89863383 L13.1812421,4.89863383 L13.1812421,3.15517144 C13.1837389,2.30739523 12.8439612,1.49449588 12.2388994,0.900668572 C11.6338375,0.306841265 10.8147135,-0.0176430365 9.96713292,0.000740689882 C8.21105284,0.081169063 6.8366707,1.54239403 6.8638551,3.30010475 L6.8638551,4.89863383 L1.47574634,4.89863383 C0.921804107,4.89862885 0.472085895,5.34644149 0.46970252,5.90037875 L0.46970252,9.28073494 C0.467465023,9.54901885 0.572450222,9.80709649 0.76136025,9.99760745 C0.950270278,10.1881184 1.2074528,10.2952777 1.47574634,10.2952681 L2.03842858,10.2952681 C3.79455985,10.2680012 5.25513623,11.6398863 5.33779264,13.3942831 C5.35388802,14.2418862 5.02721285,15.0601101 4.4317847,15.6635629 C3.83635654,16.2670156 3.02257894,16.6046145 2.1748364,16.5998668 L1.47574634,16.5998668 C0.92014366,16.5998668 0.46970252,17.0502718 0.46970252,17.6058745 L0.46970252,22.9939832 C0.46970252,23.5495859 0.92014366,24 1.47574634,24 L5.85784745,24 C6.1250049,24.0011302 6.38154936,23.8955063 6.57045992,23.7065957 C6.75937048,23.5176851 6.86499438,23.2611407 6.8638551,22.9939832 L6.8638551,22.4952422 C6.8366707,20.7375314 8.21105284,19.2763065 9.96713292,19.1958781 C10.8147135,19.1774944 11.6338375,19.5019787 12.2388994,20.095806 C12.8439612,20.6896333 13.1837389,21.5025326 13.1812421,22.3503088 L13.1812421,22.9939832 C13.1801084,23.2604003 13.2851484,23.5162945 13.473135,23.7050811 C13.6611216,23.8938677 13.9165675,24 14.182987,24 L18.5693508,24 C19.1249535,24 19.5753585,23.5495859 19.5753585,22.9939832 L19.5753585,16.5998668 L21.1824131,16.5998668 C22.0301722,16.6034883 22.8435102,16.2647998 23.4381378,15.6605426 C24.0327653,15.0562855 24.3583453,14.237612 24.3411066,13.3900204 C24.2562262,11.637307 22.7962968,10.2679159 21.0417425,10.2952681 Z" id="路径" fill="url(#linearGradient-2)"></path>
 | 
					 | 
				
			||||||
            </g>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 3.1 KiB  | 
@@ -1,12 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="32px" height="32px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>编组 54</title>
 | 
					 | 
				
			||||||
    <g id="驾驶舱" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="运营总览_生产线监控驾驶舱" transform="translate(-1866.000000, -36.000000)">
 | 
					 | 
				
			||||||
            <g id="编组-54" transform="translate(1866.000000, 36.000000)">
 | 
					 | 
				
			||||||
                <rect id="矩形" stroke="#69b4ff" fill="#D8D8D8" opacity="0" x="0.5" y="0.5" width="32" height="32"></rect>
 | 
					 | 
				
			||||||
                <path d="M18.4001211,1 L18.574731,1.00571398 C18.8641421,1.02474925 19.1451559,1.09128771 19.4122178,1.20447947 C19.7221027,1.33395436 19.9991094,1.52058631 20.2392616,1.76073844 C20.4776764,1.99915325 20.6652172,2.27804627 20.7953442,2.58736464 C20.9313506,2.90825642 21,3.24882158 21,3.59987893 L21,3.59987893 L21,18.4001211 L20.994286,18.574731 C20.9752507,18.8641421 20.9087123,19.1451559 20.7955205,19.4122178 C20.6660456,19.7221027 20.4794137,19.9991094 20.2392616,20.2392616 C20.0008468,20.4776764 19.7219537,20.6652172 19.4126354,20.7953442 C19.0917436,20.9313506 18.7511784,21 18.4001211,21 L18.4001211,21 L3.59987893,21 L3.42526905,20.994286 C3.13585794,20.9752507 2.85484405,20.9087123 2.58778224,20.7955205 C2.2778973,20.6660456 2.00089057,20.4794137 1.76073844,20.2392616 C1.52232363,20.0008468 1.33478285,19.7219537 1.20465581,19.4126354 C1.06864936,19.0917436 1,18.7511784 1,18.4001211 L1,18.4001211 L1,3.59987893 L1.00571398,3.42526905 C1.02474925,3.13585794 1.09128771,2.85484405 1.20447947,2.58778224 C1.33395436,2.2778973 1.52058631,2.00089057 1.76073844,1.76073844 C1.99915325,1.52232363 2.27804627,1.33478285 2.58736464,1.20465581 C2.90825642,1.06864936 3.24882158,1 3.59987893,1 L3.59987893,1 L18.4001211,1 Z M18.4001211,2.29539952 L3.59987893,2.29539952 L3.49797651,2.2993263 C2.82542992,2.35136056 2.29539952,2.9140495 2.29539952,3.59987893 L2.29539952,3.59987893 L2.29539952,18.4001211 L2.2993263,18.5020235 C2.35136056,19.1745701 2.9140495,19.7046005 3.59987893,19.7046005 L3.59987893,19.7046005 L18.4001211,19.7046005 L18.5020235,19.7006737 C19.1745701,19.6486394 19.7046005,19.0859505 19.7046005,18.4001211 L19.7046005,18.4001211 L19.7046005,3.59987893 L19.7006737,3.49797651 C19.6486394,2.82542992 19.0859505,2.29539952 18.4001211,2.29539952 L18.4001211,2.29539952 Z M4.56580299,11.8731508 L4.63987359,11.8789244 C4.95620444,11.9219442 5.20096852,12.1943435 5.20096852,12.5208838 L5.20096852,12.5208838 L5.20096852,15.8606113 L8.39814764,12.6634321 L8.45892035,12.6098356 C8.71226443,12.4133149 9.08161636,12.4311804 9.3138681,12.6634321 C9.56547415,12.9150382 9.56547415,13.3275466 9.3138681,13.5791526 L9.3138681,13.5791526 L6.09149511,16.7990315 L9.4155569,16.7990315 L9.49368756,16.8035151 C9.82695229,16.8420028 10.0864105,17.123441 10.081435,17.4601165 C10.0742517,17.8119637 9.78624591,18.094431 9.43371671,18.094431 L9.43371671,18.094431 L4.5691586,18.094431 L4.49163938,18.0899766 C4.16113157,18.051728 3.90556901,17.7718105 3.90556901,17.4308414 L3.90556901,17.4308414 L3.90556901,12.5367736 L3.91007171,12.4587841 C3.94871707,12.1260764 4.23118526,11.8665247 4.56580299,11.8731508 L4.56580299,11.8731508 Z M17.4353814,3.90556901 L17.512257,3.91000958 C17.8400885,3.94813523 18.094431,4.22707005 18.094431,4.56461864 L18.094431,4.56461864 L18.094431,9.46095642 L18.0899283,9.53894589 C18.0512829,9.87165361 17.7688147,10.1312053 17.434197,10.1245792 C17.0828999,10.1173731 16.7990315,9.82850504 16.7990315,9.47684625 L16.7990315,9.47684625 L16.7990315,6.13938874 L13.6018524,9.33656786 L13.5410796,9.39016441 C13.2877356,9.58668512 12.9183836,9.5688196 12.6861319,9.33656786 C12.4345258,9.08496181 12.4345258,8.67245345 12.6861319,8.4208474 L12.6861319,8.4208474 L15.9060108,5.20096852 L12.5821731,5.20096852 L12.5040246,5.19648608 C12.170734,5.1580095 11.9119308,4.876675 11.9185506,4.54071802 C11.9257483,4.18803625 12.2137541,3.90556901 12.5662833,3.90556901 L12.5662833,3.90556901 L17.4353814,3.90556901 Z" id="形状结合" fill="#69b4ff" fill-rule="nonzero" opacity="0.79078311"></path>
 | 
					 | 
				
			||||||
            </g>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 4.1 KiB  | 
@@ -1,12 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>产量</title>
 | 
					 | 
				
			||||||
    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="深加工看板" transform="translate(-68.000000, -297.000000)" fill="#FFFFFF" fill-rule="nonzero">
 | 
					 | 
				
			||||||
            <g id="产量" transform="translate(68.000000, 297.000000)">
 | 
					 | 
				
			||||||
                <rect id="矩形" opacity="0" x="0" y="0" width="24" height="24"></rect>
 | 
					 | 
				
			||||||
                <path d="M22.2162957,1 L1.78372985,1 C1.35093374,1 1,1.33440606 1,1.75168741 L1,7 L23,7 L23,1.75168741 C23,1.33486987 22.6491174,1 22.2162957,1 Z M4.00067655,5 C3.44751496,5 3,4.5525025 3,3.99928444 C3,3.44752352 3.44751496,3 4.00067655,3 C4.55245902,3 5,3.44752352 5,3.99928444 C5,4.5525025 4.55245902,5 4.00067655,5 L4.00067655,5 Z M1,22.2486389 C1,22.6651285 1.35099088,23 1.78385746,23 L22.2161681,23 C22.6499302,23 23,22.6651041 23,22.2486389 L23,17 L1,17 L1,22.2486389 Z M4.00067655,19 C4.55245902,19 5,19.4475091 5,19.9997788 C5,20.5524648 4.55245902,21 4.00067655,21 C3.44751496,21 3,20.5524648 3,19.9997788 C3,19.4475091 3.44751496,19 4.00067655,19 Z M1,15 L23,15 L23,9 L1,9 L1,15 Z M4.00067655,11 C4.55245902,11 5,11.4479977 5,12.0002082 C5,12.552939 4.55245902,13 4.00067655,13 C3.44751496,13 3,12.552939 3,12.0002082 C3,11.4479977 3.44751496,11 4.00067655,11 L4.00067655,11 Z" id="形状"></path>
 | 
					 | 
				
			||||||
            </g>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 1.5 KiB  | 
@@ -1,10 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="22px" height="22px" viewBox="0 0 22 22" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>编组 54备份</title>
 | 
					 | 
				
			||||||
    <g id="驾驶舱" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="编组-54备份">
 | 
					 | 
				
			||||||
            <rect id="矩形" stroke="#979797" fill="#D8D8D8" opacity="0" x="0.5" y="0.5" width="21" height="21"></rect>
 | 
					 | 
				
			||||||
            <path d="M18.4001211,1 L18.574731,1.00571398 C18.8641421,1.02474925 19.1451559,1.09128771 19.4122178,1.20447947 C19.7221027,1.33395436 19.9991094,1.52058631 20.2392616,1.76073844 C20.4776764,1.99915325 20.6652172,2.27804627 20.7953442,2.58736464 C20.9313506,2.90825642 21,3.24882158 21,3.59987893 L21,3.59987893 L21,18.4001211 L20.994286,18.574731 C20.9752507,18.8641421 20.9087123,19.1451559 20.7955205,19.4122178 C20.6660456,19.7221027 20.4794137,19.9991094 20.2392616,20.2392616 C20.0008468,20.4776764 19.7219537,20.6652172 19.4126354,20.7953442 C19.0917436,20.9313506 18.7511784,21 18.4001211,21 L18.4001211,21 L3.59987893,21 L3.42526905,20.994286 C3.13585794,20.9752507 2.85484405,20.9087123 2.58778224,20.7955205 C2.2778973,20.6660456 2.00089057,20.4794137 1.76073844,20.2392616 C1.52232363,20.0008468 1.33478285,19.7219537 1.20465581,19.4126354 C1.06864936,19.0917436 1,18.7511784 1,18.4001211 L1,18.4001211 L1,3.59987893 L1.00571398,3.42526905 C1.02474925,3.13585794 1.09128771,2.85484405 1.20447947,2.58778224 C1.33395436,2.2778973 1.52058631,2.00089057 1.76073844,1.76073844 C1.99915325,1.52232363 2.27804627,1.33478285 2.58736464,1.20465581 C2.90825642,1.06864936 3.24882158,1 3.59987893,1 L3.59987893,1 L18.4001211,1 Z M18.4001211,2.29539952 L3.59987893,2.29539952 L3.49797651,2.2993263 C2.82542992,2.35136056 2.29539952,2.9140495 2.29539952,3.59987893 L2.29539952,3.59987893 L2.29539952,18.4001211 L2.2993263,18.5020235 C2.35136056,19.1745701 2.9140495,19.7046005 3.59987893,19.7046005 L3.59987893,19.7046005 L18.4001211,19.7046005 L18.5020235,19.7006737 C19.1745701,19.6486394 19.7046005,19.0859505 19.7046005,18.4001211 L19.7046005,18.4001211 L19.7046005,3.59987893 L19.7006737,3.49797651 C19.6486394,2.82542992 19.0859505,2.29539952 18.4001211,2.29539952 L18.4001211,2.29539952 Z M9.43538136,11.905569 L9.512257,11.9100096 C9.84008849,11.9481352 10.094431,12.2270701 10.094431,12.5646186 L10.094431,12.5646186 L10.094431,17.4609564 L10.0899283,17.5389459 C10.0512829,17.8716536 9.76881474,18.1312053 9.43419701,18.1245792 C9.08289988,18.1173731 8.79903148,17.828505 8.79903148,17.4768462 L8.79903148,17.4768462 L8.79903148,14.1393887 L5.60185236,17.3365679 L5.54107965,17.3901644 C5.28773557,17.5866851 4.91838364,17.5688196 4.6861319,17.3365679 C4.43452585,17.0849618 4.43452585,16.6724534 4.6861319,16.4208474 L4.6861319,16.4208474 L7.90601077,13.2009685 L4.58217312,13.2009685 L4.50402457,13.1964861 C4.17073404,13.1580095 3.9119308,12.876675 3.91855064,12.540718 C3.92574827,12.1880363 4.21375409,11.905569 4.56628329,11.905569 L4.56628329,11.905569 L9.43538136,11.905569 Z M12.565803,3.8731508 L12.6398736,3.87892442 C12.9562044,3.92194416 13.2009685,4.19434347 13.2009685,4.52088378 L13.2009685,4.52088378 L13.2009685,7.86061126 L16.3981476,4.66343214 L16.4589204,4.60983559 C16.7122644,4.41331488 17.0816164,4.4311804 17.3138681,4.66343214 C17.5654742,4.91503819 17.5654742,5.32754655 17.3138681,5.5791526 L17.3138681,5.5791526 L14.0914951,8.79903148 L17.4155569,8.79903148 L17.4936876,8.80351509 C17.8269523,8.84200281 18.0864105,9.12344101 18.081435,9.46011654 C18.0742517,9.81196375 17.7862459,10.094431 17.4337167,10.094431 L17.4337167,10.094431 L12.5691586,10.094431 L12.4916394,10.0899766 C12.1611316,10.051728 11.905569,9.77181051 11.905569,9.4308414 L11.905569,9.4308414 L11.905569,4.53677361 L11.9100717,4.45878413 C11.9487171,4.12607641 12.2311853,3.86652471 12.565803,3.8731508 L12.565803,3.8731508 Z" id="形状结合" fill="#69b4ff" fill-rule="nonzero" opacity="0.79078311"></path>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 3.9 KiB  | 
@@ -1,13 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					 | 
				
			||||||
<svg width="24px" height="23.9254658px" viewBox="0 0 24 23.9254658" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 | 
					 | 
				
			||||||
    <title>烟气</title>
 | 
					 | 
				
			||||||
    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
 | 
					 | 
				
			||||||
        <g id="成本看板" transform="translate(-1319.000000, -293.962733)" fill-rule="nonzero">
 | 
					 | 
				
			||||||
            <g id="烟气" transform="translate(1319.000000, 293.962733)">
 | 
					 | 
				
			||||||
                <rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="24" height="23.9254658"></rect>
 | 
					 | 
				
			||||||
                <path d="M10.6744092,10.2458592 C10.6744092,10.2458592 3.76099563,15.5072464 6.34479666,19.9378882 C5.78613697,19.5917443 3.83082809,18.2071687 3.2721684,17.4456522 C1.73585426,15.5072464 1.80568673,14.1918996 2.36434642,12.8765528 C3.6213307,9.89971532 7.39228357,6.9921066 8.50960292,5.1229296 C10.3950794,2.07686335 8.85876522,-7.08336081e-14 8.85876522,-7.08336081e-14 C8.85876522,-7.08336081e-14 12.769383,1.73071946 12.9788804,4.98447204 C13.2582102,8.16899586 10.6744092,10.2458592 10.6744092,10.2458592 Z" id="路径" fill="#FFFFFF"></path>
 | 
					 | 
				
			||||||
                <path d="M9.55552302,-6.3573715e-14 L9.48496561,-6.3573715e-14 L9.41440819,-6.3573715e-14 L9.34385077,-6.3573715e-14 L9.27329335,-6.3573715e-14 C9.27329335,-6.3573715e-14 9.20273594,-6.3573715e-14 9.20273596,0.0693204763 L9.13217854,0.0693204763 L9.06162113,0.138640927 L8.99106371,0.207961403 L8.99106371,0.485243308 C8.99106371,0.485243308 8.99106371,0.554563785 9.06162113,0.554563785 L9.06162113,0.623884235 C10.1199823,2.35689604 9.69663786,4.36718972 7.79158769,6.65476534 C7.43880063,7.07068817 6.94489873,7.55593148 6.38043941,8.17981571 C4.96929114,9.35826373 3.6992577,10.6753527 2.99368358,11.7844803 C2.0764372,13.1015692 1.79420756,14.6266197 2.14699459,16.0130291 C2.57033907,17.8153614 4.05204476,19.4790527 6.52155425,20.8654621 C6.59211167,20.9347826 6.66266909,20.9347826 6.73322648,20.9347826 C6.80378389,20.9347826 6.87434131,20.9347826 6.94489873,20.8654621 C7.01545615,20.7961417 7.08601356,20.7961417 7.08601354,20.7268212 L7.08601354,20.6575007 L7.08601354,20.5881803 L7.08601354,20.5188598 L7.08601354,20.4495393 C7.08601354,20.3802188 7.08601354,20.3802188 7.01545615,20.3802188 L7.01545615,20.3108984 C5.60430787,18.3006047 7.01545615,16.0130291 7.9327025,14.9039015 L8.00325992,14.8345811 C8.92050629,13.656133 9.83775267,12.7549669 10.6138842,11.9231212 C11.1783435,11.3685574 11.6722454,10.8833141 12.0955899,10.3287504 C13.647853,8.45709759 14.2123123,6.72408579 13.9300827,5.06039446 C13.5772956,3.18874173 12.0955899,1.4557299 9.55552302,-6.3573715e-14 Z M9.48470738,9.26748999 C8.64336853,10.0744997 6.3074421,10.0757542 5.3258801,11.2862689 C3.92364867,12.9675392 5.42114982,16.3973307 5.7015961,17.9440994 C4.29936467,16.9353372 3.38791424,15.8593242 3.10746797,14.6488095 C2.82702169,13.5727965 3.10746797,12.3622819 3.8085837,11.2862689 L3.87869525,11.219018 C4.5096994,10.2102558 5.84181925,8.93249038 6.89349283,7.9237282 C7.52449698,7.31847086 8.01527795,6.84771519 8.3658358,6.44421029 C10.3289598,4.22493344 10.6094061,2.34191068 10.3289598,0.99689441 C11.5208565,1.87115499 12.6426417,3.01441881 12.9230879,4.49393671 C13.2035342,5.77170217 12.7127532,7.18396925 11.5208565,8.66348714 L9.48470738,9.26748999 Z M21.9281191,9.58246693 C21.6004931,7.86679721 20.3555139,6.28838107 18.1931817,4.98447205 L18.1276565,4.98447205 L18.0621313,4.98447205 L17.9966061,4.98447205 L17.9310808,4.98447205 C17.8655556,4.98447205 17.8655556,4.98447205 17.8655556,5.05309884 L17.8000304,5.05309884 L17.7345052,5.12172564 L17.66898,5.19035243 L17.66898,5.46485958 C17.66898,5.46485958 17.66898,5.53348637 17.7345052,5.53348637 L17.7345052,5.60211316 C18.6518582,7.11190253 18.2587069,8.89619902 16.6861017,10.9550027 C16.4240008,11.2981367 15.9653243,11.7785242 15.5066478,12.3275385 C14.5237695,13.3569403 13.4098408,14.5922225 12.8201138,15.6216244 C12.0993364,16.7882798 11.8372356,18.1608156 12.0993364,19.4647245 C12.4924877,21.1117675 13.7374669,22.5529301 15.8342739,23.856839 C15.8997991,23.9254658 15.9653243,23.9254658 16.0308495,23.9254658 C16.0963747,23.9254658 16.1619,23.9254658 16.2274252,23.856839 C16.2929504,23.7882123 16.3584756,23.7882123 16.3584756,23.7195855 L16.3584756,23.6509587 L16.3584756,23.5823319 L16.3584756,23.5137051 L16.3584756,23.4450783 C16.3584756,23.4450783 16.3584756,23.3764515 16.2929504,23.3764515 L16.2929504,23.3078247 C15.1790217,21.5235282 16.2929504,19.5333513 17.079253,18.5039495 L17.1447782,18.4353227 C17.9310808,17.3372941 18.6518582,16.5137726 19.3726356,15.8275047 C19.8313122,15.3471172 20.2899887,14.8667297 20.6176148,14.454969 C21.7315435,12.6020456 22.19022,11.0922563 21.9281191,9.58246693 L21.9281191,9.58246693 Z M20.5837087,13.7271478 C20.225071,14.1241412 19.7947058,14.5211345 19.2926131,14.9842934 C18.5036102,15.7121146 17.6428797,16.5061012 16.7104218,17.6309157 C15.4193261,19.086558 14.9172334,20.6083659 15.2041435,21.931677 C13.9130479,21.0715248 13.2958761,20.3327069 13.0806935,19.3402236 C12.8655109,18.3477402 13.0806935,17.3552568 13.7262413,16.3627735 L13.7979689,16.2966079 C14.3717892,15.4364556 15.4193261,13.99181 16.4235116,13.0654922 C16.9973319,12.5361677 17.4994247,12.0730088 17.7863348,11.742181 C19.5077957,9.75721431 19.8664333,8.16924091 19.6512507,6.97826087 C20.7271638,7.77224757 21.7313493,8.76473095 21.9465319,9.95571099 C22.1617145,11.2128566 21.7313493,12.4700022 20.5837087,13.7271478 Z" id="形状" fill="#FFFFFF"></path>
 | 
					 | 
				
			||||||
            </g>
 | 
					 | 
				
			||||||
        </g>
 | 
					 | 
				
			||||||
    </g>
 | 
					 | 
				
			||||||
</svg>
 | 
					 | 
				
			||||||
| 
		 Before Width: | Height: | Size: 5.4 KiB  | 
| 
		 Before Width: | Height: | Size: 16 KiB  | 
| 
		 Before Width: | Height: | Size: 14 KiB  | 
| 
		 Before Width: | Height: | Size: 1.2 MiB  | 
| 
		 Before Width: | Height: | Size: 936 B  | 
@@ -1,30 +1,16 @@
 | 
				
			|||||||
<!--
 | 
					 | 
				
			||||||
    filename: index.vue
 | 
					 | 
				
			||||||
    author: liubin
 | 
					 | 
				
			||||||
    date: 2024-04-02 09:49:36
 | 
					 | 
				
			||||||
    description:
 | 
					 | 
				
			||||||
-->
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <!-- 按钮切换 -->
 | 
					  <!-- 按钮切换 -->
 | 
				
			||||||
  <div v-if="buttonMode" class="button-nav">
 | 
					  <div v-if="buttonMode" class="button-nav">
 | 
				
			||||||
    <button
 | 
					    <button v-for="m in menus" :key="m" @click="handleClick(m)"
 | 
				
			||||||
      v-for="m in menus"
 | 
					 | 
				
			||||||
      :key="m"
 | 
					 | 
				
			||||||
      @click="currentMenu = m"
 | 
					 | 
				
			||||||
      :data-text="m"
 | 
					      :data-text="m"
 | 
				
			||||||
      :class="[m === currentMenu ? 'active' : '']"
 | 
					      :class="[m === currentMenu ? 'active' : '']"
 | 
				
			||||||
    ></button>
 | 
					      ></button>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
  <!-- 标签切换 -->
 | 
					  <!-- 标签切换 -->
 | 
				
			||||||
  <div v-else class="custom-tabs" style="height: 100%; width: 100%">
 | 
					  <div v-else class="custom-tabs" style="height: 100%; width: 100%">
 | 
				
			||||||
    <el-tabs class="tag-nav" v-model="currentMenu" style="height: 100%">
 | 
					    <el-tabs class="tag-nav" v-model="currentMenu" style="height: 100%" @tab-click="handleTabClick">
 | 
				
			||||||
      <el-tab-pane
 | 
					      <el-tab-pane v-for="(m, idx) in menus" :key="m" :label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`"
 | 
				
			||||||
        v-for="(m, idx) in menus"
 | 
					        :name="m">
 | 
				
			||||||
        :key="m"
 | 
					 | 
				
			||||||
        :label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`"
 | 
					 | 
				
			||||||
        :name="m"
 | 
					 | 
				
			||||||
      >
 | 
					 | 
				
			||||||
        <slot :name="`tab${idx + 1}`"></slot>
 | 
					        <slot :name="`tab${idx + 1}`"></slot>
 | 
				
			||||||
      </el-tab-pane>
 | 
					      </el-tab-pane>
 | 
				
			||||||
    </el-tabs>
 | 
					    </el-tabs>
 | 
				
			||||||
@@ -39,14 +25,17 @@ export default {
 | 
				
			|||||||
      type: Array,
 | 
					      type: Array,
 | 
				
			||||||
      required: true,
 | 
					      required: true,
 | 
				
			||||||
      default: () => [],
 | 
					      default: () => [],
 | 
				
			||||||
      validator: (val) => {
 | 
					      validator: (val) => val.length > 0,
 | 
				
			||||||
        return val.length > 0;
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    buttonMode: {
 | 
					    buttonMode: {
 | 
				
			||||||
      type: Boolean,
 | 
					      type: Boolean,
 | 
				
			||||||
      default: true,
 | 
					      default: true,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 新增:支持外部传入选中值(v-model 绑定)
 | 
				
			||||||
 | 
					    value: {
 | 
				
			||||||
 | 
					      type: String,
 | 
				
			||||||
 | 
					      default: "",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return {
 | 
					    return {
 | 
				
			||||||
@@ -54,16 +43,34 @@ export default {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  created() {
 | 
					  created() {
 | 
				
			||||||
    this.currentMenu = this.menus[0];
 | 
					    // 优先使用外部传入的 value,否则默认第一个
 | 
				
			||||||
 | 
					    this.currentMenu = this.value || this.menus[0];
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  watch: {
 | 
					  watch: {
 | 
				
			||||||
 | 
					    // 监听外部 value 变化,同步到内部 currentMenu
 | 
				
			||||||
 | 
					    value(newVal) {
 | 
				
			||||||
 | 
					      this.currentMenu = newVal;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 监听内部 currentMenu 变化,通知外部
 | 
				
			||||||
    currentMenu(val) {
 | 
					    currentMenu(val) {
 | 
				
			||||||
      this.$emit("change", val);
 | 
					      this.$emit("input", val); // 触发 v-model 同步
 | 
				
			||||||
 | 
					      this.$emit("change", val); // 保留原 change 事件
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  methods: {
 | 
				
			||||||
 | 
					    // 按钮点击事件
 | 
				
			||||||
 | 
					    handleClick(m) {
 | 
				
			||||||
 | 
					      this.currentMenu = m;
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 标签点击事件(el-tabs 自带)
 | 
				
			||||||
 | 
					    handleTabClick(tab) {
 | 
				
			||||||
 | 
					      this.currentMenu = tab.name;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<!-- 样式不变 -->
 | 
				
			||||||
<style scoped lang="scss">
 | 
					<style scoped lang="scss">
 | 
				
			||||||
.button-nav {
 | 
					.button-nav {
 | 
				
			||||||
  width: 100%;
 | 
					  width: 100%;
 | 
				
			||||||
@@ -108,22 +115,24 @@ export default {
 | 
				
			|||||||
</style>
 | 
					</style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style scoped>
 | 
					<style scoped>
 | 
				
			||||||
.custom-tabs >>> .el-tabs__header {
 | 
					.custom-tabs>>>.el-tabs__header {
 | 
				
			||||||
  margin-bottom: 8px;
 | 
					  margin-bottom: 8px;
 | 
				
			||||||
  display: inline-block;
 | 
					  display: inline-block;
 | 
				
			||||||
  /* transform: translateY(-12px); */
 | 
					  /* transform: translateY(-12px); */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.custom-tabs >>> .el-tabs__item {
 | 
					
 | 
				
			||||||
 | 
					.custom-tabs>>>.el-tabs__item {
 | 
				
			||||||
  padding-left: 0px !important;
 | 
					  padding-left: 0px !important;
 | 
				
			||||||
  padding-right: 0px !important;
 | 
					  padding-right: 0px !important;
 | 
				
			||||||
  line-height: 36px !important;
 | 
					  line-height: 36px !important;
 | 
				
			||||||
  height: 36px;
 | 
					  height: 36px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.custom-tabs >>> .el-tabs__content {
 | 
					.custom-tabs>>>.el-tabs__content {
 | 
				
			||||||
  height: calc(100% - 42px);
 | 
					  height: calc(100% - 42px);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
.custom-tabs >>> .el-tab-pane {
 | 
					
 | 
				
			||||||
 | 
					.custom-tabs>>>.el-tab-pane {
 | 
				
			||||||
  box-sizing: border-box;
 | 
					  box-sizing: border-box;
 | 
				
			||||||
  height: 100%;
 | 
					  height: 100%;
 | 
				
			||||||
  padding: 20px;
 | 
					  padding: 20px;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<!-- 
 | 
					<!--
 | 
				
			||||||
    filename: dialogForm.vue
 | 
					    filename: dialogForm.vue
 | 
				
			||||||
    author: liubin
 | 
					    author: liubin
 | 
				
			||||||
    date: 2023-08-15 10:32:36
 | 
					    date: 2023-08-15 10:32:36
 | 
				
			||||||
@@ -92,13 +92,13 @@
 | 
				
			|||||||
								{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
 | 
													{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
 | 
				
			||||||
							</div>
 | 
												</div>
 | 
				
			||||||
						</el-upload>
 | 
											</el-upload>
 | 
				
			||||||
 | 
					 | 
				
			||||||
						<uploadedFile
 | 
											<uploadedFile
 | 
				
			||||||
							class="file"
 | 
												class="file"
 | 
				
			||||||
							v-for="file in form[col.prop] || []"
 | 
												v-for="file in form[col.prop] || []"
 | 
				
			||||||
							:file="file"
 | 
												:file="file"
 | 
				
			||||||
							:key="file.fileUrl"
 | 
												:key="file.fileUrl"
 | 
				
			||||||
							@delete="handleDeleteFile(file)" />
 | 
												@delete="handleDeleteFile(file)"
 | 
				
			||||||
 | 
												@Preview="handlePreview(file)" />
 | 
				
			||||||
					</div>
 | 
										</div>
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
@@ -138,6 +138,9 @@ const uploadedFile = {
 | 
				
			|||||||
		handleDelete() {
 | 
							handleDelete() {
 | 
				
			||||||
			this.$emit('delete', this.file);
 | 
								this.$emit('delete', this.file);
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
							handlePreview() {
 | 
				
			||||||
 | 
								this.$emit('Preview', this.file);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	mounted() {},
 | 
						mounted() {},
 | 
				
			||||||
	render: function (h) {
 | 
						render: function (h) {
 | 
				
			||||||
@@ -156,7 +159,7 @@ const uploadedFile = {
 | 
				
			|||||||
					cursor: 'pointer',
 | 
										cursor: 'pointer',
 | 
				
			||||||
					display: 'inline-block',
 | 
										display: 'inline-block',
 | 
				
			||||||
				}}>
 | 
									}}>
 | 
				
			||||||
				{this.file.fileName}
 | 
									<el-button onClick={this.handlePreview}>{this.file.fileName}</el-button>
 | 
				
			||||||
				<el-button
 | 
									<el-button
 | 
				
			||||||
					type="text"
 | 
										type="text"
 | 
				
			||||||
					icon="el-icon-close"
 | 
										icon="el-icon-close"
 | 
				
			||||||
@@ -256,6 +259,20 @@ export default {
 | 
				
			|||||||
		resetFields(args) {
 | 
							resetFields(args) {
 | 
				
			||||||
			return this.$refs.form.resetFields(args);
 | 
								return this.$refs.form.resetFields(args);
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
							async handlePreview(file) {
 | 
				
			||||||
 | 
								const data = await this.$axios({
 | 
				
			||||||
 | 
									url: file.fileUrl,
 | 
				
			||||||
 | 
									method: 'get',
 | 
				
			||||||
 | 
									responseType: 'blob',
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								const link = document.createElement('a');
 | 
				
			||||||
 | 
								link.href = window.URL.createObjectURL(new Blob([data]));
 | 
				
			||||||
 | 
								link.download = file.fileName;
 | 
				
			||||||
 | 
								document.body.appendChild(link);
 | 
				
			||||||
 | 
								link.click();
 | 
				
			||||||
 | 
								document.body.removeChild(link);
 | 
				
			||||||
 | 
								window.URL.revokeObjectURL(link.href);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		// getCode
 | 
							// getCode
 | 
				
			||||||
		async getCode(url) {
 | 
							async getCode(url) {
 | 
				
			||||||
			const response = await this.$axios(url);
 | 
								const response = await this.$axios(url);
 | 
				
			||||||
@@ -355,7 +372,9 @@ export default {
 | 
				
			|||||||
			if (!promiseList.length) this.formLoading = false;
 | 
								if (!promiseList.length) this.formLoading = false;
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		// 上传成功的特殊处理
 | 
							// 上传成功的特殊处理
 | 
				
			||||||
		beforeUpload() {},
 | 
							beforeUpload(file) {
 | 
				
			||||||
 | 
					      console.log(file)
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
		// 上传前的验证规则可通过 bind 属性传入
 | 
							// 上传前的验证规则可通过 bind 属性传入
 | 
				
			||||||
		handleUploadSuccess(response, file, fileList) {
 | 
							handleUploadSuccess(response, file, fileList) {
 | 
				
			||||||
			this.form.files.push({
 | 
								this.form.files.push({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,7 @@ export default {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			title: '中建材自贡新能源',
 | 
								title: '中建材智能化院',
 | 
				
			||||||
			logo: logoImg,
 | 
								logo: logoImg,
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,6 @@ import Element from 'element-ui';
 | 
				
			|||||||
import './assets/styles/element-variables.scss';
 | 
					import './assets/styles/element-variables.scss';
 | 
				
			||||||
import '@/assets/styles/index.scss'; // global css
 | 
					import '@/assets/styles/index.scss'; // global css
 | 
				
			||||||
import '@/assets/styles/ruoyi.scss'; // ruoyi css
 | 
					import '@/assets/styles/ruoyi.scss'; // ruoyi css
 | 
				
			||||||
import '@/assets/font/font.css'
 | 
					 | 
				
			||||||
import App from './App';
 | 
					import App from './App';
 | 
				
			||||||
import store from './store';
 | 
					import store from './store';
 | 
				
			||||||
import router from './router';
 | 
					import router from './router';
 | 
				
			||||||
@@ -35,6 +34,7 @@ import {
 | 
				
			|||||||
	getDictDatas,
 | 
						getDictDatas,
 | 
				
			||||||
	getDictDatas2,
 | 
						getDictDatas2,
 | 
				
			||||||
} from '@/utils/dict';
 | 
					} from '@/utils/dict';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import './theme/index.css'; // 自定义主题包 - code-brick-zj
 | 
					import './theme/index.css'; // 自定义主题包 - code-brick-zj
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 全局方法挂载
 | 
					// 全局方法挂载
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2022-08-24 11:19:43
 | 
					 * @Date: 2022-08-24 11:19:43
 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2025-02-21 13:18:46
 | 
					 * @LastEditTime: 2024-04-02 09:33:29
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
@@ -16,7 +16,7 @@ export default {
 | 
				
			|||||||
      },
 | 
					      },
 | 
				
			||||||
      tableData: [], //table数据
 | 
					      tableData: [], //table数据
 | 
				
			||||||
      listQuery: { //分页
 | 
					      listQuery: { //分页
 | 
				
			||||||
        pageSize: 20,
 | 
					        pageSize: 10,
 | 
				
			||||||
        pageNo: 1,
 | 
					        pageNo: 1,
 | 
				
			||||||
        total: 1,
 | 
					        total: 1,
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										20
									
								
								src/mixins/tableHeightMixin.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					export default {
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								tableH: this.tableHeight(260),
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
							this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
 | 
				
			||||||
 | 
							window.addEventListener('resize', this._setTableHeight);
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						destroyed() {
 | 
				
			||||||
 | 
							window.removeEventListener('resize', this._setTableHeight);
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							_setTableHeight() {
 | 
				
			||||||
 | 
								this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
 | 
				
			||||||
 | 
								// this.tableH = this.tableHeight(260);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@@ -69,26 +69,6 @@ export const constantRoutes = [
 | 
				
			|||||||
    component: (resolve) => require(['@/views/print/design'], resolve),
 | 
					    component: (resolve) => require(['@/views/print/design'], resolve),
 | 
				
			||||||
    hidden: true
 | 
					    hidden: true
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    path: '/allDashboard-model',
 | 
					 | 
				
			||||||
    component: (resolve) => require(['@/views/dashboard/allDashboard/index-model'], resolve),
 | 
					 | 
				
			||||||
    hidden: true
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    path: '/rawDashboard-model',
 | 
					 | 
				
			||||||
    component: (resolve) => require(['@/views/dashboard/rawDashboard/index-model'], resolve),
 | 
					 | 
				
			||||||
    hidden: true
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    path: '/deepDashboard-model',
 | 
					 | 
				
			||||||
    component: (resolve) => require(['@/views/dashboard/deepDashboard/index-model'], resolve),
 | 
					 | 
				
			||||||
    hidden: true
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    path: '/coldDashboard-model',
 | 
					 | 
				
			||||||
    component: (resolve) => require(['@/views/dashboard/coldDashboard/index-model'], resolve),
 | 
					 | 
				
			||||||
    hidden: true
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: "",
 | 
					    path: "",
 | 
				
			||||||
    component: Layout,
 | 
					    component: Layout,
 | 
				
			||||||
@@ -96,15 +76,9 @@ export const constantRoutes = [
 | 
				
			|||||||
    children: [
 | 
					    children: [
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        path: "index",
 | 
					        path: "index",
 | 
				
			||||||
        component: (resolve) => require(["@/views/cost/index"], resolve),
 | 
					        component: (resolve) => require(["@/views/core/base/factory/index"], resolve),
 | 
				
			||||||
        name: "首页",
 | 
					        name: "首页",
 | 
				
			||||||
        meta: { title: "首页", icon: "dashboard", affix: true },
 | 
					        meta: { title: "首页", icon: "dashboard", affix: true },
 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      {
 | 
					 | 
				
			||||||
        path: "indexDetail",
 | 
					 | 
				
			||||||
        component: (resolve) => require(["@/views/cost/indexDetail"], resolve),
 | 
					 | 
				
			||||||
        name: "首页详细",
 | 
					 | 
				
			||||||
        meta: { title: "首页详细", icon: "dashboard"},
 | 
					 | 
				
			||||||
        hidden: true
 | 
					        hidden: true
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -86,10 +86,11 @@ export const DICT_TYPE = {
 | 
				
			|||||||
  // ============== PRODUCT - 产品模块 =============
 | 
					  // ============== PRODUCT - 产品模块 =============
 | 
				
			||||||
  UNIT_DICT: 'unit_dict',
 | 
					  UNIT_DICT: 'unit_dict',
 | 
				
			||||||
  PRODUCT_TYPE: 'product_type',
 | 
					  PRODUCT_TYPE: 'product_type',
 | 
				
			||||||
 | 
					  PROCESS_TYPE: 'process_type',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ============== ENERGY - 能源模块 =============
 | 
					  // ============== ENERGY - 能源模块 =============
 | 
				
			||||||
  ENERGY_UNIT: 'energy_unit',
 | 
					  ENERGY_UNIT: 'energy_unit',
 | 
				
			||||||
  
 | 
					
 | 
				
			||||||
  // ============== ENERGY - 能源模块 =============
 | 
					  // ============== ENERGY - 能源模块 =============
 | 
				
			||||||
  EQU_ALARM_LEVEL: 'equ_alarm_level',
 | 
					  EQU_ALARM_LEVEL: 'equ_alarm_level',
 | 
				
			||||||
  MONITOR_INDEX_TYPE: 'monitor_index_type',
 | 
					  MONITOR_INDEX_TYPE: 'monitor_index_type',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,121 +0,0 @@
 | 
				
			|||||||
<!--
 | 
					 | 
				
			||||||
 * @Author: zwq
 | 
					 | 
				
			||||||
 * @Date: 2024-11-13 14:01:16
 | 
					 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 | 
				
			||||||
 * @LastEditTime: 2025-02-21 14:32:08
 | 
					 | 
				
			||||||
 * @Description:
 | 
					 | 
				
			||||||
-->
 | 
					 | 
				
			||||||
<template>
 | 
					 | 
				
			||||||
	<div>
 | 
					 | 
				
			||||||
		<div class="app-container">
 | 
					 | 
				
			||||||
			<!-- 搜索工作栏 -->
 | 
					 | 
				
			||||||
			<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" />
 | 
					 | 
				
			||||||
			<pagination
 | 
					 | 
				
			||||||
				:page.sync="listQuery.pageNo"
 | 
					 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
					 | 
				
			||||||
				:total="listQuery.total"
 | 
					 | 
				
			||||||
				@pagination="getDataList" />
 | 
					 | 
				
			||||||
		</div>
 | 
					 | 
				
			||||||
	</div>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
import basicPage from '@/mixins/basic-page';
 | 
					 | 
				
			||||||
import { yurepage } from '@/api/environmental/environmentalLog';
 | 
					 | 
				
			||||||
import { parseTime } from '@/filter/code-filter';
 | 
					 | 
				
			||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const tableProps = [
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'recordTime',
 | 
					 | 
				
			||||||
		label: '记录时间',
 | 
					 | 
				
			||||||
		filter: parseTime,
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'usingQuantity',
 | 
					 | 
				
			||||||
		label: '发电量',
 | 
					 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(3) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
];
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
	name: '',
 | 
					 | 
				
			||||||
	mixins: [basicPage, tableHeightMixin],
 | 
					 | 
				
			||||||
	data() {
 | 
					 | 
				
			||||||
		return {
 | 
					 | 
				
			||||||
			urlOptions: {
 | 
					 | 
				
			||||||
				getDataListURL: yurepage,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			formConfig: [
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					type: 'datePicker',
 | 
					 | 
				
			||||||
					label: '时间',
 | 
					 | 
				
			||||||
					dateType: 'datetimerange',
 | 
					 | 
				
			||||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
					 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
					 | 
				
			||||||
					rangeSeparator: '-',
 | 
					 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
					 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
					 | 
				
			||||||
					width: 350,
 | 
					 | 
				
			||||||
					param: 'searchTime',
 | 
					 | 
				
			||||||
					clearable: false,
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					type: 'button',
 | 
					 | 
				
			||||||
					btnName: '查询',
 | 
					 | 
				
			||||||
					name: 'search',
 | 
					 | 
				
			||||||
					color: 'primary',
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			listQuery: {
 | 
					 | 
				
			||||||
				statisticType: 1,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			tableProps,
 | 
					 | 
				
			||||||
			tableData: [],
 | 
					 | 
				
			||||||
		};
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	components: {},
 | 
					 | 
				
			||||||
	created() {
 | 
					 | 
				
			||||||
		const end = new Date();
 | 
					 | 
				
			||||||
		const start = new Date();
 | 
					 | 
				
			||||||
		this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
 | 
					 | 
				
			||||||
		this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
 | 
					 | 
				
			||||||
		this.$nextTick(() => {
 | 
					 | 
				
			||||||
			this.$refs.searchBarForm.formInline.searchTime = [
 | 
					 | 
				
			||||||
				this.listQuery.startTime,
 | 
					 | 
				
			||||||
				this.listQuery.endTime,
 | 
					 | 
				
			||||||
			];
 | 
					 | 
				
			||||||
		});
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	methods: {
 | 
					 | 
				
			||||||
		buttonClick(val) {
 | 
					 | 
				
			||||||
			switch (val.btnName) {
 | 
					 | 
				
			||||||
				case 'search':
 | 
					 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
					 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
					 | 
				
			||||||
					this.listQuery.statisticType = 1;
 | 
					 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
					 | 
				
			||||||
					this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
 | 
					 | 
				
			||||||
					this.getDataList();
 | 
					 | 
				
			||||||
					break;
 | 
					 | 
				
			||||||
				default:
 | 
					 | 
				
			||||||
					console.log(val);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
<style lang="scss"></style>
 | 
					 | 
				
			||||||
@@ -1,131 +0,0 @@
 | 
				
			|||||||
<!--
 | 
					 | 
				
			||||||
 * @Author: zwq
 | 
					 | 
				
			||||||
 * @Date: 2024-11-13 14:01:16
 | 
					 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 | 
				
			||||||
 * @LastEditTime: 2025-02-21 14:31:00
 | 
					 | 
				
			||||||
 * @Description:
 | 
					 | 
				
			||||||
-->
 | 
					 | 
				
			||||||
<template>
 | 
					 | 
				
			||||||
	<div>
 | 
					 | 
				
			||||||
		<div class="app-container">
 | 
					 | 
				
			||||||
			<!-- 搜索工作栏 -->
 | 
					 | 
				
			||||||
			<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" />
 | 
					 | 
				
			||||||
			<pagination
 | 
					 | 
				
			||||||
				:page.sync="listQuery.pageNo"
 | 
					 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
					 | 
				
			||||||
				:total="listQuery.total"
 | 
					 | 
				
			||||||
				@pagination="getDataList" />
 | 
					 | 
				
			||||||
		</div>
 | 
					 | 
				
			||||||
	</div>
 | 
					 | 
				
			||||||
</template>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<script>
 | 
					 | 
				
			||||||
import basicPage from '@/mixins/basic-page';
 | 
					 | 
				
			||||||
import { getCostEnviHisPage } from '@/api/environmental/environmentalLog';
 | 
					 | 
				
			||||||
import { parseTime } from '@/filter/code-filter';
 | 
					 | 
				
			||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const tableProps = [
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'recTime',
 | 
					 | 
				
			||||||
		label: '记录时间',
 | 
					 | 
				
			||||||
		filter: parseTime,
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'envi1',
 | 
					 | 
				
			||||||
		label: '二氧化硫mg/Nm3',
 | 
					 | 
				
			||||||
		filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'envi2',
 | 
					 | 
				
			||||||
		label: '氮氧化物mg/Nm3',
 | 
					 | 
				
			||||||
		filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'envi3',
 | 
					 | 
				
			||||||
		label: '粉尘mg/Nm3',
 | 
					 | 
				
			||||||
		filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
];
 | 
					 | 
				
			||||||
export default {
 | 
					 | 
				
			||||||
	name: '',
 | 
					 | 
				
			||||||
	mixins: [basicPage, tableHeightMixin],
 | 
					 | 
				
			||||||
	data() {
 | 
					 | 
				
			||||||
		return {
 | 
					 | 
				
			||||||
			urlOptions: {
 | 
					 | 
				
			||||||
				getDataListURL: getCostEnviHisPage,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			formConfig: [
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					type: 'datePicker',
 | 
					 | 
				
			||||||
					label: '时间',
 | 
					 | 
				
			||||||
					dateType: 'datetimerange',
 | 
					 | 
				
			||||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
					 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
					 | 
				
			||||||
					rangeSeparator: '-',
 | 
					 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
					 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
					 | 
				
			||||||
					width: 350,
 | 
					 | 
				
			||||||
					param: 'searchTime',
 | 
					 | 
				
			||||||
					clearable: false,
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					type: 'button',
 | 
					 | 
				
			||||||
					btnName: '查询',
 | 
					 | 
				
			||||||
					name: 'search',
 | 
					 | 
				
			||||||
					color: 'primary',
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			listQuery: {
 | 
					 | 
				
			||||||
				statisticType: 1,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			tableProps,
 | 
					 | 
				
			||||||
			tableData: [],
 | 
					 | 
				
			||||||
		};
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	components: {},
 | 
					 | 
				
			||||||
	created() {
 | 
					 | 
				
			||||||
		const end = new Date();
 | 
					 | 
				
			||||||
		const start = new Date();
 | 
					 | 
				
			||||||
		this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
 | 
					 | 
				
			||||||
		this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
 | 
					 | 
				
			||||||
		this.$nextTick(() => {
 | 
					 | 
				
			||||||
			this.$refs.searchBarForm.formInline.searchTime = [
 | 
					 | 
				
			||||||
				this.listQuery.startTime,
 | 
					 | 
				
			||||||
				this.listQuery.endTime,
 | 
					 | 
				
			||||||
			];
 | 
					 | 
				
			||||||
		});
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	methods: {
 | 
					 | 
				
			||||||
		buttonClick(val) {
 | 
					 | 
				
			||||||
			switch (val.btnName) {
 | 
					 | 
				
			||||||
				case 'search':
 | 
					 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
					 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
					 | 
				
			||||||
					this.listQuery.statisticType = 1;
 | 
					 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
					 | 
				
			||||||
					this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
 | 
					 | 
				
			||||||
					this.getDataList();
 | 
					 | 
				
			||||||
					break;
 | 
					 | 
				
			||||||
				default:
 | 
					 | 
				
			||||||
					console.log(val);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					 | 
				
			||||||
<style lang="scss"></style>
 | 
					 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<!-- 
 | 
					<!--
 | 
				
			||||||
    filename: dialogForm.vue
 | 
					    filename: dialogForm.vue
 | 
				
			||||||
    author: liubin
 | 
					    author: liubin
 | 
				
			||||||
    date: 2023-09-11 15:55:13
 | 
					    date: 2023-09-11 15:55:13
 | 
				
			||||||
@@ -71,14 +71,14 @@
 | 
				
			|||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<el-col :span="12">
 | 
								<el-col :span="12">
 | 
				
			||||||
				<el-form-item label="工段排序" prop="sort">
 | 
									<el-form-item label="工段设备排序" prop="sort">
 | 
				
			||||||
					<el-input-number
 | 
										<el-input-number
 | 
				
			||||||
						v-model="dataForm.sort"
 | 
											v-model="dataForm.sort"
 | 
				
			||||||
						filterable
 | 
											filterable
 | 
				
			||||||
						min="0"
 | 
											min="0"
 | 
				
			||||||
						max="100"
 | 
											max="100"
 | 
				
			||||||
						@change="$emit('update', dataForm)"
 | 
											@change="$emit('update', dataForm)"
 | 
				
			||||||
						placeholder="请输入工段排序" />
 | 
											placeholder="请输入工段设备排序" />
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
		</el-row>
 | 
							</el-row>
 | 
				
			||||||
@@ -112,6 +112,7 @@
 | 
				
			|||||||
								{ label: '无类型', value: 0 },
 | 
													{ label: '无类型', value: 0 },
 | 
				
			||||||
								{ label: '进口统计', value: 1 },
 | 
													{ label: '进口统计', value: 1 },
 | 
				
			||||||
								{ label: '出口统计', value: 2 },
 | 
													{ label: '出口统计', value: 2 },
 | 
				
			||||||
 | 
					                { label: '进出口计数', value: 3 },
 | 
				
			||||||
							]"
 | 
												]"
 | 
				
			||||||
							:key="opt.value"
 | 
												:key="opt.value"
 | 
				
			||||||
							:label="opt.label"
 | 
												:label="opt.label"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,8 @@
 | 
				
			|||||||
		<SearchBar
 | 
							<SearchBar
 | 
				
			||||||
			:formConfigs="searchBarFormConfig"
 | 
								:formConfigs="searchBarFormConfig"
 | 
				
			||||||
			ref="search-bar"
 | 
								ref="search-bar"
 | 
				
			||||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
								@select-changed="handleSearchBarChanged"
 | 
				
			||||||
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		<!-- 列表 -->
 | 
							<!-- 列表 -->
 | 
				
			||||||
		<base-table
 | 
							<base-table
 | 
				
			||||||
@@ -52,6 +53,8 @@ import {
 | 
				
			|||||||
	getEquipmentBindSectionPage,
 | 
						getEquipmentBindSectionPage,
 | 
				
			||||||
	exportEquipmentBindSectionExcel,
 | 
						exportEquipmentBindSectionExcel,
 | 
				
			||||||
} from '@/api/base/equipmentBindSection';
 | 
					} from '@/api/base/equipmentBindSection';
 | 
				
			||||||
 | 
					import { getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
import moment from 'moment';
 | 
					import moment from 'moment';
 | 
				
			||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
					import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
				
			||||||
import DialogForm from './dialogForm.vue';
 | 
					import DialogForm from './dialogForm.vue';
 | 
				
			||||||
@@ -61,7 +64,7 @@ export default {
 | 
				
			|||||||
	mixins: [basicPageMixin],
 | 
						mixins: [basicPageMixin],
 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			searchBarKeys: ['workshopSectionId', 'equipmentName'],
 | 
								searchBarKeys: ['factoryId','productionLineId','workshopSectionId', 'equipmentName'],
 | 
				
			||||||
			tableBtn: [
 | 
								tableBtn: [
 | 
				
			||||||
				this.$auth.hasPermi('base:equipment-bind-section:update')
 | 
									this.$auth.hasPermi('base:equipment-bind-section:update')
 | 
				
			||||||
					? {
 | 
										? {
 | 
				
			||||||
@@ -84,8 +87,9 @@ export default {
 | 
				
			|||||||
					width: 180,
 | 
										width: 180,
 | 
				
			||||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
										filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{ prop: 'productionLine', label: '产线名称' },
 | 
									{ prop: 'factoryName', label: '工厂' },
 | 
				
			||||||
				{ prop: 'workshopSection', label: '工段名称' },
 | 
									{ prop: 'productionLine', label: '产线' },
 | 
				
			||||||
 | 
									{ prop: 'workshopSection', label: '工段' },
 | 
				
			||||||
				{ prop: 'equipment', label: '设备名称' },
 | 
									{ prop: 'equipment', label: '设备名称' },
 | 
				
			||||||
				{ prop: 'sort', label: '工段中排序' },
 | 
									{ prop: 'sort', label: '工段中排序' },
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
@@ -98,7 +102,7 @@ export default {
 | 
				
			|||||||
					prop: 'sectionDataType',
 | 
										prop: 'sectionDataType',
 | 
				
			||||||
					label: '工段数据类型',
 | 
										label: '工段数据类型',
 | 
				
			||||||
					filter: (val) =>
 | 
										filter: (val) =>
 | 
				
			||||||
						val != null ? ['无类型', '进口计数', '出口计数'][val] : '-',
 | 
											val != null ? ['无类型', '进口计数', '出口计数', '进出口计数'][val] : '-',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				// {
 | 
									// {
 | 
				
			||||||
				// 	action: 'show-alert',
 | 
									// 	action: 'show-alert',
 | 
				
			||||||
@@ -129,6 +133,20 @@ export default {
 | 
				
			|||||||
				// },
 | 
									// },
 | 
				
			||||||
			],
 | 
								],
 | 
				
			||||||
			searchBarFormConfig: [
 | 
								searchBarFormConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产线',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'productionLineId',
 | 
				
			||||||
 | 
										multiple: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
					label: '工段',
 | 
										label: '工段',
 | 
				
			||||||
@@ -209,8 +227,8 @@ export default {
 | 
				
			|||||||
						label: '产线数据类型',
 | 
											label: '产线数据类型',
 | 
				
			||||||
						options: [
 | 
											options: [
 | 
				
			||||||
							{ label: '无类型', value: 0 },
 | 
												{ label: '无类型', value: 0 },
 | 
				
			||||||
							{ label: '进口统计', value: 1 },
 | 
												{ label: '进口计数', value: 1 },
 | 
				
			||||||
							{ label: '出口统计', value: 2 },
 | 
												{ label: '出口计数', value: 2 },
 | 
				
			||||||
						],
 | 
											],
 | 
				
			||||||
						prop: 'lineDataType',
 | 
											prop: 'lineDataType',
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
@@ -219,8 +237,9 @@ export default {
 | 
				
			|||||||
						label: '工段数据类型',
 | 
											label: '工段数据类型',
 | 
				
			||||||
						options: [
 | 
											options: [
 | 
				
			||||||
							{ label: '无类型', value: 0 },
 | 
												{ label: '无类型', value: 0 },
 | 
				
			||||||
							{ label: '进口统计', value: 1 },
 | 
												{ label: '进口计数', value: 1 },
 | 
				
			||||||
							{ label: '出口统计', value: 2 },
 | 
												{ label: '出口计数', value: 2 },
 | 
				
			||||||
 | 
												{ label: '进出口计数', value: 3 },
 | 
				
			||||||
						],
 | 
											],
 | 
				
			||||||
						prop: 'sectionDataType',
 | 
											prop: 'sectionDataType',
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
@@ -234,6 +253,9 @@ export default {
 | 
				
			|||||||
				pageSize: 10,
 | 
									pageSize: 10,
 | 
				
			||||||
				workshopSectionId: null,
 | 
									workshopSectionId: null,
 | 
				
			||||||
				equipmentId: null,
 | 
									equipmentId: null,
 | 
				
			||||||
 | 
					        equipmentName: null,
 | 
				
			||||||
 | 
					        factoryId: null,
 | 
				
			||||||
 | 
									productionLineId: [],
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			// 表单参数
 | 
								// 表单参数
 | 
				
			||||||
			form: {},
 | 
								form: {},
 | 
				
			||||||
@@ -242,6 +264,7 @@ export default {
 | 
				
			|||||||
	created() {
 | 
						created() {
 | 
				
			||||||
		this.getList();
 | 
							this.getList();
 | 
				
			||||||
		this.initWorksection();
 | 
							this.initWorksection();
 | 
				
			||||||
 | 
							this.getPdLineList();
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		/** 准备工段数据 */
 | 
							/** 准备工段数据 */
 | 
				
			||||||
@@ -251,7 +274,7 @@ export default {
 | 
				
			|||||||
				method: 'get',
 | 
									method: 'get',
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
			if (code == 0) {
 | 
								if (code == 0) {
 | 
				
			||||||
				this.searchBarFormConfig[0].selectOptions = data.map((item) => {
 | 
									this.searchBarFormConfig[2].selectOptions = data.map((item) => {
 | 
				
			||||||
					return {
 | 
										return {
 | 
				
			||||||
						name: item.name,
 | 
											name: item.name,
 | 
				
			||||||
						id: item.id,
 | 
											id: item.id,
 | 
				
			||||||
@@ -259,6 +282,51 @@ export default {
 | 
				
			|||||||
				});
 | 
									});
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
							getPdLineList() {
 | 
				
			||||||
 | 
								getPdList().then((res) => {
 | 
				
			||||||
 | 
									this.searchBarFormConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.searchBarFormConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
 | 
								this.queryParams.productionLineId = [];
 | 
				
			||||||
 | 
								this.$refs['search-bar'].formInline.productionLineId = undefined;
 | 
				
			||||||
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
 | 
									this.searchBarFormConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.queryParams.pageNo = 1;
 | 
				
			||||||
 | 
										this.queryParams.pageSize = 10;
 | 
				
			||||||
 | 
										this.queryParams.name = val.name;
 | 
				
			||||||
 | 
										this.queryParams.workshopSectionId = val.workshopSectionId || undefined;
 | 
				
			||||||
 | 
										this.queryParams.equipmentName = val.equipmentName || undefined;
 | 
				
			||||||
 | 
										this.queryParams.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.queryParams.productionLineId = val.productionLineId || [];
 | 
				
			||||||
 | 
										this.handleQuery();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'add':
 | 
				
			||||||
 | 
										this.handleAdd();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'export':
 | 
				
			||||||
 | 
										this.handleExport();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'reset':
 | 
				
			||||||
 | 
										this.$refs['search-bar'].resetForm();
 | 
				
			||||||
 | 
										this.resetQuery();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		/** 查询列表 */
 | 
							/** 查询列表 */
 | 
				
			||||||
		getList() {
 | 
							getList() {
 | 
				
			||||||
			this.loading = true;
 | 
								this.loading = true;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										109
									
								
								src/views/base/equipmentPlc/add-or-updata.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,109 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: zwq
 | 
				
			||||||
 | 
					 * @Date: 2021-11-18 14:16:25
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-02-26 16:37:29
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<el-row :gutter="20">
 | 
				
			||||||
 | 
							<el-form
 | 
				
			||||||
 | 
								:model="dataForm"
 | 
				
			||||||
 | 
								:rules="dataRule"
 | 
				
			||||||
 | 
								ref="dataForm"
 | 
				
			||||||
 | 
								@keyup.enter.native="dataFormSubmit()"
 | 
				
			||||||
 | 
								label-width="80px">
 | 
				
			||||||
 | 
								<el-col :span="12">
 | 
				
			||||||
 | 
									<el-form-item label="关联表名" prop="plcTableName">
 | 
				
			||||||
 | 
										<el-input
 | 
				
			||||||
 | 
											v-model="dataForm.plcTableName"
 | 
				
			||||||
 | 
											clearable
 | 
				
			||||||
 | 
											placeholder="请输入关联表名" />
 | 
				
			||||||
 | 
									</el-form-item>
 | 
				
			||||||
 | 
								</el-col>
 | 
				
			||||||
 | 
								<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-col :span="12">
 | 
				
			||||||
 | 
									<el-form-item label="英文名" prop="enName">
 | 
				
			||||||
 | 
										<el-input
 | 
				
			||||||
 | 
											v-model="dataForm.enName"
 | 
				
			||||||
 | 
											clearable
 | 
				
			||||||
 | 
											placeholder="请输入英文名" />
 | 
				
			||||||
 | 
									</el-form-item>
 | 
				
			||||||
 | 
								</el-col>
 | 
				
			||||||
 | 
								<el-col :span="12">
 | 
				
			||||||
 | 
									<el-form-item label="是否采集" prop="collection">
 | 
				
			||||||
 | 
										<el-switch
 | 
				
			||||||
 | 
											v-model="dataForm.collection"
 | 
				
			||||||
 | 
											:active-value="1"
 | 
				
			||||||
 | 
											:inactive-value="0"></el-switch>
 | 
				
			||||||
 | 
									</el-form-item>
 | 
				
			||||||
 | 
								</el-col>
 | 
				
			||||||
 | 
								<el-col :span="12">
 | 
				
			||||||
 | 
									<el-form-item label="描述" prop="description">
 | 
				
			||||||
 | 
										<el-input
 | 
				
			||||||
 | 
											v-model="dataForm.description"
 | 
				
			||||||
 | 
											clearable
 | 
				
			||||||
 | 
											placeholder="请输入描述" />
 | 
				
			||||||
 | 
									</el-form-item>
 | 
				
			||||||
 | 
								</el-col>
 | 
				
			||||||
 | 
							</el-form>
 | 
				
			||||||
 | 
						</el-row>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import basicAdd from '@/mixins/basic-add';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
						createEquipmentPlc,
 | 
				
			||||||
 | 
						updateEquipmentPlc,
 | 
				
			||||||
 | 
						getEquipmentPlc,
 | 
				
			||||||
 | 
						getCode,
 | 
				
			||||||
 | 
					} from '@/api/base/equipmentPlc';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						mixins: [basicAdd],
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									isGetCode: true,
 | 
				
			||||||
 | 
									codeURL: getCode,
 | 
				
			||||||
 | 
									createURL: createEquipmentPlc,
 | 
				
			||||||
 | 
									updateURL: updateEquipmentPlc,
 | 
				
			||||||
 | 
									infoURL: getEquipmentPlc,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								dataForm: {
 | 
				
			||||||
 | 
									id: undefined,
 | 
				
			||||||
 | 
									plcTableName: undefined,
 | 
				
			||||||
 | 
									code: undefined,
 | 
				
			||||||
 | 
									name: undefined,
 | 
				
			||||||
 | 
									enName: undefined,
 | 
				
			||||||
 | 
									collection: 1,
 | 
				
			||||||
 | 
									description: undefined,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								dataRule: {
 | 
				
			||||||
 | 
									plcTableName: [
 | 
				
			||||||
 | 
										{ required: true, message: '关联表名不能为空', trigger: 'blur' },
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
									code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
 | 
				
			||||||
 | 
									name: [{ required: true, message: '标识不能为空', trigger: 'blur' }],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
@@ -1,59 +1,53 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
	<div class="app-container">
 | 
						<div class="app-container">
 | 
				
			||||||
		<!-- 搜索工作栏 -->
 | 
							<search-bar
 | 
				
			||||||
		<SearchBar
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
			:formConfigs="searchBarFormConfig"
 | 
								ref="searchBarForm"
 | 
				
			||||||
			ref="search-bar"
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		<!-- 列表 -->
 | 
					 | 
				
			||||||
		<base-table
 | 
							<base-table
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
			:table-props="tableProps"
 | 
								:table-props="tableProps"
 | 
				
			||||||
			:page="queryParams.pageNo"
 | 
								:page="listQuery.pageNo"
 | 
				
			||||||
			:limit="queryParams.pageSize"
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
			:table-data="list"
 | 
								:table-data="tableData"
 | 
				
			||||||
			ref="pageTable"
 | 
					 | 
				
			||||||
			@emitFun="handleEmitFun">
 | 
								@emitFun="handleEmitFun">
 | 
				
			||||||
			<method-btn
 | 
								<method-btn
 | 
				
			||||||
				v-if="tableBtn.length"
 | 
									v-if="tableBtn.length"
 | 
				
			||||||
				slot="handleBtn"
 | 
									slot="handleBtn"
 | 
				
			||||||
 | 
									:width="120"
 | 
				
			||||||
				label="操作"
 | 
									label="操作"
 | 
				
			||||||
				:method-list="tableBtn"
 | 
									:method-list="tableBtn"
 | 
				
			||||||
				@clickBtn="handleTableBtnClick" />
 | 
									@clickBtn="handleClick" />
 | 
				
			||||||
		</base-table>
 | 
							</base-table>
 | 
				
			||||||
 | 
					 | 
				
			||||||
		<!-- 分页组件 -->
 | 
					 | 
				
			||||||
		<pagination
 | 
							<pagination
 | 
				
			||||||
			v-show="total > 0"
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
			:total="total"
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
			:page.sync="queryParams.pageNo"
 | 
								:total="listQuery.total"
 | 
				
			||||||
			:limit.sync="queryParams.pageSize"
 | 
								@pagination="getDataList" />
 | 
				
			||||||
			@pagination="getList" />
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		<!-- 对话框(添加 / 修改) -->
 | 
					 | 
				
			||||||
		<base-dialog
 | 
							<base-dialog
 | 
				
			||||||
			:dialogTitle="title"
 | 
								:dialogTitle="addOrEditTitle"
 | 
				
			||||||
			:dialogVisible="open"
 | 
								:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
			width="700px"
 | 
								@cancel="handleCancel"
 | 
				
			||||||
			@close="cancel"
 | 
								@confirm="handleConfirm"
 | 
				
			||||||
			@cancel="cancel"
 | 
								:before-close="handleCancel"
 | 
				
			||||||
			@confirm="submitForm">
 | 
								width="50%">
 | 
				
			||||||
			<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
 | 
								<add-or-update
 | 
				
			||||||
 | 
									ref="addOrUpdate"
 | 
				
			||||||
 | 
									@refreshDataList="successSubmit"></add-or-update>
 | 
				
			||||||
		</base-dialog>
 | 
							</base-dialog>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
 | 
					import AddOrUpdate from './add-or-updata';
 | 
				
			||||||
 | 
					import basicPage from '@/mixins/basic-page';
 | 
				
			||||||
 | 
					import { parseTime } from '@/filter/code-filter';
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
	createEquipmentPlc,
 | 
					 | 
				
			||||||
	updateEquipmentPlc,
 | 
					 | 
				
			||||||
	deleteEquipmentPlc,
 | 
						deleteEquipmentPlc,
 | 
				
			||||||
	getEquipmentPlc,
 | 
					 | 
				
			||||||
	getEquipmentPlcPage,
 | 
						getEquipmentPlcPage,
 | 
				
			||||||
	exportEquipmentPlcExcel,
 | 
						exportEquipmentPlcExcel,
 | 
				
			||||||
 | 
						updateEquipmentPlc,
 | 
				
			||||||
} from '@/api/base/equipmentPlc';
 | 
					} from '@/api/base/equipmentPlc';
 | 
				
			||||||
import moment from 'moment';
 | 
					 | 
				
			||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const switchBtn = {
 | 
					const switchBtn = {
 | 
				
			||||||
	name: 'SwitchBtn',
 | 
						name: 'SwitchBtn',
 | 
				
			||||||
@@ -90,49 +84,45 @@ const switchBtn = {
 | 
				
			|||||||
		);
 | 
							);
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{ prop: 'code', label: '编码', width: 220 },
 | 
				
			||||||
 | 
						{ prop: 'plcTableName', label: '关联表名' },
 | 
				
			||||||
 | 
						{ prop: 'name', label: '标识名称' },
 | 
				
			||||||
 | 
						{ prop: 'enName', label: '英文名称' },
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'collection',
 | 
				
			||||||
 | 
							label: '是否采集',
 | 
				
			||||||
 | 
							subcomponent: switchBtn,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{ prop: 'description', label: '描述' },
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
	name: 'EquipmentPlc',
 | 
						mixins: [basicPage],
 | 
				
			||||||
	mixins: [basicPageMixin],
 | 
					 | 
				
			||||||
	components: {},
 | 
					 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			tableKey: Math.random(),
 | 
								urlOptions: {
 | 
				
			||||||
			searchBarKeys: ['name', 'plcTableName'],
 | 
									getDataListURL: getEquipmentPlcPage,
 | 
				
			||||||
 | 
									deleteURL: deleteEquipmentPlc,
 | 
				
			||||||
 | 
									exportURL: exportEquipmentPlcExcel,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
			tableBtn: [
 | 
								tableBtn: [
 | 
				
			||||||
				this.$auth.hasPermi('base:equipment-plc:update')
 | 
									this.$auth.hasPermi(`base:equipment-plc:update`)
 | 
				
			||||||
					? {
 | 
										? {
 | 
				
			||||||
							type: 'edit',
 | 
												type: 'edit',
 | 
				
			||||||
							btnName: '修改',
 | 
												btnName: '编辑',
 | 
				
			||||||
					  }
 | 
										  }
 | 
				
			||||||
					: undefined,
 | 
										: undefined,
 | 
				
			||||||
				this.$auth.hasPermi('base:equipment-plc:delete')
 | 
									this.$auth.hasPermi(`base:equipment-plc:delete`)
 | 
				
			||||||
					? {
 | 
										? {
 | 
				
			||||||
							type: 'delete',
 | 
												type: 'delete',
 | 
				
			||||||
							btnName: '删除',
 | 
												btnName: '删除',
 | 
				
			||||||
					  }
 | 
										  }
 | 
				
			||||||
					: undefined,
 | 
										: undefined,
 | 
				
			||||||
			].filter((v) => v),
 | 
								].filter((v) => v),
 | 
				
			||||||
			tableProps: [
 | 
								tableData: [],
 | 
				
			||||||
				// {
 | 
								formConfig: [
 | 
				
			||||||
				// 	prop: 'createTime',
 | 
					 | 
				
			||||||
				// 	label: '添加时间',
 | 
					 | 
				
			||||||
				// 	fixed: true,
 | 
					 | 
				
			||||||
				// 	width: 180,
 | 
					 | 
				
			||||||
				// 	filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
					 | 
				
			||||||
				// },
 | 
					 | 
				
			||||||
				{ prop: 'code', label: '编码' },
 | 
					 | 
				
			||||||
				{ prop: 'plcTableName', label: '关联表名' },
 | 
					 | 
				
			||||||
				{ prop: 'name', label: '标识名称' },
 | 
					 | 
				
			||||||
				{ prop: 'enName', label: '英文名称' },
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					prop: 'collection',
 | 
					 | 
				
			||||||
					label: '是否采集',
 | 
					 | 
				
			||||||
					subcomponent: switchBtn,
 | 
					 | 
				
			||||||
				},
 | 
					 | 
				
			||||||
				{ prop: 'description', label: '描述' },
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			searchBarFormConfig: [
 | 
					 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'input',
 | 
										type: 'input',
 | 
				
			||||||
					label: '表名',
 | 
										label: '表名',
 | 
				
			||||||
@@ -147,231 +137,86 @@ export default {
 | 
				
			|||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
					btnName: '查询',
 | 
										btnName: '搜索',
 | 
				
			||||||
					name: 'search',
 | 
										name: 'search',
 | 
				
			||||||
					color: 'primary',
 | 
										color: 'primary',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
 | 
									// {
 | 
				
			||||||
 | 
									// 	type: 'separate',
 | 
				
			||||||
 | 
									// },
 | 
				
			||||||
 | 
									// {
 | 
				
			||||||
 | 
									// 	type: 'button',
 | 
				
			||||||
 | 
									// 	btnName: '重置',
 | 
				
			||||||
 | 
									// 	name: 'reset',
 | 
				
			||||||
 | 
									// },
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'separate',
 | 
										type: 'separate',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					// type: this.$auth.hasPermi('base:equipment-plc:create')
 | 
										type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
 | 
				
			||||||
					// 	? 'button'
 | 
					 | 
				
			||||||
					// 	: '',
 | 
					 | 
				
			||||||
					type: 'button',
 | 
					 | 
				
			||||||
					btnName: '新增',
 | 
										btnName: '新增',
 | 
				
			||||||
					name: 'add',
 | 
										name: 'add',
 | 
				
			||||||
					plain: true,
 | 
					 | 
				
			||||||
					color: 'success',
 | 
										color: 'success',
 | 
				
			||||||
 | 
										plain: true,
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				// {
 | 
									// {
 | 
				
			||||||
				// 	type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
 | 
									// 	type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
 | 
				
			||||||
 | 
									// },
 | 
				
			||||||
 | 
									// {
 | 
				
			||||||
 | 
									// 	type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
 | 
				
			||||||
				// 	btnName: '导出',
 | 
									// 	btnName: '导出',
 | 
				
			||||||
				// 	name: 'export',
 | 
									// 	name: 'export',
 | 
				
			||||||
				// 	color: 'warning',
 | 
									// 	color: 'warning',
 | 
				
			||||||
				// },
 | 
									// },
 | 
				
			||||||
			],
 | 
								],
 | 
				
			||||||
			rows: [
 | 
					 | 
				
			||||||
				[
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						input: true,
 | 
					 | 
				
			||||||
						label: '关联表名',
 | 
					 | 
				
			||||||
						prop: 'plcTableName',
 | 
					 | 
				
			||||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
					 | 
				
			||||||
						// bind: {
 | 
					 | 
				
			||||||
						// 	disabled: true, // some condition, like detail mode...
 | 
					 | 
				
			||||||
						// }
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						input: true,
 | 
					 | 
				
			||||||
						label: '编码',
 | 
					 | 
				
			||||||
						prop: 'code',
 | 
					 | 
				
			||||||
						url: '/base/equipment-group/getCode',
 | 
					 | 
				
			||||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
				],
 | 
					 | 
				
			||||||
				[
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						input: true,
 | 
					 | 
				
			||||||
						label: '标识',
 | 
					 | 
				
			||||||
						prop: 'name',
 | 
					 | 
				
			||||||
						rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
 | 
					 | 
				
			||||||
						// bind: {
 | 
					 | 
				
			||||||
						// 	disabled: true, // some condition, like detail mode...
 | 
					 | 
				
			||||||
						// }
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						input: true,
 | 
					 | 
				
			||||||
						label: '英文名',
 | 
					 | 
				
			||||||
						prop: 'enName',
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
				],
 | 
					 | 
				
			||||||
				[
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						switch: true,
 | 
					 | 
				
			||||||
						label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
 | 
					 | 
				
			||||||
						prop: 'collection',
 | 
					 | 
				
			||||||
						value: 1,
 | 
					 | 
				
			||||||
						bind: {
 | 
					 | 
				
			||||||
							'active-value': 1,
 | 
					 | 
				
			||||||
							'inactive-value': 0,
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
				],
 | 
					 | 
				
			||||||
				[
 | 
					 | 
				
			||||||
					{
 | 
					 | 
				
			||||||
						textarea: true,
 | 
					 | 
				
			||||||
						label: '描述',
 | 
					 | 
				
			||||||
						prop: 'description',
 | 
					 | 
				
			||||||
						bind: {
 | 
					 | 
				
			||||||
							placeholder: '请输入备注',
 | 
					 | 
				
			||||||
						},
 | 
					 | 
				
			||||||
					},
 | 
					 | 
				
			||||||
				],
 | 
					 | 
				
			||||||
			],
 | 
					 | 
				
			||||||
			// 是否显示弹出
 | 
					 | 
				
			||||||
			open: false,
 | 
					 | 
				
			||||||
			// 查询参数
 | 
					 | 
				
			||||||
			queryParams: {
 | 
					 | 
				
			||||||
				pageNo: 1,
 | 
					 | 
				
			||||||
				pageSize: 10,
 | 
					 | 
				
			||||||
				plcTableName: null,
 | 
					 | 
				
			||||||
				name: null,
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			// 表单参数
 | 
					 | 
				
			||||||
			form: {},
 | 
					 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	created() {
 | 
						components: {
 | 
				
			||||||
		this.getList();
 | 
							AddOrUpdate,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						created() {},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		/** 覆盖 handleEmitFun 的默认实现 */
 | 
							/** 覆盖 handleEmitFun 的默认实现 */
 | 
				
			||||||
		handleEmitFun({ action, payload }) {
 | 
							handleEmitFun({ action, payload }) {
 | 
				
			||||||
 | 
					      console.log(payload)
 | 
				
			||||||
			switch (action) {
 | 
								switch (action) {
 | 
				
			||||||
				case 'update-collect':
 | 
									case 'update-collect':
 | 
				
			||||||
					this.reset();
 | 
										updateEquipmentPlc(payload).then((response) => {
 | 
				
			||||||
					const tempForm = {};
 | 
					 | 
				
			||||||
					Object.keys(this.form).forEach((key) => {
 | 
					 | 
				
			||||||
						tempForm[key] = payload[key];
 | 
					 | 
				
			||||||
					});
 | 
					 | 
				
			||||||
					updateEquipmentPlc(tempForm).then((response) => {
 | 
					 | 
				
			||||||
						this.$modal.msgSuccess('修改成功');
 | 
											this.$modal.msgSuccess('修改成功');
 | 
				
			||||||
						this.open = false;
 | 
											this.getDataList();
 | 
				
			||||||
						this.getList();
 | 
					 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		/** 查询列表 */
 | 
							buttonClick(val) {
 | 
				
			||||||
		getList() {
 | 
								switch (val.btnName) {
 | 
				
			||||||
			this.loading = true;
 | 
									case 'search':
 | 
				
			||||||
			// 执行查询
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
			getEquipmentPlcPage(this.queryParams).then((response) => {
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
				this.list = response.data.list;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
				this.total = response.data.total;
 | 
										this.listQuery.plcTableName = val.plcTableName;
 | 
				
			||||||
				this.loading = false;
 | 
										this.getDataList();
 | 
				
			||||||
				// this.tableKey = Math.random(); // method 1
 | 
										break;
 | 
				
			||||||
			});
 | 
									case 'reset':
 | 
				
			||||||
		},
 | 
										this.$refs.searchBarForm.resetForm();
 | 
				
			||||||
		/** 取消按钮 */
 | 
										this.listQuery = {
 | 
				
			||||||
		cancel() {
 | 
											pageSize: 10,
 | 
				
			||||||
			this.open = false;
 | 
											pageNo: 1,
 | 
				
			||||||
			this.reset();
 | 
											total: 1,
 | 
				
			||||||
		},
 | 
										};
 | 
				
			||||||
		/** 表单重置 */
 | 
										this.getDataList();
 | 
				
			||||||
		reset() {
 | 
										break;
 | 
				
			||||||
			this.form = {
 | 
									case 'add':
 | 
				
			||||||
				id: undefined,
 | 
										this.addOrEditTitle = '新增';
 | 
				
			||||||
				plcTableName: undefined,
 | 
										this.addOrUpdateVisible = true;
 | 
				
			||||||
				code: undefined,
 | 
										this.addOrUpdateHandle();
 | 
				
			||||||
				name: undefined,
 | 
										break;
 | 
				
			||||||
				enName: undefined,
 | 
									case 'export':
 | 
				
			||||||
				description: undefined,
 | 
										this.handleExport();
 | 
				
			||||||
				collection: undefined,
 | 
										break;
 | 
				
			||||||
			};
 | 
									default:
 | 
				
			||||||
			this.resetForm('form');
 | 
										console.log(val);
 | 
				
			||||||
		},
 | 
								}
 | 
				
			||||||
		/** 搜索按钮操作 */
 | 
					 | 
				
			||||||
		handleQuery() {
 | 
					 | 
				
			||||||
			this.queryParams.pageNo = 1;
 | 
					 | 
				
			||||||
			this.getList();
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		/** 重置按钮操作 */
 | 
					 | 
				
			||||||
		resetQuery() {
 | 
					 | 
				
			||||||
			this.resetForm('queryForm');
 | 
					 | 
				
			||||||
			this.handleQuery();
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		/** 新增按钮操作 */
 | 
					 | 
				
			||||||
		handleAdd() {
 | 
					 | 
				
			||||||
			this.reset();
 | 
					 | 
				
			||||||
			this.open = true;
 | 
					 | 
				
			||||||
			this.title = '添加实时数据采集配置';
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		/** 修改按钮操作 */
 | 
					 | 
				
			||||||
		handleUpdate(row) {
 | 
					 | 
				
			||||||
			this.reset();
 | 
					 | 
				
			||||||
			const id = row.id;
 | 
					 | 
				
			||||||
			getEquipmentPlc(id).then((response) => {
 | 
					 | 
				
			||||||
				this.form = response.data;
 | 
					 | 
				
			||||||
				this.open = true;
 | 
					 | 
				
			||||||
				this.title = '修改实时数据采集配置';
 | 
					 | 
				
			||||||
			});
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		/** 提交按钮 */
 | 
					 | 
				
			||||||
		submitForm() {
 | 
					 | 
				
			||||||
			this.$refs['form'].validate((valid) => {
 | 
					 | 
				
			||||||
				if (!valid) {
 | 
					 | 
				
			||||||
					return;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				// 修改的提交
 | 
					 | 
				
			||||||
				if (this.form.id != null) {
 | 
					 | 
				
			||||||
					updateEquipmentPlc(this.form).then((response) => {
 | 
					 | 
				
			||||||
						this.$modal.msgSuccess('修改成功');
 | 
					 | 
				
			||||||
						this.open = false;
 | 
					 | 
				
			||||||
						this.getList();
 | 
					 | 
				
			||||||
					});
 | 
					 | 
				
			||||||
					return;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				// 添加的提交
 | 
					 | 
				
			||||||
				createEquipmentPlc(this.form).then((response) => {
 | 
					 | 
				
			||||||
					this.$modal.msgSuccess('新增成功');
 | 
					 | 
				
			||||||
					this.open = false;
 | 
					 | 
				
			||||||
					this.getList();
 | 
					 | 
				
			||||||
				});
 | 
					 | 
				
			||||||
			});
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		/** 删除按钮操作 */
 | 
					 | 
				
			||||||
		handleDelete(row) {
 | 
					 | 
				
			||||||
			const id = row.id;
 | 
					 | 
				
			||||||
			this.$modal
 | 
					 | 
				
			||||||
				.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?')
 | 
					 | 
				
			||||||
				.then(function () {
 | 
					 | 
				
			||||||
					return deleteEquipmentPlc(id);
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				.then(() => {
 | 
					 | 
				
			||||||
					this.getList();
 | 
					 | 
				
			||||||
					this.$modal.msgSuccess('删除成功');
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				.catch(() => {});
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		/** 导出按钮操作 */
 | 
					 | 
				
			||||||
		handleExport() {
 | 
					 | 
				
			||||||
			// 处理查询参数
 | 
					 | 
				
			||||||
			let params = { ...this.queryParams };
 | 
					 | 
				
			||||||
			params.pageNo = undefined;
 | 
					 | 
				
			||||||
			params.pageSize = undefined;
 | 
					 | 
				
			||||||
			this.$modal
 | 
					 | 
				
			||||||
				.confirm('是否确认导出所有实时数据采集配置数据项?')
 | 
					 | 
				
			||||||
				.then(() => {
 | 
					 | 
				
			||||||
					this.exportLoading = true;
 | 
					 | 
				
			||||||
					return exportEquipmentPlcExcel(params);
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				.then((response) => {
 | 
					 | 
				
			||||||
					this.$download.excel(response, '实时数据采集配置.xls');
 | 
					 | 
				
			||||||
					this.exportLoading = false;
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				.catch(() => {});
 | 
					 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2021-11-18 14:16:25
 | 
					 * @Date: 2021-11-18 14:16:25
 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2024-04-30 10:01:41
 | 
					 * @LastEditTime: 2025-02-25 16:11:14
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,6 +57,7 @@ const tableProps = [
 | 
				
			|||||||
    prop: 'createTime',
 | 
					    prop: 'createTime',
 | 
				
			||||||
    label: '添加时间',
 | 
					    label: '添加时间',
 | 
				
			||||||
    filter: parseTime,
 | 
					    filter: parseTime,
 | 
				
			||||||
 | 
					    minWidth: 150
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'name',
 | 
							prop: 'name',
 | 
				
			||||||
@@ -67,10 +68,6 @@ const tableProps = [
 | 
				
			|||||||
		label: '原料编码',
 | 
							label: '原料编码',
 | 
				
			||||||
		width: 180,
 | 
							width: 180,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'level',
 | 
					 | 
				
			||||||
		label: '原料等级',
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'unit',
 | 
							prop: 'unit',
 | 
				
			||||||
		label: '单位',
 | 
							label: '单位',
 | 
				
			||||||
@@ -152,7 +149,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
					this.listQuery.code = val.code;
 | 
										this.listQuery.code = val.code;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2023-08-01 13:52:10
 | 
					 * @Date: 2023-08-01 13:52:10
 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2025-03-05 15:23:30
 | 
					 * @LastEditTime: 2024-04-11 09:05:16
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -63,7 +63,7 @@
 | 
				
			|||||||
						style="width: 75%"
 | 
											style="width: 75%"
 | 
				
			||||||
						v-model="dataForm.price"
 | 
											v-model="dataForm.price"
 | 
				
			||||||
						clearable
 | 
											clearable
 | 
				
			||||||
						placeholder="请输入单价" />
 | 
											placeholder="请输入允许留存时间" />
 | 
				
			||||||
					{{ unit }}
 | 
										{{ unit }}
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,11 +63,11 @@ const tableProps = [
 | 
				
			|||||||
		label: '原料编码',
 | 
							label: '原料编码',
 | 
				
			||||||
		width: 180,
 | 
							width: 180,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	// {
 | 
						{
 | 
				
			||||||
	// 	prop: 'price',
 | 
							prop: 'price',
 | 
				
			||||||
	// 	label: '单价(元/千克)',
 | 
							label: '单价(元/吨)',
 | 
				
			||||||
	// 	align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
	// },
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'createTime',
 | 
							prop: 'createTime',
 | 
				
			||||||
		label: '生效时间',
 | 
							label: '生效时间',
 | 
				
			||||||
@@ -152,7 +152,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.materialId = val.name;
 | 
										this.listQuery.materialId = val.name;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										197
									
								
								src/views/core/analysis/balanceAnalysis/BarChart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,197 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div
 | 
				
			||||||
 | 
							ref="lineChart"
 | 
				
			||||||
 | 
							:id="id"
 | 
				
			||||||
 | 
							:class="className"
 | 
				
			||||||
 | 
							:style="{ height: height, width: width, marginLeft: '10px' }" />
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import * as echarts from 'echarts';
 | 
				
			||||||
 | 
					require('echarts/theme/macarons'); // echarts theme
 | 
				
			||||||
 | 
					import resize from '@/utils/chartMixins/resize';
 | 
				
			||||||
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const animationDuration = 1000;
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						name: 'lineChart',
 | 
				
			||||||
 | 
						mixins: [resize],
 | 
				
			||||||
 | 
						props: {
 | 
				
			||||||
 | 
							id: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: 'chart',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							className: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: 'chart',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							title: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: '',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							width: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: '100%',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							height: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: '300px',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							barData: {
 | 
				
			||||||
 | 
								type: Object,
 | 
				
			||||||
 | 
								default: () => {},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								chart: null,
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						mounted() {
 | 
				
			||||||
 | 
							if (!this.chart) {
 | 
				
			||||||
 | 
								this.chart = echarts.init(this.$refs.lineChart);
 | 
				
			||||||
 | 
								this.$nextTick(() => {
 | 
				
			||||||
 | 
									this.initChart();
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						beforeDestroy() {
 | 
				
			||||||
 | 
							if (!this.chart) {
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							this.chart.dispose();
 | 
				
			||||||
 | 
							this.chart = null;
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						watch: {
 | 
				
			||||||
 | 
							barData: {
 | 
				
			||||||
 | 
								handler() {
 | 
				
			||||||
 | 
									if (this.chart) {
 | 
				
			||||||
 | 
										this.$nextTick(() => {
 | 
				
			||||||
 | 
											this.initChart();
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										this.$nextTick(() => {
 | 
				
			||||||
 | 
											this.chart = echarts.init(this.$refs.lineChart);
 | 
				
			||||||
 | 
											this.initChart();
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								deep: true,
 | 
				
			||||||
 | 
								immediate: true,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							initChart() {
 | 
				
			||||||
 | 
								const _this = this;
 | 
				
			||||||
 | 
								this.chart.setOption({
 | 
				
			||||||
 | 
									title: {
 | 
				
			||||||
 | 
										text: this.title
 | 
				
			||||||
 | 
											? '{space|}{tip|}{space|}{value|' + this.title + '}'
 | 
				
			||||||
 | 
											: '',
 | 
				
			||||||
 | 
										textStyle: {
 | 
				
			||||||
 | 
											rich: {
 | 
				
			||||||
 | 
												tip: {
 | 
				
			||||||
 | 
													width: 6,
 | 
				
			||||||
 | 
													height: 6,
 | 
				
			||||||
 | 
													borderRadius: 50,
 | 
				
			||||||
 | 
													backgroundColor: '#288AFF',
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												space: {
 | 
				
			||||||
 | 
													width: 8,
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												value: {
 | 
				
			||||||
 | 
													fontSize: 14,
 | 
				
			||||||
 | 
													color: 'black',
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									color: ['#288AFF', '#8EF0AB', '#FFDC94'],
 | 
				
			||||||
 | 
									tooltip: {
 | 
				
			||||||
 | 
										trigger: 'axis',
 | 
				
			||||||
 | 
										axisPointer: {
 | 
				
			||||||
 | 
											type: 'cross',
 | 
				
			||||||
 | 
											crossStyle: {
 | 
				
			||||||
 | 
												color: '#999',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									legend: {
 | 
				
			||||||
 | 
										data: ['磨边节拍', '钢化节拍', '下片节拍'],
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									grid: {
 | 
				
			||||||
 | 
										containLabel: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									xAxis: {
 | 
				
			||||||
 | 
										type: 'category',
 | 
				
			||||||
 | 
										data: this.barData.edgeCt.map((item) => {
 | 
				
			||||||
 | 
											return parseTime(item.recordTime, '{m}-{d} {h}:{i}');
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										axisPointer: {
 | 
				
			||||||
 | 
											type: 'shadow',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									yAxis: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											type: 'value',
 | 
				
			||||||
 | 
											name: '节拍 pcs/min',
 | 
				
			||||||
 | 
											min: 0,
 | 
				
			||||||
 | 
											axisLabel: {
 | 
				
			||||||
 | 
												formatter: '{value}',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
									dataZoom: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											type: 'inside',
 | 
				
			||||||
 | 
											start: 0,
 | 
				
			||||||
 | 
											end: 100,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											start: 0,
 | 
				
			||||||
 | 
											end: 100,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
									series: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '磨边节拍',
 | 
				
			||||||
 | 
											type: 'line',
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + 'pcs/min';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											data: this.barData.edgeCt.map((item) => {
 | 
				
			||||||
 | 
												return item.ct;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '钢化节拍',
 | 
				
			||||||
 | 
											type: 'line',
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + 'pcs/min';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											data: this.barData.temperCt.map((item) => {
 | 
				
			||||||
 | 
												return item.ct;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '下片节拍',
 | 
				
			||||||
 | 
											type: 'line',
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + 'pcs/min';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											data: this.barData.downCt.map((item) => {
 | 
				
			||||||
 | 
												return item.ct;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
							
								
								
									
										273
									
								
								src/views/core/analysis/balanceAnalysis/eq-detail.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,273 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: zwq
 | 
				
			||||||
 | 
					 * @Date: 2023-08-24 14:47:58
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-01-09 10:04:17
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div>
 | 
				
			||||||
 | 
							<base-table
 | 
				
			||||||
 | 
								:page="1"
 | 
				
			||||||
 | 
								:limit="999"
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
 | 
								:table-props="tableProps"
 | 
				
			||||||
 | 
								max-height="400"
 | 
				
			||||||
 | 
								:table-data="tableData">
 | 
				
			||||||
 | 
								<method-btn
 | 
				
			||||||
 | 
									v-if="tableData.length"
 | 
				
			||||||
 | 
									slot="handleBtn"
 | 
				
			||||||
 | 
									:width="80"
 | 
				
			||||||
 | 
									label="操作"
 | 
				
			||||||
 | 
									:method-list="tableBtn"
 | 
				
			||||||
 | 
									@clickBtn="handleClick" />
 | 
				
			||||||
 | 
							</base-table>
 | 
				
			||||||
 | 
							<div v-if="eqChartData.length > 0" style="margin-top: 10px">
 | 
				
			||||||
 | 
								<search-bar
 | 
				
			||||||
 | 
									:formConfigs="formConfig"
 | 
				
			||||||
 | 
									ref="searchBarForm1"
 | 
				
			||||||
 | 
									@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
								<div
 | 
				
			||||||
 | 
									ref="lineChart"
 | 
				
			||||||
 | 
									id="chart"
 | 
				
			||||||
 | 
									:style="{ height: '400px', width: '100%', marginLeft: '10px' }" />
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { getNewCTDet, getNewCTCharts } from '@/api/core/analysis/index';
 | 
				
			||||||
 | 
					import * as echarts from 'echarts';
 | 
				
			||||||
 | 
					require('echarts/theme/macarons'); // echarts theme
 | 
				
			||||||
 | 
					import resize from '@/utils/chartMixins/resize';
 | 
				
			||||||
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'equipmentName',
 | 
				
			||||||
 | 
							label: '设备',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'size',
 | 
				
			||||||
 | 
							label: '规格',
 | 
				
			||||||
 | 
							showOverflowtooltip: true,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'process',
 | 
				
			||||||
 | 
							label: '产品工艺',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'standardCt',
 | 
				
			||||||
 | 
							label: '标准节拍pcs/min',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'ct',
 | 
				
			||||||
 | 
							label: '当前节拍pcs/min',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						mixins: [resize],
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								tableBtn: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'eqChart',
 | 
				
			||||||
 | 
										btnName: '趋势图',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								].filter((v) => v),
 | 
				
			||||||
 | 
								dataListLoading: false,
 | 
				
			||||||
 | 
								time: {},
 | 
				
			||||||
 | 
								eqChartData: [],
 | 
				
			||||||
 | 
								eqName: null,
 | 
				
			||||||
 | 
								equipmentId: null,
 | 
				
			||||||
 | 
								chart: null,
 | 
				
			||||||
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'datePicker',
 | 
				
			||||||
 | 
										label: '时间范围',
 | 
				
			||||||
 | 
										dateType: 'datetimerange',
 | 
				
			||||||
 | 
										format: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
 | 
										valueFormat: 'timestamp',
 | 
				
			||||||
 | 
										rangeSeparator: '-',
 | 
				
			||||||
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
 | 
										defaultTime: ['00:00:00', '23:59:59'],
 | 
				
			||||||
 | 
										param: 'timeVal',
 | 
				
			||||||
 | 
										width: 350,
 | 
				
			||||||
 | 
										clearable: false,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '查询',
 | 
				
			||||||
 | 
										name: 'search',
 | 
				
			||||||
 | 
										color: 'primary',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						components: {},
 | 
				
			||||||
 | 
						created() {},
 | 
				
			||||||
 | 
						mounted() {},
 | 
				
			||||||
 | 
						beforeDestroy() {
 | 
				
			||||||
 | 
							if (!this.chart) {
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							this.chart.dispose();
 | 
				
			||||||
 | 
							this.chart = null;
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							// 获取数据列表
 | 
				
			||||||
 | 
							init(lineId, startTime, endTime) {
 | 
				
			||||||
 | 
								this.eqChartData = [];
 | 
				
			||||||
 | 
								this.time.startTime = startTime;
 | 
				
			||||||
 | 
								this.time.endTime = endTime;
 | 
				
			||||||
 | 
								this.dataListLoading = true;
 | 
				
			||||||
 | 
								getNewCTDet(lineId).then((response) => {
 | 
				
			||||||
 | 
									this.tableData = response.data;
 | 
				
			||||||
 | 
									this.dataListLoading = false;
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleClick(val) {
 | 
				
			||||||
 | 
								const data = {
 | 
				
			||||||
 | 
									...this.time,
 | 
				
			||||||
 | 
									equipmentId: val.data.equipmentId,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								this.eqName = val.data.equipmentName;
 | 
				
			||||||
 | 
								this.equipmentId = val.data.equipmentId;
 | 
				
			||||||
 | 
								getNewCTCharts(data).then((response) => {
 | 
				
			||||||
 | 
									this.eqChartData = response.data;
 | 
				
			||||||
 | 
									this.$nextTick(() => {
 | 
				
			||||||
 | 
										this.$refs.searchBarForm1.formInline.timeVal = [
 | 
				
			||||||
 | 
											this.time.startTime,
 | 
				
			||||||
 | 
											this.time.endTime,
 | 
				
			||||||
 | 
										];
 | 
				
			||||||
 | 
										this.initChart();
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.time.startTime = val.timeVal ? val.timeVal[0] : undefined;
 | 
				
			||||||
 | 
										this.time.endTime = val.timeVal ? val.timeVal[1] : undefined;
 | 
				
			||||||
 | 
										const data = {
 | 
				
			||||||
 | 
											...this.time,
 | 
				
			||||||
 | 
											equipmentId: this.equipmentId,
 | 
				
			||||||
 | 
										};
 | 
				
			||||||
 | 
										getNewCTCharts(data).then((response) => {
 | 
				
			||||||
 | 
											this.eqChartData = response.data;
 | 
				
			||||||
 | 
											this.$nextTick(() => {
 | 
				
			||||||
 | 
												this.initChart();
 | 
				
			||||||
 | 
											});
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							initChart() {
 | 
				
			||||||
 | 
								this.chart = echarts.init(this.$refs.lineChart);
 | 
				
			||||||
 | 
								const _this = this;
 | 
				
			||||||
 | 
								this.chart.setOption({
 | 
				
			||||||
 | 
									title: {
 | 
				
			||||||
 | 
										text: this.eqName
 | 
				
			||||||
 | 
											? '{space|}{tip|}{space|}{value|' + this.eqName + ' 节拍趋势图' + '}'
 | 
				
			||||||
 | 
											: '',
 | 
				
			||||||
 | 
										textStyle: {
 | 
				
			||||||
 | 
											rich: {
 | 
				
			||||||
 | 
												tip: {
 | 
				
			||||||
 | 
													width: 6,
 | 
				
			||||||
 | 
													height: 6,
 | 
				
			||||||
 | 
													borderRadius: 50,
 | 
				
			||||||
 | 
													backgroundColor: '#288AFF',
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												space: {
 | 
				
			||||||
 | 
													width: 8,
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												value: {
 | 
				
			||||||
 | 
													fontSize: 14,
 | 
				
			||||||
 | 
													color: 'black',
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									color: ['#288AFF', '#8EF0AB', '#FFDC94'],
 | 
				
			||||||
 | 
									tooltip: {
 | 
				
			||||||
 | 
										trigger: 'axis',
 | 
				
			||||||
 | 
										axisPointer: {
 | 
				
			||||||
 | 
											type: 'cross',
 | 
				
			||||||
 | 
											crossStyle: {
 | 
				
			||||||
 | 
												color: '#999',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									legend: {
 | 
				
			||||||
 | 
										data: ['当前节拍', '标准节拍'],
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									grid: {
 | 
				
			||||||
 | 
										containLabel: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									xAxis: {
 | 
				
			||||||
 | 
										type: 'category',
 | 
				
			||||||
 | 
										data: this.eqChartData[0].ct.map((item) => {
 | 
				
			||||||
 | 
											return parseTime(item.recordTime, '{m}-{d} {h}:{i}');
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										axisPointer: {
 | 
				
			||||||
 | 
											type: 'shadow',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									yAxis: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											type: 'value',
 | 
				
			||||||
 | 
											name: '节拍',
 | 
				
			||||||
 | 
											min: 0,
 | 
				
			||||||
 | 
											interval: 20,
 | 
				
			||||||
 | 
											axisLabel: {
 | 
				
			||||||
 | 
												formatter: '{value} pcs/min',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
									dataZoom: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											type: 'inside',
 | 
				
			||||||
 | 
											start: 0,
 | 
				
			||||||
 | 
											end: 100,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											start: 0,
 | 
				
			||||||
 | 
											end: 100,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
									series: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '标准节拍',
 | 
				
			||||||
 | 
											type: 'line',
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + 'pcs/min';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											data: this.eqChartData[0].ct.map((item) => {
 | 
				
			||||||
 | 
												return item.standardCt;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '当前节拍',
 | 
				
			||||||
 | 
											type: 'line',
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + 'pcs/min';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											data: this.eqChartData[0].ct.map((item) => {
 | 
				
			||||||
 | 
												return item.ct;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
							
								
								
									
										296
									
								
								src/views/core/analysis/balanceAnalysis/index-old.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,296 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="app-container">
 | 
				
			||||||
 | 
							<search-bar
 | 
				
			||||||
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
							<div v-if="tableData.length">
 | 
				
			||||||
 | 
								<base-table
 | 
				
			||||||
 | 
									v-loading="dataListLoading"
 | 
				
			||||||
 | 
									:span-method="mergeColumnHandler"
 | 
				
			||||||
 | 
									:max-height="tableH"
 | 
				
			||||||
 | 
									:table-props="tableProps"
 | 
				
			||||||
 | 
									:table-data="tableData" />
 | 
				
			||||||
 | 
								<SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
 | 
				
			||||||
 | 
								<balance-chart ref="lineChart" />
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
 | 
							<!-- <pagination
 | 
				
			||||||
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
 | 
								:total="listQuery.total"
 | 
				
			||||||
 | 
								@pagination="getDataList" /> -->
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					// import basicPage from '../../mixins/basic-page';
 | 
				
			||||||
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
 | 
					import { getCT } from '@/api/core/analysis/index';
 | 
				
			||||||
 | 
					import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
				
			||||||
 | 
					import BalanceChart from '../balanceChart';
 | 
				
			||||||
 | 
					import { time } from 'echarts';
 | 
				
			||||||
 | 
					import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
				
			||||||
 | 
					// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// const tableProps = [
 | 
				
			||||||
 | 
					// 	// {
 | 
				
			||||||
 | 
					//   //   prop: 'lineName',
 | 
				
			||||||
 | 
					// 	// 	label: '产线',
 | 
				
			||||||
 | 
					// 	// 	align: 'center',
 | 
				
			||||||
 | 
					// 	// },
 | 
				
			||||||
 | 
					//   // {
 | 
				
			||||||
 | 
					//   //   prop: 'sum',
 | 
				
			||||||
 | 
					//   //   label: '合计',
 | 
				
			||||||
 | 
					//   //   align: 'center',
 | 
				
			||||||
 | 
					//   // },
 | 
				
			||||||
 | 
					//   // {
 | 
				
			||||||
 | 
					//   //   prop: 'dynamicValue',
 | 
				
			||||||
 | 
					//   //   label: 'dynamicName',
 | 
				
			||||||
 | 
					//   //   align: 'center',
 | 
				
			||||||
 | 
					//   //   children:[
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//   //   ]
 | 
				
			||||||
 | 
					//   // }
 | 
				
			||||||
 | 
					// ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						components: {
 | 
				
			||||||
 | 
							BalanceChart,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						mixins: [tableHeightMixin],
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									getDataListURL: getCT,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								tableProps: [],
 | 
				
			||||||
 | 
								dataListLoading: false,
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								listQuery: {
 | 
				
			||||||
 | 
									// time: ''
 | 
				
			||||||
 | 
									endTime: undefined,
 | 
				
			||||||
 | 
									lineId: undefined,
 | 
				
			||||||
 | 
									startTime: undefined,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								timeList: [],
 | 
				
			||||||
 | 
								spanArr: [],
 | 
				
			||||||
 | 
								xData: [],
 | 
				
			||||||
 | 
								yData: [],
 | 
				
			||||||
 | 
								optionArrUrl: [getProductionLinePage],
 | 
				
			||||||
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产线',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'lineIds',
 | 
				
			||||||
 | 
										defaultSelect: '',
 | 
				
			||||||
 | 
										multiple: false,
 | 
				
			||||||
 | 
										filterable: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'datePicker',
 | 
				
			||||||
 | 
										label: '时间',
 | 
				
			||||||
 | 
										dateType: 'datetimerange',
 | 
				
			||||||
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
 | 
										rangeSeparator: '-',
 | 
				
			||||||
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
 | 
										width: 350,
 | 
				
			||||||
 | 
										param: 'time',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '查询',
 | 
				
			||||||
 | 
										name: 'search',
 | 
				
			||||||
 | 
										color: 'primary',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
							this.getArr();
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							getArr() {
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									page: 1,
 | 
				
			||||||
 | 
									limit: 500,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								this.optionArrUrl.forEach((item, index) => {
 | 
				
			||||||
 | 
									item(params).then((response) => {
 | 
				
			||||||
 | 
										this.formConfig[index].selectOptions = response.data.list;
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							setRowSpan(arr) {
 | 
				
			||||||
 | 
								let count = 0;
 | 
				
			||||||
 | 
								arr.forEach((item, index) => {
 | 
				
			||||||
 | 
									if (index === 0) {
 | 
				
			||||||
 | 
										this.spanArr.push(1);
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										if (item === arr[index - 1]) {
 | 
				
			||||||
 | 
											this.spanArr[count] += 1;
 | 
				
			||||||
 | 
											this.spanArr.push(0);
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											count = index;
 | 
				
			||||||
 | 
											this.spanArr.push(1);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							/** 合并table列的规则 */
 | 
				
			||||||
 | 
							mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
 | 
				
			||||||
 | 
								if (columnIndex == 0) {
 | 
				
			||||||
 | 
									if (this.spanArr[rowIndex]) {
 | 
				
			||||||
 | 
										return [
 | 
				
			||||||
 | 
											this.spanArr[rowIndex], // row span
 | 
				
			||||||
 | 
											1, // col span
 | 
				
			||||||
 | 
										];
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										return [0, 0];
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							getData() {
 | 
				
			||||||
 | 
								// this.listQuery.lineId = '1672847052717821953'
 | 
				
			||||||
 | 
								// this.listQuery.startTime = '1693497600000';
 | 
				
			||||||
 | 
								// this.listQuery.endTime = '1693843200000';
 | 
				
			||||||
 | 
								this.urlOptions.getDataListURL(this.listQuery).then((res) => {
 | 
				
			||||||
 | 
									console.log(res);
 | 
				
			||||||
 | 
									let arr = [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'sectionName',
 | 
				
			||||||
 | 
											label: '工段',
 | 
				
			||||||
 | 
											align: 'center',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'equName',
 | 
				
			||||||
 | 
											label: '设备',
 | 
				
			||||||
 | 
											align: 'center',
 | 
				
			||||||
 | 
					            width: 150
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									];
 | 
				
			||||||
 | 
									let sectionArr = [];
 | 
				
			||||||
 | 
									res.data.data.forEach((ele, index) => {
 | 
				
			||||||
 | 
										let tempData = [];
 | 
				
			||||||
 | 
										let ggData = [];
 | 
				
			||||||
 | 
										let sbluData = [];
 | 
				
			||||||
 | 
										let sbsjData = [];
 | 
				
			||||||
 | 
										let cxluData = [];
 | 
				
			||||||
 | 
										let cxsjData = [];
 | 
				
			||||||
 | 
										ele.data.forEach((item, index) => {
 | 
				
			||||||
 | 
											item.children.forEach((params) => {
 | 
				
			||||||
 | 
												if (params.dynamicName === '生产规格') {
 | 
				
			||||||
 | 
													tempData[item.dynamicName + '_gg'] = params.dynamicValue;
 | 
				
			||||||
 | 
													ggData[index] = params.dynamicValue;
 | 
				
			||||||
 | 
												} else if (params.dynamicName === '设备理论速度') {
 | 
				
			||||||
 | 
													tempData[item.dynamicName + '_sblu'] = params.dynamicValue;
 | 
				
			||||||
 | 
													sbluData[index] = params.dynamicValue;
 | 
				
			||||||
 | 
												} else if (params.dynamicName === '设备实际速度') {
 | 
				
			||||||
 | 
													tempData[item.dynamicName + '_sbsj'] = params.dynamicValue;
 | 
				
			||||||
 | 
													sbsjData[index] = params.dynamicValue;
 | 
				
			||||||
 | 
												} else if (params.dynamicName === '产线理论速度') {
 | 
				
			||||||
 | 
													tempData[item.dynamicName + '_cxlu'] = params.dynamicValue;
 | 
				
			||||||
 | 
													cxluData[index] = params.dynamicValue;
 | 
				
			||||||
 | 
												} else if(params.dynamicName === '产线实际速度') {
 | 
				
			||||||
 | 
													tempData[item.dynamicName + '_cxsj'] = params.dynamicValue;
 | 
				
			||||||
 | 
													cxsjData[index] = params.dynamicValue;
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											});
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										const equipment = {
 | 
				
			||||||
 | 
											name: ele.equName,
 | 
				
			||||||
 | 
											ggData: ggData,
 | 
				
			||||||
 | 
											sbluData: sbluData,
 | 
				
			||||||
 | 
											sbsjData: sbsjData,
 | 
				
			||||||
 | 
											cxluData: cxluData,
 | 
				
			||||||
 | 
											cxsjData: cxsjData,
 | 
				
			||||||
 | 
										};
 | 
				
			||||||
 | 
										tempData['equName'] = ele.equName;
 | 
				
			||||||
 | 
										tempData['sectionName'] = ele.sectionName;
 | 
				
			||||||
 | 
										this.tableData.push(tempData);
 | 
				
			||||||
 | 
										const { sectionName } = tempData;
 | 
				
			||||||
 | 
										sectionArr.push(sectionName);
 | 
				
			||||||
 | 
										this.yData.push(equipment);
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									this.setRowSpan(sectionArr);
 | 
				
			||||||
 | 
									res.data.nameData.forEach((item) => {
 | 
				
			||||||
 | 
										this.timeList.push(item.name);
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									const timeArray = Array.from(new Set(this.timeList));
 | 
				
			||||||
 | 
					        console.log(timeArray)
 | 
				
			||||||
 | 
									for (const times of timeArray) {
 | 
				
			||||||
 | 
										if (times !== '生产规格' && times !== '设备理论速度' && times !== '设备实际速度'
 | 
				
			||||||
 | 
					             && times !== '产线理论速度' && times !== '产线实际速度'
 | 
				
			||||||
 | 
					          ) {
 | 
				
			||||||
 | 
											const subprop = {
 | 
				
			||||||
 | 
												label: times,
 | 
				
			||||||
 | 
												align: 'center',
 | 
				
			||||||
 | 
												children: [
 | 
				
			||||||
 | 
													{ prop: times + '_gg', label: '生产规格', align: 'center' },
 | 
				
			||||||
 | 
													{ prop: times + '_sblu', label: '设备理论速度[片/min]', align: 'center' },
 | 
				
			||||||
 | 
													{ prop: times + '_sbsj', label: '设备实际速度[片/min]', align: 'center' },
 | 
				
			||||||
 | 
													{ prop: times + '_cxlu', label: '产线理论速度[片/min]', align: 'center' },
 | 
				
			||||||
 | 
													{ prop: times + '_cxsj', label: '产线实际速度[片/min]', align: 'center' },
 | 
				
			||||||
 | 
												],
 | 
				
			||||||
 | 
											};
 | 
				
			||||||
 | 
											arr.push(subprop);
 | 
				
			||||||
 | 
											this.xData.push(times);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									this.tableProps = arr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        console.log(this.$refs)
 | 
				
			||||||
 | 
					        this.$nextTick(()=>{
 | 
				
			||||||
 | 
					          this.$refs.lineChart.initChart(this.xData, this.yData);
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
									// this.total = response.data.total;
 | 
				
			||||||
 | 
									// this.dataListLoading = false;
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								// console.log(val)
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										// this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
										// this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.listQuery.lineId = val.lineIds;
 | 
				
			||||||
 | 
										this.listQuery.startTime = val.time
 | 
				
			||||||
 | 
											? String(new Date(val.time[0]).getTime())
 | 
				
			||||||
 | 
											: undefined;
 | 
				
			||||||
 | 
										this.listQuery.endTime = val.time
 | 
				
			||||||
 | 
											? String(new Date(val.time[1]).getTime())
 | 
				
			||||||
 | 
											: undefined;
 | 
				
			||||||
 | 
										if (val.time && val.lineIds) {
 | 
				
			||||||
 | 
											this.tableData = [];
 | 
				
			||||||
 | 
											this.xData = [];
 | 
				
			||||||
 | 
											this.yData = [];
 | 
				
			||||||
 | 
											this.tableProps = [];
 | 
				
			||||||
 | 
											this.spanArr = [];
 | 
				
			||||||
 | 
											this.timeList = [];
 | 
				
			||||||
 | 
											this.getData();
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											this.$message({
 | 
				
			||||||
 | 
												message: '请选择产线和时间',
 | 
				
			||||||
 | 
												type: 'warning',
 | 
				
			||||||
 | 
											});
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'reset':
 | 
				
			||||||
 | 
										this.$refs.searchBarForm.resetForm();
 | 
				
			||||||
 | 
										this.listQuery = {
 | 
				
			||||||
 | 
											pageSize: 10,
 | 
				
			||||||
 | 
											pageNo: 1,
 | 
				
			||||||
 | 
											total: 1,
 | 
				
			||||||
 | 
										};
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
@@ -1,260 +1,302 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 | 
					 * @Date: 2023-08-29 14:59:29
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-01-09 10:27:53
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div class="app-container">
 | 
						<div class="app-container">
 | 
				
			||||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
							<search-bar
 | 
				
			||||||
    <div v-if="tableData.length">
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
      <base-table v-loading="dataListLoading" :span-method="mergeColumnHandler" :table-props="tableProps" :table-data="tableData" />
 | 
								ref="searchBarForm"
 | 
				
			||||||
      <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" />
 | 
								@select-changed="handleSearchBarChanged"
 | 
				
			||||||
      <balance-chart ref="lineChart" />
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
    </div>
 | 
							<div v-if="showData.length">
 | 
				
			||||||
    <div v-else class="no-data-bg"></div>
 | 
								<base-table
 | 
				
			||||||
    <!-- <pagination
 | 
									class="right-aside"
 | 
				
			||||||
			:limit.sync="listQuery.pageSize"
 | 
									v-loading="dataListLoading"
 | 
				
			||||||
			:page.sync="listQuery.pageNo"
 | 
									:table-props="tableProps"
 | 
				
			||||||
			:total="listQuery.total"
 | 
									:page="1"
 | 
				
			||||||
			@pagination="getDataList" /> -->
 | 
									:limit="999"
 | 
				
			||||||
  </div>
 | 
									:table-data="showData">
 | 
				
			||||||
 | 
									<method-btn
 | 
				
			||||||
 | 
										v-if="showData.length"
 | 
				
			||||||
 | 
										slot="handleBtn"
 | 
				
			||||||
 | 
										:width="80"
 | 
				
			||||||
 | 
										label="操作"
 | 
				
			||||||
 | 
										:method-list="tableBtn"
 | 
				
			||||||
 | 
										@clickBtn="handleClick" />
 | 
				
			||||||
 | 
								</base-table>
 | 
				
			||||||
 | 
								<barChart
 | 
				
			||||||
 | 
									v-for="item in chartData"
 | 
				
			||||||
 | 
									:key="item.name + 'echart'"
 | 
				
			||||||
 | 
									style="margin-top: 50px"
 | 
				
			||||||
 | 
									height="600px"
 | 
				
			||||||
 | 
									:id="item.name + 'echart'"
 | 
				
			||||||
 | 
									:title="item.name + ' 节拍趋势图'"
 | 
				
			||||||
 | 
									:bar-data="item" />
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
 | 
							<base-dialog
 | 
				
			||||||
 | 
								:dialogTitle="addOrEditTitle"
 | 
				
			||||||
 | 
								:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
 | 
								@cancel="handleCancel"
 | 
				
			||||||
 | 
								@confirm="handleConfirm"
 | 
				
			||||||
 | 
								:before-close="handleCancel"
 | 
				
			||||||
 | 
								close-on-click-modal
 | 
				
			||||||
 | 
					      top="0"
 | 
				
			||||||
 | 
								width="50%">
 | 
				
			||||||
 | 
								<eq-detail ref="eqDetail" />
 | 
				
			||||||
 | 
								<slot name="footer">
 | 
				
			||||||
 | 
									<el-row slot="footer" type="flex" justify="end">
 | 
				
			||||||
 | 
										<el-col :span="24">
 | 
				
			||||||
 | 
											<el-button size="small" class="btnTextStyle" @click="handleCancel">
 | 
				
			||||||
 | 
												取消
 | 
				
			||||||
 | 
											</el-button>
 | 
				
			||||||
 | 
										</el-col>
 | 
				
			||||||
 | 
									</el-row>
 | 
				
			||||||
 | 
								</slot>
 | 
				
			||||||
 | 
							</base-dialog>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
// import basicPage from '../../mixins/basic-page';
 | 
					import eqDetail from './eq-detail';
 | 
				
			||||||
import { parseTime } from '../../mixins/code-filter';
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
import { getCT } from '@/api/core/analysis/index';
 | 
					import { getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
					import { getNewCTNow, getNewCTCharts } from '@/api/core/analysis/index';
 | 
				
			||||||
import BalanceChart from '../balanceChart'
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
import { time } from 'echarts';
 | 
					// import codeFilter from '../../mixins/code-filter'
 | 
				
			||||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
					import * as XLSX from 'xlsx';
 | 
				
			||||||
 | 
					import FileSaver from 'file-saver';
 | 
				
			||||||
 | 
					import barChart from './BarChart.vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
// 	// {
 | 
						{
 | 
				
			||||||
//   //   prop: 'lineName',
 | 
							prop: 'factoryName',
 | 
				
			||||||
// 	// 	label: '产线',
 | 
							label: '工厂',
 | 
				
			||||||
// 	// 	align: 'center',
 | 
						},
 | 
				
			||||||
// 	// },
 | 
						{
 | 
				
			||||||
//   // {
 | 
							prop: 'lineName',
 | 
				
			||||||
//   //   prop: 'sum',
 | 
							label: '产线',
 | 
				
			||||||
//   //   label: '合计',
 | 
						},
 | 
				
			||||||
//   //   align: 'center',
 | 
						{
 | 
				
			||||||
//   // },
 | 
							prop: 'size',
 | 
				
			||||||
//   // {
 | 
							label: '规格',
 | 
				
			||||||
//   //   prop: 'dynamicValue',
 | 
							showOverflowtooltip: true,
 | 
				
			||||||
//   //   label: 'dynamicName',
 | 
						},
 | 
				
			||||||
//   //   align: 'center',
 | 
						{
 | 
				
			||||||
//   //   children:[
 | 
							prop: 'process',
 | 
				
			||||||
 | 
							label: '产品工艺',
 | 
				
			||||||
//   //   ]
 | 
						},
 | 
				
			||||||
//   // }
 | 
						{
 | 
				
			||||||
// ];
 | 
							prop: 'edgeCt',
 | 
				
			||||||
 | 
							label: '磨边当前节拍pcs/min',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'temperCt',
 | 
				
			||||||
 | 
							label: '钢化当前节拍pcs/min',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'downCt',
 | 
				
			||||||
 | 
							label: '下片当前节拍pcs/min',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  components: {
 | 
						components: {
 | 
				
			||||||
    BalanceChart
 | 
							barChart,
 | 
				
			||||||
  },
 | 
							eqDetail,
 | 
				
			||||||
  // mixins: [basicPage],
 | 
						},
 | 
				
			||||||
  data() {
 | 
						data() {
 | 
				
			||||||
    return {
 | 
							return {
 | 
				
			||||||
      urlOptions: {
 | 
								urlOptions: {
 | 
				
			||||||
        getDataListURL: getCT,
 | 
									getDataListURL: getNewCTNow,
 | 
				
			||||||
      },
 | 
								},
 | 
				
			||||||
      tableProps: [],
 | 
								listQuery: {
 | 
				
			||||||
      dataListLoading: false,
 | 
									lineId: [],
 | 
				
			||||||
      tableData: [],
 | 
								},
 | 
				
			||||||
      listQuery: {
 | 
								fileName: '',
 | 
				
			||||||
        // time: ''
 | 
								dataListLoading: false,
 | 
				
			||||||
        endTime: undefined,
 | 
								tableProps,
 | 
				
			||||||
        lineId:undefined,
 | 
								tableBtn: [
 | 
				
			||||||
        startTime:undefined
 | 
									{
 | 
				
			||||||
      },
 | 
										type: 'eq',
 | 
				
			||||||
      timeList: [],
 | 
										btnName: '详情',
 | 
				
			||||||
      spanArr: [], 
 | 
									},
 | 
				
			||||||
      xData: [],
 | 
								].filter((v) => v),
 | 
				
			||||||
      yData: [],
 | 
								showData: [],
 | 
				
			||||||
      optionArrUrl: [getProductionLinePage],
 | 
								tableData: [],
 | 
				
			||||||
      formConfig: [
 | 
								chartData: [],
 | 
				
			||||||
        {
 | 
								formConfig: [
 | 
				
			||||||
          type: 'select',
 | 
									{
 | 
				
			||||||
          label: '产线',
 | 
										type: 'select',
 | 
				
			||||||
          selectOptions: [],
 | 
										label: '工厂',
 | 
				
			||||||
          param: 'lineIds',
 | 
										selectOptions: [],
 | 
				
			||||||
          defaultSelect: '',
 | 
										param: 'factoryId',
 | 
				
			||||||
          multiple: false,
 | 
										onchange: true,
 | 
				
			||||||
          filterable: true,
 | 
									},
 | 
				
			||||||
        },
 | 
									{
 | 
				
			||||||
        {
 | 
										type: 'select',
 | 
				
			||||||
          type: 'datePicker',
 | 
										label: '产线',
 | 
				
			||||||
          label: '时间',
 | 
										selectOptions: [],
 | 
				
			||||||
          dateType: 'datetimerange',
 | 
										param: 'lineId',
 | 
				
			||||||
          format: 'yyyy-MM-dd',
 | 
										multiple: true,
 | 
				
			||||||
          valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
									},
 | 
				
			||||||
          rangeSeparator: '-',
 | 
									{
 | 
				
			||||||
          startPlaceholder: '开始时间',
 | 
										type: 'datePicker',
 | 
				
			||||||
          endPlaceholder: '结束时间',
 | 
										label: '时间范围',
 | 
				
			||||||
          width: 350,
 | 
										dateType: 'datetimerange',
 | 
				
			||||||
          param: 'time',
 | 
										format: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
        },
 | 
										valueFormat: 'timestamp',
 | 
				
			||||||
        {
 | 
										rangeSeparator: '-',
 | 
				
			||||||
          type: 'button',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
          btnName: '查询',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
          name: 'search',
 | 
										defaultTime: ['00:00:00', '23:59:59'],
 | 
				
			||||||
          color: 'primary',
 | 
										param: 'timeVal',
 | 
				
			||||||
        }
 | 
										width: 350,
 | 
				
			||||||
      ],
 | 
										clearable: false,
 | 
				
			||||||
    };
 | 
									},
 | 
				
			||||||
  },
 | 
									{
 | 
				
			||||||
  created() {
 | 
										type: 'button',
 | 
				
			||||||
    this.getArr();
 | 
										btnName: '查询',
 | 
				
			||||||
  },
 | 
										name: 'search',
 | 
				
			||||||
  methods: {
 | 
										color: 'primary',
 | 
				
			||||||
    getArr() {
 | 
									},
 | 
				
			||||||
      const params = {
 | 
									// {
 | 
				
			||||||
        page: 1,
 | 
									// 	type: 'separate',
 | 
				
			||||||
        limit: 500
 | 
									// },
 | 
				
			||||||
      }
 | 
									// {
 | 
				
			||||||
      this.optionArrUrl.forEach((item, index) => {
 | 
									// 	// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
 | 
				
			||||||
        item(params).then((response) => {
 | 
									// 	type: 'button',
 | 
				
			||||||
          this.formConfig[index].selectOptions = response.data.list
 | 
									// 	btnName: '导出',
 | 
				
			||||||
        });
 | 
									// 	name: 'export',
 | 
				
			||||||
      });
 | 
									// 	color: 'warning',
 | 
				
			||||||
    },
 | 
									// },
 | 
				
			||||||
    setRowSpan(arr) {
 | 
								],
 | 
				
			||||||
      let count = 0
 | 
								addOrEditTitle: '',
 | 
				
			||||||
      arr.forEach((item, index) => {
 | 
								addOrUpdateVisible: false,
 | 
				
			||||||
        if(index === 0) {
 | 
							};
 | 
				
			||||||
          this.spanArr.push(1)
 | 
						},
 | 
				
			||||||
        } else {
 | 
						created() {
 | 
				
			||||||
          if (item === arr[index - 1]) {
 | 
							// 获取当前时间
 | 
				
			||||||
            this.spanArr[count] += 1
 | 
							const now = new Date();
 | 
				
			||||||
            this.spanArr.push(0)
 | 
							// 获取前一天的同一时间
 | 
				
			||||||
          } else {
 | 
							const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
 | 
				
			||||||
            count = index
 | 
							// 设置为00:00:00
 | 
				
			||||||
            this.spanArr.push(1)
 | 
							yesterday.setHours(0, 0, 0, 0);
 | 
				
			||||||
          }
 | 
							// 设置为23:59:59
 | 
				
			||||||
        }
 | 
							const end = new Date(yesterday.getTime());
 | 
				
			||||||
      })
 | 
							end.setHours(23, 59, 59, 59);
 | 
				
			||||||
    },
 | 
							this.listQuery.startTime = yesterday.getTime();
 | 
				
			||||||
    /** 合并table列的规则 */
 | 
							this.listQuery.endTime = end.getTime();
 | 
				
			||||||
		mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
 | 
							this.$nextTick(() => {
 | 
				
			||||||
			if (columnIndex == 0) {
 | 
								this.$refs.searchBarForm.formInline.timeVal = [
 | 
				
			||||||
				if (this.spanArr[rowIndex]) {
 | 
									yesterday.getTime(),
 | 
				
			||||||
					return [
 | 
									end.getTime(),
 | 
				
			||||||
						this.spanArr[rowIndex], // row span
 | 
								];
 | 
				
			||||||
						1, // col span
 | 
							});
 | 
				
			||||||
					];
 | 
							this.getDataList();
 | 
				
			||||||
				} else {
 | 
							this.getPdLineList();
 | 
				
			||||||
					return [0, 0];
 | 
						},
 | 
				
			||||||
				}
 | 
						methods: {
 | 
				
			||||||
 | 
							handleExport() {
 | 
				
			||||||
 | 
								let tables = document.querySelector('.el-table').cloneNode(true);
 | 
				
			||||||
 | 
								const fix = tables.querySelector('.el-table__fixed');
 | 
				
			||||||
 | 
								const fixRight = tables.querySelector('.el-table__fixed-right');
 | 
				
			||||||
 | 
								if (fix) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (fixRight) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed-right'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								let exportTable = XLSX.utils.table_to_book(tables);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								var exportTableOut = XLSX.write(exportTable, {
 | 
				
			||||||
 | 
									bookType: 'xlsx',
 | 
				
			||||||
 | 
									bookSST: true,
 | 
				
			||||||
 | 
									type: 'array',
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// sheetjs.xlsx为导出表格的标题名称
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
 | 
									FileSaver.saveAs(
 | 
				
			||||||
 | 
										new Blob([exportTableOut], {
 | 
				
			||||||
 | 
											type: 'application/octet-stream',
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										this.fileName + '产线自动报表.xlsx'
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
 | 
								} catch (e) {
 | 
				
			||||||
 | 
									if (typeof console !== 'undefined') console.log(e, exportTableOut);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return exportTableOut;
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							getPdLineList() {
 | 
				
			||||||
 | 
								getPdList().then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.listQuery.lineId = val.lineId ? val.lineId : [];
 | 
				
			||||||
 | 
										this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
 | 
				
			||||||
 | 
										this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'export':
 | 
				
			||||||
 | 
										this.handleExport();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    getData() {
 | 
							// 获取数据列表
 | 
				
			||||||
      // this.listQuery.lineId = '1672847052717821953'
 | 
							getDataList() {
 | 
				
			||||||
      // this.listQuery.startTime = '1693497600000';
 | 
								this.dataListLoading = true;
 | 
				
			||||||
      // this.listQuery.endTime = '1693843200000';
 | 
								this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
				
			||||||
      this.urlOptions.getDataListURL(this.listQuery).then(res => {
 | 
									this.tableData = response.data;
 | 
				
			||||||
        console.log(res)
 | 
									this.dataListLoading = false;
 | 
				
			||||||
        let arr = [
 | 
									this.showData = this.tableData;
 | 
				
			||||||
          {
 | 
								});
 | 
				
			||||||
            prop: 'sectionName',
 | 
								getNewCTCharts(this.listQuery).then((response) => {
 | 
				
			||||||
            label: '工段',
 | 
									this.chartData = response.data;
 | 
				
			||||||
            align: 'center',
 | 
								});
 | 
				
			||||||
          },
 | 
							},
 | 
				
			||||||
          {
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
            prop: 'equName',
 | 
								this.listQuery.lineId = [];
 | 
				
			||||||
            label: '设备',
 | 
								this.$refs.searchBarForm.formInline.lineId = undefined;
 | 
				
			||||||
            align: 'center',
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
          }
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
        ]
 | 
								});
 | 
				
			||||||
        let sectionArr= []
 | 
							},
 | 
				
			||||||
        res.data.data.forEach((ele, index) => {
 | 
							handleClick(val) {
 | 
				
			||||||
          let tempData = []
 | 
								this.addOrUpdateVisible = true;
 | 
				
			||||||
          let eqData = []
 | 
								this.addOrEditTitle =
 | 
				
			||||||
            let plData = []
 | 
									val.data?.factoryName + '-' + val.data?.lineName + ' 详情';
 | 
				
			||||||
          ele.data.forEach((item, index) => {
 | 
								this.$nextTick(() => {
 | 
				
			||||||
            item.children.forEach(params => {
 | 
									this.$refs.eqDetail.init(
 | 
				
			||||||
              if (params.dynamicName === '设备CT') {
 | 
										val.data.lineId,
 | 
				
			||||||
                tempData[item.dynamicName + '_eq'] = params.dynamicValue
 | 
										this.listQuery.startTime,
 | 
				
			||||||
                eqData[index] = params.dynamicValue
 | 
										this.listQuery.endTime
 | 
				
			||||||
              } else {
 | 
									);
 | 
				
			||||||
                tempData[item.dynamicName + '_pl'] = params.dynamicValue
 | 
								});
 | 
				
			||||||
                plData[index] = params.dynamicValue
 | 
							},
 | 
				
			||||||
              }
 | 
							handleCancel() {
 | 
				
			||||||
            })
 | 
								this.addOrUpdateVisible = false;
 | 
				
			||||||
          })
 | 
								this.addOrEditTitle = '';
 | 
				
			||||||
          const equipment = {
 | 
							},
 | 
				
			||||||
            name: ele.equName,
 | 
							handleConfirm() {
 | 
				
			||||||
            eqData: eqData,
 | 
								this.handleCancel();
 | 
				
			||||||
            plData: plData
 | 
							},
 | 
				
			||||||
          }
 | 
						},
 | 
				
			||||||
          tempData['equName'] = ele.equName
 | 
					 | 
				
			||||||
          tempData['sectionName'] = ele.sectionName
 | 
					 | 
				
			||||||
          this.tableData.push(tempData)
 | 
					 | 
				
			||||||
          const { sectionName } = tempData
 | 
					 | 
				
			||||||
          sectionArr.push(sectionName)
 | 
					 | 
				
			||||||
          this.yData.push(equipment)
 | 
					 | 
				
			||||||
          console.log('看看equ', this.yData)
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        this.setRowSpan(sectionArr)
 | 
					 | 
				
			||||||
        res.data.nameData.forEach(item => {
 | 
					 | 
				
			||||||
          this.timeList.push(item.name)
 | 
					 | 
				
			||||||
        })
 | 
					 | 
				
			||||||
        const timeArray = Array.from(new Set(this.timeList))
 | 
					 | 
				
			||||||
        for (const times of timeArray) {
 | 
					 | 
				
			||||||
          if (times !== '设备CT' && times !== '产线CT') {
 | 
					 | 
				
			||||||
            const subprop = {
 | 
					 | 
				
			||||||
              label: times,
 | 
					 | 
				
			||||||
              align: 'center',
 | 
					 | 
				
			||||||
              children: [
 | 
					 | 
				
			||||||
                { prop: times + '_eq', label: '设备CT', align: 'center' },
 | 
					 | 
				
			||||||
                { prop: times + '_pl', label: '产线CT', align: 'center' }
 | 
					 | 
				
			||||||
              ]
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            arr.push(subprop)
 | 
					 | 
				
			||||||
            this.xData.push(times)
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.tableProps = arr
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        console.log('表格横坐标', this.xData)
 | 
					 | 
				
			||||||
        this.$refs.lineChart.initChart(this.xData, this.yData)
 | 
					 | 
				
			||||||
        // this.total = response.data.total;
 | 
					 | 
				
			||||||
        // this.dataListLoading = false;
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    buttonClick(val) {
 | 
					 | 
				
			||||||
      // console.log(val)
 | 
					 | 
				
			||||||
      switch (val.btnName) {
 | 
					 | 
				
			||||||
        case 'search':
 | 
					 | 
				
			||||||
          // this.listQuery.pageNo = 1;
 | 
					 | 
				
			||||||
          // this.listQuery.pageSize = 10;
 | 
					 | 
				
			||||||
          this.listQuery.lineId = val.lineIds
 | 
					 | 
				
			||||||
          this.listQuery.startTime = val.time ? String(new Date(val.time[0]).getTime()) : undefined;
 | 
					 | 
				
			||||||
          this.listQuery.endTime = val.time ? String(new Date(val.time[1]).getTime()) : undefined;
 | 
					 | 
				
			||||||
          if (val.time && val.lineIds) {
 | 
					 | 
				
			||||||
            this.tableData = []
 | 
					 | 
				
			||||||
            this.xData = []
 | 
					 | 
				
			||||||
            this.yData = []
 | 
					 | 
				
			||||||
            this.tableProps = []
 | 
					 | 
				
			||||||
            this.spanArr = []
 | 
					 | 
				
			||||||
            this.timeList = []
 | 
					 | 
				
			||||||
            this.getData()
 | 
					 | 
				
			||||||
          } else {
 | 
					 | 
				
			||||||
            this.$message({
 | 
					 | 
				
			||||||
              message: '请选择产线和时间',
 | 
					 | 
				
			||||||
              type: 'warning'
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          break;
 | 
					 | 
				
			||||||
        case 'reset':
 | 
					 | 
				
			||||||
          this.$refs.searchBarForm.resetForm();
 | 
					 | 
				
			||||||
          this.listQuery = {
 | 
					 | 
				
			||||||
            pageSize: 10,
 | 
					 | 
				
			||||||
            pageNo: 1,
 | 
					 | 
				
			||||||
            total: 1,
 | 
					 | 
				
			||||||
          };
 | 
					 | 
				
			||||||
          this.getDataList();
 | 
					 | 
				
			||||||
          break;
 | 
					 | 
				
			||||||
        default:
 | 
					 | 
				
			||||||
          console.log(val);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
 * @Author: zhp
 | 
					 * @Author: zhp
 | 
				
			||||||
 * @Date: 2023-09-13 09:02:25
 | 
					 * @Date: 2023-09-13 09:02:25
 | 
				
			||||||
 * @LastEditTime: 2023-10-08 16:36:37
 | 
					 * @LastEditTime: 2024-11-26 15:52:29
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -108,13 +108,28 @@ export default {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        series: [
 | 
					        series: [
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            name: '设备CT',
 | 
					            name: '生产规格',
 | 
				
			||||||
            data: dataList.eqData,
 | 
					            data: dataList.ggData,
 | 
				
			||||||
            type: 'line',
 | 
					            type: 'line',
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            name: '产线CT',
 | 
					            name: '设备理论速度',
 | 
				
			||||||
            data: dataList.plData,
 | 
					            data: dataList.sbluData,
 | 
				
			||||||
 | 
					            type: 'line',
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            name: '设备实际速度',
 | 
				
			||||||
 | 
					            data: dataList.sbsjData,
 | 
				
			||||||
 | 
					            type: 'line',
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            name: '产线理论速度',
 | 
				
			||||||
 | 
					            data: dataList.cxluData,
 | 
				
			||||||
 | 
					            type: 'line',
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            name: '产线实际速度',
 | 
				
			||||||
 | 
					            data: dataList.cxsjData,
 | 
				
			||||||
            type: 'line',
 | 
					            type: 'line',
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,18 +1,25 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div class="app-container">
 | 
						<div class="app-container">
 | 
				
			||||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
							<search-bar
 | 
				
			||||||
    <div v-if="tableData.length">
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
      <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData" />
 | 
								ref="searchBarForm"
 | 
				
			||||||
      <SearchBar :formConfigs="[{ label: '产品产量对比图', type: 'title' }]" />
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
      <line-chart ref="lineChart" />
 | 
							<div v-if="tableData.length">
 | 
				
			||||||
    </div>
 | 
								<base-table
 | 
				
			||||||
    <div v-else class="no-data-bg"></div>
 | 
									v-loading="dataListLoading"
 | 
				
			||||||
    <!-- <pagination
 | 
									:table-props="tableProps"
 | 
				
			||||||
 | 
									:max-height="tableH"
 | 
				
			||||||
 | 
									:table-data="tableData" />
 | 
				
			||||||
 | 
								<SearchBar :formConfigs="[{ label: '产品产量对比图', type: 'title' }]" />
 | 
				
			||||||
 | 
								<line-chart ref="lineChart" />
 | 
				
			||||||
 | 
							</div>
 | 
				
			||||||
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
 | 
							<!-- <pagination
 | 
				
			||||||
			:limit.sync="listQuery.pageSize"
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
			:page.sync="listQuery.pageNo"
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
			:total="listQuery.total"
 | 
								:total="listQuery.total"
 | 
				
			||||||
			@pagination="getDataList" /> -->
 | 
								@pagination="getDataList" /> -->
 | 
				
			||||||
  </div>
 | 
						</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
@@ -20,7 +27,8 @@
 | 
				
			|||||||
import { parseTime } from '../../mixins/code-filter';
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
 | 
					import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
 | 
				
			||||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
					import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
				
			||||||
import lineChart from '../LineChart'
 | 
					import lineChart from '../LineChart';
 | 
				
			||||||
 | 
					import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
				
			||||||
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
					// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// const tableProps = [
 | 
					// const tableProps = [
 | 
				
			||||||
@@ -45,51 +53,52 @@ import lineChart from '../LineChart'
 | 
				
			|||||||
// ];
 | 
					// ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  components: {
 | 
						components: {
 | 
				
			||||||
    lineChart,
 | 
							lineChart,
 | 
				
			||||||
  },
 | 
						},
 | 
				
			||||||
	// mixins: [basicPage],
 | 
						mixins: [tableHeightMixin],
 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			urlOptions: {
 | 
								urlOptions: {
 | 
				
			||||||
        getDataListURL: getYieldAnalysisPageData,
 | 
									getDataListURL: getYieldAnalysisPageData,
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
      tableProps:[],
 | 
								tableProps: [],
 | 
				
			||||||
      dataListLoading:false,
 | 
								dataListLoading: false,
 | 
				
			||||||
      tableData: [],
 | 
								tableData: [],
 | 
				
			||||||
      listQuery: {
 | 
								listQuery: {
 | 
				
			||||||
        lineIds: [],
 | 
									lineIds: [],
 | 
				
			||||||
        time: ''
 | 
									time: '',
 | 
				
			||||||
      },
 | 
								},
 | 
				
			||||||
      dateLabelList: [],
 | 
								dateLabelList: [],
 | 
				
			||||||
      optionArrUrl: [getProductionLinePage ],
 | 
								optionArrUrl: [getProductionLinePage],
 | 
				
			||||||
			formConfig: [
 | 
								formConfig: [
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
					label: '产线',
 | 
										label: '产线',
 | 
				
			||||||
					selectOptions: [],
 | 
										selectOptions: [],
 | 
				
			||||||
          param: 'lineIds',
 | 
										param: 'lineIds',
 | 
				
			||||||
          defaultSelect: '',
 | 
										defaultSelect: [],
 | 
				
			||||||
          multiple:true,
 | 
										multiple: true,
 | 
				
			||||||
					filterable: true,
 | 
										filterable: true,
 | 
				
			||||||
 | 
										width: 400,
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'datePicker',
 | 
										type: 'datePicker',
 | 
				
			||||||
					label: '时间',
 | 
										label: '时间',
 | 
				
			||||||
					dateType: 'month',
 | 
										dateType: 'month',
 | 
				
			||||||
					format: 'yyyy-MM-dd',
 | 
										format: 'yyyy-MM',
 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
					rangeSeparator: '-',
 | 
										rangeSeparator: '-',
 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
          param: 'time',
 | 
										param: 'time',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
					btnName: '查询',
 | 
										btnName: '查询',
 | 
				
			||||||
					name: 'search',
 | 
										name: 'search',
 | 
				
			||||||
					color: 'primary',
 | 
										color: 'primary',
 | 
				
			||||||
				}
 | 
									},
 | 
				
			||||||
			],
 | 
								],
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
@@ -104,145 +113,147 @@ export default {
 | 
				
			|||||||
			};
 | 
								};
 | 
				
			||||||
			this.optionArrUrl.forEach((item, index) => {
 | 
								this.optionArrUrl.forEach((item, index) => {
 | 
				
			||||||
				item(params).then((response) => {
 | 
									item(params).then((response) => {
 | 
				
			||||||
					this.formConfig[index].selectOptions = response.data.list
 | 
										this.formConfig[index].selectOptions = response.data.list;
 | 
				
			||||||
          // this.formConfig[0].defaultSelect = response.data.list[0].id
 | 
										// this.formConfig[0].defaultSelect = response.data.list[0].id
 | 
				
			||||||
          this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
 | 
										// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
 | 
				
			||||||
				});
 | 
									});
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
    getData() {
 | 
							getData() {
 | 
				
			||||||
      // this.listQuery.lineIds = ['1672847052717821953']
 | 
								// this.listQuery.lineIds = ['1672847052717821953']
 | 
				
			||||||
      // this.listQuery.productId = val.productId;
 | 
								// this.listQuery.productId = val.productId;
 | 
				
			||||||
      // this.listQuery.time = '1694486098000';
 | 
								// this.listQuery.time = '1694486098000';
 | 
				
			||||||
      this.urlOptions.getDataListURL(this.listQuery).then(res => {
 | 
								this.urlOptions.getDataListURL(this.listQuery).then((res) => {
 | 
				
			||||||
        let arr = [
 | 
									let arr = [
 | 
				
			||||||
          	{
 | 
										{
 | 
				
			||||||
              prop: 'lineName',
 | 
											prop: 'lineName',
 | 
				
			||||||
          		label: '产线',
 | 
											label: '产线',
 | 
				
			||||||
              fixed: 'left'
 | 
											fixed: 'left',
 | 
				
			||||||
          	},
 | 
										},
 | 
				
			||||||
            {
 | 
										{
 | 
				
			||||||
              prop: 'sum',
 | 
											prop: 'sum',
 | 
				
			||||||
              label: '合计',
 | 
											label: '合计[片]',
 | 
				
			||||||
              fixed: 'left'
 | 
											fixed: 'left',
 | 
				
			||||||
            },
 | 
										},
 | 
				
			||||||
            {
 | 
										{
 | 
				
			||||||
              prop: res.data ? res.data.nameData[0].name : undefined,
 | 
											prop: res.data ? res.data.nameData[0].name : undefined,
 | 
				
			||||||
              label: res.data ? res.data.nameData[0].name : undefined,
 | 
											label: res.data ? res.data.nameData[0].name : undefined,
 | 
				
			||||||
              align: 'center',
 | 
											align: 'center',
 | 
				
			||||||
              children:[
 | 
											children: [],
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									];
 | 
				
			||||||
 | 
									// console.log(res.data.nameData.slice(1))
 | 
				
			||||||
 | 
									let xData = [];
 | 
				
			||||||
 | 
									let yAllData = [];
 | 
				
			||||||
 | 
									let lineName = [];
 | 
				
			||||||
 | 
									if (res.data) {
 | 
				
			||||||
 | 
										let tempDateList = [];
 | 
				
			||||||
 | 
										res.data.nameData.forEach((date) => {
 | 
				
			||||||
 | 
											tempDateList.push(date.name);
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										this.dateLabelList = Array.from(new Set(tempDateList));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              ]
 | 
										this.dateLabelList.forEach((item) => {
 | 
				
			||||||
            }
 | 
											if (item.indexOf('年') === -1) {
 | 
				
			||||||
        ]
 | 
												// 构造表头
 | 
				
			||||||
        // console.log(res.data.nameData.slice(1))
 | 
												const props = {
 | 
				
			||||||
        let xData = []
 | 
													prop: item,
 | 
				
			||||||
        let yAllData = []
 | 
													label: item,
 | 
				
			||||||
        let lineName = []
 | 
												};
 | 
				
			||||||
        if (res.data) {
 | 
												arr[2].children.push(props);
 | 
				
			||||||
          let tempDateList = []
 | 
					 | 
				
			||||||
          res.data.nameData.forEach(date => {
 | 
					 | 
				
			||||||
            tempDateList.push(date.name)
 | 
					 | 
				
			||||||
          })
 | 
					 | 
				
			||||||
          this.dateLabelList = Array.from(new Set(tempDateList))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
          this.dateLabelList.forEach(item => {
 | 
												// 构造echarts横坐标
 | 
				
			||||||
            if (item.indexOf('年') === -1) {
 | 
												xData.push(item);
 | 
				
			||||||
              // 构造表头
 | 
											}
 | 
				
			||||||
              const props = {
 | 
										});
 | 
				
			||||||
                'prop': item,
 | 
										// res.data.nameData.slice(1).forEach(item => {
 | 
				
			||||||
                'label': item
 | 
										//   const props = {
 | 
				
			||||||
              }
 | 
										//     'prop': item.name,
 | 
				
			||||||
              arr[2].children.push(props)
 | 
										//     'label': item.name,
 | 
				
			||||||
 | 
										//     'align': 'center'
 | 
				
			||||||
 | 
										//   }
 | 
				
			||||||
 | 
										//   arr[2].children.push(props)
 | 
				
			||||||
 | 
										// })
 | 
				
			||||||
 | 
										let tableDataArr = [];
 | 
				
			||||||
 | 
										res.data.data.forEach((item) => {
 | 
				
			||||||
 | 
											let obj = {};
 | 
				
			||||||
 | 
											(obj.lineName = item.lineName),
 | 
				
			||||||
 | 
												(obj.sum = item.sum),
 | 
				
			||||||
 | 
												item.data.forEach((ele, index) => {
 | 
				
			||||||
 | 
													// console.log(ele)
 | 
				
			||||||
 | 
													ele.children.forEach((e) => {
 | 
				
			||||||
 | 
														console.log(e.dynamicName);
 | 
				
			||||||
 | 
														obj['' + e.dynamicName + ''] = e.dynamicValue;
 | 
				
			||||||
 | 
														console.log(obj['' + e.dynamicName + '']);
 | 
				
			||||||
 | 
													});
 | 
				
			||||||
 | 
												});
 | 
				
			||||||
 | 
											tableDataArr.push(obj);
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										this.tableData = tableDataArr;
 | 
				
			||||||
 | 
										this.tableProps = arr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              // 构造echarts横坐标
 | 
										// let tempList = []
 | 
				
			||||||
              xData.push(item)
 | 
										// res.data.nameData.slice(1).forEach(item => {
 | 
				
			||||||
            }
 | 
										//   tempList.push(item.name)
 | 
				
			||||||
          })
 | 
										//   // arr[2].children.push(props)
 | 
				
			||||||
          // res.data.nameData.slice(1).forEach(item => {
 | 
										// })
 | 
				
			||||||
          //   const props = {
 | 
										// xData = Array.from(new Set(tempList))
 | 
				
			||||||
          //     'prop': item.name,
 | 
					
 | 
				
			||||||
          //     'label': item.name,
 | 
										res.data.data.forEach((item) => {
 | 
				
			||||||
          //     'align': 'center'
 | 
											let yData = [];
 | 
				
			||||||
          //   }
 | 
											lineName.push(item.lineName);
 | 
				
			||||||
          //   arr[2].children.push(props)
 | 
											// let obj = {}
 | 
				
			||||||
          // })
 | 
											// obj.lineName = item.lineName,
 | 
				
			||||||
          let tableDataArr =[]
 | 
											//   obj.sum = item.sum,
 | 
				
			||||||
          res.data.data.forEach(item => {
 | 
											item.data.forEach((ele, index) => {
 | 
				
			||||||
            let obj = {}
 | 
												// console.log(ele)
 | 
				
			||||||
            obj.lineName= item.lineName,
 | 
												ele.children.forEach((e) => {
 | 
				
			||||||
            obj.sum= item.sum,
 | 
													// let yData = []
 | 
				
			||||||
            item.data.forEach((ele, index) => {
 | 
													yData.push(e.dynamicValue);
 | 
				
			||||||
              // console.log(ele)
 | 
												});
 | 
				
			||||||
              ele.children.forEach((e) => {
 | 
											});
 | 
				
			||||||
                console.log(e.dynamicName)
 | 
											yAllData.push(yData);
 | 
				
			||||||
                obj['' + e.dynamicName + ''] = e.dynamicValue
 | 
										});
 | 
				
			||||||
                console.log(obj['' + e.dynamicName + '']);
 | 
										console.log(lineName);
 | 
				
			||||||
              })
 | 
									} else {
 | 
				
			||||||
            })
 | 
										this.tableProps = arr;
 | 
				
			||||||
            tableDataArr.push(obj)
 | 
										this.tableData = [];
 | 
				
			||||||
          });
 | 
										xData = [];
 | 
				
			||||||
          this.tableData = tableDataArr
 | 
										yAllData = [];
 | 
				
			||||||
          this.tableProps = arr
 | 
										lineName = [];
 | 
				
			||||||
          
 | 
									}
 | 
				
			||||||
          // let tempList = []
 | 
									// res.data.data[0].data[0].children.forEach((item, index) => {
 | 
				
			||||||
          // res.data.nameData.slice(1).forEach(item => {
 | 
									//   // console.log(item)
 | 
				
			||||||
          //   tempList.push(item.name)
 | 
									//   yData.push(item.dynamicValue)
 | 
				
			||||||
          //   // arr[2].children.push(props)
 | 
									//   // let data = 'data' + Number(index+1)
 | 
				
			||||||
          // })
 | 
									//   // obj['' + item.dynamicName + ''] = item.dynamicValue
 | 
				
			||||||
          // xData = Array.from(new Set(tempList))
 | 
									// })
 | 
				
			||||||
          
 | 
									// console.log(this.yData)
 | 
				
			||||||
          res.data.data.forEach(item => {
 | 
									this.$nextTick(() => {
 | 
				
			||||||
            let yData = []
 | 
										this.$refs.lineChart.initChart(xData, yAllData, lineName);
 | 
				
			||||||
            lineName.push(item.lineName)
 | 
									});
 | 
				
			||||||
            // let obj = {}
 | 
									// this.total = response.data.total;
 | 
				
			||||||
            // obj.lineName = item.lineName,
 | 
									// this.dataListLoading = false;
 | 
				
			||||||
            //   obj.sum = item.sum,
 | 
								});
 | 
				
			||||||
            item.data.forEach((ele, index) => {
 | 
							},
 | 
				
			||||||
                // console.log(ele)
 | 
							buttonClick(val) {
 | 
				
			||||||
              ele.children.forEach((e) => {
 | 
					 | 
				
			||||||
                // let yData = []
 | 
					 | 
				
			||||||
                yData.push(e.dynamicValue)
 | 
					 | 
				
			||||||
                })
 | 
					 | 
				
			||||||
              })
 | 
					 | 
				
			||||||
            yAllData.push(yData)
 | 
					 | 
				
			||||||
          });
 | 
					 | 
				
			||||||
          console.log(lineName)
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          this.tableProps = arr
 | 
					 | 
				
			||||||
          this.tableData = []
 | 
					 | 
				
			||||||
          xData = []
 | 
					 | 
				
			||||||
          yAllData = []
 | 
					 | 
				
			||||||
          lineName = []
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        // res.data.data[0].data[0].children.forEach((item, index) => {
 | 
					 | 
				
			||||||
        //   // console.log(item)
 | 
					 | 
				
			||||||
        //   yData.push(item.dynamicValue)
 | 
					 | 
				
			||||||
        //   // let data = 'data' + Number(index+1)
 | 
					 | 
				
			||||||
        //   // obj['' + item.dynamicName + ''] = item.dynamicValue
 | 
					 | 
				
			||||||
        // })
 | 
					 | 
				
			||||||
        // console.log(this.yData)
 | 
					 | 
				
			||||||
        this.$refs.lineChart.initChart(xData, yAllData, lineName)
 | 
					 | 
				
			||||||
        // this.total = response.data.total;
 | 
					 | 
				
			||||||
        // this.dataListLoading = false;
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    buttonClick(val) {
 | 
					 | 
				
			||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
        case 'search':
 | 
									case 'search':
 | 
				
			||||||
          this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined
 | 
										this.listQuery.lineIds = val.lineIds ? val.lineIds : undefined;
 | 
				
			||||||
          // this.listQuery.productId = val.productId;
 | 
										// this.listQuery.productId = val.productId;
 | 
				
			||||||
          this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined
 | 
										this.listQuery.time = val.time
 | 
				
			||||||
 | 
											? new Date(val.time).getTime()
 | 
				
			||||||
 | 
											: undefined;
 | 
				
			||||||
					// this.listQuery.pageNo = 1;
 | 
										// this.listQuery.pageNo = 1;
 | 
				
			||||||
          // this.listQuery.pageSize = 10;
 | 
										// this.listQuery.pageSize = 10;
 | 
				
			||||||
          if (val.time) {
 | 
										if (val.time) {
 | 
				
			||||||
            this.getData()
 | 
											this.getData();
 | 
				
			||||||
          } else {
 | 
										} else {
 | 
				
			||||||
            this.$message({
 | 
											this.$message({
 | 
				
			||||||
              message: '请选择时间',
 | 
												message: '请选择时间',
 | 
				
			||||||
              type: 'warning'
 | 
												type: 'warning',
 | 
				
			||||||
            });
 | 
											});
 | 
				
			||||||
          }
 | 
										}
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'reset':
 | 
									case 'reset':
 | 
				
			||||||
					this.$refs.searchBarForm.resetForm();
 | 
										this.$refs.searchBarForm.resetForm();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,24 +59,36 @@
 | 
				
			|||||||
				<i class="el-icon-delete"></i>
 | 
									<i class="el-icon-delete"></i>
 | 
				
			||||||
			</div> -->
 | 
								</div> -->
 | 
				
			||||||
			<div
 | 
								<div
 | 
				
			||||||
				class="file-list__item"
 | 
					 | 
				
			||||||
				v-for="(file, index) in files"
 | 
									v-for="(file, index) in files"
 | 
				
			||||||
				:key="file.fileName"
 | 
									:key="file.fileName"
 | 
				
			||||||
				:style="{
 | 
									style="width: 100%">
 | 
				
			||||||
					background: isPicMode
 | 
									<div
 | 
				
			||||||
						? `url(${file.fileUrl}) no-repeat`
 | 
										class="file-list__item"
 | 
				
			||||||
						: `url(${defaultBg}) no-repeat`,
 | 
										v-if="!isPicMode"
 | 
				
			||||||
					backgroundSize: isPicMode ? '100% 100%' : '64px',
 | 
										:style="{
 | 
				
			||||||
					backgroundPosition: isPicMode ? '0% 0%' : 'center',
 | 
											background: isPicMode
 | 
				
			||||||
				}"
 | 
												? `url(${file.fileUrl}) no-repeat`
 | 
				
			||||||
				:data-name="file.fileName">
 | 
												: `url(${defaultBg}) no-repeat`,
 | 
				
			||||||
				<el-button
 | 
											backgroundSize: isPicMode ? '100% 100%' : '64px',
 | 
				
			||||||
					v-if="!disabled"
 | 
											backgroundPosition: isPicMode ? '0% 0%' : 'center',
 | 
				
			||||||
					type="text"
 | 
										}"
 | 
				
			||||||
					class="el-icon-delete"
 | 
										@click="handleDownload(file)"
 | 
				
			||||||
					style="padding: 0"
 | 
										:data-name="file.fileName">
 | 
				
			||||||
					@click="(e) => handleDelete(file)" />
 | 
										<el-button
 | 
				
			||||||
			</div>
 | 
											v-if="!disabled"
 | 
				
			||||||
 | 
											type="text"
 | 
				
			||||||
 | 
											class="el-icon-delete"
 | 
				
			||||||
 | 
											style="padding: 0"
 | 
				
			||||||
 | 
											@click="(e) => handleDelete(file)" />
 | 
				
			||||||
 | 
									</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<el-image
 | 
				
			||||||
 | 
										v-else
 | 
				
			||||||
 | 
										class="file-list__item"
 | 
				
			||||||
 | 
										style="width: 100%"
 | 
				
			||||||
 | 
										:src="file.fileUrl"
 | 
				
			||||||
 | 
										:preview-src-list="files.map((item) => item.fileUrl)"></el-image>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
		</section>
 | 
							</section>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
@@ -277,6 +289,32 @@ export default {
 | 
				
			|||||||
			// Array
 | 
								// Array
 | 
				
			||||||
			this.$emit('update-filelist', this.appendFilelist);
 | 
								this.$emit('update-filelist', this.appendFilelist);
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							async handleDownload(file) {
 | 
				
			||||||
 | 
								if (this.isPicMode) {
 | 
				
			||||||
 | 
									// this.$emit('preview', file);
 | 
				
			||||||
 | 
									const link = document.createElement('a');
 | 
				
			||||||
 | 
									link.href = file.fileUrl;
 | 
				
			||||||
 | 
									link.target = '_blank';
 | 
				
			||||||
 | 
									document.body.appendChild(link);
 | 
				
			||||||
 | 
									link.click();
 | 
				
			||||||
 | 
									document.body.removeChild(link);
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									// this.$emit('download', file);
 | 
				
			||||||
 | 
									const data = await this.$axios({
 | 
				
			||||||
 | 
										url: file.fileUrl,
 | 
				
			||||||
 | 
										method: 'get',
 | 
				
			||||||
 | 
										responseType: 'blob',
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									const link = document.createElement('a');
 | 
				
			||||||
 | 
									link.href = window.URL.createObjectURL(new Blob([data]));
 | 
				
			||||||
 | 
									link.download = file.fileName;
 | 
				
			||||||
 | 
									document.body.appendChild(link);
 | 
				
			||||||
 | 
									link.click();
 | 
				
			||||||
 | 
									document.body.removeChild(link);
 | 
				
			||||||
 | 
									window.URL.revokeObjectURL(link.href);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<!-- 
 | 
					<!--
 | 
				
			||||||
    filename: dialogForm.vue
 | 
					    filename: dialogForm.vue
 | 
				
			||||||
    author: liubin
 | 
					    author: liubin
 | 
				
			||||||
    date: 2023-08-15 10:32:36
 | 
					    date: 2023-08-15 10:32:36
 | 
				
			||||||
@@ -44,7 +44,7 @@
 | 
				
			|||||||
					<el-date-picker
 | 
										<el-date-picker
 | 
				
			||||||
						v-if="col.datetime"
 | 
											v-if="col.datetime"
 | 
				
			||||||
						v-model="form[col.prop]"
 | 
											v-model="form[col.prop]"
 | 
				
			||||||
						type="datetime"
 | 
											type="date"
 | 
				
			||||||
						:placeholder="`请选择${col.label}`"
 | 
											:placeholder="`请选择${col.label}`"
 | 
				
			||||||
						value-format="timestamp"
 | 
											value-format="timestamp"
 | 
				
			||||||
						v-bind="col.bind"></el-date-picker>
 | 
											v-bind="col.bind"></el-date-picker>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -308,6 +308,7 @@ export default {
 | 
				
			|||||||
				});
 | 
									});
 | 
				
			||||||
				if (code == 0) {
 | 
									if (code == 0) {
 | 
				
			||||||
					this.$modal.msgSuccess('更新成功');
 | 
										this.$modal.msgSuccess('更新成功');
 | 
				
			||||||
 | 
					          this.$emit('refreshDataList');
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				this.btnLoading = false;
 | 
									this.btnLoading = false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<!-- 
 | 
					<!--
 | 
				
			||||||
    filename: dialogForm.vue
 | 
					    filename: dialogForm.vue
 | 
				
			||||||
    author: liubin
 | 
					    author: liubin
 | 
				
			||||||
    date: 2023-08-15 10:32:36
 | 
					    date: 2023-08-15 10:32:36
 | 
				
			||||||
@@ -57,6 +57,7 @@
 | 
				
			|||||||
						v-model="form.equipmentTypeId"
 | 
											v-model="form.equipmentTypeId"
 | 
				
			||||||
						:disabled="disabled"
 | 
											:disabled="disabled"
 | 
				
			||||||
						filterable
 | 
											filterable
 | 
				
			||||||
 | 
					            clearable
 | 
				
			||||||
						placeholder="请选择设备类型">
 | 
											placeholder="请选择设备类型">
 | 
				
			||||||
						<el-option
 | 
											<el-option
 | 
				
			||||||
							v-for="eqType in eqTypeList"
 | 
												v-for="eqType in eqTypeList"
 | 
				
			||||||
@@ -79,9 +80,9 @@
 | 
				
			|||||||
			<el-col :span="8">
 | 
								<el-col :span="8">
 | 
				
			||||||
				<el-form-item label="生产日期" prop="productionTime" :rules="[]">
 | 
									<el-form-item label="生产日期" prop="productionTime" :rules="[]">
 | 
				
			||||||
					<el-date-picker
 | 
										<el-date-picker
 | 
				
			||||||
						v-model="form.enterTime"
 | 
											v-model="form.productionTime"
 | 
				
			||||||
						:disabled="disabled"
 | 
											:disabled="disabled"
 | 
				
			||||||
						type="datetime"
 | 
											type="date"
 | 
				
			||||||
						placeholder="请选择生产日期"
 | 
											placeholder="请选择生产日期"
 | 
				
			||||||
						value-format="timestamp"></el-date-picker>
 | 
											value-format="timestamp"></el-date-picker>
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
@@ -91,14 +92,14 @@
 | 
				
			|||||||
					<el-date-picker
 | 
										<el-date-picker
 | 
				
			||||||
						v-model="form.enterTime"
 | 
											v-model="form.enterTime"
 | 
				
			||||||
						:disabled="disabled"
 | 
											:disabled="disabled"
 | 
				
			||||||
						type="datetime"
 | 
											type="date"
 | 
				
			||||||
						placeholder="请选择进场日期"
 | 
											placeholder="请选择进场日期"
 | 
				
			||||||
						value-format="timestamp"></el-date-picker>
 | 
											value-format="timestamp"></el-date-picker>
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
			<el-col :span="8">
 | 
								<el-col :span="8">
 | 
				
			||||||
				<el-form-item
 | 
									<el-form-item
 | 
				
			||||||
					label="设备TT值"
 | 
										label="设备理论生产能效(片/min)"
 | 
				
			||||||
					prop="tvalue"
 | 
										prop="tvalue"
 | 
				
			||||||
					:rules="[
 | 
										:rules="[
 | 
				
			||||||
						{ required: true, message: '不能为空', trigger: 'blur' },
 | 
											{ required: true, message: '不能为空', trigger: 'blur' },
 | 
				
			||||||
@@ -112,7 +113,7 @@
 | 
				
			|||||||
					<el-input
 | 
										<el-input
 | 
				
			||||||
						v-model="form.tvalue"
 | 
											v-model="form.tvalue"
 | 
				
			||||||
						:disabled="disabled"
 | 
											:disabled="disabled"
 | 
				
			||||||
						placeholder="请输入设备TT值"></el-input>
 | 
											placeholder="请输入"></el-input>
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
		</el-row>
 | 
							</el-row>
 | 
				
			||||||
@@ -316,7 +317,7 @@ export default {
 | 
				
			|||||||
				this.form
 | 
									this.form
 | 
				
			||||||
			);
 | 
								);
 | 
				
			||||||
			// 保存原始文件名
 | 
								// 保存原始文件名
 | 
				
			||||||
			if ('fileNames' in this.form) this.form.fileNames.push(file.name);
 | 
								if ('fileNames' in this.form) this.form.fileNames.push(file.name+Date.now());
 | 
				
			||||||
			// 保存完整地址
 | 
								// 保存完整地址
 | 
				
			||||||
			if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
 | 
								if ('fileUrls' in this.form) this.form.fileUrls.push(response.data);
 | 
				
			||||||
			this.$modal.msgSuccess('上传成功');
 | 
								this.$modal.msgSuccess('上传成功');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,7 @@
 | 
				
			|||||||
			@cancel="cancel"
 | 
								@cancel="cancel"
 | 
				
			||||||
			width="60%"
 | 
								width="60%"
 | 
				
			||||||
			@confirm="submitForm">
 | 
								@confirm="submitForm">
 | 
				
			||||||
			<DialogForm
 | 
								<DialogForm1
 | 
				
			||||||
				v-if="open"
 | 
									v-if="open"
 | 
				
			||||||
				key="index-dialog-form"
 | 
									key="index-dialog-form"
 | 
				
			||||||
				ref="form"
 | 
									ref="form"
 | 
				
			||||||
@@ -78,7 +78,7 @@
 | 
				
			|||||||
					queryParams: {
 | 
										queryParams: {
 | 
				
			||||||
						equipmentId: form.id,
 | 
											equipmentId: form.id,
 | 
				
			||||||
						pageNo: 1,
 | 
											pageNo: 1,
 | 
				
			||||||
						pageSize: 10,
 | 
											pageSize: 20,
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					tableBtn: [
 | 
										tableBtn: [
 | 
				
			||||||
						this.$auth.hasPermi('base:equipment-attr:update')
 | 
											this.$auth.hasPermi('base:equipment-attr:update')
 | 
				
			||||||
@@ -107,6 +107,7 @@
 | 
				
			|||||||
import moment from 'moment';
 | 
					import moment from 'moment';
 | 
				
			||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
					import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
				
			||||||
import EquipmentDrawer from './components/EquipmentDrawer';
 | 
					import EquipmentDrawer from './components/EquipmentDrawer';
 | 
				
			||||||
 | 
					import DialogForm1 from './components/DialogForm';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
	createEquipment,
 | 
						createEquipment,
 | 
				
			||||||
@@ -124,6 +125,7 @@ export default {
 | 
				
			|||||||
	components: {
 | 
						components: {
 | 
				
			||||||
		Editor,
 | 
							Editor,
 | 
				
			||||||
		EquipmentDrawer,
 | 
							EquipmentDrawer,
 | 
				
			||||||
 | 
							DialogForm1,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	mixins: [basicPageMixin],
 | 
						mixins: [basicPageMixin],
 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
@@ -157,7 +159,12 @@ export default {
 | 
				
			|||||||
					width: 180,
 | 
										width: 180,
 | 
				
			||||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
										filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{ prop: 'name', label: '设备名称' },
 | 
									{
 | 
				
			||||||
 | 
										width: 200,
 | 
				
			||||||
 | 
										showOverflowtooltip: true,
 | 
				
			||||||
 | 
										prop: 'name',
 | 
				
			||||||
 | 
										label: '设备名称',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{ width: 256, prop: 'code', label: '设备编码' },
 | 
									{ width: 256, prop: 'code', label: '设备编码' },
 | 
				
			||||||
				{ prop: 'equipmentType', label: '设备类型' },
 | 
									{ prop: 'equipmentType', label: '设备类型' },
 | 
				
			||||||
				{ prop: 'enName', label: '英文名称' },
 | 
									{ prop: 'enName', label: '英文名称' },
 | 
				
			||||||
@@ -270,6 +277,7 @@ export default {
 | 
				
			|||||||
						url: '/base/equipment-type/page?pageNo=1&pageSize=100',
 | 
											url: '/base/equipment-type/page?pageNo=1&pageSize=100',
 | 
				
			||||||
						bind: {
 | 
											bind: {
 | 
				
			||||||
							filterable: true,
 | 
												filterable: true,
 | 
				
			||||||
 | 
												clearable: true,
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					// {
 | 
										// {
 | 
				
			||||||
@@ -294,7 +302,7 @@ export default {
 | 
				
			|||||||
					{
 | 
										{
 | 
				
			||||||
						input: true,
 | 
											input: true,
 | 
				
			||||||
						prop: 'tvalue',
 | 
											prop: 'tvalue',
 | 
				
			||||||
						label: '设备TT值',
 | 
											label: '设备理论生产能效(片/min)',
 | 
				
			||||||
						rules: [
 | 
											rules: [
 | 
				
			||||||
							{ required: true, message: '不能为空', trigger: 'blur' },
 | 
												{ required: true, message: '不能为空', trigger: 'blur' },
 | 
				
			||||||
							{
 | 
												{
 | 
				
			||||||
@@ -435,7 +443,7 @@ export default {
 | 
				
			|||||||
			// 查询参数
 | 
								// 查询参数
 | 
				
			||||||
			queryParams: {
 | 
								queryParams: {
 | 
				
			||||||
				pageNo: 1,
 | 
									pageNo: 1,
 | 
				
			||||||
				pageSize: 10,
 | 
									pageSize: 20,
 | 
				
			||||||
				code: '',
 | 
									code: '',
 | 
				
			||||||
				name: '',
 | 
									name: '',
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
@@ -561,6 +569,7 @@ export default {
 | 
				
			|||||||
					return;
 | 
										return;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				// 添加的提交
 | 
									// 添加的提交
 | 
				
			||||||
 | 
									this.form.files = [];
 | 
				
			||||||
				createEquipment(this.form).then((response) => {
 | 
									createEquipment(this.form).then((response) => {
 | 
				
			||||||
					this.$modal.msgSuccess('新增成功');
 | 
										this.$modal.msgSuccess('新增成功');
 | 
				
			||||||
					this.open = false;
 | 
										this.open = false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -153,6 +153,9 @@ export default {
 | 
				
			|||||||
						label: '父类',
 | 
											label: '父类',
 | 
				
			||||||
						prop: 'parentId',
 | 
											prop: 'parentId',
 | 
				
			||||||
						url: '/base/equipment-type/page?pageNo=1&pageSize=100',
 | 
											url: '/base/equipment-type/page?pageNo=1&pageSize=100',
 | 
				
			||||||
 | 
											bind: {
 | 
				
			||||||
 | 
												clearable: true, // some condition, like detail mode...
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					{},
 | 
										{},
 | 
				
			||||||
				],
 | 
									],
 | 
				
			||||||
@@ -237,25 +240,6 @@ export default {
 | 
				
			|||||||
			const id = row.id;
 | 
								const id = row.id;
 | 
				
			||||||
			getEquipmentType(id).then((response) => {
 | 
								getEquipmentType(id).then((response) => {
 | 
				
			||||||
				this.form = response.data;
 | 
									this.form = response.data;
 | 
				
			||||||
				// this.form = {
 | 
					 | 
				
			||||||
				// 	code: 'SBLX20230925184444000041',
 | 
					 | 
				
			||||||
				// 	name: '测试131',
 | 
					 | 
				
			||||||
				// 	remark: '测试可删除',
 | 
					 | 
				
			||||||
				// 	id: '1706258479729336322',
 | 
					 | 
				
			||||||
				// 	files: [
 | 
					 | 
				
			||||||
				// 		{ fileName: '1.png', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: '1.asdfaslkjfkasdf.png', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: '2.txt', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: '1.rar', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: '1.kkk', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: 'test.file', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: '222', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 		{ fileName: 'g', fileUrl: '', fileType: 2 },
 | 
					 | 
				
			||||||
				// 	],
 | 
					 | 
				
			||||||
				// 	createTime: 1695638697000,
 | 
					 | 
				
			||||||
				// 	parentId: '1701869972319584257',
 | 
					 | 
				
			||||||
				// };
 | 
					 | 
				
			||||||
				// debugger;
 | 
					 | 
				
			||||||
				this.open = true;
 | 
									this.open = true;
 | 
				
			||||||
				this.title = '修改设备类型';
 | 
									this.title = '修改设备类型';
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -154,7 +154,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
					this.listQuery.code = val.code;
 | 
										this.listQuery.code = val.code;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										99
									
								
								src/views/core/base/lineBindProcess/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,99 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: zwq
 | 
				
			||||||
 | 
					 * @Date: 2023-08-02 15:12:42
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @LastEditTime: 2024-11-29 13:25:51
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="app-container">
 | 
				
			||||||
 | 
							<search-bar
 | 
				
			||||||
 | 
								:formConfigs="[{ label: '产线在制工艺', type: 'title' }]"
 | 
				
			||||||
 | 
								ref="searchBarForm" />
 | 
				
			||||||
 | 
							<base-table
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
 | 
								:table-props="tableProps"
 | 
				
			||||||
 | 
								:page="listQuery.pageNo"
 | 
				
			||||||
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
 | 
								:table-data="tableData"
 | 
				
			||||||
 | 
								@emitFun="inputChange" />
 | 
				
			||||||
 | 
							<pagination
 | 
				
			||||||
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
 | 
								:total="listQuery.total"
 | 
				
			||||||
 | 
								@pagination="getDataList" />
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import basicPage from '../../mixins/basic-page';
 | 
				
			||||||
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
 | 
					import { getLineBindProcessPage } from '@/api/core/base/lineBindProcess';
 | 
				
			||||||
 | 
					import selectProduct from './selectProduct';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lineName',
 | 
				
			||||||
 | 
							label: '产线'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'processDictName',
 | 
				
			||||||
 | 
							label: '在制工艺',
 | 
				
			||||||
 | 
							list: [],
 | 
				
			||||||
 | 
							subcomponent: selectProduct,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'recordTime',
 | 
				
			||||||
 | 
							label: '开始时间',
 | 
				
			||||||
 | 
							filter: parseTime,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						mixins: [basicPage, selectProduct],
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									getDataListURL: getLineBindProcessPage,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								// formConfig: [
 | 
				
			||||||
 | 
								// 	{
 | 
				
			||||||
 | 
								// 		type: 'button',
 | 
				
			||||||
 | 
								// 		btnName: '同步',
 | 
				
			||||||
 | 
								// 		name: 'search',
 | 
				
			||||||
 | 
								// 		color: 'primary',
 | 
				
			||||||
 | 
								// 	},
 | 
				
			||||||
 | 
								// ],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						components: {},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
					    // 获取数据列表
 | 
				
			||||||
 | 
					    getDataList() {
 | 
				
			||||||
 | 
					      this.dataListLoading = true;
 | 
				
			||||||
 | 
					      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
				
			||||||
 | 
					        this.tableData = response.data;
 | 
				
			||||||
 | 
					        this.dataListLoading = false;
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							inputChange() {
 | 
				
			||||||
 | 
								this.getDataList();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
							
								
								
									
										83
									
								
								src/views/core/base/lineBindProcess/selectProduct.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,83 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: zwq
 | 
				
			||||||
 | 
					 * @Date: 2023-08-03 14:09:18
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-02-24 15:21:07
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="tableInner">
 | 
				
			||||||
 | 
							<el-popover
 | 
				
			||||||
 | 
								placement="top"
 | 
				
			||||||
 | 
								title="切换在制工艺"
 | 
				
			||||||
 | 
								width="160"
 | 
				
			||||||
 | 
								v-model="visible">
 | 
				
			||||||
 | 
								<el-select v-model="list.processDict" style="margin: 5px" filterable>
 | 
				
			||||||
 | 
									<el-option
 | 
				
			||||||
 | 
										v-for="opt in getDictDatas(DICT_TYPE.PROCESS_TYPE)"
 | 
				
			||||||
 | 
										:key="opt.value"
 | 
				
			||||||
 | 
										:label="opt.label"
 | 
				
			||||||
 | 
										:value="opt.value"></el-option>
 | 
				
			||||||
 | 
								</el-select>
 | 
				
			||||||
 | 
								<div style="text-align: right; margin: 0">
 | 
				
			||||||
 | 
									<el-button size="mini" type="text" @click="visible = false">
 | 
				
			||||||
 | 
										取消
 | 
				
			||||||
 | 
									</el-button>
 | 
				
			||||||
 | 
									<el-button type="primary" size="mini" @click="changeInput">
 | 
				
			||||||
 | 
										确定
 | 
				
			||||||
 | 
									</el-button>
 | 
				
			||||||
 | 
								</div>
 | 
				
			||||||
 | 
								<el-button type="text" slot="reference">
 | 
				
			||||||
 | 
									<svg-icon icon-class="changelogo" />
 | 
				
			||||||
 | 
								</el-button>
 | 
				
			||||||
 | 
							</el-popover>
 | 
				
			||||||
 | 
							<el-input
 | 
				
			||||||
 | 
								readonly
 | 
				
			||||||
 | 
								v-model="list.processDictName"
 | 
				
			||||||
 | 
								style="width: 50%; margin-left: 5px"></el-input>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { switchLineBindProcess } from '@/api/core/base/lineBindProcess';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						props: {
 | 
				
			||||||
 | 
							injectData: {
 | 
				
			||||||
 | 
								type: Object,
 | 
				
			||||||
 | 
								default: () => ({}),
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								list: this.injectData,
 | 
				
			||||||
 | 
								visible: false,
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						mounted() {
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							changeInput() {
 | 
				
			||||||
 | 
					      const processDictName = this.getDictDatas(this.DICT_TYPE.PROCESS_TYPE).find(item=>
 | 
				
			||||||
 | 
					        item.value == this.list.processDict
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
								const data = {
 | 
				
			||||||
 | 
									id: this.list.id,
 | 
				
			||||||
 | 
									processDict: this.list.processDict,
 | 
				
			||||||
 | 
									processDictName: processDictName.label,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								switchLineBindProcess(data).then((response) => {
 | 
				
			||||||
 | 
									this.$modal.msgSuccess('修改成功');
 | 
				
			||||||
 | 
									this.visible = false;
 | 
				
			||||||
 | 
									this.$emit('emitData');
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					.tableInner .el-input__inner {
 | 
				
			||||||
 | 
						border: none;
 | 
				
			||||||
 | 
						padding: 0;
 | 
				
			||||||
 | 
						height: 33px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
							
								
								
									
										164
									
								
								src/views/core/base/lineBindProcessLog/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,164 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="app-container">
 | 
				
			||||||
 | 
							<search-bar
 | 
				
			||||||
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@select-changed="handleSearchBarChanged"
 | 
				
			||||||
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
							<base-table
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
 | 
								:table-props="tableProps"
 | 
				
			||||||
 | 
								:page="listQuery.pageNo"
 | 
				
			||||||
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
 | 
								:table-data="tableData" />
 | 
				
			||||||
 | 
							<pagination
 | 
				
			||||||
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
 | 
								:total="listQuery.total"
 | 
				
			||||||
 | 
								@pagination="getDataList" />
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import basicPage from '../../mixins/basic-page';
 | 
				
			||||||
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
 | 
					import { getLineBindProcessLogPage } from '@/api/core/base/lineBindProcess';
 | 
				
			||||||
 | 
					import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
				
			||||||
 | 
					import { getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'factoryName',
 | 
				
			||||||
 | 
							label: '工厂'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lineName',
 | 
				
			||||||
 | 
							label: '产线',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'processDictName',
 | 
				
			||||||
 | 
							label: '在制工艺',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'recordTime',
 | 
				
			||||||
 | 
							label: '开始时间',
 | 
				
			||||||
 | 
							filter: parseTime,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						mixins: [basicPage],
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									getDataListURL: getLineBindProcessLogPage,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								optionArrUrl: [getFactoryPage,getProductionLinePage],
 | 
				
			||||||
 | 
								listQuery: {
 | 
				
			||||||
 | 
									productionLineId: [],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产线',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'productionLineId',
 | 
				
			||||||
 | 
										multiple: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '在制工艺',
 | 
				
			||||||
 | 
										selectOptions: this.getDictDatas(this.DICT_TYPE.PROCESS_TYPE),
 | 
				
			||||||
 | 
										labelField: 'label',
 | 
				
			||||||
 | 
										valueField: 'value',
 | 
				
			||||||
 | 
										param: 'processDict',
 | 
				
			||||||
 | 
										defaultSelect: '',
 | 
				
			||||||
 | 
										filterable: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'datePicker',
 | 
				
			||||||
 | 
										label: '时间',
 | 
				
			||||||
 | 
										dateType: 'daterange',
 | 
				
			||||||
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
 | 
										rangeSeparator: '-',
 | 
				
			||||||
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
 | 
										param: 'startTime',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '搜索',
 | 
				
			||||||
 | 
										name: 'search',
 | 
				
			||||||
 | 
										color: 'primary',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '重置',
 | 
				
			||||||
 | 
										name: 'reset',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						components: {},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
							this.getArr();
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
 | 
								this.listQuery.productionLineId = [];
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.productionLineId = undefined;
 | 
				
			||||||
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							getArr() {
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									page: 1,
 | 
				
			||||||
 | 
									limit: 500,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								this.optionArrUrl.forEach((item, index) => {
 | 
				
			||||||
 | 
									item(params).then((response) => {
 | 
				
			||||||
 | 
										this.formConfig[index].selectOptions = response.data.list;
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.listQuery.productionLineId = val.productionLineId || [];
 | 
				
			||||||
 | 
										this.listQuery.processDict = val.processDict;
 | 
				
			||||||
 | 
										this.listQuery.recordTime = val.startTime
 | 
				
			||||||
 | 
											? [val.startTime[0], val.startTime[1].substr(0, 10) + ' 23:59:59']
 | 
				
			||||||
 | 
											: null;
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'reset':
 | 
				
			||||||
 | 
										this.$refs.searchBarForm.resetForm();
 | 
				
			||||||
 | 
										this.listQuery = {
 | 
				
			||||||
 | 
											pageSize: 10,
 | 
				
			||||||
 | 
											pageNo: 1,
 | 
				
			||||||
 | 
											total: 1,
 | 
				
			||||||
 | 
										};
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
							
								
								
									
										53
									
								
								src/views/core/base/lineBindProduct/changeStatus.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: zhp
 | 
				
			||||||
 | 
					 * @Date: 2023-01-31 14:12:10
 | 
				
			||||||
 | 
					 * @LastEditTime: 2024-11-29 10:49:37
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<span>
 | 
				
			||||||
 | 
							<el-switch
 | 
				
			||||||
 | 
								@change="changeStatus"
 | 
				
			||||||
 | 
								v-model="injectData.allowAuto"
 | 
				
			||||||
 | 
								:active-value="true"
 | 
				
			||||||
 | 
								:inactive-value="false"></el-switch>
 | 
				
			||||||
 | 
						</span>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { switchAutoProduct } from '@/api/core/base/lineBindProduct';
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						props: {
 | 
				
			||||||
 | 
							injectData: {
 | 
				
			||||||
 | 
								type: Object,
 | 
				
			||||||
 | 
								default: () => ({}),
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									submitURL: switchAutoProduct,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							// 子级
 | 
				
			||||||
 | 
							changeStatus() {
 | 
				
			||||||
 | 
								// 路由参数
 | 
				
			||||||
 | 
								let obj = {
 | 
				
			||||||
 | 
									allowAuto: this.injectData.allowAuto,
 | 
				
			||||||
 | 
									id: this.injectData.id,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								this.urlOptions.submitURL(obj).then((res) => {
 | 
				
			||||||
 | 
					        console.log(res)
 | 
				
			||||||
 | 
									if (res.code !== 0) {
 | 
				
			||||||
 | 
										return this.$message.error(res.msg);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									this.$modal.msgSuccess('切换状态成功');
 | 
				
			||||||
 | 
									this.$emit('emitData');
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2023-08-02 15:12:42
 | 
					 * @Date: 2023-08-02 15:12:42
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2023-10-13 16:35:03
 | 
					 * @LastEditTime: 2024-11-29 10:47:46
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -30,6 +30,7 @@ import basicPage from '../../mixins/basic-page';
 | 
				
			|||||||
import { parseTime } from '../../mixins/code-filter';
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
import { getLineBindProductPage } from '@/api/core/base/lineBindProduct';
 | 
					import { getLineBindProductPage } from '@/api/core/base/lineBindProduct';
 | 
				
			||||||
import selectProduct from './selectProduct';
 | 
					import selectProduct from './selectProduct';
 | 
				
			||||||
 | 
					import changeStatus from './changeStatus';
 | 
				
			||||||
import { getProductPage } from '@/api/core/base/product';
 | 
					import { getProductPage } from '@/api/core/base/product';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
@@ -43,6 +44,11 @@ const tableProps = [
 | 
				
			|||||||
		list: [],
 | 
							list: [],
 | 
				
			||||||
		subcomponent: selectProduct,
 | 
							subcomponent: selectProduct,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'allowAuto',
 | 
				
			||||||
 | 
							label: '允许自动',
 | 
				
			||||||
 | 
							subcomponent: changeStatus,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'recordTime',
 | 
							prop: 'recordTime',
 | 
				
			||||||
		label: '开始时间',
 | 
							label: '开始时间',
 | 
				
			||||||
@@ -85,7 +91,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
		<search-bar
 | 
							<search-bar
 | 
				
			||||||
			:formConfigs="formConfig"
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
			ref="searchBarForm"
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@select-changed="handleSearchBarChanged"
 | 
				
			||||||
			@headBtnClick="buttonClick" />
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
		<base-table
 | 
							<base-table
 | 
				
			||||||
			v-loading="dataListLoading"
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
@@ -24,15 +25,21 @@ import { parseTime } from '../../mixins/code-filter';
 | 
				
			|||||||
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
 | 
					import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
 | 
				
			||||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
					import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
				
			||||||
import { getProductPage } from '@/api/core/base/product';
 | 
					import { getProductPage } from '@/api/core/base/product';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					import { getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'factoryName',
 | 
				
			||||||
 | 
							label: '工厂'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'productionLineName',
 | 
							prop: 'productionLineName',
 | 
				
			||||||
		label: '产线'
 | 
							label: '产线',
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'productName',
 | 
							prop: 'productName',
 | 
				
			||||||
		label: '在制产品'
 | 
							label: '在制产品',
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'startTime',
 | 
							prop: 'startTime',
 | 
				
			||||||
@@ -55,15 +62,24 @@ export default {
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
			tableProps,
 | 
								tableProps,
 | 
				
			||||||
			tableData: [],
 | 
								tableData: [],
 | 
				
			||||||
			optionArrUrl: [getProductionLinePage, getProductPage],
 | 
								listQuery: {
 | 
				
			||||||
 | 
									productionLineId: [],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								optionArrUrl: [getFactoryPage,getProductionLinePage, getProductPage],
 | 
				
			||||||
			formConfig: [
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
					label: '产线',
 | 
										label: '产线',
 | 
				
			||||||
					selectOptions: [],
 | 
										selectOptions: [],
 | 
				
			||||||
					param: 'productionLineId',
 | 
										param: 'productionLineId',
 | 
				
			||||||
					defaultSelect: '',
 | 
										multiple: true,
 | 
				
			||||||
					filterable: true,
 | 
					 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
@@ -83,7 +99,7 @@ export default {
 | 
				
			|||||||
					startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
					param: 'startTime',
 | 
										param: 'startTime',
 | 
				
			||||||
					valueFormat: 'timestamp'
 | 
										valueFormat: 'timestamp',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
@@ -99,12 +115,18 @@ export default {
 | 
				
			|||||||
			],
 | 
								],
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	components: {
 | 
						components: {},
 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	created() {
 | 
						created() {
 | 
				
			||||||
		this.getArr();
 | 
							this.getArr();
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
 | 
								this.listQuery.productionLineId = [];
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.productionLineId = undefined;
 | 
				
			||||||
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		getArr() {
 | 
							getArr() {
 | 
				
			||||||
			const params = {
 | 
								const params = {
 | 
				
			||||||
				page: 1,
 | 
									page: 1,
 | 
				
			||||||
@@ -120,10 +142,11 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.productionLineId = val.productionLineId;
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.listQuery.productionLineId = val.productionLineId || [];
 | 
				
			||||||
					this.listQuery.productId = val.productId;
 | 
										this.listQuery.productId = val.productId;
 | 
				
			||||||
					this.listQuery.startTime = val.startTime;
 | 
										this.listQuery.startTime = val.startTime ? val.startTime : null;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'reset':
 | 
									case 'reset':
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,19 +72,37 @@
 | 
				
			|||||||
					</el-row>
 | 
										</el-row>
 | 
				
			||||||
					<el-row :gutter="20">
 | 
										<el-row :gutter="20">
 | 
				
			||||||
						<el-col :span="12">
 | 
											<el-col :span="12">
 | 
				
			||||||
							<el-form-item label="规格" prop="specifications">
 | 
												<el-form-item label="原片规格" prop="originalSpecifications">
 | 
				
			||||||
								<el-input
 | 
													<el-input
 | 
				
			||||||
									:disabled="isdetail"
 | 
														:disabled="isdetail"
 | 
				
			||||||
									v-model="dataForm.specifications"
 | 
														v-model="dataForm.originalSpecifications"
 | 
				
			||||||
									placeholder="请输入规格" />
 | 
														placeholder="请输入原片规格" />
 | 
				
			||||||
							</el-form-item>
 | 
												</el-form-item>
 | 
				
			||||||
						</el-col>
 | 
											</el-col>
 | 
				
			||||||
						<el-col :span="12">
 | 
											<el-col :span="12">
 | 
				
			||||||
							<el-form-item label="单位平方数" prop="area">
 | 
												<el-form-item label="原片单位平方数" prop="originalArea">
 | 
				
			||||||
 | 
													<el-input
 | 
				
			||||||
 | 
														:disabled="isdetail"
 | 
				
			||||||
 | 
														v-model="dataForm.originalArea"
 | 
				
			||||||
 | 
														placeholder="请输入原片单位平方数" />
 | 
				
			||||||
 | 
												</el-form-item>
 | 
				
			||||||
 | 
											</el-col>
 | 
				
			||||||
 | 
										</el-row>
 | 
				
			||||||
 | 
										<el-row :gutter="20">
 | 
				
			||||||
 | 
											<el-col :span="12">
 | 
				
			||||||
 | 
												<el-form-item label="深加工规格" prop="specifications">
 | 
				
			||||||
 | 
													<el-input
 | 
				
			||||||
 | 
														:disabled="isdetail"
 | 
				
			||||||
 | 
														v-model="dataForm.specifications"
 | 
				
			||||||
 | 
														placeholder="请输入深加工规格" />
 | 
				
			||||||
 | 
												</el-form-item>
 | 
				
			||||||
 | 
											</el-col>
 | 
				
			||||||
 | 
											<el-col :span="12">
 | 
				
			||||||
 | 
												<el-form-item label="深加工单位平方数" prop="area">
 | 
				
			||||||
								<el-input
 | 
													<el-input
 | 
				
			||||||
									:disabled="isdetail"
 | 
														:disabled="isdetail"
 | 
				
			||||||
									v-model="dataForm.area"
 | 
														v-model="dataForm.area"
 | 
				
			||||||
									placeholder="请输入单位平方数" />
 | 
														placeholder="请输入深加工单位平方数" />
 | 
				
			||||||
							</el-form-item>
 | 
												</el-form-item>
 | 
				
			||||||
						</el-col>
 | 
											</el-col>
 | 
				
			||||||
					</el-row>
 | 
										</el-row>
 | 
				
			||||||
@@ -154,7 +172,9 @@
 | 
				
			|||||||
			<el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
								<el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
				
			||||||
				编辑
 | 
									编辑
 | 
				
			||||||
			</el-button>
 | 
								</el-button>
 | 
				
			||||||
			<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
								<el-button v-else type="primary" @click="dataFormSubmit()">
 | 
				
			||||||
 | 
									确定
 | 
				
			||||||
 | 
								</el-button>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		<product-attr-add
 | 
							<product-attr-add
 | 
				
			||||||
@@ -220,11 +240,13 @@ export default {
 | 
				
			|||||||
				id: null,
 | 
									id: null,
 | 
				
			||||||
				name: '', // 产品名称
 | 
									name: '', // 产品名称
 | 
				
			||||||
				code: '', // 产品编码
 | 
									code: '', // 产品编码
 | 
				
			||||||
				area: 0, // 单位平方数(float only)
 | 
									area: 0, // 深加工单位平方数(float only)
 | 
				
			||||||
				typeDictValue: null, // 产品类型id
 | 
									typeDictValue: null, // 产品类型id
 | 
				
			||||||
				processTime: null, // 单位产品用时 (s)
 | 
									processTime: null, // 单位产品用时 (s)
 | 
				
			||||||
				specifications: '', // 规格
 | 
									specifications: '', // 深加工规格
 | 
				
			||||||
				unitDictValue: '', // 单位id
 | 
									unitDictValue: '', // 单位id
 | 
				
			||||||
 | 
									originalSpecifications: '', // 原片规格
 | 
				
			||||||
 | 
									originalArea: 0, // 原片单位平方数
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			listQuery: {
 | 
								listQuery: {
 | 
				
			||||||
				pageSize: 10,
 | 
									pageSize: 10,
 | 
				
			||||||
@@ -371,8 +393,19 @@ export default {
 | 
				
			|||||||
					// 添加的提交
 | 
										// 添加的提交
 | 
				
			||||||
					createProduct(this.dataForm).then((response) => {
 | 
										createProduct(this.dataForm).then((response) => {
 | 
				
			||||||
						this.$modal.msgSuccess('新增成功');
 | 
											this.$modal.msgSuccess('新增成功');
 | 
				
			||||||
						this.visible = false;
 | 
											this.$confirm(`是否新增产品属性?`, '系统提示', {
 | 
				
			||||||
						this.$emit('refreshDataList');
 | 
												confirmButtonText: '确定',
 | 
				
			||||||
 | 
												cancelButtonText: '取消',
 | 
				
			||||||
 | 
												type: 'warning',
 | 
				
			||||||
 | 
											})
 | 
				
			||||||
 | 
												.then(() => {
 | 
				
			||||||
 | 
					                this.dataForm.id = response.data
 | 
				
			||||||
 | 
													this.addNew();
 | 
				
			||||||
 | 
												})
 | 
				
			||||||
 | 
												.catch(() => {
 | 
				
			||||||
 | 
													this.visible = false;
 | 
				
			||||||
 | 
													this.$emit('refreshDataList');
 | 
				
			||||||
 | 
												});
 | 
				
			||||||
					});
 | 
										});
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
@@ -382,10 +415,14 @@ export default {
 | 
				
			|||||||
		},
 | 
							},
 | 
				
			||||||
		// 新增 / 修改
 | 
							// 新增 / 修改
 | 
				
			||||||
		addNew(id) {
 | 
							addNew(id) {
 | 
				
			||||||
			this.addOrUpdateVisible = true;
 | 
								if (this.dataForm.id) {
 | 
				
			||||||
			this.$nextTick(() => {
 | 
									this.addOrUpdateVisible = true;
 | 
				
			||||||
				this.$refs.addOrUpdate.init(id);
 | 
									this.$nextTick(() => {
 | 
				
			||||||
			});
 | 
										this.$refs.addOrUpdate.init(id);
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									this.$message('请先创建产品!');
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		goback() {
 | 
							goback() {
 | 
				
			||||||
			this.$emit('refreshDataList');
 | 
								this.$emit('refreshDataList');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2023-08-01 14:55:51
 | 
					 * @Date: 2023-08-01 14:55:51
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2023-10-13 10:27:00
 | 
					 * @LastEditTime: 2025-02-24 16:06:59
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -49,27 +49,31 @@ import {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'code',
 | 
							prop: 'createTime',
 | 
				
			||||||
		label: '产品编码'
 | 
							label: '创建时间',
 | 
				
			||||||
 | 
							filter: parseTime
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'name',
 | 
							prop: 'name',
 | 
				
			||||||
		label: '产品名称'
 | 
							label: '产品名称'
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'code',
 | 
				
			||||||
 | 
							label: '产品编码'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'originalSpecifications',
 | 
				
			||||||
 | 
							label: '原片规格'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'specifications',
 | 
							prop: 'specifications',
 | 
				
			||||||
		label: '规格'
 | 
							label: '深加工规格'
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'unitDictValue',
 | 
							prop: 'unitDictValue',
 | 
				
			||||||
		label: '单位',
 | 
							label: '单位',
 | 
				
			||||||
		subcomponent: unitDict,
 | 
							subcomponent: unitDict,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'createTime',
 | 
					 | 
				
			||||||
		label: '创建时间',
 | 
					 | 
				
			||||||
		filter: parseTime
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
@@ -162,7 +166,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
					this.listQuery.code = val.code;
 | 
										this.listQuery.code = val.code;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
 * @Author: zwq
 | 
					 * @Author: zwq
 | 
				
			||||||
 * @Date: 2023-08-01 13:52:10
 | 
					 * @Date: 2023-08-01 13:52:10
 | 
				
			||||||
 * @LastEditors: zwq
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @LastEditTime: 2024-04-10 16:31:51
 | 
					 * @LastEditTime: 2025-02-24 15:32:45
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -12,6 +12,7 @@
 | 
				
			|||||||
		:rules="dataRule"
 | 
							:rules="dataRule"
 | 
				
			||||||
		ref="dataForm"
 | 
							ref="dataForm"
 | 
				
			||||||
		@keyup.enter.native="dataFormSubmit()"
 | 
							@keyup.enter.native="dataFormSubmit()"
 | 
				
			||||||
 | 
					    label-position="top"
 | 
				
			||||||
		label-width="90px">
 | 
							label-width="90px">
 | 
				
			||||||
		<el-row :gutter="20">
 | 
							<el-row :gutter="20">
 | 
				
			||||||
			<el-col :span="12">
 | 
								<el-col :span="12">
 | 
				
			||||||
@@ -48,11 +49,11 @@
 | 
				
			|||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
			<el-col :span="12">
 | 
								<el-col :span="12">
 | 
				
			||||||
				<el-form-item label="产线TT值(h)" prop="tvalue">
 | 
									<el-form-item label="产线理论生产能效(片/min)" prop="tvalue">
 | 
				
			||||||
					<el-input
 | 
										<el-input
 | 
				
			||||||
						v-model="dataForm.tvalue"
 | 
											v-model="dataForm.tvalue"
 | 
				
			||||||
						clearable
 | 
											clearable
 | 
				
			||||||
						placeholder="请输入每小时下片数量" />
 | 
											placeholder="请输入数量" />
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
		</el-row>
 | 
							</el-row>
 | 
				
			||||||
@@ -80,6 +81,17 @@
 | 
				
			|||||||
					</el-select>
 | 
										</el-select>
 | 
				
			||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
 | 
							</el-row>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<el-row>
 | 
				
			||||||
 | 
								<el-col :span="24">
 | 
				
			||||||
 | 
									<el-form-item label="描述" prop="description">
 | 
				
			||||||
 | 
										<el-input
 | 
				
			||||||
 | 
											v-model="dataForm.description"
 | 
				
			||||||
 | 
											type="textarea"
 | 
				
			||||||
 | 
											placeholder="请输入内容" />
 | 
				
			||||||
 | 
									</el-form-item>
 | 
				
			||||||
 | 
								</el-col>
 | 
				
			||||||
			<el-col :span="12">
 | 
								<el-col :span="12">
 | 
				
			||||||
				<el-form-item label="备注" prop="remark">
 | 
									<el-form-item label="备注" prop="remark">
 | 
				
			||||||
					<el-input
 | 
										<el-input
 | 
				
			||||||
@@ -89,17 +101,6 @@
 | 
				
			|||||||
				</el-form-item>
 | 
									</el-form-item>
 | 
				
			||||||
			</el-col>
 | 
								</el-col>
 | 
				
			||||||
		</el-row>
 | 
							</el-row>
 | 
				
			||||||
 | 
					 | 
				
			||||||
		<el-row>
 | 
					 | 
				
			||||||
			<el-col>
 | 
					 | 
				
			||||||
				<el-form-item label="描述" prop="description">
 | 
					 | 
				
			||||||
					<el-input
 | 
					 | 
				
			||||||
						v-model="dataForm.description"
 | 
					 | 
				
			||||||
						type="textarea"
 | 
					 | 
				
			||||||
						placeholder="请输入内容" />
 | 
					 | 
				
			||||||
				</el-form-item>
 | 
					 | 
				
			||||||
			</el-col>
 | 
					 | 
				
			||||||
		</el-row>
 | 
					 | 
				
			||||||
	</el-form>
 | 
						</el-form>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -139,11 +140,11 @@ export default {
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
      pdTypeArr: [
 | 
					      pdTypeArr: [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          id: 0,
 | 
					          id: '0',
 | 
				
			||||||
          name: '深加工'
 | 
					          name: '深加工'
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          id: 1,
 | 
					          id: '1',
 | 
				
			||||||
          name: '原片'
 | 
					          name: '原片'
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      ],
 | 
					      ],
 | 
				
			||||||
@@ -159,6 +160,7 @@ export default {
 | 
				
			|||||||
				],
 | 
									],
 | 
				
			||||||
				tvalue: [
 | 
									tvalue: [
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
 | 
					            required: true,
 | 
				
			||||||
						type: 'number',
 | 
											type: 'number',
 | 
				
			||||||
						message: '请输入正确的数字',
 | 
											message: '请输入正确的数字',
 | 
				
			||||||
						trigger: 'change',
 | 
											trigger: 'change',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,6 +48,7 @@ import {
 | 
				
			|||||||
	exportProductionLineExcel,
 | 
						exportProductionLineExcel,
 | 
				
			||||||
	getStatus,
 | 
						getStatus,
 | 
				
			||||||
} from '@/api/core/base/productionLine';
 | 
					} from '@/api/core/base/productionLine';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@@ -121,6 +122,13 @@ export default {
 | 
				
			|||||||
			].filter((v) => v),
 | 
								].filter((v) => v),
 | 
				
			||||||
			tableData: [],
 | 
								tableData: [],
 | 
				
			||||||
			formConfig: [
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'input',
 | 
										type: 'input',
 | 
				
			||||||
					label: '产线名称',
 | 
										label: '产线名称',
 | 
				
			||||||
@@ -168,7 +176,15 @@ export default {
 | 
				
			|||||||
	components: {
 | 
						components: {
 | 
				
			||||||
		AddOrUpdate,
 | 
							AddOrUpdate,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	created() {},
 | 
						created() {
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		// 获取数据列表
 | 
							// 获取数据列表
 | 
				
			||||||
		getDataList() {
 | 
							getDataList() {
 | 
				
			||||||
@@ -196,7 +212,8 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@
 | 
				
			|||||||
		<search-bar
 | 
							<search-bar
 | 
				
			||||||
			:formConfigs="formConfig"
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
			ref="searchBarForm"
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@select-changed="handleSearchBarChanged"
 | 
				
			||||||
			@headBtnClick="buttonClick" />
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
		<base-table
 | 
							<base-table
 | 
				
			||||||
      v-loading="dataListLoading"
 | 
					      v-loading="dataListLoading"
 | 
				
			||||||
@@ -46,6 +47,8 @@ import {
 | 
				
			|||||||
  getWorkshopSectionPage,
 | 
					  getWorkshopSectionPage,
 | 
				
			||||||
  exportWorkshopSectionExcel
 | 
					  exportWorkshopSectionExcel
 | 
				
			||||||
} from "@/api/core/base/workshopSection";
 | 
					} from "@/api/core/base/workshopSection";
 | 
				
			||||||
 | 
					import { getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@@ -56,6 +59,10 @@ const tableProps = [
 | 
				
			|||||||
		prop: 'name',
 | 
							prop: 'name',
 | 
				
			||||||
		label: '工段名称'
 | 
							label: '工段名称'
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'factoryName',
 | 
				
			||||||
 | 
							label: '工厂'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'productionLineName',
 | 
							prop: 'productionLineName',
 | 
				
			||||||
		label: '产线'
 | 
							label: '产线'
 | 
				
			||||||
@@ -99,8 +106,25 @@ export default {
 | 
				
			|||||||
					  }
 | 
										  }
 | 
				
			||||||
					: undefined,
 | 
										: undefined,
 | 
				
			||||||
			].filter((v)=>v),
 | 
								].filter((v)=>v),
 | 
				
			||||||
 | 
								listQuery: {
 | 
				
			||||||
 | 
									lineId: [],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
			tableData: [],
 | 
								tableData: [],
 | 
				
			||||||
			formConfig: [
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产线',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'lineId',
 | 
				
			||||||
 | 
										multiple: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'input',
 | 
										type: 'input',
 | 
				
			||||||
					label: '工段名称',
 | 
										label: '工段名称',
 | 
				
			||||||
@@ -146,14 +170,37 @@ export default {
 | 
				
			|||||||
	components: {
 | 
						components: {
 | 
				
			||||||
		AddOrUpdate,
 | 
							AddOrUpdate,
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	created() {},
 | 
						created() {
 | 
				
			||||||
 | 
							this.getPdLineList();
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
 | 
							getPdLineList() {
 | 
				
			||||||
 | 
								getPdList().then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
 | 
								this.listQuery.lineId = [];
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.lineId = undefined;
 | 
				
			||||||
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		buttonClick(val) {
 | 
							buttonClick(val) {
 | 
				
			||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.listQuery.lineId = val.lineId || [];
 | 
				
			||||||
					this.getDataList();
 | 
										this.getDataList();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'reset':
 | 
									case 'reset':
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
 * @Author: Do not edit
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 * @Date: 2023-08-29 14:59:29
 | 
					 * @Date: 2023-08-29 14:59:29
 | 
				
			||||||
 * @LastEditTime: 2023-10-16 15:10:42
 | 
					 * @LastEditTime: 2024-12-02 13:59:32
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -92,7 +92,8 @@ const tableProps = [
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outputArea',
 | 
							prop: 'outputArea',
 | 
				
			||||||
		label: '产出面积/㎡'
 | 
							label: '产出面积/㎡',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lossNum',
 | 
							prop: 'lossNum',
 | 
				
			||||||
@@ -100,11 +101,13 @@ const tableProps = [
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lossArea',
 | 
							prop: 'lossArea',
 | 
				
			||||||
		label: '损耗面积/㎡'
 | 
							label: '损耗面积/㎡',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lossRatio',
 | 
							prop: 'lossRatio',
 | 
				
			||||||
		label: '损耗比例%'
 | 
							label: '损耗比例%',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -180,7 +183,6 @@ export default {
 | 
				
			|||||||
          startPlaceholder: '开始时间',
 | 
					          startPlaceholder: '开始时间',
 | 
				
			||||||
          endPlaceholder: '结束时间',
 | 
					          endPlaceholder: '结束时间',
 | 
				
			||||||
          param: 'timeVal',
 | 
					          param: 'timeVal',
 | 
				
			||||||
          defaultSelect: [],
 | 
					 | 
				
			||||||
          width: 350
 | 
					          width: 350
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
@@ -309,11 +311,11 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.lineId = val.line ? val.line : undefined;
 | 
										this.listQuery.lineId = val.line ? val.line : undefined;
 | 
				
			||||||
					this.listQuery.reportType = val.reportType ? val.reportType : undefined;
 | 
										this.listQuery.reportType = val.reportType ? val.reportType : undefined;
 | 
				
			||||||
					this.listQuery.reportStartTime = val.timeVal ? [new Date(val.timeVal[0]).getTime()] : undefined;
 | 
										this.listQuery.reportStartTime = val.timeVal ? [new Date(val.timeVal[0]).getTime(),new Date(val.timeVal[1]).getTime()] : undefined;
 | 
				
			||||||
					this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
 | 
										//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
 | 
				
			||||||
					if (val.timeVal && val.timeVal.length > 0) {
 | 
										if (val.timeVal && val.timeVal.length > 0) {
 | 
				
			||||||
						this.fileName = val.timeVal[0].slice(0, 10) + '-' + val.timeVal[1].slice(0, 10) + '_'
 | 
											this.fileName = val.timeVal[0].slice(0, 10) + '-' + val.timeVal[1].slice(0, 10) + '_'
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										169
									
								
								src/views/core/monitoring/data/BarChart.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,169 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div
 | 
				
			||||||
 | 
							:class="className"
 | 
				
			||||||
 | 
							:style="{ height: height, width: width, marginLeft: '10px' }" />
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import * as echarts from 'echarts';
 | 
				
			||||||
 | 
					require('echarts/theme/macarons'); // echarts theme
 | 
				
			||||||
 | 
					import resize from '@/utils/chartMixins/resize';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const animationDuration = 1000;
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						mixins: [resize],
 | 
				
			||||||
 | 
						props: {
 | 
				
			||||||
 | 
							className: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: 'chart',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							title: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: '',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							width: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: '100%',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							height: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								default: '300px',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							barData: {
 | 
				
			||||||
 | 
								type: Array,
 | 
				
			||||||
 | 
								default: () => [],
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								chart: null,
 | 
				
			||||||
 | 
								targetId: '',
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						beforeDestroy() {
 | 
				
			||||||
 | 
							if (!this.chart) {
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							this.chart.dispose();
 | 
				
			||||||
 | 
							this.chart = null;
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							initChart() {
 | 
				
			||||||
 | 
								this.chart = echarts.init(this.$el, 'macarons');
 | 
				
			||||||
 | 
								const _this = this;
 | 
				
			||||||
 | 
								this.chart.setOption({
 | 
				
			||||||
 | 
									title: {
 | 
				
			||||||
 | 
										text: this.title
 | 
				
			||||||
 | 
											? '{space|}{tip|}{space|}{value|' + this.title + '}'
 | 
				
			||||||
 | 
											: '',
 | 
				
			||||||
 | 
										textStyle: {
 | 
				
			||||||
 | 
											rich: {
 | 
				
			||||||
 | 
												tip: {
 | 
				
			||||||
 | 
													width: 6,
 | 
				
			||||||
 | 
													height: 6,
 | 
				
			||||||
 | 
													borderRadius: 50,
 | 
				
			||||||
 | 
													backgroundColor: '#288AFF',
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												space: {
 | 
				
			||||||
 | 
													width: 8,
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
												value: {
 | 
				
			||||||
 | 
													fontSize: 14,
 | 
				
			||||||
 | 
													color: 'black',
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									color: ['#288AFF', '#8EF0AB', '#FFDC94'],
 | 
				
			||||||
 | 
									tooltip: {
 | 
				
			||||||
 | 
										trigger: 'axis',
 | 
				
			||||||
 | 
										axisPointer: {
 | 
				
			||||||
 | 
											type: 'cross',
 | 
				
			||||||
 | 
											crossStyle: {
 | 
				
			||||||
 | 
												color: '#999',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									legend: {
 | 
				
			||||||
 | 
										data: ['投入', '产出', '加工成品率'],
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									grid: {
 | 
				
			||||||
 | 
										containLabel: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									xAxis: {
 | 
				
			||||||
 | 
										type: 'category',
 | 
				
			||||||
 | 
										data: this.barData.map((item) => {
 | 
				
			||||||
 | 
											return item.lineName;
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										axisPointer: {
 | 
				
			||||||
 | 
											type: 'shadow',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									yAxis: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											type: 'value',
 | 
				
			||||||
 | 
											name: '投入/产出 片',
 | 
				
			||||||
 | 
											min: 0,
 | 
				
			||||||
 | 
											axisLabel: {
 | 
				
			||||||
 | 
												formatter: '{value}',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											type: 'value',
 | 
				
			||||||
 | 
											name: '加工成品率',
 | 
				
			||||||
 | 
											min: 0,
 | 
				
			||||||
 | 
											max: 100,
 | 
				
			||||||
 | 
											interval: 10,
 | 
				
			||||||
 | 
											axisLabel: {
 | 
				
			||||||
 | 
												formatter: '{value} %',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
									series: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '投入',
 | 
				
			||||||
 | 
											type: 'bar',
 | 
				
			||||||
 | 
											barWidth: '20',
 | 
				
			||||||
 | 
											data: this.barData.map((item) => {
 | 
				
			||||||
 | 
												return item.inputNum;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + ' 片';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											animationDuration,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '产出',
 | 
				
			||||||
 | 
											type: 'bar',
 | 
				
			||||||
 | 
											barWidth: '20',
 | 
				
			||||||
 | 
											data: this.barData.map((item) => {
 | 
				
			||||||
 | 
												return item.outputNum;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + ' 片';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											animationDuration,
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											name: '加工成品率',
 | 
				
			||||||
 | 
											type: 'line',
 | 
				
			||||||
 | 
											yAxisIndex: 1,
 | 
				
			||||||
 | 
											tooltip: {
 | 
				
			||||||
 | 
												valueFormatter: function (value) {
 | 
				
			||||||
 | 
													return value + ' %';
 | 
				
			||||||
 | 
												},
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											data: this.barData.map((item) => {
 | 
				
			||||||
 | 
												return item.processingRatio;
 | 
				
			||||||
 | 
											}),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
							
								
								
									
										273
									
								
								src/views/core/monitoring/data/baseTable.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,273 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="baseTable">
 | 
				
			||||||
 | 
							<el-table
 | 
				
			||||||
 | 
								:ref="id"
 | 
				
			||||||
 | 
								:data="renderData"
 | 
				
			||||||
 | 
								v-bind="$attrs"
 | 
				
			||||||
 | 
								:border="cancelBorder ? false : true"
 | 
				
			||||||
 | 
								@current-change="currentChange"
 | 
				
			||||||
 | 
								@selection-change="handleSelectionChange"
 | 
				
			||||||
 | 
								style="width: 100%"
 | 
				
			||||||
 | 
								:header-cell-style="{
 | 
				
			||||||
 | 
									background: '#F2F4F9',
 | 
				
			||||||
 | 
									color: '#606266',
 | 
				
			||||||
 | 
								}">
 | 
				
			||||||
 | 
								<!-- 多选 -->
 | 
				
			||||||
 | 
								<el-table-column
 | 
				
			||||||
 | 
									v-if="selectWidth"
 | 
				
			||||||
 | 
									type="selection"
 | 
				
			||||||
 | 
									:width="selectWidth" />
 | 
				
			||||||
 | 
								<!-- 序号 -->
 | 
				
			||||||
 | 
								<el-table-column
 | 
				
			||||||
 | 
									v-if="page && limit"
 | 
				
			||||||
 | 
									prop="_pageIndex"
 | 
				
			||||||
 | 
									:width="pageWidth"
 | 
				
			||||||
 | 
									align="center"
 | 
				
			||||||
 | 
									:fixed="cancelPageFixed ? false : true">
 | 
				
			||||||
 | 
									<template slot="header">
 | 
				
			||||||
 | 
										<el-popover placement="bottom-start" width="300" trigger="click">
 | 
				
			||||||
 | 
											<div
 | 
				
			||||||
 | 
												class="setting-box"
 | 
				
			||||||
 | 
												style="max-height: 400px; overflow-y: auto">
 | 
				
			||||||
 | 
												<el-checkbox
 | 
				
			||||||
 | 
													v-for="(item, index) in tableProps"
 | 
				
			||||||
 | 
													:key="'cb' + index"
 | 
				
			||||||
 | 
													v-model="selectedBox[index]"
 | 
				
			||||||
 | 
													:label="item.label" />
 | 
				
			||||||
 | 
											</div>
 | 
				
			||||||
 | 
											<i slot="reference" class="el-icon-s-tools" />
 | 
				
			||||||
 | 
										</el-popover>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
								</el-table-column>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<el-table-column
 | 
				
			||||||
 | 
									v-for="item in renderTableHeadList"
 | 
				
			||||||
 | 
									:key="item.prop"
 | 
				
			||||||
 | 
									v-bind="item"
 | 
				
			||||||
 | 
									:label="item.label"
 | 
				
			||||||
 | 
									:prop="item.prop"
 | 
				
			||||||
 | 
									:fixed="item.fixed || false"
 | 
				
			||||||
 | 
									:show-overflow-tooltip="item.showOverflowtooltip || false"
 | 
				
			||||||
 | 
									:sortable="item.sortable || false">
 | 
				
			||||||
 | 
									<template slot="header">
 | 
				
			||||||
 | 
										<span>{{ item.label }}</span>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
									<!-- 多表头 -->
 | 
				
			||||||
 | 
									<template v-if="item.children">
 | 
				
			||||||
 | 
										<el-table-column
 | 
				
			||||||
 | 
											v-for="sub in item.children"
 | 
				
			||||||
 | 
											:prop="sub.prop"
 | 
				
			||||||
 | 
											:key="sub.prop"
 | 
				
			||||||
 | 
											v-bind="sub"
 | 
				
			||||||
 | 
											:label="sub.label">
 | 
				
			||||||
 | 
											<template v-if="sub.children">
 | 
				
			||||||
 | 
												<el-table-column
 | 
				
			||||||
 | 
													v-for="ssub in sub.children"
 | 
				
			||||||
 | 
													:prop="ssub.prop"
 | 
				
			||||||
 | 
													:key="ssub.prop"
 | 
				
			||||||
 | 
													v-bind="ssub"
 | 
				
			||||||
 | 
													:label="ssub.label">
 | 
				
			||||||
 | 
													<template slot-scope="sscopeInner">
 | 
				
			||||||
 | 
														<component
 | 
				
			||||||
 | 
															:is="ssub.subcomponent"
 | 
				
			||||||
 | 
															v-if="ssub.subcomponent"
 | 
				
			||||||
 | 
															:key="sscopeInner.row.id"
 | 
				
			||||||
 | 
															:inject-data="{ ...sscopeInner.row, ...ssub }"
 | 
				
			||||||
 | 
															@emitData="emitData" />
 | 
				
			||||||
 | 
														<span v-else>
 | 
				
			||||||
 | 
															{{ sscopeInner.row[ssub.prop] | commonFilter(ssub.filter) }}
 | 
				
			||||||
 | 
														</span>
 | 
				
			||||||
 | 
													</template>
 | 
				
			||||||
 | 
												</el-table-column>
 | 
				
			||||||
 | 
											</template>
 | 
				
			||||||
 | 
											<template slot-scope="scopeInner">
 | 
				
			||||||
 | 
												<component
 | 
				
			||||||
 | 
													:is="sub.subcomponent"
 | 
				
			||||||
 | 
													v-if="sub.subcomponent"
 | 
				
			||||||
 | 
													:key="scopeInner.row.id"
 | 
				
			||||||
 | 
													:inject-data="{ ...scopeInner.row, ...sub }"
 | 
				
			||||||
 | 
													@emitData="emitData" />
 | 
				
			||||||
 | 
												<span v-else>
 | 
				
			||||||
 | 
													{{ scopeInner.row[sub.prop] | commonFilter(sub.filter) }}
 | 
				
			||||||
 | 
												</span>
 | 
				
			||||||
 | 
											</template>
 | 
				
			||||||
 | 
										</el-table-column>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
									<template slot-scope="scope">
 | 
				
			||||||
 | 
										<component
 | 
				
			||||||
 | 
											:is="item.subcomponent"
 | 
				
			||||||
 | 
											v-if="item.subcomponent"
 | 
				
			||||||
 | 
											:key="scope.row.id"
 | 
				
			||||||
 | 
											:itemProp="item.prop"
 | 
				
			||||||
 | 
											:inject-data="{ ...scope.row, ...item }"
 | 
				
			||||||
 | 
											@emitData="emitData" />
 | 
				
			||||||
 | 
										<span v-else>
 | 
				
			||||||
 | 
											{{ scope.row[item.prop] | commonFilter(item.filter) }}
 | 
				
			||||||
 | 
										</span>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
								</el-table-column>
 | 
				
			||||||
 | 
								<slot name="handleBtn" />
 | 
				
			||||||
 | 
							</el-table>
 | 
				
			||||||
 | 
							<!-- 表格底部加号 -->
 | 
				
			||||||
 | 
							<el-button
 | 
				
			||||||
 | 
								v-if="addButtonShow"
 | 
				
			||||||
 | 
								class="addButton"
 | 
				
			||||||
 | 
								icon="el-icon-plus"
 | 
				
			||||||
 | 
								@click="emitButtonClick">
 | 
				
			||||||
 | 
								{{ addButtonShow }}
 | 
				
			||||||
 | 
							</el-button>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						name: 'BaseTable',
 | 
				
			||||||
 | 
						filters: {
 | 
				
			||||||
 | 
							commonFilter: (source, filterType = (a) => a) => {
 | 
				
			||||||
 | 
								return filterType(source);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						props: {
 | 
				
			||||||
 | 
							cancelBorder: {
 | 
				
			||||||
 | 
								type: Boolean,
 | 
				
			||||||
 | 
								default: false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							cancelPageFixed: {
 | 
				
			||||||
 | 
								type: Boolean,
 | 
				
			||||||
 | 
								default: false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							tableData: {
 | 
				
			||||||
 | 
								type: Array,
 | 
				
			||||||
 | 
								required: true,
 | 
				
			||||||
 | 
								default: () => {
 | 
				
			||||||
 | 
									return [];
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							tableProps: {
 | 
				
			||||||
 | 
								type: Array,
 | 
				
			||||||
 | 
								default: () => {
 | 
				
			||||||
 | 
									return [];
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							id: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: '',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							page: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							pageWidth: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 70,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							limit: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							selectWidth: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							addButtonShow: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: '',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								selectedBox: new Array(100).fill(true),
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						computed: {
 | 
				
			||||||
 | 
							renderTableHeadList() {
 | 
				
			||||||
 | 
								return this.tableProps.filter((item, index) => {
 | 
				
			||||||
 | 
									return this.selectedBox[index];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							renderData() {
 | 
				
			||||||
 | 
								return this.tableData.map((item, index) => {
 | 
				
			||||||
 | 
									return {
 | 
				
			||||||
 | 
										...item,
 | 
				
			||||||
 | 
										_pageIndex: (this.page - 1) * this.limit + index + 1,
 | 
				
			||||||
 | 
									};
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						beforeMount() {
 | 
				
			||||||
 | 
							this.selectedBox = new Array(100).fill(true);
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							currentChange(newVal, oldVal) {
 | 
				
			||||||
 | 
								this.$emit('current-change', { newVal, oldVal });
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleSelectionChange(val) {
 | 
				
			||||||
 | 
								this.$emit('selection-change', val);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							emitData(val) {
 | 
				
			||||||
 | 
								this.$emit('emitFun', val);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							emitButtonClick() {
 | 
				
			||||||
 | 
								this.$emit('emitButtonClick');
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							setCurrent(name, index) {
 | 
				
			||||||
 | 
								let _this = this;
 | 
				
			||||||
 | 
								let obj = _this.$refs[name].data[index];
 | 
				
			||||||
 | 
								_this.$refs[name].setCurrentRow(obj);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							doLayout(name) {
 | 
				
			||||||
 | 
								this.$refs[name].doLayout();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					.baseTable .show-col-btn {
 | 
				
			||||||
 | 
						margin-right: 5px;
 | 
				
			||||||
 | 
						line-height: inherit;
 | 
				
			||||||
 | 
						cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .el-icon-refresh {
 | 
				
			||||||
 | 
						cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
 | 
					<style>
 | 
				
			||||||
 | 
					.baseTable .el-table__body tr.current-row > td.el-table__cell {
 | 
				
			||||||
 | 
						background-color: #eaf1fc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .el-table .el-table__cell {
 | 
				
			||||||
 | 
						padding: 0;
 | 
				
			||||||
 | 
						height: 35px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .addButton {
 | 
				
			||||||
 | 
						width: 100%;
 | 
				
			||||||
 | 
						height: 35px;
 | 
				
			||||||
 | 
						border-top: none;
 | 
				
			||||||
 | 
						color: #0b58ff;
 | 
				
			||||||
 | 
						border-color: #ebeef5;
 | 
				
			||||||
 | 
						border-radius: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .addButton:hover {
 | 
				
			||||||
 | 
						color: #0b58ff;
 | 
				
			||||||
 | 
						border-color: #ebeef5;
 | 
				
			||||||
 | 
						background-color: #fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .addButton:focus {
 | 
				
			||||||
 | 
						border-color: #ebeef5;
 | 
				
			||||||
 | 
						background-color: #fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.el-tooltip__popper.is-dark {
 | 
				
			||||||
 | 
						background: rgba(0, 0, 0, 0.6) !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.el-tooltip__popper .popper__arrow,
 | 
				
			||||||
 | 
					.el-tooltip__popper .popper__arrow::after {
 | 
				
			||||||
 | 
						border-top-color: rgba(0, 0, 0, 0.4) !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
							
								
								
									
										314
									
								
								src/views/core/monitoring/data/index-old.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,314 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 | 
					 * @Date: 2023-08-29 14:59:29
 | 
				
			||||||
 | 
					 * @LastEditTime: 2024-12-02 13:43:57
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="app-container">
 | 
				
			||||||
 | 
							<search-bar
 | 
				
			||||||
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
							<base-table
 | 
				
			||||||
 | 
								v-if="showData.length"
 | 
				
			||||||
 | 
								class="right-aside"
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
 | 
								:table-props="tableProps"
 | 
				
			||||||
 | 
								:page="listQuery.pageNo"
 | 
				
			||||||
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
 | 
								:selectWidth="55"
 | 
				
			||||||
 | 
								:table-data="showData"
 | 
				
			||||||
 | 
								@selection-change="selectChange"
 | 
				
			||||||
 | 
								>
 | 
				
			||||||
 | 
								<method-btn
 | 
				
			||||||
 | 
									v-if="tableBtn.length"
 | 
				
			||||||
 | 
									slot="handleBtn"
 | 
				
			||||||
 | 
									:width="120"
 | 
				
			||||||
 | 
									label="操作"
 | 
				
			||||||
 | 
									:method-list="tableBtn"
 | 
				
			||||||
 | 
									@clickBtn="handleClick" />
 | 
				
			||||||
 | 
							</base-table>
 | 
				
			||||||
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
 | 
							<pagination
 | 
				
			||||||
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
 | 
								:total="listQuery.total"
 | 
				
			||||||
 | 
								@pagination="getDataList" />
 | 
				
			||||||
 | 
							<el-dialog
 | 
				
			||||||
 | 
								title="提示"
 | 
				
			||||||
 | 
								:visible.sync="dialogVisible"
 | 
				
			||||||
 | 
								width="30%"
 | 
				
			||||||
 | 
								:before-close="handleClose">
 | 
				
			||||||
 | 
								<el-button type="primary" @click="exportXlsx">xlsx</el-button>
 | 
				
			||||||
 | 
					  		<el-button type="success" @click="exportPdf">pdf</el-button>
 | 
				
			||||||
 | 
								<span slot="footer" class="dialog-footer">
 | 
				
			||||||
 | 
									<el-button @click="dialogVisible = false">取 消</el-button>
 | 
				
			||||||
 | 
									<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
 | 
				
			||||||
 | 
								</span>
 | 
				
			||||||
 | 
							</el-dialog>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { getPdlDataSearch, getPdList } from '@/api/core/monitoring/data'
 | 
				
			||||||
 | 
					import * as XLSX from 'xlsx'
 | 
				
			||||||
 | 
					import FileSaver from 'file-saver'
 | 
				
			||||||
 | 
					import jsPDF from 'jspdf'
 | 
				
			||||||
 | 
					import html2canvas from 'html2canvas'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'proLineName',
 | 
				
			||||||
 | 
							label: '产线名称'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'inputNum',
 | 
				
			||||||
 | 
							label: '投入数量/片'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputNum',
 | 
				
			||||||
 | 
							label: '产出数量/片'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputArea',
 | 
				
			||||||
 | 
							label: '产出面积/㎡',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossNum',
 | 
				
			||||||
 | 
							label: '损耗数量/片'
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossArea',
 | 
				
			||||||
 | 
							label: '损耗面积/㎡',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossRate',
 | 
				
			||||||
 | 
							label: '损耗比例%',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									getDataListURL: getPdlDataSearch
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
					      tableData: [],
 | 
				
			||||||
 | 
					      listQuery: {
 | 
				
			||||||
 | 
					        pageSize: 10,
 | 
				
			||||||
 | 
					        pageNo: 1,
 | 
				
			||||||
 | 
					        total: 1,
 | 
				
			||||||
 | 
									proLineId: undefined
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      exportLoading: false,
 | 
				
			||||||
 | 
					      dataListLoading: false,
 | 
				
			||||||
 | 
								dialogVisible: false,
 | 
				
			||||||
 | 
					      addOrEditTitle: '',
 | 
				
			||||||
 | 
					      addOrUpdateVisible: false,
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
 | 
								tableBtn: [],
 | 
				
			||||||
 | 
								showData: [],
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								selectedList: [],
 | 
				
			||||||
 | 
								fileName: '',
 | 
				
			||||||
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产线',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
					          param: 'line'
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
					          type: 'datePicker',
 | 
				
			||||||
 | 
					          label: '时间范围',
 | 
				
			||||||
 | 
					          dateType: 'datetimerange',
 | 
				
			||||||
 | 
					          format: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
 | 
					          valueFormat: "yyyy-MM-ddTHH:mm:ss",
 | 
				
			||||||
 | 
					          rangeSeparator: '-',
 | 
				
			||||||
 | 
					          startPlaceholder: '开始时间',
 | 
				
			||||||
 | 
					          endPlaceholder: '结束时间',
 | 
				
			||||||
 | 
					          param: 'timeVal',
 | 
				
			||||||
 | 
					          defaultSelect: [],
 | 
				
			||||||
 | 
					          width: 350
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '查询',
 | 
				
			||||||
 | 
										name: 'search',
 | 
				
			||||||
 | 
										color: 'primary',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'separate',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '导出',
 | 
				
			||||||
 | 
										name: 'export',
 | 
				
			||||||
 | 
										color: 'warning',
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
							if (this.$route.params.startTime) {
 | 
				
			||||||
 | 
								this.formConfig[1].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							// const time = new Date()
 | 
				
			||||||
 | 
							// this.formConfig[1].defaultSelect = [time, time]
 | 
				
			||||||
 | 
							this.getDataList()
 | 
				
			||||||
 | 
							this.getPdLineList()
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							test() {
 | 
				
			||||||
 | 
								var target = document.getElementsByClassName("right-aside")[0]
 | 
				
			||||||
 | 
								target.style.background = '#FFFFFF'
 | 
				
			||||||
 | 
								var that = this
 | 
				
			||||||
 | 
								setTimeout(() => {
 | 
				
			||||||
 | 
									html2canvas(target).then(function(canvas) {
 | 
				
			||||||
 | 
											var contentWidth = canvas.width
 | 
				
			||||||
 | 
											var contentHeight = canvas.height
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											// 一页pdf显示html页面生成的canvas高度
 | 
				
			||||||
 | 
											var pageHeight = contentHeight / 592.28 * 841.89
 | 
				
			||||||
 | 
											// 未生成pdf的html页面高度
 | 
				
			||||||
 | 
											var leftHeight = contentHeight
 | 
				
			||||||
 | 
											// 页面偏移
 | 
				
			||||||
 | 
											var position = 0
 | 
				
			||||||
 | 
											// a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的高度
 | 
				
			||||||
 | 
											var imgWidth = 595.28
 | 
				
			||||||
 | 
											var imgHeight = 592.28 / contentWidth * contentHeight
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											var pageData = canvas.toDataURL('image/jpeg', 1.0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											console.log('nihc URL', leftHeight, pageHeight)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											var pdf = new jsPDF('', 'pt', 'a4')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											if (leftHeight < pageHeight) {
 | 
				
			||||||
 | 
												pdf.addImage(pageData, 'JPEG', 0, 20, imgWidth, imgHeight)
 | 
				
			||||||
 | 
											} else {
 | 
				
			||||||
 | 
												while(leftHeight > 0) {
 | 
				
			||||||
 | 
													pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
 | 
				
			||||||
 | 
													leftHeight -= pageHeight
 | 
				
			||||||
 | 
													position -= 841.89
 | 
				
			||||||
 | 
													// 避免空白页
 | 
				
			||||||
 | 
													if (leftHeight > 0) {
 | 
				
			||||||
 | 
														pdf.addPage()
 | 
				
			||||||
 | 
													}
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											pdf.save(that.fileName + '产线产量.pdf')
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
 | 
								}, 300)
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							exportECL() {
 | 
				
			||||||
 | 
								let tables = document.querySelector('.el-table').cloneNode(true)
 | 
				
			||||||
 | 
								const fix = tables.querySelector('.el-table__fixed')
 | 
				
			||||||
 | 
								const fixRight = tables.querySelector('.el-table__fixed-right')
 | 
				
			||||||
 | 
								if (fix) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed'))
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (fixRight) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed-right'))
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								let exportTable = XLSX.utils.table_to_book(tables)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      var exportTableOut = XLSX.write(exportTable, {
 | 
				
			||||||
 | 
					        bookType: 'xlsx', bookSST: true, type: 'array'
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					      // sheetjs.xlsx为导出表格的标题名称
 | 
				
			||||||
 | 
					      try {
 | 
				
			||||||
 | 
					        FileSaver.saveAs(new Blob([exportTableOut], {
 | 
				
			||||||
 | 
					          type: 'application/octet-stream'
 | 
				
			||||||
 | 
					        }), this.fileName + '产线产量.xlsx')
 | 
				
			||||||
 | 
					      } catch (e) {
 | 
				
			||||||
 | 
					        if (typeof console !== 'undefined') console.log(e, exportTableOut)
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      return exportTableOut
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
							exportPdf() {
 | 
				
			||||||
 | 
								this.test()
 | 
				
			||||||
 | 
								setTimeout(() =>{
 | 
				
			||||||
 | 
									this.dialogVisible = false
 | 
				
			||||||
 | 
									this.showData = this.tableData
 | 
				
			||||||
 | 
								}, 600)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							exportXlsx() {
 | 
				
			||||||
 | 
								this.exportECL()
 | 
				
			||||||
 | 
								this.dialogVisible = false
 | 
				
			||||||
 | 
								this.showData = this.tableData
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleClose(done) {
 | 
				
			||||||
 | 
								this.$confirm('确认关闭?')
 | 
				
			||||||
 | 
									.then(_ => {
 | 
				
			||||||
 | 
										done();
 | 
				
			||||||
 | 
									})
 | 
				
			||||||
 | 
									.catch(_ => {});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							getPdLineList() {
 | 
				
			||||||
 | 
								getPdList().then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data || []
 | 
				
			||||||
 | 
								})
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							selectChange(val) {
 | 
				
			||||||
 | 
					      console.log(val)
 | 
				
			||||||
 | 
					      this.selectedList = val
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.listQuery.proLineId = val.line ? val.line : undefined;
 | 
				
			||||||
 | 
										this.listQuery.startTime = val.timeVal ? new Date(val.timeVal[0]).getTime() : undefined;
 | 
				
			||||||
 | 
										this.listQuery.endTime = val.timeVal ? new Date(val.timeVal[1]).getTime() : undefined;
 | 
				
			||||||
 | 
										if (val.timeVal && val.timeVal.length > 0) {
 | 
				
			||||||
 | 
											this.fileName = val.timeVal[0].slice(0, 10) + '-' + val.timeVal[1].slice(0, 10) + '_'
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'export':
 | 
				
			||||||
 | 
										this.handleExport();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 获取数据列表
 | 
				
			||||||
 | 
					    getDataList() {
 | 
				
			||||||
 | 
					      this.dataListLoading = true;
 | 
				
			||||||
 | 
					      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
				
			||||||
 | 
					        this.tableData = response.data;
 | 
				
			||||||
 | 
					        this.listQuery.total = response.data.length;
 | 
				
			||||||
 | 
					        this.dataListLoading = false;
 | 
				
			||||||
 | 
									this.showData = this.tableData
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 每页数
 | 
				
			||||||
 | 
					    sizeChangeHandle(val) {
 | 
				
			||||||
 | 
					      this.listQuery.pageSize = val;
 | 
				
			||||||
 | 
					      this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
					      this.getDataList();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    // 当前页
 | 
				
			||||||
 | 
					    currentChangeHandle(val) {
 | 
				
			||||||
 | 
					      this.listQuery.pageNo = val;
 | 
				
			||||||
 | 
					      this.getDataList();
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
							handleExport() {
 | 
				
			||||||
 | 
								if (this.selectedList.length > 0) {
 | 
				
			||||||
 | 
									this.showData = this.selectedList
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								this.dialogVisible = true
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
@@ -1,138 +1,304 @@
 | 
				
			|||||||
<!--
 | 
					 | 
				
			||||||
 * @Author: Do not edit
 | 
					 | 
				
			||||||
 * @Date: 2023-08-29 14:59:29
 | 
					 | 
				
			||||||
 * @LastEditTime: 2023-10-16 15:18:23
 | 
					 | 
				
			||||||
 * @LastEditors: DY
 | 
					 | 
				
			||||||
 * @Description:
 | 
					 | 
				
			||||||
-->
 | 
					 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
	<div class="app-container">
 | 
					  <div>
 | 
				
			||||||
		<search-bar
 | 
					    <div style="background: #f2f4f9; height: 40px; width: 100%">
 | 
				
			||||||
			:formConfigs="formConfig"
 | 
					      <ButtonNav :menus="['当前', '历史']" @change="currentMenu" v-model="activeName">
 | 
				
			||||||
			ref="searchBarForm"
 | 
					        <!-- <template v-slot:tab1>
 | 
				
			||||||
			@headBtnClick="buttonClick" />
 | 
					          <div>当前</div>
 | 
				
			||||||
		<base-table
 | 
					        </template>
 | 
				
			||||||
			v-if="showData.length"
 | 
					        <template v-slot:tab2>
 | 
				
			||||||
			class="right-aside"
 | 
					          <div>历史</div>
 | 
				
			||||||
			v-loading="dataListLoading"
 | 
					        </template> -->
 | 
				
			||||||
			:table-props="tableProps"
 | 
					      </ButtonNav>
 | 
				
			||||||
			:page="listQuery.pageNo"
 | 
					    </div>
 | 
				
			||||||
			:limit="listQuery.pageSize"
 | 
					    <div class="app-container energyOverlimitLog">
 | 
				
			||||||
			:selectWidth="55"
 | 
					      <div v-if="activeName === '历史' && routeType !== 'order'">
 | 
				
			||||||
			:table-data="showData"
 | 
					        <!-- 搜索工作栏 -->
 | 
				
			||||||
			@selection-change="selectChange"
 | 
					        <search-bar :formConfigs="formConfig" ref="searchBarForm" @select-changed="handleSearchBarChanged"
 | 
				
			||||||
			>
 | 
					          @headBtnClick="buttonClick" />
 | 
				
			||||||
			<method-btn
 | 
					      </div>
 | 
				
			||||||
				v-if="tableBtn.length"
 | 
					      <h2 v-else>
 | 
				
			||||||
				slot="handleBtn"
 | 
					        订单名称:{{ name }}
 | 
				
			||||||
				:width="120"
 | 
					        订单编码:{{ code }}
 | 
				
			||||||
				label="操作"
 | 
					        <el-button    v-hasPermi="['base:core-work-order:export']" type="primary" @click="handleExport">导出</el-button>
 | 
				
			||||||
				:method-list="tableBtn"
 | 
					      </h2>
 | 
				
			||||||
				@clickBtn="handleClick" />
 | 
					      <div v-show="activeName === '当前'"></div>
 | 
				
			||||||
		</base-table>
 | 
					      <!-- 列表 -->
 | 
				
			||||||
		<div v-else class="no-data-bg"></div>
 | 
					      <div v-if="activeName === '历史'">
 | 
				
			||||||
		<pagination
 | 
					        <base-table-s :page="1" :limit="100" :table-props="tableProps" :table-data="tableData"
 | 
				
			||||||
			:limit.sync="listQuery.pageSize"
 | 
					          :max-height="tableH / 2"></base-table-s>
 | 
				
			||||||
			:page.sync="listQuery.pageNo"
 | 
					        <div v-if="listQuery.lineId.length !== 1 && tableData.length > 0">
 | 
				
			||||||
			:total="listQuery.total"
 | 
					          <barChart style="margin-top: 50px" ref="barChart" height="600px" :bar-data="tableData" />
 | 
				
			||||||
			@pagination="getDataList" />
 | 
					        </div>
 | 
				
			||||||
		<el-dialog
 | 
					      </div>
 | 
				
			||||||
			title="提示"
 | 
					      <div v-if="activeName === '当前'">
 | 
				
			||||||
			:visible.sync="dialogVisible"
 | 
					        <span class="blue-block"></span>
 | 
				
			||||||
			width="30%"
 | 
					        <span class="tip">当班数据</span>
 | 
				
			||||||
			:before-close="handleClose">
 | 
					        <base-table-s :page="1" :limit="100" :table-props="tableProps" :table-data="tableData2"
 | 
				
			||||||
			<el-button type="primary" @click="exportXlsx">xlsx</el-button>
 | 
					          :max-height="tableH / 2" />
 | 
				
			||||||
  		<el-button type="success" @click="exportPdf">pdf</el-button>
 | 
					        <span class="blue-block"></span>
 | 
				
			||||||
			<span slot="footer" class="dialog-footer">
 | 
					        <span class="tip">当天数据</span>
 | 
				
			||||||
				<el-button @click="dialogVisible = false">取 消</el-button>
 | 
					        <base-table-s :page="1" :limit="100" :table-props="tableProps" :table-data="tableData3"
 | 
				
			||||||
				<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
 | 
					          :max-height="tableH / 2" />
 | 
				
			||||||
			</span>
 | 
					      </div>
 | 
				
			||||||
		</el-dialog>
 | 
					    </div>
 | 
				
			||||||
	</div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import { getPdlDataSearch, getPdList } from '@/api/core/monitoring/data'
 | 
					import {
 | 
				
			||||||
import * as XLSX from 'xlsx'
 | 
						getPdlAutoReportNewSearch,
 | 
				
			||||||
import FileSaver from 'file-saver'
 | 
						getPdlAutoReportNewSearchNow,
 | 
				
			||||||
import jsPDF from 'jspdf'
 | 
					} from '@/api/core/monitoring/data';
 | 
				
			||||||
import html2canvas from 'html2canvas'
 | 
					import { getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
				
			||||||
 | 
					import ButtonNav from '@/components/ButtonNav';
 | 
				
			||||||
 | 
					import baseTableS from './baseTable.vue';
 | 
				
			||||||
 | 
					import barChart from './BarChart.vue';
 | 
				
			||||||
 | 
					import * as XLSX from 'xlsx';
 | 
				
			||||||
 | 
					import FileSaver from 'file-saver';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'proLineName',
 | 
							prop: 'factoryName',
 | 
				
			||||||
		label: '产线名称'
 | 
							label: '工厂',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'inputNum',
 | 
							prop: 'lineName',
 | 
				
			||||||
		label: '投入数量/片'
 | 
							label: '产线',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outputNum',
 | 
							prop: 'sizes',
 | 
				
			||||||
		label: '产出数量/片'
 | 
							label: '规格',
 | 
				
			||||||
 | 
							width: 105,
 | 
				
			||||||
 | 
							showOverflowtooltip: true,
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'outputArea',
 | 
					 | 
				
			||||||
		label: '产出面积/㎡'
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'lossNum',
 | 
					 | 
				
			||||||
		label: '损耗数量/片'
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'lossArea',
 | 
					 | 
				
			||||||
		label: '损耗面积/㎡'
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'lossRate',
 | 
					 | 
				
			||||||
		label: '损耗比例%'
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'inputN',
 | 
				
			||||||
 | 
							label: '投入',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'inputNum',
 | 
				
			||||||
 | 
									label: '投入数量/片',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'inputArea',
 | 
				
			||||||
 | 
									label: '投入面积/m²',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputN',
 | 
				
			||||||
 | 
							label: '产出',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'outputNum',
 | 
				
			||||||
 | 
									label: '产出数量/片',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'outputArea',
 | 
				
			||||||
 | 
									label: '产出面积/㎡',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossN',
 | 
				
			||||||
 | 
							label: '不良',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'lossNum',
 | 
				
			||||||
 | 
									label: '不良数量/片',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'lossArea',
 | 
				
			||||||
 | 
									label: '不良面积/㎡',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossRatio',
 | 
				
			||||||
 | 
							label: '不良率/%',
 | 
				
			||||||
 | 
							filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputRatio',
 | 
				
			||||||
 | 
							label: '投入产出率/%',
 | 
				
			||||||
 | 
							filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'processingRatio',
 | 
				
			||||||
 | 
							label: '加工成品率/%',
 | 
				
			||||||
 | 
							filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossD',
 | 
				
			||||||
 | 
							label: '不良详情',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'original',
 | 
				
			||||||
 | 
									label: '原片',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'originalLossNum',
 | 
				
			||||||
 | 
											label: '原片不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'originalLossArea',
 | 
				
			||||||
 | 
											label: '原片不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'edge',
 | 
				
			||||||
 | 
									label: '磨边',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'edgeLossNum',
 | 
				
			||||||
 | 
											label: '磨边不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'edgeLossArea',
 | 
				
			||||||
 | 
											label: '磨边不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'drill',
 | 
				
			||||||
 | 
									label: '打孔',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'drillLossNum',
 | 
				
			||||||
 | 
											label: '打孔不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'drillLossArea',
 | 
				
			||||||
 | 
											label: '打孔不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'coating',
 | 
				
			||||||
 | 
									label: '镀膜',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'coatingLossNum',
 | 
				
			||||||
 | 
											label: '镀膜不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'coatingLossArea',
 | 
				
			||||||
 | 
											label: '镀膜不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'silk',
 | 
				
			||||||
 | 
									label: '丝印',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'silkLossNum',
 | 
				
			||||||
 | 
											label: '丝印不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'silkLossArea',
 | 
				
			||||||
 | 
											label: '丝印不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'tempering',
 | 
				
			||||||
 | 
									label: '钢化',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'temperingLossNum',
 | 
				
			||||||
 | 
											label: '钢化不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'temperingLossArea',
 | 
				
			||||||
 | 
											label: '钢化不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'packing',
 | 
				
			||||||
 | 
									label: '包装',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'packingLossNum',
 | 
				
			||||||
 | 
											label: '包装不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'packingLossArea',
 | 
				
			||||||
 | 
											label: '包装不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
 | 
						name: '',
 | 
				
			||||||
 | 
						mixins: [tableHeightMixin],
 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			urlOptions: {
 | 
								urlOptions: {
 | 
				
			||||||
				getDataListURL: getPdlDataSearch
 | 
									getDataListURL: getPdlAutoReportNewSearch,
 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
      tableData: [],
 | 
					 | 
				
			||||||
      listQuery: {
 | 
					 | 
				
			||||||
        pageSize: 10,
 | 
					 | 
				
			||||||
        pageNo: 1,
 | 
					 | 
				
			||||||
        total: 1,
 | 
					 | 
				
			||||||
				proLineId: undefined
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      exportLoading: false,
 | 
					      routeType: 'line',
 | 
				
			||||||
      dataListLoading: false,
 | 
					      code: '',
 | 
				
			||||||
			dialogVisible: false,
 | 
					      name:'',
 | 
				
			||||||
      addOrEditTitle: '',
 | 
					 | 
				
			||||||
      addOrUpdateVisible: false,
 | 
					 | 
				
			||||||
			tableProps,
 | 
					 | 
				
			||||||
			tableBtn: [],
 | 
					 | 
				
			||||||
			showData: [],
 | 
					 | 
				
			||||||
			tableData: [],
 | 
					 | 
				
			||||||
			selectedList: [],
 | 
					 | 
				
			||||||
			fileName: '',
 | 
					 | 
				
			||||||
			formConfig: [
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
					label: '产线',
 | 
										label: '产线',
 | 
				
			||||||
					selectOptions: [],
 | 
										selectOptions: [],
 | 
				
			||||||
          param: 'line'
 | 
										param: 'lineId',
 | 
				
			||||||
 | 
					          multiple: true,
 | 
				
			||||||
 | 
					          defaultSelect:[]
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
          type: 'datePicker',
 | 
										type: 'datePicker',
 | 
				
			||||||
          label: '时间范围',
 | 
										label: '时间范围',
 | 
				
			||||||
          dateType: 'datetimerange',
 | 
										dateType: 'daterange',
 | 
				
			||||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
          valueFormat: "yyyy-MM-ddTHH:mm:ss",
 | 
										valueFormat: 'timestamp',
 | 
				
			||||||
          rangeSeparator: '-',
 | 
										rangeSeparator: '-',
 | 
				
			||||||
          startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
          endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
          param: 'timeVal',
 | 
					          param: 'timeVal',
 | 
				
			||||||
          defaultSelect: [],
 | 
					          defaultSelect:[],
 | 
				
			||||||
          width: 350
 | 
										width: 350,
 | 
				
			||||||
        },
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
					btnName: '查询',
 | 
										btnName: '查询',
 | 
				
			||||||
@@ -143,134 +309,78 @@ export default {
 | 
				
			|||||||
					type: 'separate',
 | 
										type: 'separate',
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
 | 
					          type: this.$auth.hasPermi('|base:core-work-order:export') ? 'button' : '',
 | 
				
			||||||
					type: 'button',
 | 
										// type: 'button',
 | 
				
			||||||
					btnName: '导出',
 | 
										btnName: '导出',
 | 
				
			||||||
					name: 'export',
 | 
										name: 'export',
 | 
				
			||||||
					color: 'warning',
 | 
										color: 'warning',
 | 
				
			||||||
				}
 | 
									},
 | 
				
			||||||
			],
 | 
								],
 | 
				
			||||||
 | 
								listQuery: {
 | 
				
			||||||
 | 
									lineId: [],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
					      activeName: '当前',
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								tableData2: [],
 | 
				
			||||||
 | 
								tableData3: [],
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	created() {
 | 
						components: {
 | 
				
			||||||
		if (this.$route.params.startTime) {
 | 
							ButtonNav,
 | 
				
			||||||
			this.formConfig[1].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
 | 
							baseTableS,
 | 
				
			||||||
		}
 | 
							barChart,
 | 
				
			||||||
		// const time = new Date()
 | 
					 | 
				
			||||||
		// this.formConfig[1].defaultSelect = [time, time]
 | 
					 | 
				
			||||||
		this.getDataList()
 | 
					 | 
				
			||||||
		this.getPdLineList()
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						mounted() {
 | 
				
			||||||
		test() {
 | 
					    this.getPdLineList()
 | 
				
			||||||
			var target = document.getElementsByClassName("right-aside")[0]
 | 
					    this.$nextTick(() => {
 | 
				
			||||||
			target.style.background = '#FFFFFF'
 | 
					      const tab = this.$route.query.tab; // 获取路由参数
 | 
				
			||||||
			var that = this
 | 
					      console.log(this.$route.query);
 | 
				
			||||||
			setTimeout(() => {
 | 
					      this.routeType = this.$route.query.buttonType === 'order' ? 'order' : 'line'
 | 
				
			||||||
				html2canvas(target).then(function(canvas) {
 | 
					      this.code = this.$route.query.code
 | 
				
			||||||
						var contentWidth = canvas.width
 | 
					      this.name = this.$route.query.name
 | 
				
			||||||
						var contentHeight = canvas.height
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
						// 一页pdf显示html页面生成的canvas高度
 | 
					      if (tab === 'his') {
 | 
				
			||||||
						var pageHeight = contentHeight / 592.28 * 841.89
 | 
					        // 路由参数为 his 时,切换到“历史”标签
 | 
				
			||||||
						// 未生成pdf的html页面高度
 | 
					        this.activeName = '历史'; // 注意:这里直接传标签名('历史'),不是'his'
 | 
				
			||||||
						var leftHeight = contentHeight
 | 
					        this.formConfig[1].defaultSelect = this.$route.query.lineId
 | 
				
			||||||
						// 页面偏移
 | 
					        this.formConfig[2].defaultSelect[0] = this.$route.query.startProduceTime
 | 
				
			||||||
						var position = 0
 | 
					        this.formConfig[2].defaultSelect[1] = this.$route.query.finishProduceTime
 | 
				
			||||||
						// a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的高度
 | 
					        // this.buttonClick()
 | 
				
			||||||
						var imgWidth = 595.28
 | 
					        this.listQuery.lineId = this.$route.query.lineId
 | 
				
			||||||
						var imgHeight = 592.28 / contentWidth * contentHeight
 | 
					      } else {
 | 
				
			||||||
 | 
					        this.activeName = '当前'; // 默认“当前”标签
 | 
				
			||||||
						var pageData = canvas.toDataURL('image/jpeg', 1.0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						console.log('nihc URL', leftHeight, pageHeight)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						var pdf = new jsPDF('', 'pt', 'a4')
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						if (leftHeight < pageHeight) {
 | 
					 | 
				
			||||||
							pdf.addImage(pageData, 'JPEG', 0, 20, imgWidth, imgHeight)
 | 
					 | 
				
			||||||
						} else {
 | 
					 | 
				
			||||||
							while(leftHeight > 0) {
 | 
					 | 
				
			||||||
								pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
 | 
					 | 
				
			||||||
								leftHeight -= pageHeight
 | 
					 | 
				
			||||||
								position -= 841.89
 | 
					 | 
				
			||||||
								// 避免空白页
 | 
					 | 
				
			||||||
								if (leftHeight > 0) {
 | 
					 | 
				
			||||||
									pdf.addPage()
 | 
					 | 
				
			||||||
								}
 | 
					 | 
				
			||||||
							}
 | 
					 | 
				
			||||||
						}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
						pdf.save(that.fileName + '产线产量.pdf')
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
			}, 300)
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		exportECL() {
 | 
					 | 
				
			||||||
			let tables = document.querySelector('.el-table').cloneNode(true)
 | 
					 | 
				
			||||||
			const fix = tables.querySelector('.el-table__fixed')
 | 
					 | 
				
			||||||
			const fixRight = tables.querySelector('.el-table__fixed-right')
 | 
					 | 
				
			||||||
			if (fix) {
 | 
					 | 
				
			||||||
				tables.removeChild(tables.querySelector('.el-table__fixed'))
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if (fixRight) {
 | 
					 | 
				
			||||||
				tables.removeChild(tables.querySelector('.el-table__fixed-right'))
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			let exportTable = XLSX.utils.table_to_book(tables)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      var exportTableOut = XLSX.write(exportTable, {
 | 
					 | 
				
			||||||
        bookType: 'xlsx', bookSST: true, type: 'array'
 | 
					 | 
				
			||||||
      })
 | 
					 | 
				
			||||||
      // sheetjs.xlsx为导出表格的标题名称
 | 
					 | 
				
			||||||
      try {
 | 
					 | 
				
			||||||
        FileSaver.saveAs(new Blob([exportTableOut], {
 | 
					 | 
				
			||||||
          type: 'application/octet-stream'
 | 
					 | 
				
			||||||
        }), this.fileName + '产线产量.xlsx')
 | 
					 | 
				
			||||||
      } catch (e) {
 | 
					 | 
				
			||||||
        if (typeof console !== 'undefined') console.log(e, exportTableOut)
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return exportTableOut
 | 
					    })
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		exportPdf() {
 | 
					 | 
				
			||||||
			this.test()
 | 
					 | 
				
			||||||
			setTimeout(() =>{
 | 
					 | 
				
			||||||
				this.dialogVisible = false
 | 
					 | 
				
			||||||
				this.showData = this.tableData
 | 
					 | 
				
			||||||
			}, 600)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		},
 | 
					
 | 
				
			||||||
		exportXlsx() {
 | 
					  // ... 其他方法 ...
 | 
				
			||||||
			this.exportECL()
 | 
					  },
 | 
				
			||||||
			this.dialogVisible = false
 | 
					  methods: {
 | 
				
			||||||
			this.showData = this.tableData
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		handleClose(done) {
 | 
					 | 
				
			||||||
			this.$confirm('确认关闭?')
 | 
					 | 
				
			||||||
				.then(_ => {
 | 
					 | 
				
			||||||
					done();
 | 
					 | 
				
			||||||
				})
 | 
					 | 
				
			||||||
				.catch(_ => {});
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		getPdLineList() {
 | 
							getPdLineList() {
 | 
				
			||||||
			getPdList().then((res) => {
 | 
								getPdList().then((res) => {
 | 
				
			||||||
				this.formConfig[0].selectOptions = res.data || []
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
			})
 | 
								});
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		selectChange(val) {
 | 
					 | 
				
			||||||
      console.log(val)
 | 
					 | 
				
			||||||
      this.selectedList = val
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		buttonClick(val) {
 | 
							buttonClick(val) {
 | 
				
			||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.lineId = val.lineId || [];
 | 
				
			||||||
					this.listQuery.proLineId = val.line ? val.line : undefined;
 | 
										this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
 | 
				
			||||||
					this.listQuery.startTime = val.timeVal ? new Date(val.timeVal[0]).getTime() : undefined;
 | 
										this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
 | 
				
			||||||
					this.listQuery.endTime = val.timeVal ? new Date(val.timeVal[1]).getTime() : undefined;
 | 
										if (this.activeName === '历史') {
 | 
				
			||||||
					if (val.timeVal && val.timeVal.length > 0) {
 | 
											this.getDataList();
 | 
				
			||||||
						this.fileName = val.timeVal[0].slice(0, 10) + '-' + val.timeVal[1].slice(0, 10) + '_'
 | 
										} else {
 | 
				
			||||||
          }
 | 
											this.getDataList2();
 | 
				
			||||||
					this.getDataList();
 | 
										}
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
@@ -278,34 +388,265 @@ export default {
 | 
				
			|||||||
				default:
 | 
									default:
 | 
				
			||||||
					console.log(val);
 | 
										console.log(val);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		// 获取数据列表
 | 
					 | 
				
			||||||
    getDataList() {
 | 
					 | 
				
			||||||
      this.dataListLoading = true;
 | 
					 | 
				
			||||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
					 | 
				
			||||||
        this.tableData = response.data;
 | 
					 | 
				
			||||||
        this.listQuery.total = response.data.length;
 | 
					 | 
				
			||||||
        this.dataListLoading = false;
 | 
					 | 
				
			||||||
				this.showData = this.tableData
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 每页数
 | 
					    currentMenu(val) {
 | 
				
			||||||
    sizeChangeHandle(val) {
 | 
					      this.activeName = val; // 同步标签名到 activeName
 | 
				
			||||||
      this.listQuery.pageSize = val;
 | 
					      let actualName = val === '历史' ? 'his' : 'now'; // 转换为内部状态
 | 
				
			||||||
      this.listQuery.pageNo = 1;
 | 
					
 | 
				
			||||||
      this.getDataList();
 | 
					    // 后续逻辑不变(根据 activeName 加载对应数据)
 | 
				
			||||||
    },
 | 
					      if (actualName === 'his') {
 | 
				
			||||||
    // 当前页
 | 
									// this.$refs.searchBarForm.resetForm();
 | 
				
			||||||
    currentChangeHandle(val) {
 | 
					        this.listQuery.factoryId = undefined;
 | 
				
			||||||
      this.listQuery.pageNo = val;
 | 
					        if (!this.$route.query.lineId) {
 | 
				
			||||||
      this.getDataList();
 | 
					          this.listQuery.lineId = [];
 | 
				
			||||||
    },
 | 
					
 | 
				
			||||||
		handleExport() {
 | 
					        }
 | 
				
			||||||
			if (this.selectedList.length > 0) {
 | 
									// 获取当前时间
 | 
				
			||||||
				this.showData = this.selectedList
 | 
									const now = new Date();
 | 
				
			||||||
 | 
									// 获取前一天的同一时间
 | 
				
			||||||
 | 
									const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
 | 
				
			||||||
 | 
									// 设置为00:00:00
 | 
				
			||||||
 | 
									yesterday.setHours(0, 0, 0, 0);
 | 
				
			||||||
 | 
									// 设置为23:59:59
 | 
				
			||||||
 | 
									const end = new Date(yesterday.getTime());
 | 
				
			||||||
 | 
									end.setHours(23, 59, 59, 59);
 | 
				
			||||||
 | 
									this.listQuery.startTime = yesterday.getTime();
 | 
				
			||||||
 | 
									this.listQuery.endTime = end.getTime();
 | 
				
			||||||
 | 
									this.$nextTick(() => {
 | 
				
			||||||
 | 
										this.$refs.searchBarForm.formInline.timeVal = [
 | 
				
			||||||
 | 
											yesterday.getTime(),
 | 
				
			||||||
 | 
											end.getTime(),
 | 
				
			||||||
 | 
										];
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									this.getDataList();
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									this.getDataList2();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			this.dialogVisible = true
 | 
							},
 | 
				
			||||||
    }
 | 
					
 | 
				
			||||||
 | 
					    getDataList() {
 | 
				
			||||||
 | 
					      if (this.listQuery.startTime) {
 | 
				
			||||||
 | 
					        this.dataListLoading = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 判断是否为order类型且lineId有值
 | 
				
			||||||
 | 
					        if (this.routeType === 'order' && this.listQuery.lineId?.length) {
 | 
				
			||||||
 | 
					          // 存储所有接口请求的Promise
 | 
				
			||||||
 | 
					          const requests = this.listQuery.lineId.map(lineId => {
 | 
				
			||||||
 | 
					            // 复制原有查询参数,替换当前lineId
 | 
				
			||||||
 | 
					            const params = { ...this.listQuery, lineId: [lineId] };
 | 
				
			||||||
 | 
					            return this.urlOptions.getDataListURL(params);
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          // 并行执行所有请求
 | 
				
			||||||
 | 
					          Promise.all(requests)
 | 
				
			||||||
 | 
					            .then(responses => {
 | 
				
			||||||
 | 
					              // 合并所有接口返回的数据
 | 
				
			||||||
 | 
					              this.tableData = responses.flatMap(response => {
 | 
				
			||||||
 | 
					                return response.data.map(item => {
 | 
				
			||||||
 | 
					                  // 处理嵌套属性
 | 
				
			||||||
 | 
					                  item.originalLossNum = item.original?.lossNum;
 | 
				
			||||||
 | 
					                  item.originalLossArea = item.original?.lossArea;
 | 
				
			||||||
 | 
					                  item.edgeLossNum = item.edge?.lossNum;
 | 
				
			||||||
 | 
					                  item.edgeLossArea = item.edge?.lossArea;
 | 
				
			||||||
 | 
					                  item.drillLossNum = item.drill?.lossNum;
 | 
				
			||||||
 | 
					                  item.drillLossArea = item.drill?.lossArea;
 | 
				
			||||||
 | 
					                  item.coatingLossNum = item.coating?.lossNum;
 | 
				
			||||||
 | 
					                  item.coatingLossArea = item.coating?.lossArea;
 | 
				
			||||||
 | 
					                  item.silkLossNum = item.silk?.lossNum;
 | 
				
			||||||
 | 
					                  item.silkLossArea = item.silk?.lossArea;
 | 
				
			||||||
 | 
					                  item.temperingLossNum = item.tempering?.lossNum;
 | 
				
			||||||
 | 
					                  item.temperingLossArea = item.tempering?.lossArea;
 | 
				
			||||||
 | 
					                  item.packingLossNum = item.packing?.lossNum;
 | 
				
			||||||
 | 
					                  item.packingLossArea = item.packing?.lossArea;
 | 
				
			||||||
 | 
					                  return item;
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					              });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					              this.$nextTick(() => {
 | 
				
			||||||
 | 
					                if (this.tableData.length > 0) {
 | 
				
			||||||
 | 
					                  this.$refs.barChart.initChart();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              });
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .catch(error => {
 | 
				
			||||||
 | 
					              console.error('接口请求失败:', error);
 | 
				
			||||||
 | 
					              this.$message.error('数据加载失败,请重试');
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .finally(() => {
 | 
				
			||||||
 | 
					              this.dataListLoading = false;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					          // 非order类型或无lineId时,正常单次请求
 | 
				
			||||||
 | 
					          this.urlOptions.getDataListURL(this.listQuery)
 | 
				
			||||||
 | 
					            .then(response => {
 | 
				
			||||||
 | 
					              this.tableData = response.data.map((item, index) => {
 | 
				
			||||||
 | 
					                item.originalLossNum = item.original?.lossNum;
 | 
				
			||||||
 | 
					                item.originalLossArea = item.original?.lossArea;
 | 
				
			||||||
 | 
					                item.edgeLossNum = item.edge?.lossNum;
 | 
				
			||||||
 | 
					                item.edgeLossArea = item.edge?.lossArea;
 | 
				
			||||||
 | 
					                item.drillLossNum = item.drill?.lossNum;
 | 
				
			||||||
 | 
					                item.drillLossArea = item.drill?.lossArea;
 | 
				
			||||||
 | 
					                item.coatingLossNum = item.coating?.lossNum;
 | 
				
			||||||
 | 
					                item.coatingLossArea = item.coating?.lossArea;
 | 
				
			||||||
 | 
					                item.silkLossNum = item.silk?.lossNum;
 | 
				
			||||||
 | 
					                item.silkLossArea = item.silk?.lossArea;
 | 
				
			||||||
 | 
					                item.temperingLossNum = item.tempering?.lossNum;
 | 
				
			||||||
 | 
					                item.temperingLossArea = item.tempering?.lossArea;
 | 
				
			||||||
 | 
					                item.packingLossNum = item.packing?.lossNum;
 | 
				
			||||||
 | 
					                item.packingLossArea = item.packing?.lossArea;
 | 
				
			||||||
 | 
					                return item;
 | 
				
			||||||
 | 
					              });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					              this.$nextTick(() => {
 | 
				
			||||||
 | 
					                if (this.tableData.length > 0) {
 | 
				
			||||||
 | 
					                  this.$refs.barChart.initChart();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					              });
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .catch(error => {
 | 
				
			||||||
 | 
					              console.error('接口请求失败:', error);
 | 
				
			||||||
 | 
					              this.$message.error('数据加载失败,请重试');
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            .finally(() => {
 | 
				
			||||||
 | 
					              this.dataListLoading = false;
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        this.$message.warning('请选择时间范围');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
							// 获取数据2列表
 | 
				
			||||||
 | 
							getDataList2() {
 | 
				
			||||||
 | 
								getPdlAutoReportNewSearchNow().then((response) => {
 | 
				
			||||||
 | 
									this.tableData2 = response.data.classData.map((item, index) => {
 | 
				
			||||||
 | 
										item.originalLossNum = item.original?.lossNum;
 | 
				
			||||||
 | 
										item.originalLossArea = item.original?.lossArea;
 | 
				
			||||||
 | 
										item.edgeLossNum = item.edge?.lossNum;
 | 
				
			||||||
 | 
										item.edgeLossArea = item.edge?.lossArea;
 | 
				
			||||||
 | 
										item.drillLossNum = item.drill?.lossNum;
 | 
				
			||||||
 | 
										item.drillLossArea = item.drill?.lossArea;
 | 
				
			||||||
 | 
										item.coatingLossNum = item.coating?.lossNum;
 | 
				
			||||||
 | 
										item.coatingLossArea = item.coating?.lossArea;
 | 
				
			||||||
 | 
										item.silkLossNum = item.silk?.lossNum;
 | 
				
			||||||
 | 
										item.silkLossArea = item.silk?.lossArea;
 | 
				
			||||||
 | 
										item.temperingLossNum = item.tempering?.lossNum;
 | 
				
			||||||
 | 
										item.temperingLossArea = item.tempering?.lossArea;
 | 
				
			||||||
 | 
										item.packingLossNum = item.packing?.lossNum;
 | 
				
			||||||
 | 
										item.packingLossArea = item.packing?.lossArea;
 | 
				
			||||||
 | 
										return item;
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									this.tableData3 = response.data.todayData.map((item, index) => {
 | 
				
			||||||
 | 
										item.originalLossNum = item.original?.lossNum;
 | 
				
			||||||
 | 
										item.originalLossArea = item.original?.lossArea;
 | 
				
			||||||
 | 
										item.edgeLossNum = item.edge?.lossNum;
 | 
				
			||||||
 | 
										item.edgeLossArea = item.edge?.lossArea;
 | 
				
			||||||
 | 
										item.drillLossNum = item.drill?.lossNum;
 | 
				
			||||||
 | 
										item.drillLossArea = item.drill?.lossArea;
 | 
				
			||||||
 | 
										item.coatingLossNum = item.coating?.lossNum;
 | 
				
			||||||
 | 
										item.coatingLossArea = item.coating?.lossArea;
 | 
				
			||||||
 | 
										item.silkLossNum = item.silk?.lossNum;
 | 
				
			||||||
 | 
										item.silkLossArea = item.silk?.lossArea;
 | 
				
			||||||
 | 
										item.temperingLossNum = item.tempering?.lossNum;
 | 
				
			||||||
 | 
										item.temperingLossArea = item.tempering?.lossArea;
 | 
				
			||||||
 | 
										item.packingLossNum = item.packing?.lossNum;
 | 
				
			||||||
 | 
										item.packingLossArea = item.packing?.lossArea;
 | 
				
			||||||
 | 
										return item;
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
 | 
								this.listQuery.lineId = [];
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.lineId = undefined;
 | 
				
			||||||
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[1].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							/** 导出按钮操作 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							handleExport() {
 | 
				
			||||||
 | 
								let tables = document.querySelector('.el-table').cloneNode(true);
 | 
				
			||||||
 | 
								const fix = tables.querySelector('.el-table__fixed');
 | 
				
			||||||
 | 
								const fixRight = tables.querySelector('.el-table__fixed-right');
 | 
				
			||||||
 | 
								if (fix) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (fixRight) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed-right'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								let exportTable = XLSX.utils.table_to_book(tables);
 | 
				
			||||||
 | 
					      exportTable.Sheets.Sheet1.A1.v = '序号' //导出表格第一列表头为序号
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								var exportTableOut = XLSX.write(exportTable, {
 | 
				
			||||||
 | 
									bookType: 'xlsx',
 | 
				
			||||||
 | 
									bookSST: true,
 | 
				
			||||||
 | 
									type: 'array',
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// sheetjs.xlsx为导出表格的标题名称
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
 | 
									FileSaver.saveAs(
 | 
				
			||||||
 | 
										new Blob([exportTableOut], {
 | 
				
			||||||
 | 
											type: 'application/octet-stream',
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										'产线统计数据.xlsx'
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
 | 
								} catch (e) {
 | 
				
			||||||
 | 
									if (typeof console !== 'undefined') console.log(e, exportTableOut);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return exportTableOut;
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					<style lang="scss">
 | 
				
			||||||
 | 
					.energyOverlimitLog {
 | 
				
			||||||
 | 
						.el-tabs__nav::after {
 | 
				
			||||||
 | 
							content: '';
 | 
				
			||||||
 | 
							position: absolute;
 | 
				
			||||||
 | 
							left: 0;
 | 
				
			||||||
 | 
							bottom: 0;
 | 
				
			||||||
 | 
							width: 100%;
 | 
				
			||||||
 | 
							height: 2px;
 | 
				
			||||||
 | 
							background-color: #e4e7ed;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						.el-tabs__nav-wrap::after {
 | 
				
			||||||
 | 
							width: 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						.el-tabs__item {
 | 
				
			||||||
 | 
							padding: 0 10px;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						.el-tabs__item:hover {
 | 
				
			||||||
 | 
							color: rgba(0, 0, 0, 0.85);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						.el-tabs__item.is-active {
 | 
				
			||||||
 | 
							color: rgba(0, 0, 0, 0.85);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						.el-tabs__item {
 | 
				
			||||||
 | 
							color: rgba(0, 0, 0, 0.45);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						.searchBarBox {
 | 
				
			||||||
 | 
							margin-bottom: 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						.blue-block {
 | 
				
			||||||
 | 
							float: left;
 | 
				
			||||||
 | 
							display: inline-block;
 | 
				
			||||||
 | 
							width: 4px;
 | 
				
			||||||
 | 
							height: 16px;
 | 
				
			||||||
 | 
							background-color: #0b58ff;
 | 
				
			||||||
 | 
							border-radius: 1px;
 | 
				
			||||||
 | 
							margin-right: 8px;
 | 
				
			||||||
 | 
							margin-top: 12px;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						.tip {
 | 
				
			||||||
 | 
							display: inline-block;
 | 
				
			||||||
 | 
							font-size: 16px;
 | 
				
			||||||
 | 
							margin-right: 8px;
 | 
				
			||||||
 | 
							margin-top: 10px;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
<!-- 
 | 
					<!--
 | 
				
			||||||
    filename: index.vue
 | 
					    filename: index.vue
 | 
				
			||||||
    author: liubin
 | 
					    author: liubin
 | 
				
			||||||
    date: 2023-08-04 14:44:58
 | 
					    date: 2023-08-04 14:44:58
 | 
				
			||||||
@@ -16,6 +16,7 @@
 | 
				
			|||||||
		v-if="tableData && tableData.length > 0"
 | 
							v-if="tableData && tableData.length > 0"
 | 
				
			||||||
			:table-props="tableProps"
 | 
								:table-props="tableProps"
 | 
				
			||||||
			:table-data="tableData"
 | 
								:table-data="tableData"
 | 
				
			||||||
 | 
												:max-height="tableH"
 | 
				
			||||||
			@emitFun="handleEmitFun"
 | 
								@emitFun="handleEmitFun"
 | 
				
			||||||
		/>
 | 
							/>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
@@ -24,11 +25,13 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
 | 
					import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
 | 
				
			||||||
 | 
					import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
	name: 'productionLineData24',
 | 
						name: 'productionLineData24',
 | 
				
			||||||
	components: {},
 | 
						components: {},
 | 
				
			||||||
	props: {},
 | 
						props: {},
 | 
				
			||||||
 | 
						mixins: [tableHeightMixin],
 | 
				
			||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
      urlOptions: {
 | 
					      urlOptions: {
 | 
				
			||||||
@@ -41,7 +44,7 @@ export default {
 | 
				
			|||||||
			},
 | 
								},
 | 
				
			||||||
			list: [],
 | 
								list: [],
 | 
				
			||||||
			arr: [],
 | 
								arr: [],
 | 
				
			||||||
			spanArr: [], 
 | 
								spanArr: [],
 | 
				
			||||||
			timeList: [],
 | 
								timeList: [],
 | 
				
			||||||
			tableData: [],
 | 
								tableData: [],
 | 
				
			||||||
			tableProps: [],
 | 
								tableProps: [],
 | 
				
			||||||
@@ -66,10 +69,14 @@ export default {
 | 
				
			|||||||
						label: times.slice(0, 10) + ' ' + times.slice(11),
 | 
											label: times.slice(0, 10) + ' ' + times.slice(11),
 | 
				
			||||||
						align: 'center',
 | 
											align: 'center',
 | 
				
			||||||
						children: [
 | 
											children: [
 | 
				
			||||||
							{ prop: times + '_in', label: '投入数量' },
 | 
												{ prop: times + '_in', label: '投入数量',
 | 
				
			||||||
							{ prop: times + '_out', label: '产出数量' },
 | 
												filter: (val) => (val != null ? val.toFixed(2) : '-'), },
 | 
				
			||||||
							{ prop: times + '_junk', label: '报废数量' },
 | 
												{ prop: times + '_out', label: '产出数量',
 | 
				
			||||||
							{ prop: times + '_area', label: '产出面积' }
 | 
												filter: (val) => (val != null ? val.toFixed(2) : '-'), },
 | 
				
			||||||
 | 
												{ prop: times + '_junk', label: '报废数量',
 | 
				
			||||||
 | 
												filter: (val) => (val != null ? val.toFixed(2) : '-'), },
 | 
				
			||||||
 | 
												{ prop: times + '_area', label: '产出面积',
 | 
				
			||||||
 | 
												filter: (val) => (val != null ? val.toFixed(2) : '-'), }
 | 
				
			||||||
						]
 | 
											]
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					this.arr.push(subprop)
 | 
										this.arr.push(subprop)
 | 
				
			||||||
@@ -168,7 +175,7 @@ export default {
 | 
				
			|||||||
			// // console.log('recent-24', data);
 | 
								// // console.log('recent-24', data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// this.initing = true;
 | 
								// this.initing = true;
 | 
				
			||||||
			
 | 
					
 | 
				
			||||||
			// this.queryParams.pageSize = this.list.length;
 | 
								// this.queryParams.pageSize = this.list.length;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			// setTimeout(() => {
 | 
								// setTimeout(() => {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										273
									
								
								src/views/core/monitoring/lineAuto/baseTable.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,273 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="baseTable">
 | 
				
			||||||
 | 
							<el-table
 | 
				
			||||||
 | 
								:ref="id"
 | 
				
			||||||
 | 
								:data="renderData"
 | 
				
			||||||
 | 
								v-bind="$attrs"
 | 
				
			||||||
 | 
								:border="cancelBorder ? false : true"
 | 
				
			||||||
 | 
								@current-change="currentChange"
 | 
				
			||||||
 | 
								@selection-change="handleSelectionChange"
 | 
				
			||||||
 | 
								style="width: 100%"
 | 
				
			||||||
 | 
								:header-cell-style="{
 | 
				
			||||||
 | 
									background: '#F2F4F9',
 | 
				
			||||||
 | 
									color: '#606266',
 | 
				
			||||||
 | 
								}">
 | 
				
			||||||
 | 
								<!-- 多选 -->
 | 
				
			||||||
 | 
								<el-table-column
 | 
				
			||||||
 | 
									v-if="selectWidth"
 | 
				
			||||||
 | 
									type="selection"
 | 
				
			||||||
 | 
									:width="selectWidth" />
 | 
				
			||||||
 | 
								<!-- 序号 -->
 | 
				
			||||||
 | 
								<el-table-column
 | 
				
			||||||
 | 
									v-if="page && limit"
 | 
				
			||||||
 | 
									prop="_pageIndex"
 | 
				
			||||||
 | 
									:width="pageWidth"
 | 
				
			||||||
 | 
									align="center"
 | 
				
			||||||
 | 
									:fixed="cancelPageFixed ? false : true">
 | 
				
			||||||
 | 
									<template slot="header">
 | 
				
			||||||
 | 
										<el-popover placement="bottom-start" width="300" trigger="click">
 | 
				
			||||||
 | 
											<div
 | 
				
			||||||
 | 
												class="setting-box"
 | 
				
			||||||
 | 
												style="max-height: 400px; overflow-y: auto">
 | 
				
			||||||
 | 
												<el-checkbox
 | 
				
			||||||
 | 
													v-for="(item, index) in tableProps"
 | 
				
			||||||
 | 
													:key="'cb' + index"
 | 
				
			||||||
 | 
													v-model="selectedBox[index]"
 | 
				
			||||||
 | 
													:label="item.label" />
 | 
				
			||||||
 | 
											</div>
 | 
				
			||||||
 | 
											<i slot="reference" class="el-icon-s-tools" />
 | 
				
			||||||
 | 
										</el-popover>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
								</el-table-column>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<el-table-column
 | 
				
			||||||
 | 
									v-for="item in renderTableHeadList"
 | 
				
			||||||
 | 
									:key="item.prop"
 | 
				
			||||||
 | 
									v-bind="item"
 | 
				
			||||||
 | 
									:label="item.label"
 | 
				
			||||||
 | 
									:prop="item.prop"
 | 
				
			||||||
 | 
									:fixed="item.fixed || false"
 | 
				
			||||||
 | 
									:show-overflow-tooltip="item.showOverflowtooltip || false"
 | 
				
			||||||
 | 
									:sortable="item.sortable || false">
 | 
				
			||||||
 | 
									<template slot="header">
 | 
				
			||||||
 | 
										<span>{{ item.label }}</span>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
									<!-- 多表头 -->
 | 
				
			||||||
 | 
									<template v-if="item.children">
 | 
				
			||||||
 | 
										<el-table-column
 | 
				
			||||||
 | 
											v-for="sub in item.children"
 | 
				
			||||||
 | 
											:prop="sub.prop"
 | 
				
			||||||
 | 
											:key="sub.prop"
 | 
				
			||||||
 | 
											v-bind="sub"
 | 
				
			||||||
 | 
											:label="sub.label">
 | 
				
			||||||
 | 
											<template v-if="sub.children">
 | 
				
			||||||
 | 
												<el-table-column
 | 
				
			||||||
 | 
													v-for="ssub in sub.children"
 | 
				
			||||||
 | 
													:prop="ssub.prop"
 | 
				
			||||||
 | 
													:key="ssub.prop"
 | 
				
			||||||
 | 
													v-bind="ssub"
 | 
				
			||||||
 | 
													:label="ssub.label">
 | 
				
			||||||
 | 
													<template slot-scope="sscopeInner">
 | 
				
			||||||
 | 
														<component
 | 
				
			||||||
 | 
															:is="ssub.subcomponent"
 | 
				
			||||||
 | 
															v-if="ssub.subcomponent"
 | 
				
			||||||
 | 
															:key="sscopeInner.row.id"
 | 
				
			||||||
 | 
															:inject-data="{ ...sscopeInner.row, ...ssub }"
 | 
				
			||||||
 | 
															@emitData="emitData" />
 | 
				
			||||||
 | 
														<span v-else>
 | 
				
			||||||
 | 
															{{ sscopeInner.row[ssub.prop] | commonFilter(ssub.filter) }}
 | 
				
			||||||
 | 
														</span>
 | 
				
			||||||
 | 
													</template>
 | 
				
			||||||
 | 
												</el-table-column>
 | 
				
			||||||
 | 
											</template>
 | 
				
			||||||
 | 
											<template slot-scope="scopeInner">
 | 
				
			||||||
 | 
												<component
 | 
				
			||||||
 | 
													:is="sub.subcomponent"
 | 
				
			||||||
 | 
													v-if="sub.subcomponent"
 | 
				
			||||||
 | 
													:key="scopeInner.row.id"
 | 
				
			||||||
 | 
													:inject-data="{ ...scopeInner.row, ...sub }"
 | 
				
			||||||
 | 
													@emitData="emitData" />
 | 
				
			||||||
 | 
												<span v-else>
 | 
				
			||||||
 | 
													{{ scopeInner.row[sub.prop] | commonFilter(sub.filter) }}
 | 
				
			||||||
 | 
												</span>
 | 
				
			||||||
 | 
											</template>
 | 
				
			||||||
 | 
										</el-table-column>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
									<template slot-scope="scope">
 | 
				
			||||||
 | 
										<component
 | 
				
			||||||
 | 
											:is="item.subcomponent"
 | 
				
			||||||
 | 
											v-if="item.subcomponent"
 | 
				
			||||||
 | 
											:key="scope.row.id"
 | 
				
			||||||
 | 
											:itemProp="item.prop"
 | 
				
			||||||
 | 
											:inject-data="{ ...scope.row, ...item }"
 | 
				
			||||||
 | 
											@emitData="emitData" />
 | 
				
			||||||
 | 
										<span v-else>
 | 
				
			||||||
 | 
											{{ scope.row[item.prop] | commonFilter(item.filter) }}
 | 
				
			||||||
 | 
										</span>
 | 
				
			||||||
 | 
									</template>
 | 
				
			||||||
 | 
								</el-table-column>
 | 
				
			||||||
 | 
								<slot name="handleBtn" />
 | 
				
			||||||
 | 
							</el-table>
 | 
				
			||||||
 | 
							<!-- 表格底部加号 -->
 | 
				
			||||||
 | 
							<el-button
 | 
				
			||||||
 | 
								v-if="addButtonShow"
 | 
				
			||||||
 | 
								class="addButton"
 | 
				
			||||||
 | 
								icon="el-icon-plus"
 | 
				
			||||||
 | 
								@click="emitButtonClick">
 | 
				
			||||||
 | 
								{{ addButtonShow }}
 | 
				
			||||||
 | 
							</el-button>
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						name: 'BaseTable',
 | 
				
			||||||
 | 
						filters: {
 | 
				
			||||||
 | 
							commonFilter: (source, filterType = (a) => a) => {
 | 
				
			||||||
 | 
								return filterType(source);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						props: {
 | 
				
			||||||
 | 
							cancelBorder: {
 | 
				
			||||||
 | 
								type: Boolean,
 | 
				
			||||||
 | 
								default: false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							cancelPageFixed: {
 | 
				
			||||||
 | 
								type: Boolean,
 | 
				
			||||||
 | 
								default: false,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							tableData: {
 | 
				
			||||||
 | 
								type: Array,
 | 
				
			||||||
 | 
								required: true,
 | 
				
			||||||
 | 
								default: () => {
 | 
				
			||||||
 | 
									return [];
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							tableProps: {
 | 
				
			||||||
 | 
								type: Array,
 | 
				
			||||||
 | 
								default: () => {
 | 
				
			||||||
 | 
									return [];
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							id: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: '',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							page: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							pageWidth: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 70,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							limit: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							selectWidth: {
 | 
				
			||||||
 | 
								type: Number,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: 0,
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							addButtonShow: {
 | 
				
			||||||
 | 
								type: String,
 | 
				
			||||||
 | 
								required: false,
 | 
				
			||||||
 | 
								default: '',
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								selectedBox: new Array(100).fill(true),
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						computed: {
 | 
				
			||||||
 | 
							renderTableHeadList() {
 | 
				
			||||||
 | 
								return this.tableProps.filter((item, index) => {
 | 
				
			||||||
 | 
									return this.selectedBox[index];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							renderData() {
 | 
				
			||||||
 | 
								return this.tableData.map((item, index) => {
 | 
				
			||||||
 | 
									return {
 | 
				
			||||||
 | 
										...item,
 | 
				
			||||||
 | 
										_pageIndex: (this.page - 1) * this.limit + index + 1,
 | 
				
			||||||
 | 
									};
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						beforeMount() {
 | 
				
			||||||
 | 
							this.selectedBox = new Array(100).fill(true);
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							currentChange(newVal, oldVal) {
 | 
				
			||||||
 | 
								this.$emit('current-change', { newVal, oldVal });
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleSelectionChange(val) {
 | 
				
			||||||
 | 
								this.$emit('selection-change', val);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							emitData(val) {
 | 
				
			||||||
 | 
								this.$emit('emitFun', val);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							emitButtonClick() {
 | 
				
			||||||
 | 
								this.$emit('emitButtonClick');
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							setCurrent(name, index) {
 | 
				
			||||||
 | 
								let _this = this;
 | 
				
			||||||
 | 
								let obj = _this.$refs[name].data[index];
 | 
				
			||||||
 | 
								_this.$refs[name].setCurrentRow(obj);
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							doLayout(name) {
 | 
				
			||||||
 | 
								this.$refs[name].doLayout();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					<style scoped>
 | 
				
			||||||
 | 
					.baseTable .show-col-btn {
 | 
				
			||||||
 | 
						margin-right: 5px;
 | 
				
			||||||
 | 
						line-height: inherit;
 | 
				
			||||||
 | 
						cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .el-icon-refresh {
 | 
				
			||||||
 | 
						cursor: pointer;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
 | 
					<style>
 | 
				
			||||||
 | 
					.baseTable .el-table__body tr.current-row > td.el-table__cell {
 | 
				
			||||||
 | 
						background-color: #eaf1fc;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .el-table .el-table__cell {
 | 
				
			||||||
 | 
						padding: 0;
 | 
				
			||||||
 | 
						height: 35px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .addButton {
 | 
				
			||||||
 | 
						width: 100%;
 | 
				
			||||||
 | 
						height: 35px;
 | 
				
			||||||
 | 
						border-top: none;
 | 
				
			||||||
 | 
						color: #0b58ff;
 | 
				
			||||||
 | 
						border-color: #ebeef5;
 | 
				
			||||||
 | 
						border-radius: 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .addButton:hover {
 | 
				
			||||||
 | 
						color: #0b58ff;
 | 
				
			||||||
 | 
						border-color: #ebeef5;
 | 
				
			||||||
 | 
						background-color: #fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.baseTable .addButton:focus {
 | 
				
			||||||
 | 
						border-color: #ebeef5;
 | 
				
			||||||
 | 
						background-color: #fff;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.el-tooltip__popper.is-dark {
 | 
				
			||||||
 | 
						background: rgba(0, 0, 0, 0.6) !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					.el-tooltip__popper .popper__arrow,
 | 
				
			||||||
 | 
					.el-tooltip__popper .popper__arrow::after {
 | 
				
			||||||
 | 
						border-top-color: rgba(0, 0, 0, 0.4) !important;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
							
								
								
									
										481
									
								
								src/views/core/monitoring/lineAuto/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,481 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 | 
					 * @Date: 2023-08-29 14:59:29
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-03-03 10:38:00
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="app-container">
 | 
				
			||||||
 | 
							<search-bar
 | 
				
			||||||
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@select-changed="handleSearchBarChanged"
 | 
				
			||||||
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
							<base-table-s
 | 
				
			||||||
 | 
								v-if="showData.length"
 | 
				
			||||||
 | 
								class="right-aside"
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
 | 
								:table-props="tableProps"
 | 
				
			||||||
 | 
								:page="listQuery.pageNo"
 | 
				
			||||||
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
 | 
								:table-data="showData"></base-table-s>
 | 
				
			||||||
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
 | 
							<pagination
 | 
				
			||||||
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
 | 
								:total="listQuery.total"
 | 
				
			||||||
 | 
								@pagination="getDataList" />
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { parseTime } from '@/filter/code-filter';
 | 
				
			||||||
 | 
					import { getLineAuto, getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					// import codeFilter from '../../mixins/code-filter'
 | 
				
			||||||
 | 
					import * as XLSX from 'xlsx';
 | 
				
			||||||
 | 
					import FileSaver from 'file-saver';
 | 
				
			||||||
 | 
					import baseTableS from './baseTable.vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tableProps = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'reportType',
 | 
				
			||||||
 | 
							label: '报表类型',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'reportDate',
 | 
				
			||||||
 | 
							label: '日期',
 | 
				
			||||||
 | 
							width: 130,
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'factoryName',
 | 
				
			||||||
 | 
							label: '工厂',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lineName',
 | 
				
			||||||
 | 
							label: '产线',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'sizes',
 | 
				
			||||||
 | 
							label: '规格',
 | 
				
			||||||
 | 
							width: 105,
 | 
				
			||||||
 | 
							showOverflowtooltip: true,
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'process',
 | 
				
			||||||
 | 
							label: '产品工艺',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'inputN',
 | 
				
			||||||
 | 
							label: '投入',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'inputNum',
 | 
				
			||||||
 | 
									label: '投入数量/片',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'inputArea',
 | 
				
			||||||
 | 
									label: '投入面积/m²',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputN',
 | 
				
			||||||
 | 
							label: '产出',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'outputNum',
 | 
				
			||||||
 | 
									label: '产出数量/片',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'outputArea',
 | 
				
			||||||
 | 
									label: '产出面积/㎡',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossN',
 | 
				
			||||||
 | 
							label: '不良',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'lossNum',
 | 
				
			||||||
 | 
									label: '不良数量/片',
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'lossArea',
 | 
				
			||||||
 | 
									label: '不良面积/㎡',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossRatio',
 | 
				
			||||||
 | 
							label: '不良率/%',
 | 
				
			||||||
 | 
							filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputRatio',
 | 
				
			||||||
 | 
							label: '投入产出率/%',
 | 
				
			||||||
 | 
							filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'processingRatio',
 | 
				
			||||||
 | 
							label: '加工成品率/%',
 | 
				
			||||||
 | 
							filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossD',
 | 
				
			||||||
 | 
							label: '不良详情',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'original',
 | 
				
			||||||
 | 
									label: '原片',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'originalLossNum',
 | 
				
			||||||
 | 
											label: '原片不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'originalLossArea',
 | 
				
			||||||
 | 
											label: '原片不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'edge',
 | 
				
			||||||
 | 
									label: '磨边',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'edgeLossNum',
 | 
				
			||||||
 | 
											label: '磨边不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'edgeLossArea',
 | 
				
			||||||
 | 
											label: '磨边不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'drill',
 | 
				
			||||||
 | 
									label: '打孔',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'drillLossNum',
 | 
				
			||||||
 | 
											label: '打孔不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'drillLossArea',
 | 
				
			||||||
 | 
											label: '打孔不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'coating',
 | 
				
			||||||
 | 
									label: '镀膜',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'coatingLossNum',
 | 
				
			||||||
 | 
											label: '镀膜不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'coatingLossArea',
 | 
				
			||||||
 | 
											label: '镀膜不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'silk',
 | 
				
			||||||
 | 
									label: '丝印',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'silkLossNum',
 | 
				
			||||||
 | 
											label: '丝印不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'silkLossArea',
 | 
				
			||||||
 | 
											label: '丝印不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'tempering',
 | 
				
			||||||
 | 
									label: '钢化',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'temperingLossNum',
 | 
				
			||||||
 | 
											label: '钢化不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'temperingLossArea',
 | 
				
			||||||
 | 
											label: '钢化不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'packing',
 | 
				
			||||||
 | 
									label: '包装',
 | 
				
			||||||
 | 
					        align: 'center',
 | 
				
			||||||
 | 
									children: [
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'packingLossNum',
 | 
				
			||||||
 | 
											label: '包装不良/片',
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
										{
 | 
				
			||||||
 | 
											prop: 'packingLossArea',
 | 
				
			||||||
 | 
											label: '包装不良/㎡',
 | 
				
			||||||
 | 
											filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
										},
 | 
				
			||||||
 | 
									],
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						components: {
 | 
				
			||||||
 | 
							baseTableS,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									getDataListURL: getLineAuto,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								listQuery: {
 | 
				
			||||||
 | 
									lineId: [],
 | 
				
			||||||
 | 
									pageSize: 10,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
									total: 1,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								fileName: '',
 | 
				
			||||||
 | 
								dataListLoading: false,
 | 
				
			||||||
 | 
								tableProps,
 | 
				
			||||||
 | 
								tableBtn: [],
 | 
				
			||||||
 | 
								showData: [],
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '维度',
 | 
				
			||||||
 | 
										selectOptions: [
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 1,
 | 
				
			||||||
 | 
												name: '日',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 2,
 | 
				
			||||||
 | 
												name: '周',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 3,
 | 
				
			||||||
 | 
												name: '月',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 4,
 | 
				
			||||||
 | 
												name: '年',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										param: 'reportType',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产线',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'lineId',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'datePicker',
 | 
				
			||||||
 | 
										label: '时间范围',
 | 
				
			||||||
 | 
										dateType: 'daterange',
 | 
				
			||||||
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
 | 
										valueFormat: 'timestamp',
 | 
				
			||||||
 | 
										rangeSeparator: '-',
 | 
				
			||||||
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
 | 
										param: 'timeVal',
 | 
				
			||||||
 | 
										width: 350,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '查询',
 | 
				
			||||||
 | 
										name: 'search',
 | 
				
			||||||
 | 
										color: 'primary',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'separate',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '导出',
 | 
				
			||||||
 | 
										name: 'export',
 | 
				
			||||||
 | 
										color: 'warning',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
							// 获取当前时间
 | 
				
			||||||
 | 
							const now = new Date();
 | 
				
			||||||
 | 
							// 获取前一天的同一时间
 | 
				
			||||||
 | 
							const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
 | 
				
			||||||
 | 
							// 设置为00:00:00
 | 
				
			||||||
 | 
							yesterday.setHours(0, 0, 0, 0);
 | 
				
			||||||
 | 
							// 设置为23:59:59
 | 
				
			||||||
 | 
							const end = new Date(yesterday.getTime());
 | 
				
			||||||
 | 
							end.setHours(23, 59, 59, 59);
 | 
				
			||||||
 | 
							this.listQuery.startTime = yesterday.getTime();
 | 
				
			||||||
 | 
							this.listQuery.endTime = end.getTime();
 | 
				
			||||||
 | 
							this.$nextTick(() => {
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.timeVal = [
 | 
				
			||||||
 | 
									yesterday.getTime(),
 | 
				
			||||||
 | 
									end.getTime(),
 | 
				
			||||||
 | 
								];
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
							this.getDataList();
 | 
				
			||||||
 | 
							this.getPdLineList();
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							handleExport() {
 | 
				
			||||||
 | 
								let tables = document.querySelector('.el-table').cloneNode(true);
 | 
				
			||||||
 | 
								const fix = tables.querySelector('.el-table__fixed');
 | 
				
			||||||
 | 
								const fixRight = tables.querySelector('.el-table__fixed-right');
 | 
				
			||||||
 | 
								if (fix) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (fixRight) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed-right'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								let exportTable = XLSX.utils.table_to_book(tables);
 | 
				
			||||||
 | 
					      exportTable.Sheets.Sheet1.A1.v = '序号' //导出表格第一列表头为序号
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								var exportTableOut = XLSX.write(exportTable, {
 | 
				
			||||||
 | 
									bookType: 'xlsx',
 | 
				
			||||||
 | 
									bookSST: true,
 | 
				
			||||||
 | 
									type: 'array',
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// sheetjs.xlsx为导出表格的标题名称
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
 | 
									FileSaver.saveAs(
 | 
				
			||||||
 | 
										new Blob([exportTableOut], {
 | 
				
			||||||
 | 
											type: 'application/octet-stream',
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										this.fileName + '产线自动报表.xlsx'
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
 | 
								} catch (e) {
 | 
				
			||||||
 | 
									if (typeof console !== 'undefined') console.log(e, exportTableOut);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return exportTableOut;
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							getPdLineList() {
 | 
				
			||||||
 | 
								getPdList().then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[2].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.listQuery.lineId = val.lineId ? [val.lineId] : [];
 | 
				
			||||||
 | 
										this.listQuery.reportType = val.reportType || undefined;
 | 
				
			||||||
 | 
										this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
 | 
				
			||||||
 | 
										this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'export':
 | 
				
			||||||
 | 
										this.handleExport();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 获取数据列表
 | 
				
			||||||
 | 
							getDataList() {
 | 
				
			||||||
 | 
								this.dataListLoading = true;
 | 
				
			||||||
 | 
								const arr = ['日', '周', '月', '年'];
 | 
				
			||||||
 | 
								this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
				
			||||||
 | 
									this.tableData = response.data.list.map((item, index) => {
 | 
				
			||||||
 | 
										item.reportType = arr[item.reportType - 1];
 | 
				
			||||||
 | 
										item.originalLossNum = item.original?.lossNum;
 | 
				
			||||||
 | 
										item.originalLossArea = item.original?.lossArea;
 | 
				
			||||||
 | 
										item.edgeLossNum = item.edge?.lossNum;
 | 
				
			||||||
 | 
										item.edgeLossArea = item.edge?.lossArea;
 | 
				
			||||||
 | 
										item.drillLossNum = item.drill?.lossNum;
 | 
				
			||||||
 | 
										item.drillLossArea = item.drill?.lossArea;
 | 
				
			||||||
 | 
										item.coatingLossNum = item.coating?.lossNum;
 | 
				
			||||||
 | 
										item.coatingLossArea = item.coating?.lossArea;
 | 
				
			||||||
 | 
										item.silkLossNum = item.silk?.lossNum;
 | 
				
			||||||
 | 
										item.silkLossArea = item.silk?.lossArea;
 | 
				
			||||||
 | 
										item.temperingLossNum = item.tempering?.lossNum;
 | 
				
			||||||
 | 
										item.temperingLossArea = item.tempering?.lossArea;
 | 
				
			||||||
 | 
										item.packingLossNum = item.packing?.lossNum;
 | 
				
			||||||
 | 
										item.packingLossArea = item.packing?.lossArea;
 | 
				
			||||||
 | 
										return item;
 | 
				
			||||||
 | 
									});
 | 
				
			||||||
 | 
									this.listQuery.total = response.data.total;
 | 
				
			||||||
 | 
									this.dataListLoading = false;
 | 
				
			||||||
 | 
									this.showData = this.tableData;
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 每页数
 | 
				
			||||||
 | 
							sizeChangeHandle(val) {
 | 
				
			||||||
 | 
								this.listQuery.pageSize = val;
 | 
				
			||||||
 | 
								this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
								this.getDataList();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 当前页
 | 
				
			||||||
 | 
							currentChangeHandle(val) {
 | 
				
			||||||
 | 
								this.listQuery.pageNo = val;
 | 
				
			||||||
 | 
								this.getDataList();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							handleSearchBarChanged({ param, value }) {
 | 
				
			||||||
 | 
								this.listQuery.lineId = [];
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.lineId = undefined;
 | 
				
			||||||
 | 
								getPdList(value).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[2].selectOptions = res.data || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
							
								
								
									
										366
									
								
								src/views/core/monitoring/productAuto/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,366 @@
 | 
				
			|||||||
 | 
					<!--
 | 
				
			||||||
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 | 
					 * @Date: 2023-08-29 14:59:29
 | 
				
			||||||
 | 
					 * @LastEditTime: 2025-02-26 16:42:12
 | 
				
			||||||
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 | 
					 * @Description:
 | 
				
			||||||
 | 
					-->
 | 
				
			||||||
 | 
					<template>
 | 
				
			||||||
 | 
						<div class="app-container">
 | 
				
			||||||
 | 
							<search-bar
 | 
				
			||||||
 | 
								:formConfigs="formConfig"
 | 
				
			||||||
 | 
								ref="searchBarForm"
 | 
				
			||||||
 | 
								@headBtnClick="buttonClick" />
 | 
				
			||||||
 | 
							<base-table
 | 
				
			||||||
 | 
								v-if="showData.length"
 | 
				
			||||||
 | 
								class="right-aside"
 | 
				
			||||||
 | 
								v-loading="dataListLoading"
 | 
				
			||||||
 | 
								:table-props="tableProps"
 | 
				
			||||||
 | 
								:page="listQuery.pageNo"
 | 
				
			||||||
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
 | 
								:table-data="showData"></base-table>
 | 
				
			||||||
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
 | 
							<pagination
 | 
				
			||||||
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
 | 
								:page.sync="listQuery.pageNo"
 | 
				
			||||||
 | 
								:total="listQuery.total"
 | 
				
			||||||
 | 
								@pagination="getDataList" />
 | 
				
			||||||
 | 
						</div>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script>
 | 
				
			||||||
 | 
					import { parseTime } from '../../mixins/code-filter';
 | 
				
			||||||
 | 
					import { getProductAuto, getPdList } from '@/api/core/monitoring/auto';
 | 
				
			||||||
 | 
					import { listData } from '@/api/system/dict/data';
 | 
				
			||||||
 | 
					import { getFactoryPage } from '@/api/core/base/factory';
 | 
				
			||||||
 | 
					// import codeFilter from '../../mixins/code-filter'
 | 
				
			||||||
 | 
					import * as XLSX from 'xlsx';
 | 
				
			||||||
 | 
					import FileSaver from 'file-saver';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const tableProps1 = [
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'processType',
 | 
				
			||||||
 | 
							label: '工艺类型',
 | 
				
			||||||
 | 
							filter: (val) => (val === 1 ? '面板' : '背板'),
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'reportType',
 | 
				
			||||||
 | 
							label: '报表类型',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'reportDate',
 | 
				
			||||||
 | 
							label: '日期',
 | 
				
			||||||
 | 
							width: 130,
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'factoryName',
 | 
				
			||||||
 | 
							label: '工厂',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'process',
 | 
				
			||||||
 | 
							label: '产品工艺',
 | 
				
			||||||
 | 
					    fixed: true
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'all',
 | 
				
			||||||
 | 
							label: '合计',
 | 
				
			||||||
 | 
					    align: 'center',
 | 
				
			||||||
 | 
							children: [
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'inputArea',
 | 
				
			||||||
 | 
									label: '投入面积/m²',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'outputArea',
 | 
				
			||||||
 | 
									label: '产出面积/m²',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'lossArea',
 | 
				
			||||||
 | 
									label: '不良面积//m²',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'originalLossArea',
 | 
				
			||||||
 | 
									label: '原片不良/m²',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'outputRatio',
 | 
				
			||||||
 | 
									label: '投入产出率/%',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								{
 | 
				
			||||||
 | 
									prop: 'processingRatio',
 | 
				
			||||||
 | 
									label: '加工成品率/%',
 | 
				
			||||||
 | 
									filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							],
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default {
 | 
				
			||||||
 | 
						data() {
 | 
				
			||||||
 | 
							return {
 | 
				
			||||||
 | 
								urlOptions: {
 | 
				
			||||||
 | 
									getDataListURL: getProductAuto,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								listQuery: {
 | 
				
			||||||
 | 
									pageSize: 10,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
									total: 1,
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								fileName: '',
 | 
				
			||||||
 | 
								dataListLoading: false,
 | 
				
			||||||
 | 
								tableProps1,
 | 
				
			||||||
 | 
								tableProps: [],
 | 
				
			||||||
 | 
								tableBtn: [],
 | 
				
			||||||
 | 
								showData: [],
 | 
				
			||||||
 | 
								tableData: [],
 | 
				
			||||||
 | 
								formConfig: [
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '工厂',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'factoryId',
 | 
				
			||||||
 | 
										onchange: true,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '维度',
 | 
				
			||||||
 | 
										selectOptions: [
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 1,
 | 
				
			||||||
 | 
												name: '日',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 2,
 | 
				
			||||||
 | 
												name: '周',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 3,
 | 
				
			||||||
 | 
												name: '月',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
											{
 | 
				
			||||||
 | 
												id: 4,
 | 
				
			||||||
 | 
												name: '年',
 | 
				
			||||||
 | 
											},
 | 
				
			||||||
 | 
										],
 | 
				
			||||||
 | 
										param: 'reportType',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'select',
 | 
				
			||||||
 | 
										label: '产品工艺',
 | 
				
			||||||
 | 
										selectOptions: [],
 | 
				
			||||||
 | 
										param: 'process',
 | 
				
			||||||
 | 
										labelField: 'label',
 | 
				
			||||||
 | 
										valueField: 'label',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'datePicker',
 | 
				
			||||||
 | 
										label: '时间范围',
 | 
				
			||||||
 | 
										dateType: 'daterange',
 | 
				
			||||||
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
 | 
										valueFormat: 'timestamp',
 | 
				
			||||||
 | 
										rangeSeparator: '-',
 | 
				
			||||||
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
 | 
										param: 'timeVal',
 | 
				
			||||||
 | 
										width: 350,
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '查询',
 | 
				
			||||||
 | 
										name: 'search',
 | 
				
			||||||
 | 
										color: 'primary',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										type: 'separate',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
 | 
				
			||||||
 | 
										type: 'button',
 | 
				
			||||||
 | 
										btnName: '导出',
 | 
				
			||||||
 | 
										name: 'export',
 | 
				
			||||||
 | 
										color: 'warning',
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								],
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						created() {
 | 
				
			||||||
 | 
							// 获取当前时间
 | 
				
			||||||
 | 
							const now = new Date();
 | 
				
			||||||
 | 
							// 获取前一天的同一时间
 | 
				
			||||||
 | 
							const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
 | 
				
			||||||
 | 
							// 设置为00:00:00
 | 
				
			||||||
 | 
							yesterday.setHours(0, 0, 0, 0);
 | 
				
			||||||
 | 
							// 设置为23:59:59
 | 
				
			||||||
 | 
							const end = new Date(yesterday.getTime());
 | 
				
			||||||
 | 
							end.setHours(23, 59, 59, 59);
 | 
				
			||||||
 | 
							this.listQuery.startTime = yesterday.getTime();
 | 
				
			||||||
 | 
							this.listQuery.endTime = end.getTime();
 | 
				
			||||||
 | 
							this.$nextTick(() => {
 | 
				
			||||||
 | 
								this.$refs.searchBarForm.formInline.timeVal = [
 | 
				
			||||||
 | 
									yesterday.getTime(),
 | 
				
			||||||
 | 
									end.getTime(),
 | 
				
			||||||
 | 
								];
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
							const queryParams = {
 | 
				
			||||||
 | 
								pageNo: 1,
 | 
				
			||||||
 | 
								pageSize: 99,
 | 
				
			||||||
 | 
								dictType: 'process_type',
 | 
				
			||||||
 | 
							};
 | 
				
			||||||
 | 
							listData(queryParams).then((response) => {
 | 
				
			||||||
 | 
								this.formConfig[2].selectOptions = response.data.list;
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
 | 
							this.getDataList();
 | 
				
			||||||
 | 
							this.getPdLineList();
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						methods: {
 | 
				
			||||||
 | 
							handleExport() {
 | 
				
			||||||
 | 
								let tables = document.querySelector('.el-table').cloneNode(true);
 | 
				
			||||||
 | 
								const fix = tables.querySelector('.el-table__fixed');
 | 
				
			||||||
 | 
								const fixRight = tables.querySelector('.el-table__fixed-right');
 | 
				
			||||||
 | 
								if (fix) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if (fixRight) {
 | 
				
			||||||
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed-right'));
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								let exportTable = XLSX.utils.table_to_book(tables);
 | 
				
			||||||
 | 
					      exportTable.Sheets.Sheet1.A1.v = '序号' //导出表格第一列表头为序号
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								var exportTableOut = XLSX.write(exportTable, {
 | 
				
			||||||
 | 
									bookType: 'xlsx',
 | 
				
			||||||
 | 
									bookSST: true,
 | 
				
			||||||
 | 
									type: 'array',
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
								// sheetjs.xlsx为导出表格的标题名称
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
 | 
									FileSaver.saveAs(
 | 
				
			||||||
 | 
										new Blob([exportTableOut], {
 | 
				
			||||||
 | 
											type: 'application/octet-stream',
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
 | 
										this.fileName + '产品自动报表.xlsx'
 | 
				
			||||||
 | 
									);
 | 
				
			||||||
 | 
								} catch (e) {
 | 
				
			||||||
 | 
									if (typeof console !== 'undefined') console.log(e, exportTableOut);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return exportTableOut;
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							getPdLineList() {
 | 
				
			||||||
 | 
								const params = {
 | 
				
			||||||
 | 
									pageSize: 100,
 | 
				
			||||||
 | 
									pageNo: 1,
 | 
				
			||||||
 | 
								};
 | 
				
			||||||
 | 
								getFactoryPage(params).then((res) => {
 | 
				
			||||||
 | 
									this.formConfig[0].selectOptions = res.data.list || [];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							buttonClick(val) {
 | 
				
			||||||
 | 
								switch (val.btnName) {
 | 
				
			||||||
 | 
									case 'search':
 | 
				
			||||||
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
 | 
										this.listQuery.factoryId = val.factoryId || undefined;
 | 
				
			||||||
 | 
										this.listQuery.process = val.process || undefined;
 | 
				
			||||||
 | 
										this.listQuery.reportType = val.reportType || undefined;
 | 
				
			||||||
 | 
										this.listQuery.startTime = val.timeVal ? val.timeVal[0] : undefined;
 | 
				
			||||||
 | 
										this.listQuery.endTime = val.timeVal ? val.timeVal[1] : undefined;
 | 
				
			||||||
 | 
										this.getDataList();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									case 'export':
 | 
				
			||||||
 | 
										this.handleExport();
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
									default:
 | 
				
			||||||
 | 
										console.log(val);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 获取数据列表
 | 
				
			||||||
 | 
							getDataList() {
 | 
				
			||||||
 | 
								this.dataListLoading = true;
 | 
				
			||||||
 | 
								const arr = ['日', '周', '月', '年'];
 | 
				
			||||||
 | 
								this.tableProps = [];
 | 
				
			||||||
 | 
								this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
				
			||||||
 | 
									if (response.data) {
 | 
				
			||||||
 | 
										let tableArr = [];
 | 
				
			||||||
 | 
										this.tableData = response.data?.list?.map((item, stop) => {
 | 
				
			||||||
 | 
											item.reportType = arr[item.reportType - 1];
 | 
				
			||||||
 | 
											if (stop === 0) {
 | 
				
			||||||
 | 
												item.lineDetList.forEach((prop, index) => {
 | 
				
			||||||
 | 
													item['inputArea' + index] = prop.inputArea;
 | 
				
			||||||
 | 
													item['outputArea' + index] = prop.outputArea;
 | 
				
			||||||
 | 
													item['lossArea' + index] = prop.lossArea;
 | 
				
			||||||
 | 
													item['originalLossArea' + index] = prop.originalLossArea;
 | 
				
			||||||
 | 
													item['outputRatio' + index] = prop.outputRatio;
 | 
				
			||||||
 | 
													item['processingRatio' + index] = prop.processingRatio;
 | 
				
			||||||
 | 
													const subprop = {
 | 
				
			||||||
 | 
														label: prop.lineName,
 | 
				
			||||||
 | 
					                  align: 'center',
 | 
				
			||||||
 | 
														children: [
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																prop: 'inputArea' + index,
 | 
				
			||||||
 | 
																label: '投入面积/m²',
 | 
				
			||||||
 | 
																filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																prop: 'outputArea' + index,
 | 
				
			||||||
 | 
																label: '产出面积/m²',
 | 
				
			||||||
 | 
																filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																prop: 'lossArea' + index,
 | 
				
			||||||
 | 
																label: '不良面积/m²',
 | 
				
			||||||
 | 
																filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																prop: 'originalLossArea' + index,
 | 
				
			||||||
 | 
																label: '原片不良/m²',
 | 
				
			||||||
 | 
																filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																prop: 'outputRatio' + index,
 | 
				
			||||||
 | 
																label: '投入产出率/%',
 | 
				
			||||||
 | 
																filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
															{
 | 
				
			||||||
 | 
																prop: 'processingRatio' + index,
 | 
				
			||||||
 | 
																label: '加工成品率/%',
 | 
				
			||||||
 | 
																filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
															},
 | 
				
			||||||
 | 
														],
 | 
				
			||||||
 | 
													};
 | 
				
			||||||
 | 
													tableArr.push(subprop);
 | 
				
			||||||
 | 
												});
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											return item;
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										this.tableProps.push(...this.tableProps1);
 | 
				
			||||||
 | 
										this.tableProps.splice(5, 0, ...tableArr);
 | 
				
			||||||
 | 
										this.listQuery.total = response.data.total;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									this.listQuery.total = 0;
 | 
				
			||||||
 | 
									this.dataListLoading = false;
 | 
				
			||||||
 | 
									this.showData = this.tableData||[];
 | 
				
			||||||
 | 
								});
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 每页数
 | 
				
			||||||
 | 
							sizeChangeHandle(val) {
 | 
				
			||||||
 | 
								this.listQuery.pageSize = val;
 | 
				
			||||||
 | 
								this.listQuery.pageNo = 1;
 | 
				
			||||||
 | 
								this.getDataList();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							// 当前页
 | 
				
			||||||
 | 
							currentChangeHandle(val) {
 | 
				
			||||||
 | 
								this.listQuery.pageNo = val;
 | 
				
			||||||
 | 
								this.getDataList();
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
 * @Author: Do not edit
 | 
					 * @Author: Do not edit
 | 
				
			||||||
 * @Date: 2023-08-29 14:59:29
 | 
					 * @Date: 2023-08-29 14:59:29
 | 
				
			||||||
 * @LastEditTime: 2023-10-16 15:19:04
 | 
					 * @LastEditTime: 2024-12-02 13:44:47
 | 
				
			||||||
 * @LastEditors: DY
 | 
					 * @LastEditors: zwq
 | 
				
			||||||
 * @Description:
 | 
					 * @Description:
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
@@ -69,11 +69,13 @@ const tableProps = [
 | 
				
			|||||||
		prop: 'reportStartTime',
 | 
							prop: 'reportStartTime',
 | 
				
			||||||
		label: '统计开始时间',
 | 
							label: '统计开始时间',
 | 
				
			||||||
		filter: parseTime,
 | 
							filter: parseTime,
 | 
				
			||||||
 | 
					    width:160
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'reportEndTime',
 | 
							prop: 'reportEndTime',
 | 
				
			||||||
		label: '统计结束时间',
 | 
							label: '统计结束时间',
 | 
				
			||||||
		filter: parseTime,
 | 
							filter: parseTime,
 | 
				
			||||||
 | 
					    width:160
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lineName',
 | 
							prop: 'lineName',
 | 
				
			||||||
@@ -93,7 +95,8 @@ const tableProps = [
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outputArea',
 | 
							prop: 'outputArea',
 | 
				
			||||||
		label: '产出面积/㎡'
 | 
							label: '产出面积/㎡',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lossNum',
 | 
							prop: 'lossNum',
 | 
				
			||||||
@@ -101,11 +104,13 @@ const tableProps = [
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lossArea',
 | 
							prop: 'lossArea',
 | 
				
			||||||
		label: '损耗面积/㎡'
 | 
							label: '损耗面积/㎡',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'lossRatio',
 | 
							prop: 'lossRatio',
 | 
				
			||||||
		label: '损耗比例%'
 | 
							label: '损耗比例%',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -305,12 +310,12 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.lineId = val.line ? val.line : undefined;
 | 
										this.listQuery.lineId = val.line ? val.line : undefined;
 | 
				
			||||||
					this.listQuery.sectionId = val.section ? val.section : undefined;
 | 
										this.listQuery.sectionId = val.section ? val.section : undefined;
 | 
				
			||||||
					this.listQuery.reportType = val.reportType ? val.reportType : undefined;
 | 
										this.listQuery.reportType = val.reportType ? val.reportType : undefined;
 | 
				
			||||||
					this.listQuery.reportStartTime = val.timeVal ? [new Date(val.timeVal[0]).getTime()] : undefined;
 | 
										this.listQuery.reportStartTime = val.timeVal ? [new Date(val.timeVal[0]).getTime(),new Date(val.timeVal[1]).getTime()] : undefined;
 | 
				
			||||||
					this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
 | 
										//this.listQuery.reportEndTime = val.timeVal ? [new Date(val.timeVal[1]).getTime()] : undefined;
 | 
				
			||||||
					if (val.timeVal && val.timeVal.length > 0) {
 | 
										if (val.timeVal && val.timeVal.length > 0) {
 | 
				
			||||||
						this.fileName = val.timeVal[0].slice(0, 10) + '-' + val.timeVal[1].slice(0, 10) + '_'
 | 
											this.fileName = val.timeVal[0].slice(0, 10) + '-' + val.timeVal[1].slice(0, 10) + '_'
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,8 +14,7 @@
 | 
				
			|||||||
			:limit="listQuery.pageSize"
 | 
								:limit="listQuery.pageSize"
 | 
				
			||||||
			:selectWidth="55"
 | 
								:selectWidth="55"
 | 
				
			||||||
			:table-data="showData"
 | 
								:table-data="showData"
 | 
				
			||||||
			@selection-change="selectChange"
 | 
								@selection-change="selectChange" />
 | 
				
			||||||
		/>
 | 
					 | 
				
			||||||
		<div v-else class="no-data-bg"></div>
 | 
							<div v-else class="no-data-bg"></div>
 | 
				
			||||||
		<pagination
 | 
							<pagination
 | 
				
			||||||
			:limit.sync="listQuery.pageSize"
 | 
								:limit.sync="listQuery.pageSize"
 | 
				
			||||||
@@ -28,10 +27,12 @@
 | 
				
			|||||||
			width="30%"
 | 
								width="30%"
 | 
				
			||||||
			:before-close="handleClose">
 | 
								:before-close="handleClose">
 | 
				
			||||||
			<el-button type="primary" @click="exportXlsx">xlsx</el-button>
 | 
								<el-button type="primary" @click="exportXlsx">xlsx</el-button>
 | 
				
			||||||
  		<el-button type="success" @click="exportPdf">pdf</el-button>
 | 
								<el-button type="success" @click="exportPdf">pdf</el-button>
 | 
				
			||||||
			<span slot="footer" class="dialog-footer">
 | 
								<span slot="footer" class="dialog-footer">
 | 
				
			||||||
				<el-button @click="dialogVisible = false">取 消</el-button>
 | 
									<el-button @click="dialogVisible = false">取 消</el-button>
 | 
				
			||||||
				<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
 | 
									<el-button type="primary" @click="dialogVisible = false">
 | 
				
			||||||
 | 
										确 定
 | 
				
			||||||
 | 
									</el-button>
 | 
				
			||||||
			</span>
 | 
								</span>
 | 
				
			||||||
		</el-dialog>
 | 
							</el-dialog>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
@@ -42,40 +43,43 @@
 | 
				
			|||||||
import { getSectionDataSearch } from '@/api/core/monitoring';
 | 
					import { getSectionDataSearch } from '@/api/core/monitoring';
 | 
				
			||||||
import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
					import { getProductionLinePage } from '@/api/core/base/productionLine';
 | 
				
			||||||
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
					import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
 | 
				
			||||||
import * as XLSX from 'xlsx'
 | 
					import { parseTime } from '@/filter/code-filter';
 | 
				
			||||||
import FileSaver from 'file-saver'
 | 
					import * as XLSX from 'xlsx';
 | 
				
			||||||
import jsPDF from 'jspdf'
 | 
					import FileSaver from 'file-saver';
 | 
				
			||||||
import html2canvas from 'html2canvas'
 | 
					import jsPDF from 'jspdf';
 | 
				
			||||||
 | 
					import html2canvas from 'html2canvas';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
    prop: 'proLineName',
 | 
							prop: 'proLineName',
 | 
				
			||||||
		label: '产线名称'
 | 
							label: '产线名称',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'sectionName',
 | 
				
			||||||
 | 
							label: '工段名称',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'inputNum',
 | 
				
			||||||
 | 
							label: '进片数量/片',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'outputNum',
 | 
				
			||||||
 | 
							label: '出片数量/片',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossNum',
 | 
				
			||||||
 | 
							label: '损耗数量/片',
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossArea',
 | 
				
			||||||
 | 
							label: '损耗面积/m²',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							prop: 'lossRate',
 | 
				
			||||||
 | 
							label: '损耗比例/%',
 | 
				
			||||||
 | 
					    filter: (val) => (val != null ? val.toFixed(2) : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    prop: 'sectionName',
 | 
					 | 
				
			||||||
    label: '工段名称'
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    prop: 'inputNum',
 | 
					 | 
				
			||||||
    label: '进片数量/片'
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    prop: 'outputNum',
 | 
					 | 
				
			||||||
    label: '出片数量/片'
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    prop: 'lossNum',
 | 
					 | 
				
			||||||
    label: '损耗数量/片'
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    prop: 'lossArea',
 | 
					 | 
				
			||||||
    label: '损耗面积/m²'
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    prop: 'lossRate',
 | 
					 | 
				
			||||||
    label: '损耗比例/%'
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
@@ -83,29 +87,29 @@ export default {
 | 
				
			|||||||
	data() {
 | 
						data() {
 | 
				
			||||||
		return {
 | 
							return {
 | 
				
			||||||
			urlOptions: {
 | 
								urlOptions: {
 | 
				
			||||||
        getDataListURL: getSectionDataSearch,
 | 
									getDataListURL: getSectionDataSearch,
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			tableProps,
 | 
								tableProps,
 | 
				
			||||||
      tableData: [],
 | 
								tableData: [],
 | 
				
			||||||
			showData: [],
 | 
								showData: [],
 | 
				
			||||||
			selectedList: [],
 | 
								selectedList: [],
 | 
				
			||||||
      listQuery: {
 | 
								listQuery: {
 | 
				
			||||||
        proLineId:undefined,
 | 
									proLineId: undefined,
 | 
				
			||||||
        sectionId: undefined,
 | 
									sectionId: undefined,
 | 
				
			||||||
        startTime: undefined,
 | 
									startTime: undefined,
 | 
				
			||||||
        endTime: undefined,
 | 
									endTime: undefined,
 | 
				
			||||||
				total: 0
 | 
									total: 0,
 | 
				
			||||||
      },
 | 
								},
 | 
				
			||||||
			dataListLoading: false,
 | 
								dataListLoading: false,
 | 
				
			||||||
			dialogVisible: false,
 | 
								dialogVisible: false,
 | 
				
			||||||
			fileName: [],
 | 
								fileName: [],
 | 
				
			||||||
      optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
 | 
								optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
 | 
				
			||||||
			formConfig: [
 | 
								formConfig: [
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
					label: '产线',
 | 
										label: '产线',
 | 
				
			||||||
					selectOptions: [],
 | 
										selectOptions: [],
 | 
				
			||||||
          param: 'proLineId',
 | 
										param: 'proLineId',
 | 
				
			||||||
					defaultSelect: '',
 | 
										defaultSelect: '',
 | 
				
			||||||
					filterable: true,
 | 
										filterable: true,
 | 
				
			||||||
					onchange: true,
 | 
										onchange: true,
 | 
				
			||||||
@@ -114,7 +118,7 @@ export default {
 | 
				
			|||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
					label: '工段',
 | 
										label: '工段',
 | 
				
			||||||
					selectOptions: [],
 | 
										selectOptions: [],
 | 
				
			||||||
          param: 'sectionId',
 | 
										param: 'sectionId',
 | 
				
			||||||
					defaultSelect: '',
 | 
										defaultSelect: '',
 | 
				
			||||||
					filterable: true,
 | 
										filterable: true,
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
@@ -143,15 +147,21 @@ export default {
 | 
				
			|||||||
					btnName: '导出',
 | 
										btnName: '导出',
 | 
				
			||||||
					name: 'export',
 | 
										name: 'export',
 | 
				
			||||||
					color: 'warning',
 | 
										color: 'warning',
 | 
				
			||||||
				}
 | 
									},
 | 
				
			||||||
			],
 | 
								],
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	components: {
 | 
						components: {},
 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	created() {
 | 
						created() {
 | 
				
			||||||
    this.getArr();
 | 
							this.getArr();
 | 
				
			||||||
    // this.getDataList()
 | 
							const end = new Date();
 | 
				
			||||||
 | 
							const start = new Date();
 | 
				
			||||||
 | 
							start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
 | 
				
			||||||
 | 
							this.listQuery.startTime = start.getTime();
 | 
				
			||||||
 | 
							this.listQuery.endTime = end.getTime();
 | 
				
			||||||
 | 
							this.formConfig[2].startPlaceholder = parseTime(start).substr(0, 10);
 | 
				
			||||||
 | 
							this.formConfig[2].endPlaceholder = parseTime(end).substr(0, 10);
 | 
				
			||||||
 | 
							this.getDataList();
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		/** 根据产线获取工段 */
 | 
							/** 根据产线获取工段 */
 | 
				
			||||||
@@ -184,92 +194,96 @@ export default {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		test() {
 | 
							test() {
 | 
				
			||||||
			var target = document.getElementsByClassName("right-aside")[0]
 | 
								var target = document.getElementsByClassName('right-aside')[0];
 | 
				
			||||||
			target.style.background = '#FFFFFF'
 | 
								target.style.background = '#FFFFFF';
 | 
				
			||||||
			var that = this
 | 
								var that = this;
 | 
				
			||||||
			setTimeout(() => {
 | 
								setTimeout(() => {
 | 
				
			||||||
				html2canvas(target).then(function(canvas) {
 | 
									html2canvas(target).then(function (canvas) {
 | 
				
			||||||
						var contentWidth = canvas.width
 | 
										var contentWidth = canvas.width;
 | 
				
			||||||
						var contentHeight = canvas.height
 | 
										var contentHeight = canvas.height;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						// 一页pdf显示html页面生成的canvas高度
 | 
										// 一页pdf显示html页面生成的canvas高度
 | 
				
			||||||
						var pageHeight = contentHeight / 592.28 * 841.89
 | 
										var pageHeight = (contentHeight / 592.28) * 841.89;
 | 
				
			||||||
						// 未生成pdf的html页面高度
 | 
										// 未生成pdf的html页面高度
 | 
				
			||||||
						var leftHeight = contentHeight
 | 
										var leftHeight = contentHeight;
 | 
				
			||||||
						// 页面偏移
 | 
										// 页面偏移
 | 
				
			||||||
						var position = 0
 | 
										var position = 0;
 | 
				
			||||||
						// a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的高度
 | 
										// a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的高度
 | 
				
			||||||
						var imgWidth = 595.28
 | 
										var imgWidth = 595.28;
 | 
				
			||||||
						var imgHeight = 592.28 / contentWidth * contentHeight
 | 
										var imgHeight = (592.28 / contentWidth) * contentHeight;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						var pageData = canvas.toDataURL('image/jpeg', 1.0)
 | 
										var pageData = canvas.toDataURL('image/jpeg', 1.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						console.log('nihc URL', leftHeight, pageHeight)
 | 
										console.log('nihc URL', leftHeight, pageHeight);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						var pdf = new jsPDF('', 'pt', 'a4')
 | 
										var pdf = new jsPDF('', 'pt', 'a4');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						if (leftHeight < pageHeight) {
 | 
										if (leftHeight < pageHeight) {
 | 
				
			||||||
							pdf.addImage(pageData, 'JPEG', 0, 20, imgWidth, imgHeight)
 | 
											pdf.addImage(pageData, 'JPEG', 0, 20, imgWidth, imgHeight);
 | 
				
			||||||
						} else {
 | 
										} else {
 | 
				
			||||||
							while(leftHeight > 0) {
 | 
											while (leftHeight > 0) {
 | 
				
			||||||
								pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight)
 | 
												pdf.addImage(pageData, 'JPEG', 0, position, imgWidth, imgHeight);
 | 
				
			||||||
								leftHeight -= pageHeight
 | 
												leftHeight -= pageHeight;
 | 
				
			||||||
								position -= 841.89
 | 
												position -= 841.89;
 | 
				
			||||||
								// 避免空白页
 | 
												// 避免空白页
 | 
				
			||||||
								if (leftHeight > 0) {
 | 
												if (leftHeight > 0) {
 | 
				
			||||||
									pdf.addPage()
 | 
													pdf.addPage();
 | 
				
			||||||
								}
 | 
					 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						pdf.save(that.fileName[0] + '-' + that.fileName[1] + '_工段统计.pdf')
 | 
										pdf.save(that.fileName[0] + '-' + that.fileName[1] + '_工段统计.pdf');
 | 
				
			||||||
				})
 | 
									});
 | 
				
			||||||
			}, 300)
 | 
								}, 300);
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		exportECL() {
 | 
							exportECL() {
 | 
				
			||||||
			let tables = document.querySelector('.el-table').cloneNode(true)
 | 
								let tables = document.querySelector('.el-table').cloneNode(true);
 | 
				
			||||||
			const fix = tables.querySelector('.el-table__fixed')
 | 
								const fix = tables.querySelector('.el-table__fixed');
 | 
				
			||||||
			const fixRight = tables.querySelector('.el-table__fixed-right')
 | 
								const fixRight = tables.querySelector('.el-table__fixed-right');
 | 
				
			||||||
			if (fix) {
 | 
								if (fix) {
 | 
				
			||||||
				tables.removeChild(tables.querySelector('.el-table__fixed'))
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed'));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (fixRight) {
 | 
								if (fixRight) {
 | 
				
			||||||
				tables.removeChild(tables.querySelector('.el-table__fixed-right'))
 | 
									tables.removeChild(tables.querySelector('.el-table__fixed-right'));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			let exportTable = XLSX.utils.table_to_book(tables)
 | 
								let exportTable = XLSX.utils.table_to_book(tables);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var exportTableOut = XLSX.write(exportTable, {
 | 
								var exportTableOut = XLSX.write(exportTable, {
 | 
				
			||||||
        bookType: 'xlsx', bookSST: true, type: 'array'
 | 
									bookType: 'xlsx',
 | 
				
			||||||
      })
 | 
									bookSST: true,
 | 
				
			||||||
      // sheetjs.xlsx为导出表格的标题名称
 | 
									type: 'array',
 | 
				
			||||||
      try {
 | 
								});
 | 
				
			||||||
        FileSaver.saveAs(new Blob([exportTableOut], {
 | 
								// sheetjs.xlsx为导出表格的标题名称
 | 
				
			||||||
          type: 'application/octet-stream'
 | 
								try {
 | 
				
			||||||
        }), this.fileName[0] + '-' + this.fileName[1] + '_工段统计.xlsx')
 | 
									FileSaver.saveAs(
 | 
				
			||||||
      } catch (e) {
 | 
										new Blob([exportTableOut], {
 | 
				
			||||||
        if (typeof console !== 'undefined') console.log(e, exportTableOut)
 | 
											type: 'application/octet-stream',
 | 
				
			||||||
      }
 | 
										}),
 | 
				
			||||||
      return exportTableOut
 | 
										this.fileName[0] + '-' + this.fileName[1] + '_工段统计.xlsx'
 | 
				
			||||||
    },
 | 
									);
 | 
				
			||||||
 | 
								} catch (e) {
 | 
				
			||||||
 | 
									if (typeof console !== 'undefined') console.log(e, exportTableOut);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return exportTableOut;
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
		exportPdf() {
 | 
							exportPdf() {
 | 
				
			||||||
			this.test()
 | 
								this.test();
 | 
				
			||||||
			setTimeout(() =>{
 | 
								setTimeout(() => {
 | 
				
			||||||
				this.dialogVisible = false
 | 
									this.dialogVisible = false;
 | 
				
			||||||
				this.showData = this.tableData
 | 
									this.showData = this.tableData;
 | 
				
			||||||
			}, 600)
 | 
								}, 600);
 | 
				
			||||||
 | 
					 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		exportXlsx() {
 | 
							exportXlsx() {
 | 
				
			||||||
			this.exportECL()
 | 
								this.exportECL();
 | 
				
			||||||
			this.dialogVisible = false
 | 
								this.dialogVisible = false;
 | 
				
			||||||
			this.showData = this.tableData
 | 
								this.showData = this.tableData;
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		handleClose(done) {
 | 
							handleClose(done) {
 | 
				
			||||||
			this.$confirm('确认关闭?')
 | 
								this.$confirm('确认关闭?')
 | 
				
			||||||
				.then(_ => {
 | 
									.then((_) => {
 | 
				
			||||||
					done();
 | 
										done();
 | 
				
			||||||
				})
 | 
									})
 | 
				
			||||||
				.catch(_ => {});
 | 
									.catch((_) => {});
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		getArr() {
 | 
							getArr() {
 | 
				
			||||||
			const params = {
 | 
								const params = {
 | 
				
			||||||
@@ -281,61 +295,63 @@ export default {
 | 
				
			|||||||
					this.formConfig[index].selectOptions = response.data.list;
 | 
										this.formConfig[index].selectOptions = response.data.list;
 | 
				
			||||||
				});
 | 
									});
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
    getDataList() {
 | 
							getDataList() {
 | 
				
			||||||
      // this.listQuery.proLineId = '1672847052717821953';
 | 
								this.urlOptions.getDataListURL(this.listQuery).then((res) => {
 | 
				
			||||||
      // this.listQuery.startTime = '1690626657000'
 | 
									this.tableData = res.data;
 | 
				
			||||||
      // this.listQuery.endTime = '1693564257000'
 | 
									this.listQuery.total = this.tableData.length;
 | 
				
			||||||
      this.urlOptions.getDataListURL(this.listQuery).then(res => {
 | 
									this.dataListLoading = false;
 | 
				
			||||||
        this.tableData = res.data
 | 
					 | 
				
			||||||
        this.listQuery.total = this.tableData.length;
 | 
					 | 
				
			||||||
        this.dataListLoading = false;
 | 
					 | 
				
			||||||
				this.showData = this.tableData;
 | 
									this.showData = this.tableData;
 | 
				
			||||||
      });
 | 
								});
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
		// 每页数
 | 
							// 每页数
 | 
				
			||||||
    sizeChangeHandle(val) {
 | 
							sizeChangeHandle(val) {
 | 
				
			||||||
      this.listQuery.pageSize = val;
 | 
								this.listQuery.pageSize = val;
 | 
				
			||||||
      this.listQuery.pageNo = 1;
 | 
								this.listQuery.pageNo = 1;
 | 
				
			||||||
      this.getDataList();
 | 
								this.getDataList();
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
    // 当前页
 | 
							// 当前页
 | 
				
			||||||
    currentChangeHandle(val) {
 | 
							currentChangeHandle(val) {
 | 
				
			||||||
      this.listQuery.pageNo = val;
 | 
								this.listQuery.pageNo = val;
 | 
				
			||||||
      this.getDataList();
 | 
								this.getDataList();
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
		handleExport() {
 | 
							handleExport() {
 | 
				
			||||||
			if (this.selectedList.length > 0) {
 | 
								if (this.selectedList.length > 0) {
 | 
				
			||||||
				this.showData = this.selectedList
 | 
									this.showData = this.selectedList;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			this.dialogVisible = true
 | 
								this.dialogVisible = true;
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
		selectChange(val) {
 | 
							selectChange(val) {
 | 
				
			||||||
      console.log(val)
 | 
								console.log(val);
 | 
				
			||||||
      this.selectedList = val
 | 
								this.selectedList = val;
 | 
				
			||||||
    },
 | 
							},
 | 
				
			||||||
    buttonClick(val) {
 | 
							buttonClick(val) {
 | 
				
			||||||
      console.log(val)
 | 
								console.log(val);
 | 
				
			||||||
      switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
        case 'search':
 | 
									case 'search':
 | 
				
			||||||
          console.log(val.timeSlot);
 | 
										console.log(val.timeSlot);
 | 
				
			||||||
 | 
										this.formConfig[2].startPlaceholder = '开始时间';
 | 
				
			||||||
 | 
										this.formConfig[2].endPlaceholder = '结束时间';
 | 
				
			||||||
					// this.listQuery.pageNo = 1;
 | 
										// this.listQuery.pageNo = 1;
 | 
				
			||||||
          // this.listQuery.pageSize = 20;
 | 
										// this.listQuery.pageSize = 10;
 | 
				
			||||||
          this.listQuery.proLineId = val.proLineId ? val.proLineId : undefined
 | 
										this.listQuery.proLineId = val.proLineId ? val.proLineId : undefined;
 | 
				
			||||||
          this.listQuery.sectionId = val.sectionId ? val.sectionId : undefined
 | 
										this.listQuery.sectionId = val.sectionId ? val.sectionId : undefined;
 | 
				
			||||||
          this.listQuery.startTime = val.timeSlot ? new Date(val.timeSlot[0]).getTime() : undefined
 | 
										this.listQuery.startTime = val.timeSlot
 | 
				
			||||||
          this.listQuery.endTime = val.timeSlot ? new Date(val.timeSlot[1]).getTime() : undefined
 | 
											? new Date(val.timeSlot[0]).getTime()
 | 
				
			||||||
 | 
											: undefined;
 | 
				
			||||||
 | 
										this.listQuery.endTime = val.timeSlot
 | 
				
			||||||
 | 
											? new Date(val.timeSlot[1]).getTime()
 | 
				
			||||||
 | 
											: undefined;
 | 
				
			||||||
					if (val.timeSlot && val.timeSlot.length > 0) {
 | 
										if (val.timeSlot && val.timeSlot.length > 0) {
 | 
				
			||||||
						this.fileName[0] = val.timeSlot[0].slice(0, 10)
 | 
											this.fileName[0] = val.timeSlot[0].slice(0, 10);
 | 
				
			||||||
						this.fileName[1] = val.timeSlot[1].slice(0, 10)
 | 
											this.fileName[1] = val.timeSlot[1].slice(0, 10);
 | 
				
			||||||
            this.getDataList()
 | 
											this.getDataList();
 | 
				
			||||||
          } else {
 | 
										} else {
 | 
				
			||||||
            this.$message({
 | 
											this.$message({
 | 
				
			||||||
              message: '请选择时间',
 | 
												message: '请选择时间',
 | 
				
			||||||
              type: 'warning'
 | 
												type: 'warning',
 | 
				
			||||||
            });
 | 
											});
 | 
				
			||||||
          }
 | 
										}
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'reset':
 | 
									case 'reset':
 | 
				
			||||||
					this.$refs.searchBarForm.resetForm();
 | 
										this.$refs.searchBarForm.resetForm();
 | 
				
			||||||
@@ -349,12 +365,12 @@ export default {
 | 
				
			|||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					if (val.timeSlot && val.timeSlot.length > 0) {
 | 
										if (val.timeSlot && val.timeSlot.length > 0) {
 | 
				
			||||||
						this.handleExport();
 | 
											this.handleExport();
 | 
				
			||||||
          } else {
 | 
										} else {
 | 
				
			||||||
            this.$message({
 | 
											this.$message({
 | 
				
			||||||
              message: '请选择时间',
 | 
												message: '请选择时间',
 | 
				
			||||||
              type: 'warning'
 | 
												type: 'warning',
 | 
				
			||||||
            });
 | 
											});
 | 
				
			||||||
          }
 | 
										}
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
					console.log(val);
 | 
										console.log(val);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
	<div>
 | 
						<div>
 | 
				
			||||||
		<!-- <div style="background: #f2f4f9; height: 40px; width: 100%">
 | 
							<div style="background: #f2f4f9; height: 40px; width: 100%">
 | 
				
			||||||
			<ButtonNav :menus="['按日期', '按规格']" @change="currentMenu">
 | 
								<ButtonNav :menus="['按日期', '按规格']" @change="currentMenu">
 | 
				
			||||||
				<template v-slot:tab1>
 | 
									<template v-slot:tab1>
 | 
				
			||||||
					<div>按日期</div>
 | 
										<div>按日期</div>
 | 
				
			||||||
@@ -9,7 +9,7 @@
 | 
				
			|||||||
					<div>按规格</div>
 | 
										<div>按规格</div>
 | 
				
			||||||
				</template>
 | 
									</template>
 | 
				
			||||||
			</ButtonNav>
 | 
								</ButtonNav>
 | 
				
			||||||
		</div> -->
 | 
							</div>
 | 
				
			||||||
		<div class="app-container energyOverlimitLog">
 | 
							<div class="app-container energyOverlimitLog">
 | 
				
			||||||
			<div v-show="activeName === 'his'">
 | 
								<div v-show="activeName === 'his'">
 | 
				
			||||||
				<!-- 搜索工作栏 -->
 | 
									<!-- 搜索工作栏 -->
 | 
				
			||||||
@@ -54,7 +54,7 @@
 | 
				
			|||||||
				:page.sync="listQuery.pageNo"
 | 
									:page.sync="listQuery.pageNo"
 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
									:limit.sync="listQuery.pageSize"
 | 
				
			||||||
				:total="listQuery.total"
 | 
									:total="listQuery.total"
 | 
				
			||||||
				@pagination="getNavDataList" />
 | 
									@pagination="getDataList" />
 | 
				
			||||||
			<base-dialog
 | 
								<base-dialog
 | 
				
			||||||
				:dialogTitle="addOrEditTitle"
 | 
									:dialogTitle="addOrEditTitle"
 | 
				
			||||||
				:dialogVisible="addOrUpdateVisible"
 | 
									:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
@@ -86,36 +86,32 @@ import ButtonNav from '@/components/ButtonNav';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'time',
 | 
							prop: 'recTime',
 | 
				
			||||||
		label: '日期',
 | 
							label: '日期',
 | 
				
			||||||
 | 
							filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'originArea',
 | 
							prop: 'originArea',
 | 
				
			||||||
		label: '原片下片面积',
 | 
							label: '原片下片面积',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'deepArea',
 | 
							prop: 'deepArea',
 | 
				
			||||||
		label: '深加工下片面积',
 | 
							label: '深加工下片面积',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'originPrice',
 | 
							prop: 'originPrice',
 | 
				
			||||||
		label: '原片成本/元',
 | 
							label: '原片成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'deepPrice',
 | 
							prop: 'deepPrice',
 | 
				
			||||||
		label: '深加工成本/元',
 | 
							label: '深加工成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'price',
 | 
							prop: 'price',
 | 
				
			||||||
		label: '总成本/元',
 | 
							label: '总成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
const tableProps2 = [
 | 
					const tableProps2 = [
 | 
				
			||||||
@@ -248,12 +244,19 @@ export default {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		buttonClick(val) {
 | 
							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].startPlaceholder = '开始时间';
 | 
				
			||||||
			this.formConfig2[0].endPlaceholder = '结束时间';
 | 
								this.formConfig2[0].endPlaceholder = '结束时间';
 | 
				
			||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.bindObjectId = val.name || null;
 | 
										this.listQuery.bindObjectId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
@@ -271,7 +274,7 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.bindObjectId = val.name || null;
 | 
										this.listQuery.bindObjectId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
@@ -331,19 +334,12 @@ export default {
 | 
				
			|||||||
				this.otherMethods(val);
 | 
									this.otherMethods(val);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    getNavDataList(){
 | 
					 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
				this.getDataList();
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.getDataList2();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		/** 导出按钮操作 */
 | 
							/** 导出按钮操作 */
 | 
				
			||||||
		handleExport() {
 | 
							handleExport() {
 | 
				
			||||||
			let exportURL, title;
 | 
								let exportURL, title;
 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
								if (this.activeName === 'his') {
 | 
				
			||||||
				exportURL = exportCostSumExcel;
 | 
									exportURL = exportCostSumExcel;
 | 
				
			||||||
        title = '总成本统计';
 | 
					        title = '总成本统计-按日期';
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				exportURL = exportRawStatisticsRealtimeExcel;
 | 
									exportURL = exportRawStatisticsRealtimeExcel;
 | 
				
			||||||
        title = '总成本统计-按规格';
 | 
					        title = '总成本统计-按规格';
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,7 +77,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name||null;
 | 
										this.listQuery.name = val.name||null;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
@@ -90,7 +90,7 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
					this.listQuery.recTime = val.searchTime;
 | 
										this.listQuery.recTime = val.searchTime;
 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,7 +54,7 @@
 | 
				
			|||||||
				:page.sync="listQuery.pageNo"
 | 
									:page.sync="listQuery.pageNo"
 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
									:limit.sync="listQuery.pageSize"
 | 
				
			||||||
				:total="listQuery.total"
 | 
									:total="listQuery.total"
 | 
				
			||||||
				@pagination="getNavDataList" />
 | 
									@pagination="getDataList" />
 | 
				
			||||||
			<base-dialog
 | 
								<base-dialog
 | 
				
			||||||
				:dialogTitle="addOrEditTitle"
 | 
									:dialogTitle="addOrEditTitle"
 | 
				
			||||||
				:dialogVisible="addOrUpdateVisible"
 | 
									:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
@@ -86,27 +86,24 @@ import ButtonNav from '@/components/ButtonNav';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'time',
 | 
							prop: 'recTime',
 | 
				
			||||||
		label: '日期',
 | 
							label: '日期',
 | 
				
			||||||
	},
 | 
							filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'energyTypeName',
 | 
							prop: 'energyTypeName',
 | 
				
			||||||
		label: '能源类型',
 | 
							label: '能源类型',
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	// {
 | 
						{
 | 
				
			||||||
	// 	prop: 'bindObjectName',
 | 
							prop: 'bindObjectName',
 | 
				
			||||||
	// 	label: '监控对象',
 | 
							label: '监控对象',
 | 
				
			||||||
	// 	filter: (val) => (val != null ? val : '--'),
 | 
							filter: (val) => (val != null ? val : '--'),
 | 
				
			||||||
	// },
 | 
						},
 | 
				
			||||||
	// {
 | 
						{
 | 
				
			||||||
	// 	prop: 'meterName',
 | 
							prop: 'meterName',
 | 
				
			||||||
	// 	label: '抄表名',
 | 
							label: '抄表名',
 | 
				
			||||||
	// 	filter: (val) => (val != null ? val : '--'),
 | 
							filter: (val) => (val != null ? val : '--'),
 | 
				
			||||||
	// },
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'quantity',
 | 
							prop: 'quantity',
 | 
				
			||||||
		label: '累计使用量',
 | 
							label: '累计使用量',
 | 
				
			||||||
@@ -118,24 +115,20 @@ const tableProps = [
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
const tableProps2 = [
 | 
					const tableProps2 = [
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'energyTypeName',
 | 
							prop: 'energyTypeName',
 | 
				
			||||||
		label: '能源类型',
 | 
							label: '能源类型',
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	// {
 | 
						{
 | 
				
			||||||
	// 	prop: 'bindObjectName',
 | 
							prop: 'bindObjectName',
 | 
				
			||||||
	// 	label: '监控对象',
 | 
							label: '监控对象',
 | 
				
			||||||
	// 	filter: (val) => (val != null ? val : '--'),
 | 
							filter: (val) => (val != null ? val : '--'),
 | 
				
			||||||
	// },
 | 
						},
 | 
				
			||||||
	// {
 | 
						{
 | 
				
			||||||
	// 	prop: 'meter',
 | 
							prop: 'meter',
 | 
				
			||||||
	// 	label: '抄表名',
 | 
							label: '抄表名',
 | 
				
			||||||
	// 	filter: (val) => (val != null ? val : '--'),
 | 
							filter: (val) => (val != null ? val : '--'),
 | 
				
			||||||
	// },
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'quantity',
 | 
							prop: 'quantity',
 | 
				
			||||||
		label: '累计使用量',
 | 
							label: '累计使用量',
 | 
				
			||||||
@@ -214,16 +207,13 @@ export default {
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'datePicker',
 | 
										type: 'datePicker',
 | 
				
			||||||
					label: '时间范围',
 | 
										label: '时间范围',
 | 
				
			||||||
					dateType: 'datetimerange',
 | 
										dateType: 'daterange',
 | 
				
			||||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
					rangeSeparator: '-',
 | 
										rangeSeparator: '-',
 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
					defaultTime: ['08:30:00', '08:30:00'],
 | 
					 | 
				
			||||||
					param: 'searchTime',
 | 
										param: 'searchTime',
 | 
				
			||||||
					width: 350,
 | 
					 | 
				
			||||||
					clearable: false,
 | 
					 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
@@ -272,18 +262,26 @@ export default {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		buttonClick(val) {
 | 
							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) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.energyTypeId = val.name || null;
 | 
										this.listQuery.energyTypeId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
										if (this.activeName === 'his') {
 | 
				
			||||||
						this.listQuery.endTime = val.searchTime
 | 
					 | 
				
			||||||
							? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
					 | 
				
			||||||
							: null;
 | 
					 | 
				
			||||||
						this.getDataList();
 | 
											this.getDataList();
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						this.getDataList2();
 | 
											this.getDataList2();
 | 
				
			||||||
@@ -294,18 +292,13 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.energyTypeId = val.name || null;
 | 
										this.listQuery.energyTypeId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
						this.listQuery.endTime = val.searchTime
 | 
					 | 
				
			||||||
							? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
					 | 
				
			||||||
							: null;
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
@@ -327,26 +320,15 @@ export default {
 | 
				
			|||||||
				const end = new Date();
 | 
									const end = new Date();
 | 
				
			||||||
				const start = new Date();
 | 
									const start = new Date();
 | 
				
			||||||
				start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
									start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
				
			||||||
				this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
 | 
									this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
 | 
				
			||||||
				this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
 | 
									this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
 | 
				
			||||||
				this.$nextTick(() => {
 | 
									this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
 | 
				
			||||||
					this.$refs.searchBarForm2.formInline.searchTime = [
 | 
									this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
 | 
				
			||||||
						this.listQuery.startTime,
 | 
					 | 
				
			||||||
						this.listQuery.endTime,
 | 
					 | 
				
			||||||
					];
 | 
					 | 
				
			||||||
				});
 | 
					 | 
				
			||||||
				this.listQuery.name = null;
 | 
									this.listQuery.name = null;
 | 
				
			||||||
				this.listQuery.pageNo = 1;
 | 
									this.listQuery.pageNo = 1;
 | 
				
			||||||
				this.getDataList2();
 | 
									this.getDataList2();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    getNavDataList(){
 | 
					 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
				this.getDataList();
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.getDataList2();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		// 获取数据2列表
 | 
							// 获取数据2列表
 | 
				
			||||||
		getDataList2() {
 | 
							getDataList2() {
 | 
				
			||||||
			if (this.listQuery.startTime) {
 | 
								if (this.listQuery.startTime) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,7 +54,7 @@
 | 
				
			|||||||
				:page.sync="listQuery.pageNo"
 | 
									:page.sync="listQuery.pageNo"
 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
									:limit.sync="listQuery.pageSize"
 | 
				
			||||||
				:total="listQuery.total"
 | 
									:total="listQuery.total"
 | 
				
			||||||
				@pagination="getNavDataList" />
 | 
									@pagination="getDataList" />
 | 
				
			||||||
			<base-dialog
 | 
								<base-dialog
 | 
				
			||||||
				:dialogTitle="addOrEditTitle"
 | 
									:dialogTitle="addOrEditTitle"
 | 
				
			||||||
				:dialogVisible="addOrUpdateVisible"
 | 
									:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
@@ -87,12 +87,9 @@ import ButtonNav from '@/components/ButtonNav';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'time',
 | 
							prop: 'recTime',
 | 
				
			||||||
		label: '日期',
 | 
							label: '日期',
 | 
				
			||||||
	},
 | 
							filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'otherCostName',
 | 
							prop: 'otherCostName',
 | 
				
			||||||
@@ -102,14 +99,9 @@ const tableProps = [
 | 
				
			|||||||
		prop: 'price',
 | 
							prop: 'price',
 | 
				
			||||||
		label: '总价(元)',
 | 
							label: '总价(元)',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
const tableProps2 = [
 | 
					const tableProps2 = [
 | 
				
			||||||
	// {
 | 
					 | 
				
			||||||
	// 	prop: 'remark',
 | 
					 | 
				
			||||||
	// 	label: '备注',
 | 
					 | 
				
			||||||
	// },
 | 
					 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'otherCostName',
 | 
							prop: 'otherCostName',
 | 
				
			||||||
		label: '成本名称',
 | 
							label: '成本名称',
 | 
				
			||||||
@@ -118,7 +110,6 @@ const tableProps2 = [
 | 
				
			|||||||
		prop: 'price',
 | 
							prop: 'price',
 | 
				
			||||||
		label: '总价(元)',
 | 
							label: '总价(元)',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
@@ -191,16 +182,13 @@ export default {
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'datePicker',
 | 
										type: 'datePicker',
 | 
				
			||||||
					label: '时间范围',
 | 
										label: '时间范围',
 | 
				
			||||||
					dateType: 'datetimerange',
 | 
										dateType: 'daterange',
 | 
				
			||||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
					rangeSeparator: '-',
 | 
										rangeSeparator: '-',
 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
					defaultTime: ['08:30:00', '08:30:00'],
 | 
					 | 
				
			||||||
					param: 'searchTime',
 | 
										param: 'searchTime',
 | 
				
			||||||
					width: 350,
 | 
					 | 
				
			||||||
					clearable: false,
 | 
					 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
@@ -249,20 +237,26 @@ export default {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		buttonClick(val) {
 | 
							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) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name || null;
 | 
										this.listQuery.name = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
										if (this.activeName === 'his') {
 | 
				
			||||||
						this.listQuery.endTime = val.searchTime
 | 
					 | 
				
			||||||
							? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
					 | 
				
			||||||
							: null;
 | 
					 | 
				
			||||||
						this.getDataList();
 | 
											this.getDataList();
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						this.getDataList2();
 | 
											this.getDataList2();
 | 
				
			||||||
@@ -273,18 +267,13 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name || null;
 | 
										this.listQuery.name = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
						this.listQuery.endTime = val.searchTime
 | 
					 | 
				
			||||||
							? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
					 | 
				
			||||||
							: null;
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
@@ -306,26 +295,15 @@ export default {
 | 
				
			|||||||
				const end = new Date();
 | 
									const end = new Date();
 | 
				
			||||||
				const start = new Date();
 | 
									const start = new Date();
 | 
				
			||||||
				start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
									start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
				
			||||||
				this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
 | 
									this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
 | 
				
			||||||
				this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
 | 
									this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
 | 
				
			||||||
				this.$nextTick(() => {
 | 
									this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
 | 
				
			||||||
					this.$refs.searchBarForm2.formInline.searchTime = [
 | 
									this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
 | 
				
			||||||
						this.listQuery.startTime,
 | 
					 | 
				
			||||||
						this.listQuery.endTime,
 | 
					 | 
				
			||||||
					];
 | 
					 | 
				
			||||||
				});
 | 
					 | 
				
			||||||
				this.listQuery.name = null;
 | 
									this.listQuery.name = null;
 | 
				
			||||||
				this.listQuery.pageNo = 1;
 | 
									this.listQuery.pageNo = 1;
 | 
				
			||||||
				this.getDataList2();
 | 
									this.getDataList2();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    getNavDataList(){
 | 
					 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
				this.getDataList();
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.getDataList2();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		// 获取数据2列表
 | 
							// 获取数据2列表
 | 
				
			||||||
		getDataList2() {
 | 
							getDataList2() {
 | 
				
			||||||
			getRawOthercostSunPage(this.listQuery).then((response) => {
 | 
								getRawOthercostSunPage(this.listQuery).then((response) => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,7 +65,6 @@ const tableProps = [
 | 
				
			|||||||
		prop: 'price',
 | 
							prop: 'price',
 | 
				
			||||||
		label: '成本金额',
 | 
							label: '成本金额',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'remark',
 | 
							prop: 'remark',
 | 
				
			||||||
@@ -162,7 +161,7 @@ export default {
 | 
				
			|||||||
			switch (val.btnName) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name||null;
 | 
										this.listQuery.name = val.name||null;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
@@ -175,7 +174,7 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name||null;
 | 
										this.listQuery.name = val.name||null;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,9 +10,9 @@
 | 
				
			|||||||
		<span>
 | 
							<span>
 | 
				
			||||||
			{{
 | 
								{{
 | 
				
			||||||
				injectData.type == 1
 | 
									injectData.type == 1
 | 
				
			||||||
					? `每天等价,${Number(injectData.price)}元`
 | 
										? `每天等价,${injectData.price}元`
 | 
				
			||||||
					: injectData.type == 2
 | 
										: injectData.type == 2
 | 
				
			||||||
					? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
 | 
										? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
 | 
				
			||||||
					: '-'
 | 
										: '-'
 | 
				
			||||||
			}}
 | 
								}}
 | 
				
			||||||
		</span>
 | 
							</span>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,7 +52,7 @@
 | 
				
			|||||||
				:page.sync="listQuery.pageNo"
 | 
									:page.sync="listQuery.pageNo"
 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
									:limit.sync="listQuery.pageSize"
 | 
				
			||||||
				:total="listQuery.total"
 | 
									:total="listQuery.total"
 | 
				
			||||||
				@pagination="getNavDataList" />
 | 
									@pagination="getDataList" />
 | 
				
			||||||
			<base-dialog
 | 
								<base-dialog
 | 
				
			||||||
				:dialogTitle="addOrEditTitle"
 | 
									:dialogTitle="addOrEditTitle"
 | 
				
			||||||
				:dialogVisible="addOrUpdateVisible"
 | 
									:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
@@ -85,12 +85,9 @@ import ButtonNav from '@/components/ButtonNav';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'time',
 | 
							prop: 'recTime',
 | 
				
			||||||
		label: '日期',
 | 
							label: '日期',
 | 
				
			||||||
	},
 | 
							filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'productionLineName',
 | 
							prop: 'productionLineName',
 | 
				
			||||||
@@ -103,27 +100,22 @@ const tableProps = [
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'innum',
 | 
							prop: 'innum',
 | 
				
			||||||
		label: '上片数量',
 | 
							label: '上片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outnum',
 | 
							prop: 'outnum',
 | 
				
			||||||
		label: '下片数量',
 | 
							label: '下片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'ratio',
 | 
							prop: 'ratio',
 | 
				
			||||||
		label: '良品率',
 | 
							label: '良品率',
 | 
				
			||||||
		filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
 | 
							filter: (val) => (val ? val * 100 + '%' : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
const tableProps2 = [
 | 
					const tableProps2 = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'time',
 | 
							prop: 'recTime',
 | 
				
			||||||
		label: '日期',
 | 
							label: '日期',
 | 
				
			||||||
	},
 | 
							filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'productionLineName',
 | 
							prop: 'productionLineName',
 | 
				
			||||||
@@ -136,17 +128,15 @@ const tableProps2 = [
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'innum',
 | 
							prop: 'innum',
 | 
				
			||||||
		label: '进片数量',
 | 
							label: '进片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outnum',
 | 
							prop: 'outnum',
 | 
				
			||||||
		label: '出片数量',
 | 
							label: '出片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'ratio',
 | 
							prop: 'ratio',
 | 
				
			||||||
		label: '良品率',
 | 
							label: '良品率',
 | 
				
			||||||
		filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
 | 
							filter: (val) => (val ? val * 100 + '%' : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
@@ -180,15 +170,13 @@ export default {
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'datePicker',
 | 
										type: 'datePicker',
 | 
				
			||||||
					label: '时间范围',
 | 
										label: '时间范围',
 | 
				
			||||||
					dateType: 'datetimerange',
 | 
										dateType: 'daterange',
 | 
				
			||||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
					rangeSeparator: '-',
 | 
										rangeSeparator: '-',
 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
					defaultTime: ['08:30:00', '08:30:00'],
 | 
					 | 
				
			||||||
					param: 'searchTime',
 | 
										param: 'searchTime',
 | 
				
			||||||
					width: 350,
 | 
					 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'button',
 | 
										type: 'button',
 | 
				
			||||||
@@ -237,15 +225,22 @@ export default {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		buttonClick(val) {
 | 
							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) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.productionLineId = val.name || null;
 | 
										this.listQuery.productionLineId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
										if (this.activeName === 'his') {
 | 
				
			||||||
						this.getDataList();
 | 
											this.getDataList();
 | 
				
			||||||
@@ -258,12 +253,12 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.productionLineId = val.name || null;
 | 
										this.listQuery.productionLineId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
@@ -314,20 +309,10 @@ export default {
 | 
				
			|||||||
				this.otherMethods(val);
 | 
									this.otherMethods(val);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    getNavDataList(){
 | 
					 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
				this.getDataList();
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.getDataList2();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		successSubmit() {
 | 
							successSubmit() {
 | 
				
			||||||
			this.handleCancel();
 | 
								this.handleCancel();
 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
								const val = this.activeName === 'his' ? '产线良品率' : 'now';
 | 
				
			||||||
				this.getDataList();
 | 
								this.currentMenu(val);
 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.getDataList2();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		/** 导出按钮操作 */
 | 
							/** 导出按钮操作 */
 | 
				
			||||||
		handleExport() {
 | 
							handleExport() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,7 +54,7 @@
 | 
				
			|||||||
				:page.sync="listQuery.pageNo"
 | 
									:page.sync="listQuery.pageNo"
 | 
				
			||||||
				:limit.sync="listQuery.pageSize"
 | 
									:limit.sync="listQuery.pageSize"
 | 
				
			||||||
				:total="listQuery.total"
 | 
									:total="listQuery.total"
 | 
				
			||||||
				@pagination="getNavDataList" />
 | 
									@pagination="getDataList" />
 | 
				
			||||||
			<base-dialog
 | 
								<base-dialog
 | 
				
			||||||
				:dialogTitle="addOrEditTitle"
 | 
									:dialogTitle="addOrEditTitle"
 | 
				
			||||||
				:dialogVisible="addOrUpdateVisible"
 | 
									:dialogVisible="addOrUpdateVisible"
 | 
				
			||||||
@@ -87,12 +87,9 @@ import ButtonNav from '@/components/ButtonNav';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const tableProps = [
 | 
					const tableProps = [
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'time',
 | 
							prop: 'recTime',
 | 
				
			||||||
		label: '时间',
 | 
							label: '时间',
 | 
				
			||||||
	},
 | 
							filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'bindObjectName',
 | 
							prop: 'bindObjectName',
 | 
				
			||||||
@@ -105,42 +102,33 @@ const tableProps = [
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'inCount',
 | 
							prop: 'inCount',
 | 
				
			||||||
		label: '上片数量',
 | 
							label: '上片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outCount',
 | 
							prop: 'outCount',
 | 
				
			||||||
		label: '下片数量',
 | 
							label: '下片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'ratio',
 | 
							prop: 'ratio',
 | 
				
			||||||
		label: '良品率',
 | 
							label: '良品率',
 | 
				
			||||||
		filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
 | 
							filter: (val) => (val ? val * 100 + '%' : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'costSum',
 | 
							prop: 'costSum',
 | 
				
			||||||
		label: '深加工成本/元',
 | 
							label: '深加工成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'costPiece',
 | 
							prop: 'costPiece',
 | 
				
			||||||
		label: '单片成本/元',
 | 
							label: '单片成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'costArea',
 | 
							prop: 'costArea',
 | 
				
			||||||
		label: '每平米成本/元',
 | 
							label: '每平米成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
const tableProps2 = [
 | 
					const tableProps2 = [
 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		prop: 'remark',
 | 
					 | 
				
			||||||
		label: '备注',
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'bindObjectName',
 | 
							prop: 'bindObjectName',
 | 
				
			||||||
		label: '产线',
 | 
							label: '产线',
 | 
				
			||||||
@@ -152,35 +140,30 @@ const tableProps2 = [
 | 
				
			|||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'inCount',
 | 
							prop: 'inCount',
 | 
				
			||||||
		label: '上片数量',
 | 
							label: '上片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'outCount',
 | 
							prop: 'outCount',
 | 
				
			||||||
		label: '下片数量',
 | 
							label: '下片数量',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'ratio',
 | 
							prop: 'ratio',
 | 
				
			||||||
		label: '良品率',
 | 
							label: '良品率',
 | 
				
			||||||
		filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
 | 
							filter: (val) => (val ? val * 100 + '%' : '-'),
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'costSum',
 | 
							prop: 'costSum',
 | 
				
			||||||
		label: '深加工成本/元',
 | 
							label: '深加工成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'costPiece',
 | 
							prop: 'costPiece',
 | 
				
			||||||
		label: '单片成本/元',
 | 
							label: '单片成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		prop: 'costArea',
 | 
							prop: 'costArea',
 | 
				
			||||||
		label: '每平米成本/元',
 | 
							label: '每平米成本/元',
 | 
				
			||||||
		align: 'right',
 | 
							align: 'right',
 | 
				
			||||||
    filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
];
 | 
					];
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
@@ -242,16 +225,13 @@ export default {
 | 
				
			|||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'datePicker',
 | 
										type: 'datePicker',
 | 
				
			||||||
					label: '时间范围',
 | 
										label: '时间范围',
 | 
				
			||||||
					dateType: 'datetimerange',
 | 
										dateType: 'daterange',
 | 
				
			||||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
										format: 'yyyy-MM-dd',
 | 
				
			||||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
										valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
				
			||||||
					rangeSeparator: '-',
 | 
										rangeSeparator: '-',
 | 
				
			||||||
					startPlaceholder: '开始时间',
 | 
										startPlaceholder: '开始时间',
 | 
				
			||||||
					endPlaceholder: '结束时间',
 | 
										endPlaceholder: '结束时间',
 | 
				
			||||||
					defaultTime: ['08:30:00', '08:30:00'],
 | 
					 | 
				
			||||||
					param: 'searchTime',
 | 
										param: 'searchTime',
 | 
				
			||||||
					width: 350,
 | 
					 | 
				
			||||||
					clearable: false,
 | 
					 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					type: 'select',
 | 
										type: 'select',
 | 
				
			||||||
@@ -308,20 +288,26 @@ export default {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
	methods: {
 | 
						methods: {
 | 
				
			||||||
		buttonClick(val) {
 | 
							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) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.bindObjectId = val.name || null;
 | 
										this.listQuery.bindObjectId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
										if (this.activeName === 'his') {
 | 
				
			||||||
						this.listQuery.endTime = val.searchTime
 | 
					 | 
				
			||||||
							? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
					 | 
				
			||||||
							: null;
 | 
					 | 
				
			||||||
						this.getDataList();
 | 
											this.getDataList();
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						this.getDataList2();
 | 
											this.getDataList2();
 | 
				
			||||||
@@ -332,18 +318,13 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.bindObjectId = val.name || null;
 | 
										this.listQuery.bindObjectId = val.name || null;
 | 
				
			||||||
					this.listQuery.statisticType = val.statisticType || 1;
 | 
										this.listQuery.statisticType = val.statisticType || 1;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
						? val.searchTime[1]
 | 
											? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
				
			||||||
						: null;
 | 
											: null;
 | 
				
			||||||
					if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
						this.listQuery.endTime = val.searchTime
 | 
					 | 
				
			||||||
							? val.searchTime[1].substr(0, 10) + ' 23:59:59'
 | 
					 | 
				
			||||||
							: null;
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				default:
 | 
									default:
 | 
				
			||||||
@@ -365,26 +346,15 @@ export default {
 | 
				
			|||||||
				const end = new Date();
 | 
									const end = new Date();
 | 
				
			||||||
				const start = new Date();
 | 
									const start = new Date();
 | 
				
			||||||
				start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
									start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
 | 
				
			||||||
				this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
 | 
									this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
 | 
				
			||||||
				this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
 | 
									this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
 | 
				
			||||||
				this.$nextTick(() => {
 | 
									this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
 | 
				
			||||||
					this.$refs.searchBarForm2.formInline.searchTime = [
 | 
									this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
 | 
				
			||||||
						this.listQuery.startTime,
 | 
					 | 
				
			||||||
						this.listQuery.endTime,
 | 
					 | 
				
			||||||
					];
 | 
					 | 
				
			||||||
				});
 | 
					 | 
				
			||||||
				this.listQuery.name = null;
 | 
									this.listQuery.name = null;
 | 
				
			||||||
				this.listQuery.pageNo = 1;
 | 
									this.listQuery.pageNo = 1;
 | 
				
			||||||
				this.getDataList2();
 | 
									this.getDataList2();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
    getNavDataList(){
 | 
					 | 
				
			||||||
			if (this.activeName === 'his') {
 | 
					 | 
				
			||||||
				this.getDataList();
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.getDataList2();
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
		// 获取数据2列表
 | 
							// 获取数据2列表
 | 
				
			||||||
		getDataList2() {
 | 
							getDataList2() {
 | 
				
			||||||
			if (this.listQuery.startTime) {
 | 
								if (this.listQuery.startTime) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,527 +0,0 @@
 | 
				
			|||||||
<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 class="current-date">( {{ showTime }} )</div> -->
 | 
					 | 
				
			||||||
			<div class="current-time">
 | 
					 | 
				
			||||||
				<el-button
 | 
					 | 
				
			||||||
					size="mini"
 | 
					 | 
				
			||||||
					type="text"
 | 
					 | 
				
			||||||
					style="font-size: 24px; color: white; margin-right: 30px"
 | 
					 | 
				
			||||||
          :disabled="!permission"
 | 
					 | 
				
			||||||
					@click="goDetail">
 | 
					 | 
				
			||||||
					<svg-icon icon-class="list"></svg-icon>
 | 
					 | 
				
			||||||
					详细
 | 
					 | 
				
			||||||
				</el-button>
 | 
					 | 
				
			||||||
				<span style="display: inline-block; margin-right: 16px">
 | 
					 | 
				
			||||||
					{{ topTime + timeZone }}
 | 
					 | 
				
			||||||
				</span>
 | 
					 | 
				
			||||||
				<span>{{ topDate }}</span>
 | 
					 | 
				
			||||||
			</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: '日',
 | 
					 | 
				
			||||||
			topDate: '',
 | 
					 | 
				
			||||||
			topTime: '',
 | 
					 | 
				
			||||||
			timeZone: '',
 | 
					 | 
				
			||||||
			user: '',
 | 
					 | 
				
			||||||
			lineChartData: lineChartData.newVisitis,
 | 
					 | 
				
			||||||
			homeData: {},
 | 
					 | 
				
			||||||
			permission: false,
 | 
					 | 
				
			||||||
			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() {
 | 
					 | 
				
			||||||
		this.getTime();
 | 
					 | 
				
			||||||
		this.permission = false;
 | 
					 | 
				
			||||||
		this.showTime = moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD');
 | 
					 | 
				
			||||||
		getUserProfile().then((response) => {
 | 
					 | 
				
			||||||
			this.user = response.data;
 | 
					 | 
				
			||||||
			if (this.user.roles[0].name !== 'dashborad') {
 | 
					 | 
				
			||||||
				this.permission = true;
 | 
					 | 
				
			||||||
				this.getData();
 | 
					 | 
				
			||||||
			} else {
 | 
					 | 
				
			||||||
				this.permission = false;
 | 
					 | 
				
			||||||
				this.homeData = {
 | 
					 | 
				
			||||||
					areaPriceD: '***',
 | 
					 | 
				
			||||||
					areaPriceO: '***',
 | 
					 | 
				
			||||||
					areaPriceS: '***',
 | 
					 | 
				
			||||||
					energyPriceD: '***',
 | 
					 | 
				
			||||||
					energyPriceO: '***',
 | 
					 | 
				
			||||||
					energyPriceS: '***',
 | 
					 | 
				
			||||||
					matPriceO: '***',
 | 
					 | 
				
			||||||
					matPriceS: '***',
 | 
					 | 
				
			||||||
					otherPriceD: '***',
 | 
					 | 
				
			||||||
					otherPriceO: '***',
 | 
					 | 
				
			||||||
					otherPriceS: '***',
 | 
					 | 
				
			||||||
					outD: '***',
 | 
					 | 
				
			||||||
					outO: '***',
 | 
					 | 
				
			||||||
					priceD: '***',
 | 
					 | 
				
			||||||
					priceO: '***',
 | 
					 | 
				
			||||||
					priceS: '***',
 | 
					 | 
				
			||||||
					ratioD: '***',
 | 
					 | 
				
			||||||
					ratioO: '***',
 | 
					 | 
				
			||||||
					ratioS: '***',
 | 
					 | 
				
			||||||
				};
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		});
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	beforeDestroy() {
 | 
					 | 
				
			||||||
		clearInterval(this.timer);
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	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',
 | 
					 | 
				
			||||||
			};
 | 
					 | 
				
			||||||
			if (this.permission) {
 | 
					 | 
				
			||||||
				getData(listQuery).then((response) => {
 | 
					 | 
				
			||||||
					this.homeData = response.data;
 | 
					 | 
				
			||||||
					for (let i in this.homeData) {
 | 
					 | 
				
			||||||
						this.homeData[i] = Number(this.homeData[i]).toFixed(2);
 | 
					 | 
				
			||||||
					}
 | 
					 | 
				
			||||||
				});
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		// handleClick() {
 | 
					 | 
				
			||||||
		// 	let start = Date.parse(new Date());
 | 
					 | 
				
			||||||
		// 	let end = Date.parse(new Date());
 | 
					 | 
				
			||||||
		// 	switch (this.activeName) {
 | 
					 | 
				
			||||||
		// 		case '日':
 | 
					 | 
				
			||||||
		// 			this.showTime = moment(new Date())
 | 
					 | 
				
			||||||
		// 				.subtract(0, 'days')
 | 
					 | 
				
			||||||
		// 				.format('YYYY-MM-DD');
 | 
					 | 
				
			||||||
		// 			this.lineChartData = lineChartData.newVisitis;
 | 
					 | 
				
			||||||
		// 			break;
 | 
					 | 
				
			||||||
		// 		case '周':
 | 
					 | 
				
			||||||
		// 			start = moment(new Date()).subtract(6, 'days').format('x');
 | 
					 | 
				
			||||||
		// 			this.showTime =
 | 
					 | 
				
			||||||
		// 				moment(new Date()).subtract(6, 'days').format('MM-DD') +
 | 
					 | 
				
			||||||
		// 				' ~ ' +
 | 
					 | 
				
			||||||
		// 				moment(new Date()).subtract(0, 'days').format('MM-DD');
 | 
					 | 
				
			||||||
		// 			this.lineChartData = lineChartData.messages;
 | 
					 | 
				
			||||||
		// 			break;
 | 
					 | 
				
			||||||
		// 		case '月':
 | 
					 | 
				
			||||||
		// 			start = moment(new Date()).subtract(1, 'month').format('x');
 | 
					 | 
				
			||||||
		// 			this.showTime =
 | 
					 | 
				
			||||||
		// 				moment(new Date()).subtract(1, 'month').format('MM-DD') +
 | 
					 | 
				
			||||||
		// 				' ~ ' +
 | 
					 | 
				
			||||||
		// 				moment(new Date()).subtract(0, 'days').format('MM-DD');
 | 
					 | 
				
			||||||
		// 			this.lineChartData = lineChartData.purchases;
 | 
					 | 
				
			||||||
		// 			break;
 | 
					 | 
				
			||||||
		// 		case '年':
 | 
					 | 
				
			||||||
		// 			start = moment(new Date()).subtract(1, 'year').format('x');
 | 
					 | 
				
			||||||
		// 			this.showTime =
 | 
					 | 
				
			||||||
		// 				moment(new Date()).subtract(1, 'year').format('YYYY') +
 | 
					 | 
				
			||||||
		// 				' ~ ' +
 | 
					 | 
				
			||||||
		// 				moment(new Date()).subtract(0, 'days').format('YYYY');
 | 
					 | 
				
			||||||
		// 			this.lineChartData = lineChartData.shoppings;
 | 
					 | 
				
			||||||
		// 			break;
 | 
					 | 
				
			||||||
		// 		default:
 | 
					 | 
				
			||||||
		// 			console.log(val);
 | 
					 | 
				
			||||||
		// 	}
 | 
					 | 
				
			||||||
		// 	this.getData();
 | 
					 | 
				
			||||||
		// },
 | 
					 | 
				
			||||||
		getTime() {
 | 
					 | 
				
			||||||
			let _this = this;
 | 
					 | 
				
			||||||
			this.timer = setInterval(function () {
 | 
					 | 
				
			||||||
				_this.topDate = moment().format('YYYY.MM.DD');
 | 
					 | 
				
			||||||
				let temp = moment().format('A-hh:mm').split('-');
 | 
					 | 
				
			||||||
				_this.timeZone = temp[0];
 | 
					 | 
				
			||||||
				_this.topTime = temp[1];
 | 
					 | 
				
			||||||
			}, 1000);
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		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>
 | 
					 | 
				
			||||||
@@ -1,199 +0,0 @@
 | 
				
			|||||||
<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) {
 | 
								switch (val.btnName) {
 | 
				
			||||||
				case 'search':
 | 
									case 'search':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name||null;
 | 
										this.listQuery.name = val.name||null;
 | 
				
			||||||
					this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
										this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
 | 
				
			||||||
					this.listQuery.endTime = val.searchTime
 | 
										this.listQuery.endTime = val.searchTime
 | 
				
			||||||
@@ -90,7 +90,7 @@ export default {
 | 
				
			|||||||
					break;
 | 
										break;
 | 
				
			||||||
				case 'export':
 | 
									case 'export':
 | 
				
			||||||
					this.listQuery.pageNo = 1;
 | 
										this.listQuery.pageNo = 1;
 | 
				
			||||||
					this.listQuery.pageSize = 20;
 | 
										this.listQuery.pageSize = 10;
 | 
				
			||||||
					this.listQuery.name = val.name;
 | 
										this.listQuery.name = val.name;
 | 
				
			||||||
					this.listQuery.recTime = val.searchTime;
 | 
										this.listQuery.recTime = val.searchTime;
 | 
				
			||||||
					this.handleExport();
 | 
										this.handleExport();
 | 
				
			||||||
 
 | 
				
			|||||||