Compare commits
69 Commits
projects/m
...
projects/m
| Author | SHA1 | Date | |
|---|---|---|---|
| ab56bc354a | |||
| 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 |
@@ -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
|
||||
9
.env.dev
9
.env.dev
@@ -1,8 +1,8 @@
|
||||
###
|
||||
# @Author: zhp
|
||||
# @Date: 2024-04-12 14:30:48
|
||||
# @LastEditTime: 2024-04-23 17:25:25
|
||||
# @LastEditors: DY
|
||||
# @LastEditTime: 2024-04-25 10:07:02
|
||||
# @LastEditors: zhp
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
@@ -12,8 +12,9 @@ ENV = 'development'
|
||||
VUE_APP_TITLE = MES系统
|
||||
|
||||
# 芋道管理系统/开发环境
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.176:48082'
|
||||
# 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.1.101:48082'
|
||||
|
||||
|
||||
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,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
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 16:50:26
|
||||
* @LastEditTime: 2024-04-22 09:42:45
|
||||
* @LastEditTime: 2024-04-25 09:03:50
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -628,7 +628,7 @@ export default {
|
||||
`<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:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>`
|
||||
])
|
||||
this.cutConfig.data = cutArr
|
||||
// this.$nextTick(() => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 13:45:56
|
||||
* @LastEditTime: 2024-04-17 15:48: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',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-24 14:48:00
|
||||
* @LastEditTime: 2024-04-26 09:57:41
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -42,21 +42,27 @@
|
||||
<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 style="display: inline-block;width: 330px;">
|
||||
<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 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 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>
|
||||
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>
|
||||
op.planQuantity }}</span>
|
||||
<span v-if="op.planQuantity" class="orderFinishTwo"
|
||||
style="font-size: 14px;opacity: calc(.6);">片</span>
|
||||
</span>
|
||||
<span v-if="op.actualQuantity" class="orderFinish" style="font-size: 14px;margin-left: 130px;">{{
|
||||
op.actualQuantity
|
||||
}}</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(0, 255, 247, 1)" :stroke-width="10"
|
||||
define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" />
|
||||
@@ -80,7 +86,7 @@
|
||||
</base-container>
|
||||
</el-col>
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'"
|
||||
<base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'"
|
||||
:title="'产线产量及良品率'" :title-icon="'productLine'">
|
||||
<div class="myLegend">
|
||||
<div class=" barCircleLegend"></div>
|
||||
@@ -110,78 +116,79 @@ const qualityYearList = [
|
||||
{
|
||||
name: '翻转机',
|
||||
code: 'EQ20240110112358000235',
|
||||
status: '正常',
|
||||
status: '运行',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '烘干炉',
|
||||
code: 'EQ20240110112537000241',
|
||||
status: '计划停机',
|
||||
status: '停机',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '清洗机',
|
||||
code: ' EQ20240110112310000232',
|
||||
status: '正常',
|
||||
status: '故障',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '钢化清洗机',
|
||||
code: 'EQ20240110111700000208',
|
||||
status: '正常',
|
||||
status: '故障',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '固化机',
|
||||
code: 'EQ20240110111700000201',
|
||||
status: '正常',
|
||||
status: '停机',
|
||||
error: false,
|
||||
},
|
||||
{
|
||||
name: '磨边清洗机',
|
||||
code: ' EQ20240110111700000208',
|
||||
status: '正常',
|
||||
status: '停机',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '预热机',
|
||||
code: 'EQ20240110111700000205',
|
||||
status: '故障',
|
||||
status: '运行',
|
||||
error: false,
|
||||
},
|
||||
{
|
||||
name: '下片机',
|
||||
code: 'EQ20240115151435000279',
|
||||
code: 'EQ20240115151435000279',
|
||||
status: '故障',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '冷却机',
|
||||
code: 'EQ20240110111700000203',
|
||||
status: '正常',
|
||||
status: '运行',
|
||||
error: false,
|
||||
},
|
||||
{
|
||||
name: 'A储片机106',
|
||||
code: 'EQ20240110111700000202',
|
||||
status: '正常',
|
||||
status: '停机',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '二次清洗机',
|
||||
code: 'EQ20240110111700000209',
|
||||
status: '正常',
|
||||
status: '停机',
|
||||
error: true,
|
||||
},
|
||||
{
|
||||
name: '二次磨边机',
|
||||
code: ' EQ20240110110927000181',
|
||||
status: '正常',
|
||||
status: '停机',
|
||||
error: false,
|
||||
},
|
||||
{
|
||||
name: '测试设备',
|
||||
code: 'EQ20240110111700000201',
|
||||
status: '正常',
|
||||
status: '运行',
|
||||
error: true,
|
||||
},
|
||||
];
|
||||
@@ -292,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,
|
||||
@@ -373,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,
|
||||
actualQuantity:111,
|
||||
plan: 111111111111,
|
||||
actualQuantity:1000000111111,
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
@@ -452,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,
|
||||
actualQuantity: ele.actualQuantity + '片',
|
||||
specifications: ele.specifications ? '规格' + ele.specifications : '',
|
||||
planQuantity: ele.plan ? '计划' + this.getStr(String(ele.plan), 6) : '',
|
||||
actualQuantity: ele.actualQuantity ? this.getStr(String(ele.actualQuantity), 6) : '',
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -473,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 == 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>`,
|
||||
`<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 = [
|
||||
@@ -561,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)
|
||||
@@ -729,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) : '',
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -743,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 == 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>`,
|
||||
|
||||
`<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(() => {
|
||||
@@ -971,7 +985,7 @@ export default {
|
||||
|
||||
.now-secondary-title {
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
width: 110px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 2em;
|
||||
@@ -990,16 +1004,27 @@ export default {
|
||||
width: 60px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
text-align: right;
|
||||
color: rgba(0, 255, 247, 1);
|
||||
}
|
||||
.orderFinishTwo{
|
||||
display: inline-block;
|
||||
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: 100px;
|
||||
// width: 80px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
line-height: 2em;
|
||||
// line-height: 2em;
|
||||
color: #fff;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ export default {
|
||||
});
|
||||
},
|
||||
changeChoose(val) {
|
||||
console.log(val);
|
||||
this.$emit('changeChoose', val);
|
||||
},
|
||||
},
|
||||
@@ -46,17 +46,18 @@ const tableProps = [
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'lineId',
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '规格',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'check',
|
||||
prop: 'checkGoodName',
|
||||
label: '判定',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
@@ -74,12 +75,12 @@ const tableProps = [
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注1',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'printStatus',
|
||||
prop: 'printStatusName',
|
||||
label: '打印状态',
|
||||
filter: (val) => (val == 1 ? '未打印' : '已打印'),
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -106,27 +107,30 @@ export default {
|
||||
return {
|
||||
printMsg1: {
|
||||
customerId: '',
|
||||
customerName: '',
|
||||
sealWorker: '',
|
||||
packWorker: '',
|
||||
processCard: '',
|
||||
pallet: '',
|
||||
remark: '',
|
||||
remarkT: '',
|
||||
},
|
||||
printMsg2: {
|
||||
customerId: '',
|
||||
customerName: '',
|
||||
sealWorker: '',
|
||||
packWorker: '',
|
||||
processCard: '',
|
||||
pallet: '',
|
||||
remark: '',
|
||||
remarkT: '',
|
||||
},
|
||||
printMsg3: {
|
||||
customerId: '',
|
||||
customerName: '',
|
||||
sealWorker: '',
|
||||
packWorker: '',
|
||||
processCard: '',
|
||||
pallet: '',
|
||||
remark: '',
|
||||
remarkT: '',
|
||||
},
|
||||
chooseMsg: 1, //单选
|
||||
formConfig: [
|
||||
@@ -157,6 +161,16 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
lineList: [],
|
||||
printStatusList: [
|
||||
{ id: 1, name: '未打印' },
|
||||
{ id: 2, name: '已打印' },
|
||||
{ id: 3, name: '已重打' },
|
||||
],
|
||||
checkGoodList: [
|
||||
{ id: 0, name: '否' },
|
||||
{ id: 1, name: '是' },
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
@@ -242,18 +256,39 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getLineList();
|
||||
console.log(printTemplate);
|
||||
this.getTopTitle();
|
||||
console.log(JSON.stringify(printTemplate));
|
||||
console.log('================printTemplate');
|
||||
},
|
||||
methods: {
|
||||
getLineList() {
|
||||
getCorePLList().then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data;
|
||||
this.formConfig[0].selectOptions = res.data || [];
|
||||
this.lineList = res.data || [];
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
getPackingPage({ ...this.queryParams }).then((res) => {
|
||||
this.list = res.data.records || [];
|
||||
let arr = res.data.records || [];
|
||||
arr.map((item) => {
|
||||
this.lineList.map((subItem) => {
|
||||
if (item.lineId === subItem.id) {
|
||||
item.lineName = subItem.name;
|
||||
}
|
||||
});
|
||||
this.printStatusList.map((subItem2) => {
|
||||
if (item.printStatus === subItem2.id) {
|
||||
item.printStatusName = subItem2.name;
|
||||
}
|
||||
});
|
||||
this.checkGoodList.map((subItem3) => {
|
||||
if (item.checkGood === subItem3.id) {
|
||||
item.checkGoodName = subItem3.name;
|
||||
}
|
||||
});
|
||||
});
|
||||
this.list = arr;
|
||||
this.total = res.data.total;
|
||||
});
|
||||
},
|
||||
@@ -276,9 +311,13 @@ export default {
|
||||
this.saveNum(val.data);
|
||||
break;
|
||||
case 'view':
|
||||
this.preView();
|
||||
// 保存选中的内容
|
||||
this.saveTopTitle();
|
||||
this.preView(val.data);
|
||||
break;
|
||||
case 'print':
|
||||
// 保存选中的内容
|
||||
this.saveTopTitle();
|
||||
this.printTemp();
|
||||
break;
|
||||
default:
|
||||
@@ -302,11 +341,18 @@ export default {
|
||||
this.list[val._pageIndex - 1][val.prop] = val[val.prop];
|
||||
},
|
||||
// 预览
|
||||
preView() {
|
||||
preView(data) {
|
||||
let topMsg =
|
||||
this.chooseMsg === 1
|
||||
? this.printMsg1
|
||||
: this.chooseMsg === 2
|
||||
? this.printMsg2
|
||||
: this.printMsg3;
|
||||
let printData = { ...data, ...topMsg };
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: printTemplate,
|
||||
});
|
||||
this.$refs.preView.show(hiprintTemplate);
|
||||
this.$refs.preView.show(hiprintTemplate, printData);
|
||||
},
|
||||
// 打印
|
||||
printTemp() {
|
||||
@@ -327,6 +373,37 @@ export default {
|
||||
);
|
||||
console.log(hiprintTemplate);
|
||||
},
|
||||
// 保存选中的内容
|
||||
saveTopTitle() {
|
||||
switch (this.chooseMsg) {
|
||||
case 1:
|
||||
localStorage.setItem('printMsg1', JSON.stringify(this.printMsg1));
|
||||
break;
|
||||
case 2:
|
||||
localStorage.setItem('printMsg2', JSON.stringify(this.printMsg2));
|
||||
break;
|
||||
case 3:
|
||||
localStorage.setItem('printMsg3', JSON.stringify(this.printMsg3));
|
||||
break;
|
||||
default:
|
||||
throw new Error(`${this.chooseMsg}的值不正确,请检查!`);
|
||||
}
|
||||
},
|
||||
// 获取打印内容top
|
||||
getTopTitle() {
|
||||
let pm1 = localStorage.getItem('printMsg1');
|
||||
let pm2 = localStorage.getItem('printMsg2');
|
||||
let pm3 = localStorage.getItem('printMsg3');
|
||||
if (pm1) {
|
||||
this.printMsg1 = JSON.parse(pm1);
|
||||
}
|
||||
if (pm2) {
|
||||
this.printMsg2 = JSON.parse(pm2);
|
||||
}
|
||||
if (pm3) {
|
||||
this.printMsg3 = JSON.parse(pm3);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,344 +1,47 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-10 16:34:40
|
||||
* @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"
|
||||
: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" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||
</div>
|
||||
<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 AddOrUpdate from './add-or-updata';
|
||||
// import unitDict from './unitDict';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import {
|
||||
getPackingModel,
|
||||
} from '@/api/base/printModel.js'
|
||||
import {
|
||||
deletePacking,
|
||||
getPackingPage,
|
||||
getWorkOrderList,
|
||||
exportPackingExcel,
|
||||
} from '@/api/base/packingInfo';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'packagingCode',
|
||||
label: '包装流水号'
|
||||
},
|
||||
{
|
||||
prop: 'packagingBarCode',
|
||||
label: '包装条码'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderName',
|
||||
label: '所属工单'
|
||||
},
|
||||
{
|
||||
prop: 'customerName',
|
||||
label: '客户'
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '内容',
|
||||
// subcomponent: unitDict,
|
||||
},
|
||||
{
|
||||
prop: 'modelName',
|
||||
label: '标签模板',
|
||||
// subcomponent: unitDict,
|
||||
},
|
||||
{
|
||||
prop: 'printStatus',
|
||||
label: '打印状态',
|
||||
filter: (val) => val == 1 ? '未打印' : '已打印',
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '生成日期',
|
||||
filter: parseTime
|
||||
},
|
||||
];
|
||||
|
||||
import ButtonNav from '@/components/ButtonNav';
|
||||
import UnPrint from './components/UnPrint';
|
||||
import Printed from './components/Printed';
|
||||
export default {
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
name: 'packagingPrintLog',
|
||||
components: { ButtonNav, UnPrint, Printed },
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getPackingPage,
|
||||
deleteURL: deletePacking,
|
||||
exportURL: exportPackingExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'print',
|
||||
btnName: '打印',
|
||||
},
|
||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'workOrderId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
// parent: 'dateFilterType',
|
||||
// 时间段选择
|
||||
type: 'datePicker',
|
||||
// label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
defaultTime: ['00:00:00', '00:00:00'],
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'createTime',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
activeMenu: '未打印',
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.records;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
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;
|
||||
})
|
||||
},
|
||||
deleteHandle(id, name, index, packagingCode) {
|
||||
this.$confirm(`是否确认删除${'[' + packagingCode + ']'}数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
handlePrint(id) {
|
||||
if (id) {
|
||||
getPackingModel(id).then(res => {
|
||||
var obj = {
|
||||
code: '11111222',
|
||||
test: '11111',
|
||||
test2: '3333333',
|
||||
test1: '222222',
|
||||
}
|
||||
console.log(res);
|
||||
// getPackingListInfo({
|
||||
// size: 20,
|
||||
// current: 1,
|
||||
// boxNo: printModel.boxNo
|
||||
// }).then(result => {
|
||||
// this.substrateList = result.data.records
|
||||
// var obj = {
|
||||
// // time: this.getNewDate(),
|
||||
// boxNo: this.currentData.boxNo,
|
||||
// orderNum: this.currentData.orderNum,
|
||||
// powerLevel: this.currentData.powerLevel,
|
||||
// sapMaterial: this.currentData.sapMaterial,
|
||||
// img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC',
|
||||
// // lineBody: this.currentData.lineBody == 1 ? 'F ' : 'S',
|
||||
// createTime: moment(this.currentData.createTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
// // modul1: '20210320000012',
|
||||
// // modul2: '20210320000012',
|
||||
// // modul3: '20210320000012'
|
||||
// }
|
||||
// for (var i = 0; i < this.substrateList.length; i++) {
|
||||
// var model = 'model' + Number(i + 1)
|
||||
// var pmpp = 'PMPP' + Number(i + 1)
|
||||
// var m = 'm' + Number(i + 1)
|
||||
|
||||
// console.log(model)
|
||||
// // console.log(this.list[i].woSubstrateId)
|
||||
// // console.log(this.list[i].woSubstrateId)
|
||||
// obj['' + model + ''] = this.substrateList[i].woSubstrateId
|
||||
// obj['' + pmpp + ''] = this.substrateList[i].pmpp
|
||||
// obj['' + m + ''] = i + 1
|
||||
// }
|
||||
// console.log(obj)
|
||||
// this.printPreview('预览', res.data)
|
||||
const hiprintTemplate = this.$print(undefined, JSON.parse(res.data.content), obj, {}, {
|
||||
// styleHandler: () => {
|
||||
// const css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">'
|
||||
// return css
|
||||
// }
|
||||
})
|
||||
|
||||
hiprintTemplate.on('printSuccess', function () {
|
||||
console.log(1111);
|
||||
// that.$notification.success({
|
||||
// // key: key,
|
||||
// placement: 'topRight',
|
||||
// message: key + ' 打印成功',
|
||||
// description: 'Api单独直接打印回调',
|
||||
// });
|
||||
});
|
||||
console.log(hiprintTemplate)
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择打印标签模板',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
},
|
||||
closeCallback(vue) {
|
||||
console.log('关闭了打印工具')
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.workOrderId = val.workOrderId;
|
||||
if (val.createTime && val.createTime.length != 0) {
|
||||
this.listQuery.createTime = val.createTime
|
||||
// this.listQuery.createTime[1] = val.timeVal[1]
|
||||
} else {
|
||||
this.listQuery.createTime = undefined
|
||||
// this.listQuery.endTime = undefined
|
||||
}
|
||||
this.getDataList();
|
||||
console.log(this.tableData)
|
||||
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);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
this.handlePrint(val.data.modelId)
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.addOrEditTitle = '详情';
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
// });
|
||||
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>
|
||||
|
||||
889
src/views/base/packagingPrintLog/print-template.js
Normal file
889
src/views/base/packagingPrintLog/print-template.js
Normal file
@@ -0,0 +1,889 @@
|
||||
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,
|
||||
"field":"checkGoodName"
|
||||
},
|
||||
"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":199.5,
|
||||
"title":"备注",
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":91.2421875,
|
||||
"bottom":86.25,
|
||||
"vCenter":73.2421875,
|
||||
"hCenter":77.25,
|
||||
"field":"remarkT"
|
||||
},
|
||||
"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":243,
|
||||
"title":"封箱人员工号",
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":46.9921875,
|
||||
"bottom":279.24609375,
|
||||
"vCenter":28.9921875,
|
||||
"hCenter":270.24609375,
|
||||
"field":"sealWorker"
|
||||
},
|
||||
"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":244.5,
|
||||
"title":"打包人员工号",
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":96.4921875,
|
||||
"bottom":301.74609375,
|
||||
"vCenter":52.9921875,
|
||||
"hCenter":292.74609375,
|
||||
"field":"packWorker"
|
||||
},
|
||||
"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":244.5,
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":20,
|
||||
"top":122.5,
|
||||
"height":18,
|
||||
"width":157.5,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":54.99609375,
|
||||
"bottom":142.5,
|
||||
"vCenter":36.99609375,
|
||||
"hCenter":133.5,
|
||||
"field":"specifications",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":195,
|
||||
"top":122.5,
|
||||
"height":18,
|
||||
"width":58.5,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":250.9921875,
|
||||
"bottom":140.49609375,
|
||||
"vCenter":223.2421875,
|
||||
"hCenter":131.49609375,
|
||||
"field":"customerName",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":12.5,
|
||||
"top":177.5,
|
||||
"height":18,
|
||||
"width":112.5,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":48.24609375,
|
||||
"bottom":195,
|
||||
"vCenter":30.24609375,
|
||||
"hCenter":186,
|
||||
"field":"packagingCode",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":135,
|
||||
"top":177.5,
|
||||
"height":18,
|
||||
"width":49.5,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":186.24609375,
|
||||
"bottom":196.5,
|
||||
"vCenter":161.49609375,
|
||||
"hCenter":187.5,
|
||||
"field":"workStation",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":195,
|
||||
"top":177.5,
|
||||
"height":18,
|
||||
"width":60,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":254.7421875,
|
||||
"bottom":194.25,
|
||||
"vCenter":224.7421875,
|
||||
"hCenter":185.25,
|
||||
"field":"processCard",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":10,
|
||||
"top":235,
|
||||
"height":18,
|
||||
"width":36,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":46.9921875,
|
||||
"bottom":252.24609375,
|
||||
"vCenter":28.9921875,
|
||||
"hCenter":243.24609375,
|
||||
"field":"date",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":60,
|
||||
"top":235,
|
||||
"height":18,
|
||||
"width":48,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":97.2421875,
|
||||
"bottom":253.9921875,
|
||||
"vCenter":79.2421875,
|
||||
"hCenter":244.9921875,
|
||||
"field":"groupClass",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":120,
|
||||
"top":235,
|
||||
"height":18,
|
||||
"width":64.5,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":167.49609375,
|
||||
"bottom":253.9921875,
|
||||
"vCenter":143.49609375,
|
||||
"hCenter":244.9921875,
|
||||
"field":"time",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":202.5,
|
||||
"top":235,
|
||||
"height":18,
|
||||
"width":48,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":250.74609375,
|
||||
"bottom":253.2421875,
|
||||
"vCenter":226.74609375,
|
||||
"hCenter":244.2421875,
|
||||
"field":"num",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"options":{
|
||||
"left":7.5,
|
||||
"top":62.5,
|
||||
"height":18,
|
||||
"width":36,
|
||||
"coordinateSync":false,
|
||||
"widthHeightSync":false,
|
||||
"fontSize":12,
|
||||
"qrCodeLevel":0,
|
||||
"right":44.7421875,
|
||||
"bottom":81.24609375,
|
||||
"vCenter":26.7421875,
|
||||
"hCenter":72.24609375,
|
||||
"field":"lineName",
|
||||
"hideTitle":true
|
||||
},
|
||||
"printElementType":{
|
||||
"title":"文本",
|
||||
"type":"text"
|
||||
}
|
||||
}
|
||||
],
|
||||
"paperNumberLeft":372.5,
|
||||
"paperNumberTop":337.5,
|
||||
"paperNumberContinue":true,
|
||||
"watermarkOptions":{
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
344
src/views/base/packagingPrintLog1/index.vue
Normal file
344
src/views/base/packagingPrintLog1/index.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-10 16:34:40
|
||||
* @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"
|
||||
: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" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
// import unitDict from './unitDict';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import {
|
||||
getPackingModel,
|
||||
} from '@/api/base/printModel.js'
|
||||
import {
|
||||
deletePacking,
|
||||
getPackingPage,
|
||||
getWorkOrderList,
|
||||
exportPackingExcel,
|
||||
} from '@/api/base/packingInfo';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'packagingCode',
|
||||
label: '包装流水号'
|
||||
},
|
||||
{
|
||||
prop: 'packagingBarCode',
|
||||
label: '包装条码'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderName',
|
||||
label: '所属工单'
|
||||
},
|
||||
{
|
||||
prop: 'customerName',
|
||||
label: '客户'
|
||||
},
|
||||
{
|
||||
prop: 'content',
|
||||
label: '内容',
|
||||
// subcomponent: unitDict,
|
||||
},
|
||||
{
|
||||
prop: 'modelName',
|
||||
label: '标签模板',
|
||||
// subcomponent: unitDict,
|
||||
},
|
||||
{
|
||||
prop: 'printStatus',
|
||||
label: '打印状态',
|
||||
filter: (val) => val == 1 ? '未打印' : '已打印',
|
||||
},
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '生成日期',
|
||||
filter: parseTime
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getPackingPage,
|
||||
deleteURL: deletePacking,
|
||||
exportURL: exportPackingExcel,
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'print',
|
||||
btnName: '打印',
|
||||
},
|
||||
this.$auth.hasPermi(`base:packaging-print-log:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`base:packaging-print-log:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'workOrderId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
// parent: 'dateFilterType',
|
||||
// 时间段选择
|
||||
type: 'datePicker',
|
||||
// label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
defaultTime: ['00:00:00', '00:00:00'],
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'createTime',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// },
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '重置',
|
||||
// name: 'reset',
|
||||
// },
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
// {
|
||||
// type: 'separate',
|
||||
// type: this.$auth.hasPermi('base:product:create') ? 'separate' : '',
|
||||
// },
|
||||
// {
|
||||
// type: this.$auth.hasPermi('base:product:export') ? 'button' : '',
|
||||
// btnName: '导出',
|
||||
// name: 'export',
|
||||
// color: 'warning',
|
||||
// },
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data.records;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
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;
|
||||
})
|
||||
},
|
||||
deleteHandle(id, name, index, packagingCode) {
|
||||
this.$confirm(`是否确认删除${'[' + packagingCode + ']'}数据项?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.urlOptions.deleteURL(id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => { });
|
||||
},
|
||||
handlePrint(id) {
|
||||
if (id) {
|
||||
getPackingModel(id).then(res => {
|
||||
var obj = {
|
||||
code: '11111222',
|
||||
test: '11111',
|
||||
test2: '3333333',
|
||||
test1: '222222',
|
||||
}
|
||||
console.log(res);
|
||||
// getPackingListInfo({
|
||||
// size: 20,
|
||||
// current: 1,
|
||||
// boxNo: printModel.boxNo
|
||||
// }).then(result => {
|
||||
// this.substrateList = result.data.records
|
||||
// var obj = {
|
||||
// // time: this.getNewDate(),
|
||||
// boxNo: this.currentData.boxNo,
|
||||
// orderNum: this.currentData.orderNum,
|
||||
// powerLevel: this.currentData.powerLevel,
|
||||
// sapMaterial: this.currentData.sapMaterial,
|
||||
// img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAHVklEQVR4nO2dT2wUVRzHv2/2T5eSAlvFilwgQUH+eLACaUxEiJLAxdh44MDZi2ChUIrSFtoCgbbSP4GDdwgeEA8kRTAI0iIGBL1ITLxgLAlCsCKBYndnx7zd35pl2+7On/de387OJ9l00515/z7z/szMmzfs7869mD0yCjw2gZAB4VhAiln4/dUaRGdU18aOnzw9dn24ioGJj0soFsJr1z2yNm+qN2/fvRFL8XyMYqTmFfxZ+TwMc1xKDsL/f2Ms8xGeLwuIRpCKx99MHf/i4uPrw5GQ9jIAfsCMXfw2HkuOX03Wb1qLh4+uIGFJjzecPoS5iEhUTg1hDMaM2GuRk6cGMTQUCYmPQQq86CMAkkPDkQirGAzXf7Du34ejN9IHmETCRjQGPL6D+4NnYDEJDQmXbaY6on/dm2Vm/jHdZe0Almm6Ll+YNQbzasX7765BNHI1o0sOYRghwExg7MG9dDQSiqsdwHuZmlFKMjLwQ3QcFtjlSxHTenLO3Lp7vfU09AOS41Ka+HC6CjIDIaqmguvIPgBtIgOcDhjVlMTQtarKOScumR/teCdpxoeNZGJCapjFt7Rcywrb2MYtnQBatCpZTzCkYCF+5suKRXf+6EvOmv0GSzwrhB/QpmGkBYZSpqvIZAlp8ZeMLFwKUH3z2gqWyd/+3F/5b1yRQQMCN8gQspeaKt+SAItSCxCiPjIjhDEkjRAMxmCZSbgZkYke537qdxl57KM8C0OkkD0ADohMXIlwgPIuBFFC9uS3p2XGflFSRAgpdxlZeBl84jUQr0ImjDTKGWZZBwE0eCkCL0J20UgjgGCwEDHNPjB86PbiilshfGRxOBCRD0tLCSWTnzMLO9yE4EbIzjIdTdmGpc8/rB4qK0c4FcKbqe7pyWZJ0k1lZhsnQnZq3EzV00dHDjupKXaFNGtcM7YA+Io+WzRIz2R0UxkWxY6QJgCHlCbfPlzAsZytj2ks5RCVZUGKCdkOoEt+Wl3RkCcjyzGv5wIS6aIynZJCQni7d0TTjPFaMFDg9wGNa8qRQn3KVEI+1rjPmKpm5KNzTemmMp7AZEK2AehXmz7bbC1SM/IZoH10pJ/K+hnyhXBrvZpmoBHAURf7HaV9daQ3v6Zk7hhWVr4AYDOAzzRNeKPHAyW7r459Yj/deUynMcyqqpY9/fXW+RTwkiF/ms5pADcd7nMbwAkBcfMM3wOwwOF+rys46TxCt+T72d2NG0YSg2fnC58ANDkbAZyVH41QNgAYVBTXNiMxeLYG6qawvagmGqGoTHOfwcAe6T8TvWwYlTC7OsALgRDNCIRoRiBEMwIhmhEI0YxAiGYEQjRDtZCY9iUyEaVpVi3kvuL4RKA0zSqF8Ad5TimMTxSnKO1KUCWEZ6hDVaYk0KFKigohbSUuI0uHiieKZQtp89kM+U7ZUmQKafHp4wpSH/eWJaTT5zPkD8g62GQI8cXqDTZok/HEsWgh+3Of2y4D2kU/0idKyEOaJdgqKLxSotXlfLFJESXkicKZGTrys6g0iRIyD8AvAFYLCq+UWC1yACOyD+Hrf1wAUCcwTN2pozzXiEqn6E59JoBvANQKDldHaimvM0WmTcawlydw2Oc1pY7yKFQGJJ4YxqiTXyEp/OlkBeVNyn0SmZdO5gC47rOOfjXlaY6sCGRfXKwA8LVP+pRaykuFzEhUXH7nR9P3AFYqiEsWKykP0mpGFlU3qKI0IlmlKD6RrKK0R1VEpvIW7uwSHXnVUdqVoHqSwz+K4xOB0jQH87I0IxCiGYEQzQiEaEYgRDMCIZoRCNGMQIhmBEI0gwuJK0xScKZemHiY1mzqUxThYgBLHO7zQOAzGnMBPOdwn8WC4rbDNjaSWVajQaEUp9wBsB7ALY/hLAVwHsB89VmwRXrhuGwf0q/xIl/z6f6105qVyxIKQ1cZjdlV/HI79V6N1yjk/dxlAMtc7LuM9lXZVzqhIXdxtvxR1kCxZUynkbl0o2ihgyQspH3mapqn7flrSE427O3TuKbwGZI/AlhuY9vltO08Belyw6T99lTnIQN2VmGeJqppskGhpfoW0DbVmuahaarVVQudGPZo3tH/RCOnfJbSbzp34D1T/VjsTL3X6esWFMJngJwDsCgnykX0P+mzQ1yyq9jqqtnzkGI0a7wgPz9pfJm+/6ZxB77bzus+7L7pkwdkarr8OBdwJee7jjQVaqZysVtDsuwK3j3lmGYnb5hwerW3S+PRl440OX3dh5vL7z0iXzXqY/bYbaZycXs/5KDdV/iUKc1URo7xcoOqq0yfui1Gq5e3EoUava1qzS/aJQGs8xKIj2jx+gCoVyGcoUBKGs8yIEgIAiliZEDwJAehL3ovIYS+2F9UDckyRH/fFhmoxuwTvdaJaCGc7+gyi9+br1YZSzTJEAIaffHrZG/JCFwDpK16JEsI5yK9uMdvzVe7zAUxZQrhXKKBwxqZkSikQ8aiZbnIFgKS4oea0i5bBhQJgQ+kKJEBhUJAUkqxo+cduJqVrQH8B6xBgBhvJFNDAAAAAElFTkSuQmCC',
|
||||
// // lineBody: this.currentData.lineBody == 1 ? 'F ' : 'S',
|
||||
// createTime: moment(this.currentData.createTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
// // modul1: '20210320000012',
|
||||
// // modul2: '20210320000012',
|
||||
// // modul3: '20210320000012'
|
||||
// }
|
||||
// for (var i = 0; i < this.substrateList.length; i++) {
|
||||
// var model = 'model' + Number(i + 1)
|
||||
// var pmpp = 'PMPP' + Number(i + 1)
|
||||
// var m = 'm' + Number(i + 1)
|
||||
|
||||
// console.log(model)
|
||||
// // console.log(this.list[i].woSubstrateId)
|
||||
// // console.log(this.list[i].woSubstrateId)
|
||||
// obj['' + model + ''] = this.substrateList[i].woSubstrateId
|
||||
// obj['' + pmpp + ''] = this.substrateList[i].pmpp
|
||||
// obj['' + m + ''] = i + 1
|
||||
// }
|
||||
// console.log(obj)
|
||||
// this.printPreview('预览', res.data)
|
||||
const hiprintTemplate = this.$print(undefined, JSON.parse(res.data.content), obj, {}, {
|
||||
// styleHandler: () => {
|
||||
// const css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">'
|
||||
// return css
|
||||
// }
|
||||
})
|
||||
|
||||
hiprintTemplate.on('printSuccess', function () {
|
||||
console.log(1111);
|
||||
// that.$notification.success({
|
||||
// // key: key,
|
||||
// placement: 'topRight',
|
||||
// message: key + ' 打印成功',
|
||||
// description: 'Api单独直接打印回调',
|
||||
// });
|
||||
});
|
||||
console.log(hiprintTemplate)
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择打印标签模板',
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
},
|
||||
closeCallback(vue) {
|
||||
console.log('关闭了打印工具')
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.workOrderId = val.workOrderId;
|
||||
if (val.createTime && val.createTime.length != 0) {
|
||||
this.listQuery.createTime = val.createTime
|
||||
// this.listQuery.createTime[1] = val.timeVal[1]
|
||||
} else {
|
||||
this.listQuery.createTime = undefined
|
||||
// this.listQuery.endTime = undefined
|
||||
}
|
||||
this.getDataList();
|
||||
console.log(this.tableData)
|
||||
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);
|
||||
}
|
||||
},
|
||||
otherMethods(val) {
|
||||
this.handlePrint(val.data.modelId)
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.addOrEditTitle = '详情';
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(val.data.id, true);
|
||||
// });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,47 +0,0 @@
|
||||
<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>
|
||||
@@ -1,554 +0,0 @@
|
||||
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: {},
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -85,7 +85,7 @@ export default {
|
||||
color: this.colors,
|
||||
title: {
|
||||
text: num,
|
||||
subtext: '总数',
|
||||
subtext: '总数/个',
|
||||
top: '32%',
|
||||
left: '49%',
|
||||
textAlign: 'center',
|
||||
|
||||
@@ -32,11 +32,11 @@ export default {
|
||||
return {
|
||||
timestr: '',
|
||||
config: {
|
||||
header: ['序号', '设备名称', '设备编码', '设备状态', '是否故障'],
|
||||
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],
|
||||
columnWidth: [60, 120, 280],
|
||||
align: ['center'],
|
||||
data: [],
|
||||
// data: [
|
||||
@@ -63,18 +63,20 @@ export default {
|
||||
handler(newVal, oldVal) {
|
||||
let outArr = this.sjgEquipment.map((item, index) => [
|
||||
index + 1,
|
||||
`<span title=${item.lineName || ''}>${item.lineName || ''}</span>`,
|
||||
`<span title=${item.name || ''}>${item.name || ''}</span>`,
|
||||
`<span title=${item.code || ''}>${item.code || ''}</span>`,
|
||||
`<span><div style="${
|
||||
item.status == '正常'
|
||||
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>`,
|
||||
// `<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);
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</span>
|
||||
</ShadowRect>
|
||||
|
||||
<ShadowRect>
|
||||
<!-- <ShadowRect>
|
||||
<span
|
||||
style="
|
||||
font-size: 20px;
|
||||
@@ -99,7 +99,7 @@
|
||||
: ''
|
||||
}}mg/m³
|
||||
</span>
|
||||
</ShadowRect>
|
||||
</ShadowRect> -->
|
||||
</div>
|
||||
<KilnLine :horizontal="true" />
|
||||
<div
|
||||
@@ -130,8 +130,9 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
">
|
||||
<!-- :options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']" -->
|
||||
<SelectorBtnGroup
|
||||
:options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']"
|
||||
:options="['氧气含量', '二氧化硫', '氮氧化物']"
|
||||
@emitFun="toggleType"
|
||||
:active="chartType" />
|
||||
<SelectorBtnGroup
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
label: '生产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -75,7 +76,7 @@ export default {
|
||||
selectOptions: [
|
||||
{ id: '1', name: '当前班次' },
|
||||
{ id: '2', name: '近24小时' },
|
||||
{ id: '3', name: '日报' },
|
||||
{ id: '3', name: '昨日日报' },
|
||||
],
|
||||
defaultSelect: '1',
|
||||
param: 'timeType',
|
||||
@@ -104,6 +105,7 @@ export default {
|
||||
label: '生产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -112,7 +114,7 @@ export default {
|
||||
selectOptions: [
|
||||
{ id: '1', name: '当前班次' },
|
||||
{ id: '2', name: '近24小时' },
|
||||
{ id: '3', name: '日报' },
|
||||
{ id: '3', name: '昨日日报' },
|
||||
],
|
||||
param: 'timeType',
|
||||
clearable: false,
|
||||
@@ -137,12 +139,12 @@ export default {
|
||||
queryParams: {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
lineId: '',
|
||||
lineId: [],
|
||||
},
|
||||
queryParams2: {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
lineId: '',
|
||||
lineId: [],
|
||||
},
|
||||
tableProp1,
|
||||
tableProp: [],
|
||||
@@ -150,11 +152,11 @@ export default {
|
||||
tableProp2: [],
|
||||
tableData2: [],
|
||||
procedureName: [
|
||||
{ name: '压延(拉引量t)', ename: 'calenderingCapacity' },
|
||||
// { name: '压延(拉引量t)', ename: 'calenderingCapacity' },
|
||||
{ name: '优化切割(片)', ename: 'cuttingNum' },
|
||||
{ name: '堆垛(片)', ename: 'unloadPieces' },
|
||||
{ name: '堆垛(托)', ename: 'unloadCount' },
|
||||
{ name: '良品率(%)', ename: 'rate' },
|
||||
{ name: '优切良品率(%)', ename: 'rate' },
|
||||
],
|
||||
span: [], //表2第一列合并
|
||||
};
|
||||
@@ -196,6 +198,7 @@ export default {
|
||||
this.tableProp = [];
|
||||
let timeArr = this.uniqueTime(data, 'timeStr');
|
||||
let arr = [];
|
||||
let arr1 = [];
|
||||
timeArr.map((item) => {
|
||||
let obj = {};
|
||||
obj.prop = item.timeStr;
|
||||
@@ -203,7 +206,17 @@ export default {
|
||||
obj.minWidth = 140;
|
||||
arr.push(obj);
|
||||
});
|
||||
this.tableProp = this.tableProp1.concat(arr); //表头
|
||||
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);
|
||||
});
|
||||
},
|
||||
@@ -286,7 +299,6 @@ export default {
|
||||
transferData(data) {
|
||||
let tempData = [];
|
||||
let lineNum = 0; //第一条产线
|
||||
let sumArr = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (i === 0) {
|
||||
this.procedureName.map((item) => {
|
||||
@@ -299,37 +311,28 @@ export default {
|
||||
});
|
||||
lineNum++;
|
||||
} else {
|
||||
if (data[i].timeStr === '总计') {
|
||||
sumArr.push(data[i]);
|
||||
} else {
|
||||
if (data[i].lineName === data[i - 1].lineName) {
|
||||
//相同产线,添加列
|
||||
let startNum = 5 * (lineNum - 1);
|
||||
let endNum = 5 * lineNum - 1;
|
||||
for (let k = startNum; k <= endNum; k++) {
|
||||
let str = this.procedureName[k % 5];
|
||||
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++;
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let j = 0; j < tempData.length; j++) {
|
||||
sumArr.map((item) => {
|
||||
tempData[j]['总计'] = item[tempData[j].eName];
|
||||
});
|
||||
}
|
||||
this.tableData = tempData;
|
||||
|
||||
this.$nextTick(() => {
|
||||
@@ -355,9 +358,9 @@ export default {
|
||||
// 合并第一列
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex % 5 === 0) {
|
||||
if (rowIndex % 4 === 0) {
|
||||
return {
|
||||
rowspan: 5,
|
||||
rowspan: 4,
|
||||
colspan: 1,
|
||||
};
|
||||
} else {
|
||||
@@ -379,9 +382,17 @@ export default {
|
||||
obj.lineName = data[i].lineName;
|
||||
obj.procedure = data[i].productDet[j].name;
|
||||
data[i].productDet[j].data.map((item) => {
|
||||
obj[item.timeStr] = item.input || null;
|
||||
obj[item.timeStr] = item.output
|
||||
? item.output
|
||||
: item.input
|
||||
? item.input
|
||||
: null;
|
||||
});
|
||||
obj.sum = data[i].productDet[j].allInput;
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -395,7 +406,17 @@ export default {
|
||||
arr.push(obj);
|
||||
});
|
||||
arr.push({ prop: 'sum', label: '合计' });
|
||||
this.tableProp2 = this.tableProp1.concat(arr); //表头
|
||||
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();
|
||||
@@ -461,7 +482,7 @@ export default {
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #ebeef5;
|
||||
transform: rotate(-70deg);
|
||||
transform: rotate(-63deg);
|
||||
-webkit-transform-origin: top;
|
||||
transform-origin: top;
|
||||
width: 1px;
|
||||
@@ -469,11 +490,11 @@ export default {
|
||||
.el-table thead.is-group tr:last-of-type th:nth-child(1):before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
height: 67px;
|
||||
height: 93px;
|
||||
top: 0;
|
||||
left: 75px;
|
||||
left: 55px;
|
||||
background-color: #ebeef5;
|
||||
transform: rotate(-70deg);
|
||||
transform: rotate(-63deg);
|
||||
-webkit-transform-origin: top;
|
||||
transform-origin: top;
|
||||
width: 1px;
|
||||
|
||||
@@ -1,141 +1,389 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-04-22 15:49:56
|
||||
* @LastEditTime: 2024-04-23 17:06:16
|
||||
* @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="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" 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>
|
||||
<monthWeek v-if="glassWeekShow" ref="monthWeek" :product="false" :params="listQuery" />
|
||||
<proMonth v-if="proWeekShow" ref="proMonth" :product="false" :params="listQuery" />
|
||||
</div>
|
||||
<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 monthWeek from '../glass/month.vue'
|
||||
import proMonth from '../productionMonthReport/index.vue'
|
||||
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 },
|
||||
data() {
|
||||
return {
|
||||
listQuery: {
|
||||
// pageSize: 10,
|
||||
// pageNo: 1,
|
||||
// total: 0,
|
||||
reportType: 4,
|
||||
reportTime: []
|
||||
},
|
||||
startTimeStamp: '',
|
||||
endTimeStamp: '',
|
||||
reportTime: '',
|
||||
glassWeekShow: false,
|
||||
proWeekShow: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCurrentMonthFirst()
|
||||
this.glassWeekShow = true
|
||||
this.proWeekShow = true
|
||||
},
|
||||
methods: {
|
||||
getCurrentMonthFirst() {
|
||||
const date = new Date();
|
||||
date.setDate(1);
|
||||
this.reportTime = date
|
||||
// console.log(date)
|
||||
this.changeTime(date)
|
||||
// console.log(date.valueOf());
|
||||
},
|
||||
handleExport() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['monthWeek'].handleExport()
|
||||
this.$refs['proMonth'].handleExport()
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['monthWeek'].getDataList()
|
||||
this.$refs['proMonth'].getDataList()
|
||||
})
|
||||
},
|
||||
changeTime(val) {
|
||||
console.log(val)
|
||||
if(val) {
|
||||
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
|
||||
const fullyear = val.getFullYear()
|
||||
let days = 0
|
||||
switch (timeStamp) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7:
|
||||
case 9:
|
||||
case 11:
|
||||
days = 31
|
||||
break
|
||||
case 3:
|
||||
case 4:
|
||||
case 8:
|
||||
case 10:
|
||||
days = 30
|
||||
break
|
||||
case 1:
|
||||
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
||||
days = 29
|
||||
} else {
|
||||
days = 28
|
||||
}
|
||||
break
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //结束时间
|
||||
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||
this.listQuery.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.listQuery.reportTime = []
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//时间戳转为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)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取合并行
|
||||
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-top: 16px;
|
||||
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;
|
||||
.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,14 +1,14 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-04-22 15:49:56
|
||||
* @LastEditTime: 2024-04-23 15:43:36
|
||||
* @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>
|
||||
<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="选择周">
|
||||
@@ -28,7 +28,9 @@
|
||||
<script>
|
||||
import glassWeek from '../glass/weekly.vue'
|
||||
import proWeek from '../productionWeekReport/index.vue'
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { parseTime } from '../../core/mixins/code-filter'
|
||||
import FileSaver from 'file-saver'
|
||||
import * as XLSX from 'xlsx/xlsx.mjs'
|
||||
|
||||
export default {
|
||||
components: { glassWeek, proWeek },
|
||||
@@ -45,7 +47,8 @@ export default {
|
||||
endTimeStamp: '',
|
||||
reportTime: '',
|
||||
glassWeekShow: false,
|
||||
proWeekShow: false
|
||||
proWeekShow: false,
|
||||
proTabaleData: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -54,11 +57,35 @@ export default {
|
||||
this.proWeekShow = true
|
||||
},
|
||||
methods: {
|
||||
// handleExport() {
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs['glassWeek'].handleExport()
|
||||
// this.$refs['proWeek'].handleExport()
|
||||
// })
|
||||
// },
|
||||
handleExport() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['glassWeek'].handleExport()
|
||||
this.$refs['proWeek'].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(() => {
|
||||
|
||||
@@ -1,117 +1,387 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-04-22 15:49:56
|
||||
* @LastEditTime: 2024-04-23 17:16:11
|
||||
* @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="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" 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>
|
||||
<glassYear v-if="glassYearShow" ref="glassYear" :product="false" :params="listQuery" />
|
||||
<proYear v-if="proYearShow" ref="proYear" :product="false" :params="listQuery" />
|
||||
</div>
|
||||
<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 glassYear from '../glass/year.vue'
|
||||
import proYear from '../productionYearReport/index.vue'
|
||||
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: { glassYear, proYear },
|
||||
data() {
|
||||
return {
|
||||
listQuery: {
|
||||
// pageSize: 10,
|
||||
// pageNo: 1,
|
||||
// total: 0,
|
||||
reportType: 5,
|
||||
reportTime: []
|
||||
},
|
||||
startTimeStamp: '',
|
||||
endTimeStamp: '',
|
||||
reportTime: '',
|
||||
glassYearShow: false,
|
||||
proYearShow: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCurrentYearFirst()
|
||||
this.glassYearShow = true
|
||||
this.proYearShow = true
|
||||
},
|
||||
methods: {
|
||||
handleExport() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['glassYear'].handleExport()
|
||||
this.$refs['proYear'].handleExport()
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['glassYear'].getDataList()
|
||||
this.$refs['proYear'].getDataList()
|
||||
})
|
||||
},
|
||||
changeTime(val) {
|
||||
if(val) {
|
||||
// let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
||||
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(),11, 31, 7, 0, 0).getTime()); //开始时间
|
||||
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //结束时间
|
||||
this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||
} else {
|
||||
this.listQuery.reportTime = []
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
getCurrentYearFirst() {
|
||||
let date = new Date();
|
||||
date.setDate(1);
|
||||
date.setMonth(0);
|
||||
this.reportTime = date;
|
||||
this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1,7,0,1).getTime()); //开始时间
|
||||
this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //结束时间
|
||||
this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||
this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
|
||||
},
|
||||
//时间戳转为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)
|
||||
// 获取合并行
|
||||
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-top: 16px;
|
||||
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;
|
||||
.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,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-12-13 14:10:04
|
||||
* @LastEditTime: 2024-04-23 16:47:21
|
||||
* @LastEditTime: 2024-04-26 15:59:39
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -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: '拉引量㎡',
|
||||
@@ -181,9 +181,9 @@ const cols = [
|
||||
deep: true,
|
||||
handler(newv, oldv) {
|
||||
if (newv[0] !== '' && newv[0] !== undefined) {
|
||||
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
|
||||
this.cols[1].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
|
||||
} else {
|
||||
this.cols[0].label = this.date
|
||||
this.cols[1].label = this.date
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -208,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,10 +1,3 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-18 14:08:46
|
||||
* @LastEditTime: 2024-04-24 13:52:45
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
@@ -24,10 +17,13 @@
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
|
||||
<el-table class="baseTable" :span-method="objectSpanMethod" :data="tableData" style="width: 100%">
|
||||
<el-table-column align="center" prop="" label="配料日报" width="120">
|
||||
<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="120">
|
||||
<el-table-column prop="className" label="时间" width="150">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="putType" label="" width="180">
|
||||
@@ -36,8 +32,7 @@
|
||||
<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 " :prop="item"
|
||||
:label="item">
|
||||
<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] }}
|
||||
@@ -77,6 +72,7 @@ import {
|
||||
} 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 = [
|
||||
// {
|
||||
@@ -122,7 +118,7 @@ const headers = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [ tableHeightMixin],
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -130,34 +126,33 @@ export default {
|
||||
// deleteURL: deleteQualityHotMaterial,
|
||||
// exportURL: exportFactoryExcel,
|
||||
},
|
||||
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'],
|
||||
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11','sj14'],
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
startTime: undefined,
|
||||
endTime:undefined
|
||||
endTime: undefined
|
||||
},
|
||||
time: '',
|
||||
formConfig: [
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
label: '时间',
|
||||
dateType: 'date',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'checkTime',
|
||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||
width: 350
|
||||
defaultSelect: Date.now(),
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
type:'button',
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type:'button',
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
@@ -173,14 +168,29 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
// this.formConfig[1].defaultSelect[]
|
||||
this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
|
||||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
||||
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) => {
|
||||
@@ -206,23 +216,23 @@ export default {
|
||||
colspan: _col
|
||||
}
|
||||
}
|
||||
if (columnIndex === 1 ) {
|
||||
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) {
|
||||
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 || columnIndex === 12 || columnIndex === 13) {
|
||||
if (columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9 || columnIndex === 10 || columnIndex === 11 ) {
|
||||
if (rowIndex % 2 == 0) {
|
||||
return {
|
||||
rowspan: 2,
|
||||
@@ -255,7 +265,7 @@ export default {
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"切割堆垛日报表.xlsx"
|
||||
"配料日报.xlsx"
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
@@ -285,7 +295,7 @@ export default {
|
||||
let arr = [
|
||||
{
|
||||
classType: 1,
|
||||
className:'白班(8:00-20:00)',
|
||||
className: '白班(8:00-20:00)',
|
||||
'sj1': null,
|
||||
'sj2': null,
|
||||
'sj3': null,
|
||||
@@ -295,10 +305,9 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
putType: '投入数量'
|
||||
putType: '原料投入(kg)'
|
||||
},
|
||||
{
|
||||
classType: 1,
|
||||
@@ -312,8 +321,7 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
'sj1+sj2': null,
|
||||
putType: ''
|
||||
@@ -330,8 +338,7 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
putType: '投入次数'
|
||||
},
|
||||
@@ -347,8 +354,7 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
'sj1+sj2': null,
|
||||
putType: ''
|
||||
@@ -365,10 +371,9 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
putType: '投入数量',
|
||||
putType: '原料投入(kg)',
|
||||
},
|
||||
{
|
||||
classType: 2,
|
||||
@@ -382,14 +387,13 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
'sj1+sj2': null,
|
||||
putType: ''
|
||||
},
|
||||
{
|
||||
classType:2,
|
||||
classType: 2,
|
||||
className: '夜班(20:00-8:00)',
|
||||
'sj1': null,
|
||||
'sj2': null,
|
||||
@@ -400,8 +404,7 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
putType: '投入次数',
|
||||
},
|
||||
@@ -417,8 +420,7 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
'sj1+sj2': null,
|
||||
putType: ''
|
||||
@@ -435,10 +437,9 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
putType: '投入数量',
|
||||
putType: '原料投入(kg)',
|
||||
},
|
||||
{
|
||||
classType: 3,
|
||||
@@ -452,10 +453,9 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
'sj1+sj2':null,
|
||||
'sj1+sj2': null,
|
||||
putType: ''
|
||||
},
|
||||
{
|
||||
@@ -470,8 +470,7 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
putType: '投入次数',
|
||||
},
|
||||
@@ -487,41 +486,40 @@ export default {
|
||||
'sj8': null,
|
||||
'sj10': null,
|
||||
'sj11': null,
|
||||
'sj12': null,
|
||||
'sj13': null,
|
||||
|
||||
'sj14': null,
|
||||
'sj1+sj2': null,
|
||||
putType: ''
|
||||
},
|
||||
]
|
||||
res.data.forEach((ele) => {
|
||||
if(ele.classType === 1 && ele.code == 'sj1+sj2') {
|
||||
arr[1]['putType'] = ele.putNum
|
||||
arr[3]['putType'] = ele.useNum
|
||||
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.putNum
|
||||
arr[7]['putType'] = ele.useNum
|
||||
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.putNum
|
||||
arr[11]['putType'] = ele.useNum
|
||||
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.putNum
|
||||
arr[2][item] = ele.useNum
|
||||
arr[0][item] = ele.useNum
|
||||
arr[2][item] = ele.putNum
|
||||
} else if (ele.classType === 2 && ele.code == item) {
|
||||
arr[4][item] = ele.putNum
|
||||
arr[6][item] = ele.useNum
|
||||
arr[4][item] = ele.useNum
|
||||
arr[6][item] = ele.putNum
|
||||
} else if (ele.classType === 3 && ele.code == item) {
|
||||
arr[8][item] = ele.putNum
|
||||
arr[10][item] = ele.useNum
|
||||
arr[8][item] = ele.useNum
|
||||
arr[10][item] = ele.putNum
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -532,10 +530,13 @@ export default {
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
console.log(val.checkTime)
|
||||
// Date.now() - 24 * 60 * 60 - 1000
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||
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':
|
||||
@@ -549,6 +550,10 @@ export default {
|
||||
};
|
||||
</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;
|
||||
}
|
||||
@@ -557,6 +562,7 @@ export default {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
::v-deep.el-table thead.is-group th {
|
||||
background: none;
|
||||
}
|
||||
@@ -567,18 +573,19 @@ export default {
|
||||
::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: 75px;
|
||||
height: 90px;
|
||||
/*这里需要自己调整,根据td的宽度和高度*/
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: grey;
|
||||
opacity: 0.3;
|
||||
display: block;
|
||||
transform: rotate(-53deg);
|
||||
transform: rotate(-60deg);
|
||||
/*这里需要自己调整,根据线的位置*/
|
||||
transform-origin: top;
|
||||
}
|
||||
@@ -587,14 +594,14 @@ export default {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 75px;
|
||||
height: 90px;
|
||||
/*这里需要自己调整,根据td的宽度和高度*/
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: grey;
|
||||
opacity: 0.3;
|
||||
display: block;
|
||||
transform: rotate(-54deg);
|
||||
transform: rotate(-60deg);
|
||||
/*这里需要自己调整,根据线的位置*/
|
||||
transform-origin: bottom;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-04-23 16:58:06
|
||||
* @LastEditTime: 2024-04-24 15:27:49
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -26,7 +26,7 @@
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@@ -496,7 +496,7 @@ export default {
|
||||
/* 从表生成工作簿对象 */
|
||||
import('xlsx').then(excel => {
|
||||
var wb = excel.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
document.querySelector("#exportproductionTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-04-23 16:58:12
|
||||
* @LastEditTime: 2024-04-26 16:01:20
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -28,17 +28,23 @@
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<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">
|
||||
@@ -517,7 +523,7 @@ export default {
|
||||
/* 从表生成工作簿对象 */
|
||||
import('xlsx').then(excel => {
|
||||
var wb = excel.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
document.querySelector("#exportproductionTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-12 13:45:25
|
||||
* @LastEditTime: 2024-04-23 17:21:04
|
||||
* @LastEditTime: 2024-04-24 15:28:10
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@@ -30,7 +30,7 @@
|
||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
<el-table id="exportproductionTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}">
|
||||
@@ -452,7 +452,7 @@ export default {
|
||||
/* 从表生成工作簿对象 */
|
||||
import('xlsx').then(excel => {
|
||||
var wb = excel.utils.table_to_book(
|
||||
document.querySelector("#exportTable"),
|
||||
document.querySelector("#exportproductionTable"),
|
||||
xlsxParam
|
||||
);
|
||||
/* 获取二进制字符串作为输出 */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-18 10:01:33
|
||||
* @LastEditTime: 2024-04-24 09:34:36
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-26 15:22:57
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -12,8 +12,14 @@
|
||||
background: '#F2F4F9',
|
||||
color: '#606266'
|
||||
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%">
|
||||
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
|
||||
<el-table-column v-for="it in item.children" :prop="it.prop" :label="it.label" align="center">
|
||||
<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>
|
||||
@@ -42,6 +48,37 @@ import {
|
||||
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 = [
|
||||
// {
|
||||
@@ -121,14 +158,16 @@ export default {
|
||||
// deleteURL: deleteQualityHotMaterial,
|
||||
// exportURL: exportFactoryExcel,
|
||||
},
|
||||
tablePropsChild,
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableDataChild:[],
|
||||
mergeArr: [],//记录合并行数
|
||||
pos: 0,
|
||||
listQuery: {
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
lineId: null,
|
||||
lineId: undefined,
|
||||
},
|
||||
formConfig: [
|
||||
// {
|
||||
@@ -150,13 +189,13 @@ export default {
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'checkTime',
|
||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||
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
|
||||
},
|
||||
{
|
||||
@@ -166,6 +205,7 @@ export default {
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'lineId',
|
||||
// multiple:true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
@@ -193,9 +233,10 @@ export default {
|
||||
},
|
||||
created() { },
|
||||
mounted() {
|
||||
// this.formConfig[1].defaultSelect[]
|
||||
this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
|
||||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
||||
// 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()
|
||||
@@ -287,7 +328,36 @@ export default {
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"原片各线堆垛表.xlsx"
|
||||
"切割堆垛日报.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);
|
||||
@@ -295,7 +365,6 @@ export default {
|
||||
return wbout;
|
||||
//do something......
|
||||
})
|
||||
|
||||
},
|
||||
// otherMethods(val) {
|
||||
// if (val.type === 'detail') {
|
||||
@@ -395,8 +464,8 @@ export default {
|
||||
// this.listQuery.materialId = val.materialId ? val.materialId : undefined;
|
||||
// this.listQuery.startTime = '1706144404000';
|
||||
// this.listQuery.endTime = '1706230804000';
|
||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||
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;
|
||||
@@ -425,6 +494,10 @@ export default {
|
||||
};
|
||||
</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;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-18 14:08:46
|
||||
* @LastEditTime: 2024-04-24 14:41:01
|
||||
* @LastEditors: zhp
|
||||
* @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="timestamp" type="date" placeholder="选择日期">
|
||||
<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="请选择">
|
||||
<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>
|
||||
@@ -46,7 +46,10 @@
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
|
||||
<el-table class="baseTable" :data="tableData" style="width: 100%">
|
||||
<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>
|
||||
@@ -57,23 +60,8 @@
|
||||
<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 " :prop="item.prop" :label="item.label">
|
||||
<el-table-column v-for="(item, index) in codeList " :key="index" :prop="item.prop" :label="item.label">
|
||||
</el-table-column>
|
||||
<div slot="append" v-if="this.tableData.length != 0" style="text-align: center">
|
||||
<!--在此处添加你想要插入在表格最后一行的内容-->
|
||||
<el-col :span="8">
|
||||
人工监测人员
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- {{ }} -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
合计
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
{{ sum }}
|
||||
</el-col>
|
||||
</div>
|
||||
</el-table>
|
||||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getDataList" /> -->
|
||||
@@ -160,59 +148,59 @@ export default {
|
||||
radio:'晚班查询',
|
||||
lineList:[],
|
||||
codeList: [
|
||||
{
|
||||
label: '19:00',
|
||||
prop: 'num0'
|
||||
// {
|
||||
// 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'
|
||||
}
|
||||
// },
|
||||
// {
|
||||
// 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: [
|
||||
@@ -226,7 +214,7 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'checkTime',
|
||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||
defaultSelect: [Date.now() - 24 * 60 * 60*1000, Date.now()],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
@@ -255,8 +243,8 @@ export default {
|
||||
// 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(new Date().setHours(1, 9, 0, 0)).getTime()
|
||||
this.getDataList()
|
||||
this.listQuery.startTime = new Date()
|
||||
// this.getDataList()
|
||||
this.getDict()
|
||||
// this.getSpanArr(this.tableData)
|
||||
// this.getDict();
|
||||
@@ -268,28 +256,12 @@ export default {
|
||||
this.lineList = res.data
|
||||
},
|
||||
// objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
// let spanOneArr = [], concatOne = 0;
|
||||
// this.tableData.map((item, index) => {
|
||||
// if (index === 0) {
|
||||
// spanOneArr.push(1);
|
||||
// } else {
|
||||
// //第一列需合并相同内容的判断条件
|
||||
// if (item.className === this.tableData[index - 1].className) {
|
||||
// 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 === this.tableData.length-1) {
|
||||
// return {
|
||||
// rowspan: 1,
|
||||
// colspan: 4
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
@@ -310,134 +282,7 @@ export default {
|
||||
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second;
|
||||
},
|
||||
handleGetClass(e) {
|
||||
let str = this.listQuery.startTime
|
||||
// console.log(str);
|
||||
this.listQuery.startTime = new Date(new Date(str).setHours(0, 7, 0, 0)).getTime()
|
||||
// console.log(startTime1)
|
||||
this.codeList = []
|
||||
if (e === '早班查询') {
|
||||
let arr = [
|
||||
{
|
||||
label: '07:00',
|
||||
prop:'num0'
|
||||
},
|
||||
{
|
||||
label: '08:00',
|
||||
prop: 'num1'
|
||||
},
|
||||
{
|
||||
label: '09:00',
|
||||
prop: 'num2'
|
||||
},
|
||||
{
|
||||
label: '10:00',
|
||||
prop: 'num3'
|
||||
},
|
||||
{
|
||||
label: '11:00',
|
||||
prop: 'num4'
|
||||
},
|
||||
{
|
||||
label: '12:00',
|
||||
prop: 'num5'
|
||||
},
|
||||
{
|
||||
label: '13:00',
|
||||
prop: 'num6'
|
||||
},
|
||||
{
|
||||
label: '14:00',
|
||||
prop: 'num7'
|
||||
},
|
||||
{
|
||||
label: '15:00',
|
||||
prop: 'num8'
|
||||
},
|
||||
{
|
||||
label: '16:00',
|
||||
prop: 'num9'
|
||||
},
|
||||
{
|
||||
label: '17:00',
|
||||
prop: 'num10'
|
||||
},
|
||||
{
|
||||
label: '18:00',
|
||||
prop: 'num11'
|
||||
},
|
||||
{
|
||||
label: '不良合计',
|
||||
prop: 'sum'
|
||||
}
|
||||
]
|
||||
arr.forEach((ele,index) => [
|
||||
this.codeList.push(ele)
|
||||
])
|
||||
this.getDataList()
|
||||
} else {
|
||||
let str = this.listQuery.startTime
|
||||
// console.log(str);
|
||||
this.listQuery.startTime = new Date(new Date(str).setHours(0, 7, 0, 0)).getTime()
|
||||
let arr = [
|
||||
{
|
||||
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'
|
||||
}
|
||||
]
|
||||
arr.forEach((ele, index) => [
|
||||
this.codeList.push(ele)
|
||||
])
|
||||
this.getDataList()
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
@@ -463,8 +308,9 @@ export default {
|
||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
//设置导出文件名称
|
||||
"原片各线堆垛表.xlsx"
|
||||
"全检检验记录.xlsx"
|
||||
);
|
||||
this.$message.success('导出成功');
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
@@ -484,28 +330,45 @@ export default {
|
||||
// },
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
if (this.radio === '晚班查询') {
|
||||
let str = this.listQuery.startTime
|
||||
// console.log(str);
|
||||
this.listQuery.startTime = new Date(new Date(str).setHours(1, 9, 0, 0)).getTime()
|
||||
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 {
|
||||
let str = this.listQuery.startTime
|
||||
// console.log(str);
|
||||
this.listQuery.startTime = new Date(new Date(str).setHours(0, 7, 0, 0)).getTime()
|
||||
str = new Date(new Date(this.listQuery.startTime).setHours(7, 0, 0, 0)).getTime()
|
||||
}
|
||||
this.dataListLoading = true;
|
||||
// this.dataListLoading = true;
|
||||
// this.listQuery.startTime = '1713197388000';
|
||||
// this.listQuery.endTime = '1713254961000';
|
||||
this.urlOptions.getDataListURL({
|
||||
// productionLineId: '1696716506443354114',
|
||||
// startTime: '1705618800000'
|
||||
// startTime: '1705618800000',
|
||||
productionLineId: this.listQuery.productionLineId,
|
||||
startTime:this.listQuery.startTime
|
||||
startTime: str
|
||||
},).then(res => {
|
||||
let count = 0
|
||||
let arr = []
|
||||
console.log(res.data)
|
||||
this.sum = res.data.allSum
|
||||
|
||||
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])
|
||||
@@ -526,130 +389,11 @@ export default {
|
||||
}
|
||||
console.log(arr);
|
||||
this.tableData = arr
|
||||
// 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,
|
||||
// 'sj12': null,
|
||||
// 'sj13': 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,
|
||||
// 'sj12': null,
|
||||
// 'sj13': null,
|
||||
// 'sj14': 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,
|
||||
// 'sj12': null,
|
||||
// 'sj13': null,
|
||||
// 'sj14': 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,
|
||||
// 'sj12': null,
|
||||
// 'sj13': null,
|
||||
// 'sj14': null,
|
||||
// putType: '投入次数',
|
||||
// },
|
||||
// {
|
||||
// classType: 1,
|
||||
// className: '全天',
|
||||
// 'sj1': null,
|
||||
// 'sj2': null,
|
||||
// 'sj3': null,
|
||||
// 'sj4': null,
|
||||
// 'sj5': null,
|
||||
// 'sj7': null,
|
||||
// 'sj8': null,
|
||||
// 'sj10': null,
|
||||
// 'sj11': null,
|
||||
// 'sj12': null,
|
||||
// 'sj13': null,
|
||||
// 'sj14': null,
|
||||
// putType: '投入数量',
|
||||
// },
|
||||
// {
|
||||
// classType: 2,
|
||||
// className: '全天',
|
||||
// 'sj1': null,
|
||||
// 'sj2': null,
|
||||
// 'sj3': null,
|
||||
// 'sj4': null,
|
||||
// 'sj5': null,
|
||||
// 'sj7': null,
|
||||
// 'sj8': null,
|
||||
// 'sj10': null,
|
||||
// 'sj11': null,
|
||||
// 'sj12': null,
|
||||
// 'sj13': null,
|
||||
// 'sj14': null,
|
||||
// putType: '投入次数',
|
||||
// }
|
||||
// ]
|
||||
// res.data.forEach((ele) => {
|
||||
// this.codeList.forEach((item) => {
|
||||
// if (ele.classType === 1 && ele.code == item) {
|
||||
// // console.log(arr[0][item])
|
||||
// arr[0][item] = ele.putNum
|
||||
// arr[1][item] = ele.useNum
|
||||
// } else if (ele.classType === 2 && ele.code == item) {
|
||||
// arr[2][item] = ele.putNum
|
||||
// arr[3][item] = ele.useNum
|
||||
// } else if (ele.classType === 3 && ele.code == item) {
|
||||
// arr[4][item] = ele.putNum
|
||||
// arr[5][item] = ele.useNum
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// // console.log(arr)
|
||||
// this.tableData = arr
|
||||
// this.dataListLoading = false;
|
||||
this.tableData.push({
|
||||
name: '检验员',
|
||||
num11: '合计',
|
||||
sum: res.data.allSum
|
||||
})
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
@@ -670,6 +414,10 @@ export default {
|
||||
};
|
||||
</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;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
@headBtnClick="buttonClick" />
|
||||
@headBtnClick="buttonClick"
|
||||
@datepicker-change="datepickerChange" />
|
||||
<base-table
|
||||
class="israLineReportTable1"
|
||||
ref="israLineReportTable11"
|
||||
@@ -25,7 +26,7 @@ const tableProp1 = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '生产线',
|
||||
width: 110,
|
||||
width: 90,
|
||||
fixed: true,
|
||||
},
|
||||
{
|
||||
@@ -57,20 +58,23 @@ export default {
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd',
|
||||
format: 'yyyy-MM-dd HH:mm',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 250,
|
||||
width: 300,
|
||||
onchange: true,
|
||||
clearable: false,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '产线',
|
||||
selectOptions: [],
|
||||
param: 'lineId',
|
||||
multiple: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -92,7 +96,7 @@ export default {
|
||||
queryParams: {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
lineId: '',
|
||||
lineId: [],
|
||||
},
|
||||
tableProp1,
|
||||
tableProp: [],
|
||||
@@ -105,11 +109,14 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.tableProp = this.tableProp1;
|
||||
let start = moment().format('yyyy-MM-DD');
|
||||
let end = moment().format('yyyy-MM-DD');
|
||||
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 + ' 00:00:00').valueOf();
|
||||
this.queryParams.endTime = moment(end + ' 23:59:59').valueOf();
|
||||
this.queryParams.startTime = moment(start).valueOf();
|
||||
this.queryParams.endTime = moment(end).valueOf();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
@@ -235,15 +242,22 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 时间选择器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] + ' 00:00:00'
|
||||
).valueOf();
|
||||
this.queryParams.endTime = moment(
|
||||
val.timeVal[1] + ' 23:59:59'
|
||||
).valueOf();
|
||||
this.queryParams.startTime = moment(val.timeVal[0]).valueOf();
|
||||
this.queryParams.endTime = moment(val.timeVal[1]).valueOf();
|
||||
}
|
||||
this.queryParams.lineId = val.lineId;
|
||||
this.getList();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-18 10:01:33
|
||||
* @LastEditTime: 2024-04-24 09:56:20
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-26 15:31:24
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -13,8 +13,7 @@
|
||||
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 in tableProps" :prop="item.prop" :label="item.label"
|
||||
align="center">
|
||||
<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"
|
||||
@@ -51,12 +50,12 @@ const tableProps = [
|
||||
// },
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
label: '生产线',
|
||||
width:'100'
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '',
|
||||
label: '机械手名称',
|
||||
width: '200'
|
||||
},
|
||||
{
|
||||
@@ -104,7 +103,7 @@ export default {
|
||||
listQuery: {
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
lineId:null,
|
||||
lineId:undefined,
|
||||
},
|
||||
formConfig: [
|
||||
// {
|
||||
@@ -132,7 +131,7 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'checkTime',
|
||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||
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
|
||||
},
|
||||
{
|
||||
@@ -142,6 +141,7 @@ export default {
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'lineId',
|
||||
multiple:true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
@@ -170,8 +170,8 @@ export default {
|
||||
created() { },
|
||||
mounted() {
|
||||
// this.formConfig[1].defaultSelect[]
|
||||
this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
|
||||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
||||
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()
|
||||
@@ -365,8 +365,8 @@ export default {
|
||||
// this.listQuery.materialId = val.materialId ? val.materialId : undefined;
|
||||
// this.listQuery.startTime = '1706144404000';
|
||||
// this.listQuery.endTime = '1706230804000';
|
||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||
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;
|
||||
@@ -395,6 +395,11 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.baseTable {
|
||||
border-color: #D1D4DB;
|
||||
background-color: #F2F4F9;
|
||||
}
|
||||
.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||
background-color: #EAF1FC;
|
||||
}
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-04-18 15:07:53
|
||||
* @LastEditTime: 2024-04-24 09:58:07
|
||||
* @LastEditors: zhp
|
||||
* @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 :header-cell-style="{
|
||||
<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 in tableProps" :prop="item.prop" :label="item.label"
|
||||
align="center">
|
||||
<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"
|
||||
@@ -40,6 +39,8 @@ import {
|
||||
} 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 = [
|
||||
// {
|
||||
@@ -54,7 +55,7 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'dataType',
|
||||
label: '',
|
||||
label: '类型',
|
||||
width: '150',
|
||||
},
|
||||
{
|
||||
@@ -67,11 +68,16 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'area',
|
||||
label: '面积'
|
||||
label: '面积(㎡)'
|
||||
},
|
||||
{
|
||||
prop: 'rate',
|
||||
label: '占比%',
|
||||
label: '占比(%)',
|
||||
// filter: (val) => val == false ? '不合格' : '合格',
|
||||
},
|
||||
{
|
||||
prop: 'rateSum',
|
||||
label: '综合成品率(%)',
|
||||
// filter: (val) => val == false ? '不合格' : '合格',
|
||||
},
|
||||
// {
|
||||
@@ -129,7 +135,7 @@ export default {
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'checkTime',
|
||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||
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
|
||||
},
|
||||
{
|
||||
@@ -139,6 +145,7 @@ export default {
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'lineId',
|
||||
multiple:true,
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
@@ -167,8 +174,8 @@ export default {
|
||||
created() { },
|
||||
mounted() {
|
||||
// this.formConfig[1].defaultSelect[]
|
||||
this.listQuery.startTime = this.formConfig[0].defaultSelect[0]
|
||||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
||||
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()
|
||||
@@ -286,14 +293,15 @@ export default {
|
||||
// })
|
||||
this.tableData = response.data.map((ele) => {
|
||||
return {
|
||||
dataType: ele.dataType == 1 ? '成品' : ele.dataType == 2 ? '取样' : '废版',
|
||||
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,
|
||||
type: ele.type == '合计' ? '' : ele.type,
|
||||
pieces: ele.pieces,
|
||||
area: ele.area,
|
||||
rate: (ele.rate * 100).toFixed(2)
|
||||
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)
|
||||
@@ -357,8 +365,10 @@ export default {
|
||||
// this.listQuery.materialId = val.materialId ? val.materialId : undefined;
|
||||
// this.listQuery.startTime = '1706144404000';
|
||||
// this.listQuery.endTime = '1706230804000';
|
||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||
// 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;
|
||||
@@ -387,6 +397,10 @@ export default {
|
||||
};
|
||||
</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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user