Compare commits

...

38 Commits

Author SHA1 Message Date
526bb8c534 班组bug 2024-03-14 14:47:57 +08:00
57660ee5fd Merge pull request 'projects/mesxc-lb' (#242) from projects/mesxc-lb into projects/mesxc-test
Reviewed-on: #242
2024-03-14 09:03:49 +08:00
lb
764030a8da Merge branch 'projects/mesxc-test' into projects/mesxc-lb 2024-03-14 09:01:45 +08:00
2d7fc02e0b Merge pull request 'projects/mesxc-zhp' (#241) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #241
2024-03-14 08:45:24 +08:00
lb
d2e38be1e1 Merge branch 'projects/mesxc-test' into projects/mesxc-lb 2024-03-13 18:16:15 +08:00
lb
26d2e2b7e5 ui drawer ui change 2024-03-13 18:14:06 +08:00
lb
25f3c5d13b update 项目群更新 2024-03-13 17:04:36 +08:00
‘937886381’
0256306c0e Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-13 15:30:38 +08:00
‘937886381’
224625e10f 修改bug 2024-03-13 15:30:08 +08:00
e55198974d Merge pull request 'projects/mesxc-zhp' (#240) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #240
2024-03-13 14:57:25 +08:00
‘937886381’
680f852057 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-13 14:55:00 +08:00
‘937886381’
6025c8fbf7 修改bug 2024-03-13 14:54:35 +08:00
a4f5e75d3d Merge pull request 'projects/mesxc-dy' (#239) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #239
2024-03-13 09:17:11 +08:00
helloDy
149ec4c844 Merge branch 'projects/mesxc-test' into projects/mesxc-dy 2024-03-12 18:02:52 +08:00
helloDy
8045c303ee 维修 2024-03-12 18:02:16 +08:00
lb
3aee4a54fb Merge branch 'projects/mesxc-test' into projects/mesxc-lb 2024-03-12 15:50:41 +08:00
bf700b316e Merge pull request 'projects/mesxc-zhp' (#238) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #238
2024-03-12 11:22:06 +08:00
‘937886381’
4c9277b361 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-12 11:18:28 +08:00
‘937886381’
0457514f1e 修改bug 2024-03-12 11:18:06 +08:00
b23d7427bd Merge pull request 'projects/mesxc-zhp' (#237) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #237
2024-03-11 17:10:16 +08:00
‘937886381’
3be7ac4237 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-11 17:07:06 +08:00
‘937886381’
bddb182b73 修改bug 2024-03-11 17:06:38 +08:00
a74b3aa30a Merge pull request 'projects/mesxc-zhp' (#236) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #236
2024-03-11 15:53:13 +08:00
‘937886381’
8f0de8f0ba Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-11 15:48:19 +08:00
‘937886381’
df75aa04a1 修改bug 2024-03-11 15:47:46 +08:00
4531429e83 Merge pull request 'projects/mesxc-zhp' (#235) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #235
2024-03-08 18:48:29 +08:00
‘937886381’
756ed9772d Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-08 16:20:29 +08:00
‘937886381’
2e214b52a6 修改bug 2024-03-08 16:20:03 +08:00
a42f976127 Merge pull request 'projects/mesxc-zhp' (#234) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #234
2024-03-07 16:33:38 +08:00
‘937886381’
a81f961aca Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-07 16:28:50 +08:00
‘937886381’
39493549b9 修改bug 2024-03-07 16:28:23 +08:00
79394affb5 Merge pull request 'projects/mesxc-zhp' (#233) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #233
2024-03-06 11:06:58 +08:00
‘937886381’
2c06d68d72 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-03-06 11:02:00 +08:00
‘937886381’
e6e280c930 修改bug 2024-03-06 11:01:31 +08:00
354fd488a9 Merge pull request 'projects/mesxc-zhp' (#232) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #232
2024-03-05 10:07:27 +08:00
‘937886381’
a80ce13de1 解决冲突 2024-03-05 09:49:01 +08:00
‘937886381’
a027c4ca63 修改bug 2024-03-05 09:48:16 +08:00
267ee0015c Merge pull request 'projects/mesxc-zjl' (#231) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #231
2024-03-04 14:10:21 +08:00
63 changed files with 1649 additions and 1640 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-03-01 20:40:47
# @LastEditors: DY
# @LastEditTime: 2024-03-13 14:57:16
# @LastEditors: zhp
# @Description:
###
# 开发环境配置

View File

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2023-12-12 13:49:02
* @LastEditTime: 2024-01-24 15:54:58
* @LastEditTime: 2024-03-12 11:16:01
* @LastEditors: zhp
* @Description:
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,10 +1,10 @@
import axios from 'axios'
import {Message, MessageBox, Notification, Loading} from 'element-ui'
import { Message, MessageBox, Notification, Loading } from 'element-ui'
import store from '@/store'
import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import {getPath, getTenantEnable} from "@/utils/ruoyi";
import {refreshToken} from "@/api/login";
import { getPath, getTenantEnable } from "@/utils/ruoyi";
import { refreshToken } from "@/api/login";
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
const ignoreMsgs = [
@ -42,7 +42,7 @@ const service = axios.create({
let loadingInstance = null
function startLoading() {
loadingInstance = Loading.service({
fullscreen: false,
fullscreen: true,
text: '拼命加载中...',
background: 'rgba(0, 0, 0, 0.1)'
})
@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
const part = encodeURIComponent(propName) + '='
if (value !== null && typeof(value) !== "undefined") {
if (value !== null && typeof (value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';
@ -104,9 +104,9 @@ service.interceptors.request.use(config => {
}
return config
}, error => {
tryHideFullScreenLoading()
console.log(error)
Promise.reject(error)
tryHideFullScreenLoading()
console.log(error)
Promise.reject(error)
})
// 响应拦截器
@ -189,23 +189,23 @@ service.interceptors.response.use(async res => {
return res.data
}
}, error => {
tryHideFullScreenLoading()
console.log('err' + error)
let {message} = error;
if (message === "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
tryHideFullScreenLoading()
console.log('err' + error)
let { message } = error;
if (message === "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
)
export function getBaseHeader() {
@ -219,10 +219,10 @@ function handleAuthorized() {
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-02-29 15:48:47
* @LastEditTime: 2024-03-12 09:05:20
* @Description:
-->
<template>
@ -870,6 +870,8 @@ export default {
</script>
<style lang="scss" scoped>
.visual-container {
width: 1920px;
height: 1080px;
@ -886,14 +888,16 @@ export default {
position: relative;
.unit{
position: absolute;
left: 260px;
left: 290px;
top:25px;
color: rgba($color: #ffffff, $alpha: 8);
font-size: 20px;
}
.time{
position: absolute;
left: 1360px;
top:25px;
color: rgba($color: #ffffff, $alpha: 8);
font-size: 20px;
}
.title-button {

View File

@ -1,17 +1,11 @@
<!--
* @Author: zhp
* @Date: 2024-01-29 16:50:26
* @LastEditTime: 2024-02-29 15:48:11
* @LastEditTime: 2024-03-13 09:07:37
* @LastEditors: zhp
* @Description:
-->
<!--
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-01-29 17:05:37
* @Description:
-->
<template>
<div id="container" ref="container" class="visual-container" :style="styles">
<el-row class="container-title" :style="{
@ -19,7 +13,7 @@
lineHeight: 88 + 'px',
fontSize: 31 + 'px'
}">
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
<img src="../../assets/img/logo.png" style="width:1.1em;position:relative;top:.22em" alt="">
许昌安彩冷端看板
<h3 class="unit">单位河南汇融数字科技有限公司</h3>
<h3 class="time">{{ times }}</h3>
@ -715,7 +709,7 @@ export default {
`<span style="color:rgba(255,255,255,0.7)">${this.getSize(item.size) || ''}</span>`,
`<span style="color:rgba(255,255,255,0.7)">${item.productArea + '㎡' || ''}</span>`,
`<span style="color:rgba(255,255,255,0.7)">${item.wasteArea + '㎡' || ''}</span>`,
`<div style = "${(item.product * 100).toFixed(2) > 91 ? 'display:block;color:rgba(255,255,255,0.7)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>
`<div style = "${(item.product * 100).toFixed(2) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>
<div style = "${(item.product * 100).toFixed(2) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>`
])
this.cutConfig.data = cutArr

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-29 13:45:56
* @LastEditTime: 2024-02-18 14:20:01
* @LastEditTime: 2024-03-13 08:58:01
* @LastEditors: zhp
* @Description:
-->
@ -87,7 +87,7 @@ export default {
legend: {
bottom: '10%',
left: 'center',
itemWidth: 20,
itemWidth: 12,
itemHeight:12,
icon: 'rect',
textStyle: {

View File

@ -24,7 +24,7 @@
<div class="bar-item">
<div v-if="title" class="bar-title" ds>
<span>
<svg-icon :icon-class="titleIcon" style="font-size: 1em; position: relative; top: .08em" />
<svg-icon :icon-class="titleIcon" style="font-size: 1em; position: relative; top: .01em" />
{{ title }}
</span>
<!-- <span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-02-01 15:52:41
* @LastEditTime: 2024-03-13 08:51:12
* @LastEditors: zhp
* @Description:
-->
@ -172,7 +172,7 @@ export default {
axisLine: {
lineStyle: {
type: 'solid',
color: '#213259', // 线
color: '#25528f',
width: '1' // 线
}
},
@ -186,7 +186,7 @@ export default {
},
splitLine: {
lineStyle: {
color: '#213259'
color: '#25528f'
}
},
data: nameList
@ -215,7 +215,7 @@ export default {
show: true,
lineStyle: {
type: 'solid',
color: '#213259', // 线
color: '#25528f',
width: '1' // 线
}
},
@ -228,7 +228,7 @@ export default {
},
splitLine: {
lineStyle: {
color: '#213259'
color: '#25528f'
}
}
// type: 'value'
@ -260,7 +260,7 @@ export default {
show: true,
lineStyle: {
type: 'solid',
color: '#213259', // 线
color: '#25528f', // 线
width: '1' // 线
}
},
@ -275,7 +275,7 @@ export default {
},
splitLine: {
lineStyle: {
color: '#213259'
color: '#25528f'
}
}
// type: 'value'

View File

@ -145,7 +145,7 @@ export default {
axisLine: {
lineStyle: {
type: 'solid',
color: '#213259', // 线
color: '#25528f', // 线
width: '1' // 线
}
},
@ -156,7 +156,7 @@ export default {
},
splitLine: {
lineStyle: {
color: '#213259'
color: '#25528f'
}
},
data: this.nameList
@ -172,17 +172,17 @@ export default {
axisLabel: {
color: "#fff",
fontSize: 12,
formatter: '{value}/kwh'
// formatter: '{value}/kwh'
},
axisLine: {
show: true,
lineStyle: {
color: "#213259",
color: "#25528f",
},
},
splitLine: {
lineStyle: {
color: "#213259a0",
color: "#25528f",
},
}
},

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-27 13:54:52
* @LastEditTime: 2024-02-21 14:38:54
* @LastEditTime: 2024-03-13 09:04:11
* @LastEditors: zhp
* @Description:
-->
@ -170,8 +170,8 @@ export default {
// }
this.chart.setOption({
legend: {
// top: '2.5%',
// right: '20px',
itemWidth: 12,
itemHeight: 12,
icon: 'rect',
textStyle: {
color: '#ffffff'

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-02-23 16:11:48
* @LastEditTime: 2024-03-12 09:34:06
* @Description:
-->
<template>
@ -632,12 +632,12 @@ export default {
])
this.eqConfig.data = eqArr
this.$refs['eqScrollBoard'].updateRows(eqArr)
this.$refs.productLineChart.initChart(['D61', 'D62', 'D63', 'D64', 'D65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
this.getList()
this.initWebSocket()
this.SJGInitWebSocket()
this.getTimes()
// this.$refs.EnergyMonitoringChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [3134, 2323, 3232, 3233, 2321])
// this.$refs.productLineChart.initChart(['Y61', 'Y62', 'Y63', 'Y64', 'Y65',], [98, 97, 98.7, 98.5, 98.3,], [3134, 2323, 3232, 3233, 2321])
const _this = this;
_this.beilv2 = document.documentElement.clientWidth / 1920
window.onresize = () => {
@ -699,22 +699,22 @@ export default {
])
this.processConfig.data = processArr
this.$refs['processScrollBoard'].updateRows(processArr)
if (res.data.length !==0) {
let processArr = res.data.map((item, index) => [
// console.log(item)
`<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.productionLineName || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
])
this.processConfig.data = processArr
this.$refs['processScrollBoard'].updateRows(processArr)
}
// if (res.data.length !==0) {
// let processArr = res.data.map((item, index) => [
// // console.log(item)
// `<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.productionLineName || ''}
// </span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.count || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''}</span>`,
// ])
// this.processConfig.data = processArr
// this.$refs['processScrollBoard'].updateRows(processArr)
// }
})
},
getTimes() {
@ -982,6 +982,8 @@ export default {
</script>
<style lang="scss" scoped>
.visual-container {
width: 1920px;
height: 1080px;
@ -993,12 +995,15 @@ export default {
background: url('../../assets/img/OperationalOverview/title.png') no-repeat;
background-size: 100% 100%;
color: #00fff0;
word-spacing: 8px;
// word-spacing: 8px;
letter-spacing: 8px;
text-align: center;
.unit {
position: absolute;
left: 260px;
left: 290px;
top: 25px;
letter-spacing: 0px;
color: rgba($color: #ffffff, $alpha: 8);
font-size: 20px;
}
@ -1006,6 +1011,8 @@ export default {
position: absolute;
left: 1360px;
top: 25px;
letter-spacing: 0px;
color: rgba($color: #ffffff, $alpha: 8);
font-size: 20px;
}
.title-button {

View File

@ -6,41 +6,58 @@
-->
<template>
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
custom-class="mes-drawer" size="50%" @closed="$emit('destroy')">
<!-- <el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
custom-class="mes-drawer" size="50%" @closed="$emit('destroy')"> -->
<el-dialog
:visible.sync="visible"
width="50%"
:before-close="closed">
<small-title slot="title" :no-padding="true">
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
详情
<!-- {{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }} -->
</small-title>
<div class="drawer-body flex">
<div class="drawer-body__content">
<div>
<el-row :gutter="20">
<el-col :span="8">
<el-col :span="6">
<div class="blodTip">故障发生时间</div>
<div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div>
</el-col>
<el-col :span="8">
<el-col :span="6">
<div class="blodTip">故障级别</div>
<div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div>
</el-col>
<el-col :span="8">
<el-col :span="6">
<div class="blodTip">故障类型</div>
<div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-col :span="6">
<div class="blodTip">维修工</div>
<div class="lightTip">{{ dataForm.repairman }}</div>
</el-col>
<el-col :span="8">
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<div class="blodTip">联系方式</div>
<div class="lightTip">{{ dataForm.repairmanPhone }}</div>
</el-col>
<el-col :span="8">
<el-col :span="6">
<div class="blodTip">维修方式</div>
<div class="lightTip">{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(dataForm.createTime) }}</div>
</el-col>
<el-col :span="6">
<div class="blodTip">创建人</div>
<div class="lightTip">{{ dataForm.creator }}</div>
</el-col>
</el-row>
<el-row>
<div class="blodTip">备注</div>
<div class="lightTip">{{ dataForm.remark }}</div>
</el-row>
<el-row>
<div class="blodTip">维修附件</div>
@ -55,20 +72,6 @@
</div>
<p v-else>暂无附件</p>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">创建时间</div>
<div class="lightTip">{{ parseTime(dataForm.createTime) }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">创建人</div>
<div class="lightTip">{{ dataForm.creator }}</div>
</el-col>
</el-row>
<el-row>
<div class="blodTip">备注</div>
<div class="lightTip">{{ dataForm.remark }}</div>
</el-row>
</div>
<!-- <el-divider style="margin-top: -10px" />
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
@ -143,13 +146,17 @@
</el-row>
</el-form> -->
<div v-if="!disabled" class="drawer-body__footer">
<!-- <div v-if="!disabled" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div> -->
</div>
</div>
</el-drawer>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</el-dialog>
<!-- </el-drawer> -->
</template>
<script>
@ -254,6 +261,9 @@ export default {
},
mounted() { },
methods: {
closed() {
this.$emit('destroy')
},
setFileName(val) {
this.fileName = val
},
@ -373,7 +383,7 @@ export default {
.drawer-body__content {
flex: 1;
/* background: #eee; */
padding: 20px 30px;
padding: 5px 10px;
overflow-y: auto;
}

View File

@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-12-14 14:03:27
* @LastEditors: zhp
* @LastEditTime: 2024-03-08 09:14:38
* @Description:
-->
<template>
@ -224,6 +224,7 @@ export default {
this.equipmentList.forEach((ele) => {
if (val === ele.id) {
this.dataForm.equipmentCode = ele.code
console.log(this.dataForm.equipmentCode);
}
})
},
@ -336,16 +337,17 @@ export default {
pageSize:10
}).then(response => {
this.dataForm = response.data
this.getCode(response.data.equipmentId)
// this.dataForm.unit = String(this.dataForm.unit)
// this.dataForm.ValueType = String(this.dataForm.ValueType)
// this.dataForm.productType = String(this.dataForm.productType)
});
//
this.getList();
this.getList()
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
// if (this.urlOptions.isGetCode) {
// this.getCode()
// }
}
});
},

View File

@ -2,11 +2,7 @@
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-form-item label="员工" prop="workerId" v-if='!isEdit'>
<el-select v-model="form.workerId" placeholder="请选择" filterable style="width: 100%;" @change="selectWorker()">
<el-option
v-for="item in workerList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-option v-for="item in workerList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -48,12 +44,12 @@ export default {
this.form.teamId = param.teamId
this.form.majorName = param.majorName
this.workName = param.workName
otherWorkerList({teamId:this.form.teamId}).then(res => {
otherWorkerList({ teamId: this.form.teamId }).then(res => {
this.workerList = res.data || []
if (param.id) {
this.isEdit = true
this.form.id = param.id
groupTeamDet({id: this.form.id}).then((res) => {
groupTeamDet({ id: this.form.id }).then((res) => {
if (res.code === 0) {
this.form.workerId = res.data.workerId
this.form.remark = res.data.remark
@ -72,7 +68,7 @@ export default {
this.form.majorName = item.majorName
}
})
}else{
} else {
this.form.majorName = ''
}
},

View File

@ -9,18 +9,15 @@
</el-col>
<el-col :span="6">
<p class="boldTitle">车间名称</p>
<p class="lightText">{{ (queryParams.roomNameDict || queryParams.roomNameDict === 0) ? getDictDataLabel('workshop',queryParams.roomNameDict) : '-' }}</p>
<p class="lightText">{{ (queryParams.roomNameDict || queryParams.roomNameDict === 0) ?
getDictDataLabel('workshop', queryParams.roomNameDict) : '-' }}</p>
</el-col>
<el-col :span="6">
<p class="boldTitle">班组名称</p>
<p class="lightText">{{ queryParams.teamName ? queryParams.teamName : '-' }}</p>
</el-col>
</el-row>
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
<base-table :table-props="tableProps" :table-data="tableData" :max-height="tableH" :page="1" :limit="1000000" />
</div>
</el-drawer>
</div>
@ -47,7 +44,7 @@ const tableProps = [
},
{
prop: 'workTime',
label: '工作时长'
label: '工作时长(h)'
}
]
export default {
@ -83,21 +80,24 @@ export default {
<style lang="scss" scoped>
.box {
padding: 0 32px;
.topBox {
padding-bottom: 30px;
margin-bottom: 30px;
border-bottom: 1px solid #E9E9E9;
.boldTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
color: rgba(0, 0, 0, 0.85);
margin: 0;
margin-bottom: 10px;
}
.lightText {
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
color: rgba(102, 102, 102, 0.75);
margin: 0;
}
}

View File

@ -2,28 +2,20 @@
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="班次信息">
<el-select v-model="queryParams.classesId" placeholder="班次信息" style="width: 200px;" size="small" clearable>
<el-option
v-for="item in classesArr"
:key="item.id"
:label="(item.roomName?item.roomName:'')+'-'+item.name"
:value="item.id">
<span>{{ item.roomName }}-{{item.name}}</span>
<el-select v-model="queryParams.classesId" placeholder="班次信息" style="width: 200px;" size="small" clearable
filterable>
<el-option v-for="item in classesArr" :key="item.id"
:label="(item.roomName ? item.roomName : '') + '-' + item.name" :value="item.id">
<span>{{ item.roomName }}-{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="班组信息">
<el-input v-model="queryParams.teamName" placeholder="班组信息" style="width: 200px;" clearable></el-input>
</el-form-item>
<el-form-item label="上班时间">
<el-date-picker
v-model="queryParams.tiemStr"
type="daterange"
format='yyyy-MM-dd'
value-format='yyyy-MM-dd'
range-separator='-'
style="width: 250px;"
size="small">
<el-form-item label="上班日期">
<el-date-picker v-model="queryParams.tiemStr" type="daterange" format='yyyy-MM-dd' value-format='yyyy-MM-dd'
range-separator='-' style="width: 250px;" size="small">
</el-date-picker>
</el-form-item>
<el-form-item>
@ -69,6 +61,7 @@ export default {
font-size: 16px;
color: #0B58FF;
}
.el-input__prefix .el-icon-date {
font-size: 16px;
color: #0B58FF;
@ -83,6 +76,7 @@ export default {
background: #E8E8E8;
vertical-align: middle;
}
.demo-form-inline {
.blue-block {
display: inline-block;

View File

@ -1,12 +1,8 @@
<template>
<div>
<el-drawer title="查看详情" :visible.sync="visible" size="70%" :wrapperClosable='false' @closed="closeDrawer">
<el-drawer title="生产情况" :visible.sync="visible" size="70%" @closed="closeDrawer" :show-close='false'>
<div class="box">
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
<base-table :table-props="tableProps" :table-data="tableData" :max-height="tableH" />
</div>
</el-drawer>
</div>
@ -53,7 +49,7 @@ export default {
init(params) {
this.visible = true
// console.log(params)
getByScheduling({id:params.id}).then(res => {
getByScheduling({ id: params.id }).then(res => {
let dataList1 = []
let dataList2 = []
if (res.data.nameData && res.data.nameData.length > 0) {
@ -90,11 +86,11 @@ export default {
timeArr.push(this.parseTime(item.name))
tablePropsObj.prop = item.name
tablePropsObj.label = this.parseTime(item.name)
tablePropsObj.children[0].prop = item.name+'sumInput'
tablePropsObj.children[1].prop = item.name+'sumOutput'
tablePropsObj.children[2].prop = item.name+'goodArea'
tablePropsObj.children[3].prop = item.name+'dynamicValue'
tablePropsObj.children[4].prop = item.name+'dynamicRatio'
tablePropsObj.children[0].prop = item.name + 'sumInput'
tablePropsObj.children[1].prop = item.name + 'sumOutput'
tablePropsObj.children[2].prop = item.name + 'goodArea'
tablePropsObj.children[3].prop = item.name + 'dynamicValue'
tablePropsObj.children[4].prop = item.name + 'dynamicRatio'
this.tableProps.push(tablePropsObj)
})
getSchedulingMonitoringRecord({
@ -111,15 +107,15 @@ export default {
obj.workOrderList = dataList1.data[i].workOrderList
let subData1 = dataList1.data[i].data
for (let ii = 0; ii < subData1.length; ii++) {
obj[subData1[ii].dynamicName+'sumInput'] = subData1[ii].dynamicValue.sumInput
obj[subData1[ii].dynamicName+'sumOutput'] = subData1[ii].dynamicValue.sumOutput
obj[subData1[ii].dynamicName+'goodArea'] = subData1[ii].dynamicValue.goodArea
obj[subData1[ii].dynamicName + 'sumInput'] = subData1[ii].dynamicValue.sumInput
obj[subData1[ii].dynamicName + 'sumOutput'] = subData1[ii].dynamicValue.sumOutput
obj[subData1[ii].dynamicName + 'goodArea'] = subData1[ii].dynamicValue.goodArea
}
for (let j = 0; j < dataList2.data.length; j++) {
let subData2 = dataList2.data[j].data
for (let jj = 0; jj < subData2.length; jj++) {
obj[subData2[jj].dynamicName+'dynamicValue'] = subData2[jj].dynamicValue
obj[subData2[jj].dynamicName+'dynamicRatio'] = obj[subData2[jj].dynamicName+'dynamicValue'] / obj[subData2[jj].dynamicName+'sumOutput']
obj[subData2[jj].dynamicName + 'dynamicValue'] = subData2[jj].dynamicValue
obj[subData2[jj].dynamicName + 'dynamicRatio'] = obj[subData2[jj].dynamicName + 'dynamicValue'] / obj[subData2[jj].dynamicName + 'sumOutput']
}
}
this.tableData.push(obj)

View File

@ -1,37 +1,22 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-area @submit="buttonClick"/>
<search-area @submit="buttonClick" />
<!-- <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/> -->
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
<!-- 查看生产情况 -->
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' />
</div>
</template>
<script>
@ -86,38 +71,6 @@ export default {
name: 'GroupTeamScheduling',
data() {
return {
formConfig: [
{
type: 'select',
label: '班次信息',
selectOptions: [],
param: 'classesId'
},
{
type: 'input',
label: '班组信息',
placeholder: '班组信息',
param: 'teamName'
},
{
type: 'datePicker',
label: '上班日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
// valueFormat: "timestamp",
param: 'tiemStr',
defaultSelect: '',
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
//
queryParams: {
pageNo: 1,
@ -128,11 +81,12 @@ export default {
},
tableProps,
tableBtn: [
this.$auth.hasPermi('base:team-production:detail')
this.$auth.hasPermi('base:team-production:detail')
? {
type: 'detail',
btnName: '详情'
}
type: 'productionDetail',
btnName: '查看',
showTip: '生产情况'
}
: undefined
].filter((v) => v),
list: [],
@ -158,7 +112,7 @@ export default {
this.getList()
},
getList() {
groupTeamSchedulingPage({...this.queryParams}).then(res => {
groupTeamSchedulingPage({ ...this.queryParams }).then(res => {
console.log(res)
this.list = res.data.list || []
this.total = res.data.total || 0

View File

@ -11,7 +11,7 @@
<el-col :span="12">
<el-form-item label="产线" prop="productionLineId"
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="dataForm.productionLineId" placeholder="请选择产线" filterable
<el-select v-model="dataForm.productionLineId" placeholder="请选择产线" filterable :disabled="disabled"
@change="handleProductlineChange">
<el-option v-for="opt in productionLineList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
@ -19,7 +19,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="工段" prop="sectionId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
<el-select v-model="dataForm.sectionId" placeholder="请选择工段" filterable @change="$emit('update', dataForm)">
<el-select :disabled="disabled" v-model="dataForm.sectionId" placeholder="请选择工段" filterable
@change="$emit('update', dataForm)">
<el-option v-for="opt in workshopSectionList" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
@ -109,15 +110,18 @@ export default {
productionLineId: null,
inspectionDetIdList:[],
},
disabled:false,
formLoading: true,
productionLineList: [],
inspectionDetList:[],
workshopSectionList: [],
};
},
mounted() {
this.getProductionLineList()
this.getQualityInspectionDetList()
},
created () {
},
mounted() {
// this.getList()
// this.getWorksectionList();
// this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
@ -139,11 +143,14 @@ export default {
methods: {
init(obj) {
// console.log(productionLineId);
console.log(obj);
console.log(obj)
this.getProductionLineList()
this.getQualityInspectionDetList()
this.visible = true
// if(obj.id)
if (obj) {
this.dataForm.id = obj.id || null;
this.disabled = true
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields()
@ -163,7 +170,6 @@ export default {
console.log(1111);
this.urlOptions.infoURL(obj.id).then(response => {
this.dataForm.id = response.data.id
// if (this.setData) {
// this.setDataForm()
// }

View File

@ -97,11 +97,13 @@ export default {
// },
{
prop: 'productionLineName',
label: '产线',
label: '产线',
width:120,
},
{
prop: 'sectionName',
label: '工段',
label: '工段',
width: 120,
},
{
prop: 'inspectionInfoList',

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-03-01 15:22:06
* @LastEditTime: 2024-03-12 14:54:05
* @LastEditors: zhp
* @Description:
-->
@ -58,7 +58,8 @@
<el-col :span="8">
<el-form-item label="检测时间" prop="checkTime"
:rules="[{ required: true, message: '检测时间不能为空', trigger: 'change' }]">
<el-date-picker v-model="dataForm.checkTime" type="datetime" placeholder="选择检测时间">
<el-date-picker value-format="timestamp" v-model="dataForm.checkTime" type="datetime"
placeholder="选择检测时间">
</el-date-picker>
</el-form-item>
</el-col>
@ -80,7 +81,7 @@
<el-col :span="8">
<el-form-item :prop="'checkValueList.' + index + '.checkValue'" label="成分含量"
:rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]">
<el-input oninput="value=value.replace(/[^\d]/g,'')" :disabled="isdetail"
<el-input oninput="value=value.replace(/[^\d]/g,'')" :disabled="isdetail"
style="width: 90%;margin-right: 10px;" :max="item.maxValue" :min='item.minValue'
v-model.number="dataForm.checkValueList[index].checkValue"
@change="judgeValue(arguments[0],item.minValue,item.maxValue,index)"></el-input>

View File

@ -188,8 +188,8 @@ export default {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.content = val.content ? val.content : undefined;
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
this.listQuery.materialId = val.materialId ? val.materialId : undefined;
// this.listQuery.typeId = val.typeId ? val.typeId : undefined;
this.getDataList();
break;
case 'reset':

View File

@ -22,8 +22,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="报废时间" prop="logTime">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期">
<el-date-picker v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>

View File

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2024-02-28 09:51:25
* @LastEditTime: 2024-02-28 10:05:00
* @LastEditTime: 2024-03-08 13:46:46
* @LastEditors: zhp
* @Description:
*/
@ -41,7 +41,7 @@ export default {
console.log(response)
this.dataForm = response.data
this.dataForm.detId = response.data.detIdList
this.dataForm.logTime = new Date(response.data.createTime)
this.dataForm.logTime = new Date(response.data.logTime)
// if (this.setData) {
// this.setDataForm()

View File

@ -36,7 +36,7 @@ const tableProps = [
// filter: parseTime
// },
{
prop: 'logTime',
prop: 'createTime',
label: '报废时间',
filter: parseTime
},

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-11-06 15:15:30
* @LastEditTime: 2023-12-01 16:33:41
* @LastEditTime: 2024-03-08 08:38:25
* @LastEditors: zhp
* @Description:
-->
@ -22,7 +22,7 @@
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="描述类型" prop="description" label-width="110px">
<el-form-item label="报废类型描述" prop="description" label-width="110px">
<el-input v-model="dataForm.description" clearable placeholder="描述类型" />
</el-form-item>
</el-col>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-01-24 15:38:53
* @LastEditTime: 2024-03-13 15:21:30
* @LastEditors: zhp
* @Description:
-->
@ -21,7 +21,7 @@
</el-form-item>
</el-form>
</div>
<inputTable :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType"
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType"
@refreshDataList="getDataList" />
<!-- <pagination
:limit.sync="listQuery.pageSize"
@ -52,7 +52,8 @@ export default {
total: 0,
reportType: 2,
reportTime: []
},
},
date:'许昌安彩日原片生产汇总',
reportTime: '',
startTimeStamp: '',
endTimeStamp: '',
@ -62,22 +63,50 @@ export default {
};
},
created() {
this.getDict()
this.getDict()
this.getTodayStartTimeAndEndTime()
this.getDataList()
},
methods: {
methods: {
getTodayStartTimeAndEndTime() {
this.reportTime = new Date()
this.changeTime(this.reportTime)
},
async getDict() {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
//
//
multipliedByHundred(str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
},
async getDataList() {
this.dataListLoading = true;
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
item.lineName = it.name
if (item.lineId === it.id) {
item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
}
})
if (item.det === false) {
@ -113,7 +142,7 @@ export default {
// console.log(val.setHours(7, 0, 0))
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// let time = this.format(val.setHours(7, 0, 0))
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
console.log(this.listQuery.reportTime);
} else {
@ -154,7 +183,7 @@ export default {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '原片生产报.xls');
this.$download.excel(response, '原片生产报.xls');
this.exportLoading = false;
}).catch(() => { });
}

View File

@ -1,46 +1,33 @@
<!--
* @Author: Do not edit
* @Date: 2023-12-13 14:10:04
* @LastEditTime: 2023-12-14 10:18:20
* @LastEditors: DY
* @Description:
* @LastEditTime: 2024-03-13 15:27:43
* @LastEditors: zhp
* @Description:
-->
<template>
<div>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="edit = true">编辑</el-button>
<el-button v-if="!edit" size="small" @click="edit = true">编辑</el-button>
<el-button v-if="edit" size="small" @click="edit= false">返回</el-button>
<el-button v-if="edit" size="small" @click="updateData">保存</el-button>
</el-row>
<el-table
:data="data"
border
show-summary
style="width: 100%">
<el-table-column
v-for="(item, index) in cols"
:key="index" :prop="item.prop"
:label="item.label"
<el-table :data="data" border show-summary style="width: 100%">
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
:align="item.align ? item.align : 'left'">
<el-table-column
v-for="(it, index1) in item.children"
:key="index1"
:prop="it.prop"
:label="it.label"
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
:align="item.align ? item.align : 'left'">
<el-table-column
v-for="(y, index2) in it.children"
:key="index2"
:prop="y.prop"
:label="y.label">
<template slot-scope="scope">
<span v-if="!edit">{{ scope.row[y.prop] }}</span>
<el-input v-else v-model.number="scope.row[y.prop]"></el-input>
</template>
<el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
<template slot-scope="scope">
<span v-if="!edit">{{ scope.row[y.prop] }}</span>
<el-input v-else v-model="scope.row[y.prop]"></el-input>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
</el-table>
<el-input type="textarea" v-model="sum.remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}"></el-input>
<el-input type="textarea" v-model="sum.remark" placeholder="备注" :disabled="!edit"
:autosize="{ minRows: 2, maxRows: 6}"></el-input>
</div>
</template>
@ -92,6 +79,7 @@ const cols = [
{
prop: 'originalGlassStatisticsTrend',
label: '增减',
// filter:(v)=>{v + '%'}
}
]
},
@ -111,6 +99,7 @@ const cols = [
{
prop: 'actualProductTrend',
label: '增减',
// filter: (v) => { v + '%' }
}
]
},
@ -145,6 +134,10 @@ const cols = [
type: Array,
default: () => [],
},
date: {
type: String,
default:''
},
sum: {
type: Object,
default: () => {},
@ -165,9 +158,9 @@ const cols = [
immediate: true,
handler(newv, oldv) {
if (newv[0] !== '') {
this.cols[0].label = '许昌安彩周原片生产汇总' + '(' + newv[0] + '-' + newv[1] + ')'
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
} else {
this.cols[0].label = '许昌安彩周原片生产汇总'
this.cols[0].label = this.date
}
}
},
@ -183,6 +176,10 @@ const cols = [
text1 = '本月'
text2 = '上月'
text3 = '原片合计(片/月)'
} else if (newv === 2) {
text1 = '今日'
text2 = '昨日'
text3 = '原片合计(片/日)'
} else {
text1 = '本年'
text2 = '上年'
@ -200,14 +197,20 @@ const cols = [
},
methods: {
updateData() {
this.data.forEach((ele, index) => {
delete ele.dailyOutputTrend
delete ele.originalGlassStatisticsTrend
delete ele.actualProductTrend
delete ele.originalGlassPassTrend
});
updateGlass(this.data).then(response => {
updateGlassRemark(this.sum).then(res => {
this.$modal.msgSuccess("修改成功");
this.edit = false;
this.edit = false;
this.$emit("refreshDataList");
});
});
}
}
};
</script>
</script>

View File

@ -1,33 +1,27 @@
<template>
<div class="app-container">
<div>
<el-form
:model="listQuery"
:inline="true"
ref="dataForm"
class="blueTip">
<el-form-item label="月" prop="reportTime">
<el-date-picker
v-model="reportTime"
type="month"
size="small"
@change="changeTime"
placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('report:glass-month:query')" type="primary" size="small" @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType" @refreshDataList="getDataList" />
<!-- <pagination
<div class="app-container">
<div>
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="月" prop="reportTime">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('report:glass-month:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
:type="listQuery.reportType" @refreshDataList="getDataList" />
<!-- <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> -->
</div>
</div>
</template>
<script>
@ -50,7 +44,8 @@ export default {
total: 0,
reportType: 4,
reportTime: []
},
},
date: '许昌安彩月原片生产汇总',
reportTime: '',
startTimeStamp: '',
endTimeStamp: '',
@ -59,15 +54,25 @@ export default {
all: {}
};
},
created() {
this.getDict()
created() {
this.getCurrentMonthFirst()
this.getDict()
this.getDataList()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
},
getCurrentMonthFirst() {
const date = new Date();
date.setDate(1);
this.reportTime = date
// console.log(date)
this.changeTime(date)
// console.log(date.valueOf());
},
//
async getDataList() {
this.dataListLoading = true;
@ -75,7 +80,11 @@ export default {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
item.lineName = it.name
item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
}
})
if (item.det === false) {
@ -90,30 +99,41 @@ export default {
this.dataListLoading = false;
});
},
changeTime(val) {
changeTime(val) {
console.log(val)
if(val) {
const timeStamp = val.getMonth(); //
const fullyear = val.getFullYear()
let days = 0
switch (timeStamp) {
case 0, 2, 4, 6, 7, 9, 11:
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3, 4, 8, 10:
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear() % 4 === 0 && fullyear() % 100 !== 0)) {
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
}
break
}
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 23, 59, 59).getTime()); //
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).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
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 = []
}

View File

@ -1,35 +1,29 @@
<template>
<div class="app-container">
<!-- <search-bar
<div class="app-container">
<!-- <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" /> -->
<div>
<el-form
:model="listQuery"
:inline="true"
ref="dataForm"
class="blueTip">
<el-form-item label="周" prop="reportTime">
<el-date-picker
v-model="reportTime"
type="week"
size="small"
@change="changeTime"
:picker-options="{firstDayOfWeek: 1}"
:format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px"
placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:query')" type="primary" size="small" @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType" @refreshDataList="getDataList" />
</div>
<div>
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="周" prop="reportTime">
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}"
:format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp" style="width: 350px"
placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
:type="listQuery.reportType" @refreshDataList="getDataList" />
</div>
</template>
<script>
@ -52,7 +46,8 @@ export default {
total: 0,
reportType: 3,
reportTime: []
},
},
date: '许昌安彩周原片生产汇总',
reportTime: '',
startTimeStamp: '',
endTimeStamp: '',
@ -93,9 +88,11 @@ export default {
},
mounted() {
// const day = new Date().getDay()
// console.log('', day)
// console.log('', day)
this.getCurrentWeekStartTimeAndEndTime()
// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
this.getDict()
this.getDict()
this.getDataList()
},
methods: {
async getDict() {
@ -104,7 +101,69 @@ export default {
this.proLineList = res.data;
// this.getDataList()
});
},
},
getCurrentWeekStartTimeAndEndTime() {
this.reportTime = new Date()
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
// console.log(weekday[this.reportTime.getDay()]);
if (weekday[this.reportTime.getDay()] === 'Monday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime())
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
}
},
//
async getDataList() {
this.dataListLoading = true;
@ -112,7 +171,11 @@ export default {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
item.lineName = it.name
item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
}
})
if (item.det === false) {
@ -127,14 +190,15 @@ export default {
this.dataListLoading = false;
});
},
changeTime(val) {
changeTime(val) {
console.log(val);
if(val) {
let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //
console.log(this.startTimeStamp, this.endTimeStamp)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 00:00:00').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 23:59:59').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.listQuery.reportTime = []
}

View File

@ -1,31 +1,24 @@
<template>
<div class="app-container">
<div>
<el-form
:model="listQuery"
:inline="true"
ref="dataForm"
class="blueTip">
<el-form-item label="年" prop="reportTime">
<el-date-picker
v-model="reportTime"
type="year"
size="small"
@change="changeTime"
:picker-options="{firstDayOfWeek: 1}"
:format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px"
placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('report:glass-year:query')" type="primary" size="small" @click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType" @refreshDataList="getDataList" />
</div>
<div class="app-container">
<div>
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="年" prop="reportTime">
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('report:glass-year:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
:type="listQuery.reportType" @refreshDataList="getDataList" />
</div>
</template>
<script>
@ -48,7 +41,8 @@ export default {
total: 0,
reportType: 5,
reportTime: []
},
},
date: '许昌安彩年原片生产汇总',
reportTime: '',
startTimeStamp: '',
endTimeStamp: '',
@ -57,10 +51,25 @@ export default {
all: {},
};
},
created() {
created() {
this.getDict()
},
methods: {
},
mounted () {
this.getCurrentYearFirst()
this.getDataList()
;
},
methods: {
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
},
async getDict() {
// 线
const res = await getCorePLList();
@ -72,7 +81,11 @@ export default {
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
if (item.lineId === it.id) {
item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.lineName = it.name
}
})
@ -91,10 +104,10 @@ export default {
changeTime(val) {
if(val) {
// let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 23, 59, 59).getTime()); //
this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 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, 23, 59, 59).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 7, 0, 0).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 = []
}

View File

@ -1,15 +1,15 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-01 15:26:38
* @LastEditTime: 2024-03-13 15:28:18
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form :inline="true" :model="listQuery" class="demo-form-inline">
<el-form-item label="日" prop="reportTime">
<el-date-picker v-model="dataForm.reportTime" @change="changeTime" type="date" placeholder="选择日期">
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
@ -24,104 +24,111 @@
background: '#F2F4F9',
color: '#606266'
}">
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
<el-table-column prop="lineId" label="生产线">
<el-table-column :label="'许昌安彩日成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineName" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineId }} </span>
<el-input v-if="!disabled" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡">
<el-table-column prop="inputNow" label="本周">
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上周">
<el-table-column prop="inputHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减">
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span>
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' :
undefined}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量">
<el-table-column prop="goodProductNow" label="本周">
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上周">
<el-table-column prop="goodProductHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减">
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) +
'%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率">
<el-table-column prop="missCheckNow" label="本周">
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上周">
<el-table-column prop="missCheckHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减">
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' :
undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率">
<el-table-column prop="goodProductPassNow" label="本周">
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上周">
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减">
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) +
'%' : undefined }}
</span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<div style="height: 50px;" class="remark" slot="append">
<h3 style="float: left;text-align: center;margin-left: 20px;">备注</h3>
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input>
<span v-else>{{ remark }} </span>
</div>
</el-table>
<!-- 搜索工作栏 -->
@ -151,12 +158,12 @@ import {
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine';
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
{
// width: 128,
prop: 'lineId',
prop: 'lineName',
label: '生产线',
},
{
@ -167,11 +174,11 @@ const tableProps = [
children: [
{
prop: 'inputNow',
label: '本周'
label: '今日'
},
{
prop: 'inputHis',
label: '上周'
label: '昨日'
},
{
prop: 'inputTrend',
@ -187,11 +194,11 @@ const tableProps = [
children: [
{
prop: 'goodProductNow',
label: '本周'
label: '今日'
},
{
prop: 'goodProductHis',
label: '上周'
label: '昨日'
},
{
prop: 'goodProductTrend',
@ -207,11 +214,11 @@ const tableProps = [
children: [
{
prop: 'missCheckNow',
label: '本周'
label: '今日'
},
{
prop: 'missCheckHis',
label: '上周'
label: '昨日'
},
{
prop: 'missCheckTrend',
@ -227,11 +234,11 @@ const tableProps = [
children: [
{
prop: 'goodProductPassNow',
label: '本周'
label: '今日'
},
{
prop: 'goodProductPassHis',
label: '上周'
label: '昨日'
},
{
prop: 'goodProductPassTrend',
@ -388,8 +395,9 @@ export default {
// explainText: undefined,
// remark: undefined,
// },
//
dataForm: {
//
reportTime:'',
listQuery: {
// workOrderIdList:undefined,
// productionId: undefined,
// startTime: undefined,
@ -419,7 +427,9 @@ export default {
// } else {
// this.searchBarFormConfig[0].defaultSelect = [];
// }
this.getTodayStartTimeAndEndTime()
this.getDataList()
this.getDict()
},
methods: {
format(shijianchuo) {
@ -434,22 +444,27 @@ export default {
// var s = time.getSeconds();
return time
},
getTodayStartTimeAndEndTime() {
this.reportTime = new Date()
this.changeTime(this.reportTime)
},
changeTime(val) {
console.log(val)
if (val) {
// console.log(val)
// console.log(val.setHours(7, 0, 0))
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// let time = this.format(val.setHours(7, 0, 0))
this.dataForm.reportTime[0] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
console.log(this.dataForm.reportTime);
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
console.log(this.listQuery.reportTime);
} else {
this.dataForm.reportTime = []
this.listQuery.reportTime = []
}
},
handleExport() {
//
let params = { ...this.dataForm };
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
@ -460,36 +475,36 @@ export default {
this.exportLoading = false;
}).catch(() => { });
},
timeSelect() {
// switch (this.queryParams.timeDim) {
// case '1':
// if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
// this.$modal.msgError('7')
// this.timeValue = []
// }
// break
// case '2':
if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
this.$modal.msgError('最大时间范围为24个月请重新选择')//
this.monthValue = []
}
// break
// case '4':
// if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
// this.$modal.msgError('24')//
// this.monthValue = []
// }
// break
// default:
},
transformTime(timeStamp) {//
let year = moment(timeStamp).format('YYYY')
let month = moment(timeStamp).format('MM')
let newData = moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59'
let value = newData
console.log(value);
return value
},
// timeSelect() {
// // switch (this.queryParams.timeDim) {
// // case '1':
// // if (this.timeValue[1] - this.timeValue[0] > 7 * 24 * 3600000) {
// // this.$modal.msgError('7')
// // this.timeValue = []
// // }
// // break
// // case '2':
// if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
// this.$modal.msgError('24')//
// this.monthValue = []
// }
// // break
// // case '4':
// // if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
// // this.$modal.msgError('24')//
// // this.monthValue = []
// // }
// // break
// // default:
// },
// transformTime(timeStamp) {//
// let year = moment(timeStamp).format('YYYY')
// let month = moment(timeStamp).format('MM')
// let newData = moment(new Date(year, month, 0)).format('YYYY-MM-DD') + ' 23:59:59'
// let value = newData
// console.log(value);
// return value
// },
// selectTime() {
// switch (this.queryParams.type) {
// case 1:
@ -517,38 +532,50 @@ export default {
}
})
let updateArr = this.list
updateArr.forEach((ele, index) => {
delete ele.inputTrend
delete ele.goodProductTrend
delete ele.missCheckTrend
delete ele.goodProductPassTrend
});
// console.log(JSON.stringify(updateArr[1]))
const result = await Promise.all([
await updateSumProductionDataList(obj),
await updateProductionDataList(updateArr),
]);
if (result[0] == true && result[1] == true) {
await updateProductionDataList(updateArr)
])
console.log(result);
if (result[0].data == true && result[1].data == true) {
// console.log(res)
this.disabled = true
this.isSave = false
this.getDataList()
} else {
this.$modal.msgError('更新失败');
}
},
async getDict() {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
async getDataList() {
if (this.monthValue.length > 0) {
console.log(this.monthValue)
this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0])
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1])
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
console.log(this.timeTips);
} else {
// this.$modal.msgError('')
// return false
}
this.list = []
// if (this.monthValue.length > 0) {
// console.log(this.monthValue)
// this.listQuery.reportTime[0] = this.transformTime(this.monthValue[0])
// // this.queryParams.startTime = this.monthValue[0]
// this.listQuery.reportTime[1] = this.transformTime(this.monthValue[1])
this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
// console.log(this.timeTips);
// } else {
// // this.$modal.msgError('')
// // return false
// }
console.log(this.listQuery);
console.log(this.dataForm);
const res = await this.$axios({
url: '/base/report-auto-production/page',
method: 'get',
params: this.dataForm
params: this.listQuery
})
console.log(res)
// let sum = undefined
@ -559,10 +586,19 @@ export default {
// })
res.data.list.forEach((ele,index) => {
if (ele.det === false) {
res.data.list[index].lineId = '合计'
res.data.list[index].lineName = '合计'
this.remark = res.data.list[index].remark
}
});
})
res.data.list.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name
}
})
})
this.list = res.data.list
},
},

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-01-24 15:57:10
* @LastEditTime: 2024-03-13 15:29:17
* @LastEditors: zhp
* @Description:
-->
@ -10,8 +10,8 @@
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item>
<el-date-picker v-model="monthValue" type="monthrange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
size="small" style='width:350px;' @change="timeSelect">
end-placeholder="结束日期" clearable :picker-options="pickerOptions" size="small" style='width:350px;'
@change="timeSelect">
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
@ -26,104 +26,110 @@
background: '#F2F4F9',
color: '#606266'
}">
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
<el-table-column prop="lineId" label="生产线">
<el-table-column :label="'许昌安彩月成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineId }} </span>
<el-input v-if="!disabled" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡">
<el-table-column prop="inputNow" label="本">
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上">
<el-table-column prop="inputHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减">
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span>
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量">
<el-table-column prop="goodProductNow" label="本">
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上">
<el-table-column prop="goodProductHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减">
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率">
<el-table-column prop="missCheckNow" label="本">
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上">
<el-table-column prop="missCheckHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减">
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
100).toFixed(2)) +'%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率">
<el-table-column prop="goodProductPassNow" label="本">
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上">
<el-table-column prop="goodProductPassHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减">
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2))+ '%' :undefined }}
</span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<div style="height: 50px;" class="remark" slot="append">
<h3 style="float: left;text-align: center;margin-left: 20px;">备注</h3>
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input>
<span v-else>{{ remark }} </span>
</div>
</el-table>
<!-- 搜索工作栏 -->
@ -153,6 +159,7 @@ import {
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
@ -169,11 +176,11 @@ const tableProps = [
children: [
{
prop: 'inputNow',
label: '本'
label: '本'
},
{
prop: 'inputHis',
label: '上'
label: '上'
},
{
prop: 'inputTrend',
@ -189,11 +196,11 @@ const tableProps = [
children: [
{
prop: 'goodProductNow',
label: '本'
label: '本'
},
{
prop: 'goodProductHis',
label: '上'
label: '上'
},
{
prop: 'goodProductTrend',
@ -209,15 +216,15 @@ const tableProps = [
children: [
{
prop: 'missCheckNow',
label: '本'
label: '本'
},
{
prop: 'missCheckHis',
label: '上'
label: '上'
},
{
prop: 'missCheckTrend',
label: '增'
label: '增'
}
]
},
@ -229,11 +236,11 @@ const tableProps = [
children: [
{
prop: 'goodProductPassNow',
label: '本'
label: '本'
},
{
prop: 'goodProductPassHis',
label: '上'
label: '上'
},
{
prop: 'goodProductPassTrend',
@ -402,7 +409,9 @@ export default {
},
};
},
created() {
created() {
this.getCurrentMonthFirst()
this.getCurrentMonthLast()
// this.getProductLineList();
},
mounted() {
@ -421,9 +430,16 @@ export default {
// } else {
// this.searchBarFormConfig[0].defaultSelect = [];
// }
this.getDataList()
this.getDict()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList();
this.proLineList = res.data;
},
handleExport() {
//
let params = { ...this.dataForm };
@ -437,6 +453,22 @@ export default {
this.exportLoading = false;
}).catch(() => { });
},
getCurrentMonthFirst() {
const date = new Date();
date.setDate(1)
// date.setHours(7, 0, 1)
this.monthValue[0] = moment(date).format('YYYY-MM-DD')
console.log(date)
// console.log(date.valueOf());
},
getCurrentMonthLast() {
const date = new Date();
const currentMonth = date.getMonth();
const nextMonth = currentMonth + 1;
const nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
const oneDay = 24 * 60 * 60 * 1000;
this.monthValue[1] = new Date(nextMonthFirstDay - oneDay)
},
timeSelect() {
// switch (this.queryParams.timeDim) {
// case '1':
@ -445,9 +477,10 @@ export default {
// this.timeValue = []
// }
// break
// case '2':
if (this.monthValue[1] - this.monthValue[0] > 729 * 24 * 3600000) {
this.$modal.msgError('最大时间范围为24个月请重新选择')//
// case '2':
console.log(this.monthValue[1],this.monthValue[0]);
if (this.monthValue[1] - this.monthValue[0] > 2629800000) {
this.$modal.msgError('最大时间范围为1个月请重新选择')//
this.monthValue = []
}
// break
@ -467,6 +500,14 @@ export default {
console.log(value);
return value
},
transformStartTime(timeStamp) {//
let year = moment(timeStamp).format('YYYY')
let month = moment(timeStamp).format('MM')
let newData = moment(new Date(year, month, 1)).format('YYYY-MM-DD') + ' 23:59:59'
let value = newData
console.log(value);
return value
},
// selectTime() {
// switch (this.queryParams.type) {
// case 1:
@ -494,26 +535,31 @@ export default {
}
})
let updateArr = this.list
updateArr.forEach((ele, index) => {
delete ele.inputTrend
delete ele.goodProductTrend
delete ele.missCheckTrend
delete ele.goodProductPassTrend
});
// console.log(JSON.stringify(updateArr[1]))
const result = await Promise.all([
await updateSumProductionDataList(obj),
await updateProductionDataList(updateArr),
]);
if (result[0] == true && result[1] == true) {
])
console.log(result);
if (result[0].data == true && result[1].data == true) {
// console.log(res)
this.disabled = true
this.isSave = false
this.getDataList()
} else {
this.$modal.msgError('更新失败');
}
},
async getDataList() {
if (this.monthValue.length > 0) {
console.log(this.monthValue)
this.dataForm.reportTime[0] = this.transformTime(this.monthValue[0])
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = this.transformTime(this.monthValue[1])
this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
console.log(this.timeTips);
} else {
@ -536,11 +582,21 @@ export default {
// })
res.data.list.forEach((ele,index) => {
if (ele.det === false) {
res.data.list[index].lineId = '合计'
res.data.list[index].lineName = '合计'
this.remark = res.data.list[index].remark
}
});
})
res.data.list.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name
}
})
})
this.list = res.data.list
// this.list = res.data.list
},
},
};

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-01-24 15:50:10
* @LastEditTime: 2024-03-12 11:17:14
* @LastEditors: zhp
* @Description:
-->
@ -9,7 +9,7 @@
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item>
<el-date-picker v-model="monthValue" type="monthrange" range-separator="" start-placeholder="开始日期"
<el-date-picker clearable v-model="monthValue" type="monthrange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" value-format="timestamp" :clearable="false" :picker-options="pickerOptions"
size="small" style='width:350px;' @change="timeSelect">
</el-date-picker>
@ -26,136 +26,144 @@
background: '#F2F4F9',
color: '#606266'
}">
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
<el-table-column :label="'许昌安彩周成品发货及库存日报' + '(' + timeTips + ')'" align="center">
<el-table-column prop="glassType" label="品种" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.glassType" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.glassType" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.glassType }} </span>
</template>
</el-table-column>
<el-table-column prop="productionH" label="厚度" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.productionH" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionH }} </span>
</template>
</el-table-column>
<el-table-column label="规格" align="center">
<el-table-column label="成品" align="center">
<el-table-column :show-header="false">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.productionL" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.productionL" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionL }} </span>
</template>
</el-table-column>
<el-table-column :show-header="false">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.productionW" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.productionW" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionW }} </span>
</template>
</el-table-column>
<el-table-column :show-header="false">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.productionH" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.productionH" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionH }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片">
<el-table-column label="原片" align="center">
<el-table-column prop="originalGlassSize">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.originalGlassSize" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.originalGlassSize" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.originalGlassSize }} </span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<!-- <el-table-column label="完成良品产量"> -->
<el-table-column prop="customerId" align="center" label="用户">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.customerId" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.customerId }} </span>
</template>
</el-table-column>
<el-table-column prop="packageType" align="center" label="包装形式">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.packageType" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.packageType }} </span>
</template>
</el-table-column>
<el-table-column prop="orderNum" align="center" label="订单数量">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.orderNum" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.orderNum }} </span>
</template>
</el-table-column>
<el-table-column prop="orderFinish" align="center" label="订单完成">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.orderFinish" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.orderFinish }} </span>
</template>
</el-table-column>
<el-table-column prop="orderRemaining" align="center" label="未完成订单">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.orderRemaining" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.orderRemaining }} </span>
</template>
</el-table-column>
<el-table-column prop="stockLastMonth" align="center" label="上月库存">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.stockLastMonth" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.stockLastMonth }} </span>
</template>
</el-table-column>
<el-table-column prop="productNumThisMonth" align="center" label="本月生产成品">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.productNumThisMonth" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.productNumThisMonth }} </span>
</template>
</el-table-column>
<el-table-column prop="deliveNum" align="center" label="发货量">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.deliveNum" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.deliveNum }} </span>
</template>
</el-table-column>
<el-table-column prop="undeliveNum" align="center" label="未发货量">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.undeliveNum" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.undeliveNum }} </span>
</template>
</el-table-column>
<el-table-column prop="undeliveArea" align="center" label="未发货面积">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.undeliveArea" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.undeliveArea }} </span>
</template>
</el-table-column>
<el-table-column prop="deliveArea" align="center" label="发货面积">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.deliveArea" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.deliveArea }} </span>
</template>
</el-table-column>
<el-table-column prop="productAreaThisMonth" align="center" label="本月生产面积">
<template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.productAreaThisMonth" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.productAreaThisMonth }} </span>
</template>
</el-table-column>
</el-table-column>
<!-- <el-table-column label="完成良品产量"> -->
<el-table-column prop="customerId" label="用户">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.customerId" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.customerId }} </span>
</template>
</el-table-column>
<el-table-column prop="packageType" label="包装形式">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.packageType" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.packageType }} </span>
</template>
</el-table-column>
<el-table-column prop="orderNum" label="订单数量">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.orderNum" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.orderNum }} </span>
</template>
</el-table-column>
<el-table-column prop="orderFinish" label="订单完成">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.orderFinish" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.orderFinish }} </span>
</template>
</el-table-column>
<el-table-column prop="orderRemaining" label="未完成订单">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.orderRemaining" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.orderRemaining }} </span>
</template>
</el-table-column>
<el-table-column prop="stockLastMonth" label="上月库存">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.stockLastMonth" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.stockLastMonth }} </span>
</template>
</el-table-column>
<el-table-column prop="productNumThisMonth" label="本月生产成品">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.productNumThisMonth" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.productNumThisMonth }} </span>
</template>
</el-table-column>
<el-table-column prop="deliveNum" label="发货量">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.deliveNum" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.deliveNum }} </span>
</template>
</el-table-column>
<el-table-column prop="undeliveNum" label="未发货量">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.undeliveNum" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.undeliveNum }} </span>
</template>
</el-table-column>
<el-table-column prop="undeliveArea" label="未发货面积">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.undeliveArea" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.undeliveArea }} </span>
</template>
</el-table-column>
<el-table-column prop="deliveArea" label="发货面积">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.deliveArea" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.deliveArea }} </span>
</template>
</el-table-column>
<el-table-column prop="productAreaThisMonth" label="本月生产面积">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.productAreaThisMonth" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.productAreaThisMonth }} </span>
</template>
</el-table-column>
<!-- </el-table-column> -->
<div style="height: 50px;" class="remark" slot="append">
<h3 style="float: left;text-align: center;margin-left: 20px;">备注</h3>
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input>
<span v-else>{{ remark }} </span>
</div>
</el-table>
<!-- 搜索工作栏 -->
@ -178,13 +186,15 @@
<script>
import {
getAutoDeliveDataList,
updateSumAutoDeliveDataList,
updateAutoDeliveDataList
// updateSumAutoDeliveDataList,
// updateAutoDeliveDataList
updateAutoDeliveDataList,
updateSumAutoDeliveDataList
} from '@/api/report/production';
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
{
@ -439,24 +449,15 @@ export default {
// this.getProductLineList();
},
mounted() {
// 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 = [];
// }
this.getDataList()
this.getDict()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList()
this.proLineList = res.data;
},
timeSelect() {
// switch (this.queryParams.timeDim) {
// case '1':
@ -516,10 +517,10 @@ export default {
let updateArr = this.list
// console.log(JSON.stringify(updateArr[1]))
const result = await Promise.all([
await updateSumProductionDataList(obj),
await updateAutoDeliveDataList(updateArr),
await updateAutoDeliveDataList(obj),
await updateSumAutoDeliveDataList(updateArr),
]);
if (result[0] == true && result[1] == true) {
if (result[0].data == true && result[1].data == true) {
// console.log(res)
this.disabled = true
this.isSave = false
@ -560,6 +561,15 @@ export default {
this.remark = res.data[index].remark
}
});
// res.data.list.forEach(item => {
// this.proLineList.forEach(it => {
// if (item.lineId === it.id) {
// console.log(item)
// item.lineName = it.name
// }
// })
// })
this.list = res.data
},
},

View File

@ -1,37 +0,0 @@
<template>
<div class="tableInner">
<el-input v-model="list[itemProp]" @blur="changeInput" />
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeInput() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -1,468 +0,0 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-01-24 15:55:48
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item>
<el-form-item label="日" prop="reportTime">
<el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button size="small" @click="editDataList()">编辑</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
<el-table :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="生产线">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineId }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡">
<el-table-column prop="inputNow" label="本周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量">
<el-table-column prop="goodProductNow" label="本周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率">
<el-table-column prop="missCheckNow" label="本周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率">
<el-table-column prop="goodProductPassNow" label="本周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上周">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<div style="height: 50px;" class="remark" slot="append">
<h3 style="float: left;text-align: center;margin-left: 20px;">备注</h3>
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
</div>
</el-table>
<!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
<!-- 列表 -->
<!-- <base-table :table-props="tableProps" :page="1" :limit="10" :summary-method="getSummaries" show-summary
:table-data="list">
</base-table> -->
<!-- 分页组件 -->
<!-- <pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" /> -->
</div>
</template>
<script>
import {
getProductionDataList,
updateProductionDataList,
updateSumProductionDataList,
exportProductExcel
} from '@/api/report/production';
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
{
// width: 128,
prop: 'lineId',
label: '生产线',
},
{
// width: 128,
prop: '',
label: '投入数㎡',
align: 'center',
children: [
{
prop: 'inputNow',
label: '本周'
},
{
prop: 'inputHis',
label: '上周'
},
{
prop: 'inputTrend',
label: '增减'
}
]
},
{
// width: 128,
prop: '',
label: '完成良品产量',
align: 'center',
children: [
{
prop: 'goodProductNow',
label: '本周'
},
{
prop: 'goodProductHis',
label: '上周'
},
{
prop: 'goodProductTrend',
label: '增减'
}
]
},
{
// width: 128,
prop: '',
label: '原片漏检率',
align: 'center',
children: [
{
prop: 'missCheckNow',
label: '本周'
},
{
prop: 'missCheckHis',
label: '上周'
},
{
prop: 'missCheckTrend',
label: '增减'
}
]
},
{
// width: 128,
prop: '',
label: '综合良品率',
align: 'center',
children: [
{
prop: 'goodProductPassNow',
label: '本周'
},
{
prop: 'goodProductPassHis',
label: '上周'
},
{
prop: 'goodProductPassTrend',
label: '增减'
}
]
},
];
export default {
name: 'statisticalData',
// components: {
// DialogForm,
// },
// mixins: [basicPageMixin],
data() {
return {
list: [],
remark: '',
urlOptions: {
// getDataListURL: getGlassPage,
exportURL: exportProductExcel
},
// dynamicProps: [],
tableProps,
timeTips:'',
// dataForm: {
// reportTime:undefined
// },
isSave:false,
disabled: true,
sumArr: [],
weekValue1: null,//24
weekValue2: null,
searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'workOrderIdList',
// selectOptions: [],
// multiple: true,
// labelField: 'name',
// valueField: 'id',
// defaultSelect: []
// },
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'productionId',
// selectOptions: [],
// },
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'inspectionDetContent',
// },
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'checkTime',
// width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi(
// 'base:quality-inspection-record:create'
// )
// ? 'button'
// : '',
// btnName: '',
// name: 'add',
// plain: true,
// color: 'success',
// },
],
pickerOptionsWeek: {
disabledDate(time) {
let day = Date.now()
let limitTime = moment(day).day(-1)
return time.getTime() > new Date(limitTime).getTime()
}
},
reportTime:undefined,
dataForm: {
// workOrderIdList:undefined,
// productionId: undefined,
// startTime: undefined,
// endTime: undefined,
reportTime: [],
reportType:2
// productionLineId: null,
},
};
},
created() {
// this.getProductLineList();
},
mounted() {
// 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 = [];
// }
this.getDataList()
},
methods: {
format(shijianchuo) {
//shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
// console.log(time)
// var y = time.getFullYear();
// var m = time.getMonth() + 1;
// var d = time.getDate();
// var h = time.getHours();
// var mm = time.getMinutes();
// var s = time.getSeconds();
return time
},
changeTime(val) {
if (val) {
// console.log(val)
// console.log(val.setHours(7, 0, 0))
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// let time = this.format(val.setHours(7, 0, 0))
this.dataForm.reportTime[0] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
console.log(this.dataForm.reportTime);
} else {
this.dataForm.reportTime = []
}
},
editDataList() {
this.disabled = false
this.isSave = true
},
async saveDataList() {
let obj = {}
this.list.forEach((ele, index) => {
if (ele.det === false) {
this.list[index].lineId = ''
this.list[index].remark = this.remark
obj = ele
this.list.splice(index,1)
}
})
let updateArr = this.list
// console.log(JSON.stringify(updateArr[1]))
const result = await Promise.all([
await updateSumProductionDataList(obj),
await updateProductionDataList(updateArr),
]);
if (result[0].data == true && result[1].data == true) {
// console.log(res)
this.disabled = true
this.isSave = false
this.getDataList()
} else {
this.$modal.msgError('更新失败');
}
},
handleExport() {
//
let params = { ...this.dataForm };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '成品生产日报.xls');
this.exportLoading = false;
}).catch(() => { });
},
async getDataList() {
// if (this.weekValue1 && this.weekValue2) {
// this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
// // this.queryParams.startTime = this.monthValue[0]
// this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
// this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
// } else {
// }
this.loading = true;
//
const res = await this.$axios({
url: '/base/report-auto-production/page',
method: 'get',
params: this.dataForm
})
// console.log(this.queryParams);
console.log(res)
// let sum = undefined
// res.data.list.forEach((ele, index) => {
// if (ele.det === false) {
// sum = res.data.list.splice(index, 1)
// }
// })
res.data.list.forEach((ele,index) => {
if (ele.det === false) {
res.data.list[index].lineId = '合计'
this.remark = res.data.list[index].remark
}
});
this.list = res.data.list
},
},
};
</script>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-01-24 15:59:13
* @LastEditTime: 2024-03-13 15:29:26
* @LastEditors: zhp
* @Description:
-->
@ -9,11 +9,9 @@
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item>
<el-date-picker v-model="weekValue1" type="week" format="yyyy 第 WW 周" style='width:170px;'
:picker-options="pickerOptionsWeek" @change="startWeek" :clearable="false" size="small" placeholder="选择周">
</el-date-picker>-
<el-date-picker v-model="weekValue2" type="week" format="yyyy 第 WW 周" :picker-options="pickerOptionsWeek"
style='width:170px;' @change="endWeek" :clearable="false" size="small" placeholder="选择周">
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
@ -29,104 +27,110 @@
background: '#F2F4F9',
color: '#606266'
}">
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
<el-table-column prop="lineId" label="生产线">
<el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineId }} </span>
<el-input v-if="!disabled" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡">
<el-table-column prop="inputNow" label="本周">
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上周">
<el-table-column prop="inputHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减">
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span>
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量">
<el-table-column prop="goodProductNow" label="本周">
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上周">
<el-table-column prop="goodProductHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减">
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率">
<el-table-column prop="missCheckNow" label="本周">
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上周">
<el-table-column prop="missCheckHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减">
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率">
<el-table-column prop="goodProductPassNow" label="本周">
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上周">
<el-table-column prop="goodProductPassHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减">
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) + '%' :undefined }}
</span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<div style="height: 50px;" class="remark" slot="append">
<h3 style="float: left;text-align: center;margin-left: 20px;">备注</h3>
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input>
<span v-else>{{ remark }} </span>
</div>
</el-table>
<!-- 搜索工作栏 -->
@ -156,6 +160,8 @@ import {
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'
import { parseTime } from '../../core/mixins/code-filter';
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
@ -260,7 +266,9 @@ export default {
urlOptions: {
exportURL: exportProductExcel
},
timeTips:'',
timeTips: '',
startTimeStamp: '',
endTimeStamp: '',
// dataForm: {
// reportTime:undefined
// },
@ -325,7 +333,8 @@ export default {
// plain: true,
// color: 'success',
// },
],
],
reportTime:'',
pickerOptionsWeek: {
disabledDate(time) {
let day = Date.now()
@ -363,9 +372,78 @@ export default {
// } else {
// this.searchBarFormConfig[0].defaultSelect = [];
// }
this.getCurrentWeekStartTimeAndEndTime()
this.getDataList()
this.getDict()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList()
this.proLineList = res.data;
},
getCurrentWeekStartTimeAndEndTime() {
this.reportTime = new Date()
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
// console.log(weekday[this.reportTime.getDay()]);
if (weekday[this.reportTime.getDay()] === 'Monday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime())
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
}
},
handleExport() {
//
let params = { ...this.dataForm };
@ -380,6 +458,7 @@ export default {
}).catch(() => { });
},
startWeek() {
// console.log(this.weekValue1);
if (this.weekValue1 && this.weekValue2) {
let a = new Date(this.weekValue1).getTime()
let b = new Date(this.weekValue2).getTime()
@ -426,25 +505,52 @@ export default {
}
})
let updateArr = this.list
updateArr.forEach((ele, index) => {
delete ele.inputTrend
delete ele.goodProductTrend
delete ele.missCheckTrend
delete ele.goodProductPassTrend
});
// console.log(JSON.stringify(updateArr[1]))
const result = await Promise.all([
await updateSumProductionDataList(obj),
await updateProductionDataList(updateArr),
]);
])
console.log(result);
if (result[0].data == true && result[1].data == true) {
// console.log(res)
this.disabled = true
this.isSave = false
this.getDataList()
} else {
this.$modal.msgError('更新失败');
}
},
changeTime(val) {
console.log(val);
if (val) {
let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //
console.log(this.startTimeStamp, this.endTimeStamp)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.dataForm.reportTime = []
}
},
//yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
},
async getDataList() {
if (this.weekValue1 && this.weekValue2) {
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 00:00:00'
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 23:59:59'
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
} else {
}
@ -465,10 +571,19 @@ export default {
// })
res.data.list.forEach((ele,index) => {
if (ele.det === false) {
res.data.list[index].lineId = '合计'
res.data.list[index].lineName = '合计'
this.remark = res.data.list[index].remark
}
});
})
res.data.list.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name
}
})
})
this.list = res.data.list
},
},

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-01-24 15:59:21
* @LastEditTime: 2024-03-13 15:29:35
* @LastEditors: zhp
* @Description:
-->
@ -9,11 +9,9 @@
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item>
<el-date-picker style='width:170px;' v-model="yearValue1" type="year" :picker-options="pickerOptions"
value-format="timestamp" placeholder="选择年" @change="startYear" size="small" :clearable="false">
</el-date-picker>-
<el-date-picker style='width:170px;' v-model="yearValue2" type="year" :picker-options="pickerOptions"
value-format="timestamp" placeholder="选择年" @change="endYear" size="small" :clearable="false">
<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 type="primary" @click="getDataList()">查询</el-button>
@ -31,104 +29,111 @@
color: '#606266'
}">
<el-table-column :label="'许昌安彩月成品生产汇总' + timeTips" align="center">
<el-table-column prop="lineId" label="生产线">
<el-table-column :label="'许昌安彩年成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.lineId" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineId }} </span>
<el-input v-if="!disabled" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡">
<el-table-column prop="inputNow" label="本周">
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上周">
<el-table-column prop="inputHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减">
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span>
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量">
<el-table-column prop="goodProductNow" label="本周">
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上周">
<el-table-column prop="goodProductHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减">
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
100).toFixed(2)) + '%' : undefined }} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率">
<el-table-column prop="missCheckNow" label="本周">
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上周">
<el-table-column prop="missCheckHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis }} </span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减">
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.missCheckTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
100).toFixed(2)) + '%' : undefined }}
</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率">
<el-table-column prop="goodProductPassNow" label="本周">
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassNow" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上周">
<el-table-column prop="goodProductPassHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassHis" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减">
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="scope.row.det === true" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) + '%' : undefined }}
</span>
</template>
</el-table-column>
</el-table-column>
</el-table-column>
<div style="height: 50px;" class="remark" slot="append">
<h3 style="float: left;text-align: center;margin-left: 20px;">备注</h3>
<el-input :disabled="disabled" style="float:right;width: 96%;margin-top: 8px;" v-model="remark"></el-input>
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input>
<span v-else>{{ remark }} </span>
</div>
</el-table>
<!-- 搜索工作栏 -->
@ -158,8 +163,9 @@ import {
// import Editor from '@/components/Editor';
import moment from 'moment';
// import DialogForm from './dialogForm.vue';
import { parseTime } from '../../core/mixins/code-filter';
import { getCorePLList } from '@/api/base/coreProductionLine'
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [
{
// width: 128,
@ -174,11 +180,11 @@ const tableProps = [
children: [
{
prop: 'inputNow',
label: '本周'
label: '今年'
},
{
prop: 'inputHis',
label: '上周'
label: '去年'
},
{
prop: 'inputTrend',
@ -194,11 +200,11 @@ const tableProps = [
children: [
{
prop: 'goodProductNow',
label: '本周'
label: '今年'
},
{
prop: 'goodProductHis',
label: '上周'
label: '去年'
},
{
prop: 'goodProductTrend',
@ -214,11 +220,11 @@ const tableProps = [
children: [
{
prop: 'missCheckNow',
label: '本周'
label: '今年'
},
{
prop: 'missCheckHis',
label: '上周'
label: '去年'
},
{
prop: 'missCheckTrend',
@ -234,11 +240,11 @@ const tableProps = [
children: [
{
prop: 'goodProductPassNow',
label: '本周'
label: '今年'
},
{
prop: 'goodProductPassHis',
label: '上周'
label: '去年'
},
{
prop: 'goodProductPassTrend',
@ -265,6 +271,9 @@ export default {
yearValue2: null,
// dynamicProps: [],
tableProps,
reportTime: [],
startTimeStamp: '',
endTimeStamp: '',
dataForm: {
// workOrderIdList:undefined,
// productionId: undefined,
@ -344,7 +353,9 @@ export default {
],
};
},
created() {
created() {
this.getCurrentYearFirst()
// this.getProductLineList();
},
mounted() {
@ -364,8 +375,24 @@ export default {
// this.searchBarFormConfig[0].defaultSelect = [];
// }
this.getDataList()
this.getDict()
},
methods: {
async getDict() {
// 线
const res = await getCorePLList()
this.proLineList = res.data;
},
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).getTime()); //
this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 23, 59, 59).getTime()); //
this.dataForm.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.dataForm.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
},
handleExport() {
//
let params = { ...this.dataForm };
@ -379,34 +406,34 @@ export default {
this.exportLoading = false;
}).catch(() => { });
},
startYear() {
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
this.$modal.msgError('开始时间不能晚于结束时间,请重新选择')
this.yearValue1 = null
return false
}
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
this.$modal.msgError('最大时间范围为10年请重新选择')
this.yearValue1 = null
return false
}
}
},
endYear() {
if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间,请重新选择')
this.yearValue2 = null
return false
}
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
this.$modal.msgError('最大时间范围为10年请重新选择')
this.yearValue2 = null
return false
}
}
},
// startYear() {
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
// this.$modal.msgError('')
// this.yearValue1 = null
// return false
// }
// if (this.yearValue1 && this.yearValue2) {
// if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
// this.$modal.msgError('10')
// this.yearValue1 = null
// return false
// }
// }
// },
// endYear() {
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
// this.$modal.msgError('')
// this.yearValue2 = null
// return false
// }
// if (this.yearValue1 && this.yearValue2) {
// if (this.yearValue2 - this.yearValue1 > 10 * 365 * 24 * 3600000) {
// this.$modal.msgError('10')
// this.yearValue2 = null
// return false
// }
// }
// },
editDataList() {
this.disabled = false
this.isSave = true
@ -422,18 +449,23 @@ export default {
}
})
let updateArr = this.list
updateArr.forEach((ele, index) => {
delete ele.inputTrend
delete ele.goodProductTrend
delete ele.missCheckTrend
delete ele.goodProductPassTrend
});
// console.log(JSON.stringify(updateArr[1]))
const result = await Promise.all([
await updateSumProductionDataList(obj),
await updateProductionDataList(updateArr),
]);
])
console.log(result);
if (result[0].data == true && result[1].data == true) {
// console.log(res)
this.disabled = true
this.isSave = false
this.getDataList()
} else {
this.$modal.msgError('更新失败');
}
},
transformYear(timeStamp) {//
@ -442,15 +474,37 @@ export default {
let value = newData
return value
},
changeTime(val) {
console.log(val);
if (val) {
// let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()); //
this.dataForm.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.dataForm.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 1).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.dataForm.reportTime = []
}
},
//yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
},
async getDataList() {
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
console.log(this.yearValue1);
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间')
return false
} else {
this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
this.timeTips = this.transformYear(this.yearValue1) + " - " + this.transformYear(this.yearValue1)
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
}
}
this.loading = true;
@ -470,10 +524,19 @@ export default {
// })
res.data.list.forEach((ele,index) => {
if (ele.det === false) {
res.data.list[index].lineId = '合计'
res.data.list[index].lineName = '合计'
this.remark = res.data.list[index].remark
}
});
})
res.data.list.forEach(item => {
this.proLineList.forEach(it => {
if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name
}
})
})
this.list = res.data.list
},
},

View File

@ -117,12 +117,12 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import EquipmentDrawer from '../components/firefightingDrawer';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
import {
createEquipment,
updateEquipment,
deleteEquipment,
getEquipment,
getEquipmentPage,
exportEquipmentExcel,
} from '@/api/base/equipment';
@ -134,6 +134,7 @@ export default {
components: {
Editor,
EquipmentDrawer,
BaseDialog: BaseDialogWrapper
},
mixins: [basicPageMixin],
data() {

View File

@ -116,12 +116,12 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import EquipmentDrawer from '../components/manageDrawer';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
import {
createEquipment,
updateEquipment,
deleteEquipment,
getEquipment,
getEquipmentPage,
exportEquipmentExcel,
} from '@/api/base/equipment';
@ -133,6 +133,7 @@ export default {
components: {
Editor,
EquipmentDrawer,
BaseDialog: BaseDialogWrapper
},
mixins: [basicPageMixin],
data() {

View File

@ -126,12 +126,14 @@ import {
} from '@/api/base/equipment';
import Editor from '@/components/Editor';
import AssetsUpload from '../components/AssetsUpload.vue';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
export default {
name: 'SpecialEquipmentForSafety',
components: {
Editor,
EquipmentDrawer,
BaseDialog: BaseDialogWrapper,
},
mixins: [basicPageMixin],
data() {

View File

@ -51,7 +51,8 @@
<addOrUpdata
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getList" />
@refreshDataList="getList"
@destroy="addOrUpdateVisible = false" />
</div>
</template>
@ -60,10 +61,11 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue';
import add from './add.vue';
import { parseTime } from '../../core/mixins/code-filter';
import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
export default {
name: 'SpecialEquipmentCheckConfig',
components: { addOrUpdata, add },
components: { addOrUpdata, add, BaseDialog: BaseDialogWrapperVue },
mixins: [basicPageMixin],
data() {
return {
@ -188,6 +190,7 @@ export default {
pageSize: 10,
name: null,
status: 0,
special: true,
},
//
form: {},

View File

@ -9,7 +9,9 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -171,7 +173,7 @@
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">
<el-button v-if="!disableEdit" @click="handleCancel">
{{ disableEdit ? '返回' : '取消' }}
</el-button>
<el-button
@ -206,35 +208,11 @@
<script>
import DialogForm from '../../../components/DialogForm/index.vue';
import { groupConnectWorkshop } from '@/utils/equipment-module';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
import SmallTitle from '../components/SmallTitle.js';
export default {
components: { SmallTitle, DialogForm },
components: { SmallTitle, DialogForm, BaseDialog: BaseDialogWrapperVue },
props: ['dataId'], // dataId id
data() {
return {
@ -411,6 +389,35 @@ export default {
this.getList('inspector');
},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
if (this.disableEdit) return this.handleCancel();
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.handleCancel();
}
} catch (err) {
return false;
}
},
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':

View File

@ -64,10 +64,18 @@ import { parseTime } from '../../core/mixins/code-filter';
import CheckOrderListTable from './CheckOrderListTable.vue';
import edit from './Content-edit.vue';
import AddCheckDet from './Content-add_detail.vue';
import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
export default {
name: 'SpecialEquipmentCheckConfig',
components: { addOrUpdata, add, edit, AddCheckDet, CheckOrderListTable },
components: {
addOrUpdata,
add,
edit,
AddCheckDet,
BaseDialog: BaseDialogWrapperVue,
CheckOrderListTable,
},
mixins: [basicPageMixin],
data() {
return {
@ -86,7 +94,7 @@ export default {
? {
type: 'edit',
btnName: '修改',
}
}
: undefined,
{
type: 'detail',
@ -96,7 +104,7 @@ export default {
? {
type: 'delete',
btnName: '删除',
}
}
: undefined,
].filter((v) => v),
tableProps: [
@ -334,9 +342,8 @@ export default {
}
return this.$axios({
url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
// + checkPersonParam,
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
// + checkPersonParam,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put',
data: [id],

View File

@ -7,9 +7,10 @@
<template>
<el-drawer
:visible="visible"
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="true"
:close-on-click-modal="true"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -30,13 +31,13 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="巡检单名称" prop="name">
<div style="">{{ form.name }}</div>
<div style="">{{ form.name || '---' }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="department">
<div style="">{{ form.department }}</div>
<div style="">{{ form.department || '---' }}</div>
</el-form-item>
</el-col>
@ -111,7 +112,7 @@
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">
<el-button v-if="!disableEdit" @click="handleCancel">
{{ disableEdit ? '返回' : '取消' }}
</el-button>
<el-button
@ -146,35 +147,11 @@
<script>
import { parseTime } from '../../core/mixins/code-filter';
import DialogForm from '../../../components/DialogForm/index.vue';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
import SmallTitle from '../components/SmallTitle.js';
export default {
components: { SmallTitle, DialogForm },
components: { SmallTitle, DialogForm, BaseDialog: BaseDialogWrapperVue },
props: ['dataId'], // dataId id
filters: { parseTime },
data() {

View File

@ -9,7 +9,9 @@
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="true"
:wrapperClosable="true"
:close-on-click-modal="true"
@closed="$emit('destroy')"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
@ -37,12 +39,12 @@
</el-col> -->
<el-col :span="8">
<el-form-item label="巡检单名称" prop="name">
{{ dataForm.name }}
{{ dataForm.name || '---' }}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="department">
{{ dataForm.department }}
{{ dataForm.department || '---' }}
</el-form-item>
</el-col>
<el-col :span="8">
@ -94,7 +96,7 @@
@pagination="getList" />
<!-- <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
<el-button type="primary" @click="goback()">返回</el-button>
</div> -->
</div>
</div>
@ -111,7 +113,7 @@
<script>
import SmallTitle from './SmallTitle';
import attrAdd from './attr-add';
import { DICT_TYPE, getDictDatas } from '@/utils/dict';
// import { DICT_TYPE, getDictDatas } from '@/utils/dict';
import { parseTime } from '../../core/mixins/code-filter';
const tableBtn = [
@ -183,6 +185,33 @@ export default {
},
mounted() {},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.visible = false;
}
} catch (err) {
return false;
}
},
initData() {
this.checkDetList.splice(0);
this.checkDetList.total = 0;
@ -245,7 +274,7 @@ export default {
});
},
goback() {
this.$emit('refreshDataList');
// this.$emit('refreshDataList');
this.visible = false;
// this.initData();
},

View File

@ -51,7 +51,7 @@
<el-row style="text-align: right">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
</el-row>
</el-dialog>
</template>

View File

@ -0,0 +1,59 @@
<!--
filename: BaseDialogWrapper.vue
author: liubin
date: 2024-03-13 13:51:14
description: 对BaseDialog的封装自定义保存取消按钮
-->
<template>
<base-dialog
:dialogTitle="dialogTitle"
:dialogVisible="dialogVisible"
:width="width"
:custom-class="customClass"
:append-to-body="appendToBody"
@close="$emit('close')">
<slot />
<template #footer>
<el-row slot="footer" type="flex" justify="end">
<el-col :span="24">
<el-button size="small" class="btnTextStyle" @click="$emit('cancel')">
取消
</el-button>
<el-button
type="primary"
class="btnTextStyle"
size="small"
@click="$emit('confirm')">
保存
</el-button>
</el-col>
</el-row>
</template>
</base-dialog>
</template>
<script>
export default {
name: 'BaseDialogWrapper',
components: {},
props: [
'dialogTitle',
'dialogVisible',
'appendToBody',
'width',
'customClass',
],
data() {
return {};
},
};
</script>
<style scoped lang="scss">
.baseDialog .btnTextStyle {
letter-spacing: 6px;
padding: 9px 10px 9px 16px;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,32 @@
// <!--
// filename: SmallTitle.js
// author: liubin
// date: 2024-03-13 14:21:01
// description:
// -->
export default {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};

View File

@ -121,35 +121,16 @@
<script>
import DialogForm from './DialogForm';
import EquipmentInfoForm from './EquipmentInfoForm.vue';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import BaseDialogWrapper from './BaseDialogWrapper.vue';
import SmallTitle from './SmallTitle.js';
export default {
components: { SmallTitle, DialogForm, EquipmentInfoForm },
components: {
SmallTitle,
DialogForm,
EquipmentInfoForm,
BaseDialog: BaseDialogWrapper,
},
props: ['sections', 'mode', 'dataId', 'isFireEquipment'], // dataId id
data() {
return {

View File

@ -5,7 +5,6 @@
description:
-->
<template>
<el-drawer
:visible="visible"
@ -122,35 +121,16 @@
<script>
import DialogForm from './DialogForm';
import EquipmentInfoForm from './manageDrawerForm.vue';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import BaseDialogWrapper from './BaseDialogWrapper.vue';
import SmallTitle from './SmallTitle.js';
export default {
components: { SmallTitle, DialogForm, EquipmentInfoForm },
components: {
SmallTitle,
DialogForm,
EquipmentInfoForm,
BaseDialog: BaseDialogWrapper,
},
props: ['sections', 'mode', 'dataId', 'isFireEquipment'], // dataId id
data() {
return {

View File

@ -5,7 +5,6 @@
description:
-->
<template>
<el-drawer
:visible="visible"
@ -122,35 +121,16 @@
<script>
import DialogForm from './DialogForm';
import EquipmentInfoForm from './EquipmentInfoForm.vue';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import BaseDialogWrapper from './BaseDialogWrapper.vue';
import SmallTitle from './SmallTitle.js';
export default {
components: { SmallTitle, DialogForm, EquipmentInfoForm },
components: {
SmallTitle,
DialogForm,
EquipmentInfoForm,
BaseDialog: BaseDialogWrapper,
},
props: ['sections', 'mode', 'dataId', 'isFireEquipment'], // dataId id
data() {
return {

View File

@ -9,7 +9,9 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -115,7 +117,7 @@
</div>
<div class="drawer-body__footer">
<el-button style="" @click="cancel">返回</el-button>
<!-- <el-button style="" @click="cancel">返回</el-button> -->
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</el-button>
@ -143,32 +145,7 @@
<script>
import DialogForm from '@/components/DialogForm';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import SmallTitle from '../components/SmallTitle.js';
export default {
name: 'PlanConfig--addContent',
@ -263,6 +240,35 @@ export default {
this.loadEquipments();
},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
if (this.mode.includes('detail')) return this.cancel();
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.cancel();
}
} catch (err) {
return false;
}
},
show({
departmentName,
id,

View File

@ -61,7 +61,7 @@
</template>
<script>
import { publicFormatter } from '@/utils/dict';
// import { publicFormatter } from '@/utils/dict';
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record';

View File

@ -123,7 +123,8 @@
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val) && parseInt(val) === Number(val),
transform: (val) =>
Number(val) && parseInt(val) === Number(val) && Number(val),
},
{ required: true, message: '保养频率不能为空', trigger: 'blur' },
]">

View File

@ -2,14 +2,16 @@
filename: PlanConfig--addContent.vue
author: liubin
date: 2024-02-04 09:40:04
description:
description: 计划配置-添加内容
-->
<template>
<el-drawer
:visible="visible"
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -19,7 +21,7 @@
mode.includes('detail')
? '详情'
: mode.includes('edit')
? '编辑'
? '添加内容'
: '新增'
}}
</SmallTitle>
@ -38,37 +40,37 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="保养计划名称" prop="name">
<span>{{ form.name }}</span>
<span>{{ form.name || '---' }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="departmentName">
<span>{{ form.departmentName }}</span>
<span>{{ form.departmentName || '---' }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产线名" prop="lineName">
<span>{{ form.lineName }}</span>
<span>{{ form.lineName || '---' }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养频率" prop="maintenancePeriod">
<span>{{ form.maintenancePeriod }}</span>
<span>{{ form.maintenancePeriod || '---' }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养时长" prop="maintainDuration">
<span>{{ form.maintainDuration }}</span>
<span>{{ form.maintainDuration || '---' }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer">
<span>{{ form.maintainer }}</span>
<span>{{ form.maintainer || '---' }}</span>
</el-form-item>
</el-col>
</el-row>
@ -143,36 +145,12 @@
<script>
import DialogForm from '@/components/DialogForm';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
import SmallTitle from '../components/SmallTitle.js';
export default {
name: 'PlanConfig--addContent',
components: { SmallTitle, DialogForm },
components: { SmallTitle, DialogForm, BaseDialog: BaseDialogWrapper },
props: ['maintainData'],
data() {
return {
@ -263,6 +241,35 @@ export default {
this.loadEquipments();
},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
if (this.mode.includes('detail')) return this.cancel();
if (document.querySelector('.small-title').innerText.includes('添加内容')) return this.cancel();
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.cancel();
}
} catch (err) {
return false;
}
},
show({
departmentName,
id,

View File

@ -65,10 +65,15 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record';
import PlanConfigAdd from './PlanConfig--add.vue';
import PlanConfigAddContent from './PlanConfig--addContent.vue';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
export default {
name: 'SpecialEquipmentPlanConfig',
components: { DialogForm: PlanConfigAdd, PlanConfigAddContent },
components: {
BaseDialog: BaseDialogWrapper,
DialogForm: PlanConfigAdd,
PlanConfigAddContent,
},
mixins: [basicPageMixin],
data() {
const t = new Date();
@ -98,7 +103,7 @@ export default {
: undefined,
].filter((v) => v),
tableProps: [
{ prop: 'name', label: '计划名称' },
{ prop: 'name', label: '保养计划名称' },
{ prop: 'departmentName', label: '部门' },
{ width: 144, prop: 'lineName', label: '产线名' },
{ width: 132, prop: 'maintenancePeriod', label: '保养频率(天/次)' },

View File

@ -9,7 +9,9 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -84,7 +86,7 @@
</div>
<div class="drawer-body__footer">
<el-button style="" @click="cancel">返回</el-button>
<!-- <el-button style="" @click="cancel">返回</el-button> -->
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</el-button>
@ -112,36 +114,12 @@
<script>
import DialogForm from '@/components/DialogForm';
const SmallTitle = {
name: 'SmallTitle',
props: ['size'],
components: {},
data() {
return {};
},
methods: {},
render: function (h) {
return h(
'span',
{
class: 'small-title',
style: {
fontSize: '18px',
lineHeight:
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
fontWeight: 500,
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
},
},
this.$slots.default
);
},
};
import SmallTitle from '../components/SmallTitle.js';
import BaseDialogWrapper from '../components/BaseDialogWrapper';
export default {
name: 'PlanConfig--addContent',
components: { SmallTitle, DialogForm },
components: { SmallTitle, DialogForm, BaseDialog: BaseDialogWrapper },
props: ['maintainData'],
data() {
return {
@ -229,6 +207,35 @@ export default {
this.loadEquipments();
},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
if (this.mode.includes('detail')) return this.cancel();
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.cancel();
}
} catch (err) {
return false;
}
},
show({ planMaintainWorker, id, maintainWorker }) {
this.form = Object.assign(
{},
@ -305,17 +312,14 @@ export default {
}
try {
const res = await this.$axios(
'/base/equipment-maintain-log-det/page',
{
params: {
pageNo: this.detailTableQuery.pageNo,
pageSize: this.detailTableQuery.pageSize,
// planId: this.form.id,
logId: this.form.id,
},
}
);
const res = await this.$axios('/base/equipment-maintain-log-det/page', {
params: {
pageNo: this.detailTableQuery.pageNo,
pageSize: this.detailTableQuery.pageSize,
// planId: this.form.id,
logId: this.form.id,
},
});
this.detailList = res.data?.list || [];
this.detailTotal = res.data?.total || 0;
this.detailLoading = false;

View File

@ -70,10 +70,11 @@ import {
import { parseTime } from '@/utils/ruoyi';
import htmls from './htmls.vue';
import DialogForm from './Repair--add.vue';
import BaseDialogWrapperVue from '../components/BaseDialogWrapper.vue';
export default {
name: 'SpecialEquipmentRepair',
components: { DetailDrawer, DialogForm },
components: { DetailDrawer, DialogForm, BaseDialog: BaseDialogWrapperVue },
mixins: [basicPageMixin],
data() {
return {

View File

@ -97,42 +97,39 @@
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import DialogFormUnplanned from './WaitingList--add--unplanned.vue';
import UnplannedEditDrawer from './WaitingListUnplanned--edit.vue';
import PlannedEditDrawer from './WaitingListPlanned--edit.vue';
import UnplannedAddDet from './WaitingListUnplanned--add_detail.vue';
import {
exportMaintainLogExcel,
} from '@/api/equipment/base/maintain/record';
import { exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
import WaitingListTable from './WaitingListTable.vue';
import RecordDetail from './Record--detail.vue';
import BaseDialogWrapper from '../components/BaseDialogWrapper.vue';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = {
name: 'tableBtn',
props: ['injectData'],
data() {
return {};
},
methods: {
handleClick() {
this.$emit('emitData', {
action: this.injectData.label,
value: this.injectData,
});
},
},
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.name}
</el-button>
);
},
};
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
// const btn = {
// name: 'tableBtn',
// props: ['injectData'],
// data() {
// return {};
// },
// methods: {
// handleClick() {
// this.$emit('emitData', {
// action: this.injectData.label,
// value: this.injectData,
// });
// },
// },
// render: function (h) {
// return (
// <el-button type="text" onClick={this.handleClick}>
// {this.injectData.name}
// </el-button>
// );
// },
// };
export default {
name: 'SpecialEquipmentMaintainRecord',
@ -143,6 +140,7 @@ export default {
UnplannedEditDrawer,
UnplannedAddDet,
PlannedEditDrawer,
BaseDialog: BaseDialogWrapper,
},
mixins: [basicPageMixin],
data() {

View File

@ -9,7 +9,9 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -482,6 +484,33 @@ export default {
this.getList('line');
},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.handleCancel();
}
} catch (err) {
return false;
}
},
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':

View File

@ -9,7 +9,9 @@
<el-drawer
:visible="visible"
:show-close="false"
:wrapper-closable="false"
:wrapperClosable="true"
:close-on-click-modal="true"
:before-close="handleConfirmClose"
class="drawer"
custom-class="mes-drawer"
size="60%"
@ -419,6 +421,34 @@ export default {
this.getList('line');
},
methods: {
/** 确认是否关闭 */
async handleConfirmClose() {
try {
if (
await this.$confirm(
<div style="position: relative; margin-bottom: 26px; overflow: visible;">
<h1 style="font-size: 16px; font-weight: bold; color: #000c;">
确认要关闭页面吗?
</h1>
<p style="font-size: 14px; color: #0008; position: absolute; top: 24px;">
确定关闭将不保留编辑内容
</p>
</div>,
{
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning',
}
)
) {
this.handleCancel();
}
} catch (err) {
return false;
}
},
handleSearchBarBtnClick(btn) {
console.log('btn', btn);
switch (btn.btnName) {