Compare commits
	
		
			132 Commits
		
	
	
		
			b0078cb099
			...
			projects/m
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 1c7c10205e | |||
| 
						 | 
					74003e9d89 | ||
| 
						 | 
					cb72e2b68a | ||
| 025b061ec2 | |||
| 
						 | 
					f2912eaee1 | ||
| 
						 | 
					8025d00709 | ||
| 60edd8f2c4 | |||
| c0214c9eb7 | |||
| da85e5211a | |||
| 23afb0db0d | |||
| d0adf3a63e | |||
| 
						 | 
					b81c95f796 | ||
| e7f21456a3 | |||
| 
						 | 
					1537b1be58 | ||
| 
						 | 
					b2304941a4 | ||
| 14b2a49053 | |||
| 
						 | 
					6adac714f0 | ||
| 
						 | 
					0349f3cde0 | ||
| 
						 | 
					4cafa78908 | ||
| 61ef172534 | |||
| 
						 | 
					19d913a49e | ||
| 
						 | 
					70c3fd44d6 | ||
| 78d6f0bb23 | |||
| 
						 | 
					cf51eff0b7 | ||
| 
						 | 
					539dddf217 | ||
| 
						 | 
					317d01934b | ||
| 
						 | 
					cdfe5c9c1b | ||
| c1ea5157a5 | |||
| 41ceefc20e | |||
| 54425859b5 | |||
| a2a4f8dccd | |||
| 
						 | 
					fd3b054108 | ||
| 
						 | 
					dacae0cbd8 | ||
| 
						 | 
					be83c8196e | ||
| 
						 | 
					ef3f5d3fe7 | ||
| 
						 | 
					ec550f22ec | ||
| 
						 | 
					60633ac581 | ||
| 
						 | 
					9351b82d11 | ||
| 5e4227ba25 | |||
| 82f63dc4ff | |||
| 9a29185410 | |||
| 43e824f958 | |||
| 
						 | 
					de831b339f | ||
| 
						 | 
					f0105c377c | ||
| 3ba5574669 | |||
| 
						 | 
					082988d6d7 | ||
| 
						 | 
					7acb861919 | ||
| c41153a946 | |||
| 6d658d9212 | |||
| bf4bab2f3c | |||
| 20f0efa413 | |||
| 
						 | 
					c48f81b1d9 | ||
| 
						 | 
					7233720c2e | ||
| 6a491ff498 | |||
| 
						 | 
					be607e4bf3 | ||
| 
						 | 
					87ef42e277 | ||
| aa65a7e97e | |||
| 
						 | 
					b8d26c87d8 | ||
| b89f510e61 | |||
| 
						 | 
					0e60f426bc | ||
| 
						 | 
					21f4879394 | ||
| 067cd4765e | |||
| 3c4fe6daaa | |||
| 
						 | 
					e24f9c1079 | ||
| 
						 | 
					61567ce86a | ||
| 2ee66714ca | |||
| ab5867c4fd | |||
| 9a53391999 | |||
| ec0c09a674 | |||
| 
						 | 
					90e9b179eb | ||
| 
						 | 
					8e2b332c7b | ||
| f37a12d2e1 | |||
| cb19872012 | |||
| 
						 | 
					8ba79185d4 | ||
| 
						 | 
					104cda5a41 | ||
| 
						 | 
					151c5708c4 | ||
| 837735b7e8 | |||
| 
						 | 
					e00a08385f | ||
| 
						 | 
					a8c3d2c585 | ||
| eb097e77bd | |||
| 
						 | 
					30eecb8bd1 | ||
| 
						 | 
					f4a6229170 | ||
| ab593bff20 | |||
| 4b01dd3ec3 | |||
| ed3ea7dde8 | |||
| 1d9e272f99 | |||
| 
						 | 
					43c9153777 | ||
| 
						 | 
					c6d504583b | ||
| 
						 | 
					22f3c87f02 | ||
| 
						 | 
					1f54c9179d | ||
| f7247f5161 | |||
| 
						 | 
					c8856f34b5 | ||
| 
						 | 
					42c42abc08 | ||
| 0fffed9b0e | |||
| 
						 | 
					d251daa3f5 | ||
| 
						 | 
					ed5120ca97 | ||
| 
						 | 
					becf34d089 | ||
| f0d64de77b | |||
| 56819176b3 | |||
| d302179f6f | |||
| 8c117fae8e | |||
| 
						 | 
					b6cf7b2ddc | ||
| 
						 | 
					2f98b42bd2 | ||
| fb8ae9226a | |||
| 3d3763c4ef | |||
| ea675b9dea | |||
| bda065e4be | |||
| 
						 | 
					5ea4c219ed | ||
| 
						 | 
					16186667da | ||
| 
						 | 
					c7cd6e7b1e | ||
| 
						 | 
					29c3a9fb72 | ||
| 
						 | 
					1e1313d090 | ||
| d0eb1d84c8 | |||
| 
						 | 
					445d8f4818 | ||
| 
						 | 
					46ce982cfc | ||
| 391e06a382 | |||
| 72e1b4e8f9 | |||
| b41ba04cb4 | |||
| 
						 | 
					4482ce0433 | ||
| 
						 | 
					ecf6745c8a | ||
| c9128ce946 | |||
| ba08175de8 | |||
| 
						 | 
					22f8322baf | ||
| 
						 | 
					6f8abc9758 | ||
| 59d53b60c7 | |||
| d448280782 | |||
| 0337b54202 | |||
| 
						 | 
					9dec81e0b2 | ||
| 
						 | 
					64de2c50b6 | ||
| 
						 | 
					bd0f9e24fd | ||
| 
						 | 
					f3043ee11f | ||
| 5584a47575 | 
@@ -1,3 +1,3 @@
 | 
			
		||||
.dockerignore
 | 
			
		||||
dist
 | 
			
		||||
#dist
 | 
			
		||||
node_modules
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										59
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,59 @@
 | 
			
		||||
---
 | 
			
		||||
kind: pipeline
 | 
			
		||||
type: docker
 | 
			
		||||
name: default
 | 
			
		||||
 | 
			
		||||
steps:
 | 
			
		||||
- name: build
 | 
			
		||||
  image: node:16-alpine
 | 
			
		||||
  pull: if_not_exists
 | 
			
		||||
  environment:
 | 
			
		||||
    NODE_ENV: ""
 | 
			
		||||
  commands:
 | 
			
		||||
  #- yarn install --frozen-lockfile
 | 
			
		||||
  - yarn install 
 | 
			
		||||
  - env ${NODE_ENV} yarn build:prod 
 | 
			
		||||
 | 
			
		||||
- name: publish
 | 
			
		||||
  image: docker:dind
 | 
			
		||||
  pull: if_not_exists
 | 
			
		||||
  volumes:
 | 
			
		||||
  - name: dockersock
 | 
			
		||||
    path: /var/run/docker.sock
 | 
			
		||||
  - name: dockerconfig
 | 
			
		||||
    path: /root/.docker
 | 
			
		||||
  commands:
 | 
			
		||||
  - docker build -t hub.kszny.picaiba.com/kszny/xcac-ui ./
 | 
			
		||||
  - docker push hub.kszny.picaiba.com/kszny/xcac-ui
 | 
			
		||||
  depends_on:
 | 
			
		||||
  - build
 | 
			
		||||
 | 
			
		||||
- name: deploy
 | 
			
		||||
  image: appleboy/drone-ssh
 | 
			
		||||
  pull: if-not-exists
 | 
			
		||||
  settings:
 | 
			
		||||
    host:
 | 
			
		||||
      - 172.24.145.74
 | 
			
		||||
    username: root
 | 
			
		||||
    password: Root@123
 | 
			
		||||
    port: 22
 | 
			
		||||
    command_timeout: 2m
 | 
			
		||||
    script:
 | 
			
		||||
    - docker pull hub.kszny.picaiba.com/kszny/xcac-ui
 | 
			
		||||
    - docker run --rm -v /data/www/xcac:/tmp hub.kszny.picaiba.com/kszny/xcac-ui sh -c "rm -rf /tmp/* && mv -f /html /tmp"
 | 
			
		||||
  depends_on:
 | 
			
		||||
  - publish
 | 
			
		||||
 | 
			
		||||
volumes:
 | 
			
		||||
- name: dockersock
 | 
			
		||||
  host:
 | 
			
		||||
    path: /var/run/docker.sock
 | 
			
		||||
- name: dockerconfig
 | 
			
		||||
  host:
 | 
			
		||||
    path: /root/.docker
 | 
			
		||||
 | 
			
		||||
trigger:
 | 
			
		||||
  branch:
 | 
			
		||||
  - projects/mesxc-test
 | 
			
		||||
  event:
 | 
			
		||||
  - push
 | 
			
		||||
							
								
								
									
										11
									
								
								.env.dev
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								.env.dev
									
									
									
									
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
###
 | 
			
		||||
 # @Author: zhp
 | 
			
		||||
 # @Date: 2024-04-12 14:30:48
 | 
			
		||||
 # @LastEditTime: 2024-04-12 14:31:16
 | 
			
		||||
 # @LastEditTime: 2024-04-25 10:07:02
 | 
			
		||||
 # @LastEditors: zhp
 | 
			
		||||
 # @Description:
 | 
			
		||||
###
 | 
			
		||||
@@ -13,14 +13,15 @@ VUE_APP_TITLE = MES系统
 | 
			
		||||
 | 
			
		||||
# 芋道管理系统/开发环境
 | 
			
		||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
 | 
			
		||||
 | 
			
		||||
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
 | 
			
		||||
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
 | 
			
		||||
# 积木报表指向地址
 | 
			
		||||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
 | 
			
		||||
VUE_APP_JIMU_API = 'http://192.168.1.101:48082'
 | 
			
		||||
 | 
			
		||||
# socket地址(现场)
 | 
			
		||||
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
 | 
			
		||||
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
 | 
			
		||||
# socket地址(公司线上)
 | 
			
		||||
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
 | 
			
		||||
# VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
 | 
			
		||||
# socket dcs地址(只有现场)
 | 
			
		||||
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										24
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,21 +1,3 @@
 | 
			
		||||
FROM node:16-alpine as build-stage
 | 
			
		||||
 | 
			
		||||
WORKDIR /admim
 | 
			
		||||
 | 
			
		||||
COPY .npmrc package.json yarn.lock ./
 | 
			
		||||
RUN --mount=type=cache,id=yarn-store,target=/root/.yarn-store \
 | 
			
		||||
    yarn install --frozen-lockfile
 | 
			
		||||
 | 
			
		||||
COPY . .
 | 
			
		||||
ARG NODE_ENV=""
 | 
			
		||||
RUN env ${NODE_ENV} yarn build:prod
 | 
			
		||||
 | 
			
		||||
## -- stage: dist => nginx --
 | 
			
		||||
FROM nginx:alpine
 | 
			
		||||
 | 
			
		||||
ENV TZ=Asia/Shanghai
 | 
			
		||||
 | 
			
		||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
 | 
			
		||||
COPY --from=build-stage /admim/dist /usr/share/nginx/html
 | 
			
		||||
 | 
			
		||||
EXPOSE 80
 | 
			
		||||
FROM busybox 
 | 
			
		||||
LABEL maintainer thomas.hairong@gmail.com
 | 
			
		||||
COPY dist /html/
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,7 @@
 | 
			
		||||
    "benz-amr-recorder": "^1.1.5",
 | 
			
		||||
    "bpmn-js-token-simulation": "0.10.0",
 | 
			
		||||
    "clipboard": "2.0.8",
 | 
			
		||||
    "code-brick-zj": "^1.0.5",
 | 
			
		||||
    "code-brick-zj": "^1.1.0",
 | 
			
		||||
    "core-js": "^3.26.0",
 | 
			
		||||
    "crypto-js": "^4.0.0",
 | 
			
		||||
    "diagram-js": "^12.3.0",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-10-21 11:50:46
 | 
			
		||||
 * @LastEditTime: 2023-10-30 14:37:28
 | 
			
		||||
 * @LastEditTime: 2024-04-19 17:13:24
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
@@ -65,4 +65,13 @@ export function getCoreDepartmentList(query) {
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 设备获得所有列表
 | 
			
		||||
export function getDepartmentList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/system/dept/list-all-simple',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-10-31 10:55:20
 | 
			
		||||
 * @LastEditTime: 2023-12-06 14:09:14
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-25 15:28:44
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
@@ -34,11 +34,11 @@ export function exportEnergyPlcExcel(query) {
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getOriginalGlassRetrace(query) {
 | 
			
		||||
export function getOriginalGlassRetrace(data) {
 | 
			
		||||
   return request({
 | 
			
		||||
    url: '/base/original-glass-statistics/originalGlassRetrace',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query,
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								src/api/report/customizedReports.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/api/report/customizedReports.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
// 原片工段数据
 | 
			
		||||
export function originalSection(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/originalSection',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 原片产线数据
 | 
			
		||||
export function getOriginalLine(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/getOriginalLine',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 深加工产线数据
 | 
			
		||||
export function getProcessingLine(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/getProcessingLine',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 深加工工段数据
 | 
			
		||||
export function processing(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/processing',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// isra数据记录
 | 
			
		||||
export function israData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/isra',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-12-08 10:26:48
 | 
			
		||||
 * @LastEditTime: 2023-12-13 17:16:00
 | 
			
		||||
 * @LastEditTime: 2024-04-24 16:31:37
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 */
 | 
			
		||||
@@ -59,3 +59,39 @@ export function exportGlasscExcel(query) {
 | 
			
		||||
    responseType: 'blob'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 生产月报查询--冷端生产线
 | 
			
		||||
export function productionMonthY(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/productionMonthY',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 生产月报查询--深加工生产线
 | 
			
		||||
export function productionMonthD(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/productionMonthD',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 生产年报查询--冷端生产线
 | 
			
		||||
export function productionYearY(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/productionYearY',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 生产年报查询--冷端生产线
 | 
			
		||||
export function productionYearD(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/extend/customized-reports/productionYearD',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										96
									
								
								src/api/report/qcReport.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										96
									
								
								src/api/report/qcReport.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,96 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 09:27:54
 | 
			
		||||
 * @LastEditTime: 2024-04-23 15:16:12
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
 */
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 更新质量检测类型基础
 | 
			
		||||
export function getOriginalData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'extend/customized-reports/original',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
export function getIngredientData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'extend/customized-reports/materialCost',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getCuttingtData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'extend/customized-reports/cutting',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getAutoDailyData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/report-auto-daily/listAll',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getQualityRecordReport(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/quality-inspection-record/qualityRecordReport',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getProductChildData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/report-auto-ydaily-det/list',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function updateAutoDailyData(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/report-auto-daily/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getCWSectionList(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'base/core-production-line/listAll',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getCuttingReportDataList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'extend/customized-reports/cuttingReport',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getProcessingLineDataList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'extend/customized-reports/getProcessingLine',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getOriginalLineDataList(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: 'extend/customized-reports/getOriginalLine',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										138
									
								
								src/components/ButtonNav/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										138
									
								
								src/components/ButtonNav/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,138 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
    filename: index.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2024-04-02 09:49:36
 | 
			
		||||
    description: 
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<!-- 按钮切换 -->
 | 
			
		||||
	<div
 | 
			
		||||
		v-if="buttonMode"
 | 
			
		||||
		class="button-nav">
 | 
			
		||||
		<button
 | 
			
		||||
			v-for="m in menus"
 | 
			
		||||
			:key="m"
 | 
			
		||||
			@click="currentMenu = m"
 | 
			
		||||
			:data-text="m"
 | 
			
		||||
			:class="[m === currentMenu ? 'active' : '']"></button>
 | 
			
		||||
	</div>
 | 
			
		||||
	<!-- 标签切换 -->
 | 
			
		||||
	<div
 | 
			
		||||
		v-else
 | 
			
		||||
		class="custom-tabs"
 | 
			
		||||
		style="height: 100%; width: 100%">
 | 
			
		||||
		<el-tabs
 | 
			
		||||
			class="tag-nav"
 | 
			
		||||
			v-model="currentMenu"
 | 
			
		||||
			style="height: 100%">
 | 
			
		||||
			<el-tab-pane
 | 
			
		||||
				v-for="(m, idx) in menus"
 | 
			
		||||
				:key="m"
 | 
			
		||||
				:label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`"
 | 
			
		||||
				:name="m">
 | 
			
		||||
				<slot :name="`tab${idx + 1}`"></slot>
 | 
			
		||||
			</el-tab-pane>
 | 
			
		||||
		</el-tabs>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'ButtonNav',
 | 
			
		||||
	props: {
 | 
			
		||||
		menus: {
 | 
			
		||||
			type: Array,
 | 
			
		||||
			required: true,
 | 
			
		||||
			default: () => [],
 | 
			
		||||
			validator: (val) => {
 | 
			
		||||
				return val.length > 0;
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		buttonMode: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			default: true,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			currentMenu: '',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.currentMenu = this.menus[0];
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		currentMenu(val) {
 | 
			
		||||
			this.$emit('change', val);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.button-nav {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	// padding: 12px 0;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	gap: 12px;
 | 
			
		||||
 | 
			
		||||
	* {
 | 
			
		||||
		user-select: none;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	button {
 | 
			
		||||
		cursor: pointer;
 | 
			
		||||
		appearance: none;
 | 
			
		||||
		outline: none;
 | 
			
		||||
		border: none;
 | 
			
		||||
		background: #fff;
 | 
			
		||||
		border-radius: 8px;
 | 
			
		||||
		padding: 20px;
 | 
			
		||||
		color: #888;
 | 
			
		||||
		letter-spacing: 2px;
 | 
			
		||||
		flex: 1;
 | 
			
		||||
		box-sizing: padding-box;
 | 
			
		||||
		position: relative;
 | 
			
		||||
 | 
			
		||||
		&::after {
 | 
			
		||||
			content: attr(data-text);
 | 
			
		||||
			position: absolute;
 | 
			
		||||
			top: 10px;
 | 
			
		||||
			left: 50%;
 | 
			
		||||
			font-size: 18px;
 | 
			
		||||
			font-weight: 500;
 | 
			
		||||
			transform: translate(-50%);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		&.active {
 | 
			
		||||
			color: #111;
 | 
			
		||||
			border-bottom: 4px solid #0b58ff;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.custom-tabs >>> .el-tabs__header {
 | 
			
		||||
	margin-bottom: 8px;
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	/* transform: translateY(-12px); */
 | 
			
		||||
}
 | 
			
		||||
.custom-tabs >>> .el-tabs__item {
 | 
			
		||||
	padding-left: 0px !important;
 | 
			
		||||
	padding-right: 0px !important;
 | 
			
		||||
	line-height: 36px !important;
 | 
			
		||||
	height: 36px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.custom-tabs >>> .el-tabs__content {
 | 
			
		||||
	height: calc(100% - 42px);
 | 
			
		||||
}
 | 
			
		||||
.custom-tabs >>> .el-tab-pane {
 | 
			
		||||
	box-sizing: border-box;
 | 
			
		||||
	height: 100%;
 | 
			
		||||
	padding: 20px;
 | 
			
		||||
	border: 10px solid #f002;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-01-29 16:50:26
 | 
			
		||||
 * @LastEditTime: 2024-04-11 09:55:04
 | 
			
		||||
 * @LastEditTime: 2024-04-25 09:03:50
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -34,7 +34,7 @@
 | 
			
		||||
        </el-col>
 | 
			
		||||
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
 | 
			
		||||
          <base-container :no-content-padding="true" :title="'产量及良率统计'" :size="'small'"
 | 
			
		||||
          <base-container :show-time="true" :no-content-padding="true" :title="'产量及良率统计'" :size="'small'"
 | 
			
		||||
            :title-icon="'energyMonitoring'">
 | 
			
		||||
            <!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
 | 
			
		||||
              <top-radio-group />
 | 
			
		||||
@@ -53,7 +53,8 @@
 | 
			
		||||
        </el-col>
 | 
			
		||||
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
 | 
			
		||||
          <base-container :no-content-padding="true" :title="'ISRA 缺陷数据'" :size="'small'" :title-icon="'scrap'">
 | 
			
		||||
          <base-container :show-time="true" :no-content-padding="true" :title="'ISRA 缺陷数据'" :size="'small'"
 | 
			
		||||
            :title-icon="'scrap'">
 | 
			
		||||
            <!-- <base-table1 :page="1" :limit="999" :show-index="false" :table-config="ISRATableProps"
 | 
			
		||||
              :table-data="ISRAList" /> -->
 | 
			
		||||
            <ISRAChart ref="ISRAChart" />
 | 
			
		||||
@@ -64,8 +65,8 @@
 | 
			
		||||
 | 
			
		||||
      <el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="10" type="flex" class="flex-1">
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
 | 
			
		||||
          <base-container :no-content-padding="true" :height="256" :title="'废片 缺陷数据'" :size="'eqStatus'"
 | 
			
		||||
            :title-icon="'scrap'">
 | 
			
		||||
          <base-container :show-time="true" :no-content-padding="true" :height="256" :title="'废片 缺陷数据'"
 | 
			
		||||
            :size="'eqStatus'" :title-icon="'scrap'">
 | 
			
		||||
            <!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
 | 
			
		||||
              <top-radio-group />
 | 
			
		||||
            </div> -->
 | 
			
		||||
@@ -98,7 +99,8 @@
 | 
			
		||||
          </base-container>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="14">
 | 
			
		||||
          <base-container :height="318 + 338 + 16" :size="'eqStatus'" :title="'设备状态监控'" :title-icon="'eqMonitoring'">
 | 
			
		||||
          <base-container :show-time="false" :height="318 + 338 + 16" :size="'eqStatus'" :title="'设备状态监控'"
 | 
			
		||||
            :title-icon="'eqMonitoring'">
 | 
			
		||||
            <!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
 | 
			
		||||
              <top-radio-group />
 | 
			
		||||
            </div> -->
 | 
			
		||||
@@ -625,8 +627,8 @@ export default {
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.productArea) + '㎡' || ''}</span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`,
 | 
			
		||||
            `<div style = "${(item.product * 100).toFixed(0) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>
 | 
			
		||||
           <div style = "${(item.product * 100).toFixed(0) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>`
 | 
			
		||||
            `<div style = "${(item.product * 100).toFixed(0) >= 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>
 | 
			
		||||
           <div style = "${(item.product * 100).toFixed(0) <= 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>`
 | 
			
		||||
          ])
 | 
			
		||||
          this.cutConfig.data = cutArr
 | 
			
		||||
          // this.$nextTick(() => {
 | 
			
		||||
@@ -635,32 +637,34 @@ export default {
 | 
			
		||||
          // this.cutConfig.data = cutArr
 | 
			
		||||
          // this.$refs['cutScrollBoard'].updateRows(cutArr)
 | 
			
		||||
        } else if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'chart' && this.cutWsData.dateType === 'day') {
 | 
			
		||||
          let nameList = []
 | 
			
		||||
          let nameWasteList = []
 | 
			
		||||
          let topNameList = []
 | 
			
		||||
          let productList = []
 | 
			
		||||
          let wasteList = []
 | 
			
		||||
          let sumAreaList = []
 | 
			
		||||
          let yieldList = []
 | 
			
		||||
          this.coldDetData = this.cutWsData.coldDetData
 | 
			
		||||
          // this.cutTableDataList =
 | 
			
		||||
          this.cutWsData.coldDetData.forEach((ele, index) => {
 | 
			
		||||
            nameList.push(ele.lineName)
 | 
			
		||||
            topNameList.push('产线: ' + ele.lineName + '   ' + '总面积:' + ele.sumArea + '㎡')
 | 
			
		||||
            productList.push(ele.productArea)
 | 
			
		||||
            wasteList.push(ele.wastArea)
 | 
			
		||||
            nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
 | 
			
		||||
            sumAreaList.push(ele.sumArea)
 | 
			
		||||
            yieldList.push(parseFloat((ele.yield * 100).toFixed(0)))
 | 
			
		||||
          })
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
 | 
			
		||||
            this.$refs.secondPileChart.initChart(nameList, [topNameList[1]], [nameWasteList[1]], [productList[1]], [wasteList[1]])
 | 
			
		||||
            this.$refs.thirdPileChart.initChart(nameList, [topNameList[2]], [nameWasteList[2]], [productList[2]], [wasteList[2]])
 | 
			
		||||
            this.$refs.fourthPileChart.initChart(nameList, [topNameList[3]], [nameWasteList[3]], [productList[3]], [wasteList[3]])
 | 
			
		||||
            this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
 | 
			
		||||
            this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
 | 
			
		||||
          })
 | 
			
		||||
          if (this.cutWsData.coldDetData.length !== 0) {
 | 
			
		||||
            let nameList = []
 | 
			
		||||
            let nameWasteList = []
 | 
			
		||||
            let topNameList = []
 | 
			
		||||
            let productList = []
 | 
			
		||||
            let wasteList = []
 | 
			
		||||
            let sumAreaList = []
 | 
			
		||||
            let yieldList = []
 | 
			
		||||
            this.coldDetData = this.cutWsData.coldDetData
 | 
			
		||||
            // this.cutTableDataList =
 | 
			
		||||
            this.cutWsData.coldDetData.forEach((ele, index) => {
 | 
			
		||||
              nameList.push(ele.lineName)
 | 
			
		||||
              topNameList.push('产线: ' + ele.lineName + '   ' + '总面积:' + ele.sumArea + '㎡')
 | 
			
		||||
              productList.push(ele.productArea)
 | 
			
		||||
              wasteList.push(ele.wastArea)
 | 
			
		||||
              nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
 | 
			
		||||
              sumAreaList.push(ele.sumArea)
 | 
			
		||||
              yieldList.push(parseFloat((ele.yield * 100).toFixed(2)))
 | 
			
		||||
            })
 | 
			
		||||
            this.$nextTick(() => {
 | 
			
		||||
              this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
 | 
			
		||||
              this.$refs.secondPileChart.initChart(nameList, [topNameList[1]], [nameWasteList[1]], [productList[1]], [wasteList[1]])
 | 
			
		||||
              this.$refs.thirdPileChart.initChart(nameList, [topNameList[2]], [nameWasteList[2]], [productList[2]], [wasteList[2]])
 | 
			
		||||
              this.$refs.fourthPileChart.initChart(nameList, [topNameList[3]], [nameWasteList[3]], [productList[3]], [wasteList[3]])
 | 
			
		||||
              this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
 | 
			
		||||
              this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      };
 | 
			
		||||
      // if (typeof (WebSocket) === 'undefined') {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-01-29 13:45:56
 | 
			
		||||
 * @LastEditTime: 2024-04-15 09:28:21
 | 
			
		||||
 * @LastEditTime: 2024-04-24 15:48:32
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -113,7 +113,7 @@ export default {
 | 
			
		||||
				color:this.colors,
 | 
			
		||||
				title:{
 | 
			
		||||
					text: num,
 | 
			
		||||
					subtext: '总数/片',
 | 
			
		||||
					subtext: '总数/个',
 | 
			
		||||
					top: '32%',
 | 
			
		||||
					left: '49%',
 | 
			
		||||
					textAlign: 'center',
 | 
			
		||||
@@ -125,23 +125,29 @@ export default {
 | 
			
		||||
						fontSize: 20,
 | 
			
		||||
						color: '#fff00',
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				legend: {
 | 
			
		||||
					bottom: '10%',
 | 
			
		||||
					left: 'center',
 | 
			
		||||
					itemWidth: 12,
 | 
			
		||||
					itemHeight:12,
 | 
			
		||||
          icon: 'roundRect',
 | 
			
		||||
					textStyle: {
 | 
			
		||||
						color: '#fff'
 | 
			
		||||
					},
 | 
			
		||||
					data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
 | 
			
		||||
						name:item.name,
 | 
			
		||||
						itemStyle:{
 | 
			
		||||
							color: this.colors[index%4]
 | 
			
		||||
						}
 | 
			
		||||
					}))
 | 
			
		||||
				},
 | 
			
		||||
        },
 | 
			
		||||
        grid: {
 | 
			
		||||
          left: '1%',
 | 
			
		||||
          right: '1%',
 | 
			
		||||
          bottom: '0',
 | 
			
		||||
          containLabel: true
 | 
			
		||||
        },
 | 
			
		||||
				// legend: {
 | 
			
		||||
				// 	bottom: '10%',
 | 
			
		||||
				// 	left: 'center',
 | 
			
		||||
				// 	itemWidth: 12,
 | 
			
		||||
				// 	itemHeight:12,
 | 
			
		||||
        //   icon: 'roundRect',
 | 
			
		||||
				// 	textStyle: {
 | 
			
		||||
				// 		color: '#fff'
 | 
			
		||||
				// 	},
 | 
			
		||||
				// 	data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
 | 
			
		||||
				// 		name:item.name,
 | 
			
		||||
				// 		itemStyle:{
 | 
			
		||||
				// 			color: this.colors[index%4]
 | 
			
		||||
				// 		}
 | 
			
		||||
				// 	}))
 | 
			
		||||
				// },
 | 
			
		||||
				series:[{
 | 
			
		||||
						name: 'ISRA缺陷检测',
 | 
			
		||||
            type: 'pie',
 | 
			
		||||
@@ -164,7 +170,7 @@ export default {
 | 
			
		||||
              },
 | 
			
		||||
              formatter: (params) => {
 | 
			
		||||
                //调用自定义显示格式
 | 
			
		||||
                return this.getEqualNewlineString(params.value + " | " + params.percent.toFixed(0) + "%" + "\n" + params.name,10);
 | 
			
		||||
                return this.getEqualNewlineString(params.value + " | " + params.percent.toFixed(0) + "%");
 | 
			
		||||
              },
 | 
			
		||||
              textStyle: {            // 提示文字的样式
 | 
			
		||||
                // color: '#595959',
 | 
			
		||||
@@ -213,15 +219,19 @@ export default {
 | 
			
		||||
.isra-chart {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	height: 100%;
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 7%;
 | 
			
		||||
}
 | 
			
		||||
    .isra-chart-tooltip {
 | 
			
		||||
      background: #0a2b4f77 !important;
 | 
			
		||||
      border: none !important;
 | 
			
		||||
      backdrop-filter: blur(12px);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .isra-chart-tooltip * {
 | 
			
		||||
      color: #fff !important;
 | 
			
		||||
    }
 | 
			
		||||
</style>
 | 
			
		||||
<style>
 | 
			
		||||
  .isra-chart-tooltip {
 | 
			
		||||
    background: #0a2b4f77 !important;
 | 
			
		||||
    border: none !important;
 | 
			
		||||
    backdrop-filter: blur(12px);
 | 
			
		||||
  }
 | 
			
		||||
  .isra-chart-tooltip * {
 | 
			
		||||
    color: #fff !important;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: gtz
 | 
			
		||||
 * @Date: 2022-01-19 15:58:17
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-03-29 14:47:29
 | 
			
		||||
 * @LastEditTime: 2024-04-22 09:41:21
 | 
			
		||||
 * @Description: file content
 | 
			
		||||
 * @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
 | 
			
		||||
-->
 | 
			
		||||
@@ -30,7 +30,7 @@
 | 
			
		||||
        <!-- <span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">
 | 
			
		||||
          {{ time2 +'-'+ time }}
 | 
			
		||||
        </span> -->
 | 
			
		||||
        <span  style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">
 | 
			
		||||
        <span v-if="showTime"  style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">
 | 
			
		||||
          {{ startTime + '-' + endTime }}
 | 
			
		||||
        </span>
 | 
			
		||||
      </div>
 | 
			
		||||
@@ -56,6 +56,10 @@ export default {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    showTime: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    noPadding: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: false
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-09-21 09:06:28
 | 
			
		||||
 * @LastEditTime: 2024-04-09 15:24:39
 | 
			
		||||
 * @LastEditTime: 2024-04-23 15:34:56
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -83,6 +83,9 @@ export default {
 | 
			
		||||
    this.chart = null
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // getNumLength(num) {
 | 
			
		||||
    //   return num.toString().length;
 | 
			
		||||
    // },
 | 
			
		||||
    initChart(nameList, passRateList, outputNumList) {
 | 
			
		||||
      console.log(nameList, passRateList)
 | 
			
		||||
     let  series= [
 | 
			
		||||
@@ -97,7 +100,7 @@ export default {
 | 
			
		||||
               { offset: 0.3, color: '#1295FF' }
 | 
			
		||||
             ]),
 | 
			
		||||
             label: {
 | 
			
		||||
               show: true,		//开启显示
 | 
			
		||||
               show: false,		//开启显示
 | 
			
		||||
               position: 'top',	//在上方显示
 | 
			
		||||
               textStyle: {	    //数值样式
 | 
			
		||||
                 color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
 | 
			
		||||
@@ -156,6 +159,8 @@ export default {
 | 
			
		||||
      this.chart.setOption({
 | 
			
		||||
        // color: colors,
 | 
			
		||||
        tooltip: {
 | 
			
		||||
          trigger: 'item',
 | 
			
		||||
          className: "isra-chart-tooltip",
 | 
			
		||||
          trigger: 'axis',
 | 
			
		||||
          axisPointer: {
 | 
			
		||||
            type: 'cross'
 | 
			
		||||
@@ -216,11 +221,10 @@ export default {
 | 
			
		||||
        // },
 | 
			
		||||
        yAxis: [
 | 
			
		||||
          {
 | 
			
		||||
            min: function() { // 取最小值向下取整为最小刻度
 | 
			
		||||
            min: function () { // 取最小值向下取整为最小刻度
 | 
			
		||||
              return 0
 | 
			
		||||
            },
 | 
			
		||||
            max: function(value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
              return Math.ceil(value.max)
 | 
			
		||||
            max: function (value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
            },
 | 
			
		||||
            scale: true,
 | 
			
		||||
            type: 'value',
 | 
			
		||||
@@ -264,12 +268,17 @@ export default {
 | 
			
		||||
            // },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            min: function() { // 取最小值向下取整为最小刻度
 | 
			
		||||
            min: function () { // 取最小值向下取整为最小刻度
 | 
			
		||||
              return 0
 | 
			
		||||
            },
 | 
			
		||||
            max: function(value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
              return Math.ceil(value.max)
 | 
			
		||||
            max: function (value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
 | 
			
		||||
              // console.log(value.max.toString().length)
 | 
			
		||||
              // String(value.max)[0]
 | 
			
		||||
              // for
 | 
			
		||||
              // return String(value.max)[0] +
 | 
			
		||||
            },
 | 
			
		||||
            minInterval: 5,//间隔
 | 
			
		||||
            scale: true,
 | 
			
		||||
            type: 'value',
 | 
			
		||||
            name: '产量/㎡', // y轴上方的单位
 | 
			
		||||
@@ -318,8 +327,16 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
.coldProductChart{
 | 
			
		||||
  top: -10px;
 | 
			
		||||
}
 | 
			
		||||
.isra-chart-tooltip {
 | 
			
		||||
  background: #0a2b4f77 !important;
 | 
			
		||||
  border: none !important;
 | 
			
		||||
  backdrop-filter: blur(12px);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 .isra-chart-tooltip * {
 | 
			
		||||
  color: #fff !important;
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-09-21 09:06:28
 | 
			
		||||
 * @LastEditTime: 2024-04-09 15:24:28
 | 
			
		||||
 * @LastEditTime: 2024-04-23 15:36:35
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -162,6 +162,8 @@ export default {
 | 
			
		||||
        this.chart.setOption({
 | 
			
		||||
          // color: colors,
 | 
			
		||||
          tooltip: {
 | 
			
		||||
            trigger: 'item',
 | 
			
		||||
            className: "isra-chart-tooltip",
 | 
			
		||||
            trigger: 'axis',
 | 
			
		||||
            axisPointer: {
 | 
			
		||||
              type: 'cross'
 | 
			
		||||
@@ -215,12 +217,11 @@ export default {
 | 
			
		||||
          // },
 | 
			
		||||
          yAxis: [
 | 
			
		||||
            {
 | 
			
		||||
              // min: function() { // 取最小值向下取整为最小刻度
 | 
			
		||||
              //   return 0
 | 
			
		||||
              // },
 | 
			
		||||
              // max: function(value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
              //   return Math.ceil(value.max)
 | 
			
		||||
              // },
 | 
			
		||||
              min: function () { // 取最小值向下取整为最小刻度
 | 
			
		||||
                return 0
 | 
			
		||||
              },
 | 
			
		||||
              max: function (value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
              },
 | 
			
		||||
              scale: true,
 | 
			
		||||
              type: 'value',
 | 
			
		||||
              name: '良品率/%',
 | 
			
		||||
@@ -263,12 +264,17 @@ export default {
 | 
			
		||||
              // },
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              // min: function() { // 取最小值向下取整为最小刻度
 | 
			
		||||
              //   return 0
 | 
			
		||||
              // },
 | 
			
		||||
              // max: function(value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
              //   return Math.ceil(value.max)
 | 
			
		||||
              // },
 | 
			
		||||
              min: function () { // 取最小值向下取整为最小刻度
 | 
			
		||||
                return 0
 | 
			
		||||
              },
 | 
			
		||||
              max: function (value) { // 取最大值向上取整为最大刻度
 | 
			
		||||
 | 
			
		||||
                // console.log(value.max.toString().length)
 | 
			
		||||
                // String(value.max)[0]
 | 
			
		||||
                // for
 | 
			
		||||
                // return String(value.max)[0] +
 | 
			
		||||
              },
 | 
			
		||||
              minInterval: 5,//间隔
 | 
			
		||||
              scale: true,
 | 
			
		||||
              type: 'value',
 | 
			
		||||
              name: '产量/片', // y轴上方的单位
 | 
			
		||||
@@ -327,4 +333,13 @@ export default {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  top: -30px;
 | 
			
		||||
}
 | 
			
		||||
    .isra-chart-tooltip {
 | 
			
		||||
      background: #0a2b4f77 !important;
 | 
			
		||||
      border: none !important;
 | 
			
		||||
      backdrop-filter: blur(12px);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    .isra-chart-tooltip * {
 | 
			
		||||
      color: #fff !important;
 | 
			
		||||
    }
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -128,6 +128,8 @@ export default {
 | 
			
		||||
        this.chart.setOption({
 | 
			
		||||
          tooltip: {
 | 
			
		||||
            trigger: 'axis',
 | 
			
		||||
            trigger: 'item',
 | 
			
		||||
            className: "isra-chart-tooltip",
 | 
			
		||||
            axisPointer: {
 | 
			
		||||
              // 坐标轴指示器,坐标轴触发有效
 | 
			
		||||
              type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
 | 
			
		||||
@@ -226,4 +228,13 @@ export default {
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  top: -30px;
 | 
			
		||||
}
 | 
			
		||||
.isra-chart-tooltip {
 | 
			
		||||
  background: #0a2b4f77 !important;
 | 
			
		||||
  border: none !important;
 | 
			
		||||
  backdrop-filter: blur(12px);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.isra-chart-tooltip * {
 | 
			
		||||
  color: #fff !important;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-27 13:54:52
 | 
			
		||||
 * @LastEditTime: 2024-04-03 18:12:18
 | 
			
		||||
 * @LastEditTime: 2024-04-19 15:43:08
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
@@ -101,11 +101,14 @@ export default {
 | 
			
		||||
      });;
 | 
			
		||||
    },
 | 
			
		||||
    initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) {
 | 
			
		||||
      let rawData = []
 | 
			
		||||
      let colors = ['#0fdedb', '#2359ec']
 | 
			
		||||
      if (topNameList.length === 0 && nameWasteList.length === 0 && passRateList === 0 && wasteList === 0) {
 | 
			
		||||
        return
 | 
			
		||||
      } else {
 | 
			
		||||
        let rawData = []
 | 
			
		||||
        let colors = ['#0fdedb', '#2359ec']
 | 
			
		||||
        rawData.push(passRateList, wasteList)
 | 
			
		||||
      const totalData = [];
 | 
			
		||||
      // if (rawData.length != 0 && raw,Data,length != 0) {
 | 
			
		||||
        const totalData = [];
 | 
			
		||||
        // if (rawData.length != 0 && raw,Data,length != 0) {
 | 
			
		||||
        for (let i = 0; i < rawData[0].length; ++i) {
 | 
			
		||||
          let sum = 0;
 | 
			
		||||
          for (let j = 0; j < rawData.length; ++j) {
 | 
			
		||||
@@ -113,150 +116,152 @@ export default {
 | 
			
		||||
          }
 | 
			
		||||
          totalData.push(sum);
 | 
			
		||||
        }
 | 
			
		||||
      // }
 | 
			
		||||
      // rawData[1].map((d, did) =>
 | 
			
		||||
      //   console.log((d / totalData[did]).toFixed(3))
 | 
			
		||||
      //   // totalData[did] <= 0 ? 0 : d / totalData[did]
 | 
			
		||||
      // )
 | 
			
		||||
      console.log('total', totalData)
 | 
			
		||||
      const series = [
 | 
			
		||||
        '良品',
 | 
			
		||||
        '废品',
 | 
			
		||||
        // 'Affiliate Ad',
 | 
			
		||||
        // 'Video Ad',
 | 
			
		||||
        // 'Search Engine'
 | 
			
		||||
      ].map((name, sid) => {
 | 
			
		||||
        // console.log(sid)
 | 
			
		||||
        return {
 | 
			
		||||
          name,
 | 
			
		||||
          type: 'bar',
 | 
			
		||||
          stack: 'total',
 | 
			
		||||
          barWidth: 12,
 | 
			
		||||
          // label: {
 | 
			
		||||
          //   show: true,
 | 
			
		||||
          //   formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
 | 
			
		||||
          // },
 | 
			
		||||
          color:colors[sid],
 | 
			
		||||
          data: rawData.length != 0 ? rawData[sid].map((d, did) =>
 | 
			
		||||
            totalData[did] <= 0 ? 0 : (d / totalData[did]).toFixed(4)
 | 
			
		||||
          ) : []
 | 
			
		||||
        };
 | 
			
		||||
      });
 | 
			
		||||
      // this.charts.resize({
 | 
			
		||||
      //   //width: width,
 | 
			
		||||
      //   //height: height,
 | 
			
		||||
      //   // es6解构
 | 
			
		||||
      //   width,
 | 
			
		||||
      //   height
 | 
			
		||||
      // })
 | 
			
		||||
      this.chart = echarts.init(document.getElementById(this.id))
 | 
			
		||||
      let isFinished = false //标记 isFinished
 | 
			
		||||
      this.chart.on('finished', _ => {
 | 
			
		||||
        if (!isFinished) {
 | 
			
		||||
          console.log('我只执行一次')
 | 
			
		||||
          isFinished = true
 | 
			
		||||
          // this.isLoading = false //关闭loading
 | 
			
		||||
          this.chart.resize() //重新渲染charts大小
 | 
			
		||||
        }
 | 
			
		||||
        console.log(113, 'finished')
 | 
			
		||||
      })
 | 
			
		||||
      this.chart.setOption({
 | 
			
		||||
        legend: {
 | 
			
		||||
          formatter: function (name) {
 | 
			
		||||
            //通过name获取到数组对象中的单个对象
 | 
			
		||||
            let singleData = series.filter(function (item) {
 | 
			
		||||
              return item.name == name
 | 
			
		||||
            })
 | 
			
		||||
            return name + parseFloat((singleData[0].data * 100).toFixed(0)) + '%'
 | 
			
		||||
          },
 | 
			
		||||
          itemWidth: 12,
 | 
			
		||||
          itemHeight: 12,
 | 
			
		||||
          bottom: '20',
 | 
			
		||||
          left: '20',
 | 
			
		||||
          icon: 'roundRect',
 | 
			
		||||
          textStyle: {
 | 
			
		||||
            color: 'rgba(255,255,255,.9)',
 | 
			
		||||
            fontSize:12,
 | 
			
		||||
        // }
 | 
			
		||||
        // rawData[1].map((d, did) =>
 | 
			
		||||
        //   console.log((d / totalData[did]).toFixed(3))
 | 
			
		||||
        //   // totalData[did] <= 0 ? 0 : d / totalData[did]
 | 
			
		||||
        // )
 | 
			
		||||
        console.log('total', totalData)
 | 
			
		||||
        const series = [
 | 
			
		||||
          '良品',
 | 
			
		||||
          '废品',
 | 
			
		||||
          // 'Affiliate Ad',
 | 
			
		||||
          // 'Video Ad',
 | 
			
		||||
          // 'Search Engine'
 | 
			
		||||
        ].map((name, sid) => {
 | 
			
		||||
          // console.log(sid)
 | 
			
		||||
          return {
 | 
			
		||||
            name,
 | 
			
		||||
            type: 'bar',
 | 
			
		||||
            stack: 'total',
 | 
			
		||||
            barWidth: 12,
 | 
			
		||||
            // label: {
 | 
			
		||||
            //   show: true,
 | 
			
		||||
            //   formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
 | 
			
		||||
            // },
 | 
			
		||||
            color: colors[sid],
 | 
			
		||||
            data: rawData.length != 0 ? rawData[sid].map((d, did) =>
 | 
			
		||||
              totalData[did] <= 0 ? 0 : (d / totalData[did]).toFixed(4)
 | 
			
		||||
            ) : []
 | 
			
		||||
          };
 | 
			
		||||
        });
 | 
			
		||||
        // this.charts.resize({
 | 
			
		||||
        //   //width: width,
 | 
			
		||||
        //   //height: height,
 | 
			
		||||
        //   // es6解构
 | 
			
		||||
        //   width,
 | 
			
		||||
        //   height
 | 
			
		||||
        // })
 | 
			
		||||
        this.chart = echarts.init(document.getElementById(this.id))
 | 
			
		||||
        let isFinished = false //标记 isFinished
 | 
			
		||||
        this.chart.on('finished', _ => {
 | 
			
		||||
          if (!isFinished) {
 | 
			
		||||
            console.log('我只执行一次')
 | 
			
		||||
            isFinished = true
 | 
			
		||||
            // this.isLoading = false //关闭loading
 | 
			
		||||
            this.chart.resize() //重新渲染charts大小
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        grid: {
 | 
			
		||||
          top:'0',
 | 
			
		||||
          left: '3%',
 | 
			
		||||
          right: '4%',
 | 
			
		||||
          // bottom: '3%',
 | 
			
		||||
          width: 'auto',
 | 
			
		||||
          height: '95',
 | 
			
		||||
          containLabel: true
 | 
			
		||||
        },
 | 
			
		||||
        yAxis: [
 | 
			
		||||
          {
 | 
			
		||||
            type: 'category',
 | 
			
		||||
            inverse: true,
 | 
			
		||||
            splitLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
          console.log(113, 'finished')
 | 
			
		||||
        })
 | 
			
		||||
        this.chart.setOption({
 | 
			
		||||
          legend: {
 | 
			
		||||
            formatter: function (name) {
 | 
			
		||||
              //通过name获取到数组对象中的单个对象
 | 
			
		||||
              let singleData = series.filter(function (item) {
 | 
			
		||||
                return item.name == name
 | 
			
		||||
              })
 | 
			
		||||
              return name + parseFloat((singleData[0].data * 100).toFixed(2)) + '%'
 | 
			
		||||
            },
 | 
			
		||||
            axisTick: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            axisLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              inside: true,
 | 
			
		||||
              interval: 0, //横轴信息全部显
 | 
			
		||||
              splitNumber: 50,
 | 
			
		||||
              // boundaryGap: [20, 20],
 | 
			
		||||
              textStyle: {
 | 
			
		||||
                color: 'rgba(255,255,255,.9)',
 | 
			
		||||
                verticalAlign: 'bottom',
 | 
			
		||||
                fontSize: 16,
 | 
			
		||||
                align: 'left',
 | 
			
		||||
                padding: [0, 0, 10, -5]
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            data: topNameList
 | 
			
		||||
            itemWidth: 12,
 | 
			
		||||
            itemHeight: 12,
 | 
			
		||||
            bottom: '20',
 | 
			
		||||
            left: '20',
 | 
			
		||||
            icon: 'roundRect',
 | 
			
		||||
            textStyle: {
 | 
			
		||||
              color: 'rgba(255,255,255,.9)',
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            type: 'category',
 | 
			
		||||
            inverse: true,
 | 
			
		||||
            splitLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
          grid: {
 | 
			
		||||
            top: '0',
 | 
			
		||||
            left: '3%',
 | 
			
		||||
            right: '4%',
 | 
			
		||||
            // bottom: '3%',
 | 
			
		||||
            width: 'auto',
 | 
			
		||||
            height: '95',
 | 
			
		||||
            containLabel: true
 | 
			
		||||
          },
 | 
			
		||||
          yAxis: [
 | 
			
		||||
            {
 | 
			
		||||
              type: 'category',
 | 
			
		||||
              inverse: true,
 | 
			
		||||
              splitLine: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              axisTick: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              axisLine: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              axisLabel: {
 | 
			
		||||
                show: true,
 | 
			
		||||
                inside: true,
 | 
			
		||||
                interval: 0, //横轴信息全部显
 | 
			
		||||
                splitNumber: 50,
 | 
			
		||||
                // boundaryGap: [20, 20],
 | 
			
		||||
                textStyle: {
 | 
			
		||||
                  color: 'rgba(255,255,255,.9)',
 | 
			
		||||
                  verticalAlign: 'bottom',
 | 
			
		||||
                  fontSize: 16,
 | 
			
		||||
                  align: 'left',
 | 
			
		||||
                  padding: [0, 0, 10, -5]
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              data: topNameList
 | 
			
		||||
            },
 | 
			
		||||
            axisTick: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            axisLine: {
 | 
			
		||||
              show: false
 | 
			
		||||
            },
 | 
			
		||||
            axisLabel: {
 | 
			
		||||
              show: true,
 | 
			
		||||
              inside: true,
 | 
			
		||||
              interval: 0, //横轴信息全部显
 | 
			
		||||
              splitNumber: 50,
 | 
			
		||||
              // boundaryGap: [20, 20],
 | 
			
		||||
              textStyle: {
 | 
			
		||||
                color: 'rgba(255,255,255,.9)',
 | 
			
		||||
                verticalAlign: 'bottom',
 | 
			
		||||
                fontSize: 16,
 | 
			
		||||
                align: 'right',
 | 
			
		||||
                padding: [0, 0, 10, -5]
 | 
			
		||||
              }
 | 
			
		||||
            },
 | 
			
		||||
            data: nameWasteList
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        xAxis: {
 | 
			
		||||
          // max: 120,
 | 
			
		||||
          show: false,
 | 
			
		||||
        },
 | 
			
		||||
        series:series
 | 
			
		||||
      })
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        setTimeout(() => {
 | 
			
		||||
          this.resize()
 | 
			
		||||
        },1000);
 | 
			
		||||
      })
 | 
			
		||||
            {
 | 
			
		||||
              type: 'category',
 | 
			
		||||
              inverse: true,
 | 
			
		||||
              splitLine: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              axisTick: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              axisLine: {
 | 
			
		||||
                show: false
 | 
			
		||||
              },
 | 
			
		||||
              axisLabel: {
 | 
			
		||||
                show: true,
 | 
			
		||||
                inside: true,
 | 
			
		||||
                interval: 0, //横轴信息全部显
 | 
			
		||||
                splitNumber: 50,
 | 
			
		||||
                // boundaryGap: [20, 20],
 | 
			
		||||
                textStyle: {
 | 
			
		||||
                  color: 'rgba(255,255,255,.9)',
 | 
			
		||||
                  verticalAlign: 'bottom',
 | 
			
		||||
                  fontSize: 16,
 | 
			
		||||
                  align: 'right',
 | 
			
		||||
                  padding: [0, 0, 10, -5]
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              data: nameWasteList
 | 
			
		||||
            }
 | 
			
		||||
          ],
 | 
			
		||||
          xAxis: {
 | 
			
		||||
            // max: 120,
 | 
			
		||||
            show: false,
 | 
			
		||||
          },
 | 
			
		||||
          series: series
 | 
			
		||||
        })
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          setTimeout(() => {
 | 
			
		||||
            this.resize()
 | 
			
		||||
          }, 1000);
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // this.chart.resize({
 | 
			
		||||
      //   width: 'auto',
 | 
			
		||||
      //   height: 90
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-07-19 15:18:30
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-10 16:10:11
 | 
			
		||||
 * @LastEditTime: 2024-04-26 09:57:41
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -25,38 +25,46 @@
 | 
			
		||||
    <el-row class="container-main flex-col" type="flex">
 | 
			
		||||
      <el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="15" type="flex" class="flex-1" style="height: 50%">
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
 | 
			
		||||
          <base-container :title="'设备报警'" :size="'small'" :height="318" :title-icon="'eqAlarm'">
 | 
			
		||||
          <base-container :show-time="true" :title="'设备报警'" :size="'small'" :height="318" :title-icon="'eqAlarm'">
 | 
			
		||||
            <dv-scroll-board class="eqTable" :config="eqConfig" style="width: 100%; height: 350px"
 | 
			
		||||
              ref="eqScrollBoard" />
 | 
			
		||||
          </base-container>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
 | 
			
		||||
          <base-container :title="'各工序缺陷汇总'" :size="'small'" :title-icon="'scrap'">
 | 
			
		||||
          <base-container :show-time="true" :title="'各工序缺陷汇总'" :size="'small'" :title-icon="'scrap'">
 | 
			
		||||
            <dv-scroll-board :config="processConfig" style="width: 100%; height: 350px" ref="processScrollBoard" />
 | 
			
		||||
          </base-container>
 | 
			
		||||
        </el-col>
 | 
			
		||||
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
 | 
			
		||||
          <base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'">
 | 
			
		||||
          <base-container :show-time="false" :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'">
 | 
			
		||||
            <div class="order" style="width: 100%; overflow: hidden scroll; height: 350px">
 | 
			
		||||
              <el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;">
 | 
			
		||||
                <!-- <el-col :span="12"> -->
 | 
			
		||||
                <!-- <div style="height: 34px;"> -->
 | 
			
		||||
                <span class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</span>
 | 
			
		||||
                <el-divider class="split" v-if="op.specifications" direction="vertical"></el-divider>
 | 
			
		||||
                <!-- <span v-if="op.size" class="split"></span> -->
 | 
			
		||||
                <span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{
 | 
			
		||||
                op.specifications }}</span>
 | 
			
		||||
                <el-divider class="split" v-if="op.planQuantity" direction="vertical"></el-divider>
 | 
			
		||||
                <span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
 | 
			
		||||
                op.planQuantity }}</span>
 | 
			
		||||
                <span v-if="op.actualQuantity" class="orderFinish"
 | 
			
		||||
                  style="font-size: 14px;opacity: calc(.6);margin-left: 130px;">{{
 | 
			
		||||
                  op.actualQuantity
 | 
			
		||||
                <span style="display: inline-block;width: 400px">
 | 
			
		||||
                  <span v-if="op.name" class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name
 | 
			
		||||
                  }}</span>
 | 
			
		||||
                <el-divider class="split" v-if="op.actualQuantity" direction="vertical"></el-divider>
 | 
			
		||||
                  <el-divider v-if="op.specifications" class="split" direction="vertical"></el-divider>
 | 
			
		||||
                  <!-- <span v-if="op.size" class="split"></span> -->
 | 
			
		||||
                  <span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{
 | 
			
		||||
                  op.specifications }}</span>
 | 
			
		||||
                  <el-divider class="split" v-if="op.planQuantity" direction="vertical"></el-divider>
 | 
			
		||||
                  <span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
 | 
			
		||||
                  op.planQuantity }}</span>
 | 
			
		||||
                  <span v-if="op.planQuantity" class="orderFinishTwo"
 | 
			
		||||
                    style="font-size: 14px;opacity: calc(.6);">片</span>
 | 
			
		||||
                </span>
 | 
			
		||||
                <!-- <span style="overflow: hidden;"> -->
 | 
			
		||||
                <span class="orderFinish" style="font-size: 14px;margin-left: 40px;">{{
 | 
			
		||||
                op.actualQuantity
 | 
			
		||||
                }}</span>
 | 
			
		||||
                <span v-if="op.actualQuantity" class="orderFinishTwo" style="font-size: 14px">片</span>
 | 
			
		||||
                <el-divider class="split" style="background-color: rgba(0, 255, 247, 1)" v-if="op.actualQuantity"
 | 
			
		||||
                  direction="vertical"></el-divider>
 | 
			
		||||
                <!-- </span> -->
 | 
			
		||||
                <!-- </div> -->
 | 
			
		||||
                <el-progress style="width: 620px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
 | 
			
		||||
                <el-progress style="width: 620px;" text-color="rgba(0, 255, 247, 1)" :stroke-width="10"
 | 
			
		||||
                  define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" />
 | 
			
		||||
              </el-row>
 | 
			
		||||
            </div>
 | 
			
		||||
@@ -67,8 +75,8 @@
 | 
			
		||||
 | 
			
		||||
      <el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="12" type="flex" class="flex-1">
 | 
			
		||||
        <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
 | 
			
		||||
          <base-container :show-yes-time="true" :no-content-padding="true" :height="256" :size="'eqStatus'"
 | 
			
		||||
            :title="'能源监控'" :title-icon="'energyMonitoring'">
 | 
			
		||||
          <base-container :show-time="true" :show-yes-time="true" :no-content-padding="true" :height="256"
 | 
			
		||||
            :size="'eqStatus'" :title="'能源监控'" :title-icon="'energyMonitoring'">
 | 
			
		||||
            <el-row :gutter="9">
 | 
			
		||||
              <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
 | 
			
		||||
                <linear-bar-chart ref="EnergyMonitoringChart" :name-list="EnergyMonitoringNameList"
 | 
			
		||||
@@ -109,79 +117,79 @@ const qualityYearList = [
 | 
			
		||||
		name: '翻转机',
 | 
			
		||||
		code: 'EQ20240110112358000235',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '烘干炉',
 | 
			
		||||
		code: 'EQ20240110112537000241',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
		status: '停机',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '清洗机',
 | 
			
		||||
		code: '	EQ20240110112310000232',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '故障',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '钢化清洗机',
 | 
			
		||||
		code: 'EQ20240110111700000208',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '故障',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '固化机',
 | 
			
		||||
		code: 'EQ20240110111700000201',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '停机',
 | 
			
		||||
    error: false,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '磨边清洗机',
 | 
			
		||||
		code: '	EQ20240110111700000208',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '停机',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '预热机',
 | 
			
		||||
		code: 'EQ20240110111700000205',
 | 
			
		||||
		status: '故障',
 | 
			
		||||
		error: '是',
 | 
			
		||||
    status: '运行',
 | 
			
		||||
    error: false,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '下片机',
 | 
			
		||||
		code: 'EQ20240115151435000279',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    code: 'EQ20240115151435000279',
 | 
			
		||||
    status: '故障',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '冷却机',
 | 
			
		||||
		code: 'EQ20240110111700000203',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '运行',
 | 
			
		||||
    error: false,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: 'A储片机106',
 | 
			
		||||
		code: 'EQ20240110111700000202',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '停机',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '二次清洗机',
 | 
			
		||||
		code: 'EQ20240110111700000209',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '停机',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '二次磨边机',
 | 
			
		||||
		code: '	EQ20240110110927000181',
 | 
			
		||||
		status: '故障',
 | 
			
		||||
		error: '是',
 | 
			
		||||
    status: '停机',
 | 
			
		||||
    error: false,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		name: '测试设备',
 | 
			
		||||
		code: 'EQ20240110111700000201',
 | 
			
		||||
		status: '运行',
 | 
			
		||||
		error: '否',
 | 
			
		||||
    status: '运行',
 | 
			
		||||
    error: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
const qualityMonthList = [
 | 
			
		||||
@@ -230,37 +238,37 @@ const qualityMonthList = [
 | 
			
		||||
];
 | 
			
		||||
const orderProcessList = [
 | 
			
		||||
	{
 | 
			
		||||
		id: '1',
 | 
			
		||||
		id: 1,
 | 
			
		||||
		outRate: '.8',
 | 
			
		||||
		name: '凯盛0322',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		id: '2',
 | 
			
		||||
		id: 2,
 | 
			
		||||
		outRate: '.4',
 | 
			
		||||
		name: '光伏玻璃4.0',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		id: '3',
 | 
			
		||||
		id: 3,
 | 
			
		||||
		outRate: '.5',
 | 
			
		||||
		name: '光伏玻璃3.0',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		id: '4',
 | 
			
		||||
		id: 4,
 | 
			
		||||
		outRate: '.3',
 | 
			
		||||
		name: '光伏玻璃2.0',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		id: '5',
 | 
			
		||||
		id: 5,
 | 
			
		||||
		outRate: '.5',
 | 
			
		||||
		name: '光伏玻璃1.0',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		id: '6',
 | 
			
		||||
		id: 6,
 | 
			
		||||
		outRate: '.8',
 | 
			
		||||
		name: '光伏玻璃',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		id: '7',
 | 
			
		||||
		id: 7,
 | 
			
		||||
		outRate: '.8',
 | 
			
		||||
		name: '统计订单',
 | 
			
		||||
	},
 | 
			
		||||
@@ -291,11 +299,11 @@ export default {
 | 
			
		||||
			// equipmentList:[],
 | 
			
		||||
			EnergyMonitoringList: [],
 | 
			
		||||
			eqConfig: {
 | 
			
		||||
				header: ['序号', '设备名称', '设备编码', '设备状态', '是否故障'],
 | 
			
		||||
        header: ['序号', '产线名', '设备名称', '设备状态'],
 | 
			
		||||
				headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
				columnWidth: [70, 100, 200, 90, 90],
 | 
			
		||||
				columnWidth: [70, 150, 200, 120],
 | 
			
		||||
				align: ['center'],
 | 
			
		||||
				data: [],
 | 
			
		||||
				// index:true,
 | 
			
		||||
@@ -372,15 +380,15 @@ export default {
 | 
			
		||||
		this.websocketClose();
 | 
			
		||||
		this.SJGWebsocketClose();
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
  mounted() {
 | 
			
		||||
		let detData = [
 | 
			
		||||
			{
 | 
			
		||||
				id: '1',
 | 
			
		||||
				name: '测试工单',
 | 
			
		||||
        name: '镀釉光伏玻璃GW',
 | 
			
		||||
        progressRate: 0.933333,
 | 
			
		||||
        specifications: '1100*5554*22',
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish:111,
 | 
			
		||||
        plan: 111111111111,
 | 
			
		||||
        actualQuantity:1000000111111,
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				id: '2',
 | 
			
		||||
@@ -388,7 +396,7 @@ export default {
 | 
			
		||||
        progressRate: 0.932323,
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				id: '3',
 | 
			
		||||
@@ -396,7 +404,7 @@ export default {
 | 
			
		||||
        progressRate: 0.23232,
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				id: '4',
 | 
			
		||||
@@ -404,7 +412,7 @@ export default {
 | 
			
		||||
        progressRate: 0.32323,
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: '5',
 | 
			
		||||
@@ -412,7 +420,7 @@ export default {
 | 
			
		||||
        progressRate: 0.32323,
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: '6',
 | 
			
		||||
@@ -420,7 +428,7 @@ export default {
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        progressRate: 0.32323,
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: '7',
 | 
			
		||||
@@ -428,7 +436,7 @@ export default {
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        progressRate: 0.32323,
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        id: '8',
 | 
			
		||||
@@ -436,7 +444,7 @@ export default {
 | 
			
		||||
        progressRate: 0.32323,
 | 
			
		||||
        size: '1100*5554*22',
 | 
			
		||||
        plan: 11111,
 | 
			
		||||
        finish: 111,
 | 
			
		||||
        actualQuantity: 111,
 | 
			
		||||
      },
 | 
			
		||||
			// {
 | 
			
		||||
			//   id: '5',
 | 
			
		||||
@@ -451,12 +459,12 @@ export default {
 | 
			
		||||
		this.orderList = detData.map((ele, index) => {
 | 
			
		||||
			if (ele.progressRate && ele.progressRate != 1) {
 | 
			
		||||
				return {
 | 
			
		||||
					id: ele.id,
 | 
			
		||||
					name: ele.name,
 | 
			
		||||
          id: ele.id,
 | 
			
		||||
          name: this.getStr(String(ele.name), 8),
 | 
			
		||||
          progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
 | 
			
		||||
          specifications: ele.specifications ?  '规格' + ele.specifications :null,
 | 
			
		||||
          planQuantity: ele.plan ? '计划' + ele.plan + '片' : null,
 | 
			
		||||
          finish: ele.finish + '片',
 | 
			
		||||
          specifications: ele.specifications ? '规格' + ele.specifications : '',
 | 
			
		||||
          planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan), 6) : '',
 | 
			
		||||
          actualQuantity: ele.actualQuantity ? this.getStr(String(ele.actualQuantity), 6) : '',
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
@@ -472,16 +480,14 @@ export default {
 | 
			
		||||
			this.EnergyMonitoringNameList,
 | 
			
		||||
			this.EnergyMonitoringList
 | 
			
		||||
		);
 | 
			
		||||
		let eqArr = this.qualityYearList.map((item, index) => [
 | 
			
		||||
    let eqArr = this.qualityYearList.map((item, index) => [
 | 
			
		||||
			`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
 | 
			
		||||
            </span>`,
 | 
			
		||||
			// formatDate(item.planStartTime) || '',
 | 
			
		||||
			`
 | 
			
		||||
      `<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''}</span>`,`
 | 
			
		||||
          <span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
 | 
			
		||||
            </span>`,
 | 
			
		||||
			`<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</span>`,
 | 
			
		||||
      `<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;  background-color: #FFBD02;float:left;margin:13px 10px 0 0 '}"></div>  ${item.status || ''}</span>`,
 | 
			
		||||
      `<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == '是' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;  background-color: #FFBD02;float:left;margin:13px 10px 0 0 '}"></div>  ${item.error || ''}</span>`,
 | 
			
		||||
      `<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%;  background-color: red;float:left;margin:13px 10px 0 0'}"></div>  ${item.status || ''}</span>`,
 | 
			
		||||
		]);
 | 
			
		||||
    this.eqConfig.data = eqArr;
 | 
			
		||||
    let data = [
 | 
			
		||||
@@ -560,6 +566,15 @@ export default {
 | 
			
		||||
	//   removeEventListener('resize', resizeFun)
 | 
			
		||||
	// },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getStr(str,num) {
 | 
			
		||||
          //你要处理的字符串
 | 
			
		||||
      if (str.length > num) {      //如果字符长度超过10,后面的字符就变成...可自行调整长度和代替字符
 | 
			
		||||
        str = str.substr(0, num) + "..."   //截取从第一个字符开始,往后取10个字符,剩余的用...代替
 | 
			
		||||
        return str
 | 
			
		||||
      } else {
 | 
			
		||||
        return str
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
		getData() {
 | 
			
		||||
			let processArr = qualityMonthList.map((item, index) => [
 | 
			
		||||
				// console.log(item)
 | 
			
		||||
@@ -728,12 +743,12 @@ export default {
 | 
			
		||||
					this.orderList = this.SJGWsData.detData.map((ele, index) => {
 | 
			
		||||
						if (ele.progressRate && ele.progressRate != 1) {
 | 
			
		||||
							return {
 | 
			
		||||
								id: ele.id,
 | 
			
		||||
								name: ele.name,
 | 
			
		||||
                id: ele.id,
 | 
			
		||||
                name: this.getStr(String(ele.name), 8),
 | 
			
		||||
                progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
 | 
			
		||||
                specifications: ele.specifications ?  '规格' + ele.specifications :null,
 | 
			
		||||
                planQuantity: ele.planQuantity  ? '计划' + ele.planQuantity + '片' : null,
 | 
			
		||||
                actualQuantity: ele.actualQuantity ? ele.actualQuantity + '片' : null,
 | 
			
		||||
                specifications: ele.specifications ? '规格' + ele.specifications : '',
 | 
			
		||||
                planQuantity: ele.planQuantity ? '计划' + this.getStr(String(ele.planQuantity),6) : '',
 | 
			
		||||
                actualQuantity: ele.actualQuantity ? this.getStr(String(ele.actualQuantity), 6) : '',
 | 
			
		||||
							};
 | 
			
		||||
						}
 | 
			
		||||
					});
 | 
			
		||||
@@ -742,13 +757,13 @@ export default {
 | 
			
		||||
					let eqArr = this.SJGWsData.detData.map((item, index) => [
 | 
			
		||||
						`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
 | 
			
		||||
            </span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${item.lineName || ''
 | 
			
		||||
            }</span>`,
 | 
			
		||||
						`<span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
 | 
			
		||||
            </span>`,
 | 
			
		||||
						`<span style="color:rgba(255,255,255,0.5)">${
 | 
			
		||||
							item.code || ''
 | 
			
		||||
						}</span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;  background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div>  ${item.status || ''}</span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == '是' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;  background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div>  ${item.error || ''}</span>`,
 | 
			
		||||
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0' : item.status == '停机' ? 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;background-color: #FFBD02;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%;  background-color: red;float:left;margin:13px 10px 0 0'}"></div>  ${item.status || ''}</span>`,
 | 
			
		||||
            // `<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == false ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%;  background-color: red;float:left;margin:10px 10px 0 0 '}"></div>  ${item.error == true ?'是' :'否'  || ''}</span>`,
 | 
			
		||||
					]);
 | 
			
		||||
          this.eqConfig.data = eqArr;
 | 
			
		||||
          // this.$nextTick(() => {
 | 
			
		||||
@@ -790,7 +805,23 @@ export default {
 | 
			
		||||
              outputNumList
 | 
			
		||||
            );
 | 
			
		||||
          })
 | 
			
		||||
				} else if (this.SJGInitWebSocket === 'inspection') {
 | 
			
		||||
        } else if (this.SJGWsData.type === 'inspection') {
 | 
			
		||||
          let processArr = this.SJGWsData.detData.map((item, index) => [
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
 | 
			
		||||
            </span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
 | 
			
		||||
            </span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''
 | 
			
		||||
            }</span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${item.count || ''
 | 
			
		||||
            }</span>`,
 | 
			
		||||
            `<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''
 | 
			
		||||
            }</span>`,
 | 
			
		||||
          ]);
 | 
			
		||||
          this.processConfig.data = processArr;
 | 
			
		||||
          // this.$nextTick(() => {
 | 
			
		||||
          this.$refs['processScrollBoard'].updateRows(processArr);
 | 
			
		||||
          // })
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
		},
 | 
			
		||||
@@ -954,7 +985,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
.now-secondary-title {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 70px;
 | 
			
		||||
  width: 110px;
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	font-size: 14px;
 | 
			
		||||
	line-height: 2em;
 | 
			
		||||
@@ -973,16 +1004,27 @@ export default {
 | 
			
		||||
  width: 60px;
 | 
			
		||||
  margin: 0;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
  line-height: 2em;
 | 
			
		||||
  text-align: right;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  color: rgba(0, 255, 247, 1);
 | 
			
		||||
}
 | 
			
		||||
.orderPlan {
 | 
			
		||||
.orderFinishTwo{
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 100px;
 | 
			
		||||
  width: 15px;
 | 
			
		||||
  margin: 0;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
  line-height: 2em;
 | 
			
		||||
  // text-overflow: ellipsis;
 | 
			
		||||
  // white-space: nowrap;
 | 
			
		||||
  // overflow: hidden;
 | 
			
		||||
  text-align: right;
 | 
			
		||||
  color: rgba(0, 255, 247, 1);
 | 
			
		||||
}
 | 
			
		||||
.orderPlan {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  // width: 80px;
 | 
			
		||||
  margin: 0;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
  // line-height: 2em;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  text-align: left;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,24 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <el-drawer :visible.sync="drawer" :append-to-body="true" size="80%" >
 | 
			
		||||
    <small-title slot="title" :no-padding="true">
 | 
			
		||||
      <!-- <template v-for="demo in demoList"> -->
 | 
			
		||||
      <!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> -->
 | 
			
		||||
      <!-- {{ $t('module.packingManage.printModelDesign') }} -->
 | 
			
		||||
      模板设计
 | 
			
		||||
      <!-- </el-button> -->
 | 
			
		||||
      <!-- </template> -->
 | 
			
		||||
    </small-title>
 | 
			
		||||
    <el-card>
 | 
			
		||||
      <el-row style="margin-bottom: 10px">
 | 
			
		||||
        <el-col :span="4">
 | 
			
		||||
          <!-- 模板选择 -->
 | 
			
		||||
	<el-drawer
 | 
			
		||||
		:visible.sync="drawer"
 | 
			
		||||
		:append-to-body="true"
 | 
			
		||||
		size="80%">
 | 
			
		||||
		<small-title
 | 
			
		||||
			slot="title"
 | 
			
		||||
			:no-padding="true">
 | 
			
		||||
			<!-- <template v-for="demo in demoList"> -->
 | 
			
		||||
			<!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> -->
 | 
			
		||||
			<!-- {{ $t('module.packingManage.printModelDesign') }} -->
 | 
			
		||||
			模板设计
 | 
			
		||||
			<!-- </el-button> -->
 | 
			
		||||
			<!-- </template> -->
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-card>
 | 
			
		||||
			<el-row style="margin-bottom: 10px">
 | 
			
		||||
				<!-- <el-col :span="4"> -->
 | 
			
		||||
				<!-- 模板选择 -->
 | 
			
		||||
 | 
			
		||||
          <!-- <el-select
 | 
			
		||||
				<!-- <el-select
 | 
			
		||||
          v-model="mode"
 | 
			
		||||
          filterable
 | 
			
		||||
          :default-value="0"
 | 
			
		||||
@@ -25,393 +30,469 @@
 | 
			
		||||
            {{ opt.name }}
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select> -->
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="20">
 | 
			
		||||
          <!-- 纸张设置 -->
 | 
			
		||||
          <el-button-group style="margin:0 10px">
 | 
			
		||||
            <el-button v-for="(value,type) in paperTypes" :key="type" :type="curPaperType === type ? 'primary' : ' '"
 | 
			
		||||
              @click="setPaper(type,value)">
 | 
			
		||||
              {{ type }}
 | 
			
		||||
            </el-button>
 | 
			
		||||
          </el-button-group>
 | 
			
		||||
          <el-input-number style="margin:0 10px" :value="scaleValue " :precision="2" :step="0.1" :min="scaleMin"
 | 
			
		||||
            :max="scaleMax" @change="changeScale" />
 | 
			
		||||
          <el-popover v-model="paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
 | 
			
		||||
            <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
 | 
			
		||||
              <el-input v-model="paperWidth" type="number" style=" width: 100px; text-align: center" place="宽(mm)" />~
 | 
			
		||||
              <el-input v-model="paperHeight" type="number" style=" width: 100px; text-align: center" place="高(mm)" />
 | 
			
		||||
            </div>
 | 
			
		||||
            <div>
 | 
			
		||||
              <el-button type="primary" style="width: 100%" size="mini" @click="otherPaper">确定</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
            <el-button slot="reference" type="primary" style="margin:0 10px">自定义宽高</el-button>
 | 
			
		||||
          </el-popover>
 | 
			
		||||
				<!-- </el-col> -->
 | 
			
		||||
				<el-col :span="24">
 | 
			
		||||
					<!-- 纸张设置 -->
 | 
			
		||||
					<el-button-group style="margin: 0 10px">
 | 
			
		||||
						<el-button
 | 
			
		||||
							v-for="(value, type) in paperTypes"
 | 
			
		||||
							:key="type"
 | 
			
		||||
							:type="curPaperType === type ? 'primary' : ' '"
 | 
			
		||||
							@click="setPaper(type, value)">
 | 
			
		||||
							{{ type }}
 | 
			
		||||
						</el-button>
 | 
			
		||||
					</el-button-group>
 | 
			
		||||
					<el-input-number
 | 
			
		||||
						style="margin: 0 10px; width: 140px"
 | 
			
		||||
						:value="scaleValue"
 | 
			
		||||
						:precision="2"
 | 
			
		||||
						:step="0.1"
 | 
			
		||||
						:min="scaleMin"
 | 
			
		||||
						:max="scaleMax"
 | 
			
		||||
						@change="changeScale" />
 | 
			
		||||
					<el-popover
 | 
			
		||||
						v-model="paperPopVisible"
 | 
			
		||||
						placement="bottom"
 | 
			
		||||
						width="300"
 | 
			
		||||
						title="设置纸张宽高(mm)">
 | 
			
		||||
						<div
 | 
			
		||||
							style="
 | 
			
		||||
								display: flex;
 | 
			
		||||
								align-items: center;
 | 
			
		||||
								justify-content: space-between;
 | 
			
		||||
								margin-bottom: 10px;
 | 
			
		||||
							">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="paperWidth"
 | 
			
		||||
								type="number"
 | 
			
		||||
								style="width: 100px; text-align: center"
 | 
			
		||||
								place="宽(mm)" />
 | 
			
		||||
							~
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="paperHeight"
 | 
			
		||||
								type="number"
 | 
			
		||||
								style="width: 100px; text-align: center"
 | 
			
		||||
								place="高(mm)" />
 | 
			
		||||
						</div>
 | 
			
		||||
						<div>
 | 
			
		||||
							<el-button
 | 
			
		||||
								type="primary"
 | 
			
		||||
								style="width: 100%"
 | 
			
		||||
								size="mini"
 | 
			
		||||
								@click="otherPaper">
 | 
			
		||||
								确定
 | 
			
		||||
							</el-button>
 | 
			
		||||
						</div>
 | 
			
		||||
						<el-button
 | 
			
		||||
							slot="reference"
 | 
			
		||||
							type="primary"
 | 
			
		||||
							style="margin: 0 10px">
 | 
			
		||||
							自定义宽高
 | 
			
		||||
						</el-button>
 | 
			
		||||
					</el-popover>
 | 
			
		||||
 | 
			
		||||
          <!--          <a-button-group>-->
 | 
			
		||||
          <!--            <template v-for="(value,type) in paperTypes">-->
 | 
			
		||||
          <!--              <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">-->
 | 
			
		||||
          <!--                {{ type }}-->
 | 
			
		||||
          <!--              </a-button>-->
 | 
			
		||||
          <!--            </template>-->
 | 
			
		||||
          <!--            <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">-->
 | 
			
		||||
          <!--              <div slot="content">-->
 | 
			
		||||
          <!--                <a-input-group compact style="margin: 10px 10px">-->
 | 
			
		||||
          <!--                  <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"-->
 | 
			
		||||
          <!--                           placeholder="宽(mm)"/>-->
 | 
			
		||||
          <!--                  <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"-->
 | 
			
		||||
          <!--                           placeholder="~" disabled-->
 | 
			
		||||
          <!--                  />-->
 | 
			
		||||
          <!--                  <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"-->
 | 
			
		||||
          <!--                           placeholder="高(mm)"/>-->
 | 
			
		||||
          <!--                </a-input-group>-->
 | 
			
		||||
          <!--                <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>-->
 | 
			
		||||
          <!--              </div>-->
 | 
			
		||||
          <!--              <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>-->
 | 
			
		||||
          <!--            </a-popover>-->
 | 
			
		||||
          <!--          </a-button-group>-->
 | 
			
		||||
					<!--          <a-button-group>-->
 | 
			
		||||
					<!--            <template v-for="(value,type) in paperTypes">-->
 | 
			
		||||
					<!--              <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">-->
 | 
			
		||||
					<!--                {{ type }}-->
 | 
			
		||||
					<!--              </a-button>-->
 | 
			
		||||
					<!--            </template>-->
 | 
			
		||||
					<!--            <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">-->
 | 
			
		||||
					<!--              <div slot="content">-->
 | 
			
		||||
					<!--                <a-input-group compact style="margin: 10px 10px">-->
 | 
			
		||||
					<!--                  <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"-->
 | 
			
		||||
					<!--                           placeholder="宽(mm)"/>-->
 | 
			
		||||
					<!--                  <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"-->
 | 
			
		||||
					<!--                           placeholder="~" disabled-->
 | 
			
		||||
					<!--                  />-->
 | 
			
		||||
					<!--                  <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"-->
 | 
			
		||||
					<!--                           placeholder="高(mm)"/>-->
 | 
			
		||||
					<!--                </a-input-group>-->
 | 
			
		||||
					<!--                <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>-->
 | 
			
		||||
					<!--              </div>-->
 | 
			
		||||
					<!--              <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>-->
 | 
			
		||||
					<!--            </a-popover>-->
 | 
			
		||||
					<!--          </a-button-group>-->
 | 
			
		||||
 | 
			
		||||
          <!-- 预览/打印 -->
 | 
			
		||||
          <el-button-group>
 | 
			
		||||
            <el-button type="primary" icon="redo" @click="rotatePaper()">旋转</el-button>
 | 
			
		||||
            <el-button type="primary" icon="el-icon-view" @click="preView">
 | 
			
		||||
              预览
 | 
			
		||||
            </el-button>
 | 
			
		||||
            <!-- <el-button type="primary" icon="el-icon-printer" @click="print">
 | 
			
		||||
					<!-- 预览/打印 -->
 | 
			
		||||
					<el-button-group>
 | 
			
		||||
						<el-button
 | 
			
		||||
							type="primary"
 | 
			
		||||
							icon="redo"
 | 
			
		||||
							@click="rotatePaper()">
 | 
			
		||||
							旋转
 | 
			
		||||
						</el-button>
 | 
			
		||||
						<el-button
 | 
			
		||||
							type="primary"
 | 
			
		||||
							icon="el-icon-view"
 | 
			
		||||
							@click="preView">
 | 
			
		||||
							预览
 | 
			
		||||
						</el-button>
 | 
			
		||||
						<!-- <el-button type="primary" icon="el-icon-printer" @click="print">
 | 
			
		||||
            直接打印
 | 
			
		||||
          </el-button> -->
 | 
			
		||||
            <el-button type="primary" icon="el-icon-s-management" @click="save">
 | 
			
		||||
              保存
 | 
			
		||||
            </el-button>
 | 
			
		||||
            <el-button type="danger" icon="el-icon-delete" @click="clearPaper">
 | 
			
		||||
              清空
 | 
			
		||||
            </el-button>
 | 
			
		||||
          </el-button-group>
 | 
			
		||||
          <!-- 保存/清空 -->
 | 
			
		||||
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-row :gutter="24">
 | 
			
		||||
        <el-col :span="4">
 | 
			
		||||
          <el-card style="height: 100vh">
 | 
			
		||||
            <el-row>
 | 
			
		||||
              <el-col :span="24" class="rect-printElement-types hiprintEpContainer" />
 | 
			
		||||
            </el-row>
 | 
			
		||||
          </el-card>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="16">
 | 
			
		||||
          <el-card class="card-design">
 | 
			
		||||
            <div id="hiprint-printTemplate" class="hiprint-printTemplate" />
 | 
			
		||||
          </el-card>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="4" class="params_setting_container">
 | 
			
		||||
          <el-card>
 | 
			
		||||
            <el-row class="hinnn-layout-sider">
 | 
			
		||||
              <div id="PrintElementOptionSetting" />
 | 
			
		||||
            </el-row>
 | 
			
		||||
          </el-card>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <!-- 预览 -->
 | 
			
		||||
      <print-preview ref="preView" />
 | 
			
		||||
    </el-card>
 | 
			
		||||
  </el-drawer>
 | 
			
		||||
						<el-button
 | 
			
		||||
							type="primary"
 | 
			
		||||
							icon="el-icon-s-management"
 | 
			
		||||
							@click="save">
 | 
			
		||||
							保存
 | 
			
		||||
						</el-button>
 | 
			
		||||
						<el-button
 | 
			
		||||
							type="danger"
 | 
			
		||||
							icon="el-icon-delete"
 | 
			
		||||
							@click="clearPaper">
 | 
			
		||||
							清空
 | 
			
		||||
						</el-button>
 | 
			
		||||
					</el-button-group>
 | 
			
		||||
					<!-- 保存/清空 -->
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="24">
 | 
			
		||||
				<el-col :span="4">
 | 
			
		||||
					<el-card style="height: 100vh">
 | 
			
		||||
						<el-row>
 | 
			
		||||
							<el-col
 | 
			
		||||
								:span="24"
 | 
			
		||||
								class="rect-printElement-types hiprintEpContainer" />
 | 
			
		||||
						</el-row>
 | 
			
		||||
					</el-card>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="16">
 | 
			
		||||
					<el-card class="card-design">
 | 
			
		||||
						<div
 | 
			
		||||
							id="hiprint-printTemplate"
 | 
			
		||||
							class="hiprint-printTemplate" />
 | 
			
		||||
					</el-card>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col
 | 
			
		||||
					:span="4"
 | 
			
		||||
					class="params_setting_container">
 | 
			
		||||
					<el-card>
 | 
			
		||||
						<el-row class="hinnn-layout-sider">
 | 
			
		||||
							<div id="PrintElementOptionSetting" />
 | 
			
		||||
						</el-row>
 | 
			
		||||
					</el-card>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<!-- 预览 -->
 | 
			
		||||
			<print-preview ref="preView" />
 | 
			
		||||
		</el-card>
 | 
			
		||||
	</el-drawer>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
import printPreview from './preview'
 | 
			
		||||
import { MessageBox } from 'element-ui'
 | 
			
		||||
import { hiprint } from 'vue-plugin-hiprint'
 | 
			
		||||
import providers from './providers'
 | 
			
		||||
import printPreview from './preview';
 | 
			
		||||
import { MessageBox } from 'element-ui';
 | 
			
		||||
import { hiprint } from 'vue-plugin-hiprint';
 | 
			
		||||
import providers from './providers';
 | 
			
		||||
// import printData from './print-data'
 | 
			
		||||
import $ from 'jquery'
 | 
			
		||||
import SmallTitle from './SmallTitle.vue'
 | 
			
		||||
let hiprintTemplate = null
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
import SmallTitle from './SmallTitle.vue';
 | 
			
		||||
let hiprintTemplate = null;
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'PrintCustom',
 | 
			
		||||
  components: { printPreview, SmallTitle },
 | 
			
		||||
  // props: {
 | 
			
		||||
  //   modelData: {
 | 
			
		||||
  //     type: String,
 | 
			
		||||
  //     default: ''
 | 
			
		||||
  //   }
 | 
			
		||||
  // },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // paperPopVisible: false,
 | 
			
		||||
      // 模板选择
 | 
			
		||||
      mode: 0,
 | 
			
		||||
      template: null,
 | 
			
		||||
      modeList: [],
 | 
			
		||||
      // 当前纸张
 | 
			
		||||
      curPaper: {
 | 
			
		||||
        // type: 'other',
 | 
			
		||||
        // width: 220,
 | 
			
		||||
        // height: 80
 | 
			
		||||
      },
 | 
			
		||||
      printData:{},
 | 
			
		||||
      drawer: false,
 | 
			
		||||
      // 纸张类型
 | 
			
		||||
      paperTypes: {
 | 
			
		||||
        'A3': {
 | 
			
		||||
          width: 420,
 | 
			
		||||
          height: 296.6
 | 
			
		||||
        },
 | 
			
		||||
        'A4': {
 | 
			
		||||
          width: 210,
 | 
			
		||||
          height: 297
 | 
			
		||||
        },
 | 
			
		||||
        'A5': {
 | 
			
		||||
          width: 210,
 | 
			
		||||
          height: 147.6
 | 
			
		||||
        },
 | 
			
		||||
        'B3': {
 | 
			
		||||
          width: 500,
 | 
			
		||||
          height: 352.6
 | 
			
		||||
        },
 | 
			
		||||
        'B4': {
 | 
			
		||||
          width: 250,
 | 
			
		||||
          height: 352.6
 | 
			
		||||
        },
 | 
			
		||||
        'B5': {
 | 
			
		||||
          width: 250,
 | 
			
		||||
          height: 175.6
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      scaleValue: 1,
 | 
			
		||||
      scaleMax: 5,
 | 
			
		||||
      scaleMin: 0.5,
 | 
			
		||||
      // 自定义纸张
 | 
			
		||||
      paperPopVisible: false,
 | 
			
		||||
      paperWidth: '210',
 | 
			
		||||
      paperHeight: '297'
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    curPaperType() {
 | 
			
		||||
      let type = 'other'
 | 
			
		||||
      const types = this.paperTypes
 | 
			
		||||
      for (const key in types) {
 | 
			
		||||
        const item = types[key]
 | 
			
		||||
        const { width, height } = this.curPaper
 | 
			
		||||
        if (item.width === width && item.height === height) {
 | 
			
		||||
          type = key
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      return type
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    // $('.hiprintEpContainer').empty()
 | 
			
		||||
  },
 | 
			
		||||
  destroyed () {
 | 
			
		||||
    $('.hiprintEpContainer').empty()
 | 
			
		||||
    console.log(11111)
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // handleClose() {
 | 
			
		||||
    //   $('.hiprintEpContainer').empty()
 | 
			
		||||
    // },
 | 
			
		||||
    closed() {
 | 
			
		||||
      $('.hiprintEpContainer').empty()
 | 
			
		||||
      $('.hiprint-printTemplate').empty()
 | 
			
		||||
    },
 | 
			
		||||
    init(data) {
 | 
			
		||||
      this.drawer = true
 | 
			
		||||
      this.modelData = data
 | 
			
		||||
      this.modeList = providers.map((e) => {
 | 
			
		||||
        return { type: e.type, name: e.name, value: e.value }
 | 
			
		||||
      })
 | 
			
		||||
      this.changeMode()
 | 
			
		||||
    },
 | 
			
		||||
    changeMode() {
 | 
			
		||||
      // hiprintTemplate.clear()
 | 
			
		||||
      // console.log(this.modelData)
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        const { mode } = this
 | 
			
		||||
        const provider = providers[mode]
 | 
			
		||||
        hiprint.init({
 | 
			
		||||
          providers: [provider.f]
 | 
			
		||||
        })
 | 
			
		||||
	name: 'PrintCustom',
 | 
			
		||||
	components: { printPreview, SmallTitle },
 | 
			
		||||
	// props: {
 | 
			
		||||
	//   modelData: {
 | 
			
		||||
	//     type: String,
 | 
			
		||||
	//     default: ''
 | 
			
		||||
	//   }
 | 
			
		||||
	// },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			// paperPopVisible: false,
 | 
			
		||||
			// 模板选择
 | 
			
		||||
			mode: 0,
 | 
			
		||||
			template: null,
 | 
			
		||||
			modeList: [],
 | 
			
		||||
			// 当前纸张
 | 
			
		||||
			curPaper: {
 | 
			
		||||
				// type: 'other',
 | 
			
		||||
				// width: 220,
 | 
			
		||||
				// height: 80
 | 
			
		||||
			},
 | 
			
		||||
			printData: {},
 | 
			
		||||
			drawer: false,
 | 
			
		||||
			// 纸张类型
 | 
			
		||||
			paperTypes: {
 | 
			
		||||
				A3: {
 | 
			
		||||
					width: 420,
 | 
			
		||||
					height: 296.6,
 | 
			
		||||
				},
 | 
			
		||||
				A4: {
 | 
			
		||||
					width: 210,
 | 
			
		||||
					height: 297,
 | 
			
		||||
				},
 | 
			
		||||
				A5: {
 | 
			
		||||
					width: 210,
 | 
			
		||||
					height: 147.6,
 | 
			
		||||
				},
 | 
			
		||||
				A6: {
 | 
			
		||||
					width: 95,
 | 
			
		||||
					height: 125,
 | 
			
		||||
				},
 | 
			
		||||
				B3: {
 | 
			
		||||
					width: 500,
 | 
			
		||||
					height: 352.6,
 | 
			
		||||
				},
 | 
			
		||||
				B4: {
 | 
			
		||||
					width: 250,
 | 
			
		||||
					height: 352.6,
 | 
			
		||||
				},
 | 
			
		||||
				B5: {
 | 
			
		||||
					width: 250,
 | 
			
		||||
					height: 175.6,
 | 
			
		||||
				},
 | 
			
		||||
			},
 | 
			
		||||
			scaleValue: 1,
 | 
			
		||||
			scaleMax: 5,
 | 
			
		||||
			scaleMin: 0.5,
 | 
			
		||||
			// 自定义纸张
 | 
			
		||||
			paperPopVisible: false,
 | 
			
		||||
			paperWidth: '210',
 | 
			
		||||
			paperHeight: '297',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		curPaperType() {
 | 
			
		||||
			let type = 'other';
 | 
			
		||||
			const types = this.paperTypes;
 | 
			
		||||
			for (const key in types) {
 | 
			
		||||
				const item = types[key];
 | 
			
		||||
				const { width, height } = this.curPaper;
 | 
			
		||||
				if (item.width === width && item.height === height) {
 | 
			
		||||
					type = key;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return type;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		// $('.hiprintEpContainer').empty()
 | 
			
		||||
	},
 | 
			
		||||
	destroyed() {
 | 
			
		||||
		$('.hiprintEpContainer').empty();
 | 
			
		||||
		console.log(11111);
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// handleClose() {
 | 
			
		||||
		//   $('.hiprintEpContainer').empty()
 | 
			
		||||
		// },
 | 
			
		||||
		closed() {
 | 
			
		||||
			$('.hiprintEpContainer').empty();
 | 
			
		||||
			$('.hiprint-printTemplate').empty();
 | 
			
		||||
		},
 | 
			
		||||
		init(data) {
 | 
			
		||||
			this.drawer = true;
 | 
			
		||||
			this.modelData = data;
 | 
			
		||||
			this.modeList = providers.map((e) => {
 | 
			
		||||
				return { type: e.type, name: e.name, value: e.value };
 | 
			
		||||
			});
 | 
			
		||||
			this.changeMode();
 | 
			
		||||
		},
 | 
			
		||||
		changeMode() {
 | 
			
		||||
			// hiprintTemplate.clear()
 | 
			
		||||
			// console.log(this.modelData)
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				const { mode } = this;
 | 
			
		||||
				const provider = providers[mode];
 | 
			
		||||
				hiprint.init({
 | 
			
		||||
					providers: [provider.f],
 | 
			
		||||
				});
 | 
			
		||||
 | 
			
		||||
        // $('#hiprint-printTemplate').empty()
 | 
			
		||||
        // console.log(JSON.parse(this.modelData))
 | 
			
		||||
        hiprint.setConfig()
 | 
			
		||||
        // 替换配置
 | 
			
		||||
        hiprint.setConfig({
 | 
			
		||||
          movingDistance: 2.5,
 | 
			
		||||
          text: {
 | 
			
		||||
            supportOptions: [
 | 
			
		||||
              {
 | 
			
		||||
                name: 'styler',
 | 
			
		||||
                hidden: true
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                name: 'formatter',
 | 
			
		||||
                hidden: true
 | 
			
		||||
              }
 | 
			
		||||
            ]
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
				// $('#hiprint-printTemplate').empty()
 | 
			
		||||
				// console.log(JSON.parse(this.modelData))
 | 
			
		||||
				hiprint.setConfig();
 | 
			
		||||
				// 替换配置
 | 
			
		||||
				hiprint.setConfig({
 | 
			
		||||
					movingDistance: 2.5,
 | 
			
		||||
					text: {
 | 
			
		||||
						supportOptions: [
 | 
			
		||||
							{
 | 
			
		||||
								name: 'styler',
 | 
			
		||||
								hidden: true,
 | 
			
		||||
							},
 | 
			
		||||
							{
 | 
			
		||||
								name: 'formatter',
 | 
			
		||||
								hidden: true,
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
 | 
			
		||||
        // console.log(this.modelData)
 | 
			
		||||
        // console.log($('#hiprint-printTemplate').empty())
 | 
			
		||||
        // if () {
 | 
			
		||||
          // console.log(this.modelData);
 | 
			
		||||
          // $('.hiprintEpContainer').empty()
 | 
			
		||||
          // hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
 | 
			
		||||
          // $('.hiprint-printTemplate').empty()
 | 
			
		||||
          // hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
          //   template: JSON.parse(this.modelData),
 | 
			
		||||
          //   settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
          //   paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
          // })
 | 
			
		||||
        // } else {
 | 
			
		||||
          $('.hiprintEpContainer').empty()
 | 
			
		||||
          console.log(this.modelData || {});
 | 
			
		||||
          hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
 | 
			
		||||
          $('.hiprint-printTemplate').empty()
 | 
			
		||||
          // const templates = this.$ls.get('KEY_TEMPLATES', {})
 | 
			
		||||
          const template = provider.value
 | 
			
		||||
        // console.log(template)
 | 
			
		||||
        if (this.modelData) {
 | 
			
		||||
          hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
            template: JSON.parse(this.modelData),
 | 
			
		||||
            settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
            paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
          })
 | 
			
		||||
        } else {
 | 
			
		||||
          hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
            template:{},
 | 
			
		||||
            settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
            paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
          })
 | 
			
		||||
          }
 | 
			
		||||
        // }
 | 
			
		||||
        hiprintTemplate.design('#hiprint-printTemplate')
 | 
			
		||||
        // console.log(hiprintTemplate)
 | 
			
		||||
        console.log(hiprintTemplate);
 | 
			
		||||
        // hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
 | 
			
		||||
        // 获取当前放大比例, 当zoom时传true 才会有
 | 
			
		||||
        this.scaleValue = hiprintTemplate.editingPanel.scale || 1
 | 
			
		||||
        // this.scaleValue = hiprintTemplate.editingPanel.scale || 1
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    /**
 | 
			
		||||
     * 设置纸张大小
 | 
			
		||||
     * @param type [A3, A4, A5, B3, B4, B5, other]
 | 
			
		||||
     * @param value {width,height} mm
 | 
			
		||||
     */
 | 
			
		||||
    setPaper(type, value) {
 | 
			
		||||
      try {
 | 
			
		||||
        if (Object.keys(this.paperTypes).includes(type)) {
 | 
			
		||||
          this.curPaper = { type: type, width: value.width, height: value.height }
 | 
			
		||||
          hiprintTemplate.setPaper(value.width, value.height)
 | 
			
		||||
        } else {
 | 
			
		||||
          this.curPaper = { type: 'other', width: value.width, height: value.height }
 | 
			
		||||
          hiprintTemplate.setPaper(value.width, value.height)
 | 
			
		||||
        }
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
        this.$message.error(`操作失败: ${error}`)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    changeScale(currentValue, oldValue) {
 | 
			
		||||
      let big = false
 | 
			
		||||
      currentValue <= oldValue ? big = false : big = true
 | 
			
		||||
      let scaleValue = this.scaleValue
 | 
			
		||||
      if (big) {
 | 
			
		||||
        scaleValue += 0.1
 | 
			
		||||
        if (scaleValue > this.scaleMax) scaleValue = 5
 | 
			
		||||
      } else {
 | 
			
		||||
        scaleValue -= 0.1
 | 
			
		||||
        if (scaleValue < this.scaleMin) scaleValue = 0.5
 | 
			
		||||
      }
 | 
			
		||||
      if (hiprintTemplate) {
 | 
			
		||||
        // scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
 | 
			
		||||
        hiprintTemplate.zoom(scaleValue)
 | 
			
		||||
        this.scaleValue = scaleValue
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    clearPaper() {
 | 
			
		||||
      MessageBox.confirm('是否确认清空模板信息?', '警告', {
 | 
			
		||||
        confirmButtonText: '确定',
 | 
			
		||||
        cancelButtonText: '取消',
 | 
			
		||||
        type: 'warning'
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        try {
 | 
			
		||||
          hiprintTemplate.clear()
 | 
			
		||||
        } catch (error) {
 | 
			
		||||
          this.$message.error(`操作失败: ${error}`)
 | 
			
		||||
        }
 | 
			
		||||
      }).catch((err) => {
 | 
			
		||||
        console.log(err)
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    otherPaper() {
 | 
			
		||||
      const value = {}
 | 
			
		||||
      value.width = this.paperWidth
 | 
			
		||||
      value.height = this.paperHeight
 | 
			
		||||
      this.paperPopVisible = false
 | 
			
		||||
      this.setPaper('other', value)
 | 
			
		||||
    },
 | 
			
		||||
    rotatePaper() {
 | 
			
		||||
      if (hiprintTemplate) {
 | 
			
		||||
        hiprintTemplate.rotatePaper()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    preView() {
 | 
			
		||||
      const { width } = this.curPaper
 | 
			
		||||
      this.$refs.preView.show(hiprintTemplate, this.printData, width)
 | 
			
		||||
    },
 | 
			
		||||
    print() {
 | 
			
		||||
      // if (window.hiwebSocket.opened) {
 | 
			
		||||
      const printerList = hiprintTemplate.getPrinterList()
 | 
			
		||||
      console.log(printerList)
 | 
			
		||||
      hiprintTemplate.print2(this.printData, { printer: '', title: '预览打印' })
 | 
			
		||||
      // return
 | 
			
		||||
      // }
 | 
			
		||||
      // this.$message.error('客户端未连接,无法直接打印')
 | 
			
		||||
    },
 | 
			
		||||
    save() {
 | 
			
		||||
      // console.log(hiprintTemplate.getJson())
 | 
			
		||||
      const { mode } = this
 | 
			
		||||
      const provider = providers[mode]
 | 
			
		||||
      // console.log(hiprintTemplate.getJson())
 | 
			
		||||
      this.setTemplate({
 | 
			
		||||
        name: provider.value,
 | 
			
		||||
        json: hiprintTemplate.getJson()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    setTemplate(payload) {
 | 
			
		||||
      // const templates = this.$ls.get('KEY_TEMPLATES', {})
 | 
			
		||||
      // console.log(payload.json)
 | 
			
		||||
      // templates[payload.name] = payload.json
 | 
			
		||||
      // this.$ls.set('KEY_TEMPLATES', templates)
 | 
			
		||||
      this.$message.info('保存成功')
 | 
			
		||||
      // console.log(JSON.stringify(payload.json))
 | 
			
		||||
      this.drawer = false
 | 
			
		||||
      this.$emit('saveData', payload.json)
 | 
			
		||||
      $('.hiprintEpContainer').empty()
 | 
			
		||||
      // this.$parent.$parent.getModelData(payload.json)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
				// console.log(this.modelData)
 | 
			
		||||
				// console.log($('#hiprint-printTemplate').empty())
 | 
			
		||||
				// if () {
 | 
			
		||||
				// console.log(this.modelData);
 | 
			
		||||
				// $('.hiprintEpContainer').empty()
 | 
			
		||||
				// hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
 | 
			
		||||
				// $('.hiprint-printTemplate').empty()
 | 
			
		||||
				// hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
				//   template: JSON.parse(this.modelData),
 | 
			
		||||
				//   settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
				//   paginationContainer: '.hiprint-printPagination'
 | 
			
		||||
				// })
 | 
			
		||||
				// } else {
 | 
			
		||||
				$('.hiprintEpContainer').empty();
 | 
			
		||||
				console.log(this.modelData || {});
 | 
			
		||||
				hiprint.PrintElementTypeManager.build(
 | 
			
		||||
					'.hiprintEpContainer',
 | 
			
		||||
					provider.value
 | 
			
		||||
				);
 | 
			
		||||
				$('.hiprint-printTemplate').empty();
 | 
			
		||||
				// const templates = this.$ls.get('KEY_TEMPLATES', {})
 | 
			
		||||
				const template = provider.value;
 | 
			
		||||
				// console.log(template)
 | 
			
		||||
				if (this.modelData) {
 | 
			
		||||
					hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
						template: JSON.parse(this.modelData),
 | 
			
		||||
						settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
						paginationContainer: '.hiprint-printPagination',
 | 
			
		||||
					});
 | 
			
		||||
				} else {
 | 
			
		||||
					hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
						template: {},
 | 
			
		||||
						settingContainer: '#PrintElementOptionSetting',
 | 
			
		||||
						paginationContainer: '.hiprint-printPagination',
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
				// }
 | 
			
		||||
				hiprintTemplate.design('#hiprint-printTemplate');
 | 
			
		||||
				// console.log(hiprintTemplate)
 | 
			
		||||
				console.log(hiprintTemplate);
 | 
			
		||||
				// hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
 | 
			
		||||
				// 获取当前放大比例, 当zoom时传true 才会有
 | 
			
		||||
				this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
 | 
			
		||||
				// this.scaleValue = hiprintTemplate.editingPanel.scale || 1
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/**
 | 
			
		||||
		 * 设置纸张大小
 | 
			
		||||
		 * @param type [A3, A4, A5, B3, B4, B5, other]
 | 
			
		||||
		 * @param value {width,height} mm
 | 
			
		||||
		 */
 | 
			
		||||
		setPaper(type, value) {
 | 
			
		||||
			try {
 | 
			
		||||
				if (Object.keys(this.paperTypes).includes(type)) {
 | 
			
		||||
					this.curPaper = {
 | 
			
		||||
						type: type,
 | 
			
		||||
						width: value.width,
 | 
			
		||||
						height: value.height,
 | 
			
		||||
					};
 | 
			
		||||
					hiprintTemplate.setPaper(value.width, value.height);
 | 
			
		||||
				} else {
 | 
			
		||||
					this.curPaper = {
 | 
			
		||||
						type: 'other',
 | 
			
		||||
						width: value.width,
 | 
			
		||||
						height: value.height,
 | 
			
		||||
					};
 | 
			
		||||
					hiprintTemplate.setPaper(value.width, value.height);
 | 
			
		||||
				}
 | 
			
		||||
			} catch (error) {
 | 
			
		||||
				this.$message.error(`操作失败: ${error}`);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		changeScale(currentValue, oldValue) {
 | 
			
		||||
			let big = false;
 | 
			
		||||
			currentValue <= oldValue ? (big = false) : (big = true);
 | 
			
		||||
			let scaleValue = this.scaleValue;
 | 
			
		||||
			if (big) {
 | 
			
		||||
				scaleValue += 0.1;
 | 
			
		||||
				if (scaleValue > this.scaleMax) scaleValue = 5;
 | 
			
		||||
			} else {
 | 
			
		||||
				scaleValue -= 0.1;
 | 
			
		||||
				if (scaleValue < this.scaleMin) scaleValue = 0.5;
 | 
			
		||||
			}
 | 
			
		||||
			if (hiprintTemplate) {
 | 
			
		||||
				// scaleValue: 放大缩小值, false: 不保存(不传也一样), 如果传 true, 打印时也会放大
 | 
			
		||||
				hiprintTemplate.zoom(scaleValue);
 | 
			
		||||
				this.scaleValue = scaleValue;
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		clearPaper() {
 | 
			
		||||
			MessageBox.confirm('是否确认清空模板信息?', '警告', {
 | 
			
		||||
				confirmButtonText: '确定',
 | 
			
		||||
				cancelButtonText: '取消',
 | 
			
		||||
				type: 'warning',
 | 
			
		||||
			})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					try {
 | 
			
		||||
						hiprintTemplate.clear();
 | 
			
		||||
					} catch (error) {
 | 
			
		||||
						this.$message.error(`操作失败: ${error}`);
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
				.catch((err) => {
 | 
			
		||||
					console.log(err);
 | 
			
		||||
				});
 | 
			
		||||
		},
 | 
			
		||||
		otherPaper() {
 | 
			
		||||
			const value = {};
 | 
			
		||||
			value.width = this.paperWidth;
 | 
			
		||||
			value.height = this.paperHeight;
 | 
			
		||||
			this.paperPopVisible = false;
 | 
			
		||||
			this.setPaper('other', value);
 | 
			
		||||
		},
 | 
			
		||||
		rotatePaper() {
 | 
			
		||||
			if (hiprintTemplate) {
 | 
			
		||||
				hiprintTemplate.rotatePaper();
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		preView() {
 | 
			
		||||
			const { width } = this.curPaper;
 | 
			
		||||
			this.$refs.preView.show(hiprintTemplate, this.printData, width);
 | 
			
		||||
		},
 | 
			
		||||
		print() {
 | 
			
		||||
			// if (window.hiwebSocket.opened) {
 | 
			
		||||
			const printerList = hiprintTemplate.getPrinterList();
 | 
			
		||||
			console.log(printerList);
 | 
			
		||||
			hiprintTemplate.print2(this.printData, {
 | 
			
		||||
				printer: '',
 | 
			
		||||
				title: '预览打印',
 | 
			
		||||
			});
 | 
			
		||||
			// return
 | 
			
		||||
			// }
 | 
			
		||||
			// this.$message.error('客户端未连接,无法直接打印')
 | 
			
		||||
		},
 | 
			
		||||
		save() {
 | 
			
		||||
			// console.log(hiprintTemplate.getJson())
 | 
			
		||||
			const { mode } = this;
 | 
			
		||||
			const provider = providers[mode];
 | 
			
		||||
			// console.log(hiprintTemplate.getJson())
 | 
			
		||||
			this.setTemplate({
 | 
			
		||||
				name: provider.value,
 | 
			
		||||
				json: hiprintTemplate.getJson(),
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		setTemplate(payload) {
 | 
			
		||||
			// const templates = this.$ls.get('KEY_TEMPLATES', {})
 | 
			
		||||
			// console.log(payload.json)
 | 
			
		||||
			// templates[payload.name] = payload.json
 | 
			
		||||
			// this.$ls.set('KEY_TEMPLATES', templates)
 | 
			
		||||
			this.$message.info('保存成功');
 | 
			
		||||
			// console.log(JSON.stringify(payload.json))
 | 
			
		||||
			this.drawer = false;
 | 
			
		||||
			this.$emit('saveData', payload.json);
 | 
			
		||||
			$('.hiprintEpContainer').empty();
 | 
			
		||||
			// this.$parent.$parent.getModelData(payload.json)
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
// build 拖拽
 | 
			
		||||
::v-deep .hiprint-printElement-type >li>ul>li>a {
 | 
			
		||||
  padding: 4px 4px;
 | 
			
		||||
  color: #1296db;
 | 
			
		||||
  line-height: 1;
 | 
			
		||||
  height: auto;
 | 
			
		||||
  text-overflow: ellipsis;
 | 
			
		||||
::v-deep .hiprint-printElement-type > li > ul > li > a {
 | 
			
		||||
	padding: 4px 4px;
 | 
			
		||||
	color: #1296db;
 | 
			
		||||
	line-height: 1;
 | 
			
		||||
	height: auto;
 | 
			
		||||
	text-overflow: ellipsis;
 | 
			
		||||
}
 | 
			
		||||
// 设计容器
 | 
			
		||||
.card-design {
 | 
			
		||||
  // overflow: hidden;
 | 
			
		||||
  overflow-x: auto;
 | 
			
		||||
  overflow-y: auto;
 | 
			
		||||
	// overflow: hidden;
 | 
			
		||||
	overflow-x: auto;
 | 
			
		||||
	overflow-y: auto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								src/views/base/packagingPrintLog2/components/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								src/views/base/packagingPrintLog2/components/InputArea.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="tableInner">
 | 
			
		||||
		<el-input
 | 
			
		||||
			v-if="list.isEdit"
 | 
			
		||||
			type="number"
 | 
			
		||||
			v-model="list[itemProp]"
 | 
			
		||||
			@blur="changeInput" />
 | 
			
		||||
		<span v-else>{{ list[itemProp] }}</span>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'InputArea',
 | 
			
		||||
	props: {
 | 
			
		||||
		injectData: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
		itemProp: {
 | 
			
		||||
			type: String,
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			list: {},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.initData();
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		injectData() {
 | 
			
		||||
			this.initData();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initData() {
 | 
			
		||||
			this.list = this.injectData;
 | 
			
		||||
		},
 | 
			
		||||
		changeInput() {
 | 
			
		||||
			this.$emit('emitData', this.list);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										226
									
								
								src/views/base/packagingPrintLog2/components/OtherMsg.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										226
									
								
								src/views/base/packagingPrintLog2/components/OtherMsg.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,226 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="other-msg-box">
 | 
			
		||||
		<el-radio-group
 | 
			
		||||
			v-model="chooseMsg"
 | 
			
		||||
			@change="changeChoose">
 | 
			
		||||
			<el-radio :label="1">
 | 
			
		||||
				<div style="display: inline-block">
 | 
			
		||||
					<el-form
 | 
			
		||||
						:inline="true"
 | 
			
		||||
						:model="printMsg1"
 | 
			
		||||
						class="demo-form-inline">
 | 
			
		||||
						<el-form-item label="客户">
 | 
			
		||||
							<el-select
 | 
			
		||||
								size="small"
 | 
			
		||||
								v-model="printMsg1.customerId"
 | 
			
		||||
								filterable
 | 
			
		||||
								placeholder="客户">
 | 
			
		||||
								<el-option
 | 
			
		||||
									v-for="item in customerList"
 | 
			
		||||
									:key="item.id"
 | 
			
		||||
									:label="item.name"
 | 
			
		||||
									:value="item.id"></el-option>
 | 
			
		||||
							</el-select>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="封箱人员工号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg1.sealWorker"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="封箱人员工号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="打包人员工号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg1.packWorker"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="打包人员工号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="流程卡号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg1.processCard"
 | 
			
		||||
								size="small"
 | 
			
		||||
								style="width: 120px"
 | 
			
		||||
								placeholder="流程卡号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="托盘规格">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg1.pallet"
 | 
			
		||||
								size="small"
 | 
			
		||||
								style="width: 120px"
 | 
			
		||||
								placeholder="托盘规格"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="备注">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg1.remark"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="备注"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-form>
 | 
			
		||||
				</div>
 | 
			
		||||
			</el-radio>
 | 
			
		||||
			<el-radio :label="2">
 | 
			
		||||
				<div style="display: inline-block">
 | 
			
		||||
					<el-form
 | 
			
		||||
						:inline="true"
 | 
			
		||||
						:model="printMsg2"
 | 
			
		||||
						class="demo-form-inline">
 | 
			
		||||
						<el-form-item label="客户">
 | 
			
		||||
							<el-select
 | 
			
		||||
								size="small"
 | 
			
		||||
								v-model="printMsg2.customerId"
 | 
			
		||||
								filterable
 | 
			
		||||
								placeholder="客户">
 | 
			
		||||
								<el-option
 | 
			
		||||
									v-for="item in customerList"
 | 
			
		||||
									:key="item.id"
 | 
			
		||||
									:label="item.name"
 | 
			
		||||
									:value="item.id"></el-option>
 | 
			
		||||
							</el-select>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="封箱人员工号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg2.sealWorker"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="封箱人员工号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="打包人员工号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg2.packWorker"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="打包人员工号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="流程卡号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg2.processCard"
 | 
			
		||||
								size="small"
 | 
			
		||||
								style="width: 120px"
 | 
			
		||||
								placeholder="流程卡号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="托盘规格">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg2.pallet"
 | 
			
		||||
								size="small"
 | 
			
		||||
								style="width: 120px"
 | 
			
		||||
								placeholder="托盘规格"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="备注">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg2.remark"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="备注"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-form>
 | 
			
		||||
				</div>
 | 
			
		||||
			</el-radio>
 | 
			
		||||
			<el-radio :label="3">
 | 
			
		||||
				<div style="display: inline-block">
 | 
			
		||||
					<el-form
 | 
			
		||||
						:inline="true"
 | 
			
		||||
						:model="printMsg3"
 | 
			
		||||
						class="demo-form-inline">
 | 
			
		||||
						<el-form-item label="客户">
 | 
			
		||||
							<el-select
 | 
			
		||||
								size="small"
 | 
			
		||||
								v-model="printMsg3.customerId"
 | 
			
		||||
								filterable
 | 
			
		||||
								placeholder="客户">
 | 
			
		||||
								<el-option
 | 
			
		||||
									v-for="item in customerList"
 | 
			
		||||
									:key="item.id"
 | 
			
		||||
									:label="item.name"
 | 
			
		||||
									:value="item.id"></el-option>
 | 
			
		||||
							</el-select>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="封箱人员工号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg3.sealWorker"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="封箱人员工号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="打包人员工号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg3.packWorker"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="打包人员工号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="流程卡号">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg3.processCard"
 | 
			
		||||
								size="small"
 | 
			
		||||
								style="width: 120px"
 | 
			
		||||
								placeholder="流程卡号"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="托盘规格">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg3.pallet"
 | 
			
		||||
								size="small"
 | 
			
		||||
								style="width: 120px"
 | 
			
		||||
								placeholder="托盘规格"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
						<el-form-item label="备注">
 | 
			
		||||
							<el-input
 | 
			
		||||
								v-model="printMsg3.remark"
 | 
			
		||||
								size="small"
 | 
			
		||||
								placeholder="备注"></el-input>
 | 
			
		||||
						</el-form-item>
 | 
			
		||||
					</el-form>
 | 
			
		||||
				</div>
 | 
			
		||||
			</el-radio>
 | 
			
		||||
		</el-radio-group>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getCustomerList } from '@/api/base/packingInfo';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'OtherMsg',
 | 
			
		||||
	props: {
 | 
			
		||||
		printMsg1: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
		printMsg2: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
		printMsg3: {
 | 
			
		||||
			type: Object,
 | 
			
		||||
			default: () => ({}),
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			chooseMsg: 1,
 | 
			
		||||
			customerList: [],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getCList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getCList() {
 | 
			
		||||
			getCustomerList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				console.log('customer');
 | 
			
		||||
				this.customerList = res.data;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		changeChoose(val) {
 | 
			
		||||
			this.$emit('changeChoose', val);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.other-msg-box {
 | 
			
		||||
	.el-radio {
 | 
			
		||||
		display: block;
 | 
			
		||||
		line-height: 36px;
 | 
			
		||||
		.demo-form-inline {
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			white-space: normal;
 | 
			
		||||
		}
 | 
			
		||||
		.el-form-item {
 | 
			
		||||
			margin-bottom: 0px;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										182
									
								
								src/views/base/packagingPrintLog2/components/Printed.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								src/views/base/packagingPrintLog2/components/Printed.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="show-box">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick2" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams2.pageNo"
 | 
			
		||||
			:limit="queryParams2.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list2">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn2.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="240"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn2"
 | 
			
		||||
				@clickBtn="handleClick2" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams2.pageNo"
 | 
			
		||||
			:limit.sync="queryParams2.pageSize"
 | 
			
		||||
			:total="total2"
 | 
			
		||||
			@pagination="getList2" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import { getPackingPage } from '@/api/base/packingInfo';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'packagingCode',
 | 
			
		||||
		label: '成品周转编号',
 | 
			
		||||
		minWidth: 180,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'lineId',
 | 
			
		||||
		label: '产线',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'specifications',
 | 
			
		||||
		label: '规格',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'check',
 | 
			
		||||
		label: '判定',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workStation',
 | 
			
		||||
		label: '工位号',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '片数',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注1',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'printStatus',
 | 
			
		||||
		label: '打印状态',
 | 
			
		||||
		filter: (val) => (val == 1 ? '未打印' : '已打印'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'groupClass',
 | 
			
		||||
		label: '班次',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'Printed',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'lineId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams2: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				printStatus: '2',
 | 
			
		||||
				lineId: '',
 | 
			
		||||
				createTime: [],
 | 
			
		||||
			},
 | 
			
		||||
			total2: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list2: [],
 | 
			
		||||
			tableBtn2: [
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'reprint',
 | 
			
		||||
							btnName: '重打',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:query')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermiAnd([
 | 
			
		||||
					'base:order-group:update',
 | 
			
		||||
					'base:core-product:query',
 | 
			
		||||
					'base:core-customer:query',
 | 
			
		||||
				])
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getLineList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getLineList() {
 | 
			
		||||
			getCorePLList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getList2() {
 | 
			
		||||
			getPackingPage({ ...this.queryParams2 }).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.list2 = res.data.records || [];
 | 
			
		||||
				this.total2 = res.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick2(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			this.queryParams2.lineId = val.lineId;
 | 
			
		||||
			this.queryParams2.createTime = val.timeVal;
 | 
			
		||||
			this.getList2();
 | 
			
		||||
		},
 | 
			
		||||
		handleClick2() {},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										332
									
								
								src/views/base/packagingPrintLog2/components/UnPrint.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										332
									
								
								src/views/base/packagingPrintLog2/components/UnPrint.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,332 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="show-box">
 | 
			
		||||
		<!-- 单选 -->
 | 
			
		||||
		<other-msg
 | 
			
		||||
			:printMsg1="printMsg1"
 | 
			
		||||
			:printMsg2="printMsg2"
 | 
			
		||||
			:printMsg3="printMsg3"
 | 
			
		||||
			@changeChoose="changeChoose" />
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="inputChange">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="260"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 预览 -->
 | 
			
		||||
		<print-preview ref="preView" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import inputArea from './InputArea.vue';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'packagingCode',
 | 
			
		||||
		label: '成品周转编号',
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'lineId',
 | 
			
		||||
		label: '产线',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'specifications',
 | 
			
		||||
		label: '规格',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'check',
 | 
			
		||||
		label: '判定',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workStation',
 | 
			
		||||
		label: '工位号',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '片数',
 | 
			
		||||
		subcomponent: inputArea,
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注1',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'printStatus',
 | 
			
		||||
		label: '打印状态',
 | 
			
		||||
		filter: (val) => (val == 1 ? '未打印' : '已打印'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'groupClass',
 | 
			
		||||
		label: '班次',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
import OtherMsg from './OtherMsg';
 | 
			
		||||
import { getPackingPage, updatePacking } from '@/api/base/packingInfo';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
import printPreview from './preview';
 | 
			
		||||
import printTemplate from '../print-template';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'UnPrint',
 | 
			
		||||
	components: { OtherMsg, printPreview },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			printMsg1: {
 | 
			
		||||
				customerId: '',
 | 
			
		||||
				sealWorker: '',
 | 
			
		||||
				packWorker: '',
 | 
			
		||||
				processCard: '',
 | 
			
		||||
				pallet: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
			},
 | 
			
		||||
			printMsg2: {
 | 
			
		||||
				customerId: '',
 | 
			
		||||
				sealWorker: '',
 | 
			
		||||
				packWorker: '',
 | 
			
		||||
				processCard: '',
 | 
			
		||||
				pallet: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
			},
 | 
			
		||||
			printMsg3: {
 | 
			
		||||
				customerId: '',
 | 
			
		||||
				sealWorker: '',
 | 
			
		||||
				packWorker: '',
 | 
			
		||||
				processCard: '',
 | 
			
		||||
				pallet: '',
 | 
			
		||||
				remark: '',
 | 
			
		||||
			},
 | 
			
		||||
			chooseMsg: 1, //单选
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'lineId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				printStatus: '1',
 | 
			
		||||
				lineId: '',
 | 
			
		||||
				createTime: [],
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermiAnd([
 | 
			
		||||
					'base:order:query',
 | 
			
		||||
					'base:order-con-group-order:create',
 | 
			
		||||
				])
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'view',
 | 
			
		||||
							btnName: '预览',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'print',
 | 
			
		||||
							btnName: '打印',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'printed',
 | 
			
		||||
							btnName: '已打印',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermiAnd([
 | 
			
		||||
					'base:order-group:update',
 | 
			
		||||
					'base:core-product:query',
 | 
			
		||||
					'base:core-customer:query',
 | 
			
		||||
				])
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'unequal',
 | 
			
		||||
										name: 'isEdit',
 | 
			
		||||
										value: true,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermiAnd([
 | 
			
		||||
					'base:order-group:update',
 | 
			
		||||
					'base:core-product:query',
 | 
			
		||||
					'base:core-customer:query',
 | 
			
		||||
				])
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'save',
 | 
			
		||||
							btnName: '保存',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'equal',
 | 
			
		||||
										name: 'isEdit',
 | 
			
		||||
										value: true,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:query')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			printData: {},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getLineList();
 | 
			
		||||
		console.log(printTemplate);
 | 
			
		||||
		console.log('================printTemplate');
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getLineList() {
 | 
			
		||||
			getCorePLList().then((res) => {
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			getPackingPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.records || [];
 | 
			
		||||
				this.total = res.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 单选
 | 
			
		||||
		changeChoose(val) {
 | 
			
		||||
			this.chooseMsg = val;
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			this.queryParams.lineId = val.lineId;
 | 
			
		||||
			this.queryParams.createTime = val.timeVal;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.editNum(val.data);
 | 
			
		||||
					break;
 | 
			
		||||
				case 'save':
 | 
			
		||||
					this.saveNum(val.data);
 | 
			
		||||
					break;
 | 
			
		||||
				case 'view':
 | 
			
		||||
					this.preView();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'print':
 | 
			
		||||
					this.printTemp();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 编辑
 | 
			
		||||
		editNum(val) {
 | 
			
		||||
			let obj = this.list[val._pageIndex - 1];
 | 
			
		||||
			obj.isEdit = true;
 | 
			
		||||
			this.$set(this.list, val._pageIndex - 1, obj);
 | 
			
		||||
		},
 | 
			
		||||
		// 保存
 | 
			
		||||
		saveNum(val) {
 | 
			
		||||
			// 调用修改接口
 | 
			
		||||
			updatePacking({ id: val.id, num: val.num }).then(() => {
 | 
			
		||||
				this.getList();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 输入框改变num
 | 
			
		||||
		inputChange(val) {
 | 
			
		||||
			this.list[val._pageIndex - 1][val.prop] = val[val.prop];
 | 
			
		||||
		},
 | 
			
		||||
		// 预览
 | 
			
		||||
		preView() {
 | 
			
		||||
			var hiprintTemplate = new hiprint.PrintTemplate({
 | 
			
		||||
				template: printTemplate,
 | 
			
		||||
			});
 | 
			
		||||
			this.$refs.preView.show(hiprintTemplate);
 | 
			
		||||
		},
 | 
			
		||||
		// 打印
 | 
			
		||||
		printTemp() {
 | 
			
		||||
			console.log('11');
 | 
			
		||||
			var printData = {};
 | 
			
		||||
			let hiprintTemplate = this.$print(
 | 
			
		||||
				undefined,
 | 
			
		||||
				printTemplate,
 | 
			
		||||
				printData,
 | 
			
		||||
				{},
 | 
			
		||||
				{
 | 
			
		||||
					styleHandler: () => {
 | 
			
		||||
						let css =
 | 
			
		||||
							'<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">';
 | 
			
		||||
						return css;
 | 
			
		||||
					},
 | 
			
		||||
				}
 | 
			
		||||
			);
 | 
			
		||||
			console.log(hiprintTemplate);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										69
									
								
								src/views/base/packagingPrintLog2/components/UnPrintEdit.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								src/views/base/packagingPrintLog2/components/UnPrintEdit.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,69 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<el-form
 | 
			
		||||
		ref="unPrintEdit"
 | 
			
		||||
		:rules="rules"
 | 
			
		||||
		label-width="130px"
 | 
			
		||||
		:model="form">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="24">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="成品周转编号"
 | 
			
		||||
					prop="packagingCode">
 | 
			
		||||
					<el-input
 | 
			
		||||
						readonly
 | 
			
		||||
						v-model="form.packagingCode"></el-input>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="24">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="片数"
 | 
			
		||||
					prop="num">
 | 
			
		||||
					<el-input-number
 | 
			
		||||
						v-model="form.num"
 | 
			
		||||
						:min="0"
 | 
			
		||||
						:max="999999"
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						label="片数"></el-input-number>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getPacking } from '@/api/base/packingInfo';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'UnPrintEdit',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			form: {
 | 
			
		||||
				id: '',
 | 
			
		||||
				packagingCode: '',
 | 
			
		||||
				num: null,
 | 
			
		||||
			},
 | 
			
		||||
			rules: {
 | 
			
		||||
				num: [{ required: true, message: '片数不能为空', trigger: 'blur' }],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		init(id) {
 | 
			
		||||
			console.log('init');
 | 
			
		||||
			this.form.id = id;
 | 
			
		||||
			getPacking(id).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		submitForm() {
 | 
			
		||||
			this.$refs['unPrintEdit'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					console.log('保存');
 | 
			
		||||
					this.$emit('successSubmit');
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		formClear() {
 | 
			
		||||
			this.$refs.unPrintEdit.resetFields();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										100
									
								
								src/views/base/packagingPrintLog2/components/preview.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								src/views/base/packagingPrintLog2/components/preview.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<base-dialog
 | 
			
		||||
		dialogTitle="预览"
 | 
			
		||||
		:dialogVisible="visible"
 | 
			
		||||
		width="50%"
 | 
			
		||||
		@cancel="hideModal"
 | 
			
		||||
		:before-close="hideModal">
 | 
			
		||||
		<!-- <div>
 | 
			
		||||
			<el-button
 | 
			
		||||
				:loading="waitShowPrinter"
 | 
			
		||||
				type="primary"
 | 
			
		||||
				icon="printer"
 | 
			
		||||
				@click.stop="print">
 | 
			
		||||
				打印
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<el-button
 | 
			
		||||
				type="primary"
 | 
			
		||||
				icon="printer"
 | 
			
		||||
				@click.stop="toPdf">
 | 
			
		||||
				pdf
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</div> -->
 | 
			
		||||
		<div id="preview_content" />
 | 
			
		||||
		<template slot="footer">
 | 
			
		||||
			<el-button
 | 
			
		||||
				key="close"
 | 
			
		||||
				@click="hideModal">
 | 
			
		||||
				关闭
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</template>
 | 
			
		||||
	</base-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'PrintPreview',
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			visible: false,
 | 
			
		||||
			spinning: true,
 | 
			
		||||
			waitShowPrinter: false,
 | 
			
		||||
			// 纸张宽 mm
 | 
			
		||||
			width: 0,
 | 
			
		||||
			// 模板
 | 
			
		||||
			hiprintTemplate: {},
 | 
			
		||||
			// 数据
 | 
			
		||||
			printData: {},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {},
 | 
			
		||||
	watch: {},
 | 
			
		||||
	created() {},
 | 
			
		||||
	mounted() {},
 | 
			
		||||
	methods: {
 | 
			
		||||
		hideModal() {
 | 
			
		||||
			this.visible = false;
 | 
			
		||||
		},
 | 
			
		||||
		show(hiprintTemplate, printData, width = '210') {
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
			this.spinning = true;
 | 
			
		||||
			this.width = width;
 | 
			
		||||
			this.hiprintTemplate = hiprintTemplate;
 | 
			
		||||
			this.printData = printData;
 | 
			
		||||
			console.log(hiprintTemplate);
 | 
			
		||||
			console.log(printData);
 | 
			
		||||
			setTimeout(() => {
 | 
			
		||||
				// eslint-disable-next-line no-undef
 | 
			
		||||
				$('#preview_content').html(hiprintTemplate.getHtml(printData));
 | 
			
		||||
				this.spinning = false;
 | 
			
		||||
			}, 500);
 | 
			
		||||
		},
 | 
			
		||||
		print() {
 | 
			
		||||
			this.waitShowPrinter = true;
 | 
			
		||||
			this.hiprintTemplate.print(
 | 
			
		||||
				this.printData,
 | 
			
		||||
				{},
 | 
			
		||||
				{
 | 
			
		||||
					callback: () => {
 | 
			
		||||
						console.log('callback');
 | 
			
		||||
						this.waitShowPrinter = false;
 | 
			
		||||
					},
 | 
			
		||||
				}
 | 
			
		||||
			);
 | 
			
		||||
		},
 | 
			
		||||
		toPdf() {
 | 
			
		||||
			this.hiprintTemplate.toPdf({}, '打印预览');
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<!-- <style lang="less" scoped>
 | 
			
		||||
/deep/ .ant-modal-body {
 | 
			
		||||
  padding: 0px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/deep/ .ant-modal-content {
 | 
			
		||||
  margin-bottom: 24px;
 | 
			
		||||
}
 | 
			
		||||
</style> -->
 | 
			
		||||
							
								
								
									
										47
									
								
								src/views/base/packagingPrintLog2/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/views/base/packagingPrintLog2/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="packagingPrintLog-box">
 | 
			
		||||
		<div style="width: 100%">
 | 
			
		||||
			<ButtonNav
 | 
			
		||||
				:menus="['未打印', '已打印']"
 | 
			
		||||
				:button-mode="true"
 | 
			
		||||
				@change="currentMenu"></ButtonNav>
 | 
			
		||||
		</div>
 | 
			
		||||
		<!-- 未打印 -->
 | 
			
		||||
		<UnPrint v-if="activeMenu == '未打印'" />
 | 
			
		||||
		<!-- 已打印 -->
 | 
			
		||||
		<Printed v-else />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import ButtonNav from '@/components/ButtonNav';
 | 
			
		||||
import UnPrint from './components/UnPrint';
 | 
			
		||||
import Printed from './components/Printed';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'packagingPrintLog',
 | 
			
		||||
	components: { ButtonNav, UnPrint, Printed },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			activeMenu: '未打印',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		currentMenu(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			this.activeMenu = val;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.packagingPrintLog-box {
 | 
			
		||||
	min-height: calc(100vh - 120px - 8px);
 | 
			
		||||
	background-color: #f2f4f9;
 | 
			
		||||
	.show-box {
 | 
			
		||||
		min-height: calc(100vh - 128px - 52px);
 | 
			
		||||
		margin-top: 8px;
 | 
			
		||||
		padding: 16px;
 | 
			
		||||
		border-radius: 8px;
 | 
			
		||||
		background-color: #fff;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										554
									
								
								src/views/base/packagingPrintLog2/print-template.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										554
									
								
								src/views/base/packagingPrintLog2/print-template.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,554 @@
 | 
			
		||||
export default {
 | 
			
		||||
    panels: [
 | 
			
		||||
      {
 | 
			
		||||
        index: 0,
 | 
			
		||||
        name: 1,
 | 
			
		||||
        height: 125,
 | 
			
		||||
        width: 95,
 | 
			
		||||
        paperHeader: 0,
 | 
			
		||||
        paperFooter: 354.33070866141736,
 | 
			
		||||
        printElements: [
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 5,
 | 
			
		||||
              height: 30,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 262.2421875,
 | 
			
		||||
              bottom: 34.9921875,
 | 
			
		||||
              vCenter: 133.9921875,
 | 
			
		||||
              hCenter: 19.9921875,
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              borderColor: 'green',
 | 
			
		||||
              backgroundColor: 'green',
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '矩形', type: 'rect' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 35,
 | 
			
		||||
              top: 15,
 | 
			
		||||
              height: 20,
 | 
			
		||||
              width: 195,
 | 
			
		||||
              title: '厂内镀膜/钢化片周转标签',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 16.5,
 | 
			
		||||
              color: '#ffffff',
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 232.9921875,
 | 
			
		||||
              bottom: 35.24609375,
 | 
			
		||||
              vCenter: 135.4921875,
 | 
			
		||||
              hCenter: 25.24609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: { left: 50, top: 35, height: 52.5, width: 9 },
 | 
			
		||||
            printElementType: { title: '竖线', type: 'vline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 35,
 | 
			
		||||
              height: 309,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 261.4921875,
 | 
			
		||||
              bottom: 343.9921875,
 | 
			
		||||
              vCenter: 133.2421875,
 | 
			
		||||
              hCenter: 189.4921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '矩形', type: 'rect' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 10,
 | 
			
		||||
              top: 42.5,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '线别',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 45.99609375,
 | 
			
		||||
              bottom: 60.4921875,
 | 
			
		||||
              vCenter: 27.99609375,
 | 
			
		||||
              hCenter: 51.4921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 55,
 | 
			
		||||
              top: 42.5,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 200,
 | 
			
		||||
              title: '判定:良品/保留/再检',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 93.4921875,
 | 
			
		||||
              bottom: 59.25,
 | 
			
		||||
              vCenter: 75.4921875,
 | 
			
		||||
              hCenter: 50.25,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 62.5,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 259.9921875,
 | 
			
		||||
              bottom: 72.4921875,
 | 
			
		||||
              vCenter: 132.4921875,
 | 
			
		||||
              hCenter: 67.9921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 55,
 | 
			
		||||
              top: 70,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 46,
 | 
			
		||||
              title: '备注:',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 91.2421875,
 | 
			
		||||
              bottom: 86.25,
 | 
			
		||||
              vCenter: 73.2421875,
 | 
			
		||||
              hCenter: 77.25,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 190,
 | 
			
		||||
              top: 87.5,
 | 
			
		||||
              height: 169.5,
 | 
			
		||||
              width: 9,
 | 
			
		||||
              right: 199.74609375,
 | 
			
		||||
              bottom: 255.75,
 | 
			
		||||
              vCenter: 195.24609375,
 | 
			
		||||
              hCenter: 171,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '竖线', type: 'vline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 87.5,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 260.7421875,
 | 
			
		||||
              bottom: 96.75,
 | 
			
		||||
              vCenter: 132.4921875,
 | 
			
		||||
              hCenter: 92.25,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 77.5,
 | 
			
		||||
              top: 90,
 | 
			
		||||
              height: 15,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '规格',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 113.49609375,
 | 
			
		||||
              bottom: 105.4921875,
 | 
			
		||||
              vCenter: 95.49609375,
 | 
			
		||||
              hCenter: 97.9921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 207.5,
 | 
			
		||||
              top: 100,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '用户',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 242.7421875,
 | 
			
		||||
              bottom: 116.25,
 | 
			
		||||
              vCenter: 224.7421875,
 | 
			
		||||
              hCenter: 107.25,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 25,
 | 
			
		||||
              top: 102.5,
 | 
			
		||||
              height: 15,
 | 
			
		||||
              width: 156,
 | 
			
		||||
              title: '长*宽*厚度(单位:mm)',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 179.25,
 | 
			
		||||
              bottom: 117.4921875,
 | 
			
		||||
              vCenter: 101.25,
 | 
			
		||||
              hCenter: 109.9921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 117.5,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 263.7421875,
 | 
			
		||||
              bottom: 125.7421875,
 | 
			
		||||
              vCenter: 135.4921875,
 | 
			
		||||
              hCenter: 121.2421875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 130,
 | 
			
		||||
              top: 145,
 | 
			
		||||
              height: 55.5,
 | 
			
		||||
              width: 9,
 | 
			
		||||
              right: 138.99609375,
 | 
			
		||||
              bottom: 199.5,
 | 
			
		||||
              vCenter: 134.49609375,
 | 
			
		||||
              hCenter: 171.75,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '竖线', type: 'vline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 145,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 260.25,
 | 
			
		||||
              bottom: 154.2421875,
 | 
			
		||||
              vCenter: 132,
 | 
			
		||||
              hCenter: 149.7421875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 45,
 | 
			
		||||
              top: 155,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '编号',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 82.2421875,
 | 
			
		||||
              bottom: 171.75,
 | 
			
		||||
              vCenter: 64.2421875,
 | 
			
		||||
              hCenter: 162.75,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 135,
 | 
			
		||||
              top: 155,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 49.5,
 | 
			
		||||
              title: '工位号',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 186,
 | 
			
		||||
              bottom: 172.9921875,
 | 
			
		||||
              vCenter: 161.25,
 | 
			
		||||
              hCenter: 163.9921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 197.5,
 | 
			
		||||
              top: 155,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 60,
 | 
			
		||||
              title: '流程卡号',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 256.74609375,
 | 
			
		||||
              bottom: 143.7421875,
 | 
			
		||||
              vCenter: 226.74609375,
 | 
			
		||||
              hCenter: 134.7421875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 175,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 259.2421875,
 | 
			
		||||
              bottom: 183.75,
 | 
			
		||||
              vCenter: 130.9921875,
 | 
			
		||||
              hCenter: 179.25,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 50,
 | 
			
		||||
              top: 200,
 | 
			
		||||
              height: 58.5,
 | 
			
		||||
              width: 9,
 | 
			
		||||
              right: 58.9921875,
 | 
			
		||||
              bottom: 259.5,
 | 
			
		||||
              vCenter: 54.4921875,
 | 
			
		||||
              hCenter: 230.25,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '竖线', type: 'vline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 110,
 | 
			
		||||
              top: 200,
 | 
			
		||||
              height: 58.5,
 | 
			
		||||
              width: 9,
 | 
			
		||||
              right: 117.75,
 | 
			
		||||
              bottom: 256.9921875,
 | 
			
		||||
              vCenter: 113.25,
 | 
			
		||||
              hCenter: 227.7421875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '竖线', type: 'vline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 200,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 262.9921875,
 | 
			
		||||
              bottom: 210.24609375,
 | 
			
		||||
              vCenter: 134.7421875,
 | 
			
		||||
              hCenter: 205.74609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 10,
 | 
			
		||||
              top: 210,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '日期',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 45.99609375,
 | 
			
		||||
              bottom: 228,
 | 
			
		||||
              vCenter: 27.99609375,
 | 
			
		||||
              hCenter: 219,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 67.5,
 | 
			
		||||
              top: 210,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '班次',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 103.5,
 | 
			
		||||
              bottom: 228,
 | 
			
		||||
              vCenter: 85.5,
 | 
			
		||||
              hCenter: 219,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 207.5,
 | 
			
		||||
              top: 210,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 36,
 | 
			
		||||
              title: '片数',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 243.4921875,
 | 
			
		||||
              bottom: 228,
 | 
			
		||||
              vCenter: 225.4921875,
 | 
			
		||||
              hCenter: 219,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 230,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 261.4921875,
 | 
			
		||||
              bottom: 239.25,
 | 
			
		||||
              vCenter: 133.2421875,
 | 
			
		||||
              hCenter: 234.75,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 257.5,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 261.4921875,
 | 
			
		||||
              bottom: 266.49609375,
 | 
			
		||||
              vCenter: 133.2421875,
 | 
			
		||||
              hCenter: 261.99609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 10,
 | 
			
		||||
              top: 262.5,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 87,
 | 
			
		||||
              title: '封箱人员工号:',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 46.9921875,
 | 
			
		||||
              bottom: 279.24609375,
 | 
			
		||||
              vCenter: 28.9921875,
 | 
			
		||||
              hCenter: 270.24609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 280,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 262.2421875,
 | 
			
		||||
              bottom: 289.2421875,
 | 
			
		||||
              vCenter: 133.9921875,
 | 
			
		||||
              hCenter: 284.7421875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 10,
 | 
			
		||||
              top: 285,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 87,
 | 
			
		||||
              title: '打包人员工号:',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 96.4921875,
 | 
			
		||||
              bottom: 301.74609375,
 | 
			
		||||
              vCenter: 52.9921875,
 | 
			
		||||
              hCenter: 292.74609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 300,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 264.4921875,
 | 
			
		||||
              bottom: 308.49609375,
 | 
			
		||||
              vCenter: 136.2421875,
 | 
			
		||||
              hCenter: 303.99609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 10,
 | 
			
		||||
              top: 305,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 247.5,
 | 
			
		||||
              title: '备注1:单层镀/双层镀/丝印打孔/打孔钢片',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 96.99609375,
 | 
			
		||||
              bottom: 322.9921875,
 | 
			
		||||
              vCenter: 53.49609375,
 | 
			
		||||
              hCenter: 313.9921875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 5,
 | 
			
		||||
              top: 322.5,
 | 
			
		||||
              height: 9,
 | 
			
		||||
              width: 256.5,
 | 
			
		||||
              right: 262.2421875,
 | 
			
		||||
              bottom: 332.7421875,
 | 
			
		||||
              vCenter: 133.9921875,
 | 
			
		||||
              hCenter: 328.2421875,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '横线', type: 'hline' },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            options: {
 | 
			
		||||
              left: 10,
 | 
			
		||||
              top: 327.5,
 | 
			
		||||
              height: 18,
 | 
			
		||||
              width: 87,
 | 
			
		||||
              title: '备注2:',
 | 
			
		||||
              coordinateSync: false,
 | 
			
		||||
              widthHeightSync: false,
 | 
			
		||||
              fontSize: 12,
 | 
			
		||||
              qrCodeLevel: 0,
 | 
			
		||||
              right: 97.9921875,
 | 
			
		||||
              bottom: 343.74609375,
 | 
			
		||||
              vCenter: 54.4921875,
 | 
			
		||||
              hCenter: 334.74609375,
 | 
			
		||||
            },
 | 
			
		||||
            printElementType: { title: '文本', type: 'text' },
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
        paperNumberLeft: 372.5,
 | 
			
		||||
        paperNumberTop: 337.5,
 | 
			
		||||
        paperNumberContinue: true,
 | 
			
		||||
        watermarkOptions: {},
 | 
			
		||||
      },
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
@@ -6,138 +6,130 @@
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%" show-close="true">
 | 
			
		||||
    <small-title slot="title" :no-padding="true">
 | 
			
		||||
      {{ !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		class="baseDialog"
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="true"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		width="50%">
 | 
			
		||||
		<small-title
 | 
			
		||||
			slot="title"
 | 
			
		||||
			:no-padding="true">
 | 
			
		||||
			{{ !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
 | 
			
		||||
    <div class="content">
 | 
			
		||||
      <div class="visual-part">
 | 
			
		||||
        <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
 | 
			
		||||
          @keyup.enter.native="dataFormSubmit">
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <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="typeId">
 | 
			
		||||
                <el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择标签类型" clearable>
 | 
			
		||||
                  <el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
                </el-select>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
              <el-form-item label="打印方式" prop="printModel">
 | 
			
		||||
                <el-select v-model="dataForm.printModel" style="width: 100%;" placeholder="请选择打印方式" clearable>
 | 
			
		||||
                  <el-option v-for="dict in printModelList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
                </el-select>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
              <el-form-item label="标签备注" prop="remark">
 | 
			
		||||
                <el-input v-model="dataForm.remark" clearable placeholder="请输入标签备注" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="12">
 | 
			
		||||
              <el-form-item label="模板设计" prop="content">
 | 
			
		||||
                <el-button  icon="el-icon-edit" @click="btnClickDesign()">模板设计</el-button>
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
            <!-- <el-col :span="12">
 | 
			
		||||
              <el-form-item label="单位平方数" prop="area">
 | 
			
		||||
                <el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col> -->
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <!-- <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="24">
 | 
			
		||||
              <el-form-item label="完成单位产品用时" prop="processTime">
 | 
			
		||||
                <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row> -->
 | 
			
		||||
        </el-form>
 | 
			
		||||
 | 
			
		||||
        <!-- <small-title
 | 
			
		||||
					style="margin: 16px 0; padding-left: 8px"
 | 
			
		||||
					:no-padding="true">
 | 
			
		||||
					产品属性列表
 | 
			
		||||
				</small-title>
 | 
			
		||||
 | 
			
		||||
				<div class="attr-list">
 | 
			
		||||
					<base-table
 | 
			
		||||
						:table-props="tableProps"
 | 
			
		||||
						:page="listQuery.pageNo"
 | 
			
		||||
						:limit="listQuery.pageSize"
 | 
			
		||||
						:add-button-show="isdetail ? null : '添加属性'"
 | 
			
		||||
						@emitButtonClick="addNew()"
 | 
			
		||||
						:table-data="productAttributeList">
 | 
			
		||||
						<method-btn
 | 
			
		||||
							v-if="!isdetail"
 | 
			
		||||
							slot="handleBtn"
 | 
			
		||||
							:width="120"
 | 
			
		||||
							label="操作"
 | 
			
		||||
							:method-list="tableBtn"
 | 
			
		||||
							@clickBtn="handleClick" />
 | 
			
		||||
					</base-table>
 | 
			
		||||
					<pagination
 | 
			
		||||
						v-show="listQuery.total > 0"
 | 
			
		||||
						:total="listQuery.total"
 | 
			
		||||
						:page.sync="listQuery.pageNo"
 | 
			
		||||
						:limit.sync="listQuery.pageSize"
 | 
			
		||||
						:page-sizes="[5, 10, 15]"
 | 
			
		||||
						@pagination="getList" />
 | 
			
		||||
				</div> -->
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- <div style="position: absolute; bottom: 24px; right: 24px">
 | 
			
		||||
			<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
 | 
			
		||||
			<el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<div class="visual-part">
 | 
			
		||||
				<el-form
 | 
			
		||||
					ref="dataForm"
 | 
			
		||||
					:model="dataForm"
 | 
			
		||||
					:rules="dataRule"
 | 
			
		||||
					label-width="100px"
 | 
			
		||||
					@keyup.enter.native="dataFormSubmit">
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="模板名称"
 | 
			
		||||
								prop="name">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.name"
 | 
			
		||||
									clearable
 | 
			
		||||
									placeholder="请输入模板名称" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="标签类型"
 | 
			
		||||
								prop="typeId">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.typeId"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择标签类型"
 | 
			
		||||
									clearable>
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in typeList"
 | 
			
		||||
										:key="dict.id"
 | 
			
		||||
										:label="dict.name"
 | 
			
		||||
										:value="dict.id" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="打印方式"
 | 
			
		||||
								prop="printModel">
 | 
			
		||||
								<el-select
 | 
			
		||||
									v-model="dataForm.printModel"
 | 
			
		||||
									style="width: 100%"
 | 
			
		||||
									placeholder="请选择打印方式"
 | 
			
		||||
									clearable>
 | 
			
		||||
									<el-option
 | 
			
		||||
										v-for="dict in printModelList"
 | 
			
		||||
										:key="dict.id"
 | 
			
		||||
										:label="dict.name"
 | 
			
		||||
										:value="dict.id" />
 | 
			
		||||
								</el-select>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="标签备注"
 | 
			
		||||
								prop="remark">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.remark"
 | 
			
		||||
									clearable
 | 
			
		||||
									placeholder="请输入标签备注" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="模板设计"
 | 
			
		||||
								prop="content">
 | 
			
		||||
								<el-button
 | 
			
		||||
									icon="el-icon-edit"
 | 
			
		||||
									@click="btnClickDesign()">
 | 
			
		||||
									模板设计
 | 
			
		||||
								</el-button>
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
				</el-form>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<template slot="footer">
 | 
			
		||||
			<el-button
 | 
			
		||||
				style=""
 | 
			
		||||
				@click="goback()">
 | 
			
		||||
				取消
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<span v-if="!isdetail">
 | 
			
		||||
				<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
 | 
			
		||||
				<el-button
 | 
			
		||||
					v-if="dataForm.id && !isdetail"
 | 
			
		||||
					type="primary"
 | 
			
		||||
					@click="addNew()">
 | 
			
		||||
					添加属性
 | 
			
		||||
				</el-button>
 | 
			
		||||
			</span>
 | 
			
		||||
		</div> -->
 | 
			
		||||
    <template slot="footer">
 | 
			
		||||
      <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
      <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
			</el-button> -->
 | 
			
		||||
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
    </template>
 | 
			
		||||
    <print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" />
 | 
			
		||||
  </el-dialog>
 | 
			
		||||
			<el-button
 | 
			
		||||
				type="primary"
 | 
			
		||||
				@click="dataFormSubmit()">
 | 
			
		||||
				确定
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</template>
 | 
			
		||||
		<print-model-design
 | 
			
		||||
			v-if="modelShow"
 | 
			
		||||
			ref="printModelDesign"
 | 
			
		||||
			@saveData="getModelData" />
 | 
			
		||||
	</el-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
import {
 | 
			
		||||
  createPackingModel,
 | 
			
		||||
  updatePackingModel,
 | 
			
		||||
  getPackingModel,
 | 
			
		||||
  // getWorkOrderList,
 | 
			
		||||
  // getCode,
 | 
			
		||||
  // getCustomerList,
 | 
			
		||||
  getTypeList
 | 
			
		||||
	createPackingModel,
 | 
			
		||||
	updatePackingModel,
 | 
			
		||||
	getPackingModel,
 | 
			
		||||
	getTypeList,
 | 
			
		||||
} from '@/api/base/printModel.js';
 | 
			
		||||
// import productAttrAdd from './attr-add';
 | 
			
		||||
import { parseTime } from '../mixins/code-filter';
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
import printModelDesign from '../custom/index'
 | 
			
		||||
import printModelDesign from '../custom/index';
 | 
			
		||||
 | 
			
		||||
const tableBtn = [
 | 
			
		||||
	{
 | 
			
		||||
@@ -166,42 +158,42 @@ const tableProps = [
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  components: { SmallTitle, printModelDesign },
 | 
			
		||||
	components: { SmallTitle, printModelDesign },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			visible: false,
 | 
			
		||||
			addOrUpdateVisible: false,
 | 
			
		||||
			tableBtn,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      modelShow:false,
 | 
			
		||||
      typeList:[],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			modelShow: false,
 | 
			
		||||
			typeList: [],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				// name: '', // 产品名称
 | 
			
		||||
        name: '', // 产品编码
 | 
			
		||||
				name: '', // 产品编码
 | 
			
		||||
				// area: 0, // 单位平方数(float only)
 | 
			
		||||
        typeId: null, // 产品类型id
 | 
			
		||||
        printModel: null, // 单位产品用时 (s)
 | 
			
		||||
        content: '', // 规格
 | 
			
		||||
        remark: '', // 单位id
 | 
			
		||||
      },
 | 
			
		||||
      printModelList: [
 | 
			
		||||
        {
 | 
			
		||||
          id: 1,
 | 
			
		||||
          name:'自动'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          id: 2,
 | 
			
		||||
          name: '手动'
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
				typeId: null, // 产品类型id
 | 
			
		||||
				printModel: null, // 单位产品用时 (s)
 | 
			
		||||
				content: '', // 规格
 | 
			
		||||
				remark: '', // 单位id
 | 
			
		||||
			},
 | 
			
		||||
			printModelList: [
 | 
			
		||||
				{
 | 
			
		||||
					id: 1,
 | 
			
		||||
					name: '自动',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					id: 2,
 | 
			
		||||
					name: '手动',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
			},
 | 
			
		||||
			dataRule: {
 | 
			
		||||
        typeId: [
 | 
			
		||||
				typeId: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '打印类型不能为空',
 | 
			
		||||
@@ -221,7 +213,7 @@ export default {
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
        printModel: [
 | 
			
		||||
				printModel: [
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '模板类型不能为空',
 | 
			
		||||
@@ -229,11 +221,11 @@ export default {
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				content: [
 | 
			
		||||
          {
 | 
			
		||||
            required: true,
 | 
			
		||||
            message: '模板不能为空',
 | 
			
		||||
            trigger: 'blur',
 | 
			
		||||
          },
 | 
			
		||||
					{
 | 
			
		||||
						required: true,
 | 
			
		||||
						message: '模板不能为空',
 | 
			
		||||
						trigger: 'blur',
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				processTime: [
 | 
			
		||||
					{
 | 
			
		||||
@@ -251,30 +243,30 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			// isdetail: false,
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getModelData(data) {
 | 
			
		||||
      console.log(data)
 | 
			
		||||
      this.content = JSON.stringify(data)
 | 
			
		||||
      this.dataForm.content = JSON.stringify(data)
 | 
			
		||||
    },
 | 
			
		||||
    btnClickDesign() {
 | 
			
		||||
      console.log(11111)
 | 
			
		||||
      this.modelShow = true
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.printModelDesign.init(this.dataForm.content)
 | 
			
		||||
        console.log(this.dataForm.content)
 | 
			
		||||
      })
 | 
			
		||||
      // this.$router.push({
 | 
			
		||||
      //   path: '/printModelDesign'
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getModelData(data) {
 | 
			
		||||
			console.log(data);
 | 
			
		||||
			this.content = JSON.stringify(data);
 | 
			
		||||
			this.dataForm.content = JSON.stringify(data);
 | 
			
		||||
		},
 | 
			
		||||
		btnClickDesign() {
 | 
			
		||||
			console.log(11111);
 | 
			
		||||
			this.modelShow = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.printModelDesign.init(this.dataForm.content);
 | 
			
		||||
				console.log(this.dataForm.content);
 | 
			
		||||
			});
 | 
			
		||||
			// this.$router.push({
 | 
			
		||||
			//   path: '/printModelDesign'
 | 
			
		||||
			// })
 | 
			
		||||
		},
 | 
			
		||||
		// initData() {
 | 
			
		||||
		// 	this.productAttributeList.splice(0);
 | 
			
		||||
		// 	this.listQuery.total = 0;
 | 
			
		||||
		// },
 | 
			
		||||
    init(id) {
 | 
			
		||||
      this.getDict()
 | 
			
		||||
		init(id) {
 | 
			
		||||
			this.getDict();
 | 
			
		||||
			// this.initData();
 | 
			
		||||
			// this.isdetail = isdetail || false;
 | 
			
		||||
			this.dataForm.id = id || null;
 | 
			
		||||
@@ -284,34 +276,34 @@ export default {
 | 
			
		||||
				this.$refs['dataForm'].resetFields();
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					// 获取产品详情
 | 
			
		||||
          getPackingModel(id).then((response) => {
 | 
			
		||||
					getPackingModel(id).then((response) => {
 | 
			
		||||
						this.dataForm = response.data;
 | 
			
		||||
					});
 | 
			
		||||
					// 获取产品的属性列表
 | 
			
		||||
					// this.getList();
 | 
			
		||||
				} else {
 | 
			
		||||
					// getCode().then((res) => {
 | 
			
		||||
          //   this.dataForm.packagingCode = res.data;
 | 
			
		||||
					//   this.dataForm.packagingCode = res.data;
 | 
			
		||||
					// });
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		getDict() {
 | 
			
		||||
      // 获取产品的属性列表
 | 
			
		||||
      // getCustomerList().then((response) => {
 | 
			
		||||
      //   console.log(response);
 | 
			
		||||
      //   this.customerList = response.data
 | 
			
		||||
      //   // this.listQuery.total = response.data.total;
 | 
			
		||||
      // })
 | 
			
		||||
      getTypeList().then((response) => {
 | 
			
		||||
        console.log(response);
 | 
			
		||||
        this.typeList = response.data
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      // getWorkOrderList().then((response) => {
 | 
			
		||||
      //   // console.log(response);
 | 
			
		||||
      //   this.workOrderList = response.data
 | 
			
		||||
			// 获取产品的属性列表
 | 
			
		||||
			// getCustomerList().then((response) => {
 | 
			
		||||
			//   console.log(response);
 | 
			
		||||
			//   this.customerList = response.data
 | 
			
		||||
			//   // this.listQuery.total = response.data.total;
 | 
			
		||||
			// })
 | 
			
		||||
			getTypeList().then((response) => {
 | 
			
		||||
				console.log(response);
 | 
			
		||||
				this.typeList = response.data;
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			// getWorkOrderList().then((response) => {
 | 
			
		||||
			//   // console.log(response);
 | 
			
		||||
			//   this.workOrderList = response.data
 | 
			
		||||
			// 	// this.listQuery.total = response.data.total;
 | 
			
		||||
			// })
 | 
			
		||||
		},
 | 
			
		||||
@@ -353,7 +345,7 @@ export default {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					// 修改的提交
 | 
			
		||||
					if (this.dataForm.id) {
 | 
			
		||||
            updatePackingModel(this.dataForm).then((response) => {
 | 
			
		||||
						updatePackingModel(this.dataForm).then((response) => {
 | 
			
		||||
							this.$modal.msgSuccess('修改成功');
 | 
			
		||||
							this.visible = false;
 | 
			
		||||
							this.$emit('refreshDataList');
 | 
			
		||||
@@ -361,7 +353,7 @@ export default {
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
          createPackingModel(this.dataForm).then((response) => {
 | 
			
		||||
					createPackingModel(this.dataForm).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('新增成功');
 | 
			
		||||
						this.visible = false;
 | 
			
		||||
						this.$emit('refreshDataList');
 | 
			
		||||
@@ -439,35 +431,31 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</style> -->
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.baseDialog .el-dialog__header {
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
  color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  font-weight: 500;
 | 
			
		||||
  padding: 13px 24px;
 | 
			
		||||
  border-bottom: 1px solid #e9e9e9;
 | 
			
		||||
	font-size: 16px;
 | 
			
		||||
	color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
	font-weight: 500;
 | 
			
		||||
	padding: 13px 24px;
 | 
			
		||||
	border-bottom: 1px solid #e9e9e9;
 | 
			
		||||
}
 | 
			
		||||
.baseDialog .el-dialog__header .titleStyle::before{
 | 
			
		||||
  content: '';
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 16px;
 | 
			
		||||
  background-color: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8px;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  top: 2px;
 | 
			
		||||
.baseDialog .el-dialog__header .titleStyle::before {
 | 
			
		||||
	content: '';
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 16px;
 | 
			
		||||
	background-color: #0b58ff;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	position: relative;
 | 
			
		||||
	top: 2px;
 | 
			
		||||
}
 | 
			
		||||
.baseDialog .el-dialog__body {
 | 
			
		||||
  padding-left: 24px;
 | 
			
		||||
  padding-right: 24px;
 | 
			
		||||
	padding-left: 24px;
 | 
			
		||||
	padding-right: 24px;
 | 
			
		||||
}
 | 
			
		||||
.baseDialog .btnTextStyle {
 | 
			
		||||
  letter-spacing:6px;
 | 
			
		||||
  padding: 9px 10px 9px 16px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
	letter-spacing: 6px;
 | 
			
		||||
	padding: 9px 10px 9px 16px;
 | 
			
		||||
	font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -6,106 +6,72 @@
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true">
 | 
			
		||||
    <small-title slot="title" :no-padding="true">
 | 
			
		||||
      {{ !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		class="baseDialog"
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		:show-close="true"
 | 
			
		||||
		:wrapper-closable="false"
 | 
			
		||||
		width="50%">
 | 
			
		||||
		<small-title
 | 
			
		||||
			slot="title"
 | 
			
		||||
			:no-padding="true">
 | 
			
		||||
			{{ !dataForm.id ? '新增' : '编辑' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
 | 
			
		||||
    <div class="content">
 | 
			
		||||
      <div class="visual-part">
 | 
			
		||||
        <el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
 | 
			
		||||
          @keyup.enter.native="dataFormSubmit">
 | 
			
		||||
          <el-row :gutter="20">
 | 
			
		||||
            <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="description">
 | 
			
		||||
                <el-input v-model="dataForm.description" clearable placeholder="类型描述" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
          <!-- <el-row :gutter="20">
 | 
			
		||||
            <el-col :span="24">
 | 
			
		||||
              <el-form-item label="完成单位产品用时" prop="processTime">
 | 
			
		||||
                <el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
 | 
			
		||||
              </el-form-item>
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row> -->
 | 
			
		||||
        </el-form>
 | 
			
		||||
 | 
			
		||||
        <!-- <small-title
 | 
			
		||||
					style="margin: 16px 0; padding-left: 8px"
 | 
			
		||||
					:no-padding="true">
 | 
			
		||||
					产品属性列表
 | 
			
		||||
				</small-title>
 | 
			
		||||
 | 
			
		||||
				<div class="attr-list">
 | 
			
		||||
					<base-table
 | 
			
		||||
						:table-props="tableProps"
 | 
			
		||||
						:page="listQuery.pageNo"
 | 
			
		||||
						:limit="listQuery.pageSize"
 | 
			
		||||
						:add-button-show="isdetail ? null : '添加属性'"
 | 
			
		||||
						@emitButtonClick="addNew()"
 | 
			
		||||
						:table-data="productAttributeList">
 | 
			
		||||
						<method-btn
 | 
			
		||||
							v-if="!isdetail"
 | 
			
		||||
							slot="handleBtn"
 | 
			
		||||
							:width="120"
 | 
			
		||||
							label="操作"
 | 
			
		||||
							:method-list="tableBtn"
 | 
			
		||||
							@clickBtn="handleClick" />
 | 
			
		||||
					</base-table>
 | 
			
		||||
					<pagination
 | 
			
		||||
						v-show="listQuery.total > 0"
 | 
			
		||||
						:total="listQuery.total"
 | 
			
		||||
						:page.sync="listQuery.pageNo"
 | 
			
		||||
						:limit.sync="listQuery.pageSize"
 | 
			
		||||
						:page-sizes="[5, 10, 15]"
 | 
			
		||||
						@pagination="getList" />
 | 
			
		||||
				</div> -->
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- <div style="position: absolute; bottom: 24px; right: 24px">
 | 
			
		||||
			<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
 | 
			
		||||
			<el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
		<div class="content">
 | 
			
		||||
			<div class="visual-part">
 | 
			
		||||
				<el-form
 | 
			
		||||
					ref="dataForm"
 | 
			
		||||
					:model="dataForm"
 | 
			
		||||
					:rules="dataRule"
 | 
			
		||||
					label-width="auto"
 | 
			
		||||
					@keyup.enter.native="dataFormSubmit">
 | 
			
		||||
					<el-row :gutter="20">
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="名称"
 | 
			
		||||
								prop="name">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.name"
 | 
			
		||||
									clearable
 | 
			
		||||
									placeholder="名称" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
						<el-col :span="24">
 | 
			
		||||
							<el-form-item
 | 
			
		||||
								label="类型描述"
 | 
			
		||||
								prop="description">
 | 
			
		||||
								<el-input
 | 
			
		||||
									v-model="dataForm.description"
 | 
			
		||||
									clearable
 | 
			
		||||
									placeholder="类型描述" />
 | 
			
		||||
							</el-form-item>
 | 
			
		||||
						</el-col>
 | 
			
		||||
					</el-row>
 | 
			
		||||
				</el-form>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
		<template slot="footer">
 | 
			
		||||
			<el-button
 | 
			
		||||
				style=""
 | 
			
		||||
				@click="goback()">
 | 
			
		||||
				取消
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<span v-if="!isdetail">
 | 
			
		||||
				<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
 | 
			
		||||
				<el-button
 | 
			
		||||
					v-if="dataForm.id && !isdetail"
 | 
			
		||||
					type="primary"
 | 
			
		||||
					@click="addNew()">
 | 
			
		||||
					添加属性
 | 
			
		||||
				</el-button>
 | 
			
		||||
			</span>
 | 
			
		||||
		</div> -->
 | 
			
		||||
    <template slot="footer">
 | 
			
		||||
      <el-button style="" @click="goback()">取消</el-button>
 | 
			
		||||
      <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
 | 
			
		||||
				编辑
 | 
			
		||||
			</el-button> -->
 | 
			
		||||
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
 | 
			
		||||
    </template>
 | 
			
		||||
  </el-dialog>
 | 
			
		||||
			<el-button
 | 
			
		||||
				type="primary"
 | 
			
		||||
				@click="dataFormSubmit()">
 | 
			
		||||
				确定
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</template>
 | 
			
		||||
	</el-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
import {
 | 
			
		||||
  createPackingType,
 | 
			
		||||
  updatePackingType,
 | 
			
		||||
  getPackingType,
 | 
			
		||||
  // getWorkOrderList,
 | 
			
		||||
  // getCode,
 | 
			
		||||
  // getCustomerList,
 | 
			
		||||
  // getModelList
 | 
			
		||||
	createPackingType,
 | 
			
		||||
	updatePackingType,
 | 
			
		||||
	getPackingType,
 | 
			
		||||
} from '@/api/base/modelType.js';
 | 
			
		||||
// import productAttrAdd from './attr-add';
 | 
			
		||||
import { parseTime } from '../mixins/code-filter';
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
 | 
			
		||||
@@ -142,20 +108,15 @@ export default {
 | 
			
		||||
			visible: false,
 | 
			
		||||
			addOrUpdateVisible: false,
 | 
			
		||||
			tableBtn,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      customerList: [],
 | 
			
		||||
      modelList:[],
 | 
			
		||||
      workOrderList:[],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			customerList: [],
 | 
			
		||||
			modelList: [],
 | 
			
		||||
			workOrderList: [],
 | 
			
		||||
			productAttributeList: [],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
				id: null,
 | 
			
		||||
				// name: '', // 产品名称
 | 
			
		||||
        name: '', // 产品编码
 | 
			
		||||
				// area: 0, // 单位平方数(float only)
 | 
			
		||||
        description: null, // 产品类型id
 | 
			
		||||
        // workOrderId: null, // 单位产品用时 (s)
 | 
			
		||||
        // customerId: '', // 规格
 | 
			
		||||
        // content: '', // 单位id
 | 
			
		||||
				name: '', // 产品编码
 | 
			
		||||
				description: null, // 产品类型id
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
@@ -171,18 +132,10 @@ export default {
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
			// isdetail: false,
 | 
			
		||||
		};
 | 
			
		||||
  },
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// initData() {
 | 
			
		||||
		// 	this.productAttributeList.splice(0);
 | 
			
		||||
		// 	this.listQuery.total = 0;
 | 
			
		||||
		// },
 | 
			
		||||
    init(id) {
 | 
			
		||||
      // this.getDict()
 | 
			
		||||
			// this.initData();
 | 
			
		||||
			// this.isdetail = isdetail || false;
 | 
			
		||||
		init(id) {
 | 
			
		||||
			this.dataForm.id = id || null;
 | 
			
		||||
			this.visible = true;
 | 
			
		||||
 | 
			
		||||
@@ -191,76 +144,20 @@ export default {
 | 
			
		||||
 | 
			
		||||
				if (this.dataForm.id) {
 | 
			
		||||
					// 获取产品详情
 | 
			
		||||
          getPackingType(id).then((response) => {
 | 
			
		||||
					getPackingType(id).then((response) => {
 | 
			
		||||
						this.dataForm = response.data;
 | 
			
		||||
					});
 | 
			
		||||
					// 获取产品的属性列表
 | 
			
		||||
					// this.getList();
 | 
			
		||||
				} else {
 | 
			
		||||
					// getCode().then((res) => {
 | 
			
		||||
          //   this.dataForm.packagingCode = res.data;
 | 
			
		||||
					// });
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		// getDict() {
 | 
			
		||||
    //   // 获取产品的属性列表
 | 
			
		||||
    //   getCustomerList().then((response) => {
 | 
			
		||||
    //     console.log(response);
 | 
			
		||||
    //     this.customerList = response.data
 | 
			
		||||
    //     // this.listQuery.total = response.data.total;
 | 
			
		||||
    //   })
 | 
			
		||||
    //   getModelList().then((response) => {
 | 
			
		||||
    //     console.log(response);
 | 
			
		||||
    //     this.modelList = response.data
 | 
			
		||||
    //     // this.listQuery.total = response.data.total;
 | 
			
		||||
    //   })
 | 
			
		||||
    //   getWorkOrderList().then((response) => {
 | 
			
		||||
    //     // console.log(response);
 | 
			
		||||
    //     this.workOrderList = response.data
 | 
			
		||||
		// 		// this.listQuery.total = response.data.total;
 | 
			
		||||
		// 	})
 | 
			
		||||
		// },
 | 
			
		||||
		// handleClick(raw) {
 | 
			
		||||
		// 	if (raw.type === 'delete') {
 | 
			
		||||
		// 		this.$confirm(
 | 
			
		||||
		// 			`确定对${
 | 
			
		||||
		// 				raw.data.name
 | 
			
		||||
		// 					? '[名称=' + raw.data.name + ']'
 | 
			
		||||
		// 					: '[序号=' + raw.data._pageIndex + ']'
 | 
			
		||||
		// 			}进行删除操作?`,
 | 
			
		||||
		// 			'提示',
 | 
			
		||||
		// 			{
 | 
			
		||||
		// 				confirmButtonText: '确定',
 | 
			
		||||
		// 				cancelButtonText: '取消',
 | 
			
		||||
		// 				type: 'warning',
 | 
			
		||||
		// 			}
 | 
			
		||||
		// 		)
 | 
			
		||||
		// 			.then(() => {
 | 
			
		||||
		// 				deleteProductAttr(raw.data.id).then(({ data }) => {
 | 
			
		||||
		// 					this.$message({
 | 
			
		||||
		// 						message: '操作成功',
 | 
			
		||||
		// 						type: 'success',
 | 
			
		||||
		// 						duration: 1500,
 | 
			
		||||
		// 						onClose: () => {
 | 
			
		||||
		// 							this.getList();
 | 
			
		||||
		// 						},
 | 
			
		||||
		// 					});
 | 
			
		||||
		// 				});
 | 
			
		||||
		// 			})
 | 
			
		||||
		// 			.catch(() => {});
 | 
			
		||||
		// 	} else {
 | 
			
		||||
		// 		this.addNew(raw.data.id);
 | 
			
		||||
		// 	}
 | 
			
		||||
		// },
 | 
			
		||||
		// 表单提交
 | 
			
		||||
		dataFormSubmit() {
 | 
			
		||||
			this.$refs['dataForm'].validate((valid) => {
 | 
			
		||||
				if (valid) {
 | 
			
		||||
					// 修改的提交
 | 
			
		||||
					if (this.dataForm.id) {
 | 
			
		||||
            updatePackingType(this.dataForm).then((response) => {
 | 
			
		||||
						updatePackingType(this.dataForm).then((response) => {
 | 
			
		||||
							this.$modal.msgSuccess('修改成功');
 | 
			
		||||
							this.visible = false;
 | 
			
		||||
							this.$emit('refreshDataList');
 | 
			
		||||
@@ -268,7 +165,7 @@ export default {
 | 
			
		||||
						return;
 | 
			
		||||
					}
 | 
			
		||||
					// 添加的提交
 | 
			
		||||
          createPackingType(this.dataForm).then((response) => {
 | 
			
		||||
					createPackingType(this.dataForm).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('新增成功');
 | 
			
		||||
						this.visible = false;
 | 
			
		||||
						this.$emit('refreshDataList');
 | 
			
		||||
@@ -294,88 +191,32 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<!-- <style scoped>
 | 
			
		||||
.drawer >>> .el-drawer {
 | 
			
		||||
	border-radius: 8px 0 0 8px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form-item__label {
 | 
			
		||||
	padding: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-drawer__header {
 | 
			
		||||
	margin: 0;
 | 
			
		||||
	padding: 32px 32px 24px;
 | 
			
		||||
	border-bottom: 1px solid #dcdfe6;
 | 
			
		||||
}
 | 
			
		||||
.drawer >>> .el-drawer__body {
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	height: 1px;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .content {
 | 
			
		||||
	padding: 30px 24px;
 | 
			
		||||
	flex: 1;
 | 
			
		||||
	display: flex;
 | 
			
		||||
	flex-direction: column;
 | 
			
		||||
	/* height: 100%; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .visual-part {
 | 
			
		||||
	flex: 1 auto;
 | 
			
		||||
	max-height: 76vh;
 | 
			
		||||
	overflow: hidden;
 | 
			
		||||
	overflow-y: scroll;
 | 
			
		||||
	padding-right: 10px; /* 调整滚动条样式 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer >>> .el-form,
 | 
			
		||||
.drawer >>> .attr-list {
 | 
			
		||||
	padding: 0 16px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.drawer-body__footer {
 | 
			
		||||
	display: flex;
 | 
			
		||||
	justify-content: flex-end;
 | 
			
		||||
	padding: 18px;
 | 
			
		||||
}
 | 
			
		||||
</style> -->
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.baseDialog .el-dialog__header {
 | 
			
		||||
  font-size: 16px;
 | 
			
		||||
  color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
  font-weight: 500;
 | 
			
		||||
  padding: 13px 24px;
 | 
			
		||||
  border-bottom: 1px solid #e9e9e9;
 | 
			
		||||
	font-size: 16px;
 | 
			
		||||
	color: rgba(0, 0, 0, 0.85);
 | 
			
		||||
	font-weight: 500;
 | 
			
		||||
	padding: 13px 24px;
 | 
			
		||||
	border-bottom: 1px solid #e9e9e9;
 | 
			
		||||
}
 | 
			
		||||
.baseDialog .el-dialog__header .titleStyle::before{
 | 
			
		||||
  content: '';
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 16px;
 | 
			
		||||
  background-color: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8px;
 | 
			
		||||
  position: relative;
 | 
			
		||||
  top: 2px;
 | 
			
		||||
.baseDialog .el-dialog__header .titleStyle::before {
 | 
			
		||||
	content: '';
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 16px;
 | 
			
		||||
	background-color: #0b58ff;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	position: relative;
 | 
			
		||||
	top: 2px;
 | 
			
		||||
}
 | 
			
		||||
.baseDialog .el-dialog__body {
 | 
			
		||||
  padding-left: 24px;
 | 
			
		||||
  padding-right: 24px;
 | 
			
		||||
	padding-left: 24px;
 | 
			
		||||
	padding-right: 24px;
 | 
			
		||||
}
 | 
			
		||||
.baseDialog .btnTextStyle {
 | 
			
		||||
  letter-spacing:6px;
 | 
			
		||||
  padding: 9px 10px 9px 16px;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
	letter-spacing: 6px;
 | 
			
		||||
	padding: 9px 10px 9px 16px;
 | 
			
		||||
	font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,26 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div>
 | 
			
		||||
		<NotMsg v-show="notMsg"/>
 | 
			
		||||
		<div id='gasChart' class="gas-chart" style="width:600px;height:200px;" v-show='!notMsg'></div>
 | 
			
		||||
		<NotMsg v-show="notMsg" />
 | 
			
		||||
		<div
 | 
			
		||||
			id="gasChart"
 | 
			
		||||
			class="gas-chart"
 | 
			
		||||
			style="width: 600px; height: 200px"
 | 
			
		||||
			v-show="!notMsg"></div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from 'echarts';
 | 
			
		||||
import resize from './../mixins/resize'
 | 
			
		||||
import NotMsg from './../components/NotMsg'
 | 
			
		||||
import resize from './../mixins/resize';
 | 
			
		||||
import NotMsg from './../components/NotMsg';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'GasChart',
 | 
			
		||||
	mixins: [resize],
 | 
			
		||||
	components:{ NotMsg },
 | 
			
		||||
	components: { NotMsg },
 | 
			
		||||
	props: {
 | 
			
		||||
		chartType: '', // 能源类型
 | 
			
		||||
		chartTime: ''
 | 
			
		||||
		chartTime: '',
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		const colors = [
 | 
			
		||||
@@ -31,159 +35,170 @@ export default {
 | 
			
		||||
		];
 | 
			
		||||
		return {
 | 
			
		||||
			chart: null,
 | 
			
		||||
			notMsg:false
 | 
			
		||||
			notMsg: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		gasChartMsg() {
 | 
			
		||||
			return this.$store.state.websocket.sumGasInfo
 | 
			
		||||
			return this.$store.state.websocket.sumGasInfo;
 | 
			
		||||
		},
 | 
			
		||||
		energyWeekTrend() {
 | 
			
		||||
			return this.$store.state.websocket.energyWeekTrend
 | 
			
		||||
			return this.$store.state.websocket.energyWeekTrend;
 | 
			
		||||
		},
 | 
			
		||||
		energyMonthTrend() {
 | 
			
		||||
			return this.$store.state.websocket.energyMonthTrend
 | 
			
		||||
			return this.$store.state.websocket.energyMonthTrend;
 | 
			
		||||
		},
 | 
			
		||||
		energyYearTrend() {
 | 
			
		||||
			return this.$store.state.websocket.energyYearTrend
 | 
			
		||||
		}
 | 
			
		||||
			return this.$store.state.websocket.energyYearTrend;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		energyWeekTrend: {// 监听周电能,更新图
 | 
			
		||||
		energyWeekTrend: {
 | 
			
		||||
			// 监听周电能,更新图
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				if (this.chartTime === '周' && this.chartType === '电耗能') {
 | 
			
		||||
					this.updateChart()
 | 
			
		||||
					this.$emit('emitFun')
 | 
			
		||||
					this.updateChart();
 | 
			
		||||
					this.$emit('emitFun');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		energyMonthTrend: {// 监听月电能,更新图
 | 
			
		||||
		energyMonthTrend: {
 | 
			
		||||
			// 监听月电能,更新图
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				if (this.chartTime === '月' && this.chartType === '电耗能') {
 | 
			
		||||
					this.updateChart()
 | 
			
		||||
					this.$emit('emitFun')
 | 
			
		||||
					this.updateChart();
 | 
			
		||||
					this.$emit('emitFun');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		energyYearTrend: {// 监听年电能,更新图
 | 
			
		||||
		energyYearTrend: {
 | 
			
		||||
			// 监听年电能,更新图
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				if (this.chartTime === '年' && this.chartType === '电耗能') {
 | 
			
		||||
					this.updateChart()
 | 
			
		||||
					this.$emit('emitFun')
 | 
			
		||||
					this.updateChart();
 | 
			
		||||
					this.$emit('emitFun');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		gasChartMsg: {// 监听天然气,更新图
 | 
			
		||||
		gasChartMsg: {
 | 
			
		||||
			// 监听天然气,更新图
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				if (this.chartType === '天然气I' || this.chartType === '天然气II') {
 | 
			
		||||
					this.updateChart()
 | 
			
		||||
					this.$emit('emitFun')
 | 
			
		||||
					this.updateChart();
 | 
			
		||||
					this.$emit('emitFun');
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		chartTime: {// 监听时间变化,更新图
 | 
			
		||||
		chartTime: {
 | 
			
		||||
			// 监听时间变化,更新图
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				this.updateChart()
 | 
			
		||||
			}
 | 
			
		||||
				this.updateChart();
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		chartType: {// 监听能源类型变化,更新图
 | 
			
		||||
		chartType: {
 | 
			
		||||
			// 监听能源类型变化,更新图
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				this.updateChart()
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
				this.updateChart();
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.$el.addEventListener('resize', () => {
 | 
			
		||||
			console.log('resziing.....');
 | 
			
		||||
		});
 | 
			
		||||
		this.updateChart()
 | 
			
		||||
		this.updateChart();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		updateChart() {
 | 
			
		||||
			let gasName  = ''
 | 
			
		||||
			let gasName = '';
 | 
			
		||||
			const colors = ['#FFCB59'];
 | 
			
		||||
			let temp = []
 | 
			
		||||
			let seriesData = []
 | 
			
		||||
			let xData = []
 | 
			
		||||
			let yData = []
 | 
			
		||||
			let temp = [];
 | 
			
		||||
			let seriesData = [];
 | 
			
		||||
			let xData = [];
 | 
			
		||||
			let yData = [];
 | 
			
		||||
			switch (this.chartType) {
 | 
			
		||||
				case '电耗能':{
 | 
			
		||||
					gasName = '电耗能'
 | 
			
		||||
				case '电耗能': {
 | 
			
		||||
					gasName = '电耗能';
 | 
			
		||||
					if (this.chartTime === '周') {
 | 
			
		||||
						temp = this.energyWeekTrend || []
 | 
			
		||||
					}else if(this.chartTime === '月') {
 | 
			
		||||
						temp = this.energyMonthTrend || []
 | 
			
		||||
					}else{
 | 
			
		||||
						temp = this.energyYearTrend || []
 | 
			
		||||
						temp = this.energyWeekTrend || [];
 | 
			
		||||
					} else if (this.chartTime === '月') {
 | 
			
		||||
						temp = this.energyMonthTrend || [];
 | 
			
		||||
					} else {
 | 
			
		||||
						temp = this.energyYearTrend || [];
 | 
			
		||||
					}
 | 
			
		||||
					temp && temp.map(i => {
 | 
			
		||||
						xData.push(i.time)
 | 
			
		||||
						yData.push(i.qty)
 | 
			
		||||
					})
 | 
			
		||||
					temp &&
 | 
			
		||||
						temp.map((i) => {
 | 
			
		||||
							xData.push(i.time);
 | 
			
		||||
							yData.push(i.qty);
 | 
			
		||||
						});
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
				case '天然气I':{
 | 
			
		||||
				case '天然气I': {
 | 
			
		||||
					if (this.chartTime === '周') {
 | 
			
		||||
						yData = this.gasChartMsg.hisSumGas1For7Day || []
 | 
			
		||||
					}else if(this.chartTime === '月') {
 | 
			
		||||
						yData = this.gasChartMsg.sumGas1ForMonth || []
 | 
			
		||||
					}else{
 | 
			
		||||
						yData = this.gasChartMsg.sumGas1ForYear || []
 | 
			
		||||
						yData = this.gasChartMsg.hisSumGas1For7Day || [];
 | 
			
		||||
					} else if (this.chartTime === '月') {
 | 
			
		||||
						yData = this.gasChartMsg.sumGas1ForMonth || [];
 | 
			
		||||
					} else {
 | 
			
		||||
						yData = this.gasChartMsg.sumGas1ForYear || [];
 | 
			
		||||
					}
 | 
			
		||||
					gasName = '天然气I'
 | 
			
		||||
					xData = this.getXdata()
 | 
			
		||||
					gasName = '天然气I';
 | 
			
		||||
					xData = this.getXdata();
 | 
			
		||||
					break;
 | 
			
		||||
				}
 | 
			
		||||
				default:
 | 
			
		||||
				gasName = '天然气II'
 | 
			
		||||
				if (this.chartTime === '周') {
 | 
			
		||||
						yData = this.gasChartMsg.hisSumGas2For7Day || []
 | 
			
		||||
					}else if(this.chartTime === '月') {
 | 
			
		||||
						yData = this.gasChartMsg.sumGas2ForMonth || []
 | 
			
		||||
					}else{
 | 
			
		||||
						yData = this.gasChartMsg.sumGas2ForYear || []
 | 
			
		||||
					gasName = '天然气II';
 | 
			
		||||
					if (this.chartTime === '周') {
 | 
			
		||||
						yData = this.gasChartMsg.hisSumGas2For7Day || [];
 | 
			
		||||
					} else if (this.chartTime === '月') {
 | 
			
		||||
						yData = this.gasChartMsg.sumGas2ForMonth || [];
 | 
			
		||||
					} else {
 | 
			
		||||
						yData = this.gasChartMsg.sumGas2ForYear || [];
 | 
			
		||||
					}
 | 
			
		||||
				xData = this.getXdata()
 | 
			
		||||
					xData = this.getXdata();
 | 
			
		||||
			}
 | 
			
		||||
			if (yData.length === 0) {
 | 
			
		||||
         this.notMsg = true
 | 
			
		||||
         return
 | 
			
		||||
      } else {
 | 
			
		||||
        this.notMsg = false
 | 
			
		||||
      }
 | 
			
		||||
				this.notMsg = true;
 | 
			
		||||
				return;
 | 
			
		||||
			} else {
 | 
			
		||||
				this.notMsg = false;
 | 
			
		||||
			}
 | 
			
		||||
			if (yData.length == 0) {
 | 
			
		||||
				seriesData = []
 | 
			
		||||
			}else {
 | 
			
		||||
				seriesData = [{
 | 
			
		||||
					name: gasName,
 | 
			
		||||
					data: yData,
 | 
			
		||||
					type: "line",
 | 
			
		||||
					areaStyle: {
 | 
			
		||||
				seriesData = [];
 | 
			
		||||
			} else {
 | 
			
		||||
				yData = yData.map((item) => {
 | 
			
		||||
					return (item = Number(item.toFixed(2)));
 | 
			
		||||
				});
 | 
			
		||||
				seriesData = [
 | 
			
		||||
					{
 | 
			
		||||
						name: gasName,
 | 
			
		||||
						data: yData,
 | 
			
		||||
						type: 'line',
 | 
			
		||||
						areaStyle: {
 | 
			
		||||
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
 | 
			
		||||
							{ offset: 0, color: '#FFCB59' + "40" },
 | 
			
		||||
							{ offset: 0.5, color: '#FFCB59' + "20" },
 | 
			
		||||
							{ offset: 1, color: '#FFCB59' + "00" },
 | 
			
		||||
								{ offset: 0, color: '#FFCB59' + '40' },
 | 
			
		||||
								{ offset: 0.5, color: '#FFCB59' + '20' },
 | 
			
		||||
								{ offset: 1, color: '#FFCB59' + '00' },
 | 
			
		||||
							]),
 | 
			
		||||
						},
 | 
			
		||||
						lineStyle: {
 | 
			
		||||
							width: 1,
 | 
			
		||||
						},
 | 
			
		||||
						symbol: 'circle',
 | 
			
		||||
						symbolSize: 5,
 | 
			
		||||
						emphasis: {
 | 
			
		||||
							focus: 'series',
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					lineStyle: {
 | 
			
		||||
							width: 1
 | 
			
		||||
					},
 | 
			
		||||
					symbol: 'circle',
 | 
			
		||||
					symbolSize: 5,
 | 
			
		||||
					emphasis: {
 | 
			
		||||
							focus: 'series'
 | 
			
		||||
					}
 | 
			
		||||
				}]
 | 
			
		||||
					
 | 
			
		||||
				];
 | 
			
		||||
			}
 | 
			
		||||
			// 绘图
 | 
			
		||||
			if (
 | 
			
		||||
        this.chart !== null &&
 | 
			
		||||
        this.chart !== '' &&
 | 
			
		||||
        this.chart !== undefined
 | 
			
		||||
      ) {
 | 
			
		||||
        this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
 | 
			
		||||
      }
 | 
			
		||||
				this.chart !== null &&
 | 
			
		||||
				this.chart !== '' &&
 | 
			
		||||
				this.chart !== undefined
 | 
			
		||||
			) {
 | 
			
		||||
				this.chart.dispose(); // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
 | 
			
		||||
			}
 | 
			
		||||
			this.chart = echarts.init(document.getElementById('gasChart'));
 | 
			
		||||
			var option = {
 | 
			
		||||
				color: colors,
 | 
			
		||||
@@ -204,7 +219,7 @@ export default {
 | 
			
		||||
					},
 | 
			
		||||
				},
 | 
			
		||||
				yAxis: {
 | 
			
		||||
					name: this.chartType === '电耗能'?'单位kwh':'单位Nm³',
 | 
			
		||||
					name: this.chartType === '电耗能' ? '单位kwh' : '单位Nm³',
 | 
			
		||||
					nameTextStyle: {
 | 
			
		||||
						color: '#fff',
 | 
			
		||||
						fontSize: 10,
 | 
			
		||||
@@ -230,10 +245,10 @@ export default {
 | 
			
		||||
				series: seriesData,
 | 
			
		||||
				tooltip: {
 | 
			
		||||
					trigger: 'axis',
 | 
			
		||||
					className: "gas-tooltip"
 | 
			
		||||
					className: 'gas-tooltip',
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
			option && this.chart.setOption(option)
 | 
			
		||||
			};
 | 
			
		||||
			option && this.chart.setOption(option);
 | 
			
		||||
		},
 | 
			
		||||
		getXdata() {
 | 
			
		||||
			const today = new Date();
 | 
			
		||||
@@ -242,31 +257,39 @@ export default {
 | 
			
		||||
			let days = 30;
 | 
			
		||||
			if (this.chartTime === '周') {
 | 
			
		||||
				return Array(7)
 | 
			
		||||
						.fill(1)
 | 
			
		||||
						.map((_, index) => {
 | 
			
		||||
							const today = new Date();
 | 
			
		||||
							const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
 | 
			
		||||
							return `${new Date(dtimestamp).getMonth()+1}.${new Date(dtimestamp).getDate()}`;}).reverse()
 | 
			
		||||
			}else if (this.chartTime == "月") {
 | 
			
		||||
					.fill(1)
 | 
			
		||||
					.map((_, index) => {
 | 
			
		||||
						const today = new Date();
 | 
			
		||||
						const dtimestamp = today - (index + 1) * 24 * 60 * 60 * 1000;
 | 
			
		||||
						return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
 | 
			
		||||
							dtimestamp
 | 
			
		||||
						).getDate()}`;
 | 
			
		||||
					})
 | 
			
		||||
					.reverse();
 | 
			
		||||
			} else if (this.chartTime == '月') {
 | 
			
		||||
				if (currentMonth in [1, 3, 5, 7, 8, 10, 12]) {
 | 
			
		||||
					days = 31;
 | 
			
		||||
				} else if (currentMonth == 2) {
 | 
			
		||||
					days = this.isLeapYear(currentYear) ? 29 : 28;
 | 
			
		||||
				}
 | 
			
		||||
				return Array(days)
 | 
			
		||||
						.fill(1)
 | 
			
		||||
						.map((_, index) => {
 | 
			
		||||
							return `${currentMonth}.${days - index}`;}).reverse()
 | 
			
		||||
					.fill(1)
 | 
			
		||||
					.map((_, index) => {
 | 
			
		||||
						return `${currentMonth}.${days - index}`;
 | 
			
		||||
					})
 | 
			
		||||
					.reverse();
 | 
			
		||||
			} else {
 | 
			
		||||
				return Array(12)
 | 
			
		||||
						.fill(1)
 | 
			
		||||
						.map((_, index) => {
 | 
			
		||||
							return `${12 - index}`;}).reverse()
 | 
			
		||||
					.fill(1)
 | 
			
		||||
					.map((_, index) => {
 | 
			
		||||
						return `${12 - index}`;
 | 
			
		||||
					})
 | 
			
		||||
					.reverse();
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		isLeapYear(year) {
 | 
			
		||||
			return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
 | 
			
		||||
		}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -278,12 +301,12 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<style>
 | 
			
		||||
  .gas-tooltip {
 | 
			
		||||
    background: #0a2b4f77 !important;
 | 
			
		||||
    border: none !important;
 | 
			
		||||
    backdrop-filter: blur(12px);
 | 
			
		||||
  }
 | 
			
		||||
  .gas-tooltip * {
 | 
			
		||||
    color: #fff !important;
 | 
			
		||||
  }
 | 
			
		||||
.gas-tooltip {
 | 
			
		||||
	background: #0a2b4f77 !important;
 | 
			
		||||
	border: none !important;
 | 
			
		||||
	backdrop-filter: blur(12px);
 | 
			
		||||
}
 | 
			
		||||
.gas-tooltip * {
 | 
			
		||||
	color: #fff !important;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,70 +1,91 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div>
 | 
			
		||||
		<NotMsg v-show="notMsg"/>
 | 
			
		||||
		<div id="israChart" class="isra-chart" style="width:600px;height:390px;" v-show='!notMsg'></div>
 | 
			
		||||
		<NotMsg v-show="notMsg" />
 | 
			
		||||
		<div
 | 
			
		||||
			id="israChart"
 | 
			
		||||
			class="isra-chart"
 | 
			
		||||
			style="width: 600px; height: 390px"
 | 
			
		||||
			v-show="!notMsg"></div>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import * as echarts from 'echarts';
 | 
			
		||||
import resize from './../mixins/resize'
 | 
			
		||||
import NotMsg from './../components/NotMsg'
 | 
			
		||||
import resize from './../mixins/resize';
 | 
			
		||||
import NotMsg from './../components/NotMsg';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'ISRAChart',
 | 
			
		||||
	mixins: [resize],
 | 
			
		||||
	components:{ NotMsg },
 | 
			
		||||
	components: { NotMsg },
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			chart: null,
 | 
			
		||||
			notMsg:true,
 | 
			
		||||
			colors:['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
 | 
			
		||||
			chartData: []
 | 
			
		||||
			notMsg: true,
 | 
			
		||||
			colors: ['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
 | 
			
		||||
			chartData: [],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	activated() {
 | 
			
		||||
	},
 | 
			
		||||
	activated() {},
 | 
			
		||||
	computed: {
 | 
			
		||||
		israChartMsg() {
 | 
			
		||||
			return this.$store.state.websocket.israKiln
 | 
			
		||||
		}
 | 
			
		||||
			return this.$store.state.websocket.israKiln;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		israChartMsg: {
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
				this.chartData = newVal || []
 | 
			
		||||
				this.updateChart()
 | 
			
		||||
				this.$emit('emitFun')
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
				this.chartData = newVal || [];
 | 
			
		||||
				this.updateChart();
 | 
			
		||||
				this.$emit('emitFun');
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getEqualNewlineString(params, length) {
 | 
			
		||||
			let text = '';
 | 
			
		||||
			let count = Math.ceil(params.length / length); // 向上取整数
 | 
			
		||||
			// 一行展示length个
 | 
			
		||||
			if (count > 1) {
 | 
			
		||||
				for (let z = 1; z <= count; z++) {
 | 
			
		||||
					text += params.substr((z - 1) * length, length);
 | 
			
		||||
					if (z < count) {
 | 
			
		||||
						text += '\n';
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				text += params.substr(0, length);
 | 
			
		||||
			}
 | 
			
		||||
			return text;
 | 
			
		||||
		},
 | 
			
		||||
		updateChart() {
 | 
			
		||||
			console.log('update')
 | 
			
		||||
			let num = 0
 | 
			
		||||
			this.chartData && this.chartData.length > 0 && this.chartData.map(i => {
 | 
			
		||||
				num+=i.num
 | 
			
		||||
			})
 | 
			
		||||
			console.log('update');
 | 
			
		||||
			let num = 0;
 | 
			
		||||
			this.chartData &&
 | 
			
		||||
				this.chartData.length > 0 &&
 | 
			
		||||
				this.chartData.map((i) => {
 | 
			
		||||
					num += i.num;
 | 
			
		||||
				});
 | 
			
		||||
			if (
 | 
			
		||||
        this.chart !== null &&
 | 
			
		||||
        this.chart !== '' &&
 | 
			
		||||
        this.chart !== undefined
 | 
			
		||||
      ) {
 | 
			
		||||
        this.chart.dispose()
 | 
			
		||||
      }
 | 
			
		||||
				this.chart !== null &&
 | 
			
		||||
				this.chart !== '' &&
 | 
			
		||||
				this.chart !== undefined
 | 
			
		||||
			) {
 | 
			
		||||
				this.chart.dispose();
 | 
			
		||||
			}
 | 
			
		||||
			if (this.chartData && this.chartData.length > 0) {
 | 
			
		||||
         this.notMsg = false
 | 
			
		||||
      } else {
 | 
			
		||||
        this.notMsg = true
 | 
			
		||||
				return
 | 
			
		||||
      }
 | 
			
		||||
				this.notMsg = false;
 | 
			
		||||
			} else {
 | 
			
		||||
				this.notMsg = true;
 | 
			
		||||
				return;
 | 
			
		||||
			}
 | 
			
		||||
			this.chart = echarts.init(document.getElementById('israChart'));
 | 
			
		||||
			var option = {
 | 
			
		||||
				color:this.colors,
 | 
			
		||||
				title:{
 | 
			
		||||
				color: this.colors,
 | 
			
		||||
				title: {
 | 
			
		||||
					text: num,
 | 
			
		||||
					subtext: '总数',
 | 
			
		||||
					subtext: '总数/个',
 | 
			
		||||
					top: '32%',
 | 
			
		||||
					left: '49%',
 | 
			
		||||
					textAlign: 'center',
 | 
			
		||||
@@ -81,55 +102,92 @@ export default {
 | 
			
		||||
					bottom: '2%',
 | 
			
		||||
					left: 'center',
 | 
			
		||||
					itemWidth: 18,
 | 
			
		||||
					itemHeight:18,
 | 
			
		||||
					itemHeight: 18,
 | 
			
		||||
					icon: 'circle',
 | 
			
		||||
					textStyle: {
 | 
			
		||||
						color: '#fff'
 | 
			
		||||
						color: '#fff',
 | 
			
		||||
					},
 | 
			
		||||
					data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
 | 
			
		||||
						name:item.name,
 | 
			
		||||
						itemStyle:{
 | 
			
		||||
							color: this.colors[index%4]
 | 
			
		||||
						}
 | 
			
		||||
					}))
 | 
			
		||||
					data:
 | 
			
		||||
						this.chartData &&
 | 
			
		||||
						this.chartData.length > 0 &&
 | 
			
		||||
						this.chartData.map((item, index) => ({
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							itemStyle: {
 | 
			
		||||
								color: this.colors[index % 4],
 | 
			
		||||
							},
 | 
			
		||||
						})),
 | 
			
		||||
				},
 | 
			
		||||
				series:[{
 | 
			
		||||
				series: [
 | 
			
		||||
					{
 | 
			
		||||
						name: 'ISRA缺陷检测',
 | 
			
		||||
						type: 'pie',
 | 
			
		||||
						center: ['50%', '40%'],
 | 
			
		||||
						radius: ['45%', '70%'],
 | 
			
		||||
						avoidLabelOverlap: true,
 | 
			
		||||
						// label: {
 | 
			
		||||
						// 	show: true,
 | 
			
		||||
						// },
 | 
			
		||||
						// labelLine: {
 | 
			
		||||
						// 	show: true,
 | 
			
		||||
						// },
 | 
			
		||||
						label: {
 | 
			
		||||
							show: false
 | 
			
		||||
							show: true,
 | 
			
		||||
							normal: {
 | 
			
		||||
								alignTo: 'labelLine',
 | 
			
		||||
								margin: 10,
 | 
			
		||||
								edgeDistance: 10,
 | 
			
		||||
								lineHeight: 16,
 | 
			
		||||
								formatter: (params) => {
 | 
			
		||||
									//调用自定义显示格式
 | 
			
		||||
									return this.getEqualNewlineString(
 | 
			
		||||
										params.value + ' | ' + params.percent.toFixed(0) + '%'
 | 
			
		||||
									);
 | 
			
		||||
								},
 | 
			
		||||
								textStyle: {
 | 
			
		||||
									// 提示文字的样式
 | 
			
		||||
									// color: '#595959',
 | 
			
		||||
									fontSize: 16,
 | 
			
		||||
								},
 | 
			
		||||
							},
 | 
			
		||||
						},
 | 
			
		||||
						labelLine: {
 | 
			
		||||
							show: true,
 | 
			
		||||
							length: 25,
 | 
			
		||||
							length2: 10,
 | 
			
		||||
						},
 | 
			
		||||
						data: this.chartData && this.chartData.length > 0 && this.chartData.map((item, index) => ({
 | 
			
		||||
						name:item.name,
 | 
			
		||||
						value: item.num,
 | 
			
		||||
						itemStyle:{
 | 
			
		||||
							color:{
 | 
			
		||||
								type: 'linear',
 | 
			
		||||
								x: 1,
 | 
			
		||||
								y: 1,
 | 
			
		||||
								x2: 0,
 | 
			
		||||
								y2: 0,
 | 
			
		||||
								global: false,
 | 
			
		||||
								colorStops:[
 | 
			
		||||
									{offset: 0,color: this.colors[index%4]},
 | 
			
		||||
									{offset: 1,color: this.colors[index%4]+'33'}
 | 
			
		||||
								]
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}))}],
 | 
			
		||||
					tooltip: {
 | 
			
		||||
						trigger: 'item',
 | 
			
		||||
						className: "isra-chart-tooltip"
 | 
			
		||||
						data:
 | 
			
		||||
							this.chartData &&
 | 
			
		||||
							this.chartData.length > 0 &&
 | 
			
		||||
							this.chartData.map((item, index) => ({
 | 
			
		||||
								name: item.name,
 | 
			
		||||
								value: item.num,
 | 
			
		||||
								label: {
 | 
			
		||||
									color: this.colors[index % 4],
 | 
			
		||||
								},
 | 
			
		||||
								itemStyle: {
 | 
			
		||||
									color: {
 | 
			
		||||
										type: 'linear',
 | 
			
		||||
										x: 1,
 | 
			
		||||
										y: 1,
 | 
			
		||||
										x2: 0,
 | 
			
		||||
										y2: 0,
 | 
			
		||||
										global: false,
 | 
			
		||||
										colorStops: [
 | 
			
		||||
											{ offset: 0, color: this.colors[index % 4] },
 | 
			
		||||
											{ offset: 1, color: this.colors[index % 4] + '33' },
 | 
			
		||||
										],
 | 
			
		||||
									},
 | 
			
		||||
								},
 | 
			
		||||
							})),
 | 
			
		||||
					},
 | 
			
		||||
			}
 | 
			
		||||
				],
 | 
			
		||||
				tooltip: {
 | 
			
		||||
					trigger: 'item',
 | 
			
		||||
					className: 'isra-chart-tooltip',
 | 
			
		||||
				},
 | 
			
		||||
			};
 | 
			
		||||
			this.chart.setOption(option);
 | 
			
		||||
		}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -141,12 +199,12 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<style>
 | 
			
		||||
  .isra-chart-tooltip {
 | 
			
		||||
    background: #0a2b4f77 !important;
 | 
			
		||||
    border: none !important;
 | 
			
		||||
    backdrop-filter: blur(12px);
 | 
			
		||||
  }
 | 
			
		||||
  .isra-chart-tooltip * {
 | 
			
		||||
    color: #fff !important;
 | 
			
		||||
  }
 | 
			
		||||
.isra-chart-tooltip {
 | 
			
		||||
	background: #0a2b4f77 !important;
 | 
			
		||||
	border: none !important;
 | 
			
		||||
	backdrop-filter: blur(12px);
 | 
			
		||||
}
 | 
			
		||||
.isra-chart-tooltip * {
 | 
			
		||||
	color: #fff !important;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,77 +1,95 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div style="flex: 1;">
 | 
			
		||||
    <Container name="设备报警" size="middle" style="">
 | 
			
		||||
      <TimePrompt class="timeShow" :timestr="timestr" />
 | 
			
		||||
      <div style="padding: 5px 10px;">
 | 
			
		||||
        <dv-scroll-board :config="config" style="width:575px;height:380px" ref='eqScrollBoard'/>
 | 
			
		||||
      </div>
 | 
			
		||||
    </Container>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div style="flex: 1">
 | 
			
		||||
		<Container
 | 
			
		||||
			name="设备报警"
 | 
			
		||||
			size="middle"
 | 
			
		||||
			style="">
 | 
			
		||||
			<TimePrompt
 | 
			
		||||
				class="timeShow"
 | 
			
		||||
				:timestr="timestr" />
 | 
			
		||||
			<div style="padding: 5px 10px">
 | 
			
		||||
				<dv-scroll-board
 | 
			
		||||
					:config="config"
 | 
			
		||||
					style="width: 575px; height: 380px"
 | 
			
		||||
					ref="eqScrollBoard" />
 | 
			
		||||
			</div>
 | 
			
		||||
		</Container>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import Container from '../components/Container.vue';
 | 
			
		||||
import TimePrompt from '../components/TimePrompt';
 | 
			
		||||
import { switchShowTime } from '../utils'
 | 
			
		||||
import { switchShowTime } from '../utils';
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'EqAlarm',
 | 
			
		||||
  components: { Container, TimePrompt },
 | 
			
		||||
  computed: {
 | 
			
		||||
    sjgEquipment() {
 | 
			
		||||
      return this.$store.state.websocket.sjgEquipment
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      timestr: '',
 | 
			
		||||
      config: {
 | 
			
		||||
        header: ['序号', '设备名称', '设备编码','设备状态','是否故障'],
 | 
			
		||||
        headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
        oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
        evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
        columnWidth: [60, 150, 190],
 | 
			
		||||
        align: ['center'],
 | 
			
		||||
        data: [],
 | 
			
		||||
        // data: [
 | 
			
		||||
        //   [1, '四大线3小线铺纸机', 'EQ20240110130909000255', '正常', '否'],
 | 
			
		||||
        //   [2, '四大线2小线铺纸机', 'EQ20240110130848000254', '正常', '否'],
 | 
			
		||||
        //   [3, '四大线1小线铺纸机', 'EQ20240110130832000253', '正常', '否'],
 | 
			
		||||
        //   [4, '12线下片台', 'EQ20240110130817000252', '正常', '否'],
 | 
			
		||||
        //   [5, '11线下片台', '	EQ20240110130743000250', '正常', '否'],
 | 
			
		||||
        //   [6, '10线下片台', '	EQ20240110130743000250', '正常', '否'],
 | 
			
		||||
        //   [7, '4大线五区自动连线柜', 'EQ20240110130731000249', '正常', '否'],
 | 
			
		||||
        //   [8, '四大线四区2小线清洗机', 'EQ20240110112716000248', '正常', '否'],
 | 
			
		||||
        //   [9, '四大线四区1小线清洗机', 'EQ20240110112700000247', '正常', '否'],
 | 
			
		||||
        //   [10, '4大线四区自动连线柜', 'EQ20240110112646000246', '正常', '否']
 | 
			
		||||
        // ],
 | 
			
		||||
        rowNum: 10
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted(){
 | 
			
		||||
    this.timestr = switchShowTime('日')
 | 
			
		||||
  },
 | 
			
		||||
  watch:{
 | 
			
		||||
    sjgEquipment: {
 | 
			
		||||
	name: 'EqAlarm',
 | 
			
		||||
	components: { Container, TimePrompt },
 | 
			
		||||
	computed: {
 | 
			
		||||
		sjgEquipment() {
 | 
			
		||||
			return this.$store.state.websocket.sjgEquipment;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			timestr: '',
 | 
			
		||||
			config: {
 | 
			
		||||
				header: ['序号', '产线名', '设备名称', '设备状态'],
 | 
			
		||||
				headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
				columnWidth: [60, 120, 280],
 | 
			
		||||
				align: ['center'],
 | 
			
		||||
				data: [],
 | 
			
		||||
				// data: [
 | 
			
		||||
				//   [1, '四大线3小线铺纸机', 'EQ20240110130909000255', '正常', '否'],
 | 
			
		||||
				//   [2, '四大线2小线铺纸机', 'EQ20240110130848000254', '正常', '否'],
 | 
			
		||||
				//   [3, '四大线1小线铺纸机', 'EQ20240110130832000253', '正常', '否'],
 | 
			
		||||
				//   [4, '12线下片台', 'EQ20240110130817000252', '正常', '否'],
 | 
			
		||||
				//   [5, '11线下片台', '	EQ20240110130743000250', '正常', '否'],
 | 
			
		||||
				//   [6, '10线下片台', '	EQ20240110130743000250', '正常', '否'],
 | 
			
		||||
				//   [7, '4大线五区自动连线柜', 'EQ20240110130731000249', '正常', '否'],
 | 
			
		||||
				//   [8, '四大线四区2小线清洗机', 'EQ20240110112716000248', '正常', '否'],
 | 
			
		||||
				//   [9, '四大线四区1小线清洗机', 'EQ20240110112700000247', '正常', '否'],
 | 
			
		||||
				//   [10, '4大线四区自动连线柜', 'EQ20240110112646000246', '正常', '否']
 | 
			
		||||
				// ],
 | 
			
		||||
				rowNum: 10,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.timestr = switchShowTime('日');
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		sjgEquipment: {
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
        let outArr = this.sjgEquipment.map((item, index) => [
 | 
			
		||||
          index+1,
 | 
			
		||||
          `<span title=${item.name || ''}>${item.name || ''}</span>`,
 | 
			
		||||
          `<span title=${item.code || ''}>${item.code || ''}</span>`,
 | 
			
		||||
          item.status,
 | 
			
		||||
          item.error? '是': '否'
 | 
			
		||||
      ]);
 | 
			
		||||
        this.config.data = outArr
 | 
			
		||||
        this.$refs['eqScrollBoard'].updateRows(outArr)
 | 
			
		||||
        this.timestr = switchShowTime('日')
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
				let outArr = this.sjgEquipment.map((item, index) => [
 | 
			
		||||
					index + 1,
 | 
			
		||||
					`<span title=${item.lineName || ''}>${item.lineName || ''}</span>`,
 | 
			
		||||
					`<span title=${item.name || ''}>${item.name || ''}</span>`,
 | 
			
		||||
					`<span><div style="${
 | 
			
		||||
						item.status == '运行'
 | 
			
		||||
							? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 '
 | 
			
		||||
							: item.status == '故障'
 | 
			
		||||
							? 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%;  background-color: red;float:left;margin:13px 10px 0 0 '
 | 
			
		||||
							: 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%;  background-color: #FFBD02;float:left;margin:13px 10px 0 0 '
 | 
			
		||||
					}"></div>  ${item.status || ''}</span>`,
 | 
			
		||||
					// `<span"><div style="${
 | 
			
		||||
					// 	item.error == false
 | 
			
		||||
					// 		? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 '
 | 
			
		||||
					// 		: 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%;  background-color: red;float:left;margin:13px 10px 0 0 '
 | 
			
		||||
					// }"></div>  ${item.error == true ? '是' : '否' || ''}</span>`,
 | 
			
		||||
				]);
 | 
			
		||||
				this.config.data = outArr;
 | 
			
		||||
				this.$refs['eqScrollBoard'].updateRows(outArr);
 | 
			
		||||
				this.timestr = switchShowTime('日');
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.timeShow {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 20px;
 | 
			
		||||
  left: 170px;
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	top: 20px;
 | 
			
		||||
	left: 170px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,67 +1,88 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <Container name="工单监控" size="middle" style="">
 | 
			
		||||
    <TimePrompt class="timeShow" :timestr="timestr" />
 | 
			
		||||
    <div style="padding: 5px 10px;" class="WOMonitoring">
 | 
			
		||||
      <dv-scroll-board :config="config" style="width:900px;height:380px" ref='worderScrollBoard'/>
 | 
			
		||||
    </div>
 | 
			
		||||
  </Container>
 | 
			
		||||
	<Container
 | 
			
		||||
		name="工单监控"
 | 
			
		||||
		size="middle"
 | 
			
		||||
		style="">
 | 
			
		||||
		<TimePrompt
 | 
			
		||||
			class="timeShow"
 | 
			
		||||
			:timestr="timestr" />
 | 
			
		||||
		<div
 | 
			
		||||
			style="padding: 5px 10px"
 | 
			
		||||
			class="WOMonitoring">
 | 
			
		||||
			<dv-scroll-board
 | 
			
		||||
				:config="config"
 | 
			
		||||
				style="width: 900px; height: 380px"
 | 
			
		||||
				ref="worderScrollBoard" />
 | 
			
		||||
		</div>
 | 
			
		||||
	</Container>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import Container from '../components/Container.vue';
 | 
			
		||||
import TimePrompt from '../components/TimePrompt';
 | 
			
		||||
import { switchShowTime } from '../utils'
 | 
			
		||||
import { formatDate } from '@/utils'
 | 
			
		||||
import { switchShowTime } from '../utils';
 | 
			
		||||
import { formatDate } from '@/utils';
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'WorkOrderMonitoring',
 | 
			
		||||
  components: { Container, TimePrompt },
 | 
			
		||||
  computed: {
 | 
			
		||||
    order() {
 | 
			
		||||
      return this.$store.state.websocket.workOrder
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      timestr: '',
 | 
			
		||||
      config: {
 | 
			
		||||
        header: ['序号', '工单名称', '规格','产线','工单状态', '计划完成时间','计划产量','实际产量'],
 | 
			
		||||
        headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
        oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
        evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
        columnWidth: [60, 120, 120, 60, 100, 150],
 | 
			
		||||
        align: ['center'],
 | 
			
		||||
        data: [],
 | 
			
		||||
        rowNum:10
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted(){
 | 
			
		||||
    this.timestr = switchShowTime('日')
 | 
			
		||||
  },
 | 
			
		||||
  watch:{
 | 
			
		||||
    order: {
 | 
			
		||||
	name: 'WorkOrderMonitoring',
 | 
			
		||||
	components: { Container, TimePrompt },
 | 
			
		||||
	computed: {
 | 
			
		||||
		order() {
 | 
			
		||||
			return this.$store.state.websocket.workOrder;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			timestr: '',
 | 
			
		||||
			config: {
 | 
			
		||||
				header: [
 | 
			
		||||
					'序号',
 | 
			
		||||
					'工单名称',
 | 
			
		||||
					'规格',
 | 
			
		||||
					'产线',
 | 
			
		||||
					'工单状态',
 | 
			
		||||
					'计划完成时间',
 | 
			
		||||
					'计划产量',
 | 
			
		||||
					'实际产量',
 | 
			
		||||
					'完成进度',
 | 
			
		||||
				],
 | 
			
		||||
				headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
				columnWidth: [60, 120, 120, 60, 100, 150],
 | 
			
		||||
				align: ['center'],
 | 
			
		||||
				data: [],
 | 
			
		||||
				rowNum: 10,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.timestr = switchShowTime('日');
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		order: {
 | 
			
		||||
			handler(newVal, oldVal) {
 | 
			
		||||
        let outArr = this.order.map((item, index) => [
 | 
			
		||||
          index+1,
 | 
			
		||||
          `<span title=${item.name || ''}>${item.name || ''}</span>`,
 | 
			
		||||
          item.specifications,
 | 
			
		||||
          item.lines,
 | 
			
		||||
          this.getDictDatas(this.DICT_TYPE.ORDER_STATUS)[item.status]?.label,
 | 
			
		||||
          formatDate(item.planFinishTime),
 | 
			
		||||
          item.planQuantity,
 | 
			
		||||
          item.planAssignQuantity
 | 
			
		||||
      ]);
 | 
			
		||||
        this.config.data = outArr
 | 
			
		||||
        this.$refs['worderScrollBoard'].updateRows(outArr)
 | 
			
		||||
        this.timestr = switchShowTime('日')
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
				let outArr = this.order.map((item, index) => [
 | 
			
		||||
					index + 1,
 | 
			
		||||
					`<span title=${item.name || ''}>${item.name || ''}</span>`,
 | 
			
		||||
					item.specifications,
 | 
			
		||||
					item.lines,
 | 
			
		||||
					this.getDictDatas(this.DICT_TYPE.ORDER_STATUS)[item.status]?.label,
 | 
			
		||||
					formatDate(item.planFinishTime),
 | 
			
		||||
					item.planQuantity,
 | 
			
		||||
					item.actualQuantity,
 | 
			
		||||
					(item.progressRate * 100).toFixed(0) + '%',
 | 
			
		||||
				]);
 | 
			
		||||
				this.config.data = outArr;
 | 
			
		||||
				this.$refs['worderScrollBoard'].updateRows(outArr);
 | 
			
		||||
				this.timestr = switchShowTime('日');
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.timeShow {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 20px;
 | 
			
		||||
  left: 170px;
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	top: 20px;
 | 
			
		||||
	left: 170px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,24 @@
 | 
			
		||||
<!-- 
 | 
			
		||||
    filename: MaterialCost.vue
 | 
			
		||||
    author: liubin
 | 
			
		||||
    date: 2023-12-06 09:09:27
 | 
			
		||||
    description: 
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
	<Container name="能耗" size="middle" style="">
 | 
			
		||||
		<TimePrompt class="timeShow" :timestr="timestr" />
 | 
			
		||||
	<Container
 | 
			
		||||
		name="能耗"
 | 
			
		||||
		size="middle"
 | 
			
		||||
		style="">
 | 
			
		||||
		<EnergeTop />
 | 
			
		||||
		<SplitLine :horizontal="true" />
 | 
			
		||||
		<div class="" style="flex: 2; padding: 8px">
 | 
			
		||||
		<div
 | 
			
		||||
			class=""
 | 
			
		||||
			style="flex: 2; padding: 8px">
 | 
			
		||||
			<div
 | 
			
		||||
				class="header-line"
 | 
			
		||||
				style="margin: 8px 0 16px; display: flex; align-items: center">
 | 
			
		||||
				<h2 class="" style="margin: 0; color: #0ee8fe; margin-right: 12px">
 | 
			
		||||
				<h2
 | 
			
		||||
					class=""
 | 
			
		||||
					style="margin: 0; color: #0ee8fe; margin-right: 12px">
 | 
			
		||||
					能耗趋势图
 | 
			
		||||
				</h2>
 | 
			
		||||
				<TimePrompt
 | 
			
		||||
					class="timeShow"
 | 
			
		||||
					:timestr="timestr" />
 | 
			
		||||
				<!-- <Switcher /> -->
 | 
			
		||||
				<div>
 | 
			
		||||
					<!-- <span class="lgd lgd-total">总量</span> -->
 | 
			
		||||
@@ -32,11 +34,21 @@
 | 
			
		||||
					justify-content: space-between;
 | 
			
		||||
				">
 | 
			
		||||
				<SelectorBtnGroup
 | 
			
		||||
					:options="['电耗能', '天然气I', '天然气II']" @emitFun='toggleType' :active='chartType'/>
 | 
			
		||||
				<SelectorBtnGroup :options="['周', '月', '年']" @emitFun='toggleDate' :active='chartTime'/>
 | 
			
		||||
					:options="['电耗能', '天然气I', '天然气II']"
 | 
			
		||||
					@emitFun="toggleType"
 | 
			
		||||
					:active="chartType" />
 | 
			
		||||
				<SelectorBtnGroup
 | 
			
		||||
					:options="['周', '月', '年']"
 | 
			
		||||
					@emitFun="toggleDate"
 | 
			
		||||
					:active="chartTime" />
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="chart" style="height: 200px; margin-top: 8px;">
 | 
			
		||||
				<GasChart :chartType='chartType' :chartTime='chartTime' @emitFun='dateUpdate'/>
 | 
			
		||||
			<div
 | 
			
		||||
				class="chart"
 | 
			
		||||
				style="height: 200px; margin-top: 8px">
 | 
			
		||||
				<GasChart
 | 
			
		||||
					:chartType="chartType"
 | 
			
		||||
					:chartTime="chartTime"
 | 
			
		||||
					@emitFun="dateUpdate" />
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
	</Container>
 | 
			
		||||
@@ -51,7 +63,7 @@ import EnergeTop from './EnergeTop';
 | 
			
		||||
import GasChart from '../components/GasChart.vue';
 | 
			
		||||
import SelectorBtnGroup from '../components/SelectorBtnGroup';
 | 
			
		||||
import TimePrompt from '../components/TimePrompt';
 | 
			
		||||
import { switchShowTime } from '../utils'
 | 
			
		||||
import { switchShowTime } from '../utils';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'EnergeCost',
 | 
			
		||||
	components: {
 | 
			
		||||
@@ -61,48 +73,43 @@ export default {
 | 
			
		||||
		EnergeTop,
 | 
			
		||||
		GasChart,
 | 
			
		||||
		SelectorBtnGroup,
 | 
			
		||||
		TimePrompt
 | 
			
		||||
		TimePrompt,
 | 
			
		||||
	},
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			chartType:'电耗能',
 | 
			
		||||
			chartTime:'周',
 | 
			
		||||
			timestr: ''
 | 
			
		||||
			chartType: '电耗能',
 | 
			
		||||
			chartTime: '周',
 | 
			
		||||
			timestr: '',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
    this.timestr = switchShowTime(this.chartTime)
 | 
			
		||||
  },
 | 
			
		||||
		this.timestr = switchShowTime(this.chartTime);
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		gasInfoMsg() {
 | 
			
		||||
			return this.$store.state.websocket.gasInfo
 | 
			
		||||
			return this.$store.state.websocket.gasInfo;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 切换能源
 | 
			
		||||
		toggleType(val) {
 | 
			
		||||
			this.chartType = val
 | 
			
		||||
			this.chartType = val;
 | 
			
		||||
		},
 | 
			
		||||
		// 切换时间
 | 
			
		||||
		toggleDate(val) {
 | 
			
		||||
			this.chartTime = val
 | 
			
		||||
			this.timestr = switchShowTime(val)
 | 
			
		||||
			this.chartTime = val;
 | 
			
		||||
			this.timestr = switchShowTime(val);
 | 
			
		||||
		},
 | 
			
		||||
		// 数据更新
 | 
			
		||||
    dateUpdate() {
 | 
			
		||||
      this.timestr = switchShowTime(this.chartTime)
 | 
			
		||||
    }
 | 
			
		||||
		dateUpdate() {
 | 
			
		||||
			this.timestr = switchShowTime(this.chartTime);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.timeShow {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 20px;
 | 
			
		||||
  left: 120px;
 | 
			
		||||
}
 | 
			
		||||
.lgd {
 | 
			
		||||
	color: #fff;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,11 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="gas-handle" style="flex: 2">
 | 
			
		||||
		<Container name="烟气处理" size="large" style="">
 | 
			
		||||
			<TimePrompt class="timeShow" :timestr="timestr" />
 | 
			
		||||
	<div
 | 
			
		||||
		class="gas-handle"
 | 
			
		||||
		style="flex: 2">
 | 
			
		||||
		<Container
 | 
			
		||||
			name="烟气处理"
 | 
			
		||||
			size="large"
 | 
			
		||||
			style="">
 | 
			
		||||
			<div
 | 
			
		||||
				class=""
 | 
			
		||||
				style="
 | 
			
		||||
@@ -24,7 +28,13 @@
 | 
			
		||||
						">
 | 
			
		||||
						氧气含量
 | 
			
		||||
					</span>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.O2_float ? (Number(exhaustGasInfo.O2_float)).toFixed(2) : ''}}%</span>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1">
 | 
			
		||||
						{{
 | 
			
		||||
							exhaustGasInfo?.O2_float
 | 
			
		||||
								? Number(exhaustGasInfo.O2_float).toFixed(2)
 | 
			
		||||
								: ''
 | 
			
		||||
						}}%
 | 
			
		||||
					</span>
 | 
			
		||||
				</ShadowRect>
 | 
			
		||||
				<ShadowRect>
 | 
			
		||||
					<div
 | 
			
		||||
@@ -33,13 +43,19 @@
 | 
			
		||||
							line-height: 1.24;
 | 
			
		||||
							flex: 1;
 | 
			
		||||
							text-align: right;
 | 
			
		||||
							padding:5px 8px 5px 0;
 | 
			
		||||
							padding: 5px 8px 5px 0;
 | 
			
		||||
							letter-spacing: 3px;
 | 
			
		||||
						">
 | 
			
		||||
						<p style="margin: 0; line-height: inherit">氮氧化物</p>
 | 
			
		||||
						<p style="margin: 0; line-height: inherit">排放浓度</p>
 | 
			
		||||
					</div>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1.2">{{exhaustGasInfo?.NOX_float ? (Number(exhaustGasInfo.NOX_float)).toFixed(2) : ''}}mg/m³</span>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1.2">
 | 
			
		||||
						{{
 | 
			
		||||
							exhaustGasInfo?.NOX_float
 | 
			
		||||
								? Number(exhaustGasInfo.NOX_float).toFixed(2)
 | 
			
		||||
								: ''
 | 
			
		||||
						}}mg/m³
 | 
			
		||||
					</span>
 | 
			
		||||
				</ShadowRect>
 | 
			
		||||
 | 
			
		||||
				<ShadowRect>
 | 
			
		||||
@@ -49,16 +65,22 @@
 | 
			
		||||
							line-height: 1.24;
 | 
			
		||||
							flex: 1;
 | 
			
		||||
							text-align: right;
 | 
			
		||||
							padding:5px 8px 5px 0;
 | 
			
		||||
							padding: 5px 8px 5px 0;
 | 
			
		||||
							letter-spacing: 3px;
 | 
			
		||||
						">
 | 
			
		||||
						<p style="margin: 0; line-height: inherit">二氧化硫</p>
 | 
			
		||||
						<p style="margin: 0; line-height: inherit">排放浓度</p>
 | 
			
		||||
					</div>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.SO2_float ? (Number(exhaustGasInfo.SO2_float)).toFixed(2) : ''}}mg/m³</span>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1">
 | 
			
		||||
						{{
 | 
			
		||||
							exhaustGasInfo?.SO2_float
 | 
			
		||||
								? Number(exhaustGasInfo.SO2_float).toFixed(2)
 | 
			
		||||
								: ''
 | 
			
		||||
						}}mg/m³
 | 
			
		||||
					</span>
 | 
			
		||||
				</ShadowRect>
 | 
			
		||||
 | 
			
		||||
				<ShadowRect>
 | 
			
		||||
				<!-- <ShadowRect>
 | 
			
		||||
					<span
 | 
			
		||||
						style="
 | 
			
		||||
							font-size: 20px;
 | 
			
		||||
@@ -70,17 +92,30 @@
 | 
			
		||||
						">
 | 
			
		||||
						颗粒物浓度
 | 
			
		||||
					</span>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1.2">{{exhaustGasInfo?.dust_float ? (Number(exhaustGasInfo.dust_float)).toFixed(2) : ''}}mg/m³</span>
 | 
			
		||||
				</ShadowRect>
 | 
			
		||||
					<span style="font-size: 20px; line-height: 1.24; flex: 1.2">
 | 
			
		||||
						{{
 | 
			
		||||
							exhaustGasInfo?.dust_float
 | 
			
		||||
								? Number(exhaustGasInfo.dust_float).toFixed(2)
 | 
			
		||||
								: ''
 | 
			
		||||
						}}mg/m³
 | 
			
		||||
					</span>
 | 
			
		||||
				</ShadowRect> -->
 | 
			
		||||
			</div>
 | 
			
		||||
			<KilnLine :horizontal="true" />
 | 
			
		||||
			<div class="" style="flex: 2; padding: 8px">
 | 
			
		||||
			<div
 | 
			
		||||
				class=""
 | 
			
		||||
				style="flex: 2; padding: 8px">
 | 
			
		||||
				<div
 | 
			
		||||
					class="header-line"
 | 
			
		||||
					style="margin-bottom: 10px; display: flex; align-items: center">
 | 
			
		||||
					<h2 class="" style="margin: 5px 0; color: #0ee8fe; margin-right: 12px">
 | 
			
		||||
					<h2
 | 
			
		||||
						class=""
 | 
			
		||||
						style="margin: 5px 0; color: #0ee8fe; margin-right: 12px">
 | 
			
		||||
						烟气趋势图
 | 
			
		||||
					</h2>
 | 
			
		||||
					<TimePrompt
 | 
			
		||||
						class="timeShow"
 | 
			
		||||
						:timestr="timestr" />
 | 
			
		||||
					<!-- <Switcher /> -->
 | 
			
		||||
					<div>
 | 
			
		||||
						<!-- <span class="lgd lgd-total">总量</span> -->
 | 
			
		||||
@@ -95,12 +130,23 @@
 | 
			
		||||
						align-items: center;
 | 
			
		||||
						justify-content: space-between;
 | 
			
		||||
					">
 | 
			
		||||
					<!-- :options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']" -->
 | 
			
		||||
					<SelectorBtnGroup
 | 
			
		||||
						:options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']" @emitFun='toggleType' :active='chartType'/>
 | 
			
		||||
					<SelectorBtnGroup :options="['日', '周', '月', '年']" @emitFun='toggleDate' :active='chartTime' />
 | 
			
		||||
						:options="['氧气含量', '二氧化硫', '氮氧化物']"
 | 
			
		||||
						@emitFun="toggleType"
 | 
			
		||||
						:active="chartType" />
 | 
			
		||||
					<SelectorBtnGroup
 | 
			
		||||
						:options="['日', '周', '月', '年']"
 | 
			
		||||
						@emitFun="toggleDate"
 | 
			
		||||
						:active="chartTime" />
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="chart" style="height: 250px;margin-top: 10px;">
 | 
			
		||||
					<FlueGasChart :chartType='chartType' :chartTime='chartTime' @emitFun='dateUpdate'/>
 | 
			
		||||
				<div
 | 
			
		||||
					class="chart"
 | 
			
		||||
					style="height: 250px; margin-top: 10px">
 | 
			
		||||
					<FlueGasChart
 | 
			
		||||
						:chartType="chartType"
 | 
			
		||||
						:chartTime="chartTime"
 | 
			
		||||
						@emitFun="dateUpdate" />
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</Container>
 | 
			
		||||
@@ -115,7 +161,7 @@ import KilnLine from '../components/line';
 | 
			
		||||
import SelectorBtnGroup from '../components/SelectorBtnGroup';
 | 
			
		||||
import FlueGasChart from '../components/FlueGasChart';
 | 
			
		||||
import TimePrompt from '../components/TimePrompt';
 | 
			
		||||
import { switchShowTime } from '../utils'
 | 
			
		||||
import { switchShowTime } from '../utils';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'GasHandle',
 | 
			
		||||
@@ -125,49 +171,44 @@ export default {
 | 
			
		||||
		KilnLine,
 | 
			
		||||
		SelectorBtnGroup,
 | 
			
		||||
		FlueGasChart,
 | 
			
		||||
		TimePrompt
 | 
			
		||||
		TimePrompt,
 | 
			
		||||
	},
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			chartType:'氧气含量',
 | 
			
		||||
			chartTime:'日',
 | 
			
		||||
			timestr: ''
 | 
			
		||||
			chartType: '氧气含量',
 | 
			
		||||
			chartTime: '日',
 | 
			
		||||
			timestr: '',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		exhaustGasInfo() {
 | 
			
		||||
			return this.$store.state.websocket.exhaustGasInfo
 | 
			
		||||
		}
 | 
			
		||||
			return this.$store.state.websocket.exhaustGasInfo;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
    this.timestr = switchShowTime(this.chartTime)
 | 
			
		||||
  },
 | 
			
		||||
		this.timestr = switchShowTime(this.chartTime);
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 烟气
 | 
			
		||||
		toggleType(val) {
 | 
			
		||||
			console.log('烟气' + val)
 | 
			
		||||
			this.chartType = val
 | 
			
		||||
			console.log('烟气' + val);
 | 
			
		||||
			this.chartType = val;
 | 
			
		||||
		},
 | 
			
		||||
		// 切换时间
 | 
			
		||||
		toggleDate(val) {
 | 
			
		||||
			this.chartTime = val
 | 
			
		||||
			this.timestr = switchShowTime(val)
 | 
			
		||||
			this.chartTime = val;
 | 
			
		||||
			this.timestr = switchShowTime(val);
 | 
			
		||||
		},
 | 
			
		||||
		// 数据更新
 | 
			
		||||
    dateUpdate() {
 | 
			
		||||
      this.timestr = switchShowTime(this.chartTime)
 | 
			
		||||
    }
 | 
			
		||||
		dateUpdate() {
 | 
			
		||||
			this.timestr = switchShowTime(this.chartTime);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.timeShow {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 20px;
 | 
			
		||||
  left: 170px;
 | 
			
		||||
}
 | 
			
		||||
.gas-handle {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,9 @@
 | 
			
		||||
		name="原料用量统计"
 | 
			
		||||
		size="middle"
 | 
			
		||||
		style="">
 | 
			
		||||
		<TimePrompt
 | 
			
		||||
			class="timeShow"
 | 
			
		||||
			:timestr="timestr" />
 | 
			
		||||
		<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
 | 
			
		||||
			<div
 | 
			
		||||
				class="absolute"
 | 
			
		||||
@@ -10,8 +13,8 @@
 | 
			
		||||
					flex: 2;
 | 
			
		||||
					padding: 12px 12px 0 12px;
 | 
			
		||||
					display: grid;
 | 
			
		||||
					grid-template-columns: repeat(2, 1fr);
 | 
			
		||||
					grid-auto-rows: repeat(4, 1fr);
 | 
			
		||||
					grid-template-columns: repeat(3, 1fr);
 | 
			
		||||
					grid-auto-rows: repeat(3, 1fr);
 | 
			
		||||
					gap: 8px;
 | 
			
		||||
				">
 | 
			
		||||
				<ShadowRect
 | 
			
		||||
@@ -22,7 +25,8 @@
 | 
			
		||||
						class="material"
 | 
			
		||||
						style="
 | 
			
		||||
							flex: 1;
 | 
			
		||||
							padding-bottom: 3px;
 | 
			
		||||
							padding-bottom: 18px;
 | 
			
		||||
							padding-top: 18px;
 | 
			
		||||
							display: flex;
 | 
			
		||||
							flex-direction: column;
 | 
			
		||||
							gap: 4px;
 | 
			
		||||
@@ -53,20 +57,33 @@
 | 
			
		||||
<script>
 | 
			
		||||
import Container from '../components/Container';
 | 
			
		||||
import ShadowRect from '../components/ShadowRect.vue';
 | 
			
		||||
import TimePrompt from '../components/TimePrompt';
 | 
			
		||||
import { switchShowTime } from '../utils';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'MaterialCost',
 | 
			
		||||
	components: { Container, ShadowRect },
 | 
			
		||||
	components: { Container, ShadowRect, TimePrompt },
 | 
			
		||||
	props: {},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {};
 | 
			
		||||
		return {
 | 
			
		||||
			timestr: '',
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	computed: {
 | 
			
		||||
		materialMsg() {
 | 
			
		||||
			return this.$store.state.websocket.material;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.timestr = switchShowTime('日');
 | 
			
		||||
	},
 | 
			
		||||
	methods: {},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss"></style>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.timeShow {
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	top: 20px;
 | 
			
		||||
	left: 210px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -29,6 +29,8 @@ export const switchShowTime = (type) => {
 | 
			
		||||
      }
 | 
			
		||||
      if (lastMonth === 12) {
 | 
			
		||||
        startYear = currentYear - 1
 | 
			
		||||
      }else{
 | 
			
		||||
        startYear = currentYear
 | 
			
		||||
      }
 | 
			
		||||
      startTime = startYear+'.'+lastMonth+'.'+day
 | 
			
		||||
      endTime = currentYear+'.'+(nowTime.getMonth()+1)+'.28'
 | 
			
		||||
 
 | 
			
		||||
@@ -1,70 +1,94 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div style="flex: 1;" class="orderContainer">
 | 
			
		||||
    <Container name="订单完成情况" size="small" style="">
 | 
			
		||||
      <TimePrompt class="timeShow" :timestr="timestr" />
 | 
			
		||||
      <div style="padding: 5px 10px;">
 | 
			
		||||
        <dv-scroll-board :config="config" style="width:575px;height:230px" ref='orderScrollBoard'/>
 | 
			
		||||
      </div>
 | 
			
		||||
    </Container>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div
 | 
			
		||||
		style="flex: 1"
 | 
			
		||||
		class="orderContainer">
 | 
			
		||||
		<Container
 | 
			
		||||
			name="订单完成情况"
 | 
			
		||||
			size="small"
 | 
			
		||||
			style="">
 | 
			
		||||
			<TimePrompt
 | 
			
		||||
				class="timeShow"
 | 
			
		||||
				:timestr="timestr" />
 | 
			
		||||
			<div style="padding: 5px 10px">
 | 
			
		||||
				<dv-scroll-board
 | 
			
		||||
					:config="config"
 | 
			
		||||
					style="width: 575px; height: 230px"
 | 
			
		||||
					ref="orderScrollBoard" />
 | 
			
		||||
			</div>
 | 
			
		||||
		</Container>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import Container from '../components/Container'
 | 
			
		||||
import Container from '../components/Container';
 | 
			
		||||
import TimePrompt from '../components/TimePrompt';
 | 
			
		||||
import { formatDate } from '@/utils'
 | 
			
		||||
import { switchShowTime } from '../utils'
 | 
			
		||||
import { formatDate } from '@/utils';
 | 
			
		||||
import { switchShowTime } from '../utils';
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderStatus',
 | 
			
		||||
  components: { Container, TimePrompt },
 | 
			
		||||
  computed: {
 | 
			
		||||
    order() {
 | 
			
		||||
      return this.$store.state.websocket.order
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      timestr: '',
 | 
			
		||||
      config: {
 | 
			
		||||
        header: ['上线时间', '客户名称', '规格','完成度'],
 | 
			
		||||
        headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
        oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
        evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
        columnWidth: [155, 160, 150],
 | 
			
		||||
        data: [],
 | 
			
		||||
        rowNum: 6
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.timestr = switchShowTime('日')
 | 
			
		||||
  },
 | 
			
		||||
  watch:{
 | 
			
		||||
    order:{
 | 
			
		||||
      handler() {
 | 
			
		||||
        let outArr = this.order.map((item) => [
 | 
			
		||||
        formatDate(item.planStartTime) || '',
 | 
			
		||||
          `<span title=${item.customerName || ''}>${item.customerName || ''}</span>`,
 | 
			
		||||
          `<span title=${item.specifications || ''}>${item.specifications || ''}</span>`,
 | 
			
		||||
          `<span style="display:inline-block;width:60px;">${item.completeRate?(item.completeRate*100).toFixed(2)+'%':'0%'}</span>
 | 
			
		||||
	name: 'OrderStatus',
 | 
			
		||||
	components: { Container, TimePrompt },
 | 
			
		||||
	computed: {
 | 
			
		||||
		order() {
 | 
			
		||||
			return this.$store.state.websocket.order;
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			timestr: '',
 | 
			
		||||
			config: {
 | 
			
		||||
				header: ['上线时间', '客户名称', '规格', '完成度'],
 | 
			
		||||
				headerBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				oddRowBGC: 'rgba(32, 55, 96, 0.8)',
 | 
			
		||||
				evenRowBGC: 'rgba(14, 32, 62, 0.8)',
 | 
			
		||||
				columnWidth: [155, 160, 150],
 | 
			
		||||
				data: [],
 | 
			
		||||
				rowNum: 6,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.timestr = switchShowTime('日');
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		order: {
 | 
			
		||||
			handler() {
 | 
			
		||||
				let outArr = this.order.map((item) => [
 | 
			
		||||
					formatDate(item.planStartTime) || '',
 | 
			
		||||
					`<span title=${item.customerName || ''}>${
 | 
			
		||||
						item.customerName || ''
 | 
			
		||||
					}</span>`,
 | 
			
		||||
					`<span title=${item.specifications || ''}>${
 | 
			
		||||
						item.specifications || ''
 | 
			
		||||
					}</span>`,
 | 
			
		||||
					`<span style="display:inline-block;width:60px;">${
 | 
			
		||||
						item.completeRate
 | 
			
		||||
							? (item.completeRate * 100).toFixed(2) + '%'
 | 
			
		||||
							: '0%'
 | 
			
		||||
					}</span>
 | 
			
		||||
          <div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;">
 | 
			
		||||
            <svg xmlns="http://www.w3.org/200/svg" height="20" width="20">
 | 
			
		||||
              <circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/>
 | 
			
		||||
              <circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${item.completeRate?item.completeRate.toFixed(2)*37.68+','+((1-item.completeRate.toFixed(2))*37.68):(0+','+37.68)}"/>
 | 
			
		||||
              <circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${
 | 
			
		||||
								item.completeRate
 | 
			
		||||
									? item.completeRate.toFixed(2) * 37.68 +
 | 
			
		||||
									  ',' +
 | 
			
		||||
									  (1 - item.completeRate.toFixed(2)) * 37.68
 | 
			
		||||
									: 0 + ',' + 37.68
 | 
			
		||||
							}"/>
 | 
			
		||||
            </svg>
 | 
			
		||||
          </div>`
 | 
			
		||||
      ]);
 | 
			
		||||
      this.config.data = outArr
 | 
			
		||||
      this.$refs['orderScrollBoard'].updateRows(outArr)
 | 
			
		||||
      this.timestr = switchShowTime('日')
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
          </div>`,
 | 
			
		||||
				]);
 | 
			
		||||
				this.config.data = outArr;
 | 
			
		||||
				this.$refs['orderScrollBoard'].updateRows(outArr);
 | 
			
		||||
				this.timestr = switchShowTime('日');
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss' scoped>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.timeShow {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  top: 20px;
 | 
			
		||||
  left: 210px;
 | 
			
		||||
	position: absolute;
 | 
			
		||||
	top: 20px;
 | 
			
		||||
	left: 210px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2024-03-25 15:44:49
 | 
			
		||||
 * @LastEditTime: 2024-04-22 15:04:40
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -165,7 +165,7 @@ import SmallTitle from './SmallTitle';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import attrAdd from './attr-add';
 | 
			
		||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
 | 
			
		||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
 | 
			
		||||
import { getDepartmentList } from "@/api/base/coreDepartment";
 | 
			
		||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
 | 
			
		||||
import { getDictDataLabel } from '@/utils/dict';
 | 
			
		||||
 | 
			
		||||
@@ -289,7 +289,7 @@ export default {
 | 
			
		||||
				return item
 | 
			
		||||
			}) || [];
 | 
			
		||||
			// 部门列表
 | 
			
		||||
			const res1 = await getCoreDepartmentList();
 | 
			
		||||
			const res1 = await getDepartmentList();
 | 
			
		||||
			this.departmentOptions = res1.data || []
 | 
			
		||||
			// 巡检人
 | 
			
		||||
			let inspectorList = [];
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2024-03-15 18:38:52
 | 
			
		||||
 * @LastEditTime: 2024-04-22 14:56:03
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -99,7 +99,7 @@ import {
 | 
			
		||||
	createCheckOrder,
 | 
			
		||||
	updateCheckOrder,
 | 
			
		||||
} from '@/api/equipment/base/inspection/settings';
 | 
			
		||||
import { getCoreDepartmentList } from '@/api/base/coreDepartment';
 | 
			
		||||
import { getDepartmentList } from '@/api/base/coreDepartment';
 | 
			
		||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
 | 
			
		||||
import { getDictDataLabel } from '@/utils/dict';
 | 
			
		||||
// import { getEquipmentAll } from '@/api/base/equipment'
 | 
			
		||||
@@ -195,7 +195,7 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 部门列表
 | 
			
		||||
			const res = await getCoreDepartmentList();
 | 
			
		||||
			const res = await getDepartmentList();
 | 
			
		||||
			this.departmentOptions = res.data || [];
 | 
			
		||||
			const res1 = await groupClassesListAll();
 | 
			
		||||
			this.groupOptions =
 | 
			
		||||
 
 | 
			
		||||
@@ -320,7 +320,7 @@ export default {
 | 
			
		||||
		async getList(source = 'department') {
 | 
			
		||||
			const urls = [
 | 
			
		||||
				'/base/core-production-line/listAll',
 | 
			
		||||
				'/base/core-department/listAll',
 | 
			
		||||
				'/system/dept/list-all-simple',
 | 
			
		||||
				'/base/core-worker/listAll',
 | 
			
		||||
			];
 | 
			
		||||
			let res;
 | 
			
		||||
 
 | 
			
		||||
@@ -540,7 +540,7 @@ export default {
 | 
			
		||||
		async getList(source = 'department') {
 | 
			
		||||
			const urls = [
 | 
			
		||||
				'/base/core-production-line/listAll',
 | 
			
		||||
				'/base/core-department/listAll',
 | 
			
		||||
				'system/dept/list-all-simple',
 | 
			
		||||
				'/base/core-worker/listAll',
 | 
			
		||||
			];
 | 
			
		||||
			let res;
 | 
			
		||||
 
 | 
			
		||||
@@ -609,7 +609,7 @@ export default {
 | 
			
		||||
		async getList(source = 'department') {
 | 
			
		||||
			const urls = [
 | 
			
		||||
				'/base/core-production-line/listAll',
 | 
			
		||||
				'/base/core-department/listAll',
 | 
			
		||||
				'/system/dept/list-all-simple',
 | 
			
		||||
				'/base/core-worker/listAll',
 | 
			
		||||
			];
 | 
			
		||||
			let res;
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2021-11-18 14:16:25
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2024-03-13 15:55:36
 | 
			
		||||
 * @LastEditTime: 2024-04-19 17:13:45
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
@@ -114,7 +114,7 @@
 | 
			
		||||
import basicAdd from '../../../../core/mixins/basic-add';
 | 
			
		||||
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
 | 
			
		||||
import { getWorkerList } from '@/api/base/worker'
 | 
			
		||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
 | 
			
		||||
import { getDepartmentList } from "@/api/base/coreDepartment";
 | 
			
		||||
import { createPlan, updatePlan, getCode, getPlan } from '@/api/equipment/base/maintain/planconfig';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
import { parseTime } from '../../../../core/mixins/code-filter';
 | 
			
		||||
@@ -175,7 +175,7 @@ export default {
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 部门列表
 | 
			
		||||
			this.menuOptions = []
 | 
			
		||||
			const res = await getCoreDepartmentList();
 | 
			
		||||
			const res = await getDepartmentList();
 | 
			
		||||
			this.departmentlList = res.data.map(item => {
 | 
			
		||||
				item.parentId = item.parentId ? item.parentId : 0
 | 
			
		||||
				return item
 | 
			
		||||
 
 | 
			
		||||
@@ -376,7 +376,7 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.orderMonitoring {
 | 
			
		||||
	.el-tabs__nav::after {
 | 
			
		||||
		content: '';
 | 
			
		||||
@@ -431,4 +431,4 @@ export default {
 | 
			
		||||
		vertical-align: bottom;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,14 @@
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="24">
 | 
			
		||||
        <el-form-item label="重置方式" prop="resetMethod" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
 | 
			
		||||
          <el-radio-group v-model="dataForm.resetMethod">
 | 
			
		||||
            <el-radio :label="0">自动</el-radio>
 | 
			
		||||
            <el-radio :label="1">手动</el-radio>
 | 
			
		||||
          </el-radio-group>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <el-col :span="24">
 | 
			
		||||
        <el-form-item label="检测内容" prop="inspectionDetIdList"
 | 
			
		||||
          :rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
 | 
			
		||||
@@ -109,6 +117,7 @@ export default {
 | 
			
		||||
        sectionId: null,
 | 
			
		||||
        productionLineId: null,
 | 
			
		||||
        inspectionDetIdList:[],
 | 
			
		||||
        resetMethod: 0
 | 
			
		||||
      },
 | 
			
		||||
      disabled:false,
 | 
			
		||||
			formLoading: true,
 | 
			
		||||
@@ -143,7 +152,7 @@ export default {
 | 
			
		||||
  methods: {
 | 
			
		||||
    init(obj) {
 | 
			
		||||
      // console.log(productionLineId);
 | 
			
		||||
      console.log(obj)
 | 
			
		||||
      console.log('你好打印', obj)
 | 
			
		||||
      this.getProductionLineList()
 | 
			
		||||
      this.getQualityInspectionDetList()
 | 
			
		||||
      this.visible = true
 | 
			
		||||
@@ -162,6 +171,7 @@ export default {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            this.dataForm.inspectionDetIdList = res.data
 | 
			
		||||
            this.dataForm.productionLineId = obj.productionLineId
 | 
			
		||||
            this.dataForm.resetMethod = obj.resetMethod
 | 
			
		||||
            this.getWorksectionList(obj.productionLineId)
 | 
			
		||||
            this.dataForm.sectionId = obj.sectionId
 | 
			
		||||
          })
 | 
			
		||||
 
 | 
			
		||||
@@ -151,7 +151,8 @@ export default {
 | 
			
		||||
            productionLineId:item.productionLineId,
 | 
			
		||||
            productionLineName:item.productionLineName,
 | 
			
		||||
            sectionId: item.sectionId,
 | 
			
		||||
            sectionName: item.sectionName
 | 
			
		||||
            sectionName: item.sectionName,
 | 
			
		||||
            resetMethod: item.resetMethod
 | 
			
		||||
         }
 | 
			
		||||
        })
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
 
 | 
			
		||||
@@ -86,16 +86,19 @@ import moment from 'moment';
 | 
			
		||||
// import DialogForm from './dialogForm.vue';
 | 
			
		||||
import * as echarts from 'echarts';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
 | 
			
		||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'statisticalData',
 | 
			
		||||
  name: 'QualityIsra',
 | 
			
		||||
	// components: {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
  mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      isFold: false,
 | 
			
		||||
      list: [],
 | 
			
		||||
      dynamicProps: [],
 | 
			
		||||
      activeName: 'day',
 | 
			
		||||
@@ -106,6 +109,16 @@ export default {
 | 
			
		||||
      weekListUrl: '/base/quality-isra-statistics/weekList',
 | 
			
		||||
      monthListUrl: '/base/quality-isra-statistics/monthList',
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '是否报废',
 | 
			
		||||
          placeholder: '请选择是否报废',
 | 
			
		||||
          param: 'checkDiscard',
 | 
			
		||||
          selectOptions: [
 | 
			
		||||
            { name: '否', id: 0 },
 | 
			
		||||
						{ name: '是', id: 1 }
 | 
			
		||||
          ],
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '缺陷类型',
 | 
			
		||||
@@ -114,6 +127,17 @@ export default {
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'name',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '产线',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'name',
 | 
			
		||||
          param: 'lineName',
 | 
			
		||||
          filterable: true,
 | 
			
		||||
          defaultSelect: []
 | 
			
		||||
        },
 | 
			
		||||
				{
 | 
			
		||||
@@ -139,8 +163,9 @@ export default {
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
        checkDiscard: undefined,
 | 
			
		||||
        checkType:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        lineName: undefined,
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
@@ -149,6 +174,7 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
	created() {
 | 
			
		||||
		// this.getProductLineList();
 | 
			
		||||
    // this.isFold = this.searchBarWidth('QualityIsraBox', 1198);
 | 
			
		||||
  },
 | 
			
		||||
  computed: {
 | 
			
		||||
    tableProps() {
 | 
			
		||||
@@ -168,29 +194,19 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // if (this.$route.query.woIdString) {
 | 
			
		||||
    //   console.log(this.$route.query.woIdString)
 | 
			
		||||
    //   this.queryParams.workOrderIdList = this.$route.query.woIdString.split(',')
 | 
			
		||||
    //   // this.queryParams.workOrderIdList = [this.$route.query.woIdString]
 | 
			
		||||
    //   // let arr =[]
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',')
 | 
			
		||||
    //   console.log(this.searchBarFormConfig[0].defaultSelect);
 | 
			
		||||
    // }
 | 
			
		||||
    // if (this.$route.params.startTime && this.$route.params.endTime) {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [
 | 
			
		||||
    //     this.$route.params.startTime,
 | 
			
		||||
    //     this.$route.params.endTime,
 | 
			
		||||
    //   ];
 | 
			
		||||
    //   this.queryParams.param = {};
 | 
			
		||||
    //   this.$set(
 | 
			
		||||
    //     this.queryParams.param,
 | 
			
		||||
    //     'startTime',
 | 
			
		||||
    //     this.$route.params.startTime
 | 
			
		||||
    //   );
 | 
			
		||||
    //   this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
 | 
			
		||||
    // } else {
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = [];
 | 
			
		||||
    // }
 | 
			
		||||
    if (this.$route.query.lineName) {
 | 
			
		||||
      // console.log('打印看看产线', this.$route.query.lineName)
 | 
			
		||||
      this.queryParams.lineName = this.$route.query.lineName
 | 
			
		||||
      this.searchBarFormConfig[2].defaultSelect = this.$route.query.lineName
 | 
			
		||||
    }
 | 
			
		||||
    if (this.$route.query.startTime && this.$route.query.endTime) {
 | 
			
		||||
      this.queryParams.startTime = parseTime(new Date(Number(this.$route.query.startTime)))
 | 
			
		||||
      this.queryParams.endTime = parseTime(new Date(Number(this.$route.query.endTime)))
 | 
			
		||||
      this.searchBarFormConfig[3].defaultSelect = [
 | 
			
		||||
        this.queryParams.startTime,
 | 
			
		||||
        this.queryParams.endTime,
 | 
			
		||||
      ];
 | 
			
		||||
    }
 | 
			
		||||
    this.getList()
 | 
			
		||||
    this.getData()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
@@ -393,8 +409,12 @@ export default {
 | 
			
		||||
          pageNo:1
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      this.searchBarFormConfig[0].selectOptions = res.data.list
 | 
			
		||||
      // console.log(res)
 | 
			
		||||
      this.searchBarFormConfig[1].selectOptions = res.data.list
 | 
			
		||||
      await getCorePLList().then((res) => {
 | 
			
		||||
				// console.log(res);
 | 
			
		||||
				this.searchBarFormConfig[2].selectOptions = res.data;
 | 
			
		||||
			})
 | 
			
		||||
      // this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
 | 
			
		||||
      //   return {
 | 
			
		||||
      //     name: item.name,
 | 
			
		||||
@@ -425,7 +445,7 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      console.log(this.queryParams);
 | 
			
		||||
      console.log('查询条件', this.queryParams);
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
			// 执行查询
 | 
			
		||||
      const {
 | 
			
		||||
@@ -467,7 +487,10 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
    handleSearchBarBtnClick(val) {
 | 
			
		||||
      console.log('11111', val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.checkDiscard = (val?.checkDiscard === 0 || val?.checkDiscard === 1) ? val?.checkDiscard : undefined
 | 
			
		||||
        this.queryParams.lineName = val.lineName ? val.lineName : undefined
 | 
			
		||||
        this.queryParams.checkType = val.checkType ? val.checkType : undefined
 | 
			
		||||
        // this.queryParams.productionId = val.productionId ? val.productionId : undefined
 | 
			
		||||
        this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-11-06 15:15:30
 | 
			
		||||
 * @LastEditTime: 2024-04-09 15:14:08
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-28 17:10:02
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
 | 
			
		||||
  <!-- <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
 | 
			
		||||
    <el-row :gutter="20">
 | 
			
		||||
      <el-col :span="8">
 | 
			
		||||
        <el-form-item label="工单号" prop="workOrderId">
 | 
			
		||||
@@ -60,7 +60,7 @@
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-col :span="8">
 | 
			
		||||
      <el-form-item label="来源" prop="source">
 | 
			
		||||
        <el-select v-model="dataForm.source" placeholder="请选择来源" multiple>
 | 
			
		||||
        <el-select v-model="dataForm.source" placeholder="请选择来源">
 | 
			
		||||
          <el-option v-for="dict in sourceList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
@@ -70,15 +70,145 @@
 | 
			
		||||
        <el-input v-model="dataForm.remark" placeholder="备注" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-col>
 | 
			
		||||
  </el-form>
 | 
			
		||||
  </el-form> -->
 | 
			
		||||
	<el-form
 | 
			
		||||
		:model="dataForm"
 | 
			
		||||
		:rules="dataRule"
 | 
			
		||||
		ref="dataForm"
 | 
			
		||||
		@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
		label-width="auto">
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="工单号"
 | 
			
		||||
					prop="workOrderId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						filterable
 | 
			
		||||
						v-model="dataForm.workOrderId"
 | 
			
		||||
						placeholder="请选择工单号"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in workOrderList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
							:label="dict.name"
 | 
			
		||||
							:value="dict.id" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="数量"
 | 
			
		||||
					prop="num"
 | 
			
		||||
					style="width: 100%">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.num"
 | 
			
		||||
						placeholder="请输入数量" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="产线"
 | 
			
		||||
					prop="lineId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.lineId"
 | 
			
		||||
						placeholder="请选择产线"
 | 
			
		||||
						@change="getWorksectionById"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in lineList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
							:label="dict.name"
 | 
			
		||||
							:value="dict.id" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="工段"
 | 
			
		||||
					prop="sectionId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.sectionId"
 | 
			
		||||
						placeholder="请选择工段"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in sectionList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
							:label="dict.name"
 | 
			
		||||
							:value="dict.id" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报废时间"
 | 
			
		||||
					prop="logTime">
 | 
			
		||||
					<el-date-picker
 | 
			
		||||
						style="width: 100%"
 | 
			
		||||
						v-model="dataForm.logTime"
 | 
			
		||||
						type="datetime"
 | 
			
		||||
						value-format="timestamp"
 | 
			
		||||
						placeholder="选择日期"></el-date-picker>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
			<el-col :span="12">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="报废原因"
 | 
			
		||||
					prop="detId">
 | 
			
		||||
					<el-select
 | 
			
		||||
						v-model="dataForm.detId"
 | 
			
		||||
						placeholder="请选择报废原因"
 | 
			
		||||
						multiple
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-option
 | 
			
		||||
							v-for="dict in detList"
 | 
			
		||||
							:key="dict.id"
 | 
			
		||||
							:label="dict.name"
 | 
			
		||||
							:value="dict.id" />
 | 
			
		||||
					</el-select>
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-row :gutter="20">
 | 
			
		||||
			<el-col :span="24">
 | 
			
		||||
				<el-form-item
 | 
			
		||||
					label="描述"
 | 
			
		||||
					prop="description">
 | 
			
		||||
					<el-input
 | 
			
		||||
						v-model="dataForm.description"
 | 
			
		||||
						type="textarea"
 | 
			
		||||
						:rows="4"
 | 
			
		||||
						placeholder="请输入描述"
 | 
			
		||||
						style="width: 100%" />
 | 
			
		||||
				</el-form-item>
 | 
			
		||||
			</el-col>
 | 
			
		||||
		</el-row>
 | 
			
		||||
		<el-col :span="24">
 | 
			
		||||
			<el-form-item
 | 
			
		||||
				label="备注"
 | 
			
		||||
				prop="remark">
 | 
			
		||||
				<el-input
 | 
			
		||||
					v-model="dataForm.remark"
 | 
			
		||||
					placeholder="备注"
 | 
			
		||||
					style="width: 100%" />
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
		</el-col>
 | 
			
		||||
	</el-form>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from './basic-add';
 | 
			
		||||
import {
 | 
			
		||||
  createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
 | 
			
		||||
  getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
 | 
			
		||||
import { getList,} from "@/api/base/qualityScrapType";
 | 
			
		||||
	createQualityScrapLog,
 | 
			
		||||
	updateQualityScrapLog,
 | 
			
		||||
	getQualityScrapLog,
 | 
			
		||||
	getWorkOrderList,
 | 
			
		||||
	getTeamList,
 | 
			
		||||
	getDetList,
 | 
			
		||||
	getLineList,
 | 
			
		||||
} from '@/api/base/qualityScrapLog';
 | 
			
		||||
import { getList } from '@/api/base/qualityScrapType';
 | 
			
		||||
// import { getMaterialList } from "@/api/base/material";
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
export default {
 | 
			
		||||
@@ -86,32 +216,22 @@ export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
			  isGetCode: false,
 | 
			
		||||
        // codeURL: getCode,
 | 
			
		||||
        createURL: createQualityScrapLog,
 | 
			
		||||
        updateURL: updateQualityScrapLog,
 | 
			
		||||
        infoURL: getQualityScrapLog,
 | 
			
		||||
      },
 | 
			
		||||
      lineList:[],
 | 
			
		||||
      typeList: [],
 | 
			
		||||
      workOrderList: [],
 | 
			
		||||
      detList:[],
 | 
			
		||||
      teamList: [],
 | 
			
		||||
      sectionList:[],
 | 
			
		||||
      sourceList: [
 | 
			
		||||
        {
 | 
			
		||||
          id: 1,
 | 
			
		||||
          name: '平板端',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          id: 2,
 | 
			
		||||
          name: '网页端',
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
				isGetCode: false,
 | 
			
		||||
				// codeURL: getCode,
 | 
			
		||||
				createURL: createQualityScrapLog,
 | 
			
		||||
				updateURL: updateQualityScrapLog,
 | 
			
		||||
				infoURL: getQualityScrapLog,
 | 
			
		||||
			},
 | 
			
		||||
			lineList: [],
 | 
			
		||||
			typeList: [],
 | 
			
		||||
			workOrderList: [],
 | 
			
		||||
			detList: [],
 | 
			
		||||
			teamList: [],
 | 
			
		||||
			sectionList: [],
 | 
			
		||||
			dataForm: {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        logTime: undefined,
 | 
			
		||||
        source:1,
 | 
			
		||||
        source: 2,
 | 
			
		||||
        detId: undefined,
 | 
			
		||||
        workOrderId: null,
 | 
			
		||||
        teamId: undefined,
 | 
			
		||||
@@ -120,120 +240,137 @@ export default {
 | 
			
		||||
        lineId:undefined,
 | 
			
		||||
        description:undefined,
 | 
			
		||||
        // description: undefined,
 | 
			
		||||
        remark: undefined,
 | 
			
		||||
        remark: undefined
 | 
			
		||||
				// id: undefined,
 | 
			
		||||
				// logTime: undefined,
 | 
			
		||||
				// detId: undefined,
 | 
			
		||||
				// workOrderId: null,
 | 
			
		||||
				// teamId: undefined,
 | 
			
		||||
				// num: undefined,
 | 
			
		||||
				// sectionId: undefined,
 | 
			
		||||
				// lineId: undefined,
 | 
			
		||||
				// description: undefined,
 | 
			
		||||
				// // description: undefined,
 | 
			
		||||
				// remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			// materialList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				// materialId: [{ required: true, message: "", trigger: "blur" }],
 | 
			
		||||
        workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
 | 
			
		||||
        num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
 | 
			
		||||
        detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
 | 
			
		||||
				workOrderId: [
 | 
			
		||||
					{ required: true, message: '工单号不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
 | 
			
		||||
				detId: [
 | 
			
		||||
					{ required: true, message: '报废原因不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
 | 
			
		||||
        logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
 | 
			
		||||
      }
 | 
			
		||||
				logTime: [
 | 
			
		||||
					{ required: true, message: '报废时间不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict()
 | 
			
		||||
    console.log('我看看', this.dataForm)
 | 
			
		||||
    // this.getCurrentTime()
 | 
			
		||||
    // this.dataForm.logTime = new Date()
 | 
			
		||||
		this.getDict();
 | 
			
		||||
		console.log('我看看', this.dataForm);
 | 
			
		||||
		// this.getCurrentTime()
 | 
			
		||||
		// this.dataForm.logTime = new Date()
 | 
			
		||||
	},
 | 
			
		||||
  methods: {
 | 
			
		||||
    // getCurrentTime() {
 | 
			
		||||
    //   // new Date().Format("yyyy-MM-dd HH:mm:ss")
 | 
			
		||||
    //   // this.dataForm.logTime = year + "-" + month + "-" + day;
 | 
			
		||||
    //   // console.log(this.dataForm.logTime);
 | 
			
		||||
    // },
 | 
			
		||||
	methods: {
 | 
			
		||||
		// getCurrentTime() {
 | 
			
		||||
		//   // new Date().Format("yyyy-MM-dd HH:mm:ss")
 | 
			
		||||
		//   // this.dataForm.logTime = year + "-" + month + "-" + day;
 | 
			
		||||
		//   // console.log(this.dataForm.logTime);
 | 
			
		||||
		// },
 | 
			
		||||
		async getDict() {
 | 
			
		||||
      // 物料列表
 | 
			
		||||
      const res = await getList()
 | 
			
		||||
      this.typeList = res.data
 | 
			
		||||
      getWorkOrderList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.workOrderList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      getLineList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.lineList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      getDetList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.detList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.content,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      getTeamList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.teamList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    async getWorksectionById(lineId) {
 | 
			
		||||
      if (lineId) {
 | 
			
		||||
        const { code, data } = await this.$axios({
 | 
			
		||||
          url: '/base/core-workshop-section/listByParentId',
 | 
			
		||||
          method: 'get',
 | 
			
		||||
          params: {
 | 
			
		||||
            id: lineId,
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
        if (code == 0) {
 | 
			
		||||
          console.log(data)
 | 
			
		||||
          this.sectionList = data.map((item) => {
 | 
			
		||||
            return {
 | 
			
		||||
              name: item.name,
 | 
			
		||||
              id: item.id,
 | 
			
		||||
            };
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$axios({
 | 
			
		||||
          url: '/base/core-workshop-section/listAll',
 | 
			
		||||
          method: 'get',
 | 
			
		||||
          // params: {
 | 
			
		||||
          //   id: lineId,
 | 
			
		||||
          // },
 | 
			
		||||
        }).then((res) => {
 | 
			
		||||
          // console.log(data)
 | 
			
		||||
          this.sectionList = res.data.map((item) => {
 | 
			
		||||
            return {
 | 
			
		||||
              name: item.name,
 | 
			
		||||
              id: item.id,
 | 
			
		||||
            };
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
			// 物料列表
 | 
			
		||||
			const res = await getList();
 | 
			
		||||
			this.typeList = res.data;
 | 
			
		||||
			getWorkOrderList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.workOrderList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			getLineList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.lineList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			getDetList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.detList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.content,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			getTeamList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.teamList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		async getWorksectionById(lineId) {
 | 
			
		||||
			if (lineId) {
 | 
			
		||||
				const { code, data } = await this.$axios({
 | 
			
		||||
					url: '/base/core-workshop-section/listByParentId',
 | 
			
		||||
					method: 'get',
 | 
			
		||||
					params: {
 | 
			
		||||
						id: lineId,
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
				if (code == 0) {
 | 
			
		||||
					console.log(data);
 | 
			
		||||
					this.sectionList = data.map((item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							id: item.id,
 | 
			
		||||
						};
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$axios({
 | 
			
		||||
					url: '/base/core-workshop-section/listAll',
 | 
			
		||||
					method: 'get',
 | 
			
		||||
					// params: {
 | 
			
		||||
					//   id: lineId,
 | 
			
		||||
					// },
 | 
			
		||||
				}).then((res) => {
 | 
			
		||||
					// console.log(data)
 | 
			
		||||
					this.sectionList = res.data.map((item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							id: item.id,
 | 
			
		||||
						};
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// setMaterialCode() {
 | 
			
		||||
		// 	const chooseM = this.materialList.filter(item => {
 | 
			
		||||
		// 		return item.id === this.dataForm.materialId
 | 
			
		||||
 
 | 
			
		||||
@@ -58,10 +58,6 @@ export default {
 | 
			
		||||
            this.dataForm.detId = response.data.detIdList
 | 
			
		||||
            this.getWorksectionById(this.dataForm.lineId)
 | 
			
		||||
            this.dataForm.logTime = new Date(response.data.logTime)
 | 
			
		||||
 | 
			
		||||
            // if (this.setData) {
 | 
			
		||||
            //   this.setDataForm()
 | 
			
		||||
            // }
 | 
			
		||||
          });
 | 
			
		||||
        } else {
 | 
			
		||||
          if (this.urlOptions.isGetCode) {
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ export default {
 | 
			
		||||
      },
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 1,
 | 
			
		||||
      },
 | 
			
		||||
 
 | 
			
		||||
@@ -6,239 +6,322 @@
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <el-dialog :visible.sync="visible" width="50%">
 | 
			
		||||
    <small-title slot="title" :no-padding="true">
 | 
			
		||||
      {{ '详情' }}
 | 
			
		||||
    </small-title>
 | 
			
		||||
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
      label-width="auto">
 | 
			
		||||
      <el-row :gutter="24">
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="工单号" prop="workOrderId">
 | 
			
		||||
            <el-select disabled v-model="dataForm.workOrderId" placeholder="请选择工单号">
 | 
			
		||||
              <el-option v-for="dict in workOrderList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="数量" prop="num">
 | 
			
		||||
            <el-input disabled v-model="dataForm.num" placeholder="请输入数量" />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="报废时间" prop="logTime">
 | 
			
		||||
            <el-date-picker disabled v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
              placeholder="选择日期">
 | 
			
		||||
            </el-date-picker>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-row :gutter="20">
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="产线" prop="lineId">
 | 
			
		||||
            <el-select disabled v-model="dataForm.lineId" placeholder="请选择产线" @change="getWorksectionById">
 | 
			
		||||
              <el-option v-for="dict in lineList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="工段" prop="sectionId">
 | 
			
		||||
            <el-select v-model="dataForm.sectionId" placeholder="请选择工段" disabled>
 | 
			
		||||
              <el-option v-for="dict in sectionList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="8">
 | 
			
		||||
          <el-form-item label="报废原因" prop="detId">
 | 
			
		||||
            <el-select v-model="dataForm.detId" placeholder="请选择报废原因" multiple disabled>
 | 
			
		||||
              <el-option v-for="dict in detList" :key="dict.id" :label="dict.name" :value="dict.id" />
 | 
			
		||||
            </el-select>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-row :gutter="20">
 | 
			
		||||
        <el-col :span="24">
 | 
			
		||||
          <el-form-item label="描述" prop="description">
 | 
			
		||||
            <el-input v-model="dataForm.description" type="textarea" :rows="4" placeholder="请输入描述" />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
      <el-col :span="8">
 | 
			
		||||
        <el-form-item label="备注" prop="remark">
 | 
			
		||||
          <el-input v-model="dataForm.remark" placeholder="备注" />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-form>
 | 
			
		||||
  </el-dialog>
 | 
			
		||||
 | 
			
		||||
	<el-dialog
 | 
			
		||||
		:visible.sync="visible"
 | 
			
		||||
		width="50%">
 | 
			
		||||
		<small-title
 | 
			
		||||
			slot="title"
 | 
			
		||||
			:no-padding="true">
 | 
			
		||||
			{{ '详情' }}
 | 
			
		||||
		</small-title>
 | 
			
		||||
		<el-form
 | 
			
		||||
			:model="dataForm"
 | 
			
		||||
			:rules="dataRule"
 | 
			
		||||
			ref="dataForm"
 | 
			
		||||
			@keyup.enter.native="dataFormSubmit()"
 | 
			
		||||
			label-width="auto">
 | 
			
		||||
			<el-row :gutter="24">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="工单号"
 | 
			
		||||
						prop="workOrderId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							disabled
 | 
			
		||||
							v-model="dataForm.workOrderId"
 | 
			
		||||
							placeholder="请选择工单号"
 | 
			
		||||
							style="width: 100%">
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="dict in workOrderList"
 | 
			
		||||
								:key="dict.id"
 | 
			
		||||
								:label="dict.name"
 | 
			
		||||
								:value="dict.id" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="数量"
 | 
			
		||||
						prop="num">
 | 
			
		||||
						<el-input
 | 
			
		||||
							disabled
 | 
			
		||||
							v-model="dataForm.num"
 | 
			
		||||
							placeholder="请输入数量"
 | 
			
		||||
							style="width: 100%" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="报废时间"
 | 
			
		||||
						prop="logTime"
 | 
			
		||||
						style="width: 100%">
 | 
			
		||||
						<el-date-picker
 | 
			
		||||
							disabled
 | 
			
		||||
							v-model="dataForm.logTime"
 | 
			
		||||
							type="datetime"
 | 
			
		||||
							value-format="yyyy-MM-dd HH:mm:ss"
 | 
			
		||||
							placeholder="选择日期"></el-date-picker>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="产线"
 | 
			
		||||
						prop="lineId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							disabled
 | 
			
		||||
							v-model="dataForm.lineId"
 | 
			
		||||
							placeholder="请选择产线"
 | 
			
		||||
							@change="getWorksectionById"
 | 
			
		||||
							style="width: 100%">
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="dict in lineList"
 | 
			
		||||
								:key="dict.id"
 | 
			
		||||
								:label="dict.name"
 | 
			
		||||
								:value="dict.id" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="工段"
 | 
			
		||||
						prop="sectionId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.sectionId"
 | 
			
		||||
							placeholder="请选择工段"
 | 
			
		||||
							disabled
 | 
			
		||||
							style="width: 100%">
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="dict in sectionList"
 | 
			
		||||
								:key="dict.id"
 | 
			
		||||
								:label="dict.name"
 | 
			
		||||
								:value="dict.id" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="8">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="报废原因"
 | 
			
		||||
						prop="detId">
 | 
			
		||||
						<el-select
 | 
			
		||||
							v-model="dataForm.detId"
 | 
			
		||||
							placeholder="请选择报废原因"
 | 
			
		||||
							multiple
 | 
			
		||||
							disabled
 | 
			
		||||
							style="width: 100%">
 | 
			
		||||
							<el-option
 | 
			
		||||
								v-for="dict in detList"
 | 
			
		||||
								:key="dict.id"
 | 
			
		||||
								:label="dict.name"
 | 
			
		||||
								:value="dict.id" />
 | 
			
		||||
						</el-select>
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
			<el-row :gutter="20">
 | 
			
		||||
				<el-col :span="24">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="描述"
 | 
			
		||||
						prop="description">
 | 
			
		||||
						<el-input
 | 
			
		||||
							v-model="dataForm.description"
 | 
			
		||||
							type="textarea"
 | 
			
		||||
							:rows="4"
 | 
			
		||||
							placeholder="请输入描述" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
				<el-col :span="24">
 | 
			
		||||
					<el-form-item
 | 
			
		||||
						label="备注"
 | 
			
		||||
						prop="remark">
 | 
			
		||||
						<el-input
 | 
			
		||||
							v-model="dataForm.remark"
 | 
			
		||||
							placeholder="备注" />
 | 
			
		||||
					</el-form-item>
 | 
			
		||||
				</el-col>
 | 
			
		||||
			</el-row>
 | 
			
		||||
		</el-form>
 | 
			
		||||
	</el-dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import basicAdd from './basic-add';
 | 
			
		||||
import {
 | 
			
		||||
  createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
 | 
			
		||||
  getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
 | 
			
		||||
import { getList,} from "@/api/base/qualityScrapType";
 | 
			
		||||
	createQualityScrapLog,
 | 
			
		||||
	updateQualityScrapLog,
 | 
			
		||||
	getQualityScrapLog,
 | 
			
		||||
	getWorkOrderList,
 | 
			
		||||
	getTeamList,
 | 
			
		||||
	getDetList,
 | 
			
		||||
	getLineList,
 | 
			
		||||
} from '@/api/base/qualityScrapLog';
 | 
			
		||||
import { getList } from '@/api/base/qualityScrapType';
 | 
			
		||||
import SmallTitle from './SmallTitle';
 | 
			
		||||
export default {
 | 
			
		||||
  components: {
 | 
			
		||||
    SmallTitle,
 | 
			
		||||
  },
 | 
			
		||||
	components: {
 | 
			
		||||
		SmallTitle,
 | 
			
		||||
	},
 | 
			
		||||
	mixins: [basicAdd],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
			  isGetCode: false,
 | 
			
		||||
        // codeURL: getCode,
 | 
			
		||||
        createURL: createQualityScrapLog,
 | 
			
		||||
        updateURL: updateQualityScrapLog,
 | 
			
		||||
        infoURL: getQualityScrapLog,
 | 
			
		||||
      },
 | 
			
		||||
      lineList:[],
 | 
			
		||||
      typeList: [],
 | 
			
		||||
      workOrderList: [],
 | 
			
		||||
      detList:[],
 | 
			
		||||
      teamList: [],
 | 
			
		||||
      sourceList: [
 | 
			
		||||
        {
 | 
			
		||||
          id: 1,
 | 
			
		||||
          name: '手动',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          id: 2,
 | 
			
		||||
          name: '自动',
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      sectionList:[],
 | 
			
		||||
      visible:false,
 | 
			
		||||
				isGetCode: false,
 | 
			
		||||
				// codeURL: getCode,
 | 
			
		||||
				createURL: createQualityScrapLog,
 | 
			
		||||
				updateURL: updateQualityScrapLog,
 | 
			
		||||
				infoURL: getQualityScrapLog,
 | 
			
		||||
			},
 | 
			
		||||
			lineList: [],
 | 
			
		||||
			typeList: [],
 | 
			
		||||
			workOrderList: [],
 | 
			
		||||
			detList: [],
 | 
			
		||||
			teamList: [],
 | 
			
		||||
			sourceList: [
 | 
			
		||||
				{
 | 
			
		||||
					id: 1,
 | 
			
		||||
					name: '手动',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					id: 2,
 | 
			
		||||
					name: '自动',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			sectionList: [],
 | 
			
		||||
			visible: false,
 | 
			
		||||
			dataForm: {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        logTime: undefined,
 | 
			
		||||
        source:1,
 | 
			
		||||
        detId: undefined,
 | 
			
		||||
        workOrderId: null,
 | 
			
		||||
        teamId: undefined,
 | 
			
		||||
        num: undefined,
 | 
			
		||||
        lineId:undefined,
 | 
			
		||||
        description:undefined,
 | 
			
		||||
        // description: undefined,
 | 
			
		||||
        remark: undefined,
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				logTime: undefined,
 | 
			
		||||
				source: 1,
 | 
			
		||||
				detId: undefined,
 | 
			
		||||
				workOrderId: null,
 | 
			
		||||
				teamId: undefined,
 | 
			
		||||
				num: undefined,
 | 
			
		||||
				lineId: undefined,
 | 
			
		||||
				description: undefined,
 | 
			
		||||
				// description: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
			},
 | 
			
		||||
			// materialList: [],
 | 
			
		||||
			dataRule: {
 | 
			
		||||
				// materialId: [{ required: true, message: "", trigger: "blur" }],
 | 
			
		||||
        workOrderId: [{ required: true, message: "工单号不能为空", trigger: "change" }],
 | 
			
		||||
        num: [{ required: true, message: "数量不能为空", trigger: "blur" }],
 | 
			
		||||
        detId: [{ required: true, message: "报废原因不能为空", trigger: "change" }],
 | 
			
		||||
				workOrderId: [
 | 
			
		||||
					{ required: true, message: '工单号不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
				num: [{ required: true, message: '数量不能为空', trigger: 'blur' }],
 | 
			
		||||
				detId: [
 | 
			
		||||
					{ required: true, message: '报废原因不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
 | 
			
		||||
        logTime: [{ required: true, message: "报废时间不能为空", trigger: "change" }],
 | 
			
		||||
      }
 | 
			
		||||
				logTime: [
 | 
			
		||||
					{ required: true, message: '报废时间不能为空', trigger: 'change' },
 | 
			
		||||
				],
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict()
 | 
			
		||||
    console.log('我看看', this.dataForm)
 | 
			
		||||
    // this.getCurrentTime()
 | 
			
		||||
		this.getDict();
 | 
			
		||||
		console.log('我看看', this.dataForm);
 | 
			
		||||
		// this.getCurrentTime()
 | 
			
		||||
	},
 | 
			
		||||
  methods: {
 | 
			
		||||
    // init() {
 | 
			
		||||
    //   this.dialogVisible = true
 | 
			
		||||
    // },
 | 
			
		||||
    // getCurrentTime() {
 | 
			
		||||
    //   // new Date().Format("yyyy-MM-dd HH:mm:ss")
 | 
			
		||||
    //   this.dataForm.logTime = new Date()
 | 
			
		||||
    //   // this.dataForm.logTime = year + "-" + month + "-" + day;
 | 
			
		||||
    //   console.log(this.dataForm.logTime);
 | 
			
		||||
    // },
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      // 物料列表
 | 
			
		||||
      const res = await getList()
 | 
			
		||||
      this.typeList = res.data
 | 
			
		||||
      getWorkOrderList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.workOrderList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      getLineList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.lineList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      getDetList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.detList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.content,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      getTeamList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.teamList = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    async getWorksectionById(lineId) {
 | 
			
		||||
      if (lineId) {
 | 
			
		||||
        const { code, data } = await this.$axios({
 | 
			
		||||
          url: '/base/core-workshop-section/listByParentId',
 | 
			
		||||
          method: 'get',
 | 
			
		||||
          params: {
 | 
			
		||||
            id: lineId,
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
        if (code == 0) {
 | 
			
		||||
          console.log(data)
 | 
			
		||||
          this.sectionList = data.map((item) => {
 | 
			
		||||
            return {
 | 
			
		||||
              name: item.name,
 | 
			
		||||
              id: item.id,
 | 
			
		||||
            };
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$axios({
 | 
			
		||||
          url: '/base/core-workshop-section/listAll',
 | 
			
		||||
          method: 'get',
 | 
			
		||||
          // params: {
 | 
			
		||||
          //   id: lineId,
 | 
			
		||||
          // },
 | 
			
		||||
        }).then((res) => {
 | 
			
		||||
          // console.log(data)
 | 
			
		||||
          this.sectionList = res.data.map((item) => {
 | 
			
		||||
            return {
 | 
			
		||||
              name: item.name,
 | 
			
		||||
              id: item.id,
 | 
			
		||||
            };
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
	methods: {
 | 
			
		||||
		// init() {
 | 
			
		||||
		//   this.dialogVisible = true
 | 
			
		||||
		// },
 | 
			
		||||
		// getCurrentTime() {
 | 
			
		||||
		//   // new Date().Format("yyyy-MM-dd HH:mm:ss")
 | 
			
		||||
		//   this.dataForm.logTime = new Date()
 | 
			
		||||
		//   // this.dataForm.logTime = year + "-" + month + "-" + day;
 | 
			
		||||
		//   console.log(this.dataForm.logTime);
 | 
			
		||||
		// },
 | 
			
		||||
		async getDict() {
 | 
			
		||||
			// 物料列表
 | 
			
		||||
			const res = await getList();
 | 
			
		||||
			this.typeList = res.data;
 | 
			
		||||
			getWorkOrderList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.workOrderList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			getLineList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.lineList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			getDetList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.detList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.content,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			getTeamList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.teamList = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		async getWorksectionById(lineId) {
 | 
			
		||||
			if (lineId) {
 | 
			
		||||
				const { code, data } = await this.$axios({
 | 
			
		||||
					url: '/base/core-workshop-section/listByParentId',
 | 
			
		||||
					method: 'get',
 | 
			
		||||
					params: {
 | 
			
		||||
						id: lineId,
 | 
			
		||||
					},
 | 
			
		||||
				});
 | 
			
		||||
				if (code == 0) {
 | 
			
		||||
					console.log(data);
 | 
			
		||||
					this.sectionList = data.map((item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							id: item.id,
 | 
			
		||||
						};
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$axios({
 | 
			
		||||
					url: '/base/core-workshop-section/listAll',
 | 
			
		||||
					method: 'get',
 | 
			
		||||
					// params: {
 | 
			
		||||
					//   id: lineId,
 | 
			
		||||
					// },
 | 
			
		||||
				}).then((res) => {
 | 
			
		||||
					// console.log(data)
 | 
			
		||||
					this.sectionList = res.data.map((item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.name,
 | 
			
		||||
							id: item.id,
 | 
			
		||||
						};
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,45 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
 | 
			
		||||
      :limit="listQuery.pageSize" :table-data="tableData">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" />
 | 
			
		||||
    <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm" :before-close="handleCancel" width="50%">
 | 
			
		||||
      <add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <detail-or-update v-if="detailOrUpdateVisible" ref="detailOrUpdate" @refreshDataList="successSubmit" />
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			v-loading="dataListLoading"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="listQuery.pageNo"
 | 
			
		||||
			:limit="listQuery.pageSize"
 | 
			
		||||
			:table-data="tableData">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" />
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@refreshDataList="successSubmit"></add-or-update>
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
		<detail-or-update
 | 
			
		||||
			v-if="detailOrUpdateVisible"
 | 
			
		||||
			ref="detailOrUpdate"
 | 
			
		||||
			@refreshDataList="successSubmit" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -23,201 +49,211 @@ import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import basicPage from './basic-page';
 | 
			
		||||
import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getQualityScrapLogPage,
 | 
			
		||||
  deleteQualityScrapLog,
 | 
			
		||||
  getWorkOrderList,
 | 
			
		||||
  // getTeamList
 | 
			
		||||
	getQualityScrapLogPage,
 | 
			
		||||
	deleteQualityScrapLog,
 | 
			
		||||
	getWorkOrderList,
 | 
			
		||||
	// getTeamList
 | 
			
		||||
} from '@/api/base/qualityScrapLog';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	// {
 | 
			
		||||
	// 	prop: 'createTime',
 | 
			
		||||
	// 	label: '添加时间',
 | 
			
		||||
	// 	filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '报废时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'lineName',
 | 
			
		||||
    label: '产线名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'sectionName',
 | 
			
		||||
    label: '工段'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderName',
 | 
			
		||||
    label: '工单名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '数量'
 | 
			
		||||
  },
 | 
			
		||||
	{
 | 
			
		||||
    prop: 'detContent',
 | 
			
		||||
    label: '报废原因'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'source',
 | 
			
		||||
    label: '来源',
 | 
			
		||||
    filter: (val) => val == 1 ? '平板端' : '网页端'
 | 
			
		||||
  },
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '报废时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		width: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'lineName',
 | 
			
		||||
		label: '产线名称',
 | 
			
		||||
		width: 90,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'sectionName',
 | 
			
		||||
		label: '工段',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workOrderName',
 | 
			
		||||
		label: '工单名称',
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '数量',
 | 
			
		||||
		width: 90,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'detContent',
 | 
			
		||||
		label: '报废原因',
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'source',
 | 
			
		||||
		label: '来源',
 | 
			
		||||
		filter: (val) => ['', '平板端', '网页端'][val],
 | 
			
		||||
		width: 90,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  mixins: [basicPage, tableHeightMixin],
 | 
			
		||||
	mixins: [basicPage, tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
        getDataListURL: getQualityScrapLogPage,
 | 
			
		||||
        deleteURL: deleteQualityScrapLog,
 | 
			
		||||
				getDataListURL: getQualityScrapLogPage,
 | 
			
		||||
				deleteURL: deleteQualityScrapLog,
 | 
			
		||||
				// exportURL: exportFactoryExcel,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi(`base:quality-scrap-log:update`)
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-scrap-log:update`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi(`base:quality-scrap-log:detail`)
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'detail',
 | 
			
		||||
            btnName: '详情',
 | 
			
		||||
          }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi(`base:quality-scrap-log:delete`)
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-scrap-log:detail`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi(`base:quality-scrap-log:delete`)
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v)=>v),
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      detailOrUpdateVisible:false,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			detailOrUpdateVisible: false,
 | 
			
		||||
			formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '工单',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'workOrderId',
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '班组',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   param: 'teamId',
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
        // },
 | 
			
		||||
				{
 | 
			
		||||
          type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '工单',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					labelField: 'name',
 | 
			
		||||
					valueField: 'id',
 | 
			
		||||
					param: 'workOrderId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				//   type: 'select',
 | 
			
		||||
				//   label: '班组',
 | 
			
		||||
				//   selectOptions: [],
 | 
			
		||||
				//   labelField: 'name',
 | 
			
		||||
				//   valueField: 'id',
 | 
			
		||||
				//   param: 'teamId',
 | 
			
		||||
				//   filterable: true
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-scrap-det:query')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'separate' : '',
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-scrap-det:create')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
					// type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
          type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-scrap-det:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: {
 | 
			
		||||
    AddOrUpdate,
 | 
			
		||||
    DetailOrUpdate
 | 
			
		||||
		AddOrUpdate,
 | 
			
		||||
		DetailOrUpdate,
 | 
			
		||||
	},
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getDict()
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    otherMethods(val) {
 | 
			
		||||
      if (val.type === 'detail') {
 | 
			
		||||
        this.detailOrUpdateVisible = true;
 | 
			
		||||
        // this.addOrEditTitle = "详情";
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.detailOrUpdate.init(val.data.id, true);
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    deleteHandle(id, name, index, data) {
 | 
			
		||||
      this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: "操作成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.getDataList();
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDict() {
 | 
			
		||||
      getWorkOrderList().then((res) => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      // getTeamList().then((res) => {
 | 
			
		||||
      //   console.log(res);
 | 
			
		||||
      //   // console.log(response);
 | 
			
		||||
      //   this.formConfig[1].selectOptions = res.data.map((item) => {
 | 
			
		||||
      //     return {
 | 
			
		||||
      //       name: item.name,
 | 
			
		||||
      //       id: item.id
 | 
			
		||||
      //     }
 | 
			
		||||
      //   })
 | 
			
		||||
      //   // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
      //   // this.listQuery.total = response.data.total;
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        this.tableData = response.data.list;
 | 
			
		||||
        this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getDict();
 | 
			
		||||
		this.getDataList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		otherMethods(val) {
 | 
			
		||||
			if (val.type === 'detail') {
 | 
			
		||||
				this.detailOrUpdateVisible = true;
 | 
			
		||||
				// this.addOrEditTitle = "详情";
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.detailOrUpdate.init(val.data.id, true);
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		deleteHandle(id, name, index, data) {
 | 
			
		||||
			this.$confirm(`确认要删除序号为${index}的数据项?`, '提示', {
 | 
			
		||||
				confirmButtonText: '确定',
 | 
			
		||||
				cancelButtonText: '取消',
 | 
			
		||||
				type: 'warning',
 | 
			
		||||
			})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
						this.$message({
 | 
			
		||||
							message: '操作成功',
 | 
			
		||||
							type: 'success',
 | 
			
		||||
							duration: 1500,
 | 
			
		||||
							onClose: () => {
 | 
			
		||||
								this.getDataList();
 | 
			
		||||
							},
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		// 获取数据列表
 | 
			
		||||
		getDict() {
 | 
			
		||||
			getWorkOrderList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data.map((item) => {
 | 
			
		||||
					return {
 | 
			
		||||
						name: item.name,
 | 
			
		||||
						id: item.id,
 | 
			
		||||
					};
 | 
			
		||||
				});
 | 
			
		||||
				// console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
				// this.listQuery.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
			// getTeamList().then((res) => {
 | 
			
		||||
			//   console.log(res);
 | 
			
		||||
			//   // console.log(response);
 | 
			
		||||
			//   this.formConfig[1].selectOptions = res.data.map((item) => {
 | 
			
		||||
			//     return {
 | 
			
		||||
			//       name: item.name,
 | 
			
		||||
			//       id: item.id
 | 
			
		||||
			//     }
 | 
			
		||||
			//   })
 | 
			
		||||
			//   // console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
			//   // this.listQuery.total = response.data.total;
 | 
			
		||||
			// })
 | 
			
		||||
		},
 | 
			
		||||
		getDataList() {
 | 
			
		||||
			this.dataListLoading = true;
 | 
			
		||||
			this.urlOptions.getDataListURL(this.listQuery).then((response) => {
 | 
			
		||||
				this.tableData = response.data.list;
 | 
			
		||||
				this.listQuery.total = response.data.total;
 | 
			
		||||
				this.dataListLoading = false;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.listQuery.pageNo = 1;
 | 
			
		||||
					this.listQuery.pageSize = 20;
 | 
			
		||||
          this.listQuery.workOrderId = val.workOrderId ? val.workOrderId : undefined;
 | 
			
		||||
          // this.listQuery.teamId = val.teamId ? val.teamId : undefined;
 | 
			
		||||
					this.listQuery.workOrderId = val.workOrderId
 | 
			
		||||
						? val.workOrderId
 | 
			
		||||
						: undefined;
 | 
			
		||||
					// this.listQuery.teamId = val.teamId ? val.teamId : undefined;
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'reset':
 | 
			
		||||
@@ -227,7 +263,7 @@ export default {
 | 
			
		||||
						pageNo: 1,
 | 
			
		||||
						total: 1,
 | 
			
		||||
					};
 | 
			
		||||
					this.getDataList()
 | 
			
		||||
					this.getDataList();
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,59 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zwq
 | 
			
		||||
 * @Date: 2023-08-01 14:55:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-07 16:25:19
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @LastEditTime: 2024-04-29 15:25:52
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
 | 
			
		||||
    <!-- <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> -->
 | 
			
		||||
    <el-form
 | 
			
		||||
			:inline="true"
 | 
			
		||||
			:model="listQuery"
 | 
			
		||||
			class="blueTip">
 | 
			
		||||
      <el-form-item label="合格证号" prop="certificateNumber">
 | 
			
		||||
				<el-input size="small" v-model="listQuery.certificateNumber" clearable placeholder="合格证号" @blur="countTimes(1)" @clear="countArray[0] = false"></el-input>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
      <el-form-item label="成品周转编号" prop="packagingCode">
 | 
			
		||||
				<el-input size="small" v-model="listQuery.packagingCode" clearable placeholder="成品周转编号" @blur="countTimes(2)" @clear="countArray[1] = false"></el-input>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
      <el-form-item label="原片周转编号" prop="glassCode">
 | 
			
		||||
				<el-input size="small" v-model="listQuery.glassCode" clearable placeholder="原片周转编号" @blur="countTimes(3)" @clear="countArray[2] = false"></el-input>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			<el-form-item label="包装全检时间及产线" prop="val">
 | 
			
		||||
				<el-date-picker
 | 
			
		||||
					v-model="listQuery.packTime"
 | 
			
		||||
					value-format="timestamp"
 | 
			
		||||
					type="datetime"
 | 
			
		||||
					size="small"
 | 
			
		||||
          clearable
 | 
			
		||||
					placeholder="包装全检时间"
 | 
			
		||||
          @change="countTimes('timestamp3')"
 | 
			
		||||
        />
 | 
			
		||||
        <el-select v-model="listQuery.lineName" size="small" clearable filterable placeholder="产线" @change="countTimes('timestamp3')" style="margin-left: 5px">
 | 
			
		||||
          <el-option v-for="(item, index) in lineOptions" :key="index" :label="item.name" :value="item.name"></el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button
 | 
			
		||||
          v-if="this.$auth.hasPermi('monitoring:rawMaterial-traceability:query')"
 | 
			
		||||
          type="primary"
 | 
			
		||||
          size="small"
 | 
			
		||||
          @click="getList">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
		</el-form>
 | 
			
		||||
    <!-- <base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
 | 
			
		||||
      :table-data="list"> -->
 | 
			
		||||
    <base-table :max-height="tableH" :table-props="tableProps" :page="1" :limit="100"
 | 
			
		||||
      :table-data="list">
 | 
			
		||||
      <!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" /> -->
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" :width="220" label="缺陷操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
    <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getList" /> -->
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -23,61 +62,76 @@
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import unitDict from './unitDict';
 | 
			
		||||
// import basicPage from '../mixins/basic-page';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
// import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { parseTime } from '../mixins/code-filter';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
 | 
			
		||||
import {
 | 
			
		||||
  getOriginalGlassRetrace,
 | 
			
		||||
  getWorkOrderList,
 | 
			
		||||
  // exportEnergyPlcExcel
 | 
			
		||||
} from '@/api/quality/rawMaterialTraceability';
 | 
			
		||||
import { getOriginalGlassRetrace } from '@/api/quality/rawMaterialTraceability';
 | 
			
		||||
 | 
			
		||||
const tableProps = [
 | 
			
		||||
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderName',
 | 
			
		||||
    label: '订单名称',
 | 
			
		||||
    prop: 'certificateNumber',
 | 
			
		||||
    label: '合格证号',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
    filter: (val) => val ? val : '--'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderName',
 | 
			
		||||
    label: '工单名称',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'palletNumber',
 | 
			
		||||
    label: '托号',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'transportQuantity',
 | 
			
		||||
    label: '该托片数',
 | 
			
		||||
    prop: 'boxNumber',
 | 
			
		||||
    label: '箱号',
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
    filter: (val) => val ? val : '--'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packagingCode',
 | 
			
		||||
    label: '包装条码',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'originalGlassLineName',
 | 
			
		||||
    label: '原片产线',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'originalGlassOutputTime',
 | 
			
		||||
    label: '原片下片时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
    label: '成品周转编号',
 | 
			
		||||
    minWidth: 180,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
    filter: (val) => val ? val : '--'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deepProcessingLineName',
 | 
			
		||||
    label: '深加工产线',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
    filter: (val) => val ? val : '--'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deepProcessingInputTime',
 | 
			
		||||
    label: '深加工上片时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
    // filter: (val) => parseTime(val) ? parseTime(val) : '--',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 180,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productionOutputTime',
 | 
			
		||||
    prop: 'deepProcessingOutputTime',
 | 
			
		||||
    label: '深加工下片时间',
 | 
			
		||||
    filter: parseTime
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 180,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'glassCode',
 | 
			
		||||
    label: '原片周转编码',
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'originalGlassLineName',
 | 
			
		||||
    label: '原片产线',
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'originalGlassOutputTime',
 | 
			
		||||
    label: '原片下片时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 180,
 | 
			
		||||
		showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'scrapDetail',
 | 
			
		||||
  //   label: '详情',
 | 
			
		||||
@@ -88,64 +142,93 @@ const tableProps = [
 | 
			
		||||
export default {
 | 
			
		||||
  // mixins: [basicPage],
 | 
			
		||||
  mixins: [tableHeightMixin],
 | 
			
		||||
  name: 'originalGlassRetrace',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // urlOptions: {
 | 
			
		||||
      //   getDataListURL: getMaterialUseLogPage,
 | 
			
		||||
      //   // deleteURL: deletePackingType,
 | 
			
		||||
      //   // exportURL: exportPackingExcel,
 | 
			
		||||
      // },
 | 
			
		||||
      lineOptions: [],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      // tableBtn: [
 | 
			
		||||
      //   // this.$auth.hasPermi(`base:packaging-print-log:update`)
 | 
			
		||||
      //   //   ?
 | 
			
		||||
      //     {
 | 
			
		||||
      //       type: 'edit',
 | 
			
		||||
      //       btnName: '编辑',
 | 
			
		||||
      //     },
 | 
			
		||||
      //     // : undefined,
 | 
			
		||||
      //   // this.$auth.hasPermi(`base:packaging-print-log:delete`)
 | 
			
		||||
      //   //   ?
 | 
			
		||||
      //     {
 | 
			
		||||
      //       type: 'delete',
 | 
			
		||||
      //       btnName: '删除',
 | 
			
		||||
      //     }
 | 
			
		||||
      //     // : undefined,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        // this.$auth.hasPermi(`base:packaging-print-log:update`)
 | 
			
		||||
        //   ?
 | 
			
		||||
          {
 | 
			
		||||
            type: 'detail0',
 | 
			
		||||
            btnName: '成品缺陷详情',
 | 
			
		||||
          },
 | 
			
		||||
          // : undefined,
 | 
			
		||||
        // this.$auth.hasPermi(`base:packaging-print-log:delete`)
 | 
			
		||||
        //   ?
 | 
			
		||||
          {
 | 
			
		||||
            type: 'detail1',
 | 
			
		||||
            btnName: '原片缺陷详情',
 | 
			
		||||
          }
 | 
			
		||||
          // : undefined,
 | 
			
		||||
 | 
			
		||||
      // ].filter((v) => v),
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      list: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        total: 0,
 | 
			
		||||
        workOrderId: undefined,
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime:undefined,
 | 
			
		||||
        // pageSize: 10,
 | 
			
		||||
        // pageNo: 1,
 | 
			
		||||
        // total: 0,
 | 
			
		||||
        certificateNumber: undefined,
 | 
			
		||||
        packagingCode: undefined,
 | 
			
		||||
        packTime: null,
 | 
			
		||||
        lineName: null,
 | 
			
		||||
        glassCode: undefined
 | 
			
		||||
      },
 | 
			
		||||
      useTime: false,
 | 
			
		||||
      countArray: [false, false, false, false],
 | 
			
		||||
      // tableH: this.tableHeight(260),
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '工单',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'name',
 | 
			
		||||
        //   param: 'workOrderName',
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '合格证号',
 | 
			
		||||
          placeholder: '合格证号',
 | 
			
		||||
          param: 'certificateNumber',
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '成品周转编号',
 | 
			
		||||
          placeholder: '成品周转编号',
 | 
			
		||||
          param: 'packagingCode'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '包装全检时间及产线',
 | 
			
		||||
          dateType: 'datetimerange',
 | 
			
		||||
          format: 'timestamp',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 250
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '工单',
 | 
			
		||||
          label: '',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'name',
 | 
			
		||||
          param: 'workOrderName',
 | 
			
		||||
          param: 'lineName',
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'datePicker',
 | 
			
		||||
        //   label: '时间段',
 | 
			
		||||
        //   dateType: 'daterange',
 | 
			
		||||
        //   format: 'yyyy-MM-dd',
 | 
			
		||||
        //   valueFormat: "yyyy-MM-dd",
 | 
			
		||||
        //   rangeSeparator: '-',
 | 
			
		||||
        //   startPlaceholder: '开始时间',
 | 
			
		||||
        //   endPlaceholder: '结束时间',
 | 
			
		||||
        //   param: 'timeVal',
 | 
			
		||||
        //   defaultSelect: [],
 | 
			
		||||
        //   width: 250
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '原片周转编号',
 | 
			
		||||
          placeholder: '原片周转编号',
 | 
			
		||||
          param: 'glassCode'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
          type: this.$auth.hasPermi('monitoring:rawMaterial-traceability:query') ? 'button' : '',
 | 
			
		||||
@@ -191,41 +274,109 @@ export default {
 | 
			
		||||
    // window.addEventListener('resize', () => {
 | 
			
		||||
    //   this.tableH = this.tableHeight(260)
 | 
			
		||||
    // })
 | 
			
		||||
    this.getList()
 | 
			
		||||
    countArray: [false, false, false, false],
 | 
			
		||||
    this.useTime = false
 | 
			
		||||
    // this.getList()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleClick(raw) {
 | 
			
		||||
			if (raw.type === 'detail1') {
 | 
			
		||||
        // 原片缺陷
 | 
			
		||||
        // console.log('你好', raw.data._pageIndex)
 | 
			
		||||
        // const tempArray = this?.list[raw.data._pageIndex]
 | 
			
		||||
        // console.log('你好tempArray', tempArray)
 | 
			
		||||
        // let startTime = raw.data.originalGlassOutputTime
 | 
			
		||||
        // if (tempArray) {
 | 
			
		||||
        //   startTime = tempArray.originalGlassOutputTime
 | 
			
		||||
        // }
 | 
			
		||||
        // console.log('你好', parseTime(raw.data.originalGlassOutputTime))
 | 
			
		||||
        const startTime = new Date(raw.data.originalGlassOutputTime)
 | 
			
		||||
        const endTime = new Date(raw.data.originalGlassOutputTime)
 | 
			
		||||
        startTime.setHours(startTime.getHours() - 1)
 | 
			
		||||
        startTime.setMinutes(0)
 | 
			
		||||
        startTime.setSeconds(0)
 | 
			
		||||
        endTime.setHours(endTime.getHours() + 1)
 | 
			
		||||
        endTime.setMinutes(0)
 | 
			
		||||
        // endTime.setSeconds(0)
 | 
			
		||||
        // console.log('设置时间', startTime, parseTime(startTime))
 | 
			
		||||
        // console.log('设置时间11', endTime, parseTime(endTime))
 | 
			
		||||
				this.$router.push({
 | 
			
		||||
          path: '/quality/base/quality-isra',
 | 
			
		||||
          query: {
 | 
			
		||||
            // deepProcessingLineId: raw.data.deepProcessingLineId,
 | 
			
		||||
            lineName: raw.data.deepProcessingLineName,
 | 
			
		||||
            endTime: endTime,
 | 
			
		||||
            startTime: startTime
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
			} else {
 | 
			
		||||
				// 成品缺陷
 | 
			
		||||
				this.$router.push({
 | 
			
		||||
          path: '/quality/base/quality-inspection-data/detection-information/statistical-data',
 | 
			
		||||
          query: {
 | 
			
		||||
            startTime: raw.data.deepProcessingInputTime,
 | 
			
		||||
            endTime: raw.data.deepProcessingOutputTime
 | 
			
		||||
          },
 | 
			
		||||
        });
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
    countTimes(val) {
 | 
			
		||||
      if (val === 1) {
 | 
			
		||||
        this.countArray[0] = this.listQuery.certificateNumber !== '' && this.listQuery.certificateNumber !== undefined
 | 
			
		||||
      }
 | 
			
		||||
      if (val === 2) {
 | 
			
		||||
        this.countArray[1] = this.listQuery?.packagingCode !== '' && this.listQuery?.packagingCode !== undefined
 | 
			
		||||
      }
 | 
			
		||||
      if (val === 3) {
 | 
			
		||||
        this.countArray[2] = this.listQuery?.glassCode !== '' && this.listQuery?.glassCode !== undefined
 | 
			
		||||
      }
 | 
			
		||||
      if (val === 'timestamp3') {
 | 
			
		||||
        if ((this.listQuery.packTime !== '' && this.listQuery.packTime !== null) || (this.listQuery?.lineName !== '' && this.listQuery.lineName !== null)) {
 | 
			
		||||
          this.useTime = true
 | 
			
		||||
          this.countArray[3] = true
 | 
			
		||||
        } else {
 | 
			
		||||
          this.useTime = false
 | 
			
		||||
          this.countArray[3] = true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      getOriginalGlassRetrace({ ...this.listQuery }).then(res => {
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        this.list = res.data || []
 | 
			
		||||
        console.log(this.list);
 | 
			
		||||
        // this.listQuery.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
      let trueArray = this.countArray.filter(val => val === true)
 | 
			
		||||
      if (trueArray.length !== 1) {
 | 
			
		||||
        this.$message.error('请选择一个条件进行查询!')
 | 
			
		||||
      } else {
 | 
			
		||||
        if (this.useTime === true) {
 | 
			
		||||
          if (this.listQuery.packTime !== null && this.listQuery.packTime !== '' && this.listQuery.lineName !== null && this.listQuery.lineName !== '') {
 | 
			
		||||
 | 
			
		||||
            getOriginalGlassRetrace({
 | 
			
		||||
              lineNameList: [this.listQuery.lineName],
 | 
			
		||||
               ...this.listQuery
 | 
			
		||||
            }).then(res => {
 | 
			
		||||
              console.log(res);
 | 
			
		||||
              this.list = res.data || []
 | 
			
		||||
              console.log(this.list);
 | 
			
		||||
              // this.listQuery.total = res.data.total || 0
 | 
			
		||||
            })
 | 
			
		||||
          } else {
 | 
			
		||||
            this.$message.error('选择包装全检时,时间和产线均为必填!')
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          getOriginalGlassRetrace({ ...this.listQuery }).then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            this.list = res.data || []
 | 
			
		||||
            console.log(this.list);
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
    },
 | 
			
		||||
    getDict() {
 | 
			
		||||
      // 获取产品的属性列表
 | 
			
		||||
      // getCustomerList().then((response) => {
 | 
			
		||||
      //   console.log(response);
 | 
			
		||||
      //   this.customerList = response.data
 | 
			
		||||
      //   // this.listQuery.total = response.data.total;
 | 
			
		||||
      // })
 | 
			
		||||
      // getModelList().then((response) => {
 | 
			
		||||
      //   console.log(response);
 | 
			
		||||
      //   this.modelList = response.data
 | 
			
		||||
      //   // this.listQuery.total = response.data.total;
 | 
			
		||||
      // })
 | 
			
		||||
      getWorkOrderList().then((response) => {
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.formConfig[0].selectOptions = response.data.map((item) => {
 | 
			
		||||
          return {
 | 
			
		||||
            name: item.name,
 | 
			
		||||
            id: item.id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        console.log(this.formConfig[0].selectOptions);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
      })
 | 
			
		||||
      // 获取产线
 | 
			
		||||
      getCorePLList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.lineOptions = res.data;
 | 
			
		||||
			})
 | 
			
		||||
    },
 | 
			
		||||
    // handleExport() {
 | 
			
		||||
    //   // 处理查询参数
 | 
			
		||||
@@ -243,7 +394,7 @@ export default {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.listQuery.workOrderName = val.workOrderName ? val.workOrderName :undefined
 | 
			
		||||
        this.listQuery.certificateNumber = val.certificateNumber ? val.certificateNumber :undefined
 | 
			
		||||
        // this.queryParams.status = val.status
 | 
			
		||||
        // if (val.timeVal && val.timeVal.length != 0 ) {
 | 
			
		||||
        // this.listQuery.startTime =  val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
@@ -272,3 +423,17 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.blueTip::before {
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	content: '';
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 18px;
 | 
			
		||||
	background: #0b58ff;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	margin-top: 8px;
 | 
			
		||||
	margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,26 +1,52 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <SearchBar :isFold="true" :formConfigs="searchBarFormConfig" ref="search-bar"
 | 
			
		||||
      @headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<SearchBar
 | 
			
		||||
			:isFold="true"
 | 
			
		||||
			:formConfigs="searchBarFormConfig"
 | 
			
		||||
			ref="search-bar"
 | 
			
		||||
			@headBtnClick="handleSearchBarBtnClick" />
 | 
			
		||||
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list"
 | 
			
		||||
      @emitFun="handleEmitFun">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleTableBtnClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:width="90"
 | 
			
		||||
				fixed="right"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleTableBtnClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
 | 
			
		||||
    <!-- 分页组件 -->
 | 
			
		||||
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
		<!-- 分页组件 -->
 | 
			
		||||
		<pagination
 | 
			
		||||
			v-show="total > 0"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
 | 
			
		||||
    <!-- 对话框(添加 / 修改) -->
 | 
			
		||||
    <base-dialog :dialogTitle="title" :dialogVisible="open" width="50%" @close="cancel" @cancel="cancel"
 | 
			
		||||
      @confirm="submitForm">
 | 
			
		||||
      <DialogForm v-if="open" ref="form" v-model="form" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
		<!-- 对话框(添加 / 修改) -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="title"
 | 
			
		||||
			:dialogVisible="open"
 | 
			
		||||
			width="50%"
 | 
			
		||||
			@close="cancel"
 | 
			
		||||
			@cancel="cancel"
 | 
			
		||||
			@confirm="submitForm">
 | 
			
		||||
			<DialogForm
 | 
			
		||||
				v-if="open"
 | 
			
		||||
				ref="form"
 | 
			
		||||
				v-model="form" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
@@ -37,27 +63,34 @@ import moment from 'moment';
 | 
			
		||||
import DialogForm from './dialogForm.vue';
 | 
			
		||||
 | 
			
		||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'QualityInspectionRecord',
 | 
			
		||||
	components: {
 | 
			
		||||
		DialogForm,
 | 
			
		||||
	},
 | 
			
		||||
	mixins: [basicPageMixin],
 | 
			
		||||
	mixins: [basicPageMixin, tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
      rows: [
 | 
			
		||||
        [
 | 
			
		||||
          {
 | 
			
		||||
            select: true,
 | 
			
		||||
            label: '工单名称',
 | 
			
		||||
            url: 'base/core-work-order/listbyfilter',
 | 
			
		||||
            prop: 'workOrderId',
 | 
			
		||||
            rules: [{ required: true, message: '工单名称不能为空', trigger: 'change' }],
 | 
			
		||||
            bind: {
 | 
			
		||||
              filterable: true,
 | 
			
		||||
            },
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
			rows: [
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
						label: '工单名称',
 | 
			
		||||
						url: 'base/core-work-order/listbyfilter',
 | 
			
		||||
						prop: 'workOrderId',
 | 
			
		||||
						rules: [
 | 
			
		||||
							{
 | 
			
		||||
								required: true,
 | 
			
		||||
								message: '工单名称不能为空',
 | 
			
		||||
								trigger: 'change',
 | 
			
		||||
							},
 | 
			
		||||
						],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
				],
 | 
			
		||||
				[
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
@@ -65,7 +98,9 @@ export default {
 | 
			
		||||
						url: '/base/quality-inspection-det/listAll',
 | 
			
		||||
						prop: 'inspectionDetId',
 | 
			
		||||
						labelKey: 'content',
 | 
			
		||||
						rules: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '检测内容不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
@@ -93,7 +128,9 @@ export default {
 | 
			
		||||
						bind: {
 | 
			
		||||
							filterable: true,
 | 
			
		||||
						},
 | 
			
		||||
						rules: [{ required: true, message: '产线不能为空', trigger: 'blur' }],
 | 
			
		||||
						rules: [
 | 
			
		||||
							{ required: true, message: '产线不能为空', trigger: 'blur' },
 | 
			
		||||
						],
 | 
			
		||||
					},
 | 
			
		||||
					{
 | 
			
		||||
						select: true,
 | 
			
		||||
@@ -113,7 +150,6 @@ export default {
 | 
			
		||||
						label: '检测人员',
 | 
			
		||||
						prop: 'checkPerson',
 | 
			
		||||
					},
 | 
			
		||||
 | 
			
		||||
				],
 | 
			
		||||
				[{ textarea: true, label: '描述', prop: 'explainText' }],
 | 
			
		||||
				[{ input: true, label: '备注', prop: 'remark' }],
 | 
			
		||||
@@ -121,32 +157,32 @@ export default {
 | 
			
		||||
			searchBarFormConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
          label: '工单名称',
 | 
			
		||||
          placeholder: '请选择工单名称',
 | 
			
		||||
					label: '工单名称',
 | 
			
		||||
					placeholder: '请选择工单名称',
 | 
			
		||||
					param: 'workOrderId',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          filterable:true
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
          type: 'select',
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '检测内容',
 | 
			
		||||
          placeholder: '请输入检测内容',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'inspectionDetContent',
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '检测人员',
 | 
			
		||||
          placeholder: '请选择检测人员',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'checkPerson',
 | 
			
		||||
          filterable: true,
 | 
			
		||||
          multiple:true,
 | 
			
		||||
        },
 | 
			
		||||
					placeholder: '请输入检测内容',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'inspectionDetContent',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '检测人员',
 | 
			
		||||
					placeholder: '请选择检测人员',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'checkPerson',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
					multiple: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					label: '检测时间',
 | 
			
		||||
					dateType: 'daterange', // datetimerange
 | 
			
		||||
					// format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
@@ -159,27 +195,21 @@ export default {
 | 
			
		||||
					// width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
          type: this.$auth.hasPermi(
 | 
			
		||||
            'base:quality-inspection-record:query'
 | 
			
		||||
          )
 | 
			
		||||
            ? 'button'
 | 
			
		||||
            : '',
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-inspection-record:query')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi(
 | 
			
		||||
            'base:quality-inspection-record:create'
 | 
			
		||||
          )
 | 
			
		||||
            ? 'separate'
 | 
			
		||||
            : '',
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-inspection-record:create')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
					// type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi(
 | 
			
		||||
						'base:quality-inspection-record:create'
 | 
			
		||||
					)
 | 
			
		||||
					type: this.$auth.hasPermi('base:quality-inspection-record:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
@@ -195,7 +225,7 @@ export default {
 | 
			
		||||
							btnName: '修改',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:quality-inspection-record:delete')
 | 
			
		||||
				this.$auth.hasPermi('base:quality-inspection-record:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
@@ -207,64 +237,66 @@ export default {
 | 
			
		||||
					prop: 'createTime',
 | 
			
		||||
					label: '添加时间',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 180,
 | 
			
		||||
					width: 160,
 | 
			
		||||
					filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'workOrderName',
 | 
			
		||||
          label: '工单名称',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'productionLineName',
 | 
			
		||||
          label: '产线',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'sectionName',
 | 
			
		||||
          label: '工段',
 | 
			
		||||
        },
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'workOrderName',
 | 
			
		||||
					label: '工单名称',
 | 
			
		||||
					minWidth: 180,
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					// width: 128,
 | 
			
		||||
					prop: 'inspectionDetContent',
 | 
			
		||||
					label: '检测内容',
 | 
			
		||||
					minWidth: 180,
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'productionLineName',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					minWidth: 80,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'sectionName',
 | 
			
		||||
					label: '工段',
 | 
			
		||||
					minWidth: 120,
 | 
			
		||||
				},
 | 
			
		||||
				// {
 | 
			
		||||
				// 	// width: 128,
 | 
			
		||||
        //   prop: 'productionLineName',
 | 
			
		||||
				// 	label: '产线',
 | 
			
		||||
				// },
 | 
			
		||||
				{
 | 
			
		||||
					// width: 128,
 | 
			
		||||
					prop: 'checkPerson',
 | 
			
		||||
					label: '检测人员',
 | 
			
		||||
					showOverflowtooltip: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					// width: 160,
 | 
			
		||||
					prop: 'checkTime',
 | 
			
		||||
					label: '检测时间',
 | 
			
		||||
					width: 160,
 | 
			
		||||
					filter: (val) =>
 | 
			
		||||
						val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					width: 90,
 | 
			
		||||
					prop: 'source',
 | 
			
		||||
					label: '来源',
 | 
			
		||||
          filter: (val) => val == 1 ? '平板端' : '网页端',
 | 
			
		||||
					width: 80,
 | 
			
		||||
					filter: (val) => ['', '平板端', '网页端'][val],
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 搜索框需要的 keys, 与上面 queryParams 的除 pageNo, pageSize 之外的 key 一一对应
 | 
			
		||||
      searchBarKeys: ['inspectionDetContent', 'checkTime', 'workOrderId','checkPerson'],
 | 
			
		||||
			searchBarKeys: [
 | 
			
		||||
				'inspectionDetContent',
 | 
			
		||||
				'checkTime',
 | 
			
		||||
				'workOrderId',
 | 
			
		||||
				'checkPerson',
 | 
			
		||||
			],
 | 
			
		||||
			form: {
 | 
			
		||||
        id: undefined,
 | 
			
		||||
        // workOrderId:undefined,
 | 
			
		||||
				id: undefined,
 | 
			
		||||
				// workOrderId:undefined,
 | 
			
		||||
				inspectionDetId: undefined,
 | 
			
		||||
				inspectionDetContent: undefined,
 | 
			
		||||
				productionLineId: undefined,
 | 
			
		||||
				sectionId: undefined,
 | 
			
		||||
        checkPerson: undefined,
 | 
			
		||||
        workOrderId:undefined,
 | 
			
		||||
				checkPerson: undefined,
 | 
			
		||||
				workOrderId: undefined,
 | 
			
		||||
				checkTime: undefined,
 | 
			
		||||
				source: undefined,
 | 
			
		||||
				explainText: undefined,
 | 
			
		||||
@@ -273,26 +305,26 @@ export default {
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        workOrderId:null,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				workOrderId: null,
 | 
			
		||||
				inspectionDetContent: null,
 | 
			
		||||
        checkTime: [],
 | 
			
		||||
        checkPerson:undefined,
 | 
			
		||||
				checkTime: [],
 | 
			
		||||
				checkPerson: undefined,
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
		this.getProductLineList()
 | 
			
		||||
		this.getProductLineList();
 | 
			
		||||
	},
 | 
			
		||||
	watch: {
 | 
			
		||||
		form: {
 | 
			
		||||
			handler: function (val) {
 | 
			
		||||
				console.log('form change:', val);
 | 
			
		||||
			},
 | 
			
		||||
			deep: true
 | 
			
		||||
		}
 | 
			
		||||
			deep: true,
 | 
			
		||||
		},
 | 
			
		||||
		// 注册弹窗里产线改变时的监听事件
 | 
			
		||||
		// 'form.productionLineId': {
 | 
			
		||||
		// 	handler: function (val) {
 | 
			
		||||
@@ -318,29 +350,29 @@ export default {
 | 
			
		||||
		// },
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
    /** 获取搜索栏的产线列表 */
 | 
			
		||||
    deleteHandle(id, name, index, data) {
 | 
			
		||||
      this.$confirm(`确认要删除序号为${index}的数据项?`, "提示", {
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        type: "warning",
 | 
			
		||||
      })
 | 
			
		||||
        .then(() => {
 | 
			
		||||
          this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
            this.$message({
 | 
			
		||||
              message: "操作成功",
 | 
			
		||||
              type: "success",
 | 
			
		||||
              duration: 1500,
 | 
			
		||||
              onClose: () => {
 | 
			
		||||
                this.getDataList();
 | 
			
		||||
              },
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
		/** 获取搜索栏的产线列表 */
 | 
			
		||||
		deleteHandle(id, name, index, data) {
 | 
			
		||||
			this.$confirm(`确认要删除序号为${index}的数据项?`, '提示', {
 | 
			
		||||
				confirmButtonText: '确定',
 | 
			
		||||
				cancelButtonText: '取消',
 | 
			
		||||
				type: 'warning',
 | 
			
		||||
			})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
						this.$message({
 | 
			
		||||
							message: '操作成功',
 | 
			
		||||
							type: 'success',
 | 
			
		||||
							duration: 1500,
 | 
			
		||||
							onClose: () => {
 | 
			
		||||
								this.getDataList();
 | 
			
		||||
							},
 | 
			
		||||
						});
 | 
			
		||||
					});
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		getProductLineList() {
 | 
			
		||||
      this.$axios('/base/core-work-order/listbyfilter').then((response) => {
 | 
			
		||||
			this.$axios('/base/core-work-order/listbyfilter').then((response) => {
 | 
			
		||||
				this.searchBarFormConfig[0].selectOptions = response.data.map(
 | 
			
		||||
					(item) => {
 | 
			
		||||
						return {
 | 
			
		||||
@@ -349,34 +381,36 @@ export default {
 | 
			
		||||
						};
 | 
			
		||||
					}
 | 
			
		||||
				);
 | 
			
		||||
      })
 | 
			
		||||
      this.$axios('/base/quality-inspection-det/listAll').then((response) => {
 | 
			
		||||
        this.searchBarFormConfig[1].selectOptions = response.data.map(
 | 
			
		||||
          (item) => {
 | 
			
		||||
            return {
 | 
			
		||||
              name: item.content,
 | 
			
		||||
              id: item.content,
 | 
			
		||||
            };
 | 
			
		||||
          }
 | 
			
		||||
        );
 | 
			
		||||
      })
 | 
			
		||||
      this.$axios('base/quality-inspection-box-btn-auth/getUserList', {
 | 
			
		||||
          pageNo: 1,
 | 
			
		||||
          pageSize: 999
 | 
			
		||||
      }).then((res) => {
 | 
			
		||||
        // console.log(response);
 | 
			
		||||
        this.searchBarFormConfig[2].selectOptions = res.data.map((item) => ({
 | 
			
		||||
          name: item.username,
 | 
			
		||||
          id: item.username,
 | 
			
		||||
        }));
 | 
			
		||||
        })
 | 
			
		||||
			});
 | 
			
		||||
			this.$axios('/base/quality-inspection-det/listAll').then((response) => {
 | 
			
		||||
				this.searchBarFormConfig[1].selectOptions = response.data.map(
 | 
			
		||||
					(item) => {
 | 
			
		||||
						return {
 | 
			
		||||
							name: item.content,
 | 
			
		||||
							id: item.content,
 | 
			
		||||
						};
 | 
			
		||||
					}
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
			this.$axios('base/quality-inspection-box-btn-auth/getUserList', {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 999,
 | 
			
		||||
			}).then((res) => {
 | 
			
		||||
				// console.log(response);
 | 
			
		||||
				this.searchBarFormConfig[2].selectOptions = res.data.map((item) => ({
 | 
			
		||||
					name: item.username,
 | 
			
		||||
					id: item.username,
 | 
			
		||||
				}));
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			this.loading = true;
 | 
			
		||||
      // 执行查询
 | 
			
		||||
      let str = this.queryParams.checkPerson ?  this.queryParams.checkPerson.join() :undefined
 | 
			
		||||
      this.queryParams.checkPerson = str
 | 
			
		||||
			// 执行查询
 | 
			
		||||
			let str = this.queryParams.checkPerson
 | 
			
		||||
				? this.queryParams.checkPerson.join()
 | 
			
		||||
				: undefined;
 | 
			
		||||
			this.queryParams.checkPerson = str;
 | 
			
		||||
			getQualityInspectionRecordPage(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
@@ -396,8 +430,8 @@ export default {
 | 
			
		||||
				inspectionDetContent: undefined,
 | 
			
		||||
				sectionId: undefined,
 | 
			
		||||
				checkPerson: undefined,
 | 
			
		||||
        checkTime: undefined,
 | 
			
		||||
        workOrderId:undefined,
 | 
			
		||||
				checkTime: undefined,
 | 
			
		||||
				workOrderId: undefined,
 | 
			
		||||
				source: undefined,
 | 
			
		||||
				explainText: undefined,
 | 
			
		||||
				remark: undefined,
 | 
			
		||||
@@ -426,14 +460,14 @@ export default {
 | 
			
		||||
			this.reset();
 | 
			
		||||
			const id = row.id;
 | 
			
		||||
			getQualityInspectionRecord(id).then((response) => {
 | 
			
		||||
        /** 因为后端返回的时间是时间戳格式,需转换 */
 | 
			
		||||
        console.log(response.data);
 | 
			
		||||
				const info = {}
 | 
			
		||||
				Object.keys(this.form).forEach(key => {
 | 
			
		||||
					info[key] = response.data[key]
 | 
			
		||||
				/** 因为后端返回的时间是时间戳格式,需转换 */
 | 
			
		||||
				console.log(response.data);
 | 
			
		||||
				const info = {};
 | 
			
		||||
				Object.keys(this.form).forEach((key) => {
 | 
			
		||||
					info[key] = response.data[key];
 | 
			
		||||
				});
 | 
			
		||||
        this.form = info;
 | 
			
		||||
        console.log(this.form);
 | 
			
		||||
				this.form = info;
 | 
			
		||||
				console.log(this.form);
 | 
			
		||||
				this.open = true;
 | 
			
		||||
				this.title = '修改质量检查信息记录表';
 | 
			
		||||
			});
 | 
			
		||||
@@ -444,9 +478,9 @@ export default {
 | 
			
		||||
				if (!valid) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
        // 修改的提交
 | 
			
		||||
        let str = this.form.checkPerson ? this.form.checkPerson.join() : null
 | 
			
		||||
        this.form.checkPerson = str
 | 
			
		||||
				// 修改的提交
 | 
			
		||||
				let str = this.form.checkPerson ? this.form.checkPerson.join() : null;
 | 
			
		||||
				this.form.checkPerson = str;
 | 
			
		||||
				if (this.form.id != null) {
 | 
			
		||||
					updateQualityInspectionRecord(this.form).then((response) => {
 | 
			
		||||
						this.$modal.msgSuccess('修改成功');
 | 
			
		||||
 
 | 
			
		||||
@@ -60,26 +60,26 @@ export default {
 | 
			
		||||
      list: [],
 | 
			
		||||
      dynamicProps:[],
 | 
			
		||||
      searchBarFormConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '工单名称',
 | 
			
		||||
          placeholder: '请选择工单名称',
 | 
			
		||||
          param: 'workOrderIdList',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          multiple: true,
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产品',
 | 
			
		||||
          placeholder: '请选择产品',
 | 
			
		||||
          param: 'productionId',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          filterable: true
 | 
			
		||||
				},
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '工单名称',
 | 
			
		||||
        //   placeholder: '请选择工单名称',
 | 
			
		||||
        //   param: 'workOrderIdList',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   multiple: true,
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   defaultSelect: [],
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
        // },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'select',
 | 
			
		||||
				// 	label: '产品',
 | 
			
		||||
        //   placeholder: '请选择产品',
 | 
			
		||||
        //   param: 'productionId',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
				// },
 | 
			
		||||
				// {
 | 
			
		||||
				// 	type: 'input',
 | 
			
		||||
				// 	label: '检测内容',
 | 
			
		||||
@@ -193,8 +193,8 @@ export default {
 | 
			
		||||
			// },
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
        workOrderIdList:undefined,
 | 
			
		||||
        productionId: undefined,
 | 
			
		||||
        // workOrderIdList:undefined,
 | 
			
		||||
        // productionId: undefined,
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
				// productionLineId: null,
 | 
			
		||||
@@ -207,16 +207,16 @@ export default {
 | 
			
		||||
  computed: {
 | 
			
		||||
    tableProps() {
 | 
			
		||||
      return [
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'workOrderName',
 | 
			
		||||
          label: '工单名称',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          // width: 128,
 | 
			
		||||
          prop: 'productionName',
 | 
			
		||||
          label: '产品',
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   // width: 128,
 | 
			
		||||
        //   prop: 'workOrderName',
 | 
			
		||||
        //   label: '工单名称',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   // width: 128,
 | 
			
		||||
        //   prop: 'productionName',
 | 
			
		||||
        //   label: '产品',
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          // width: 160,
 | 
			
		||||
          prop: 'inspectionContent',
 | 
			
		||||
@@ -259,17 +259,17 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    if (this.$route.query.woIdString) {
 | 
			
		||||
      console.log(this.$route.query.woIdString)
 | 
			
		||||
      this.queryParams.workOrderIdList = this.$route.query.woIdString.split(',')
 | 
			
		||||
      // this.queryParams.workOrderIdList = [this.$route.query.woIdString]
 | 
			
		||||
      // let arr =[]
 | 
			
		||||
      this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',')
 | 
			
		||||
      console.log(this.searchBarFormConfig[0].defaultSelect);
 | 
			
		||||
    }
 | 
			
		||||
    // if (this.$route.query.woIdString) {
 | 
			
		||||
    //   console.log(this.$route.query.woIdString)
 | 
			
		||||
    //   this.queryParams.workOrderIdList = this.$route.query.woIdString.split(',')
 | 
			
		||||
    //   // this.queryParams.workOrderIdList = [this.$route.query.woIdString]
 | 
			
		||||
    //   // let arr =[]
 | 
			
		||||
    //   this.searchBarFormConfig[0].defaultSelect = this.$route.query.woIdString.split(',')
 | 
			
		||||
    //   console.log(this.searchBarFormConfig[0].defaultSelect);
 | 
			
		||||
    // }
 | 
			
		||||
    if (this.$route.query.startTime && this.$route.query.endTime) {
 | 
			
		||||
      // console.log(this.$route.query.startTime);
 | 
			
		||||
      this.searchBarFormConfig[2].defaultSelect = [moment(Number(this.$route.query.startTime)).format('yyyy-MM-DD HH:mm:ss'), moment(Number(this.$route.query.endTime)).format('yyyy-MM-DD HH:mm:ss'),]
 | 
			
		||||
      this.searchBarFormConfig[0].defaultSelect = [moment(Number(this.$route.query.startTime)).format('yyyy-MM-DD HH:mm:ss'), moment(Number(this.$route.query.endTime)).format('yyyy-MM-DD HH:mm:ss'),]
 | 
			
		||||
      this.queryParams.startTime = moment(Number(this.$route.query.startTime)).format('yyyy-MM-DD HH:mm:ss')
 | 
			
		||||
      this.queryParams.endTime = moment(Number(this.$route.query.endTime)).format('yyyy-MM-DD HH:mm:ss')
 | 
			
		||||
    }
 | 
			
		||||
@@ -370,8 +370,8 @@ export default {
 | 
			
		||||
		/** 取消按钮 */
 | 
			
		||||
    handleSearchBarBtnClick(val) {
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.workOrderIdList = val.workOrderIdList ? val.workOrderIdList : undefined
 | 
			
		||||
        this.queryParams.productionId = val.productionId ? val.productionId : undefined
 | 
			
		||||
        // this.queryParams.workOrderIdList = val.workOrderIdList ? val.workOrderIdList : undefined
 | 
			
		||||
        // this.queryParams.productionId = val.productionId ? val.productionId : undefined
 | 
			
		||||
        this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
 | 
			
		||||
        this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
 | 
			
		||||
        this.getList()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										280
									
								
								src/views/report/Environmental/productionDayR/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										280
									
								
								src/views/report/Environmental/productionDayR/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,280 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-01-24 15:15:24
 | 
			
		||||
 * @LastEditTime: 2024-04-23 09:05:08
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <div>
 | 
			
		||||
      <!-- <el-alert title="自定义 close-text" type="warning" close-text="知道了">
 | 
			
		||||
      </el-alert> -->
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="日" prop="time">
 | 
			
		||||
          <el-date-picker v-model="listQuery.time" value-format="timestamp" type="datetime" placeholder="选择日期">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-button type="primary" size="small"
 | 
			
		||||
            @click="getDataList">查询</el-button>
 | 
			
		||||
          <el-button  type="primary" size="small"
 | 
			
		||||
            plain @click="handleExport">导出</el-button>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-col :span="16">
 | 
			
		||||
      <inputTable :date="date" :data="tableData" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType"
 | 
			
		||||
        @refreshDataList="getDataList" />
 | 
			
		||||
    </el-col>
 | 
			
		||||
    <el-col :span="8">
 | 
			
		||||
      <inputTableTwo :data="tableDataChild" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType"
 | 
			
		||||
        @refreshDataList="getDataList" />
 | 
			
		||||
    </el-col>
 | 
			
		||||
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
			:page.sync="listQuery.pageNo"
 | 
			
		||||
			:total="listQuery.total"
 | 
			
		||||
			@pagination="getDataList" /> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import { getAutoDailyData, getProductChildData } from '@/api/report/qcReport';
 | 
			
		||||
import inputTable from './inputTable.vue';
 | 
			
		||||
import inputTableTwo from './inputTableTwo.vue';
 | 
			
		||||
 | 
			
		||||
// import { getCorePLList } from '@/api/base/coreProductionLine';
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
  components: { inputTable, inputTableTwo },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getAutoDailyData,
 | 
			
		||||
        getChildDataListURL: getProductChildData,
 | 
			
		||||
        // exportURL: exportGlasscExcel
 | 
			
		||||
      },
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        // pageSize: 10,
 | 
			
		||||
        // pageNo: 1,
 | 
			
		||||
        // total: 0,
 | 
			
		||||
        // reportType: 2,
 | 
			
		||||
        time: ''
 | 
			
		||||
      },
 | 
			
		||||
      date: '许昌安彩新能科技有限公司2024年4月份生产日报',
 | 
			
		||||
      time: '',
 | 
			
		||||
      startTimeStamp: '',
 | 
			
		||||
      endTimeStamp: '',
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableDataChild:[],
 | 
			
		||||
      proLineList: [],
 | 
			
		||||
      all: {}
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    // this.getDict()
 | 
			
		||||
    this.getTodayStartTimeAndEndTime()
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getTodayStartTimeAndEndTime() {
 | 
			
		||||
      this.listQuery.time = new Date()
 | 
			
		||||
      // this.changeTime(this.time)
 | 
			
		||||
    },
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      // 产线列表
 | 
			
		||||
      // const res = await getCorePLList();
 | 
			
		||||
      // this.proLineList = res.data;
 | 
			
		||||
    },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    multipliedByHundred(str) {
 | 
			
		||||
      console.log(str);
 | 
			
		||||
      // console.log(str)
 | 
			
		||||
      if (str != 0) {
 | 
			
		||||
        let floatVal = parseFloat(str);
 | 
			
		||||
        if (isNaN(floatVal)) {
 | 
			
		||||
          return 0;
 | 
			
		||||
        }
 | 
			
		||||
        floatVal = Math.round(str * 10000) / 100;
 | 
			
		||||
        let strVal = floatVal.toString();
 | 
			
		||||
        let searchVal = strVal.indexOf('.');
 | 
			
		||||
        if (searchVal < 0) {
 | 
			
		||||
          searchVal = strVal.length;
 | 
			
		||||
          strVal += '.';
 | 
			
		||||
        }
 | 
			
		||||
        while (strVal.length <= searchVal + 2) {
 | 
			
		||||
          strVal += '0';
 | 
			
		||||
        }
 | 
			
		||||
        return parseFloat(strVal);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      // const res = await getCorePLList()
 | 
			
		||||
      // this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true
 | 
			
		||||
      if (this.listQuery.time.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
          type: 'warning'
 | 
			
		||||
        })
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      await this.urlOptions.getDataListURL(this.listQuery).then(res => {
 | 
			
		||||
        console.log(res.data.datas);
 | 
			
		||||
        let arr = res.data.datas
 | 
			
		||||
        let obj = res.data.reportAutoYdailyRespVO
 | 
			
		||||
        obj.lineName = '压延线产量合计'
 | 
			
		||||
        arr.push(obj)
 | 
			
		||||
        // this.tableData.push(res.data.reportAutoYdailyRespVO)
 | 
			
		||||
        this.tableData = arr
 | 
			
		||||
        this.listQuery.total = res.data.length;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      })
 | 
			
		||||
      await this.urlOptions.getChildDataListURL(this.listQuery).then(res => {
 | 
			
		||||
        console.log(res.data.datas)
 | 
			
		||||
        // res.data.datas.sort((a, b) => {
 | 
			
		||||
        //   if (a['lineName'] != b['lineName']) {
 | 
			
		||||
        //     return a['lineName'].localeCompare(b['lineName']);
 | 
			
		||||
        //   }
 | 
			
		||||
        //   // if (a['groupClasses'] == '白班' && b['groupClasses'] == '夜班' ) {
 | 
			
		||||
        //   //   return a['groupClasses'].localeCompare(b['groupClasses']);
 | 
			
		||||
        //   // }
 | 
			
		||||
        //   // if (a['groupClasses'] == '夜班') {
 | 
			
		||||
        //   //   return a['groupClasses'].localeCompare(b['groupClasses']);
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        console.log(res.data.datas);
 | 
			
		||||
        let arr = res.data.datas
 | 
			
		||||
        this.tableData.forEach(ele => {
 | 
			
		||||
          res.data.datas.forEach(item => {
 | 
			
		||||
            if (ele.lineName === item.lineName && item.groupClasses != '小计') {
 | 
			
		||||
              item.width = ele.width
 | 
			
		||||
              item.thick = ele.thick
 | 
			
		||||
              item.length = ele.length
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
        let obj = res.data.reportAutoYdailyDetRespVO
 | 
			
		||||
        // obj.lineName = '合计'
 | 
			
		||||
        arr.push(obj)
 | 
			
		||||
        // this.tableChildData.push(res.data.reportAutoYdailyRespVO)
 | 
			
		||||
        this.tableDataChild = arr
 | 
			
		||||
        console.log(this.tableDataChild);
 | 
			
		||||
        // this.listQuery.total = res.data.length;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    add0(m) {
 | 
			
		||||
      return m < 10 ? '0' + m : m
 | 
			
		||||
    },
 | 
			
		||||
    format(shijianchuo) {
 | 
			
		||||
      //shijianchuo是整数,否则要parseInt转换
 | 
			
		||||
      var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
      // console.log(time)
 | 
			
		||||
      // var y = time.getFullYear();
 | 
			
		||||
      // var m = time.getMonth() + 1;
 | 
			
		||||
      // var d = time.getDate();
 | 
			
		||||
      // var h = time.getHours();
 | 
			
		||||
      // var mm = time.getMinutes();
 | 
			
		||||
      // var s = time.getSeconds();
 | 
			
		||||
      return time
 | 
			
		||||
    },
 | 
			
		||||
    // changeTime(val) {
 | 
			
		||||
    //   if (val) {
 | 
			
		||||
    //     // console.log(val)
 | 
			
		||||
    //     // console.log(val.setHours(7, 0, 0))
 | 
			
		||||
    //     // console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
 | 
			
		||||
    //     // let time = this.format(val.setHours(7, 0, 0))
 | 
			
		||||
    //     // this.startTimeStamp = this.format(val.setHours(0, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
    //     // this.startTimeStamp = this.format(val.setHours(7, 0, 0) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
    //     // console.log(this.listQuery.reportTime);
 | 
			
		||||
    //     this.listQuery.time = this.format(val.setHours(0, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
    //     // this.listQuery.time[0] = this.format(val.setHours(7, 0, 0) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
    //     // console.log(this.listQuery.reportTime);
 | 
			
		||||
    //   } else {
 | 
			
		||||
    //     this.listQuery.time = ''
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
 | 
			
		||||
    //时间戳转为yy-mm-dd hh:mm:ss
 | 
			
		||||
    timeFun(unixtimestamp) {
 | 
			
		||||
      var unixtimestamp = new Date(unixtimestamp);
 | 
			
		||||
      var year = 1900 + unixtimestamp.getYear();
 | 
			
		||||
      var month = "0" + (unixtimestamp.getMonth() + 1);
 | 
			
		||||
      var date = "0" + unixtimestamp.getDate();
 | 
			
		||||
      return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.listQuery.time = val.time ? val.time : undefined;
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.listQuery.pageNo = 1;
 | 
			
		||||
          this.listQuery.pageSize = 10;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 导出按钮操作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "许昌安彩日原片生产汇总.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
/* .blueTip { */
 | 
			
		||||
/* padding-bottom: 10px; */
 | 
			
		||||
/* } */
 | 
			
		||||
.blueTip::before {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  content: '';
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8PX;
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										305
									
								
								src/views/report/Environmental/productionDayR/inputTable.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										305
									
								
								src/views/report/Environmental/productionDayR/inputTable.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,305 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 15:49:48
 | 
			
		||||
 * @LastEditTime: 2024-04-22 16:15:08
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="edit = true">编辑</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="updateData">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table :span-method="objectSpanMethod" :id="id" :data="data" border style="width: 100%">
 | 
			
		||||
      <el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
 | 
			
		||||
        :align="item.align ? item.align : 'left'">
 | 
			
		||||
 | 
			
		||||
        <el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
 | 
			
		||||
          :align="item.align ? item.align : 'left'">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <span v-if="!edit">{{ scope.row[it.prop] }}</span>
 | 
			
		||||
            <el-input @change="handleChange"
 | 
			
		||||
              :disabled="it.label == '生产线' || it.label == '良品重量(吨)' || it.label == '月累计面积'" v-else
 | 
			
		||||
              v-model="scope.row[it.prop]">
 | 
			
		||||
            </el-input>
 | 
			
		||||
          </template>
 | 
			
		||||
          <el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
 | 
			
		||||
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}">
 | 
			
		||||
    </el-input> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { updateAutoDailyData } from '@/api/report/qcReport';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const cols = [
 | 
			
		||||
  {
 | 
			
		||||
		prop: 'xc',
 | 
			
		||||
    label: '许昌安彩新能科技有限公司2024年4月份生产日报',
 | 
			
		||||
		align: 'center',
 | 
			
		||||
		children: [
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'lineName',
 | 
			
		||||
				label: '生产线',
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'm',
 | 
			
		||||
        label: '尺寸(长、宽、厚)毫米',
 | 
			
		||||
        align: 'center',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'length',
 | 
			
		||||
            label: '长',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'width',
 | 
			
		||||
            label: '宽',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'thick',
 | 
			
		||||
            label: '高',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'm',
 | 
			
		||||
        label: '良品数',
 | 
			
		||||
        align: 'center',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'earlyNum',
 | 
			
		||||
            label: '早班',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'nightNum',
 | 
			
		||||
            label: '晚班',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'num',
 | 
			
		||||
            label: '合计',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'weight',
 | 
			
		||||
        label: '良品重量(吨)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
				prop: 'y',
 | 
			
		||||
        label: '良品玻璃面积(㎡)',
 | 
			
		||||
        align: 'center',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'earlyArea',
 | 
			
		||||
            label: '早班',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'nightArea',
 | 
			
		||||
            label: '晚班',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'area',
 | 
			
		||||
            label: '合计',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'y',
 | 
			
		||||
        label: '原片良品率',
 | 
			
		||||
        align: 'center',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'earlyRate',
 | 
			
		||||
            label: '早班',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'nightRate',
 | 
			
		||||
            label: '晚班',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'rate',
 | 
			
		||||
            label: '合计',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'monthArea',
 | 
			
		||||
        label: '月累计面积',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'remark',
 | 
			
		||||
        label: '备注',
 | 
			
		||||
      }
 | 
			
		||||
		]
 | 
			
		||||
	}
 | 
			
		||||
]
 | 
			
		||||
  export default {
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => [],
 | 
			
		||||
      },
 | 
			
		||||
      id: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default:'exportTable'
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => [],
 | 
			
		||||
      },
 | 
			
		||||
      date: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default:''
 | 
			
		||||
      },
 | 
			
		||||
      sum: {
 | 
			
		||||
        type: Object,
 | 
			
		||||
        default: () => {},
 | 
			
		||||
      },
 | 
			
		||||
      type: {
 | 
			
		||||
        type: Number,
 | 
			
		||||
        default: 3,
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
      return {
 | 
			
		||||
        cols,
 | 
			
		||||
        remark:null,
 | 
			
		||||
        edit: false,
 | 
			
		||||
        noData:false,
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
  watch: {
 | 
			
		||||
    data: {
 | 
			
		||||
      handler(newv, oldv) {
 | 
			
		||||
        if (newv.length != 0) {
 | 
			
		||||
          this.noData = false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.noData = true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        immediate: true,
 | 
			
		||||
        handler(newv, oldv) {
 | 
			
		||||
          if (newv[0] !== '') {
 | 
			
		||||
            this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
 | 
			
		||||
          } else {
 | 
			
		||||
            this.cols[0].label = this.date
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      // type: {
 | 
			
		||||
      //   immediate: true,
 | 
			
		||||
      //   handler(newv, oldv) {
 | 
			
		||||
      //     let text1 = '', text2 = '', text3 = ''
 | 
			
		||||
      //     if (newv === 3) {
 | 
			
		||||
      //       text1 = '本周'
 | 
			
		||||
      //       text2 = '上周'
 | 
			
		||||
      //       text3 = '原片合计(片/周)'
 | 
			
		||||
      //     } else if (newv === 4) {
 | 
			
		||||
      //       text1 = '本月'
 | 
			
		||||
      //       text2 = '上月'
 | 
			
		||||
      //       text3 = '原片合计(片/月)'
 | 
			
		||||
      //     } else if (newv === 2) {
 | 
			
		||||
      //       text1 = '今日'
 | 
			
		||||
      //       text2 = '昨日'
 | 
			
		||||
      //       text3 = '原片合计(片/日)'
 | 
			
		||||
      //     } else {
 | 
			
		||||
      //       text1 = '本年'
 | 
			
		||||
      //       text2 = '上年'
 | 
			
		||||
      //       text3 = '原片合计(片/年)'
 | 
			
		||||
      //     }
 | 
			
		||||
      //     this.cols[0].children[1].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[1].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[2].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[2].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[3].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[3].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[4].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[4].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[2].label = text3
 | 
			
		||||
      //   }
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
  methods: {
 | 
			
		||||
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
      let spanOneArr = [], concatOne = 0;
 | 
			
		||||
      this.data.map((item, index) => {
 | 
			
		||||
        if (index === 0) {
 | 
			
		||||
          spanOneArr.push(1);
 | 
			
		||||
        } else {
 | 
			
		||||
          //第一列需合并相同内容的判断条件
 | 
			
		||||
          if (item.lineName === this.data[index - 1].lineName) {
 | 
			
		||||
            spanOneArr[concatOne] += 1;
 | 
			
		||||
            spanOneArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanOneArr.push(1);
 | 
			
		||||
            concatOne = index;
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      if (columnIndex === 0) {
 | 
			
		||||
        const _row = spanOneArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      // if (columnIndex  == 0  ) {
 | 
			
		||||
      //   // if (rowIndex == this.data.length-1) {
 | 
			
		||||
      //     // console.log(rowIndex)
 | 
			
		||||
      //     return {
 | 
			
		||||
      //       rowspan: this.data.length - 1,
 | 
			
		||||
      //       colspan: 3
 | 
			
		||||
      //     };
 | 
			
		||||
      //   // } else {
 | 
			
		||||
      //     // return {
 | 
			
		||||
      //     //   rowspan: 0,
 | 
			
		||||
      //     //   colspan: 0
 | 
			
		||||
      //     // };
 | 
			
		||||
      //   }
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
    handleReturn() {
 | 
			
		||||
      this.edit = false
 | 
			
		||||
      console.log(this.$parent.getDataList());
 | 
			
		||||
    },
 | 
			
		||||
    handleChange(e) {
 | 
			
		||||
    },
 | 
			
		||||
      updateData() {
 | 
			
		||||
        let data = this.data.slice(0, -1)
 | 
			
		||||
        // console.log(obj)
 | 
			
		||||
        // let updateArr = this.data
 | 
			
		||||
        // updateArr.forEach((ele, index) => {
 | 
			
		||||
        //   delete ele.dailyOutputTrend
 | 
			
		||||
        //   delete ele.originalGlassStatisticsTrend
 | 
			
		||||
        //   delete ele.actualProductTrend
 | 
			
		||||
        //   delete ele.originalGlassPassTrend
 | 
			
		||||
        // });
 | 
			
		||||
        // this.data.forEach((ele, index) => {
 | 
			
		||||
        //   delete ele.dailyOutputTrend
 | 
			
		||||
        //   delete ele.originalGlassStatisticsTrend
 | 
			
		||||
        //   delete ele.actualProductTrend
 | 
			
		||||
        //   delete ele.originalGlassPassTrend
 | 
			
		||||
        // });
 | 
			
		||||
        updateAutoDailyData(data).then(response => {
 | 
			
		||||
          // updateGlassRemark(obj).then(res => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功")
 | 
			
		||||
            this.edit = false
 | 
			
		||||
          //   this.$emit("refreshDataList");
 | 
			
		||||
          // });
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										252
									
								
								src/views/report/Environmental/productionDayR/inputTableTwo.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										252
									
								
								src/views/report/Environmental/productionDayR/inputTableTwo.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,252 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-22 13:18:59
 | 
			
		||||
 * @LastEditTime: 2024-04-22 16:15:14
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <!-- <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="edit = true">编辑</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="updateData">保存</el-button> -->
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table style="margin-top:38px;width: 100%" :span-method="objectSpanMethod" :data="data" :id="id" border>
 | 
			
		||||
      <el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
 | 
			
		||||
        :align="item.align ? item.align : 'left'">
 | 
			
		||||
        <el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
 | 
			
		||||
          :align="item.align ? item.align : 'left'">
 | 
			
		||||
          <el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <span v-if="!edit">{{ scope.row[y.prop] }}</span>
 | 
			
		||||
              <el-input type="number" @change="handleChange" :disabled="false" v-else v-model="scope.row[y.prop]">
 | 
			
		||||
              </el-input>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}">
 | 
			
		||||
    </el-input> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { updateGlass, updateGlassRemark } from '@/api/report/glass';
 | 
			
		||||
 | 
			
		||||
const cols = [
 | 
			
		||||
  {
 | 
			
		||||
		prop: 'xc',
 | 
			
		||||
    // label: '许昌安彩新能科技有限公司2024年4月份生产日报',
 | 
			
		||||
		align: 'center',
 | 
			
		||||
    children: [
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'lineName',
 | 
			
		||||
        label: '产线',
 | 
			
		||||
      },
 | 
			
		||||
			{
 | 
			
		||||
        prop: 'groupClasses',
 | 
			
		||||
        label: '班次',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'tractionSpeed',
 | 
			
		||||
        label: '拉引速度(米/分)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'width',
 | 
			
		||||
        label: '板宽(mm)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'weight',
 | 
			
		||||
        label: '板重(g)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'pullWeight',
 | 
			
		||||
        label: '拉引速度(吨/班)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'pullArea',
 | 
			
		||||
        label: '拉引面积(平方米)',
 | 
			
		||||
      },
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'm',
 | 
			
		||||
        label: '尺寸(长、宽、厚)毫米',
 | 
			
		||||
        align: 'center',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'length',
 | 
			
		||||
            label: '长',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'width',
 | 
			
		||||
            label: '宽',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'thick',
 | 
			
		||||
            label: '高',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
		]
 | 
			
		||||
	}
 | 
			
		||||
]
 | 
			
		||||
  export default {
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => [],
 | 
			
		||||
      },
 | 
			
		||||
      id: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default:'exportTable'
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => [],
 | 
			
		||||
      },
 | 
			
		||||
      date: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default:''
 | 
			
		||||
      },
 | 
			
		||||
      sum: {
 | 
			
		||||
        type: Object,
 | 
			
		||||
        default: () => {},
 | 
			
		||||
      },
 | 
			
		||||
      type: {
 | 
			
		||||
        type: Number,
 | 
			
		||||
        default: 3,
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
      return {
 | 
			
		||||
        cols,
 | 
			
		||||
        remark:null,
 | 
			
		||||
        edit: false,
 | 
			
		||||
        noData:false,
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
  watch: {
 | 
			
		||||
    data: {
 | 
			
		||||
      handler(newv, oldv) {
 | 
			
		||||
        if (newv.length != 0) {
 | 
			
		||||
          this.noData = false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.noData = true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        immediate: true,
 | 
			
		||||
        handler(newv, oldv) {
 | 
			
		||||
          if (newv[0] !== '') {
 | 
			
		||||
            this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
 | 
			
		||||
          } else {
 | 
			
		||||
            this.cols[0].label = this.date
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      // type: {
 | 
			
		||||
      //   immediate: true,
 | 
			
		||||
      //   handler(newv, oldv) {
 | 
			
		||||
      //     let text1 = '', text2 = '', text3 = ''
 | 
			
		||||
      //     if (newv === 3) {
 | 
			
		||||
      //       text1 = '本周'
 | 
			
		||||
      //       text2 = '上周'
 | 
			
		||||
      //       text3 = '原片合计(片/周)'
 | 
			
		||||
      //     } else if (newv === 4) {
 | 
			
		||||
      //       text1 = '本月'
 | 
			
		||||
      //       text2 = '上月'
 | 
			
		||||
      //       text3 = '原片合计(片/月)'
 | 
			
		||||
      //     } else if (newv === 2) {
 | 
			
		||||
      //       text1 = '今日'
 | 
			
		||||
      //       text2 = '昨日'
 | 
			
		||||
      //       text3 = '原片合计(片/日)'
 | 
			
		||||
      //     } else {
 | 
			
		||||
      //       text1 = '本年'
 | 
			
		||||
      //       text2 = '上年'
 | 
			
		||||
      //       text3 = '原片合计(片/年)'
 | 
			
		||||
      //     }
 | 
			
		||||
      //     this.cols[0].children[1].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[1].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[2].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[2].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[3].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[3].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[4].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[4].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[2].label = text3
 | 
			
		||||
      //   }
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
  methods: {
 | 
			
		||||
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
      let spanOneArr = [], concatOne = 0;
 | 
			
		||||
      this.data.map((item, index) => {
 | 
			
		||||
        if (index === 0) {
 | 
			
		||||
          spanOneArr.push(1);
 | 
			
		||||
        } else {
 | 
			
		||||
          //第一列需合并相同内容的判断条件
 | 
			
		||||
          if (item.lineName === this.data[index - 1].lineName) {
 | 
			
		||||
            spanOneArr[concatOne] += 1;
 | 
			
		||||
            spanOneArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanOneArr.push(1);
 | 
			
		||||
            concatOne = index;
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      if (columnIndex === 0) {
 | 
			
		||||
        const _row = spanOneArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleReturn() {
 | 
			
		||||
      this.edit = false
 | 
			
		||||
      console.log(this.$parent.getDataList());
 | 
			
		||||
    },
 | 
			
		||||
    handleChange(e) {
 | 
			
		||||
    },
 | 
			
		||||
      updateData() {
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // this.data.forEach((ele, index) => {
 | 
			
		||||
        //   if (ele.det === false) {
 | 
			
		||||
        //     this.data[index].lineId = ''
 | 
			
		||||
        //     this.data[index].remark = this.remark
 | 
			
		||||
        //     obj = ele
 | 
			
		||||
        //     delete this.data[index].dailyOutputTrend
 | 
			
		||||
        //     delete this.data[index].originalGlassStatisticsTrend
 | 
			
		||||
        //     delete this.data[index].actualProductTrend
 | 
			
		||||
        //     delete this.data[index].originalGlassPassTrend
 | 
			
		||||
        //     this.data.splice(index, 1)
 | 
			
		||||
        //   }
 | 
			
		||||
        // })
 | 
			
		||||
        // let updateArr = this.data
 | 
			
		||||
        // updateArr.forEach((ele, index) => {
 | 
			
		||||
        //   delete ele.dailyOutputTrend
 | 
			
		||||
        //   delete ele.originalGlassStatisticsTrend
 | 
			
		||||
        //   delete ele.actualProductTrend
 | 
			
		||||
        //   delete ele.originalGlassPassTrend
 | 
			
		||||
        // });
 | 
			
		||||
        // this.data.forEach((ele, index) => {
 | 
			
		||||
        //   delete ele.dailyOutputTrend
 | 
			
		||||
        //   delete ele.originalGlassStatisticsTrend
 | 
			
		||||
        //   delete ele.actualProductTrend
 | 
			
		||||
        //   delete ele.originalGlassPassTrend
 | 
			
		||||
        // });
 | 
			
		||||
        // updateGlass(updateArr).then(response => {
 | 
			
		||||
        //   updateGlassRemark(obj).then(res => {
 | 
			
		||||
        //     this.$modal.msgSuccess("修改成功");
 | 
			
		||||
        //     this.edit = false;
 | 
			
		||||
        //     this.$emit("refreshDataList");
 | 
			
		||||
        //   });
 | 
			
		||||
        // });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										220
									
								
								src/views/report/Environmental/productionDayR/secondTable.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										220
									
								
								src/views/report/Environmental/productionDayR/secondTable.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,220 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 16:32:03
 | 
			
		||||
 * @LastEditTime: 2024-04-18 16:34:49
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="edit = true">编辑</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="updateData">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table :id="id" :data="data" border style="width: 100%">
 | 
			
		||||
      <el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
 | 
			
		||||
        :align="item.align ? item.align : 'left'">
 | 
			
		||||
        <el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
 | 
			
		||||
          :align="item.align ? item.align : 'left'">
 | 
			
		||||
          <el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
              <span v-if="!edit">{{ scope.row[y.prop] }}</span>
 | 
			
		||||
              <el-input type="number" @change="handleChange" :disabled="y.prop == 'dailyOutputTrend' || y.prop === 'originalGlassStatisticsTrend'
 | 
			
		||||
                 || y.prop === 'actualProductTrend' || y.prop === 'originalGlassPassTrend' || y.prop === 'originalGlassPassNow' || y.prop === 'originalGlassPassHis'
 | 
			
		||||
              " v-else v-model="scope.row[y.prop]"></el-input>
 | 
			
		||||
            </template>
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}">
 | 
			
		||||
    </el-input> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { updateGlass, updateGlassRemark } from '@/api/report/glass';
 | 
			
		||||
 | 
			
		||||
const cols = [
 | 
			
		||||
  {
 | 
			
		||||
		prop: 'xc',
 | 
			
		||||
    label: '许昌安彩新能科技有限公司2024年4月份生产日报',
 | 
			
		||||
		align: 'center',
 | 
			
		||||
		children: [
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'lineName',
 | 
			
		||||
				label: '生产线',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: '拉引速度(米/分)',
 | 
			
		||||
        label: '班次',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'width2',
 | 
			
		||||
        label: '板宽(mm)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'weight2',
 | 
			
		||||
        label: '板重(g)',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'lineName',
 | 
			
		||||
        label: '拉引量(吨/班)',
 | 
			
		||||
      },
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'm',
 | 
			
		||||
        label: '尺寸(长、宽、厚)毫米',
 | 
			
		||||
        align: 'center',
 | 
			
		||||
        children: [
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'length',
 | 
			
		||||
            label: '长',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'width',
 | 
			
		||||
            label: '宽',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: 'thick',
 | 
			
		||||
            label: '高',
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      }
 | 
			
		||||
		]
 | 
			
		||||
	}
 | 
			
		||||
]
 | 
			
		||||
  export default {
 | 
			
		||||
    props: {
 | 
			
		||||
      data: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => [],
 | 
			
		||||
      },
 | 
			
		||||
      id: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default:'exportTable'
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        type: Array,
 | 
			
		||||
        default: () => [],
 | 
			
		||||
      },
 | 
			
		||||
      date: {
 | 
			
		||||
        type: String,
 | 
			
		||||
        default:''
 | 
			
		||||
      },
 | 
			
		||||
      sum: {
 | 
			
		||||
        type: Object,
 | 
			
		||||
        default: () => {},
 | 
			
		||||
      },
 | 
			
		||||
      type: {
 | 
			
		||||
        type: Number,
 | 
			
		||||
        default: 3,
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
      return {
 | 
			
		||||
        cols,
 | 
			
		||||
        remark:null,
 | 
			
		||||
        edit: false,
 | 
			
		||||
        noData:false,
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
  watch: {
 | 
			
		||||
    data: {
 | 
			
		||||
      handler(newv, oldv) {
 | 
			
		||||
        if (newv.length != 0) {
 | 
			
		||||
          this.noData = false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.noData = true
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        immediate: true,
 | 
			
		||||
        handler(newv, oldv) {
 | 
			
		||||
          if (newv[0] !== '') {
 | 
			
		||||
            this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
 | 
			
		||||
          } else {
 | 
			
		||||
            this.cols[0].label = this.date
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      // type: {
 | 
			
		||||
      //   immediate: true,
 | 
			
		||||
      //   handler(newv, oldv) {
 | 
			
		||||
      //     let text1 = '', text2 = '', text3 = ''
 | 
			
		||||
      //     if (newv === 3) {
 | 
			
		||||
      //       text1 = '本周'
 | 
			
		||||
      //       text2 = '上周'
 | 
			
		||||
      //       text3 = '原片合计(片/周)'
 | 
			
		||||
      //     } else if (newv === 4) {
 | 
			
		||||
      //       text1 = '本月'
 | 
			
		||||
      //       text2 = '上月'
 | 
			
		||||
      //       text3 = '原片合计(片/月)'
 | 
			
		||||
      //     } else if (newv === 2) {
 | 
			
		||||
      //       text1 = '今日'
 | 
			
		||||
      //       text2 = '昨日'
 | 
			
		||||
      //       text3 = '原片合计(片/日)'
 | 
			
		||||
      //     } else {
 | 
			
		||||
      //       text1 = '本年'
 | 
			
		||||
      //       text2 = '上年'
 | 
			
		||||
      //       text3 = '原片合计(片/年)'
 | 
			
		||||
      //     }
 | 
			
		||||
      //     this.cols[0].children[1].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[1].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[2].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[2].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[3].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[3].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[4].children[0].label = text1
 | 
			
		||||
      //     this.cols[0].children[4].children[1].label = text2
 | 
			
		||||
      //     this.cols[0].children[2].label = text3
 | 
			
		||||
      //   }
 | 
			
		||||
      // }
 | 
			
		||||
    },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleReturn() {
 | 
			
		||||
      this.edit = false
 | 
			
		||||
      console.log(this.$parent.getDataList());
 | 
			
		||||
    },
 | 
			
		||||
    handleChange(e) {
 | 
			
		||||
    },
 | 
			
		||||
      updateData() {
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // this.data.forEach((ele, index) => {
 | 
			
		||||
        //   if (ele.det === false) {
 | 
			
		||||
        //     this.data[index].lineId = ''
 | 
			
		||||
        //     this.data[index].remark = this.remark
 | 
			
		||||
        //     obj = ele
 | 
			
		||||
        //     delete this.data[index].dailyOutputTrend
 | 
			
		||||
        //     delete this.data[index].originalGlassStatisticsTrend
 | 
			
		||||
        //     delete this.data[index].actualProductTrend
 | 
			
		||||
        //     delete this.data[index].originalGlassPassTrend
 | 
			
		||||
        //     this.data.splice(index, 1)
 | 
			
		||||
        //   }
 | 
			
		||||
        // })
 | 
			
		||||
        // let updateArr = this.data
 | 
			
		||||
        // updateArr.forEach((ele, index) => {
 | 
			
		||||
        //   delete ele.dailyOutputTrend
 | 
			
		||||
        //   delete ele.originalGlassStatisticsTrend
 | 
			
		||||
        //   delete ele.actualProductTrend
 | 
			
		||||
        //   delete ele.originalGlassPassTrend
 | 
			
		||||
        // });
 | 
			
		||||
        // this.data.forEach((ele, index) => {
 | 
			
		||||
        //   delete ele.dailyOutputTrend
 | 
			
		||||
        //   delete ele.originalGlassStatisticsTrend
 | 
			
		||||
        //   delete ele.actualProductTrend
 | 
			
		||||
        //   delete ele.originalGlassPassTrend
 | 
			
		||||
        // });
 | 
			
		||||
        updateGlass(updateArr).then(response => {
 | 
			
		||||
          updateGlassRemark(obj).then(res => {
 | 
			
		||||
            this.$modal.msgSuccess("修改成功");
 | 
			
		||||
            this.edit = false;
 | 
			
		||||
            this.$emit("refreshDataList");
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										503
									
								
								src/views/report/Environmental/sectionProduction/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										503
									
								
								src/views/report/Environmental/sectionProduction/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,503 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container sectionProductionReport">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			class="sectionProductionTable1"
 | 
			
		||||
			ref="sectionProductionTable11"
 | 
			
		||||
			id="sectionProductionTable1"
 | 
			
		||||
			:table-props="tableProp"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			:span-method="objectSpanMethod"
 | 
			
		||||
			:max-height="tableH" />
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			style="margin-top: 10px"
 | 
			
		||||
			:formConfigs="formConfig2"
 | 
			
		||||
			@headBtnClick="buttonClick2" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			class="sectionProductionTable2"
 | 
			
		||||
			ref="sectionProductionTable22"
 | 
			
		||||
			id="sectionProductionTable2"
 | 
			
		||||
			:table-props="tableProp2"
 | 
			
		||||
			:table-data="tableData2"
 | 
			
		||||
			:span-method="objectSpanMethod2"
 | 
			
		||||
			:max-height="tableH" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
const tableProp1 = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'lineName',
 | 
			
		||||
		label: '生产线',
 | 
			
		||||
		width: 80,
 | 
			
		||||
		fixed: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		label: '时间',
 | 
			
		||||
		fixed: true,
 | 
			
		||||
		width: 140,
 | 
			
		||||
		children: [
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'procedure',
 | 
			
		||||
				label: '工序',
 | 
			
		||||
				fixed: true,
 | 
			
		||||
				width: 140,
 | 
			
		||||
			},
 | 
			
		||||
		],
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
import {
 | 
			
		||||
	originalSection,
 | 
			
		||||
	getOriginalLine,
 | 
			
		||||
	getProcessingLine,
 | 
			
		||||
	processing,
 | 
			
		||||
} from '@/api/report/customizedReports';
 | 
			
		||||
import FileSaver from 'file-saver';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'SectionProduction',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tableH: this.tableHeight(280) / 2,
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '生产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'lineId',
 | 
			
		||||
					multiple: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
					selectOptions: [
 | 
			
		||||
						{ id: '1', name: '当前班次' },
 | 
			
		||||
						{ id: '2', name: '近24小时' },
 | 
			
		||||
						{ id: '3', name: '昨日日报' },
 | 
			
		||||
					],
 | 
			
		||||
					defaultSelect: '1',
 | 
			
		||||
					param: 'timeType',
 | 
			
		||||
					clearable: false,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			formConfig2: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '生产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'lineId',
 | 
			
		||||
					multiple: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
					defaultSelect: '1',
 | 
			
		||||
					selectOptions: [
 | 
			
		||||
						{ id: '1', name: '当前班次' },
 | 
			
		||||
						{ id: '2', name: '近24小时' },
 | 
			
		||||
						{ id: '3', name: '昨日日报' },
 | 
			
		||||
					],
 | 
			
		||||
					param: 'timeType',
 | 
			
		||||
					clearable: false,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				startTime: '',
 | 
			
		||||
				endTime: '',
 | 
			
		||||
				lineId: [],
 | 
			
		||||
			},
 | 
			
		||||
			queryParams2: {
 | 
			
		||||
				startTime: '',
 | 
			
		||||
				endTime: '',
 | 
			
		||||
				lineId: [],
 | 
			
		||||
			},
 | 
			
		||||
			tableProp1,
 | 
			
		||||
			tableProp: [],
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProp2: [],
 | 
			
		||||
			tableData2: [],
 | 
			
		||||
			procedureName: [
 | 
			
		||||
				// { name: '压延(拉引量t)', ename: 'calenderingCapacity' },
 | 
			
		||||
				{ name: '优化切割(片)', ename: 'cuttingNum' },
 | 
			
		||||
				{ name: '堆垛(片)', ename: 'unloadPieces' },
 | 
			
		||||
				{ name: '堆垛(托)', ename: 'unloadCount' },
 | 
			
		||||
				{ name: '优切良品率(%)', ename: 'rate' },
 | 
			
		||||
			],
 | 
			
		||||
			span: [], //表2第一列合并
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		window.addEventListener('resize', this._setTableHeight);
 | 
			
		||||
	},
 | 
			
		||||
	destroyed() {
 | 
			
		||||
		window.removeEventListener('resize', this._setTableHeight);
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getLine();
 | 
			
		||||
		this.tableProp = this.tableProp1;
 | 
			
		||||
		this.tableProp2 = this.tableProp1;
 | 
			
		||||
		let arr = this.getTime('1');
 | 
			
		||||
		this.queryParams.startTime = arr[0];
 | 
			
		||||
		this.queryParams.endTime = arr[1];
 | 
			
		||||
		this.queryParams2.startTime = arr[0];
 | 
			
		||||
		this.queryParams2.endTime = arr[1];
 | 
			
		||||
		this.getList();
 | 
			
		||||
		this.getList2();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		_setTableHeight() {
 | 
			
		||||
			this.tableH = this.tableHeight(280) / 2;
 | 
			
		||||
		},
 | 
			
		||||
		getLine() {
 | 
			
		||||
			getOriginalLine().then((res) => {
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
			getProcessingLine().then((res) => {
 | 
			
		||||
				this.formConfig2[0].selectOptions = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			// 获取数据
 | 
			
		||||
			originalSection({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				let data = res.data;
 | 
			
		||||
				this.tableProp = [];
 | 
			
		||||
				let timeArr = this.uniqueTime(data, 'timeStr');
 | 
			
		||||
				let arr = [];
 | 
			
		||||
				let arr1 = [];
 | 
			
		||||
				timeArr.map((item) => {
 | 
			
		||||
					let obj = {};
 | 
			
		||||
					obj.prop = item.timeStr;
 | 
			
		||||
					obj.label = item.timeStr;
 | 
			
		||||
					obj.minWidth = 140;
 | 
			
		||||
					arr.push(obj);
 | 
			
		||||
				});
 | 
			
		||||
				let obj1 = {};
 | 
			
		||||
				obj1.children = arr.length > 0 ? arr : [{ label: '合计' }];
 | 
			
		||||
				obj1.label =
 | 
			
		||||
					'24小时原片工段产量表(' +
 | 
			
		||||
					moment(this.queryParams.startTime).format('YYYY-MM-DD HH:mm:ss') +
 | 
			
		||||
					'-' +
 | 
			
		||||
					moment(this.queryParams.endTime).format('YYYY-MM-DD HH:mm:ss') +
 | 
			
		||||
					')';
 | 
			
		||||
				arr1.push(obj1);
 | 
			
		||||
				this.tableProp = this.tableProp1.concat(arr1); //表头
 | 
			
		||||
				console.log(this.tableProp);
 | 
			
		||||
				this.transferData(data);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getTime(val) {
 | 
			
		||||
			let nowTime = moment().valueOf();
 | 
			
		||||
			let dTime = moment(moment().format('YYYY-MM-DD') + ' 07:00:00').valueOf();
 | 
			
		||||
			switch (val) {
 | 
			
		||||
				case '1':
 | 
			
		||||
					let fTime = moment(
 | 
			
		||||
						moment(moment().valueOf() - 86400000).format('YYYY-MM-DD') +
 | 
			
		||||
							' 19:00:00'
 | 
			
		||||
					).valueOf();
 | 
			
		||||
					let nTime = moment(
 | 
			
		||||
						moment().format('YYYY-MM-DD') + ' 19:00:00'
 | 
			
		||||
					).valueOf();
 | 
			
		||||
					if (nowTime <= dTime) {
 | 
			
		||||
						return [fTime, nowTime];
 | 
			
		||||
					} else if (nowTime > dTime && nowTime <= nTime) {
 | 
			
		||||
						return [dTime, nowTime];
 | 
			
		||||
					} else {
 | 
			
		||||
						return [nTime, nowTime];
 | 
			
		||||
					}
 | 
			
		||||
					break;
 | 
			
		||||
				case '2':
 | 
			
		||||
					let lastTime = nowTime - 86400000;
 | 
			
		||||
					return [lastTime, nowTime];
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					let f1Time = dTime - 86400000 * 2;
 | 
			
		||||
					let f2Time = dTime - 86400000;
 | 
			
		||||
					if (nowTime <= dTime) {
 | 
			
		||||
						return [f1Time, f2Time];
 | 
			
		||||
					} else {
 | 
			
		||||
						return [f2Time, dTime];
 | 
			
		||||
					}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.lineId = val.lineId;
 | 
			
		||||
				this.queryParams.startTime = this.getTime(val.timeType)[0];
 | 
			
		||||
				this.queryParams.endTime = this.getTime(val.timeType)[1];
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				//导出
 | 
			
		||||
				this.exportTable('.sectionProductionTable1', '原片工段数据.xlsx', 0);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		//导出表格
 | 
			
		||||
		exportTable(className, fileName, num) {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			var fix = document.querySelectorAll('.el-table__fixed')[num];
 | 
			
		||||
			var table = document.querySelector(className).childNodes[0];
 | 
			
		||||
			var wb;
 | 
			
		||||
			import('xlsx').then((excel) => {
 | 
			
		||||
				if (fix) {
 | 
			
		||||
					wb = excel.utils.table_to_book(table.removeChild(fix));
 | 
			
		||||
					table.appendChild(fix);
 | 
			
		||||
				} else {
 | 
			
		||||
					wb = excel.utils.table_to_book(table);
 | 
			
		||||
				}
 | 
			
		||||
				/* 获取二进制字符串作为输出 */
 | 
			
		||||
				var wbout = excel.write(wb, {
 | 
			
		||||
					bookType: 'xlsx',
 | 
			
		||||
					bookSST: true,
 | 
			
		||||
					type: 'array',
 | 
			
		||||
				});
 | 
			
		||||
				try {
 | 
			
		||||
					FileSaver.saveAs(
 | 
			
		||||
						new Blob([wbout], { type: 'application/octet-stream' }),
 | 
			
		||||
						//设置导出文件名称
 | 
			
		||||
						fileName
 | 
			
		||||
					);
 | 
			
		||||
				} catch (e) {
 | 
			
		||||
					if (typeof console !== 'undefined') console.log(e, wbout);
 | 
			
		||||
				}
 | 
			
		||||
				return wbout;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		transferData(data) {
 | 
			
		||||
			let tempData = [];
 | 
			
		||||
			let lineNum = 0; //第一条产线
 | 
			
		||||
			for (let i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.procedureName.map((item) => {
 | 
			
		||||
						let obj = {};
 | 
			
		||||
						obj.lineName = data[i].lineName;
 | 
			
		||||
						obj.procedure = item.name;
 | 
			
		||||
						obj.eName = item.ename;
 | 
			
		||||
						obj[data[i].timeStr] = data[i][item.ename];
 | 
			
		||||
						tempData.push(obj);
 | 
			
		||||
					});
 | 
			
		||||
					lineNum++;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].lineName === data[i - 1].lineName) {
 | 
			
		||||
						//相同产线,添加列
 | 
			
		||||
						let startNum = 4 * (lineNum - 1);
 | 
			
		||||
						let endNum = 4 * lineNum - 1;
 | 
			
		||||
						for (let k = startNum; k <= endNum; k++) {
 | 
			
		||||
							let str = this.procedureName[k % 4];
 | 
			
		||||
							tempData[k][data[i].timeStr] = data[i][str.ename];
 | 
			
		||||
						}
 | 
			
		||||
					} else {
 | 
			
		||||
						//不同产线,同时添加5行
 | 
			
		||||
						this.procedureName.map((item) => {
 | 
			
		||||
							let obj = {};
 | 
			
		||||
							obj.lineName = data[i].lineName;
 | 
			
		||||
							obj.procedure = item.name;
 | 
			
		||||
							obj.eName = item.ename;
 | 
			
		||||
							obj[data[i].timeStr] = data[i][item.ename];
 | 
			
		||||
							tempData.push(obj);
 | 
			
		||||
						});
 | 
			
		||||
						lineNum++;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			this.tableData = tempData;
 | 
			
		||||
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.reTable1();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		reTable1() {
 | 
			
		||||
			this.$refs.sectionProductionTable11.doLayout('sectionProductionTable1');
 | 
			
		||||
		},
 | 
			
		||||
		reTable2() {
 | 
			
		||||
			this.$refs.sectionProductionTable22.doLayout('sectionProductionTable2');
 | 
			
		||||
		},
 | 
			
		||||
		// 时间去重
 | 
			
		||||
		uniqueTime(arr, prop) {
 | 
			
		||||
			return arr.filter((value, index, self) => {
 | 
			
		||||
				return (
 | 
			
		||||
					self.findIndex((t) => {
 | 
			
		||||
						return t[prop] === value[prop];
 | 
			
		||||
					}) === index
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 合并第一列
 | 
			
		||||
		objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex === 0) {
 | 
			
		||||
				if (rowIndex % 4 === 0) {
 | 
			
		||||
					return {
 | 
			
		||||
						rowspan: 4,
 | 
			
		||||
						colspan: 1,
 | 
			
		||||
					};
 | 
			
		||||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						rowspan: 0,
 | 
			
		||||
						colspan: 0,
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList2() {
 | 
			
		||||
			// 获取数据
 | 
			
		||||
			processing({ ...this.queryParams2 }).then((res) => {
 | 
			
		||||
				this.tableData2 = [];
 | 
			
		||||
				let data = res.data;
 | 
			
		||||
				for (let i = 0; i < data.length; i++) {
 | 
			
		||||
					for (let j = 0; j < data[i].productDet.length; j++) {
 | 
			
		||||
						let obj = {};
 | 
			
		||||
						obj.lineName = data[i].lineName;
 | 
			
		||||
						obj.procedure = data[i].productDet[j].name;
 | 
			
		||||
						data[i].productDet[j].data.map((item) => {
 | 
			
		||||
							obj[item.timeStr] = item.output
 | 
			
		||||
								? item.output
 | 
			
		||||
								: item.input
 | 
			
		||||
								? item.input
 | 
			
		||||
								: null;
 | 
			
		||||
						});
 | 
			
		||||
						obj.sum = data[i].productDet[j].allOutput
 | 
			
		||||
							? data[i].productDet[j].allOutput
 | 
			
		||||
							: data[i].productDet[j].allInput
 | 
			
		||||
							? data[i].productDet[j].allInput
 | 
			
		||||
							: null;
 | 
			
		||||
						this.tableData2.push(obj);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				let arr = [];
 | 
			
		||||
				let propsArr = data[0].timeStr || [];
 | 
			
		||||
				propsArr.map((t) => {
 | 
			
		||||
					let obj = {};
 | 
			
		||||
					obj.prop = t;
 | 
			
		||||
					obj.label = t;
 | 
			
		||||
					obj.minWidth = 140;
 | 
			
		||||
					arr.push(obj);
 | 
			
		||||
				});
 | 
			
		||||
				arr.push({ prop: 'sum', label: '合计' });
 | 
			
		||||
				let arr1 = [];
 | 
			
		||||
				let obj1 = {};
 | 
			
		||||
				obj1.children = arr;
 | 
			
		||||
				obj1.label =
 | 
			
		||||
					'24小时深加工工段产量表(' +
 | 
			
		||||
					moment(this.queryParams2.startTime).format('YYYY-MM-DD HH:mm:ss') +
 | 
			
		||||
					'-' +
 | 
			
		||||
					moment(this.queryParams2.endTime).format('YYYY-MM-DD HH:mm:ss') +
 | 
			
		||||
					')';
 | 
			
		||||
				arr1.push(obj1);
 | 
			
		||||
				this.tableProp2 = this.tableProp1.concat(arr1); //表头
 | 
			
		||||
				this.getSpanArr(this.tableData2);
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.reTable2();
 | 
			
		||||
				});
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 表格2
 | 
			
		||||
		buttonClick2(val) {
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams2.lineId = val.lineId;
 | 
			
		||||
				this.queryParams2.startTime = this.getTime(val.timeType)[0];
 | 
			
		||||
				this.queryParams2.endTime = this.getTime(val.timeType)[1];
 | 
			
		||||
				this.getList2();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.exportTable('.sectionProductionTable2', '深加工工段数据.xlsx', 1);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 获取合并行
 | 
			
		||||
		getSpanArr(data) {
 | 
			
		||||
			this.span = [];
 | 
			
		||||
			for (var i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.span.push(1);
 | 
			
		||||
					this.index = 0;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].lineName === data[i - 1].lineName) {
 | 
			
		||||
						this.span[this.index] += 1;
 | 
			
		||||
						this.span.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						this.span.push(1);
 | 
			
		||||
						this.index = i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		objectSpanMethod2({ rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex === 0) {
 | 
			
		||||
				const _row = this.span[rowIndex];
 | 
			
		||||
				return {
 | 
			
		||||
					rowspan: _row,
 | 
			
		||||
					colspan: 1,
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.sectionProductionReport {
 | 
			
		||||
	.el-table thead.is-group tr:first-of-type th:nth-child(2) {
 | 
			
		||||
		border-bottom: none;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table thead.is-group tr:first-of-type th:nth-child(2) div.cell {
 | 
			
		||||
		padding-left: 82px;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table th.el-table__cell {
 | 
			
		||||
		height: 28px;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table thead.is-group tr:first-of-type th:nth-child(2):before {
 | 
			
		||||
		content: '';
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		height: 80px;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		background-color: #ebeef5;
 | 
			
		||||
		transform: rotate(-63deg);
 | 
			
		||||
		-webkit-transform-origin: top;
 | 
			
		||||
		transform-origin: top;
 | 
			
		||||
		width: 1px;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table thead.is-group tr:last-of-type th:nth-child(1):before {
 | 
			
		||||
		content: '';
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		height: 93px;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		left: 55px;
 | 
			
		||||
		background-color: #ebeef5;
 | 
			
		||||
		transform: rotate(-63deg);
 | 
			
		||||
		-webkit-transform-origin: top;
 | 
			
		||||
		transform-origin: top;
 | 
			
		||||
		width: 1px;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										389
									
								
								src/views/report/Product/monthly.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										389
									
								
								src/views/report/Product/monthly.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,389 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2024-04-22 15:49:56
 | 
			
		||||
 * @LastEditTime: 2024-04-26 10:32:29
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="weekly">
 | 
			
		||||
		<el-form
 | 
			
		||||
			:inline="true"
 | 
			
		||||
			:model="listQuery"
 | 
			
		||||
			class="blueTip">
 | 
			
		||||
			<el-form-item
 | 
			
		||||
				label="月份"
 | 
			
		||||
				prop="reportTime">
 | 
			
		||||
				<el-date-picker
 | 
			
		||||
					v-model="listQuery.time"
 | 
			
		||||
					value-format="timestamp"
 | 
			
		||||
					type="month"
 | 
			
		||||
					size="small"
 | 
			
		||||
					placeholder="选择月"></el-date-picker>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			<el-button
 | 
			
		||||
				v-if="this.$auth.hasPermi('base:report-auto-production:query')"
 | 
			
		||||
				type="primary"
 | 
			
		||||
				size="small"
 | 
			
		||||
				@click="getList">
 | 
			
		||||
				查询
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<el-button
 | 
			
		||||
				v-if="
 | 
			
		||||
					this.$auth.hasPermiAnd([
 | 
			
		||||
						'base:report-auto-original-glass:export',
 | 
			
		||||
						'base:report-auto-production:export',
 | 
			
		||||
					])
 | 
			
		||||
				"
 | 
			
		||||
				type="primary"
 | 
			
		||||
				size="small"
 | 
			
		||||
				plain
 | 
			
		||||
				@click="handleExport">
 | 
			
		||||
				导出
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</el-form>
 | 
			
		||||
		<base-table
 | 
			
		||||
			ref="productionDataMonthTable11"
 | 
			
		||||
			id="productionDataMonthTable1"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			:span-method="objectSpanMethod1"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH" />
 | 
			
		||||
		<base-table
 | 
			
		||||
		ref="productionDataMonthTable22"
 | 
			
		||||
			id="productionDataMonthTable2"
 | 
			
		||||
			:table-props="tableProps1"
 | 
			
		||||
			:table-data="tableData1"
 | 
			
		||||
			:span-method="objectSpanMethod1"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			style="margin-top: 15px" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { productionMonthY, productionMonthD } from '@/api/report/glass';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import FileSaver from 'file-saver';
 | 
			
		||||
import * as XLSX from 'xlsx/xlsx.mjs';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	// components: { monthWeek, proMonth },
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			heightNum: 350,
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				time: '',
 | 
			
		||||
			},
 | 
			
		||||
			// startTimeStamp: '',
 | 
			
		||||
			// endTimeStamp: '',
 | 
			
		||||
			// reportTime: '',
 | 
			
		||||
			// glassWeekShow: false,
 | 
			
		||||
			// proWeekShow: false,
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps: [],
 | 
			
		||||
			tableData1: [],
 | 
			
		||||
			tableProps1: [],
 | 
			
		||||
			resData: [],
 | 
			
		||||
			span1: [], //表格1的合并规则
 | 
			
		||||
			resData1: [],
 | 
			
		||||
			span2: []
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		let now = new Date()
 | 
			
		||||
    now.setHours(0, 0, 0, 0)
 | 
			
		||||
    now.setDate(1)
 | 
			
		||||
    let startOfMonth = now.getTime()
 | 
			
		||||
    this.listQuery.time = startOfMonth
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getTime1() {
 | 
			
		||||
			const firstDayOfMonth = new Date(this.listQuery.time)
 | 
			
		||||
			const lastDayOfMonth = new Date(firstDayOfMonth.getFullYear(), firstDayOfMonth.getMonth() + 1, 0, 0, 0, 0, 0)
 | 
			
		||||
			// console.log('时间', parseTime(firstDayOfMonth), parseTime(lastDayOfMonth))
 | 
			
		||||
			this.$set(this.tableProps[2], 'label', '许昌安彩月原片生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')')
 | 
			
		||||
			this.$set(this.tableProps1[2], 'label', '许昌安彩月成品生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')') 
 | 
			
		||||
			// this.tableProps[2].label = '许昌安彩月原片生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')'
 | 
			
		||||
			// this.tableProps1[2].label = '许昌安彩月成品生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')'
 | 
			
		||||
			console.log(this.tableProps, this.tableProps1)
 | 
			
		||||
		},
 | 
			
		||||
		async getList() {
 | 
			
		||||
			const firstDayOfMonth = new Date(this.listQuery.time)
 | 
			
		||||
			const lastDayOfMonth = new Date(firstDayOfMonth.getFullYear(), firstDayOfMonth.getMonth() + 1, 0, 0, 0, 0, 0)
 | 
			
		||||
			this.tableData = [];
 | 
			
		||||
			this.tableProps = [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'lineName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 120,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'paramsName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 120,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'xc',
 | 
			
		||||
					label: '许昌安彩月原片生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')',
 | 
			
		||||
					// align: 'center',
 | 
			
		||||
					children: []
 | 
			
		||||
				}
 | 
			
		||||
			];
 | 
			
		||||
			this.tableData1 = [];
 | 
			
		||||
			this.tableProps1 = [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'lineName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 120,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'paramsName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 120,
 | 
			
		||||
					'show-overflow-tooltip': true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'xc1',
 | 
			
		||||
					label: '许昌安彩月成品生产汇总(' + parseTime(firstDayOfMonth) + '-' + parseTime(lastDayOfMonth) + ')',
 | 
			
		||||
					// align: 'center',
 | 
			
		||||
					children: []
 | 
			
		||||
				}
 | 
			
		||||
			];
 | 
			
		||||
			await productionMonthY(this.listQuery).then((res) => {
 | 
			
		||||
				this.resData = res.data;
 | 
			
		||||
				// 设置表头
 | 
			
		||||
				Object.keys(this.resData).forEach((item) => {
 | 
			
		||||
					this.tableProps[2].children.push({
 | 
			
		||||
						prop: item,
 | 
			
		||||
						label: item,
 | 
			
		||||
						'show-overflow-tooltip': true,
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
				this.buildTableData(this.resData);
 | 
			
		||||
			});
 | 
			
		||||
			await productionMonthD(this.listQuery).then((res) => {
 | 
			
		||||
				this.resData1 = res.data;
 | 
			
		||||
				// 设置表头
 | 
			
		||||
				Object.keys(this.resData1).forEach((item) => {
 | 
			
		||||
					this.tableProps1[2].children.push({
 | 
			
		||||
						prop: item,
 | 
			
		||||
						label: item,
 | 
			
		||||
						'show-overflow-tooltip': true,
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
				this.buildTableData1(this.resData1);
 | 
			
		||||
			});
 | 
			
		||||
			// this.getTime1()
 | 
			
		||||
		},
 | 
			
		||||
		// 设置表格2数据
 | 
			
		||||
		buildTableData1(data) {
 | 
			
		||||
			let keys = Object.keys(data);
 | 
			
		||||
			let tempData = [];
 | 
			
		||||
			let subKeys = Object.keys(data[keys[0]]);
 | 
			
		||||
			let sub2Keys = Object.keys(data[keys[0]][subKeys[0]]);
 | 
			
		||||
			for (let i = 0; i < keys.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							let obj = {};
 | 
			
		||||
							obj.lineName = subKeys[j];
 | 
			
		||||
							obj.paramsName = sub2Keys[k];
 | 
			
		||||
							obj[keys[0]] = data[keys[0]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
							tempData.push(obj);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							for (let v = 0; v < tempData.length; v++) {
 | 
			
		||||
								if (
 | 
			
		||||
									tempData[v].lineName === subKeys[j] &&
 | 
			
		||||
									tempData[v].paramsName === sub2Keys[k]
 | 
			
		||||
								) {
 | 
			
		||||
									tempData[v][keys[i]] = data[keys[i]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			this.tableData1 = tempData;
 | 
			
		||||
			this.getSpanArr1(this.tableData1);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.reTable1();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 设置表格数据
 | 
			
		||||
		buildTableData(data) {
 | 
			
		||||
			let keys = Object.keys(data);
 | 
			
		||||
			let tempData = [];
 | 
			
		||||
			let subKeys = Object.keys(data[keys[0]]);
 | 
			
		||||
			let sub2Keys = Object.keys(data[keys[0]][subKeys[0]]);
 | 
			
		||||
			for (let i = 0; i < keys.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							let obj = {};
 | 
			
		||||
							obj.lineName = subKeys[j];
 | 
			
		||||
							obj.paramsName = sub2Keys[k];
 | 
			
		||||
							obj[keys[0]] = data[keys[0]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
							tempData.push(obj);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							for (let v = 0; v < tempData.length; v++) {
 | 
			
		||||
								if (
 | 
			
		||||
									tempData[v].lineName === subKeys[j] &&
 | 
			
		||||
									tempData[v].paramsName === sub2Keys[k]
 | 
			
		||||
								) {
 | 
			
		||||
									tempData[v][keys[i]] = data[keys[i]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			this.tableData = tempData;
 | 
			
		||||
			this.getSpanArr(this.tableData);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.reTable();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		reTable() {
 | 
			
		||||
			this.$refs.productionDataMonthTable11.doLayout('productionDataMonthTable1');
 | 
			
		||||
		},
 | 
			
		||||
		reTable1() {
 | 
			
		||||
			this.$refs.productionDataMonthTable22.doLayout('productionDataMonthTable2');
 | 
			
		||||
		},
 | 
			
		||||
		getSpanArr1(data) {
 | 
			
		||||
			this.span2 = [];
 | 
			
		||||
			for (var i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.span2.push(1);
 | 
			
		||||
					this.index1 = 0;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].lineName === data[i - 1].lineName) {
 | 
			
		||||
						this.span2[this.index1] += 1;
 | 
			
		||||
						this.span2.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						this.span2.push(1);
 | 
			
		||||
						this.index1 = i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 获取合并行
 | 
			
		||||
		getSpanArr(data) {
 | 
			
		||||
			this.span1 = [];
 | 
			
		||||
			for (var i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.span1.push(1);
 | 
			
		||||
					this.index = 0;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].lineName === data[i - 1].lineName) {
 | 
			
		||||
						this.span1[this.index] += 1;
 | 
			
		||||
						this.span1.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						this.span1.push(1);
 | 
			
		||||
						this.index = i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		objectSpanMethod1({ rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex === 0) {
 | 
			
		||||
				const _row = this.span1[rowIndex];
 | 
			
		||||
				return {
 | 
			
		||||
					rowspan: _row,
 | 
			
		||||
					colspan: 1,
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			const xlsxParam = { raw: true };
 | 
			
		||||
			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 workbook = XLSX.utils.book_new();
 | 
			
		||||
			var ws = XLSX.utils.table_to_sheet(
 | 
			
		||||
				tables,
 | 
			
		||||
				xlsxParam
 | 
			
		||||
			);
 | 
			
		||||
			XLSX.utils.book_append_sheet(workbook, ws, '许昌安彩月原片生产汇总');
 | 
			
		||||
 | 
			
		||||
			let tables1 = document.querySelectorAll('.el-table')[1].cloneNode(true)
 | 
			
		||||
			const fix1 = tables1.querySelector('.el-table__fixed')
 | 
			
		||||
			const fixRight1 = tables1.querySelector('.el-table__fixed-right')
 | 
			
		||||
			if (fix1) {
 | 
			
		||||
				tables1.removeChild(fix1)
 | 
			
		||||
			}
 | 
			
		||||
			if (fixRight1) {
 | 
			
		||||
				tables1.removeChild(fixRight1)
 | 
			
		||||
			}
 | 
			
		||||
			var prows = XLSX.utils.table_to_sheet(
 | 
			
		||||
				tables1,
 | 
			
		||||
				xlsxParam
 | 
			
		||||
			);
 | 
			
		||||
			XLSX.utils.book_append_sheet(workbook, prows, '许昌安彩月成品生产汇总');
 | 
			
		||||
			let fileName = '生产数据汇总表-月报.xlsx';
 | 
			
		||||
			var wbout = XLSX.write(workbook, {
 | 
			
		||||
				bookType: 'xlsx',
 | 
			
		||||
				bookSST: true,
 | 
			
		||||
				type: 'array',
 | 
			
		||||
			});
 | 
			
		||||
			try {
 | 
			
		||||
				FileSaver.saveAs(
 | 
			
		||||
					new Blob([wbout], { type: 'application/octet-stream' }),
 | 
			
		||||
					fileName
 | 
			
		||||
				);
 | 
			
		||||
				this.$message.success('导出成功');
 | 
			
		||||
			} catch (e) {
 | 
			
		||||
				if (typeof console !== 'undefined') console.log(e, wbout);
 | 
			
		||||
			}
 | 
			
		||||
			return wbout;
 | 
			
		||||
		},
 | 
			
		||||
		handleEmitFun(payload) {
 | 
			
		||||
			console.log('payload', payload);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.weekly {
 | 
			
		||||
	padding: 16px;
 | 
			
		||||
}
 | 
			
		||||
.blueTip::before {
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	content: '';
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 18px;
 | 
			
		||||
	background: #0b58ff;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	margin-top: 8px;
 | 
			
		||||
	margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										198
									
								
								src/views/report/Product/weekly.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								src/views/report/Product/weekly.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,198 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2024-04-22 15:49:56
 | 
			
		||||
 * @LastEditTime: 2024-04-25 14:31:53
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="weekly">
 | 
			
		||||
    <el-form :inline="true" :model="listQuery" class="blueTip">
 | 
			
		||||
      <el-form-item label="周" prop="reportTime">
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
          :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
          style="width: 350px" placeholder="选择周">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <glassWeek v-if="glassWeekShow" ref="glassWeek" :product="false" :params="listQuery" />
 | 
			
		||||
    <proWeek v-if="proWeekShow" ref="proWeek" :product="false" :params="listQuery" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import glassWeek from '../glass/weekly.vue'
 | 
			
		||||
import proWeek from '../productionWeekReport/index.vue'
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter'
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
import * as XLSX from 'xlsx/xlsx.mjs'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  components: { glassWeek, proWeek },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      listQuery: {
 | 
			
		||||
				// pageSize: 10,
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// total: 0,
 | 
			
		||||
				reportType: 3,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
      startTimeStamp: '',
 | 
			
		||||
      endTimeStamp: '',
 | 
			
		||||
      reportTime: '',
 | 
			
		||||
      glassWeekShow: false,
 | 
			
		||||
      proWeekShow: false,
 | 
			
		||||
      proTabaleData: []
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
    this.glassWeekShow = true
 | 
			
		||||
    this.proWeekShow = true
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // handleExport() {
 | 
			
		||||
    //   this.$nextTick(() => {
 | 
			
		||||
    //     this.$refs['glassWeek'].handleExport()
 | 
			
		||||
    //     this.$refs['proWeek'].handleExport()
 | 
			
		||||
    //   })
 | 
			
		||||
    // },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      const xlsxParam = { raw: true }
 | 
			
		||||
      let workbook = XLSX.utils.book_new()
 | 
			
		||||
      var ws = XLSX.utils.table_to_sheet( document.querySelector('#exportTable'), xlsxParam)
 | 
			
		||||
      XLSX.utils.book_append_sheet(workbook, ws, '许昌安彩周原片生产汇总')
 | 
			
		||||
      var prows = XLSX.utils.table_to_sheet( document.querySelector('#exportproductionTable'), xlsxParam)
 | 
			
		||||
      XLSX.utils.book_append_sheet(workbook, prows, '许昌安彩周成品生产汇总')
 | 
			
		||||
      let fileName = '生产数据汇总表-周报.xlsx';
 | 
			
		||||
      var wbout = XLSX.write(workbook, {
 | 
			
		||||
        bookType: 'xlsx',
 | 
			
		||||
        bookSST: true,
 | 
			
		||||
        type: 'array',
 | 
			
		||||
      });
 | 
			
		||||
      try {
 | 
			
		||||
        FileSaver.saveAs(
 | 
			
		||||
          new Blob([wbout], { type: 'application/octet-stream' }),
 | 
			
		||||
          fileName
 | 
			
		||||
        );
 | 
			
		||||
        this.$message.success('导出成功');
 | 
			
		||||
      } catch (e) {
 | 
			
		||||
        if (typeof console !== 'undefined') console.log(e, wbout);
 | 
			
		||||
      }
 | 
			
		||||
      return wbout;
 | 
			
		||||
    },
 | 
			
		||||
    search() {
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs['glassWeek'].getDataList()
 | 
			
		||||
        this.$refs['proWeek'].getDataList()
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    changeTime(val) {
 | 
			
		||||
      console.log(val);
 | 
			
		||||
			if(val) {
 | 
			
		||||
					let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
 | 
			
		||||
					this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间
 | 
			
		||||
					this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间
 | 
			
		||||
					console.log(this.startTimeStamp, this.endTimeStamp)
 | 
			
		||||
				this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
			} else {
 | 
			
		||||
					this.listQuery.reportTime = []
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
    getCurrentWeekStartTimeAndEndTime() {
 | 
			
		||||
      this.reportTime = new Date()
 | 
			
		||||
      var weekday = new Array(7);
 | 
			
		||||
      weekday[0] = "Sunday";
 | 
			
		||||
      weekday[1] = "Monday";
 | 
			
		||||
      weekday[2] = "Tuesday";
 | 
			
		||||
      weekday[3] = "Wednesday";
 | 
			
		||||
      weekday[4] = "Thursday";
 | 
			
		||||
      weekday[5] = "Friday";
 | 
			
		||||
      weekday[6] = "Saturday";
 | 
			
		||||
      // console.log(weekday[this.reportTime.getDay()]);
 | 
			
		||||
      if (weekday[this.reportTime.getDay()] === 'Monday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Thursday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime())
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Friday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Saturday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      } else if (weekday[this.reportTime.getDay()] === 'Sunday') {
 | 
			
		||||
        this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
 | 
			
		||||
        this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
 | 
			
		||||
        this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
 | 
			
		||||
        // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
 | 
			
		||||
        // this.changeTime(reportTime)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    //时间戳转为yy-mm-dd hh:mm:ss
 | 
			
		||||
		timeFun(unixtimestamp) {
 | 
			
		||||
				var unixtimestamp = new Date(unixtimestamp);
 | 
			
		||||
				var year = 1900 + unixtimestamp.getYear();
 | 
			
		||||
				var month = "0" + (unixtimestamp.getMonth() + 1);
 | 
			
		||||
				var date = "0" + unixtimestamp.getDate();
 | 
			
		||||
				return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
		}
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.weekly {
 | 
			
		||||
  padding-top: 16px;
 | 
			
		||||
}
 | 
			
		||||
.blueTip::before{
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  content: '';
 | 
			
		||||
  width: 4px;
 | 
			
		||||
  height: 18px;
 | 
			
		||||
  background: #0B58FF;
 | 
			
		||||
  border-radius: 1px;
 | 
			
		||||
  margin-right: 8PX;
 | 
			
		||||
  margin-top: 8px;
 | 
			
		||||
  margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										387
									
								
								src/views/report/Product/year.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										387
									
								
								src/views/report/Product/year.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,387 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2024-04-22 15:49:56
 | 
			
		||||
 * @LastEditTime: 2024-04-26 10:34:12
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description: 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="weekly">
 | 
			
		||||
		<el-form
 | 
			
		||||
			:inline="true"
 | 
			
		||||
			:model="listQuery"
 | 
			
		||||
			class="blueTip">
 | 
			
		||||
			<el-form-item
 | 
			
		||||
				label="年份"
 | 
			
		||||
				prop="reportTime">
 | 
			
		||||
				<el-date-picker
 | 
			
		||||
					v-model="listQuery.time"
 | 
			
		||||
					value-format="timestamp"
 | 
			
		||||
					type="year"
 | 
			
		||||
					size="small"
 | 
			
		||||
					placeholder="选择年"></el-date-picker>
 | 
			
		||||
			</el-form-item>
 | 
			
		||||
			<el-button
 | 
			
		||||
				v-if="this.$auth.hasPermi('base:report-auto-production:query')"
 | 
			
		||||
				type="primary"
 | 
			
		||||
				size="small"
 | 
			
		||||
				@click="getList">
 | 
			
		||||
				查询
 | 
			
		||||
			</el-button>
 | 
			
		||||
			<el-button
 | 
			
		||||
				v-if="
 | 
			
		||||
					this.$auth.hasPermiAnd([
 | 
			
		||||
						'base:report-auto-original-glass:export',
 | 
			
		||||
						'base:report-auto-production:export',
 | 
			
		||||
					])
 | 
			
		||||
				"
 | 
			
		||||
				type="primary"
 | 
			
		||||
				size="small"
 | 
			
		||||
				plain
 | 
			
		||||
				@click="handleExport">
 | 
			
		||||
				导出
 | 
			
		||||
			</el-button>
 | 
			
		||||
		</el-form>
 | 
			
		||||
		<base-table
 | 
			
		||||
		ref="productionDataYearTable11"
 | 
			
		||||
			id="productionDataYearTable1"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			:span-method="objectSpanMethod1"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH" />
 | 
			
		||||
		<base-table
 | 
			
		||||
		ref="productionDataYearTable22"
 | 
			
		||||
			id="productionDataYearTable2"
 | 
			
		||||
			:table-props="tableProps1"
 | 
			
		||||
			:table-data="tableData1"
 | 
			
		||||
			:span-method="objectSpanMethod1"
 | 
			
		||||
			@emitFun="handleEmitFun"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			style="margin-top: 15px" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { productionYearY, productionYearD } from '@/api/report/glass';
 | 
			
		||||
import { parseTime } from '../../core/mixins/code-filter';
 | 
			
		||||
import FileSaver from 'file-saver';
 | 
			
		||||
import * as XLSX from 'xlsx/xlsx.mjs';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	// components: { monthWeek, proMonth },
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			heightNum: 350,
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				time: '',
 | 
			
		||||
			},
 | 
			
		||||
			// startTimeStamp: '',
 | 
			
		||||
			// endTimeStamp: '',
 | 
			
		||||
			// reportTime: '',
 | 
			
		||||
			// glassWeekShow: false,
 | 
			
		||||
			// proWeekShow: false,
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			tableProps: [],
 | 
			
		||||
			tableData1: [],
 | 
			
		||||
			tableProps1: [],
 | 
			
		||||
			resData: [],
 | 
			
		||||
			span1: [], //表格1的合并规则
 | 
			
		||||
			resData1: [],
 | 
			
		||||
			span2: []
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		let now = new Date()
 | 
			
		||||
    now.setHours(0, 0, 0, 0)
 | 
			
		||||
    now.setDate(1)
 | 
			
		||||
		now.setMonth(0)
 | 
			
		||||
    let startOfMonth = now.getTime()
 | 
			
		||||
    // let firstDayOfMonth = new Date(startOfMonth)
 | 
			
		||||
		// console.log('看看', parseTime(firstDayOfMonth))
 | 
			
		||||
    this.listQuery.time = startOfMonth
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getTime() {
 | 
			
		||||
			const firstDayOfYear = new Date(this.listQuery.time)
 | 
			
		||||
			const lastDayOfYear = new Date(firstDayOfYear.getFullYear() + 1, 0, 0, 0, 0, 0, 0)
 | 
			
		||||
			// console.log('时间', parseTime(firstDayOfMonth), parseTime(lastDayOfMonth))
 | 
			
		||||
			this.tableProps[0].label = '许昌安彩年原片生产汇总(' + parseTime(firstDayOfYear) + '-' + parseTime(lastDayOfYear) + ')'
 | 
			
		||||
			this.tableProps1[0].label = '许昌安彩年成品生产汇总(' + parseTime(firstDayOfYear) + '-' + parseTime(lastDayOfYear) + ')'
 | 
			
		||||
		},
 | 
			
		||||
		async getList() {
 | 
			
		||||
			// this.getTime()
 | 
			
		||||
			const firstDayOfYear = new Date(this.listQuery.time)
 | 
			
		||||
			const lastDayOfYear = new Date(firstDayOfYear.getFullYear() + 1, 0, 0, 0, 0, 0, 0)
 | 
			
		||||
			this.tableData = [];
 | 
			
		||||
			this.tableProps = [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'lineName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 120,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'paramsName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					width: 120,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'xc',
 | 
			
		||||
					label: '许昌安彩年原片生产汇总(' + parseTime(firstDayOfYear) + '-' + parseTime(lastDayOfYear) + ')',
 | 
			
		||||
					// align: 'center',
 | 
			
		||||
					children: []
 | 
			
		||||
				}
 | 
			
		||||
			];
 | 
			
		||||
			this.tableData1 = [];
 | 
			
		||||
			this.tableProps1 = [
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'lineName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'paramsName',
 | 
			
		||||
					label: '',
 | 
			
		||||
					fixed: true,
 | 
			
		||||
					'show-overflow-tooltip': true
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					prop: 'xc1',
 | 
			
		||||
					label: '许昌安彩年成品生产汇总(' + parseTime(firstDayOfYear) + '-' + parseTime(lastDayOfYear) + ')',
 | 
			
		||||
					// align: 'center',
 | 
			
		||||
					children: []
 | 
			
		||||
				}
 | 
			
		||||
			];
 | 
			
		||||
			await productionYearY(this.listQuery).then((res) => {
 | 
			
		||||
				this.resData = res.data;
 | 
			
		||||
				// 设置表头
 | 
			
		||||
				Object.keys(this.resData).forEach((item) => {
 | 
			
		||||
					this.tableProps[2].children.push({
 | 
			
		||||
						prop: item,
 | 
			
		||||
						label: item,
 | 
			
		||||
						'show-overflow-tooltip': true,
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
				this.buildTableData(this.resData);
 | 
			
		||||
			});
 | 
			
		||||
			await productionYearD(this.listQuery).then((res) => {
 | 
			
		||||
				this.resData1 = res.data;
 | 
			
		||||
				// 设置表头
 | 
			
		||||
				Object.keys(this.resData1).forEach((item) => {
 | 
			
		||||
					this.tableProps1[2].children.push({
 | 
			
		||||
						prop: item,
 | 
			
		||||
						label: item,
 | 
			
		||||
						'show-overflow-tooltip': true,
 | 
			
		||||
					});
 | 
			
		||||
				});
 | 
			
		||||
				this.buildTableData1(this.resData1);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 设置表格2数据
 | 
			
		||||
		buildTableData1(data) {
 | 
			
		||||
			let keys = Object.keys(data);
 | 
			
		||||
			let tempData = [];
 | 
			
		||||
			let subKeys = Object.keys(data[keys[0]]);
 | 
			
		||||
			let sub2Keys = Object.keys(data[keys[0]][subKeys[0]]);
 | 
			
		||||
			for (let i = 0; i < keys.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							let obj = {};
 | 
			
		||||
							obj.lineName = subKeys[j];
 | 
			
		||||
							obj.paramsName = sub2Keys[k];
 | 
			
		||||
							obj[keys[0]] = data[keys[0]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
							tempData.push(obj);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							for (let v = 0; v < tempData.length; v++) {
 | 
			
		||||
								if (
 | 
			
		||||
									tempData[v].lineName === subKeys[j] &&
 | 
			
		||||
									tempData[v].paramsName === sub2Keys[k]
 | 
			
		||||
								) {
 | 
			
		||||
									tempData[v][keys[i]] = data[keys[i]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			this.tableData1 = tempData;
 | 
			
		||||
			this.getSpanArr1(this.tableData1);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.reTable1();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 设置表格数据
 | 
			
		||||
		buildTableData(data) {
 | 
			
		||||
			let keys = Object.keys(data);
 | 
			
		||||
			let tempData = [];
 | 
			
		||||
			let subKeys = Object.keys(data[keys[0]]);
 | 
			
		||||
			let sub2Keys = Object.keys(data[keys[0]][subKeys[0]]);
 | 
			
		||||
			for (let i = 0; i < keys.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							let obj = {};
 | 
			
		||||
							obj.lineName = subKeys[j];
 | 
			
		||||
							obj.paramsName = sub2Keys[k];
 | 
			
		||||
							obj[keys[0]] = data[keys[0]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
							tempData.push(obj);
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					for (let j = 0; j < subKeys.length; j++) {
 | 
			
		||||
						for (let k = 0; k < sub2Keys.length; k++) {
 | 
			
		||||
							for (let v = 0; v < tempData.length; v++) {
 | 
			
		||||
								if (
 | 
			
		||||
									tempData[v].lineName === subKeys[j] &&
 | 
			
		||||
									tempData[v].paramsName === sub2Keys[k]
 | 
			
		||||
								) {
 | 
			
		||||
									tempData[v][keys[i]] = data[keys[i]][subKeys[j]][sub2Keys[k]];
 | 
			
		||||
								}
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			this.tableData = tempData;
 | 
			
		||||
			this.getSpanArr(this.tableData);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.reTable();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		reTable() {
 | 
			
		||||
			this.$refs.productionDataYearTable11.doLayout('productionDataYearTable1');
 | 
			
		||||
		},
 | 
			
		||||
		reTable1() {
 | 
			
		||||
			this.$refs.productionDataYearTable22.doLayout('productionDataYearTable2');
 | 
			
		||||
		},
 | 
			
		||||
		getSpanArr1(data) {
 | 
			
		||||
			this.span2 = [];
 | 
			
		||||
			for (var i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.span2.push(1);
 | 
			
		||||
					this.index1 = 0;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].lineName === data[i - 1].lineName) {
 | 
			
		||||
						this.span2[this.index1] += 1;
 | 
			
		||||
						this.span2.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						this.span2.push(1);
 | 
			
		||||
						this.index1 = i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 获取合并行
 | 
			
		||||
		getSpanArr(data) {
 | 
			
		||||
			this.span1 = [];
 | 
			
		||||
			for (var i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.span1.push(1);
 | 
			
		||||
					this.index = 0;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].lineName === data[i - 1].lineName) {
 | 
			
		||||
						this.span1[this.index] += 1;
 | 
			
		||||
						this.span1.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						this.span1.push(1);
 | 
			
		||||
						this.index = i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		objectSpanMethod1({ rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex === 0) {
 | 
			
		||||
				const _row = this.span1[rowIndex];
 | 
			
		||||
				return {
 | 
			
		||||
					rowspan: _row,
 | 
			
		||||
					colspan: 1,
 | 
			
		||||
				};
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleExport() {
 | 
			
		||||
			const xlsxParam = { raw: true };
 | 
			
		||||
			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 workbook = XLSX.utils.book_new();
 | 
			
		||||
			var ws = XLSX.utils.table_to_sheet(
 | 
			
		||||
				tables,
 | 
			
		||||
				xlsxParam
 | 
			
		||||
			);
 | 
			
		||||
			XLSX.utils.book_append_sheet(workbook, ws, '许昌安彩年原片生产汇总');
 | 
			
		||||
 | 
			
		||||
			let tables1 = document.querySelectorAll('.el-table')[1].cloneNode(true)
 | 
			
		||||
			const fix1 = tables1.querySelector('.el-table__fixed')
 | 
			
		||||
			const fixRight1 = tables1.querySelector('.el-table__fixed-right')
 | 
			
		||||
			if (fix1) {
 | 
			
		||||
				tables1.removeChild(tables1.querySelector('.el-table__fixed'))
 | 
			
		||||
			}
 | 
			
		||||
			if (fixRight1) {
 | 
			
		||||
				tables1.removeChild(tables1.querySelector('.el-table__fixed-right'))
 | 
			
		||||
			}
 | 
			
		||||
			var prows = XLSX.utils.table_to_sheet(
 | 
			
		||||
				tables1,
 | 
			
		||||
				xlsxParam
 | 
			
		||||
			);
 | 
			
		||||
			XLSX.utils.book_append_sheet(workbook, prows, '许昌安彩年成品生产汇总');
 | 
			
		||||
			let fileName = '生产数据汇总表-年报.xlsx';
 | 
			
		||||
			var wbout = XLSX.write(workbook, {
 | 
			
		||||
				bookType: 'xlsx',
 | 
			
		||||
				bookSST: true,
 | 
			
		||||
				type: 'array',
 | 
			
		||||
			});
 | 
			
		||||
			try {
 | 
			
		||||
				FileSaver.saveAs(
 | 
			
		||||
					new Blob([wbout], { type: 'application/octet-stream' }),
 | 
			
		||||
					fileName
 | 
			
		||||
				);
 | 
			
		||||
				this.$message.success('导出成功');
 | 
			
		||||
			} catch (e) {
 | 
			
		||||
				if (typeof console !== 'undefined') console.log(e, wbout);
 | 
			
		||||
			}
 | 
			
		||||
			return wbout;
 | 
			
		||||
		},
 | 
			
		||||
		handleEmitFun(payload) {
 | 
			
		||||
			console.log('payload', payload);
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
.weekly {
 | 
			
		||||
	padding: 16px;
 | 
			
		||||
}
 | 
			
		||||
.blueTip::before {
 | 
			
		||||
	display: inline-block;
 | 
			
		||||
	content: '';
 | 
			
		||||
	width: 4px;
 | 
			
		||||
	height: 18px;
 | 
			
		||||
	background: #0b58ff;
 | 
			
		||||
	border-radius: 1px;
 | 
			
		||||
	margin-right: 8px;
 | 
			
		||||
	margin-top: 8px;
 | 
			
		||||
	margin-left: 16px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: Do not edit
 | 
			
		||||
 * @Date: 2023-12-13 14:10:04
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:21:34
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-26 15:59:39
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
    <el-row v-if="isShowEdit" style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="edit = true">编辑</el-button>
 | 
			
		||||
      <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
@@ -38,15 +38,15 @@
 | 
			
		||||
import { updateGlass, updateGlassRemark } from '@/api/report/glass';
 | 
			
		||||
 | 
			
		||||
const cols = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'lineName',
 | 
			
		||||
    label: '生产线',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
		prop: 'xc',
 | 
			
		||||
		label: '许昌安彩周原片生产汇总',
 | 
			
		||||
		align: 'center',
 | 
			
		||||
		// align: '200px',
 | 
			
		||||
		children: [
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'lineName',
 | 
			
		||||
				label: '生产线',
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'm',
 | 
			
		||||
				label: '拉引量㎡',
 | 
			
		||||
@@ -152,6 +152,10 @@ const cols = [
 | 
			
		||||
      type: {
 | 
			
		||||
        type: Number,
 | 
			
		||||
        default: 3,
 | 
			
		||||
      },
 | 
			
		||||
      isShowEdit: {
 | 
			
		||||
        type: Boolean,
 | 
			
		||||
        default: true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
@@ -174,11 +178,12 @@ const cols = [
 | 
			
		||||
      },
 | 
			
		||||
      time: {
 | 
			
		||||
        immediate: true,
 | 
			
		||||
        deep: true,
 | 
			
		||||
        handler(newv, oldv) {
 | 
			
		||||
          if (newv[0] !== '') {
 | 
			
		||||
            this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
 | 
			
		||||
          if (newv[0] !== '' && newv[0] !== undefined) {
 | 
			
		||||
            this.cols[1].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
 | 
			
		||||
          } else {
 | 
			
		||||
            this.cols[0].label = this.date
 | 
			
		||||
            this.cols[1].label = this.date
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
@@ -203,15 +208,15 @@ const cols = [
 | 
			
		||||
            text2 = '上年'
 | 
			
		||||
            text3 = '原片合计(片/年)'
 | 
			
		||||
          }
 | 
			
		||||
          this.cols[0].children[1].children[0].label = text1
 | 
			
		||||
          this.cols[0].children[1].children[1].label = text2
 | 
			
		||||
          this.cols[0].children[2].children[0].label = text1
 | 
			
		||||
          this.cols[0].children[2].children[1].label = text2
 | 
			
		||||
          this.cols[0].children[3].children[0].label = text1
 | 
			
		||||
          this.cols[0].children[3].children[1].label = text2
 | 
			
		||||
          this.cols[0].children[4].children[0].label = text1
 | 
			
		||||
          this.cols[0].children[4].children[1].label = text2
 | 
			
		||||
          this.cols[0].children[2].label = text3
 | 
			
		||||
          this.cols[1].children[0].children[0].label = text1
 | 
			
		||||
          this.cols[1].children[0].children[1].label = text2
 | 
			
		||||
          this.cols[1].children[1].children[0].label = text1
 | 
			
		||||
          this.cols[1].children[1].children[1].label = text2
 | 
			
		||||
          this.cols[1].children[2].children[0].label = text1
 | 
			
		||||
          this.cols[1].children[2].children[1].label = text2
 | 
			
		||||
          this.cols[1].children[3].children[0].label = text1
 | 
			
		||||
          this.cols[1].children[3].children[1].label = text2
 | 
			
		||||
          this.cols[1].children[1].label = text3
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <div>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="月" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
 | 
			
		||||
      :type="listQuery.reportType" @refreshDataList="getDataList" />
 | 
			
		||||
    <!-- <pagination
 | 
			
		||||
			:limit.sync="listQuery.pageSize"
 | 
			
		||||
@@ -33,6 +33,16 @@ import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
	components: { inputTable },
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
@@ -40,9 +50,6 @@ export default {
 | 
			
		||||
				exportURL: exportGlasscExcel
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
				reportType: 4,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
@@ -101,6 +108,9 @@ export default {
 | 
			
		||||
      const res = await getCorePLList()
 | 
			
		||||
      this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
       if (this?.params) {
 | 
			
		||||
        this.listQuery = {...this.params}
 | 
			
		||||
      }
 | 
			
		||||
      if (this.listQuery.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" /> -->
 | 
			
		||||
    <div>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="周" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
 | 
			
		||||
      :type="listQuery.reportType" @refreshDataList="getDataList" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -35,6 +35,16 @@ import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
	components: { inputTable },
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
@@ -42,9 +52,6 @@ export default {
 | 
			
		||||
				exportURL: exportGlasscExcel
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
				reportType: 3,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
@@ -89,11 +96,12 @@ export default {
 | 
			
		||||
  },
 | 
			
		||||
  created () {
 | 
			
		||||
    // this.getDict()
 | 
			
		||||
    this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
  },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		// const day = new Date().getDay()
 | 
			
		||||
    // console.log('周四', day)
 | 
			
		||||
    this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
    // this.getCurrentWeekStartTimeAndEndTime()
 | 
			
		||||
		// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
	},
 | 
			
		||||
@@ -190,6 +198,10 @@ export default {
 | 
			
		||||
      const res = await getCorePLList()
 | 
			
		||||
      this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.listQuery = {...this.params}
 | 
			
		||||
        // this.$set(this.listQuery, 'reportTime', this.params.reportTime)
 | 
			
		||||
      }
 | 
			
		||||
      if (this.listQuery.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <div>
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="年" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
@@ -16,7 +16,7 @@
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
    </div>
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
 | 
			
		||||
    <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
 | 
			
		||||
      :type="listQuery.reportType" @refreshDataList="getDataList" />
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
@@ -30,6 +30,16 @@ import FileSaver from 'file-saver'
 | 
			
		||||
// import * as XLSX from 'xlsx'
 | 
			
		||||
export default {
 | 
			
		||||
	components: { inputTable },
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			urlOptions: {
 | 
			
		||||
@@ -37,9 +47,9 @@ export default {
 | 
			
		||||
				exportURL: exportGlasscExcel
 | 
			
		||||
			},
 | 
			
		||||
			listQuery: {
 | 
			
		||||
				pageSize: 10,
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				total: 0,
 | 
			
		||||
				// pageSize: 10,
 | 
			
		||||
				// pageNo: 1,
 | 
			
		||||
				// total: 0,
 | 
			
		||||
				reportType: 5,
 | 
			
		||||
				reportTime: []
 | 
			
		||||
      },
 | 
			
		||||
@@ -54,11 +64,10 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
  created() {
 | 
			
		||||
		// this.getDict()
 | 
			
		||||
    this.getCurrentYearFirst()
 | 
			
		||||
  },
 | 
			
		||||
  mounted () {
 | 
			
		||||
    this.getCurrentYearFirst()
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
      ;
 | 
			
		||||
    this.getDataList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getCurrentYearFirst() {
 | 
			
		||||
@@ -101,6 +110,9 @@ export default {
 | 
			
		||||
      const res = await getCorePLList()
 | 
			
		||||
      this.proLineList = res.data;
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.listQuery = {...this.params}
 | 
			
		||||
      }
 | 
			
		||||
      if (this.listQuery.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
          message: '请选择时间',
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										608
									
								
								src/views/report/ingredientReport/day.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										608
									
								
								src/views/report/ingredientReport/day.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,608 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <!-- <el-table show-summary :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
 | 
			
		||||
      :span-method="objectSpanMethod">
 | 
			
		||||
      <el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table> -->
 | 
			
		||||
    <!-- <el-table border style="margin-top: 50px;" :data="transData">
 | 
			
		||||
      <el-table-column v-for="(item, index) in transTitle" :label="item" :key="index" align="center">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          {{scope.row[index]}}
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table> -->
 | 
			
		||||
 | 
			
		||||
    <el-table id="exportTable" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" class="baseTable" :span-method="objectSpanMethod" :data="tableData" style="width: 100%">
 | 
			
		||||
      <el-table-column align="center" prop="" :label=" '配料日报' + time " width="120">
 | 
			
		||||
        <el-table-column label="原料样式" align="right" width="150">
 | 
			
		||||
          <el-table-column prop="className" label="时间" width="150">
 | 
			
		||||
          </el-table-column>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <el-table-column align="center" prop="putType" label="" width="180">
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        <!-- <el-table-column prop label="参考标准及评价方法">
 | 
			
		||||
        <el-table-column prop="activityName"></el-table-column>
 | 
			
		||||
        <el-table-column prop="message"></el-table-column>
 | 
			
		||||
      </el-table-column> -->
 | 
			
		||||
        <el-table-column align="center" style="text-align: center;" v-for="(item, index) in codeList " :key="index" :prop="item"  :label="item">
 | 
			
		||||
          <!-- <template slot-scope="scope">
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
            {{ codeList[index] }}
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-row>
 | 
			
		||||
            <el-col :span="24">
 | 
			
		||||
              {{ scope.row.sj2 }}
 | 
			
		||||
            </el-col>
 | 
			
		||||
          </el-row>
 | 
			
		||||
        </template> -->
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" /> -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="30%"> -->
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
    <!-- </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import basicPage from '../../../core/mixins/basic-page';
 | 
			
		||||
// import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getIngredientData
 | 
			
		||||
} from '@/api/report/qcReport';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const headers = [
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'createTime',
 | 
			
		||||
  //   label: '添加时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'classType',
 | 
			
		||||
    label: '时间'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'equipmentName',
 | 
			
		||||
    label: ''
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'area',
 | 
			
		||||
    label: '面积'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'countNum',
 | 
			
		||||
    label: '托数',
 | 
			
		||||
    // filter: (val) => val == false ? '不合格' : '合格',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'size',
 | 
			
		||||
    label: '规格',
 | 
			
		||||
    // filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkerName',
 | 
			
		||||
  //   label: '检测人员'
 | 
			
		||||
  // },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkTime',
 | 
			
		||||
  //   label: '检测时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  mixins: [tableHeightMixin],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getIngredientData,
 | 
			
		||||
        // deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
      codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11','sj14'],
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined
 | 
			
		||||
      },
 | 
			
		||||
      time: '',
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间',
 | 
			
		||||
          dateType: 'date',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          param: 'checkTime',
 | 
			
		||||
          defaultSelect: Date.now(),
 | 
			
		||||
          width: 150
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    // AddOrUpdate,
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.formConfig[1].defaultSelect[]
 | 
			
		||||
    this.listQuery.startTime = Date.now()
 | 
			
		||||
    this.time = moment(new Date((Date.now())).setHours(8, 0, 0)).format('YYYY-MM-DD HH:mm:ss') + moment(new Date(Date.now() + 24*60*60*1000).setHours( 7, 59, 59)).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
    this.listQuery.endTime = Date.now()
 | 
			
		||||
    // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
    // this.getSpanArr(this.tableData)
 | 
			
		||||
    // this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    timestampToTime(date) {
 | 
			
		||||
      // 时间戳为10位需*1000,时间戳为13位不需乘1000
 | 
			
		||||
      // var date = new Date(timestamp * 1000);
 | 
			
		||||
      var Y = date.getFullYear() + "-";
 | 
			
		||||
      var M =
 | 
			
		||||
        (date.getMonth() + 1 < 10
 | 
			
		||||
          ? "0" + (date.getMonth() + 1)
 | 
			
		||||
          : date.getMonth() + 1) + "-";
 | 
			
		||||
      var D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
 | 
			
		||||
      var h = date.getHours() + ":";
 | 
			
		||||
      var m = date.getMinutes() + ":";
 | 
			
		||||
      var s = date.getSeconds();
 | 
			
		||||
      return Y + M + D + h + m + s;
 | 
			
		||||
    },
 | 
			
		||||
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
      let spanOneArr = [], concatOne = 0;
 | 
			
		||||
      this.tableData.map((item, index) => {
 | 
			
		||||
        if (index === 0) {
 | 
			
		||||
          spanOneArr.push(1);
 | 
			
		||||
        } else {
 | 
			
		||||
          //第一列需合并相同内容的判断条件
 | 
			
		||||
          if (item.classType === this.tableData[index - 1].classType) {
 | 
			
		||||
            spanOneArr[concatOne] += 1;
 | 
			
		||||
            spanOneArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanOneArr.push(1);
 | 
			
		||||
            concatOne = index;
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      if (columnIndex === 0) {
 | 
			
		||||
        const _row = spanOneArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (columnIndex === 1) {
 | 
			
		||||
        if (rowIndex === 0 || rowIndex === 2 || rowIndex === 4 || rowIndex === 6 || rowIndex === 8 || rowIndex === 10) {
 | 
			
		||||
          return {
 | 
			
		||||
            rowspan: 2,
 | 
			
		||||
            colspan: 1
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (columnIndex === 1) {
 | 
			
		||||
        if (rowIndex % 2 == 1) {
 | 
			
		||||
          return {
 | 
			
		||||
            rowspan: 1,
 | 
			
		||||
            colspan: 2
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9 || columnIndex === 10 || columnIndex === 11 ) {
 | 
			
		||||
        if (rowIndex % 2 == 0) {
 | 
			
		||||
          return {
 | 
			
		||||
            rowspan: 2,
 | 
			
		||||
            colspan: 1
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      console.log(this.$refs);
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "配料日报.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    // otherMethods(val) {
 | 
			
		||||
    //   if (val.type === 'detail') {
 | 
			
		||||
    //     this.addOrUpdateVisible = true;
 | 
			
		||||
    //     this.addOrEditTitle = "详情";
 | 
			
		||||
    //     this.$nextTick(() => {
 | 
			
		||||
    //       this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
    //     });
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      // this.listQuery.startTime = '1713197388000';
 | 
			
		||||
      // this.listQuery.endTime = '1713254961000';
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(res => {
 | 
			
		||||
        // console.log(res)
 | 
			
		||||
        // console.log(res.data)
 | 
			
		||||
        let arr = [
 | 
			
		||||
          {
 | 
			
		||||
            classType: 1,
 | 
			
		||||
            className: '白班(8:00-20:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            putType: '原料投入(kg)'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 1,
 | 
			
		||||
            className: '白班(8:00-20:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            'sj1+sj2': null,
 | 
			
		||||
            putType: ''
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 1,
 | 
			
		||||
            className: '白班(8:00-20:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            putType: '投入次数'
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 1,
 | 
			
		||||
            className: '白班(8:00-20:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            'sj1+sj2': null,
 | 
			
		||||
            putType: ''
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 2,
 | 
			
		||||
            className: '夜班(20:00-8:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            putType: '原料投入(kg)',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 2,
 | 
			
		||||
            className: '夜班(8:00-20:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            'sj1+sj2': null,
 | 
			
		||||
            putType: ''
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 2,
 | 
			
		||||
            className: '夜班(20:00-8:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            putType: '投入次数',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 2,
 | 
			
		||||
            className: '夜班(8:00-20:00)',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            'sj1+sj2': null,
 | 
			
		||||
            putType: ''
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 3,
 | 
			
		||||
            className: '全天',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            putType: '原料投入(kg)',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 3,
 | 
			
		||||
            className: '全天',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            'sj1+sj2': null,
 | 
			
		||||
            putType: ''
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 3,
 | 
			
		||||
            className: '全天',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            putType: '投入次数',
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            classType: 3,
 | 
			
		||||
            className: '全天',
 | 
			
		||||
            'sj1': null,
 | 
			
		||||
            'sj2': null,
 | 
			
		||||
            'sj3': null,
 | 
			
		||||
            'sj4': null,
 | 
			
		||||
            'sj5': null,
 | 
			
		||||
            'sj7': null,
 | 
			
		||||
            'sj8': null,
 | 
			
		||||
            'sj10': null,
 | 
			
		||||
            'sj11': null,
 | 
			
		||||
 | 
			
		||||
            'sj14': null,
 | 
			
		||||
            'sj1+sj2': null,
 | 
			
		||||
            putType: ''
 | 
			
		||||
          },
 | 
			
		||||
        ]
 | 
			
		||||
        res.data.forEach((ele) => {
 | 
			
		||||
          if (ele.classType === 1 && ele.code == 'sj1+sj2') {
 | 
			
		||||
            arr[1]['putType'] = ele.useNum
 | 
			
		||||
            arr[3]['putType'] = ele.putNum
 | 
			
		||||
            // arr[1]['sj2'] = ele.putNum
 | 
			
		||||
            // arr[3]['sj2'] = ele.useNum
 | 
			
		||||
          } else if (ele.classType === 2 && ele.code == 'sj1+sj2') {
 | 
			
		||||
            arr[5]['putType'] = ele.useNum
 | 
			
		||||
            arr[7]['putType'] = ele.putNum
 | 
			
		||||
            // arr[5]['sj2'] = ele.putNum
 | 
			
		||||
            // arr[7]['sj2'] = ele.useNum
 | 
			
		||||
          } else if (ele.classType === 3 && ele.code == 'sj1+sj2') {
 | 
			
		||||
            arr[9]['putType'] = ele.useNum
 | 
			
		||||
            arr[11]['putType'] = ele.putNum
 | 
			
		||||
            // arr[9]['sj2'] = ele.putNum
 | 
			
		||||
            // arr[11]['sj2'] = ele.useNum
 | 
			
		||||
          }
 | 
			
		||||
          this.codeList.forEach((item) => {
 | 
			
		||||
            if (ele.classType === 1 && ele.code == item) {
 | 
			
		||||
              // console.log(arr[0][item])
 | 
			
		||||
              arr[0][item] = ele.useNum
 | 
			
		||||
              arr[2][item] = ele.putNum
 | 
			
		||||
            } else if (ele.classType === 2 && ele.code == item) {
 | 
			
		||||
              arr[4][item] = ele.useNum
 | 
			
		||||
              arr[6][item] = ele.putNum
 | 
			
		||||
            } else if (ele.classType === 3 && ele.code == item) {
 | 
			
		||||
              arr[8][item] = ele.useNum
 | 
			
		||||
              arr[10][item] = ele.putNum
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        })
 | 
			
		||||
        // console.log(arr)
 | 
			
		||||
        this.tableData = arr
 | 
			
		||||
        console.log(this.tableData);
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val.checkTime)
 | 
			
		||||
      // Date.now() - 24 * 60 * 60 - 1000
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime).setHours(8, 0, 0, 0)).getTime() : undefined;
 | 
			
		||||
          this.time = moment(new Date((val.checkTime)).setHours(8, 0, 0, 0)).format('YYYY-MM-DD HH:mm:ss') + moment(new Date(val.checkTime + 24 * 60 * 60 * 1000).setHours(7, 59, 59)).format('YYYY-MM-DD HH:mm:ss')
 | 
			
		||||
          this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime + 24 * 60 * 60 * 1000).setHours(7, 59, 59)).getTime() : undefined;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.baseTable{
 | 
			
		||||
  border-color: #D1D4DB;
 | 
			
		||||
  background-color: #F2F4F9;
 | 
			
		||||
}
 | 
			
		||||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
 | 
			
		||||
  background-color: #EAF1FC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep .baseTable .el-table .el-table__cell {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 35px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep.el-table thead.is-group th {
 | 
			
		||||
  background: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type {
 | 
			
		||||
  border-bottom: none;
 | 
			
		||||
} */
 | 
			
		||||
::v-deep.el-table thead.is-group tr:nth-child(2) th:nth-child(1) {
 | 
			
		||||
  border-bottom: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep.el-table thead.is-group tr:nth-child(2) th:first-of-type:before {
 | 
			
		||||
  content: '';
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  width: 1px;
 | 
			
		||||
  height: 90px;
 | 
			
		||||
  /*这里需要自己调整,根据td的宽度和高度*/
 | 
			
		||||
  top: 0;
 | 
			
		||||
  left: 0;
 | 
			
		||||
  background-color: grey;
 | 
			
		||||
  opacity: 0.3;
 | 
			
		||||
  display: block;
 | 
			
		||||
  transform: rotate(-60deg);
 | 
			
		||||
  /*这里需要自己调整,根据线的位置*/
 | 
			
		||||
  transform-origin: top;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep.el-table thead.is-group tr:nth-child(3) th:first-of-type:before {
 | 
			
		||||
  content: '';
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  width: 1px;
 | 
			
		||||
  height: 90px;
 | 
			
		||||
  /*这里需要自己调整,根据td的宽度和高度*/
 | 
			
		||||
  bottom: 0;
 | 
			
		||||
  right: 0;
 | 
			
		||||
  background-color: grey;
 | 
			
		||||
  opacity: 0.3;
 | 
			
		||||
  display: block;
 | 
			
		||||
  transform: rotate(-60deg);
 | 
			
		||||
  /*这里需要自己调整,根据线的位置*/
 | 
			
		||||
  transform-origin: bottom;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										85
									
								
								src/views/report/productionDayR/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								src/views/report/productionDayR/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,85 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<div>开发中</div>
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<!-- <search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<div class="report-box">
 | 
			
		||||
			<div class="top-box">
 | 
			
		||||
				<div class="left-top">
 | 
			
		||||
					<base-table
 | 
			
		||||
						:table-props="tableProp1"
 | 
			
		||||
						:table-data="tableData"
 | 
			
		||||
						:span-method="spanMethod"
 | 
			
		||||
						:max-height="tableH" />
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="right-top"></div>
 | 
			
		||||
			</div>
 | 
			
		||||
			<div class="bottom-box">
 | 
			
		||||
				<div class="left-bottom"></div>
 | 
			
		||||
				<div class="right-bottom"></div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div> -->
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
const tableProp1 = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'col1',
 | 
			
		||||
		label: '生产线',
 | 
			
		||||
		fixed: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'productionDayR',
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '日',
 | 
			
		||||
					dateType: 'date',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd',
 | 
			
		||||
					placeholder: '日',
 | 
			
		||||
					param: 'searchTime',
 | 
			
		||||
					width: 150,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:group-classes:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {},
 | 
			
		||||
	methods: {},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.report-box {
 | 
			
		||||
	.left-top,
 | 
			
		||||
	.right-top,
 | 
			
		||||
	.left-bottom,
 | 
			
		||||
	.right-bottom {
 | 
			
		||||
		display: inline-block;
 | 
			
		||||
		border: 1px solid red;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,30 +1,32 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:22:46
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-24 15:27:49
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item label="月" prop="reportTime">
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item label="月" prop="reportTime">
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
          @click="handleExport">导出</el-button>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
        <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
          size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
        <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
@@ -286,6 +288,16 @@ export default {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
@@ -484,7 +496,7 @@ export default {
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          document.querySelector("#exportproductionTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
@@ -653,16 +665,21 @@ export default {
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.monthValue.length > 0) {
 | 
			
		||||
        console.log(this.monthValue)
 | 
			
		||||
        this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
        this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
 | 
			
		||||
        console.log(this.timeTips);
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.dataForm = {...this.params}
 | 
			
		||||
        this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
 | 
			
		||||
      } else {
 | 
			
		||||
        // this.$modal.msgError('月范围不能为空')
 | 
			
		||||
        // return false
 | 
			
		||||
        if (this.monthValue.length > 0) {
 | 
			
		||||
          console.log(this.monthValue)
 | 
			
		||||
          this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
          // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
          this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
          this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
 | 
			
		||||
          console.log(this.timeTips);
 | 
			
		||||
        } else {
 | 
			
		||||
          // this.$modal.msgError('月范围不能为空')
 | 
			
		||||
          // return false
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.dataForm.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,42 +1,50 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:22:51
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-26 16:01:20
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
          :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
          style="width: 350px" placeholder="选择周">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
 | 
			
		||||
            :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
            style="width: 350px" placeholder="选择周">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
          @click="handleExport">导出</el-button>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
        <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
          size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
        <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
      <el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'" align="center">
 | 
			
		||||
        <el-table-column prop="lineId" label="生产线" align="center">
 | 
			
		||||
      <el-table-column prop="lineId" label="生产线" align="center">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
 | 
			
		||||
          <span v-else>{{ scope.row.lineName }} </span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'">
 | 
			
		||||
        <!-- <el-table-column prop="lineId" label="生产线" align="center">
 | 
			
		||||
          <template slot-scope="scope">
 | 
			
		||||
            <el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
 | 
			
		||||
            <span v-else>{{ scope.row.lineName }} </span>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
        </el-table-column> -->
 | 
			
		||||
        <el-table-column label="投入数㎡" align="center">
 | 
			
		||||
          <el-table-column prop="inputNow" label="本周" align="center">
 | 
			
		||||
            <template slot-scope="scope">
 | 
			
		||||
@@ -292,6 +300,16 @@ export default {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
@@ -505,7 +523,7 @@ export default {
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          document.querySelector("#exportproductionTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
@@ -622,11 +640,16 @@ export default {
 | 
			
		||||
      return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
        this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
        // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
        this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.dataForm = {...this.params}
 | 
			
		||||
        this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
 | 
			
		||||
      } else {
 | 
			
		||||
        if (this.weekValue1 && this.weekValue2) {
 | 
			
		||||
          this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
 | 
			
		||||
          // this.queryParams.startTime = this.monthValue[0]
 | 
			
		||||
          this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
 | 
			
		||||
        } else {
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.dataForm.reportTime.length == 0) {
 | 
			
		||||
        this.$message({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,34 +1,36 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2023-12-12 13:45:25
 | 
			
		||||
 * @LastEditTime: 2024-04-12 14:22:54
 | 
			
		||||
 * @LastEditors: zhp
 | 
			
		||||
 * @LastEditTime: 2024-04-24 15:28:10
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
          :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
          style="width: 350px" placeholder="选择年">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
        查询
 | 
			
		||||
      </el-button>
 | 
			
		||||
      <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
        @click="handleExport">导出</el-button>
 | 
			
		||||
      <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
      <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
        size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
      <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
      <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
    </el-row>
 | 
			
		||||
    <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
    <div v-if="product">
 | 
			
		||||
      <el-form :inline="true" :model="dataForm" class="blueTip">
 | 
			
		||||
        <el-form-item>
 | 
			
		||||
          <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
 | 
			
		||||
            :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
 | 
			
		||||
            style="width: 350px" placeholder="选择年">
 | 
			
		||||
          </el-date-picker>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
 | 
			
		||||
          查询
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
 | 
			
		||||
          @click="handleExport">导出</el-button>
 | 
			
		||||
        <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <el-row style="float: right; margin-bottom: 5px">
 | 
			
		||||
        <el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
 | 
			
		||||
          size="small" @click="editDataList()">编辑</el-button>
 | 
			
		||||
        <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
 | 
			
		||||
        <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
 | 
			
		||||
      </el-row>
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }">
 | 
			
		||||
@@ -294,6 +296,16 @@ export default {
 | 
			
		||||
	// 	DialogForm,
 | 
			
		||||
	// },
 | 
			
		||||
	// mixins: [basicPageMixin],
 | 
			
		||||
  props: {
 | 
			
		||||
    product: {
 | 
			
		||||
      type: Boolean,
 | 
			
		||||
      default: true
 | 
			
		||||
    },
 | 
			
		||||
    params: {
 | 
			
		||||
      type: Object,
 | 
			
		||||
      default: () => {}
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
	data() {
 | 
			
		||||
    return {
 | 
			
		||||
      list: [],
 | 
			
		||||
@@ -440,7 +452,7 @@ export default {
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          document.querySelector("#exportproductionTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
@@ -556,15 +568,20 @@ export default {
 | 
			
		||||
      return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
 | 
			
		||||
    },
 | 
			
		||||
    async getDataList() {
 | 
			
		||||
      this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
 | 
			
		||||
      console.log(this.yearValue1);
 | 
			
		||||
      if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
        if (this.yearValue2 < this.yearValue1) {
 | 
			
		||||
          this.$modal.msgError('结束时间不能早于开始时间')
 | 
			
		||||
          return false
 | 
			
		||||
        } else {
 | 
			
		||||
          // this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
 | 
			
		||||
          // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
 | 
			
		||||
      if (this?.params) {
 | 
			
		||||
        this.dataForm = {...this.params}
 | 
			
		||||
        this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
 | 
			
		||||
      } else {
 | 
			
		||||
        this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
 | 
			
		||||
        console.log(this.yearValue1);
 | 
			
		||||
        if (this.yearValue1 && this.yearValue2) {
 | 
			
		||||
          if (this.yearValue2 < this.yearValue1) {
 | 
			
		||||
            this.$modal.msgError('结束时间不能早于开始时间')
 | 
			
		||||
            return false
 | 
			
		||||
          } else {
 | 
			
		||||
            // this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
 | 
			
		||||
            // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (this.dataForm.reportTime.length == 0) {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										509
									
								
								src/views/report/qcReport/cutDayReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										509
									
								
								src/views/report/qcReport/cutDayReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,509 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 10:01:33
 | 
			
		||||
 * @LastEditTime: 2024-04-26 15:22:57
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <el-table :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%">
 | 
			
		||||
      <el-table-column v-for="(item, index) in tableProps" :key="index" :prop="item.prop" :label="item.label" align="center">
 | 
			
		||||
        <el-table-column v-for="(it, indexNo) in item.children" :key="indexNo" :prop="it.prop" :label="it.label" align="center">
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <el-table class="baseTable" :max-height="tableH" id="exportTableChild" :data="tableDataChild" style="width: 100%">
 | 
			
		||||
      <el-table-column v-for="(item, indexn) in tablePropsChild" :key="indexn" :prop="item.prop" :label="item.label" align="center">
 | 
			
		||||
        <el-table-column v-for="(it, indexi) in item.children" :key="indexi" :prop="it.prop" :label="it.label" align="center">
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" /> -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="30%"> -->
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
    <!-- </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import basicPage from '../../../core/mixins/basic-page';
 | 
			
		||||
// import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getOriginalLineDataList,
 | 
			
		||||
  getCuttingReportDataList
 | 
			
		||||
} from '@/api/report/qcReport';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
 | 
			
		||||
const tablePropsChild = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '人工堆垛人员'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '规格mm'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '规格mm'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '规格mm'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
]
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'createTime',
 | 
			
		||||
  //   label: '添加时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: '',
 | 
			
		||||
    label: '切割堆垛日报',
 | 
			
		||||
    children:[
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'lineName',
 | 
			
		||||
        label: '产线'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'className',
 | 
			
		||||
        label: '班组'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'groupName',
 | 
			
		||||
        label: '班次'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'size',
 | 
			
		||||
        label: '规格 mm 长*宽'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'thickness',
 | 
			
		||||
        label: '厚度mm'
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'glassCode',
 | 
			
		||||
        label: '周转编号',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'stackingType',
 | 
			
		||||
        label: '堆垛方式',
 | 
			
		||||
        // filter: (val) =>
 | 
			
		||||
        //   val != null ? ['集装架', '堵头箱'][val] : '',
 | 
			
		||||
        // filter: ((val) => { val == 1 ? '集装架' : '堵头箱' }),
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'pieces',
 | 
			
		||||
        label: '片数',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'originCode',
 | 
			
		||||
        label: '堆垛工位',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'endTime',
 | 
			
		||||
        label: '堆垛时间',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'dusting',
 | 
			
		||||
        label: '喷粉情况',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'palletNumber',
 | 
			
		||||
        label: '集装架号',
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        prop: 'remark',
 | 
			
		||||
        label: '备注',
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  mixins: [tableHeightMixin],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getCuttingReportDataList,
 | 
			
		||||
        // deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
      tablePropsChild,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      tableDataChild:[],
 | 
			
		||||
      mergeArr: [],//记录合并行数
 | 
			
		||||
      pos: 0,
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
        lineId: undefined,
 | 
			
		||||
      },
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        // 	type: 'input',
 | 
			
		||||
        //   label: '报废原因',
 | 
			
		||||
        //   placeholder: '报废原因',
 | 
			
		||||
        //   param: 'content',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '原料名称',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   param: 'materialId',
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'checkTime',
 | 
			
		||||
          defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime(), new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '产线',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'lineId',
 | 
			
		||||
          // multiple:true,
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
 | 
			
		||||
        //   // type: 'separate',
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    // AddOrUpdate,
 | 
			
		||||
  },
 | 
			
		||||
  created() { },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.formConfig[1].defaultSelect[0] =
 | 
			
		||||
    // this.formConfig[1].defaultSelect[0] =
 | 
			
		||||
    this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime()
 | 
			
		||||
    this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime() + 24 * 60 * 60 * 1000
 | 
			
		||||
    // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
    // this.getSpanArr(this.tableData)
 | 
			
		||||
    // this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      const res = await getOriginalLineDataList()
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      this.formConfig[1].selectOptions = res.data
 | 
			
		||||
    },
 | 
			
		||||
    // getSummaries(param) {
 | 
			
		||||
    //   console.log(columns)
 | 
			
		||||
 | 
			
		||||
    //   const { columns, data } = param;
 | 
			
		||||
    //   const sums = [];
 | 
			
		||||
    //   columns.forEach((column, index) => {
 | 
			
		||||
    //     if (index === 0) {
 | 
			
		||||
    //       sums[index] = '合计';
 | 
			
		||||
    //       return;
 | 
			
		||||
    //     }
 | 
			
		||||
    //     const values = data.map(item => Number(item[column.property]));
 | 
			
		||||
    //     // const data = data.map(item => !Number(item[column.property]));
 | 
			
		||||
    //     if (!values.every(value => isNaN(value))) {
 | 
			
		||||
    //       sums[index] = values.reduce((prev, curr) => {
 | 
			
		||||
    //         const value = Number(curr);
 | 
			
		||||
    //         if (!isNaN(value)) {
 | 
			
		||||
    //           return prev + curr;
 | 
			
		||||
    //         } else {
 | 
			
		||||
    //           return prev;
 | 
			
		||||
    //         }
 | 
			
		||||
    //       }, 0);
 | 
			
		||||
    //       sums[index] += ' ';
 | 
			
		||||
    //     } else {
 | 
			
		||||
    //       sums[index] = '-';
 | 
			
		||||
    //     }
 | 
			
		||||
    //   });
 | 
			
		||||
 | 
			
		||||
    //   return sums;
 | 
			
		||||
    // },
 | 
			
		||||
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
      let spanOneArr = [], concatOne = 0;
 | 
			
		||||
      this.tableData.map((item, index) => {
 | 
			
		||||
        if (index === 0) {
 | 
			
		||||
          spanOneArr.push(1);
 | 
			
		||||
        } else {
 | 
			
		||||
          //第一列需合并相同内容的判断条件
 | 
			
		||||
          if (item.lineName === this.tableData[index - 1].lineName) {
 | 
			
		||||
            spanOneArr[concatOne] += 1;
 | 
			
		||||
            spanOneArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanOneArr.push(1);
 | 
			
		||||
            concatOne = index;
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      if (columnIndex === 0) {
 | 
			
		||||
        const _row = spanOneArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      console.log(this.$refs);
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "切割堆垛日报.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTableChild"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "切割堆垛日报.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // otherMethods(val) {
 | 
			
		||||
    //   if (val.type === 'detail') {
 | 
			
		||||
    //     this.addOrUpdateVisible = true;
 | 
			
		||||
    //     this.addOrEditTitle = "详情";
 | 
			
		||||
    //     this.$nextTick(() => {
 | 
			
		||||
    //       this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
    //     });
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      // this.listQuery.startTime = '1711095616000';
 | 
			
		||||
      // this.listQuery.endTime = '1711183743000';
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        // this.getSpanArr(this.tableData)
 | 
			
		||||
        // response.data.forEach((ele) => {
 | 
			
		||||
        //   console.log(ele.size.substring(2, ele.size.length - 2))
 | 
			
		||||
        //   // console.log(Object.prototype.toString.call(ele.size))
 | 
			
		||||
        //   // // if (Object.prototype.toString.call(ele.size) === Array) {
 | 
			
		||||
        //   //   console.log(11111)
 | 
			
		||||
        //   //   console.log();
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        this.tableData = response.data.map((ele) => {
 | 
			
		||||
          return {
 | 
			
		||||
            lineName: ele.lineName,
 | 
			
		||||
            className: ele.className,
 | 
			
		||||
            groupName: ele.groupName,
 | 
			
		||||
            size: ele.size,
 | 
			
		||||
            thickness: ele.thickness,
 | 
			
		||||
            glassCode: ele.glassCode,
 | 
			
		||||
            stackingType: ele.stackingType == 1 ? '集装架' : '堵头箱',
 | 
			
		||||
            pieces: ele.pieces,
 | 
			
		||||
            originCode: ele.originCode,
 | 
			
		||||
            endTime: parseTime(ele.endTime),
 | 
			
		||||
            dusting: ele.dusting,
 | 
			
		||||
            palletNumber: ele.palletNumber,
 | 
			
		||||
            remark:ele.remark
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // response.data.reduce((prev, curr) => {
 | 
			
		||||
        //   console.log(prev, curr)
 | 
			
		||||
        // })
 | 
			
		||||
        // this.tableData.forEach((ele) => {
 | 
			
		||||
        //   ele.size.substring(2, ele.size.length - 2)
 | 
			
		||||
        //   // console.log(Object.prototype.toString.call(ele.size))
 | 
			
		||||
        //   // // if (Object.prototype.toString.call(ele.size) === Array) {
 | 
			
		||||
        //   //   console.log(11111)
 | 
			
		||||
        //   //   console.log();
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // this.tableData.forEach(ele => {
 | 
			
		||||
        //   obj.num += ele.num
 | 
			
		||||
        //   obj.area += ele.num
 | 
			
		||||
        //   obj.count += ele.num
 | 
			
		||||
 | 
			
		||||
        // })
 | 
			
		||||
        // console.log(obj);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // deleteHandle(id, name, index, data) {
 | 
			
		||||
    //   this.$confirm(`确认要删除序号${index}?`, "提示", {
 | 
			
		||||
    //     confirmButtonText: "确定",
 | 
			
		||||
    //     cancelButtonText: "取消",
 | 
			
		||||
    //     type: "warning",
 | 
			
		||||
    //   })
 | 
			
		||||
    //     .then(() => {
 | 
			
		||||
    //       this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
    //         this.$message({
 | 
			
		||||
    //           message: "操作成功",
 | 
			
		||||
    //           type: "success",
 | 
			
		||||
    //           duration: 1500,
 | 
			
		||||
    //           onClose: () => {
 | 
			
		||||
    //             this.getDataList();
 | 
			
		||||
    //           },
 | 
			
		||||
    //         });
 | 
			
		||||
    //       });
 | 
			
		||||
    //     })
 | 
			
		||||
    //     .catch(() => { });
 | 
			
		||||
    // },
 | 
			
		||||
    // async getDict() {
 | 
			
		||||
    //   // 物料列表
 | 
			
		||||
    //   const res = await getHotMaterialAllList();
 | 
			
		||||
    //   this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
    // },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          // this.listQuery.pageNo = 1;
 | 
			
		||||
          // this.listQuery.pageSize = 20;
 | 
			
		||||
          // this.listQuery.materialId = val.materialId ? val.materialId : undefined;
 | 
			
		||||
          // this.listQuery.startTime = '1706144404000';
 | 
			
		||||
          // this.listQuery.endTime = '1706230804000';
 | 
			
		||||
          this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() : undefined;
 | 
			
		||||
          this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() + 24*60*60*1000 : undefined;
 | 
			
		||||
          this.listQuery.lineId = val.lineId ? val.lineId : undefined
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        // case 'reset':
 | 
			
		||||
        //   this.$refs.searchBarForm.resetForm();
 | 
			
		||||
        //   this.listQuery = {
 | 
			
		||||
        //     pageSize: 20,
 | 
			
		||||
        //     pageNo: 1,
 | 
			
		||||
        //     total: 1,
 | 
			
		||||
        //   };
 | 
			
		||||
        //   this.getDataList();
 | 
			
		||||
        //   break;
 | 
			
		||||
        // case 'add':
 | 
			
		||||
        //   this.addOrEditTitle = '新增';
 | 
			
		||||
        //   this.addOrUpdateVisible = true;
 | 
			
		||||
        //   this.addOrUpdateHandle();
 | 
			
		||||
        //   break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.baseTable {
 | 
			
		||||
  border-color: #D1D4DB;
 | 
			
		||||
  background-color: #F2F4F9;
 | 
			
		||||
}
 | 
			
		||||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
 | 
			
		||||
  background-color: #EAF1FC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep .baseTable .el-table .el-table__cell {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 35px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										469
									
								
								src/views/report/qcReport/fullInspection/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										469
									
								
								src/views/report/qcReport/fullInspection/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,469 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 14:08:46
 | 
			
		||||
 * @LastEditTime: 2024-04-26 16:12:51
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
 | 
			
		||||
      <el-form-item label="时间" prop="startTime">
 | 
			
		||||
        <el-date-picker v-model="listQuery.startTime" value-format="yyyy-MM-dd HH:mm:ss" type="date" placeholder="选择日期">
 | 
			
		||||
        </el-date-picker>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="产线" prop="productionLineId">
 | 
			
		||||
        <el-select v-model="listQuery.productionLineId" placeholder="请选择" clearable>
 | 
			
		||||
          <el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id">
 | 
			
		||||
          </el-option>
 | 
			
		||||
        </el-select>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="" prop="">
 | 
			
		||||
        <el-radio-group v-model="radio" @input="handleGetClass">
 | 
			
		||||
          <el-radio-button label="早班查询"></el-radio-button>
 | 
			
		||||
          <el-radio-button label="晚班查询"></el-radio-button>
 | 
			
		||||
        </el-radio-group>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
 | 
			
		||||
      <el-form-item>
 | 
			
		||||
        <el-button type="primary" size="small" @click="getDataList">查询</el-button>
 | 
			
		||||
        <el-button type="primary" size="small" plain @click="handleExport">导出</el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
    <!-- <el-table show-summary :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
 | 
			
		||||
      :span-method="objectSpanMethod">
 | 
			
		||||
      <el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table> -->
 | 
			
		||||
    <!-- <el-table border style="margin-top: 50px;" :data="transData">
 | 
			
		||||
      <el-table-column v-for="(item, index) in transTitle" :label="item" :key="index" align="center">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          {{scope.row[index]}}
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table> -->
 | 
			
		||||
 | 
			
		||||
    <el-table :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" id="exportTable" class="baseTable" :data="tableData" style="width: 100%">
 | 
			
		||||
      <el-table-column label="时间" align="right" width="150">
 | 
			
		||||
        <el-table-column prop="name" label="缺陷" width="120">
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <!-- <el-table-column prop="putType" label="" width="180">
 | 
			
		||||
      </el-table-column> -->
 | 
			
		||||
      <!-- <el-table-column prop label="参考标准及评价方法">
 | 
			
		||||
        <el-table-column prop="activityName"></el-table-column>
 | 
			
		||||
        <el-table-column prop="message"></el-table-column>
 | 
			
		||||
      </el-table-column> -->
 | 
			
		||||
      <el-table-column v-for="(item, index) in codeList " :key="index" :prop="item.prop" :label="item.label">
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" /> -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="30%"> -->
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
    <!-- </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import basicPage from '../../../core/mixins/basic-page';
 | 
			
		||||
// import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getQualityRecordReport,
 | 
			
		||||
  getCWSectionList
 | 
			
		||||
} from '@/api/report/qcReport';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const headers = [
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'createTime',
 | 
			
		||||
  //   label: '添加时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'classType',
 | 
			
		||||
    label: '时间'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'equipmentName',
 | 
			
		||||
    label: ''
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'area',
 | 
			
		||||
    label: '面积'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'countNum',
 | 
			
		||||
    label: '托数',
 | 
			
		||||
    // filter: (val) => val == false ? '不合格' : '合格',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'size',
 | 
			
		||||
    label: '规格',
 | 
			
		||||
    // filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkerName',
 | 
			
		||||
  //   label: '检测人员'
 | 
			
		||||
  // },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkTime',
 | 
			
		||||
  //   label: '检测时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  mixins: [tableHeightMixin],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getQualityRecordReport,
 | 
			
		||||
        // deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        startTime: null,
 | 
			
		||||
        productionLineId:null,
 | 
			
		||||
      },
 | 
			
		||||
      sum:null,
 | 
			
		||||
      radio:'晚班查询',
 | 
			
		||||
      lineList:[],
 | 
			
		||||
      codeList: [
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '19:00',
 | 
			
		||||
        //   prop: 'num0'
 | 
			
		||||
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '20:00',
 | 
			
		||||
        //   prop: 'num1'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '21:00',
 | 
			
		||||
        //   prop: 'num2'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '22:00',
 | 
			
		||||
        //   prop: 'num3'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '23:00',
 | 
			
		||||
        //   prop: 'num4'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '00:00',
 | 
			
		||||
        //   prop: 'num5'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '01:00',
 | 
			
		||||
        //   prop: 'num6'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '02:00',
 | 
			
		||||
        //   prop: 'num7'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '03:00',
 | 
			
		||||
        //   prop: 'num8'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '04:00',
 | 
			
		||||
        //   prop: 'num9'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '05:00',
 | 
			
		||||
        //   prop: 'num10'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '06:00',
 | 
			
		||||
        //   prop: 'num11'
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   label: '不良合计',
 | 
			
		||||
        //   prop: 'sum'
 | 
			
		||||
        // }
 | 
			
		||||
      ],
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'checkTime',
 | 
			
		||||
          defaultSelect: [Date.now() - 24 * 60 * 60*1000, Date.now()],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    // AddOrUpdate,
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.formConfig[1].defaultSelect[]
 | 
			
		||||
    // this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
 | 
			
		||||
    // this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
 | 
			
		||||
    // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
 | 
			
		||||
    this.listQuery.startTime = new Date()
 | 
			
		||||
    // this.getDataList()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
    // this.getSpanArr(this.tableData)
 | 
			
		||||
    // this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      const res = await getCWSectionList()
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      this.lineList = res.data
 | 
			
		||||
    },
 | 
			
		||||
    // objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
    //   if (columnIndex === 1) {
 | 
			
		||||
    //     if (rowIndex === this.tableData.length-1) {
 | 
			
		||||
    //       return {
 | 
			
		||||
    //         rowspan: 1,
 | 
			
		||||
    //         colspan: 4
 | 
			
		||||
    //       }
 | 
			
		||||
    //     }
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    formatDateTime(time) {
 | 
			
		||||
      var date = new Date(time);
 | 
			
		||||
      var y = date.getFullYear();
 | 
			
		||||
      var m = date.getMonth() + 1;
 | 
			
		||||
      m = m < 10 ? ('0' + m) : m;
 | 
			
		||||
      var d = date.getDate();
 | 
			
		||||
      d = d < 10 ? ('0' + d) : d;
 | 
			
		||||
      var h = date.getHours();
 | 
			
		||||
      h = h < 10 ? ('0' + h) : h;
 | 
			
		||||
      var minute = date.getMinutes();
 | 
			
		||||
      var second = date.getSeconds();
 | 
			
		||||
      minute = minute < 10 ? ('0' + minute) : minute;
 | 
			
		||||
      second = second < 10 ? ('0' + second) : second;
 | 
			
		||||
 | 
			
		||||
      return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
 | 
			
		||||
    },
 | 
			
		||||
    handleGetClass(e) {
 | 
			
		||||
        this.getDataList()
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      console.log(this.$refs);
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "全检检验记录.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
          this.$message.success('导出成功');
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    // otherMethods(val) {
 | 
			
		||||
    //   if (val.type === 'detail') {
 | 
			
		||||
    //     this.addOrUpdateVisible = true;
 | 
			
		||||
    //     this.addOrEditTitle = "详情";
 | 
			
		||||
    //     this.$nextTick(() => {
 | 
			
		||||
    //       this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
    //     });
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      var str = null
 | 
			
		||||
      if (this.radio == '晚班查询') {
 | 
			
		||||
        console.log(this.radio);
 | 
			
		||||
        str = new Date(new Date(this.listQuery.startTime).setHours(19, 0, 0, 0)).getTime()
 | 
			
		||||
      } else {
 | 
			
		||||
        str = new Date(new Date(this.listQuery.startTime).setHours(7, 0, 0, 0)).getTime()
 | 
			
		||||
      }
 | 
			
		||||
      // this.dataListLoading = true;
 | 
			
		||||
      // this.listQuery.startTime = '1713197388000';
 | 
			
		||||
      // this.listQuery.endTime = '1713254961000';
 | 
			
		||||
      this.urlOptions.getDataListURL({
 | 
			
		||||
        // productionLineId: '1696716506443354114',
 | 
			
		||||
        // startTime: '1705618800000',
 | 
			
		||||
        productionLineId: this.listQuery.productionLineId,
 | 
			
		||||
        startTime: str
 | 
			
		||||
      },).then(res => {
 | 
			
		||||
        let count = 0
 | 
			
		||||
        let arr = []
 | 
			
		||||
        console.log(res.data)
 | 
			
		||||
 | 
			
		||||
        res.data?.timeStrList.push('不良合计')
 | 
			
		||||
        this.codeList = res.data.timeStrList.map((ele, index) => {
 | 
			
		||||
          if (ele === '不良合计') {
 | 
			
		||||
            return {
 | 
			
		||||
              label: ele,
 | 
			
		||||
              prop: 'sum'
 | 
			
		||||
            }
 | 
			
		||||
          } else {
 | 
			
		||||
            return {
 | 
			
		||||
              label: ele,
 | 
			
		||||
              prop: 'num' + index
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
        })
 | 
			
		||||
        console.log(this.codeList)
 | 
			
		||||
        // res.data.timeStrList.forEach((ele, index) => [
 | 
			
		||||
        //   this.codeList.push(ele)
 | 
			
		||||
        // ])
 | 
			
		||||
        for (let i in res.data.qualityInspectionRecordReportLineVOMap) {
 | 
			
		||||
          count ++,
 | 
			
		||||
          console.log(res.data.qualityInspectionRecordReportLineVOMap[i])
 | 
			
		||||
          // arr.push({
 | 
			
		||||
 | 
			
		||||
          // })
 | 
			
		||||
          // console.log(arr)
 | 
			
		||||
          let obj = {
 | 
			
		||||
            name: res.data.qualityInspectionRecordReportLineVOMap[i].content,
 | 
			
		||||
            sum: res.data.qualityInspectionRecordReportLineVOMap[i].sum,
 | 
			
		||||
          }
 | 
			
		||||
          res.data.qualityInspectionRecordReportLineVOMap[i].nums.forEach((ele, index) => {
 | 
			
		||||
            obj['num' +index] = ele
 | 
			
		||||
            // console.log(arr[count])
 | 
			
		||||
            // arr[count]['num'+index] = ele
 | 
			
		||||
          })
 | 
			
		||||
          arr.push(obj)
 | 
			
		||||
        }
 | 
			
		||||
        console.log(arr);
 | 
			
		||||
        this.tableData = arr
 | 
			
		||||
        this.tableData.push({
 | 
			
		||||
          name: '检验员',
 | 
			
		||||
          num11: '合计',
 | 
			
		||||
          sum: res.data.allSum
 | 
			
		||||
        })
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          // this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
 | 
			
		||||
          // this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.baseTable {
 | 
			
		||||
  border-color: #D1D4DB;
 | 
			
		||||
  background-color: #F2F4F9;
 | 
			
		||||
}
 | 
			
		||||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
 | 
			
		||||
  background-color: #EAF1FC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep .baseTable .el-table .el-table__cell {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 35px;
 | 
			
		||||
}
 | 
			
		||||
::v-deep.el-table thead.is-group th {
 | 
			
		||||
  background: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type {
 | 
			
		||||
  border-bottom: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type:before {
 | 
			
		||||
  content: '';
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  width: 1px;
 | 
			
		||||
  height: 75px;
 | 
			
		||||
  /*这里需要自己调整,根据td的宽度和高度*/
 | 
			
		||||
  top: 0;
 | 
			
		||||
  left: 0;
 | 
			
		||||
  background-color: grey;
 | 
			
		||||
  opacity: 0.3;
 | 
			
		||||
  display: block;
 | 
			
		||||
  transform: rotate(-53deg);
 | 
			
		||||
  /*这里需要自己调整,根据线的位置*/
 | 
			
		||||
  transform-origin: top;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep.el-table thead.is-group tr:last-of-type th:first-of-type:before {
 | 
			
		||||
  content: '';
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  width: 1px;
 | 
			
		||||
  height: 75px;
 | 
			
		||||
  /*这里需要自己调整,根据td的宽度和高度*/
 | 
			
		||||
  bottom: 0;
 | 
			
		||||
  right: 0;
 | 
			
		||||
  background-color: grey;
 | 
			
		||||
  opacity: 0.3;
 | 
			
		||||
  display: block;
 | 
			
		||||
  transform: rotate(-54deg);
 | 
			
		||||
  /*这里需要自己调整,根据线的位置*/
 | 
			
		||||
  transform-origin: bottom;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										359
									
								
								src/views/report/qcReport/israLineReport/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										359
									
								
								src/views/report/qcReport/israLineReport/index.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,359 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div class="app-container isra-line-report">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			@headBtnClick="buttonClick"
 | 
			
		||||
			@datepicker-change="datepickerChange" />
 | 
			
		||||
		<base-table
 | 
			
		||||
			class="israLineReportTable1"
 | 
			
		||||
			ref="israLineReportTable11"
 | 
			
		||||
			id="israLineReportTable1"
 | 
			
		||||
			:table-props="tableProp"
 | 
			
		||||
			:table-data="tableData"
 | 
			
		||||
			:span-method="objectSpanMethod"
 | 
			
		||||
			:max-height="tableH" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
const tableProp1 = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'dataStr',
 | 
			
		||||
		label: '日期',
 | 
			
		||||
		width: 110,
 | 
			
		||||
		fixed: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'lineName',
 | 
			
		||||
		label: '生产线',
 | 
			
		||||
		width: 90,
 | 
			
		||||
		fixed: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		label: '类型',
 | 
			
		||||
		fixed: true,
 | 
			
		||||
		width: 110,
 | 
			
		||||
		children: [
 | 
			
		||||
			{
 | 
			
		||||
				prop: 'className',
 | 
			
		||||
				label: '班次',
 | 
			
		||||
				width: 140,
 | 
			
		||||
			},
 | 
			
		||||
		],
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
import { israData } from '@/api/report/customizedReports';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import { getOriginalLine } from '@/api/report/customizedReports';
 | 
			
		||||
import FileSaver from 'file-saver';
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'IsraLineReport',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			heightNum: 215,
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd HH:mm',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 300,
 | 
			
		||||
					onchange: true,
 | 
			
		||||
					clearable: false,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '产线',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'lineId',
 | 
			
		||||
					multiple: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					plain: true,
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				startTime: '',
 | 
			
		||||
				endTime: '',
 | 
			
		||||
				lineId: [],
 | 
			
		||||
			},
 | 
			
		||||
			tableProp1,
 | 
			
		||||
			tableProp: [],
 | 
			
		||||
			tableData: [],
 | 
			
		||||
			span: [], //表第一列合并
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getLine();
 | 
			
		||||
	},
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.tableProp = this.tableProp1;
 | 
			
		||||
		let start = moment(moment().format('yyyy-MM-DD') + ' 07:00:00').format(
 | 
			
		||||
			'yyyy-MM-DD HH:mm:ss'
 | 
			
		||||
		);
 | 
			
		||||
		let end =
 | 
			
		||||
			moment(moment().valueOf() + 86400000).format('yyyy-MM-DD') + ' 06:59:59';
 | 
			
		||||
		this.formConfig[0].defaultSelect = [start, end];
 | 
			
		||||
		this.queryParams.startTime = moment(start).valueOf();
 | 
			
		||||
		this.queryParams.endTime = moment(end).valueOf();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getLine() {
 | 
			
		||||
			getOriginalLine().then((res) => {
 | 
			
		||||
				this.formConfig[1].selectOptions = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			israData({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.tableProp = [];
 | 
			
		||||
				let data = res.data;
 | 
			
		||||
				if (data.length > 0) {
 | 
			
		||||
					let typeArr = data[0].allType;
 | 
			
		||||
					let arr = [];
 | 
			
		||||
					typeArr &&
 | 
			
		||||
						typeArr.map((item) => {
 | 
			
		||||
							let obj = {};
 | 
			
		||||
							obj.prop = item.name;
 | 
			
		||||
							obj.label = item.name;
 | 
			
		||||
							obj.minWidth = 120;
 | 
			
		||||
							arr.push(obj);
 | 
			
		||||
						});
 | 
			
		||||
					this.tableProp = this.tableProp1.concat(arr); //表头
 | 
			
		||||
					this.transformData(data);
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		transformData(data) {
 | 
			
		||||
			let part1Data = [];
 | 
			
		||||
			let part2Data = [];
 | 
			
		||||
			for (let i = 0; i < data.length; i++) {
 | 
			
		||||
				let obj = {};
 | 
			
		||||
				let arr = [];
 | 
			
		||||
				arr = this.uniqueLine(data[i].allClass, 'lineName');
 | 
			
		||||
				obj.dataStr = data[i].dataStr;
 | 
			
		||||
				obj.dayClass = [];
 | 
			
		||||
				obj.allClass = [];
 | 
			
		||||
				obj.nightClass = [];
 | 
			
		||||
				obj.num = arr.length;
 | 
			
		||||
				arr.length > 0 &&
 | 
			
		||||
					arr.map((item) => {
 | 
			
		||||
						// 白班
 | 
			
		||||
						let dobj = {};
 | 
			
		||||
						dobj.className = '白班';
 | 
			
		||||
						dobj.dataStr = data[i].dataStr;
 | 
			
		||||
						for (let a = 0; a < data[i].dayClass.length; a++) {
 | 
			
		||||
							dobj.lineName = item.lineName;
 | 
			
		||||
							if (item.lineName === data[i].dayClass[a].lineName) {
 | 
			
		||||
								dobj[data[i].dayClass[a].checkType] =
 | 
			
		||||
									data[i].dayClass[a].checkNum;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
						obj.dayClass.push(dobj);
 | 
			
		||||
						// 夜班
 | 
			
		||||
						let nobj = {};
 | 
			
		||||
						nobj.className = '夜班';
 | 
			
		||||
						nobj.dataStr = data[i].dataStr;
 | 
			
		||||
						for (let a = 0; a < data[i].nightClass.length; a++) {
 | 
			
		||||
							nobj.lineName = item.lineName;
 | 
			
		||||
							if (item.lineName === data[i].nightClass[a].lineName) {
 | 
			
		||||
								nobj[data[i].nightClass[a].checkType] =
 | 
			
		||||
									data[i].nightClass[a].checkNum;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
						obj.nightClass.push(nobj);
 | 
			
		||||
						// 合计
 | 
			
		||||
						let sobj = {};
 | 
			
		||||
						sobj.className = '合计';
 | 
			
		||||
						sobj.dataStr = data[i].dataStr;
 | 
			
		||||
						for (let a = 0; a < data[i].allClass.length; a++) {
 | 
			
		||||
							sobj.lineName = item.lineName;
 | 
			
		||||
							if (item.lineName === data[i].allClass[a].lineName) {
 | 
			
		||||
								sobj[data[i].allClass[a].checkType] =
 | 
			
		||||
									data[i].allClass[a].checkNum;
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
						obj.allClass.push(sobj);
 | 
			
		||||
					});
 | 
			
		||||
				part1Data.push(obj);
 | 
			
		||||
			}
 | 
			
		||||
			for (let j = 0; j < part1Data.length; j++) {
 | 
			
		||||
				for (let k = 0; k < part1Data[j].num; k++) {
 | 
			
		||||
					part2Data.push(part1Data[j].dayClass[k]);
 | 
			
		||||
					part2Data.push(part1Data[j].nightClass[k]);
 | 
			
		||||
					part2Data.push(part1Data[j].allClass[k]);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			this.tableData = part2Data;
 | 
			
		||||
			this.getSpanArr(this.tableData);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.reTable();
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		reTable() {
 | 
			
		||||
			this.$refs.israLineReportTable11.doLayout('israLineReportTable1');
 | 
			
		||||
		},
 | 
			
		||||
		// 产线去重
 | 
			
		||||
		uniqueLine(arr, prop) {
 | 
			
		||||
			return arr.filter((value, index, self) => {
 | 
			
		||||
				return (
 | 
			
		||||
					self.findIndex((t) => {
 | 
			
		||||
						return t[prop] === value[prop];
 | 
			
		||||
					}) === index
 | 
			
		||||
				);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 获取合并行
 | 
			
		||||
		getSpanArr(data) {
 | 
			
		||||
			this.span = [];
 | 
			
		||||
			for (var i = 0; i < data.length; i++) {
 | 
			
		||||
				if (i === 0) {
 | 
			
		||||
					this.span.push(1);
 | 
			
		||||
					this.index = 0;
 | 
			
		||||
				} else {
 | 
			
		||||
					if (data[i].dataStr === data[i - 1].dataStr) {
 | 
			
		||||
						this.span[this.index] += 1;
 | 
			
		||||
						this.span.push(0);
 | 
			
		||||
					} else {
 | 
			
		||||
						this.span.push(1);
 | 
			
		||||
						this.index = i;
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 时间选择器change
 | 
			
		||||
		datepickerChange(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			let start = moment(
 | 
			
		||||
				moment(val.value[0]).format('yyyy-MM-DD') + ' 07:00:00'
 | 
			
		||||
			).format('yyyy-MM-DD HH:mm:ss');
 | 
			
		||||
			let end =
 | 
			
		||||
				moment(moment(val.value[1]).valueOf() + 86400000).format('yyyy-MM-DD') +
 | 
			
		||||
				' 06:59:59';
 | 
			
		||||
			this.formConfig[0].defaultSelect = [start, end];
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
					this.queryParams.startTime = moment(val.timeVal[0]).valueOf();
 | 
			
		||||
					this.queryParams.endTime = moment(val.timeVal[1]).valueOf();
 | 
			
		||||
				}
 | 
			
		||||
				this.queryParams.lineId = val.lineId;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				// 导出
 | 
			
		||||
				this.exportTable();
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		exportTable() {
 | 
			
		||||
			// 处理查询参数
 | 
			
		||||
			var fix = document.querySelectorAll('.el-table__fixed')[0];
 | 
			
		||||
			var table = document.querySelector('.israLineReportTable1').childNodes[0];
 | 
			
		||||
			var wb;
 | 
			
		||||
			import('xlsx').then((excel) => {
 | 
			
		||||
				if (fix) {
 | 
			
		||||
					wb = excel.utils.table_to_book(table.removeChild(fix));
 | 
			
		||||
					table.appendChild(fix);
 | 
			
		||||
				} else {
 | 
			
		||||
					wb = excel.utils.table_to_book(table);
 | 
			
		||||
				}
 | 
			
		||||
				/* 获取二进制字符串作为输出 */
 | 
			
		||||
				var wbout = excel.write(wb, {
 | 
			
		||||
					bookType: 'xlsx',
 | 
			
		||||
					bookSST: true,
 | 
			
		||||
					type: 'array',
 | 
			
		||||
				});
 | 
			
		||||
				try {
 | 
			
		||||
					FileSaver.saveAs(
 | 
			
		||||
						new Blob([wbout], { type: 'application/octet-stream' }),
 | 
			
		||||
						//设置导出文件名称
 | 
			
		||||
						'原片各线isra数据.xlsx'
 | 
			
		||||
					);
 | 
			
		||||
				} catch (e) {
 | 
			
		||||
					if (typeof console !== 'undefined') console.log(e, wbout);
 | 
			
		||||
				}
 | 
			
		||||
				return wbout;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
			if (columnIndex === 0) {
 | 
			
		||||
				const _row = this.span[rowIndex];
 | 
			
		||||
				return {
 | 
			
		||||
					rowspan: _row,
 | 
			
		||||
					colspan: 1,
 | 
			
		||||
				};
 | 
			
		||||
			} else if (columnIndex === 1) {
 | 
			
		||||
				if (rowIndex % 3 === 0) {
 | 
			
		||||
					return {
 | 
			
		||||
						rowspan: 3,
 | 
			
		||||
						colspan: 1,
 | 
			
		||||
					};
 | 
			
		||||
				} else {
 | 
			
		||||
					return {
 | 
			
		||||
						rowspan: 0,
 | 
			
		||||
						colspan: 0,
 | 
			
		||||
					};
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang="scss">
 | 
			
		||||
.isra-line-report {
 | 
			
		||||
	.el-table thead.is-group tr:first-of-type th:nth-child(3) {
 | 
			
		||||
		border-bottom: none;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table thead.is-group tr:first-of-type th:nth-child(3) div.cell {
 | 
			
		||||
		padding-left: 82px;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table th.el-table__cell {
 | 
			
		||||
		height: 28px;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table thead.is-group tr:first-of-type th:nth-child(3):before {
 | 
			
		||||
		content: '';
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		height: 80px;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		left: 0;
 | 
			
		||||
		background-color: #ebeef5;
 | 
			
		||||
		transform: rotate(-70deg);
 | 
			
		||||
		-webkit-transform-origin: top;
 | 
			
		||||
		transform-origin: top;
 | 
			
		||||
		width: 1px;
 | 
			
		||||
	}
 | 
			
		||||
	.el-table thead.is-group tr:last-of-type th:nth-child(1):before {
 | 
			
		||||
		content: '';
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		height: 67px;
 | 
			
		||||
		top: 0;
 | 
			
		||||
		left: 75px;
 | 
			
		||||
		background-color: #ebeef5;
 | 
			
		||||
		transform: rotate(-70deg);
 | 
			
		||||
		-webkit-transform-origin: top;
 | 
			
		||||
		transform-origin: top;
 | 
			
		||||
		width: 1px;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										411
									
								
								src/views/report/qcReport/lineReport.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										411
									
								
								src/views/report/qcReport/lineReport.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,411 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 10:01:33
 | 
			
		||||
 * @LastEditTime: 2024-04-26 15:31:24
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <el-table :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" class="baseTable" border :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
 | 
			
		||||
      :span-method="objectSpanMethod">
 | 
			
		||||
      <el-table-column :width="item.width" v-for="(item, index) in tableProps" :key="index" :prop="item.prop" :label="item.label" align="center">
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" /> -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="30%"> -->
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
    <!-- </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import basicPage from '../../../core/mixins/basic-page';
 | 
			
		||||
// import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getOriginalData,
 | 
			
		||||
  getOriginalLineDataList
 | 
			
		||||
} from '@/api/report/qcReport';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import { width } from '@antv/x6-common/lib/dom/position';
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'createTime',
 | 
			
		||||
  //   label: '添加时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'lineName',
 | 
			
		||||
    label: '生产线',
 | 
			
		||||
    width:'100'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'equipmentName',
 | 
			
		||||
    label: '机械手名称',
 | 
			
		||||
    width: '200'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'area',
 | 
			
		||||
    label: '面积'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'countNum',
 | 
			
		||||
    label: '托数',
 | 
			
		||||
    // filter: (val) => val == false ? '不合格' : '合格',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'size',
 | 
			
		||||
    label: '规格',
 | 
			
		||||
    // filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkerName',
 | 
			
		||||
  //   label: '检测人员'
 | 
			
		||||
  // },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkTime',
 | 
			
		||||
  //   label: '检测时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  mixins: [ tableHeightMixin],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getOriginalData,
 | 
			
		||||
        // deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      mergeArr: [],//记录合并行数
 | 
			
		||||
      pos: 0,
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
        lineId:undefined,
 | 
			
		||||
      },
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        // 	type: 'input',
 | 
			
		||||
        //   label: '报废原因',
 | 
			
		||||
        //   placeholder: '报废原因',
 | 
			
		||||
        //   param: 'content',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '原料名称',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   param: 'materialId',
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          // format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'checkTime',
 | 
			
		||||
          defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000, new Date(new Date(Date.now()).setHours(6, 59, 59, 0)).getTime()],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '产线',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'lineId',
 | 
			
		||||
          multiple:true,
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type:'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
 | 
			
		||||
        //   // type: 'separate',
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type:'button',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    // AddOrUpdate,
 | 
			
		||||
  },
 | 
			
		||||
  created() { },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.formConfig[1].defaultSelect[]
 | 
			
		||||
    this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
 | 
			
		||||
    this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
 | 
			
		||||
    // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
    // this.getSpanArr(this.tableData)
 | 
			
		||||
    // this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      const res = await getOriginalLineDataList()
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      this.formConfig[1].selectOptions = res.data
 | 
			
		||||
    },
 | 
			
		||||
    // getSummaries(param) {
 | 
			
		||||
    //   console.log(columns)
 | 
			
		||||
 | 
			
		||||
    //   const { columns, data } = param;
 | 
			
		||||
    //   const sums = [];
 | 
			
		||||
    //   columns.forEach((column, index) => {
 | 
			
		||||
    //     if (index === 0) {
 | 
			
		||||
    //       sums[index] = '合计';
 | 
			
		||||
    //       return;
 | 
			
		||||
    //     }
 | 
			
		||||
    //     const values = data.map(item => Number(item[column.property]));
 | 
			
		||||
    //     // const data = data.map(item => !Number(item[column.property]));
 | 
			
		||||
    //     if (!values.every(value => isNaN(value))) {
 | 
			
		||||
    //       sums[index] = values.reduce((prev, curr) => {
 | 
			
		||||
    //         const value = Number(curr);
 | 
			
		||||
    //         if (!isNaN(value)) {
 | 
			
		||||
    //           return prev + curr;
 | 
			
		||||
    //         } else {
 | 
			
		||||
    //           return prev;
 | 
			
		||||
    //         }
 | 
			
		||||
    //       }, 0);
 | 
			
		||||
    //       sums[index] += ' ';
 | 
			
		||||
    //     } else {
 | 
			
		||||
    //       sums[index] = '-';
 | 
			
		||||
    //     }
 | 
			
		||||
    //   });
 | 
			
		||||
 | 
			
		||||
    //   return sums;
 | 
			
		||||
    // },
 | 
			
		||||
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
      let spanOneArr = [], concatOne = 0;
 | 
			
		||||
      this.tableData.map((item, index) => {
 | 
			
		||||
        if (index === 0) {
 | 
			
		||||
          spanOneArr.push(1);
 | 
			
		||||
        } else {
 | 
			
		||||
          //第一列需合并相同内容的判断条件
 | 
			
		||||
          if (item.lineName === this.tableData[index - 1].lineName) {
 | 
			
		||||
            spanOneArr[concatOne] += 1;
 | 
			
		||||
            spanOneArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanOneArr.push(1);
 | 
			
		||||
            concatOne = index;
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      if (columnIndex === 0) {
 | 
			
		||||
        const _row = spanOneArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      console.log(this.$refs);
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "原片各线堆垛表.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    // otherMethods(val) {
 | 
			
		||||
    //   if (val.type === 'detail') {
 | 
			
		||||
    //     this.addOrUpdateVisible = true;
 | 
			
		||||
    //     this.addOrEditTitle = "详情";
 | 
			
		||||
    //     this.$nextTick(() => {
 | 
			
		||||
    //       this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
    //     });
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      // this.listQuery.startTime = '1711095616000';
 | 
			
		||||
      // this.listQuery.endTime = '1711183743000';
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        // this.getSpanArr(this.tableData)
 | 
			
		||||
        // response.data.forEach((ele) => {
 | 
			
		||||
        //   console.log(ele.size.substring(2, ele.size.length - 2))
 | 
			
		||||
        //   // console.log(Object.prototype.toString.call(ele.size))
 | 
			
		||||
        //   // // if (Object.prototype.toString.call(ele.size) === Array) {
 | 
			
		||||
        //   //   console.log(11111)
 | 
			
		||||
        //   //   console.log();
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        this.tableData = response.data.map((ele) => {
 | 
			
		||||
          return {
 | 
			
		||||
            area:ele.area,
 | 
			
		||||
            countNum: ele.countNum,
 | 
			
		||||
            equipmentName: ele.equipmentName,
 | 
			
		||||
            lineName: ele.lineName,
 | 
			
		||||
            num: ele.num,
 | 
			
		||||
            // size: typeof (ele.size)
 | 
			
		||||
            size: ele.size.match(/\[(.+?)\]/g) ? ele.size.substring(1, ele.size.length - 1) : ele.size
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        let obj = {}
 | 
			
		||||
        response.data.reduce((prev, curr) => {
 | 
			
		||||
          console.log(prev, curr)
 | 
			
		||||
        })
 | 
			
		||||
        // this.tableData.forEach((ele) => {
 | 
			
		||||
        //   ele.size.substring(2, ele.size.length - 2)
 | 
			
		||||
        //   // console.log(Object.prototype.toString.call(ele.size))
 | 
			
		||||
        //   // // if (Object.prototype.toString.call(ele.size) === Array) {
 | 
			
		||||
        //   //   console.log(11111)
 | 
			
		||||
        //   //   console.log();
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // this.tableData.forEach(ele => {
 | 
			
		||||
        //   obj.num += ele.num
 | 
			
		||||
        //   obj.area += ele.num
 | 
			
		||||
        //   obj.count += ele.num
 | 
			
		||||
 | 
			
		||||
        // })
 | 
			
		||||
        // console.log(obj);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // deleteHandle(id, name, index, data) {
 | 
			
		||||
    //   this.$confirm(`确认要删除序号${index}?`, "提示", {
 | 
			
		||||
    //     confirmButtonText: "确定",
 | 
			
		||||
    //     cancelButtonText: "取消",
 | 
			
		||||
    //     type: "warning",
 | 
			
		||||
    //   })
 | 
			
		||||
    //     .then(() => {
 | 
			
		||||
    //       this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
    //         this.$message({
 | 
			
		||||
    //           message: "操作成功",
 | 
			
		||||
    //           type: "success",
 | 
			
		||||
    //           duration: 1500,
 | 
			
		||||
    //           onClose: () => {
 | 
			
		||||
    //             this.getDataList();
 | 
			
		||||
    //           },
 | 
			
		||||
    //         });
 | 
			
		||||
    //       });
 | 
			
		||||
    //     })
 | 
			
		||||
    //     .catch(() => { });
 | 
			
		||||
    // },
 | 
			
		||||
    // async getDict() {
 | 
			
		||||
    //   // 物料列表
 | 
			
		||||
    //   const res = await getHotMaterialAllList();
 | 
			
		||||
    //   this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
    // },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          // this.listQuery.pageNo = 1;
 | 
			
		||||
          // this.listQuery.pageSize = 20;
 | 
			
		||||
          // this.listQuery.materialId = val.materialId ? val.materialId : undefined;
 | 
			
		||||
          // this.listQuery.startTime = '1706144404000';
 | 
			
		||||
          // this.listQuery.endTime = '1706230804000';
 | 
			
		||||
          this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000 : undefined;
 | 
			
		||||
          this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() : undefined;
 | 
			
		||||
          this.listQuery.lineId = val.lineId ? val.lineId : undefined
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        // case 'reset':
 | 
			
		||||
        //   this.$refs.searchBarForm.resetForm();
 | 
			
		||||
        //   this.listQuery = {
 | 
			
		||||
        //     pageSize: 20,
 | 
			
		||||
        //     pageNo: 1,
 | 
			
		||||
        //     total: 1,
 | 
			
		||||
        //   };
 | 
			
		||||
        //   this.getDataList();
 | 
			
		||||
        //   break;
 | 
			
		||||
        // case 'add':
 | 
			
		||||
        //   this.addOrEditTitle = '新增';
 | 
			
		||||
        //   this.addOrUpdateVisible = true;
 | 
			
		||||
        //   this.addOrUpdateHandle();
 | 
			
		||||
        //   break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
.baseTable {
 | 
			
		||||
  border-color: #D1D4DB;
 | 
			
		||||
  background-color: #F2F4F9;
 | 
			
		||||
}
 | 
			
		||||
.baseTable .el-table__body tr.current-row>td.el-table__cell {
 | 
			
		||||
  background-color: #EAF1FC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.baseTable .el-table .el-table__cell {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 35px;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										413
									
								
								src/views/report/qcReport/optimizeCutData.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										413
									
								
								src/views/report/qcReport/optimizeCutData.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,413 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: zhp
 | 
			
		||||
 * @Date: 2024-04-18 15:07:53
 | 
			
		||||
 * @LastEditTime: 2024-04-26 15:20:45
 | 
			
		||||
 * @LastEditors: DY
 | 
			
		||||
 * @Description:
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <el-table :max-height="tableH" :header-cell-style="{
 | 
			
		||||
      background: '#F2F4F9',
 | 
			
		||||
      color: '#606266'
 | 
			
		||||
    }" class="baseTable" border id="exportTable" :data="tableData" style="width: 100%" :span-method="objectSpanMethod">
 | 
			
		||||
      <el-table-column :width="item.width" v-for="(item, index) in tableProps" :key="index" :prop="item.prop" :label="item.label" align="center">
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
    </el-table>
 | 
			
		||||
    <!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
 | 
			
		||||
      @pagination="getDataList" /> -->
 | 
			
		||||
    <!-- <base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="addOrUpdateVisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="30%"> -->
 | 
			
		||||
    <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
 | 
			
		||||
    <!-- </base-dialog> -->
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
// import AddOrUpdate from './add-or-updata';
 | 
			
		||||
// import basicPage from '../../../core/mixins/basic-page';
 | 
			
		||||
// import { parseTime } from '../../../core/mixins/code-filter';
 | 
			
		||||
import {
 | 
			
		||||
  getCuttingtData,
 | 
			
		||||
  getOriginalLineDataList
 | 
			
		||||
} from '@/api/report/qcReport';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
import FileSaver from 'file-saver'
 | 
			
		||||
// import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
 | 
			
		||||
// import { getList, } from "@/api/base/qualityScrapType";
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'createTime',
 | 
			
		||||
  //   label: '添加时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'lineName',
 | 
			
		||||
    label: '产线',
 | 
			
		||||
    width:'150',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'dataType',
 | 
			
		||||
    label: '类型',
 | 
			
		||||
    width: '150',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'type',
 | 
			
		||||
    label: '类别'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'pieces',
 | 
			
		||||
    label: '片数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'area',
 | 
			
		||||
    label: '面积(㎡)'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '占比(%)',
 | 
			
		||||
    // filter: (val) => val == false ? '不合格' : '合格',
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rateSum',
 | 
			
		||||
    label: '综合成品率(%)',
 | 
			
		||||
    // filter: (val) => val == false ? '不合格' : '合格',
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkerName',
 | 
			
		||||
  //   label: '检测人员'
 | 
			
		||||
  // },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'checkTime',
 | 
			
		||||
  //   label: '检测时间',
 | 
			
		||||
  //   filter: parseTime
 | 
			
		||||
  // },
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  mixins: [ tableHeightMixin],
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      urlOptions: {
 | 
			
		||||
        getDataListURL: getCuttingtData,
 | 
			
		||||
        // deleteURL: deleteQualityHotMaterial,
 | 
			
		||||
        // exportURL: exportFactoryExcel,
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableData: [],
 | 
			
		||||
      mergeArr: [],//记录合并行数
 | 
			
		||||
      pos: 0,
 | 
			
		||||
      listQuery: {
 | 
			
		||||
        startTime: undefined,
 | 
			
		||||
        endTime: undefined,
 | 
			
		||||
        lineId:undefined
 | 
			
		||||
      },
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        // {
 | 
			
		||||
        // 	type: 'input',
 | 
			
		||||
        //   label: '报废原因',
 | 
			
		||||
        //   placeholder: '报废原因',
 | 
			
		||||
        //   param: 'content',
 | 
			
		||||
        // },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: 'select',
 | 
			
		||||
        //   label: '原料名称',
 | 
			
		||||
        //   selectOptions: [],
 | 
			
		||||
        //   labelField: 'name',
 | 
			
		||||
        //   valueField: 'id',
 | 
			
		||||
        //   param: 'materialId',
 | 
			
		||||
        //   filterable: true
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          // format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'checkTime',
 | 
			
		||||
          defaultSelect: [new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000, new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '产线',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          labelField: 'name',
 | 
			
		||||
          valueField: 'id',
 | 
			
		||||
          param: 'lineId',
 | 
			
		||||
          multiple:true,
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type:'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
        },
 | 
			
		||||
        // {
 | 
			
		||||
        //   type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
 | 
			
		||||
        //   // type: 'separate',
 | 
			
		||||
        // },
 | 
			
		||||
        {
 | 
			
		||||
          type:'button',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  components: {
 | 
			
		||||
    // AddOrUpdate,
 | 
			
		||||
  },
 | 
			
		||||
  created() { },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.formConfig[1].defaultSelect[]
 | 
			
		||||
    this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
 | 
			
		||||
    this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
 | 
			
		||||
    // this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
 | 
			
		||||
    this.getDataList()
 | 
			
		||||
    this.getDict()
 | 
			
		||||
    // this.getSpanArr(this.tableData)
 | 
			
		||||
    // this.getDict();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    async getDict() {
 | 
			
		||||
      const res = await getOriginalLineDataList()
 | 
			
		||||
      console.log(res)
 | 
			
		||||
      this.formConfig[1].selectOptions = res.data
 | 
			
		||||
    },
 | 
			
		||||
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
 | 
			
		||||
      let spanOneArr = [], concatOne = 0;
 | 
			
		||||
      let spanTwoArr = [], concatTwo = 0;
 | 
			
		||||
 | 
			
		||||
      this.tableData.map((item, index) => {
 | 
			
		||||
        // console.log(inde);
 | 
			
		||||
        if (index === 0) {
 | 
			
		||||
          spanOneArr.push(1);
 | 
			
		||||
          spanTwoArr.push(1);
 | 
			
		||||
        } else {
 | 
			
		||||
          //第一列需合并相同内容的判断条件
 | 
			
		||||
          if (item.lineName === this.tableData[index - 1].lineName) {
 | 
			
		||||
            spanOneArr[concatOne] += 1;
 | 
			
		||||
            spanOneArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanOneArr.push(1);
 | 
			
		||||
            concatOne = index;
 | 
			
		||||
          };
 | 
			
		||||
          if (item.dataType === this.tableData[index - 1].dataType) {
 | 
			
		||||
            spanTwoArr[concatTwo] += 1;
 | 
			
		||||
            spanTwoArr.push(0);
 | 
			
		||||
          } else {
 | 
			
		||||
            spanTwoArr.push(1);
 | 
			
		||||
            concatTwo = index;
 | 
			
		||||
          };
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      if (columnIndex === 0) {
 | 
			
		||||
        const _row = spanOneArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      if (columnIndex === 1) {
 | 
			
		||||
        const _row = spanTwoArr[rowIndex];
 | 
			
		||||
        const _col = _row > 0 ? 1 : 0;
 | 
			
		||||
        return {
 | 
			
		||||
          rowspan: _row,
 | 
			
		||||
          colspan: _col
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      // 处理查询参数
 | 
			
		||||
      console.log(this.$refs);
 | 
			
		||||
      var xlsxParam = { raw: true };
 | 
			
		||||
      /* 从表生成工作簿对象 */
 | 
			
		||||
      import('xlsx').then(excel => {
 | 
			
		||||
        var wb = excel.utils.table_to_book(
 | 
			
		||||
          document.querySelector("#exportTable"),
 | 
			
		||||
          xlsxParam
 | 
			
		||||
        );
 | 
			
		||||
        /* 获取二进制字符串作为输出 */
 | 
			
		||||
        var wbout = excel.write(wb, {
 | 
			
		||||
          bookType: "xlsx",
 | 
			
		||||
          bookSST: true,
 | 
			
		||||
          type: "array",
 | 
			
		||||
        });
 | 
			
		||||
        try {
 | 
			
		||||
          FileSaver.saveAs(
 | 
			
		||||
            //Blob 对象表示一个不可变、原始数据的类文件对象。
 | 
			
		||||
            //Blob 表示的不一定是JavaScript原生格式的数据。
 | 
			
		||||
            //File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
 | 
			
		||||
            //返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
 | 
			
		||||
            new Blob([wbout], { type: "application/octet-stream" }),
 | 
			
		||||
            //设置导出文件名称
 | 
			
		||||
            "原片各线优化切割堆垛表.xlsx"
 | 
			
		||||
          );
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
          if (typeof console !== "undefined") console.log(e, wbout);
 | 
			
		||||
        }
 | 
			
		||||
        return wbout;
 | 
			
		||||
        //do something......
 | 
			
		||||
      })
 | 
			
		||||
 | 
			
		||||
    },
 | 
			
		||||
    // otherMethods(val) {
 | 
			
		||||
    //   if (val.type === 'detail') {
 | 
			
		||||
    //     this.addOrUpdateVisible = true;
 | 
			
		||||
    //     this.addOrEditTitle = "详情";
 | 
			
		||||
    //     this.$nextTick(() => {
 | 
			
		||||
    //       this.$refs.addOrUpdate.init(val.data.id, true);
 | 
			
		||||
    //     });
 | 
			
		||||
    //   }
 | 
			
		||||
    // },
 | 
			
		||||
    // 获取数据列表
 | 
			
		||||
    getDataList() {
 | 
			
		||||
      this.dataListLoading = true;
 | 
			
		||||
      // this.listQuery.startTime = '1706144404000';
 | 
			
		||||
      // this.listQuery.endTime = '1706230804000';
 | 
			
		||||
      this.urlOptions.getDataListURL(this.listQuery).then(response => {
 | 
			
		||||
        // this.getSpanArr(this.tableData)
 | 
			
		||||
        // response.data.forEach((ele) => {
 | 
			
		||||
        //   console.log(ele.size.substring(2, ele.size.length - 2))
 | 
			
		||||
        //   // console.log(Object.prototype.toString.call(ele.size))
 | 
			
		||||
        //   // // if (Object.prototype.toString.call(ele.size) === Array) {
 | 
			
		||||
        //   //   console.log(11111)
 | 
			
		||||
        //   //   console.log();
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        this.tableData = response.data.map((ele) => {
 | 
			
		||||
          return {
 | 
			
		||||
            dataType: ele.dataType == 1 ? '成品' : ele.dataType == 2 ? '取样板' : ele.dataType == 4 ? '合计' : ele.dataType == 3 ? '废版' : '',
 | 
			
		||||
            code: ele.code,
 | 
			
		||||
            putNum: ele.putNum,
 | 
			
		||||
            lineName: ele.lineName,
 | 
			
		||||
            type: ele.type == '合计' ? '' : ele.type,
 | 
			
		||||
            pieces: ele.pieces,
 | 
			
		||||
            area: ele.area,
 | 
			
		||||
            rate: ele.lineName != '总计' &&  ele.rate ? (ele.rate * 100).toFixed(2) : '',
 | 
			
		||||
            rateSum: ele.lineName === '总计' ? (ele.rate * 100).toFixed(2) : ''
 | 
			
		||||
            // useNum: ele.useNum,
 | 
			
		||||
            // num: ele.num,
 | 
			
		||||
            // size: typeof (ele.size)
 | 
			
		||||
            // size: ele.size.match(/\[(.+?)\]/g) ? ele.size.substring(1, ele.size.length - 1) : ele.size
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // response.data.reduce((prev, curr) => {
 | 
			
		||||
        //   console.log(prev, curr)
 | 
			
		||||
        // })
 | 
			
		||||
        // this.tableData.forEach((ele) => {
 | 
			
		||||
        //   ele.size.substring(2, ele.size.length - 2)
 | 
			
		||||
        //   // console.log(Object.prototype.toString.call(ele.size))
 | 
			
		||||
        //   // // if (Object.prototype.toString.call(ele.size) === Array) {
 | 
			
		||||
        //   //   console.log(11111)
 | 
			
		||||
        //   //   console.log();
 | 
			
		||||
        //   // }
 | 
			
		||||
        // })
 | 
			
		||||
        // let obj = {}
 | 
			
		||||
        // this.tableData.forEach(ele => {
 | 
			
		||||
        //   obj.num += ele.num
 | 
			
		||||
        //   obj.area += ele.num
 | 
			
		||||
        //   obj.count += ele.num
 | 
			
		||||
 | 
			
		||||
        // })
 | 
			
		||||
        // console.log(obj);
 | 
			
		||||
        // this.listQuery.total = response.data.total;
 | 
			
		||||
        this.dataListLoading = false;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    // deleteHandle(id, name, index, data) {
 | 
			
		||||
    //   this.$confirm(`确认要删除序号${index}?`, "提示", {
 | 
			
		||||
    //     confirmButtonText: "确定",
 | 
			
		||||
    //     cancelButtonText: "取消",
 | 
			
		||||
    //     type: "warning",
 | 
			
		||||
    //   })
 | 
			
		||||
    //     .then(() => {
 | 
			
		||||
    //       this.urlOptions.deleteURL(id).then(({ data }) => {
 | 
			
		||||
    //         this.$message({
 | 
			
		||||
    //           message: "操作成功",
 | 
			
		||||
    //           type: "success",
 | 
			
		||||
    //           duration: 1500,
 | 
			
		||||
    //           onClose: () => {
 | 
			
		||||
    //             this.getDataList();
 | 
			
		||||
    //           },
 | 
			
		||||
    //         });
 | 
			
		||||
    //       });
 | 
			
		||||
    //     })
 | 
			
		||||
    //     .catch(() => { });
 | 
			
		||||
    // },
 | 
			
		||||
    // async getDict() {
 | 
			
		||||
    //   // 物料列表
 | 
			
		||||
    //   const res = await getHotMaterialAllList();
 | 
			
		||||
    //   this.formConfig[0].selectOptions = res.data;
 | 
			
		||||
    // },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          // this.listQuery.pageNo = 1;
 | 
			
		||||
          // this.listQuery.pageSize = 20;
 | 
			
		||||
          // this.listQuery.materialId = val.materialId ? val.materialId : undefined;
 | 
			
		||||
          // this.listQuery.startTime = '1706144404000';
 | 
			
		||||
          // this.listQuery.endTime = '1706230804000';
 | 
			
		||||
          // this.listQuery.startTime = new Date(new Date(Date.now()).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000
 | 
			
		||||
          // this.listQuery.endTime = new Date(new Date(Date.now()).setHours(6, 59, 59)).getTime()
 | 
			
		||||
          this.listQuery.startTime = val.checkTime ? new Date(new Date(val.checkTime[0]).setHours(7, 0, 0, 0)).getTime() - 24 * 60 * 60 * 1000 : undefined;
 | 
			
		||||
          this.listQuery.endTime = val.checkTime ? new Date(new Date(val.checkTime[1]).setHours(6, 59, 59)).getTime() : undefined;
 | 
			
		||||
          this.listQuery.lineId = val.lineId ? val.lineId : undefined
 | 
			
		||||
          this.getDataList();
 | 
			
		||||
          break;
 | 
			
		||||
        // case 'reset':
 | 
			
		||||
        //   this.$refs.searchBarForm.resetForm();
 | 
			
		||||
        //   this.listQuery = {
 | 
			
		||||
        //     pageSize: 20,
 | 
			
		||||
        //     pageNo: 1,
 | 
			
		||||
        //     total: 1,
 | 
			
		||||
        //   };
 | 
			
		||||
        //   this.getDataList();
 | 
			
		||||
        //   break;
 | 
			
		||||
        // case 'add':
 | 
			
		||||
        //   this.addOrEditTitle = '新增';
 | 
			
		||||
        //   this.addOrUpdateVisible = true;
 | 
			
		||||
        //   this.addOrUpdateHandle();
 | 
			
		||||
        //   break;
 | 
			
		||||
        case 'export':
 | 
			
		||||
          this.handleExport();
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          console.log(val);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped>
 | 
			
		||||
.baseTable {
 | 
			
		||||
  border-color: #D1D4DB;
 | 
			
		||||
  background-color: #F2F4F9;
 | 
			
		||||
}
 | 
			
		||||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
 | 
			
		||||
  background-color: #EAF1FC;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
::v-deep .baseTable .el-table .el-table__cell {
 | 
			
		||||
  padding: 0;
 | 
			
		||||
  height: 35px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</style>
 | 
			
		||||
@@ -111,7 +111,10 @@ const mesEN = new WsConnect(
 | 
			
		||||
    if (msgData == null) return;
 | 
			
		||||
    switch (msgData?.type) {
 | 
			
		||||
      case "EnergyInfo": {
 | 
			
		||||
        store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
 | 
			
		||||
        let keys = Object.keys(msgData.data)
 | 
			
		||||
        if (keys.includes('elecQty1') || keys.includes('waterQty')) {
 | 
			
		||||
          store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
      case "EnergyTrend": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user