Merge branch 'projects/mesxc-test' of git.picaiba.com:mt-fe-group/yudao-dev into projects/mesxc-test

This commit is contained in:
gtz 2024-03-24 15:45:29 +08:00
commit d9b354f0c4
165 changed files with 5500 additions and 3367 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-02-29 15:53:50
# @LastEditors: DY
# @LastEditTime: 2024-03-22 14:18:33
# @LastEditors: zhp
# @Description:
###
# 开发环境配置
@ -25,7 +25,7 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# socket地址
VUE_APP_Socket_API = 'ws://192.168.0.30:8888'
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
# 积木报表指向地址

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-11-15 17:19:19
* @LastEditTime: 2024-03-21 10:49:24
* @LastEditors: DY
* @Description:
*/
@ -118,6 +118,24 @@ export function getCoreWOMaPage(query) {
})
}
// 获得工单预使用原料分页----根据产品id
export function getlistByProductId(query) {
return request({
url: '/base/material-product-bom-det/listByProductId',
method: 'get',
params: query
})
}
// 获得工单预使用原料分页----根据工艺流程
export function getlistByFlowId(query) {
return request({
url: '/extend/process-equ-material-bom-det/listByFlowId',
method: 'get',
params: query
})
}
// 获得预计用料信息分页
export function getMaterialBomPage(query) {
return request({
@ -162,3 +180,12 @@ export function updateConCoreWOr(data) {
data: data
})
}
// 修改分配产量----批量
export function updateBatchConCoreWOr(data) {
return request({
url: '/base/core-order-con-work-order/updateBatch',
method: 'put',
data: data
})
}

View File

@ -34,6 +34,15 @@ export function workOrderList(query) {
})
}
// 条件获得工单列表
export function getFreeWOlist(query) {
return request({
url: '/base/core-work-order/getFreeWOlist',
method: 'get',
params: query
})
}
// 获得订单分页
export function getOrderPage(query) {
return request({

View File

@ -5,4 +5,13 @@ export function getLineAll() {
url: '/base/core-production-line/listAll',
method: 'get'
})
}
}
// 根据车间获得所有工厂产线列表
export function getLinelistByRoom(query) {
return request({
url: '/base/core-production-line/listFilter',
method: 'get',
params: query
})
}

View File

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2023-12-04 14:10:37
* @LastEditTime: 2023-12-14 10:06:03
* @LastEditTime: 2024-03-19 15:02:49
* @LastEditors: zhp
* @Description:
*/
@ -26,10 +26,11 @@ export function updateQualityInspectionBoxBtn(data) {
}
// 删除安灯按钮16键对应
export function deleteQualityInspectionBoxBtn(id) {
export function deleteQualityInspectionBoxBtn(query) {
return request({
url: '/base/quality-inspection-box-btn/delete?id=' + id,
method: 'delete'
url: 'base/quality-inspection-box-btn/deleteByLineSection',
method: 'delete',
params: query
})
}

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2024-02-21 13:43:02
* @LastEditTime: 2024-02-21 15:00:17
* @LastEditTime: 2024-03-14 19:12:31
* @LastEditors: DY
* @Description:
*/
@ -33,3 +33,21 @@ export function listByParentId(query) {
params: query
})
}
// 获得产线工段设备树形结构
export function getTree(query) {
return request({
url: '/base/core-factory/getTree',
method: 'get',
params: query
})
}
// 获得设备分组列表
export function getgroupAllList(query) {
return request({
url: '/base/equipment-group/listAll',
method: 'get',
params: query
})
}

View File

@ -1,7 +1,7 @@
/*
* @Author: zhp
* @Date: 2023-10-18 09:33:57
* @LastEditTime: 2023-11-03 09:31:17
* @LastEditTime: 2024-03-20 15:39:27
* @LastEditors: zhp
* @Description:
*/
@ -33,3 +33,12 @@ export function exportEnergyPlcExcel(query) {
responseType: 'blob'
})
}
export function exportEquipmentTraceabilityExcel(query) {
return request({
url: '/analysis/equipment-analysis/export-efficiency',
method: 'get',
params: query,
responseType: 'blob'
})
}

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

@ -94,7 +94,7 @@
:show-file-list="false"
icon="el-icon-upload2"
:disabled="disabled"
:before-upload="beforeUpload"
:before-upload="col.uploadTips ? beforeUploadPic : beforeUpload"
:on-success="
(response, file, fileList) => {
handleUploadSuccess(response, file, col.prop);
@ -110,7 +110,7 @@
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
{{ '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
@ -416,6 +416,26 @@ export default {
//
beforeUpload(file) {
const checkFileSize = () => {
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$modal.msgError('上传文件大小不能超过 2MB!');
}
return isLt2M;
};
// const checkFileType = () => {
// const isJPG =
// file.type === 'image/jpeg' ||
// file.type === 'image/png' ||
// file.type === 'image/jpg';
// return isJPG;
// };
// return checkFileSize() && checkFileType();
return checkFileSize();
},
// ----
beforeUploadPic(file) {
const checkFileSize = () => {
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
@ -428,6 +448,9 @@ export default {
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/jpg';
if (!isJPG) {
this.$modal.msgError('只能上传jpg/png文件!');
}
return isJPG;
};
return checkFileSize() && checkFileType();

View File

@ -104,7 +104,7 @@ export const DICT_TYPE = {
ORDER_PRIORITY: 'order_priority',
PACK_SPEC: 'pack_spec',
WORK_ORDER_STATUS: 'work_order_status',
// ============== EQUIPMENT - 设备模块 =============
MAINTAIN_TYPE: 'maintain_type',
FAULT_LEVEL: 'fault-level',
@ -116,7 +116,9 @@ export const DICT_TYPE = {
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
// ============== GROUP - 班组模块 =============
WORK_SHOP: 'workshop'
WORK_SHOP: 'workshop',
// ============== GROUP - 质量模块 =============
MATERIAL_GRADE: 'material_grade'
}
/**

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-23 16:11:33
* @LastEditTime: 2024-03-12 09:05:20
* @Description:
-->
<template>
@ -715,6 +715,7 @@ export default {
qualityMonthTableProps,
modelMonth: '',
qualityList1,
// logoutTime: 43200000,
qualityTableProps2,
qualityList2,
dateType: '0',
@ -869,6 +870,8 @@ export default {
</script>
<style lang="scss" scoped>
.visual-container {
width: 1920px;
height: 1080px;
@ -885,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-23 16:11:40
* @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>
@ -341,7 +335,9 @@ export default {
// offsetWidth: null,
cxNameList,
cxDataList,
// time:12,
cutProps,
// logoutTime: 43200000,
cutTableDataList:[],
clientWidth: 0,
containerWidth: 111111,
@ -432,36 +428,15 @@ export default {
this.beilv2 = _this.clientWidth / 1920
})()
}
// let obj = {
// 'a': 11111,
// 'b': 22222,
// 'c': 33333,
// 'd': 44444,
// 'e': 55555,
// logoutInterval = setInterval(() => {
// this.logoutTime -= 1000
// }, 1000)
// if (this.logoutTime === 0) {
// this.SJGInitWebSocket()
// this.CutInitWebSocket()
// this.funInitWebSocket()
// this.logoutTimeReset()
// }
// let index = 0
// for (let i in obj) {
// index++,
// console.log(index);
// }
// this.getList()
// const _this = this;
// window.onresize = () => {
// return (() => {
// _this.clientWidth = `${document.documentElement.clientWidth}`
// this.beilv2 = _this.clientWidth / 1920
// })()
// }
// this.beilv2 = window.innerWidth / 1920
// addEventListener('resize', resizeFun = () => {
// this.beilv2 = window.innerWidth / 1920
// })
// erd.listenTo(document, (element) => {
// this.beilv2 = element.offsetWidth / 1920
// // var width = element.offsetWidth;
// // var height = element.offsetHeight;
// });
},
// beforeDestroy() {
// //
@ -469,13 +444,16 @@ export default {
// removeEventListener('resize', resizeFun)
// },
methods: {
// logoutTimeReset() {
// this.logoutTime = this.time * 60 * 60 * 1000
// },
CutWebsocketClose(e) {
console.log('WebSocket 断开连接', e)
},
SJGWebsocketClose(e) {
console.log('WebSocket 断开连接', e)
},
funInitWebSocket(e) {
funWebSocketClose(e) {
console.log('WebSocket 断开连接', e)
},
formatTime(time, option) {
@ -731,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

@ -1,6 +1,6 @@
<template>
<div>
<div :id="id" :class="className" :style="{ height: height + 'px', width: width }" />
<div :id="id" :class="className" :style="{ height: '420px', width: width }" />
</div>
</template>
@ -19,7 +19,7 @@ export default {
},
className: {
type: String,
default: 'chart'
default: 'enChart'
},
width: {
type: String,
@ -84,7 +84,7 @@ export default {
},
methods: {
initChart(nameList, dataList) {
console.log('1111', dataList);
// console.log('1111', dataList);
// console.log(1)
this.chart = echarts.init(document.getElementById(this.id))
// if (dataList.length !== 0) {
@ -123,13 +123,7 @@ export default {
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
top: 30,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
grid: { top: 90, right: 60, bottom: 20, left: 90 },
// legend: {
// itemWidth: 10,
// itemHeight: 10,
@ -145,7 +139,7 @@ export default {
axisLine: {
lineStyle: {
type: 'solid',
color: '#213259', // 线
color: '#25528f', // 线
width: '1' // 线
}
},
@ -156,7 +150,7 @@ export default {
},
splitLine: {
lineStyle: {
color: '#213259'
color: '#25528f'
}
},
data: this.nameList
@ -172,17 +166,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",
},
}
},
@ -205,4 +199,11 @@ export default {
}
}
</script>
<style>
.enChart {
position: absolute;
height: 100%;
width: 100%;
top: -30px;
}
</style>

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-22 16:40:46
* @Description:
-->
<template>
@ -632,12 +632,12 @@ export default {
])
this.eqConfig.data = eqArr
this.$refs['eqScrollBoard'].updateRows(eqArr)
this.getList()
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 = () => {
@ -671,52 +671,52 @@ export default {
// removeEventListener('resize', resizeFun)
// },
methods: {
getList() {
this.$axios.get(
'base/core-production-line/listAll',
'get',
this.queryParams
).then((res) => {
// console.log('11111', res);
this.productLineList = res.data
})
this.$axios.get(
'base/quality-inspection-record/dayStatistics',
'get',
).then((res) => {
// console.log('11111', res);
let processArr = qualityMonthList.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)
}
})
},
// getList() {
// // this.$axios.get(
// // 'base/core-production-line/listAll',
// // 'get',
// // this.queryParams
// // ).then((res) => {
// // // console.log('11111', res);
// // this.productLineList = res.data
// // })
// this.$axios.get(
// 'base/quality-inspection-record/dayStatistics',
// 'get',
// ).then((res) => {
// // console.log('11111', res);
// let processArr = qualityMonthList.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() {
setInterval(this.getTimesInterval, 1000);
},
@ -837,24 +837,25 @@ export default {
this.$refs['eqScrollBoard'].updateRows(eqArr)
// console.log(SJGWsData.orderList)
} else if (this.SJGWsData.type === 'productline') {
console.log('aaaaaaaaaaaaaaaaaaa', this.SJGWsData);
// console.log(this.wsData.detData);
let nameList = []
let passRateList = []
let outputNumList = []
// console.log('2222222222', this.productLineList);
this.productLineList.forEach((item) => {
// this.productLineList.forEach((item) => {
this.SJGWsData.detData.forEach((ele) => {
if (item.id == ele.productionLineId) {
if (item.name.substr(0, 1) == "D") {
console.log(ele)
nameList.push(item.name)
// if (item.id == ele.productionLineId) {
// if (item.name.substr(0, 1) == "D") {
// console.log(ele)
nameList.push(ele.lineName)
outputNumList.push(ele.outputNum)
passRateList.push(ele.passRate)
}
}
// }
// }
})
})
// })
// progressRateList = EnergyNameList
// let EnergyDataList = []
// this.SJGWsData.detData.forEach((ele) => {
@ -864,7 +865,22 @@ export default {
// console.log(this.EnergyMonitoringNameList)
// console.log(this.EnergyMonitoringList)
// this.$nextTick(() => {
this.$refs.productLineChart.initChart(Array.from(new Set(nameList)), passRateList, outputNumList)
this.$refs.productLineChart.initChart(nameList, passRateList, outputNumList)
} else if (this.SJGInitWebSocket === 'inspection') {
let processArr = qualityMonthList.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)
}
},
//
@ -982,6 +998,8 @@ export default {
</script>
<style lang="scss" scoped>
.visual-container {
width: 1920px;
height: 1080px;
@ -993,12 +1011,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 +1027,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

@ -32,7 +32,7 @@ import { parseTime } from '../../core/mixins/code-filter';
import {
getcoreAlarmLogPage
} from '@/api/base/coreAlarmLog';
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {DICT_TYPE, getDictDatas, publicFormatter } from "@/utils/dict";
const tableProps = [
{
@ -50,7 +50,8 @@ const tableProps = [
},
{
prop: 'alarmGrade',
label: '报警级别'
label: '报警级别',
filter: publicFormatter(DICT_TYPE.EQU_ALARM_LEVEL)
},
{
prop: 'alarmReason',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-12-12 16:04:44
* @LastEditTime: 2024-03-20 16:20:39
* @Description:
-->
<template>
@ -130,6 +130,11 @@ export default {
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
const tempPic = []
this.dataForm.files?.forEach(item => {
tempPic.push(item.fileUrl)
})
this.files = tempPic.join(',')
if (this.setData) {
this.setDataForm()
}
@ -150,8 +155,8 @@ export default {
}
this.dataForm.files = []
if (this.files.length > 0) {
this.files.forEach(item => {
if (this.files.split(',').length > 0) {
this.files.split(',').forEach(item => {
const temp = {
fileType: 1,
fileUrl: item

View File

@ -7,10 +7,11 @@
<template>
<el-drawer
:visible="visible"
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="true"
class="drawer"
:before-close="beforeClose"
custom-class="mes-drawer"
size="60%"
@closed="$emit('destroy')">
@ -81,12 +82,12 @@
</section>
</div>
<div class="drawer-body__footer">
<div v-if="mode == 'edit'" class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
编辑
</el-button>
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
</el-button> -->
<el-button type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
@ -298,6 +299,17 @@ export default {
}
},
methods: {
beforeClose(done) {
if (this.mode.includes('edit')) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
handleTableBtnClick({ type, data }) {
switch (type) {
case 'edit':

View File

@ -387,6 +387,7 @@ export default {
label: '设备图片',
prop: 'files2',
fileType: 1,
uploadTips: true
},
],
[{ input: true, label: '备注', prop: 'remark' }],
@ -486,6 +487,7 @@ export default {
pageSize: 10,
code: '',
name: '',
special: false
},
//
form: {

View File

@ -298,9 +298,9 @@ export default {
//
sort: undefined,
// 线
lineDataType: undefined,
lineDataType: 0,
//
sectionDataType: undefined,
sectionDataType: 0,
};
this.resetForm('form');
},

View File

@ -161,7 +161,7 @@ export default {
{
upload: true,
label: '上传资料',
prop: 'files',
prop: 'files'
},
],
[{ input: true, label: '备注', prop: 'remark' }],

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-12-14 13:52:42
* @LastEditTime: 2024-03-14 10:02:53
* @Description:
-->
<template>
@ -169,7 +169,7 @@ export default {
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
if (this.test.length > 1 || this.test[0].name) {
if (this.test.length > 1 || this.test[0]?.name) {
this.test.forEach(check => {
check.hotMaterialId = this.dataForm.id
if (check.id) {
@ -191,7 +191,7 @@ export default {
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
if (this.test.length > 1 || this.test[0].name) {
if (this.test.length > 1 || this.test[0]?.name) {
this.test.forEach(check => {
check.hotMaterialId = response.data
createHotMaterialCheck(check).then(res => {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-29 15:01:25
* @LastEditTime: 2024-03-13 13:54:01
* @Description:
-->
<template>
@ -254,7 +254,7 @@ export default {
dataRule: {
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
specifications: [{ required: true, message: "规格不能为空", trigger: "blur" }],
specifications: [{ required: false, message: "规格不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }]
}

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-18 13:53:09
* @LastEditTime: 2024-03-13 13:54:48
* @Description:
-->
<template>
@ -33,14 +33,14 @@
<el-select
v-model="dataForm.roomNameDict"
filterable
:disabled="isdetail || isedit"
clearable
style="width: 100%"
placeholder="请选择车间名称">
<el-option
v-for="(dict, index) in getDictDatas('workshop')"
:key="index"
:label="dict.label"
:value="dict.value" />
:value="Number(dict.value)" />
</el-select>
</el-form-item>
</el-col>
@ -125,6 +125,26 @@ export default {
this.getDict()
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
// this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
async getDict() {
//
const factoryRes = await getFactoryList();

View File

@ -84,7 +84,7 @@
<el-radio :label="1">产品基础BOM</el-radio>
<el-radio :label="2">工艺扩展BOM</el-radio>
</el-radio-group> -->
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" @change="materialMethodChange">
<el-select v-model="dataForm.materialMethod" placeholder="请选择物料计算方式" style="width: 100%;" clearable @change="materialMethodChange">
<el-option key="1" label="产品基础BOM" :value="1" />
<el-option key="2" label="工艺扩展BOM" :value="2" />
</el-select>
@ -92,7 +92,7 @@
</el-col>
<el-col :span='8'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="dataForm.priority" placeholder="请选择优先级" style="width: 100%;">
<el-select v-model="dataForm.priority" clearable placeholder="请选择优先级" style="width: 100%;">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
@ -104,7 +104,7 @@
</el-col>
<el-col :span='8'>
<el-form-item label="工单类型" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择工单类型" style="width: 100%;">
<el-select v-model="dataForm.type" clearable placeholder="请选择工单类型" style="width: 100%;">
<el-option
v-for="item in workOrderTypeList"
:key="item.id"
@ -121,7 +121,9 @@
<el-select
v-model="dataForm.roomNameDict"
filterable
clearable
style="width: 100%"
@change="setLine"
placeholder="请选择车间名称">
<el-option
v-for="(dict, index) in getDictDatas('workshop')"
@ -133,7 +135,7 @@
</el-col>
<el-col :span='8'>
<el-form-item label="关联产线" prop="productLineIds">
<el-select v-model="dataForm.productLineIds" placeholder="请选择关联产线" multiple style="width: 100%;">
<el-select v-model="dataForm.productLineIds" clearable placeholder="请选择关联产线" multiple style="width: 100%;">
<el-option
v-for="item in productLineList"
:key="item.id"
@ -145,7 +147,7 @@
</el-col>
<el-col :span='8'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="dataForm.workers" placeholder="请输入负责人"></el-input>
<el-input v-model="dataForm.workers" clearable placeholder="请输入负责人"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -162,7 +164,7 @@
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLineAll } from '@/api/base/productionLine'
import { getLinelistByRoom, getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add';
export default {
@ -184,8 +186,8 @@ export default {
code: '',
planProductId: '',
specifications: '',
planStartTime: '',
planFinishTime: '',
planStartTime: undefined,
planFinishTime: undefined,
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
@ -204,7 +206,8 @@ export default {
planAssignQuantity: [{ required: true, message: "计划投入数量不能为空", trigger: "blur" }],
planQuantity: [{ required: true, message: "计划生产数量不能为空", trigger: "blur" }],
roomNameDict: [{ required: true, message: "车间名称不能为空", trigger: "blur" }],
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }]
productLineIds: [{ required: true, message: "关联产线不能为空", trigger: "change" }],
materialMethod: [{ required: true, message: "物料计算方式不能为空", trigger: "change" }]
},
productList: [],
processFlowList: [],
@ -223,6 +226,14 @@ export default {
this.getDict()
},
methods: {
setLine() {
// 线
getLinelistByRoom({
room: this.dataForm.roomNameDict
}).then(res => {
this.productLineList = res.data || []
})
},
//
materialMethodChange(val) {
if (val === 2 && !this.dataForm.processFlowId) {
@ -237,7 +248,31 @@ export default {
this.dataForm.materialMethod = 1
}
},
reset() {
this.dataForm = {
id: undefined,
workOrderId: '',
name: '',
code: '',
planProductId: '',
specifications: '',
planStartTime: undefined,
planFinishTime: undefined,
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
triggerOrigin: 1,
priority: '',
productLineIds: [],
type: '',
workers: '',
roomNameDict: '',
status: 1
}
},
init(id) {
this.reset();
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
@ -245,6 +280,7 @@ export default {
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
console.log('222', this.dataForm)
this.planStartTime = ''
this.planFinishTime = ''
if (this.dataForm.id) {
@ -253,6 +289,12 @@ export default {
if (this.dataForm.priority !== undefined) {
this.dataForm.priority = String(this.dataForm.priority)
}
if (this.dataForm.planStartTime === 0) {
this.dataForm.planStartTime = undefined
}
if (this.dataForm.planFinishTime === 0) {
this.dataForm.planFinishTime = undefined
}
if (this.dataForm.roomNameDict !== undefined) {
this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
}

View File

@ -2,80 +2,100 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-29 10:01:52
* @LastEditTime: 2024-03-22 08:53:20
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="true"
class="drawer"
size="55%">
size="55%"
:before-close="beforeClose"
@closed="$emit('destroy')"
>
<small-title slot="title" :no-padding="true">
{{ '分配产量' }}
</small-title>
<div class="content">
<div class="formContent">
<el-row :gutter="20">
<el-col :span="12">工单名称:{{ dataForm.name }}</el-col>
<el-col :span="12">工单编码:{{ dataForm.code }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">产品名称:{{ dataForm.productName }}</el-col>
<el-col :span="12">产品规格:{{ dataForm.specifications }}</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">实际生产数量:{{ dataForm.expectedTime }}</el-col>
</el-row>
<el-form :model="dataForm" ref="dataForm" label-width="120px" label-position="top" class="demo-ruleForm" :rules="rules">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="工单名称" prop="name">
<!-- <el-input v-model="dataForm.name" autocomplete="off"></el-input> -->
<span>{{ dataForm.name }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工单编码" prop="code">
<span>{{ dataForm.code }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="productName">
<span>{{ dataForm.productName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="产品规格" prop="specifications">
<span>{{ dataForm.specifications }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际生产数量" prop="actualQuantity">
<el-input v-model.number="dataForm.actualQuantity" autocomplete="off" style="width: 80%" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际生产完成时间" prop="finishProduceTime">
<el-date-picker
v-model="dataForm.finishProduceTime"
type="datetime"
value-format="timestamp"
placeholder="选择实际生产完成时间" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="attr-list">
<div v-show="!isdetail" class="attr-list">
<!-- <el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button> -->
<el-table
:data="tableData"
style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="orderName" label="订单名称" />
<el-table-column prop="orderCode" label="订单编码" />
<el-table-column prop="priority" label="优先级" />
<el-table-column prop="planAssignmentQuantity" label="计划分配数量" >
<template slot-scope="scope">
<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</template>
</el-table-column>
<el-table-column prop="actualAssignmentQuantity" label="实际分配数量">
<template slot-scope="scope">
<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="saveData(scope.row)">保存</el-button>
<!-- <el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑">
<el-button
type="text"
:style="{color:'#0B58FF'}"
size="mini"
@click="edit(scope.row)"
>
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" />
</el-button>
</el-tooltip> -->
<!-- <el-tooltip placement="top" content="删除">
<el-button
type="text"
:style="{color:'#FF5454'}"
size="mini"
@click="deleteDetail(scope.row)"
>
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" />
</el-button>
</el-tooltip> -->
</template>
</el-table-column>
</el-table>
<el-form ref="tableForm" :model="form" style="padding: 0">
<el-table
ref="table"
:data="form.tableData"
row-key="id"
style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="orderName" label="订单名称" />
<el-table-column prop="orderCode" label="订单编码" />
<el-table-column prop="priority" label="优先级" />
<el-table-column prop="planAssignmentQuantity" label="计划分配数量" >
<template slot-scope="scope">
<el-form-item prop="planAssignmentQuantity">
<el-input v-model.number="scope.row.planAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="*实际分配数量">
<template slot-scope="scope">
<el-form-item :prop="`tableData.${scope.$index}.actualAssignmentQuantity`" :rules="[{ required: true, message: '实际分配数量不能为空', trigger: 'blur' }]">
<el-input v-model.number="scope.row.actualAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</el-form-item>
</template>
</el-table-column>
<!-- <el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="saveData(scope.row)">保存</el-button>
</template>
</el-table-column> -->
</el-table>
</el-form>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
@ -86,11 +106,11 @@
</div>
<div class="drawer-body__footer">
<el-button style="" type="primary" @click="goback()">关闭</el-button>
<el-button style="" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> -->
</el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</div>
@ -104,7 +124,7 @@
<script>
import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, updateConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
import { getConOrderList, updateConCoreWOr, updateBatchConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add';
@ -128,6 +148,10 @@ export default {
code: undefined,
productId: '',
remark: undefined,
},
form: {
tableData: []
},
productList: [],
materialAttrList: [],
@ -135,11 +159,94 @@ export default {
tableData: [],
visible: false,
isdetail: false,
idAttrShow: false
idAttrShow: false,
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
},
};
},
mounted() {},
methods: {
beforeClose(done) {
// if (this.mode.includes('edit')) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
//
dataFormSubmit() {
// console.log('', this.$refs['table'])
console.log('nihc ', this.form.tableData)
// this.$refs['tableForm'].validate((valid) => {
// if (valid) {
// alert('!');
// } else {
// alert('!');
// return false;
// }
// });
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
this.$refs['tableForm'].validate((valid) => {
if (!valid) {
return false;
}
//
console.log('aaaaaaa', this.form.tableData)
//
let num = 0
const tempList = this.form.tableData.map((item) => {
item.workOrderId = this.dataForm.id
num += item.actualAssignmentQuantity
return item
})
if (num <= this.dataForm.actualQuantity) {
if (this.dataForm.id) {
statusChange({
id: this.dataForm.id,
status: 4,
finishProduceTime: this.dataForm.finishProduceTime,
actualQuantity: this.dataForm.actualQuantity
}).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.saveData(tempList)
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
} else {
this.$message.error('实际分配数量超过实际生产数量!')
}
console.log('2111', num, tempList)
});
//
// if (this.dataForm.id) {
// statusChange({
// id: this.dataForm.id,
// status: 4,
// finishProduceTime: this.dataForm.finishProduceTime,
// actualQuantity: this.dataForm.actualQuantity
// }).then(response => {
// this.$modal.msgSuccess("");
// this.visible = false;
// this.$emit("refreshDataList");
// });
// return;
// }
//
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("");
// this.visible = false;
// this.$emit("refreshDataList");
// });
});
},
initData() {
// this.materialAttrList.splice(0);
this.listQuery.total = 0;
@ -147,30 +254,14 @@ export default {
edit(row) {
row.isEdit = true
},
saveData(row) {
if (row.actualAssignmentQuantity) {
if (row.id) {
// updateMaterialPBDet({
// ...row
// }).then((response) => {
// this.$modal.msgSuccess('');
// // this.visible = false;
// this.getList();
// });
// return;
}
//
updateConCoreWOr({
...row,
workOrderId: this.dataForm.id
}).then((response) => {
this.$modal.msgSuccess('分配成功');
// this.visible = false;
this.getList();
});
} else {
this.$message.warning('请填写实际分配数量');
}
saveData(list) {
console.log('你好', list)
//
updateBatchConCoreWOr(list).then((response) => {
this.$modal.msgSuccess('分配成功');
// this.visible = false;
this.getList();
});
},
getList() {
//
@ -183,6 +274,7 @@ export default {
item.isallocation = item.actualAssignmentQuantity ? true : false
return item
});
this.$set(this.form, 'tableData', this.tableData)
this.listQuery.total = response.data.length;
});
},
@ -242,6 +334,9 @@ export default {
};
</script>
<style scoped>
/* .item .el-form-item__label {
color: red;
} */
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
@ -250,6 +345,7 @@ export default {
.drawer >>> .el-form-item__label {
padding: 0;
font-weight: 600;
}
.drawer >>> .el-drawer__header {
@ -296,4 +392,18 @@ export default {
margin-bottom: 10px;
width: 100%;
}
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
/* height: 16px; */
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-29 15:35:02
* @LastEditTime: 2024-03-21 16:52:46
* @Description:
-->
<template>
@ -16,7 +16,13 @@
<!-- <small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title> -->
<div v-show="workOrderButton.length" class="buttonDiv">
<div v-show="workOrderButton.length" style="position: relative;padding-right: 90px;">
<topTabVue :orderIdList='workOrderButton' :orderId="workorderId" @emitFun='toggleName' />
<el-button type="primary" plain size="small"
style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="goback"><svg-icon
icon-class="return" /> 返回</el-button>
</div>
<!-- <div v-show="workOrderButton.length" class="buttonDiv">
<div style="display: flex; width: 100%;">
<el-button v-show="showScroll" type="text" style="width: 30px; background: white; margin-right: 8px" @click="scrollLeft" icon="el-icon-caret-left"></el-button>
<div ref="content" class="scrollDiv">
@ -27,7 +33,7 @@
<svg-icon icon-class="return"/>返回
</el-button>
</div>
</div>
</div> -->
<div class="content">
<div class="card">
<div class="boxTitle">
@ -97,6 +103,10 @@
<div class="blodTip">关联工艺</div>
<div class="lightTip">{{ dataForm.processFlowName }}</div>
</el-col>
<el-col :span="3">
<div class="blodTip">车间名称</div>
<div class="lightTip">{{ (dataForm.roomNameDict || dataForm.roomNameDict === 0) ? getDictDataLabel('workshop', dataForm.roomNameDict) : '-' }}</div>
</el-col>
</el-row>
</div>
</div>
@ -153,7 +163,7 @@
</el-col>
<el-col :span="3">
<div class="blodTip">废片数量</div>
<div class="lightTip">{{ dataForm.nokQuantity }}</div>
<div class="lightTip">{{ dataForm.nokNum }}</div>
</el-col>
<el-col :span="3">
<div class="blodTip">检测瑕疵数</div>
@ -218,12 +228,13 @@
<script>
// import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getCoreWOMaPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
import { getCoreWO, getCoreWOMaPage, getlistByProductId, getlistByFlowId, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
// import { orderList } from "@/api/base/orderManage";
import { getProcessFlowList } from '@/api/base/orderManage'
import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import topTabVue from '../../order/base/orderManage/components/topTab.vue';
const tableBtn = [
{
@ -261,9 +272,9 @@ const tableProps = [
const tableProps1 = [
{
prop: 'material',
label: '物料名称',
filter: publicFormatter('material')
prop: 'materialName',
label: '物料名称'
// filter: publicFormatter('material')
},
{
prop: 'unit',
@ -274,10 +285,14 @@ const tableProps1 = [
prop: 'remaining',
label: '剩余生产预计消耗'
},
{
prop: 'num',
label: '库存数量'
}
];
export default {
components: { SmallTitle },
components: { SmallTitle, topTabVue },
data() {
return {
tableBtn,
@ -300,6 +315,7 @@ export default {
dataForm: {},
orderList: [],
materialList: [],
workorderId: '',
// orderArray: [],
visible: false,
isdetail: false,
@ -323,13 +339,15 @@ export default {
name: work.name
}
})
const contentRef = this.$refs.content
if (contentRef.scrollWidth > contentRef.clientWidth) {
this.showScroll = true
} else {
this.showScroll = false
}
console.log(contentRef.scrollWidth, contentRef.clientWidth)
this.workorderId = this.workOrderButton[0].id
console.log('wawa ew', this.workorderId, this.workOrderButton)
// const contentRef = this.$refs.content
// if (contentRef.scrollWidth > contentRef.clientWidth) {
// this.showScroll = true
// } else {
// this.showScroll = false
// }
// console.log(contentRef.scrollWidth, contentRef.clientWidth)
this.init(this.workOrderButton[0].id, true)
})
} else {
@ -337,6 +355,11 @@ export default {
}
},
methods: {
// tab
toggleName(val) {
this.workorderId = val
this.init(val, true)
},
scrolRight() {
// let contentRef = this.$refs.content
// console.log('', contentRef.scrollWidth, contentRef.clientWidth)
@ -434,17 +457,38 @@ export default {
// 使
console.log()
if (this.dataForm.id) {
getCoreWOMaPage({
workOrderId: this.dataForm.id,
pageNo: 1,
pageSize: 100
}).then((response) => {
this.materialList = response.data.records.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
if (this.dataForm.materialMethod === 1) {
//
getlistByProductId({
id: this.dataForm.planProductId
}).then((response) => {
this.materialList = response.data.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
});
});
// this.listQuery.total = response.data.length;
});
} else {
//
getlistByFlowId({
id: this.dataForm.processFlowId
}).then((response) => {
this.materialList = response.data.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
});
});
}
// getCoreWOMaPage({
// workOrderId: this.dataForm.id,
// pageNo: 1,
// pageSize: 100
// }).then((response) => {
// this.materialList = response.data.records.map((item) => {
// item.remaining = item?.num * this.dataForm.remainingQuantity || 0
// return item
// });
// // this.listQuery.total = response.data.length;
// });
}
//
// orderList({

View File

@ -43,7 +43,8 @@
<allocation
v-if="allocationVisible"
ref="allocation"
@refreshDataList="getDataList" />
@refreshDataList="searchStatus"
@destroy="allocationVisible = false" />
</div>
</template>
@ -353,6 +354,11 @@ export default {
this.getDataList()
},
methods: {
searchStatus() {
setTimeout(() => {
this.getDataList()
}, 20000)
},
getWorkOrder() {
getCoreWOList().then(res => {
this.formConfig[0].selectOptions = res.data.map(item => {
@ -431,28 +437,33 @@ export default {
opration = '终止'
}
console.log('22',val)
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
statusChange(param).then(({ data }) => {
this.$message({
message: '操作成功!工单状态稍后将会更新!',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
//
if (param.status === 4) {
this.allocationOrder(param);
}
},
if (param.status !== 4) {
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
statusChange(param).then(({ data }) => {
this.$message({
message: '操作成功!工单状态稍后将会更新!',
type: 'success',
duration: 1500,
onClose: () => {
this.searchStatus();
//
// if (param.status === 4) {
// this.allocationOrder(param);
// }
},
});
});
});
})
.catch(() => { });
})
.catch(() => { });
} else {
//
this.allocationOrder(param);
}
}
},
allocationOrder(val) {
@ -460,20 +471,25 @@ export default {
getConOrderList({
workOrderId: val.id,
}).then((response) => {
if (response.data.length > 0) {
this.$confirm('工单结束,可分配产量', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.allocationVisible = true;
this.$nextTick(() => {
this.$confirm('工单结束,可分配产量', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.allocationVisible = true;
this.$nextTick(() => {
if (response.data.length > 0) {
// id
this.$refs.allocation.init(val.id);
} else {
this.$refs.allocation.init(val.id, true);
});
})
.catch(() => { });
}
}
});
})
.catch(() => { });
// this.listQuery.total = response.data.total;
});
},

View File

@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-21 09:41:39
* @LastEditTime: 2024-03-21 15:21:32
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
:wrapper-closable="true"
:before-close="beforeClose"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
@ -256,6 +257,17 @@ export default {
this.getDict()
},
methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
async getDict() {
//
// const res = await listData({

View File

@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-27 19:50:36
* @LastEditTime: 2024-03-21 14:39:52
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
:wrapper-closable="true"
:before-close="beforeClose"
class="drawer"
size="70%">
<small-title slot="title" :no-padding="true">
@ -196,6 +197,17 @@ export default {
this.getDict()
},
methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.deleteDetail(raw.data);
@ -246,7 +258,7 @@ export default {
});
},
initData() {
// this.materialAttrList.splice(0);
this.tableData.splice(0);
this.listQuery.total = 0;
},
deleteDetail(raw) {
@ -284,18 +296,18 @@ export default {
});
},
//
addRow() {
const row = {
bomId: this.dataForm.id,
materialId: '',
num: 0,
materialCode: undefined,
unit: undefined,
remark: '',
isEdit: true
}
this.tableData.push(row)
},
// addRow() {
// const row = {
// bomId: this.dataForm.id,
// materialId: '',
// num: 0,
// materialCode: undefined,
// unit: undefined,
// remark: '',
// isEdit: true
// }
// this.tableData.push(row)
// },
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-10-17 16:50:19
* @LastEditTime: 2024-01-22 09:55:32
* @LastEditTime: 2024-03-20 08:36:01
* @LastEditors: zhp
* @Description:
-->
@ -23,7 +23,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="标签类型" prop="typeId">
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择打印方式" clearable>
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择标签类型" clearable>
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>

View File

@ -46,6 +46,7 @@
import BalanceChart from '../balanceChart';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AnalysisChart from './chart.vue';
import { parseTime } from '@/utils/ruoyi'
export default {
components: {
@ -82,7 +83,7 @@ export default {
{
type: 'datePicker',
label: '时间',
dateType: 'monthrange',
dateType: 'month',
format: 'yyyy-MM',
valueFormat: 'timestamp',
rangeSeparator: '-',
@ -255,13 +256,13 @@ export default {
const date = eq.dynamicName;
eq.children.forEach((sub) => {
if (sub.dynamicName == '设备CT')
row[date + '_eq_ct'] = sub.dynamicValue;
row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2);
if (sub.dynamicName == '设备TT')
row[date + '_eq_tt'] = sub.dynamicValue;
row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2);
if (sub.dynamicName == '产线CT')
row[date + '_pl_ct'] = sub.dynamicValue;
row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2);
if (sub.dynamicName == '产线TT')
row[date + '_pl_tt'] = sub.dynamicValue;
row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2);
});
});
this.tableData.push(row);
@ -369,21 +370,63 @@ export default {
// this.dataListLoading = false;
});
},
changeTime(val) {
console.log(val)
if(val) {
const timeStamp = new Date(val).getMonth(); //
console.log('沃尔沃', timeStamp)
const fullyear = new Date(val).getFullYear()
let days = 0
switch (timeStamp) {
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
break
}
this.queryParams.startTime = new Date(fullyear, timeStamp, 1, 0, 0, 0).getTime() //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.queryParams.endTime = new Date(fullyear, timeStamp, days, 23, 59, 59).getTime() //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.queryParams.startTime = undefined
this.queryParams.endTime = undefined
}
},
handleSearchBarBtnClick(btn) {
switch (btn.btnName) {
case 'search':
this.queryParams.lineId = btn.lineIds || null;
this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
console.log('2222', new Date(btn.timeArr).getFullYear())
this.changeTime(btn.timeArr)
// this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
// this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
if (!btn.lineIds || !btn.timeArr.length) {
if (!btn.lineIds || !btn.timeArr) {
this.$message({
message: '请选择产线和时间',
type: 'warning',
});
} else {
this.getList();
}
this.getList();
break;
}
},

View File

@ -17,6 +17,7 @@
:table-props="tableProps"
:table-data="tableData"
@emitFun="handleEmitFun"
:max-height="tableH"
/>
</div>
</div>
@ -45,6 +46,7 @@ export default {
arr: [],
spanArr: [],
timeList: [],
tableH: this.tableHeight(240),
tableData: [],
tableProps: [],
spanInfo: {},
@ -54,6 +56,9 @@ export default {
},
computed: {},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(240)
})
this.getList();
},
methods: {
@ -148,6 +153,9 @@ export default {
lineData['spec'] = Array.from(new Set(specs)).join(',')
this.tableData.push(lineData)
})
this.tableData.forEach((item, index) => {
item._index = index + 1
})
console.log('打印', this.tableData)
// this.setRowSpan(sectionArr)
// console.log('', sectionArr)
@ -176,22 +184,26 @@ export default {
console.log('看看数据', res)
this.ResData = res.data
this.arr = [
{
prop: '_index',
label: '序号'
},
{
prop: 'proLineName',
label: '生产线',
fixed: 'left',
// fixed: 'left',
'show-overflow-tooltip': true
},
{
prop: 'workOrderName',
label: '当前工单',
fixed: 'left',
// fixed: 'left',
'show-overflow-tooltip': true
},
{
prop: 'spec',
label: '产品规格',
fixed: 'left',
// fixed: 'left',
'show-overflow-tooltip': true
}
]

View File

@ -30,6 +30,7 @@ import {
} from '@/api/cost/costEneryAutoReport';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
const tableProps = [
{
@ -135,15 +136,23 @@ export default {
this.listQuery.pageSize = 10;
this.listQuery.energyTypeId = val.energyTypeId;
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
this.listQuery.startTime = val.searchTime
? moment(val.searchTime[0]).startOf('day').format('x')
: null;
this.listQuery.endTime = val.searchTime
? moment(val.searchTime[1]).endOf('day').format('x')
: null;
this.getDataList();
break;
case 'export':
const data = {
energyTypeId:val.energyTypeId,
startTime : val.searchTime ? val.searchTime[0] : null,
endTime : val.searchTime ? val.searchTime[1] : null,
startTime : val.searchTime
? moment(val.searchTime[0]).startOf('day').format('x')
: null,
endTime : val.searchTime
? moment(val.searchTime[1]).endOf('day').format('x')
: null,
}
this.handleExport(data);
break;

View File

@ -111,6 +111,7 @@ export default {
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
defaultSelect: [],
},
{
type: 'button',
@ -132,6 +133,14 @@ export default {
},
components: {},
created() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
this.formConfig[2].defaultSelect = [start, end];
this.listQuery.reportTime = [
moment(start).startOf('day').format('x'),
moment(end).endOf('day').format('x'),
];
getEnergyTypeListAll().then((response) => {
this.formConfig[1].selectOptions = response.data;
});

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 13:52:10
* @LastEditors: zwq
* @LastEditTime: 2024-02-19 09:36:50
* @LastEditTime: 2024-03-21 15:59:26
* @Description:
-->
<template>
@ -44,7 +44,7 @@
v-for="item in urlOptions.dictList.dict0"
:key="item.id"
:label="item.label"
:value="item.value"></el-option>
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>

View File

@ -79,10 +79,9 @@ const tableProps = [
align: 'right',
},
{
prop: 'enabledTime',
prop: 'time',
label: '生效时间',
filter: parseTime,
width: 150,
width: 235,
},
{
prop: 'remark',

View File

@ -152,8 +152,12 @@ export default {
case 'export':
this.listQuery.materialId = val.materialId;
this.listQuery.searchTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
this.listQuery.startTime = val.searchTime
? moment(val.searchTime[0]).startOf('day').format('x')
: null;
this.listQuery.endTime = val.searchTime
? moment(val.searchTime[1]).endOf('day').format('x')
: null;
this.handleExport();
break;
default:

View File

@ -110,6 +110,7 @@ export default {
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'searchTime',
defaultSelect: [],
},
{
type: 'button',
@ -131,6 +132,14 @@ export default {
},
components: {},
created() {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
this.formConfig[2].defaultSelect = [start, end];
this.listQuery.times = [
moment(start).startOf('day').format('x'),
moment(end).endOf('day').format('x'),
];
getHotMaterialList().then((response) => {
this.formConfig[1].selectOptions = response.data;
});

View File

@ -1,8 +1,5 @@
<template>
<div
id="analysischartLine"
style="width: 100%;height: 100%;"
></div>
<div id="analysischartLine" style="width: 100%;height: 100%;"></div>
</template>
<script>
import * as echarts from 'echarts'
@ -56,11 +53,10 @@ export default {
let yData = []
for (let j = 0; j < arr.length; j++) {
for (let k = 0; k < keys.length; k++) {
if (keys[k].indexOf(arr[j]+'_上年同期') > -1 || keys[k].indexOf(arr[j]+'_能源消耗') > -1) {
if (keys[k].indexOf(arr[j] + '_上年同期') > -1 || keys[k].indexOf(arr[j] + '_能源消耗') > -1) {
let obj = {
name: '',
type: 'line',
stack: 'Total',
data: []
}
obj.name = keys[k]
@ -71,14 +67,14 @@ export default {
for (let i = 0; i < this.chartData.length; i++) {
xData.push(this.chartData[i].time)
for (let p = 0; p < yData.length; p++) {
yData[p].data.push(this.chartData[i][ yData[p].name])
yData[p].data.push(this.chartData[i][yData[p].name])
}
}
var option = {
color:['#FFDC94','#8EF0AB','#63BDFF','#288AFF','#7164FF','#FF6860','#FF9747','#B0EB42','#D680FF','#0043D2'],
color: ['#FFDC94', '#8EF0AB', '#63BDFF', '#288AFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
legend: {
data: keys,
right:'1%'
right: '1%'
},
tooltip: {
trigger: 'axis'

View File

@ -4,38 +4,23 @@
<el-col :span='12'>
<el-form-item label="能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in this.energyTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='12'>
<el-form-item label="抄表日期" prop="recordTime">
<el-date-picker
v-model="form.recordTime"
type="date"
format="yyyy-MM-dd"
value-format="timestamp"
placeholder="选择日期"
style="width: 100%;">
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
placeholder="选择日期" style="width: 100%;">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span='24'>
<base-table
border
:table-props="tableProps"
:table-data="tableData"
:add-button-show="addButtonShow"
@emitFun="inputChange"
@emitButtonClick="emitButtonClick"
/>
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
@emitFun="inputChange" @emitButtonClick="emitButtonClick" />
</el-col>
</el-row>
</el-form>
@ -46,17 +31,17 @@ import moment from 'moment'
import InputArea from './InputArea'
import SelectArea from './SelectArea'
const tableProps = [
{
prop: 'tableName',
label: '表名',
subcomponent: SelectArea
},
{
prop: 'readingQuantity',
label: '抄表数',
subcomponent: InputArea
}
]
{
prop: 'tableName',
label: '表名*',
subcomponent: SelectArea
},
{
prop: 'readingQuantity',
label: '抄表数*',
subcomponent: InputArea
}
]
export default {
name: 'EnergyQuantityManualAdd',
props: {
@ -72,7 +57,7 @@ export default {
return {
tableProps,
tableData: [],
addButtonShow:'新增',
addButtonShow: '新增',
form: {
id: '',
energyTypeId: '',
@ -98,16 +83,16 @@ export default {
obj.tableName = params.tableName + ''
obj.readingQuantity = 0
this.tableData.push(obj)
}else {
} else {
this.isEdit = true
this.form.id = params.id
this.addButtonShow = ''
energyQuantityManualGet({id: this.form.id}).then(res => {
energyQuantityManualGet({ id: this.form.id }).then(res => {
if (res.code === 0) {
this.form.energyTypeId = res.data.energyTypeId
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
let obj = {}
obj.tableName = res.data.tableName ? res.data.tableName+'' : ''
obj.tableName = res.data.tableName ? res.data.tableName + '' : ''
obj.readingQuantity = res.data.readingQuantity
this.tableData.push(obj)
}
@ -130,10 +115,10 @@ export default {
if (this.tableData.length === 0) {
this.$modal.msgError("抄表数据不能为空");
return false
}else{
} else {
for (let item of this.tableData) {
console.log(item)
if (!item.tableName || (!item.readingQuantity && item.readingQuantity!==0)) {
if (!item.tableName || (!item.readingQuantity && item.readingQuantity !== 0)) {
this.$modal.msgError("抄表数据有空值,请检查");
return false
}
@ -142,11 +127,11 @@ export default {
if (this.isEdit) {
//
energyQuantityManualUpdate({
id:this.form.id,
energyTypeId:this.form.energyTypeId,
recordTime:this.form.recordTime,
tableName:this.tableData[0].tableName,
readingQuantity:this.tableData[0].readingQuantity
id: this.form.id,
energyTypeId: this.form.energyTypeId,
recordTime: this.form.recordTime,
tableName: this.tableData[0].tableName,
readingQuantity: this.tableData[0].readingQuantity
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
@ -155,9 +140,9 @@ export default {
})
} else {
energyQuantityManualCreate({
energyTypeId:this.form.energyTypeId,
recordTime:this.form.recordTime,
data:this.tableData
energyTypeId: this.form.energyTypeId,
recordTime: this.form.recordTime,
data: this.tableData
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");

View File

@ -2,44 +2,20 @@
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="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"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH" @selection-change="selectChange">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" 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" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" @successSubmit="successSubmit" />
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel">
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
@ -68,7 +44,7 @@ const tableProps = [
},
{
prop: 'tableName',
label: '水/气表名',
label: '能源表名',
filter: publicFormatter('table_name'),
minWidth: 110
},
@ -142,25 +118,25 @@ export default {
//
list: [],
tableBtn: [
this.$auth.hasPermi('base:energy-quantity-manual:create')
this.$auth.hasPermi('base:energy-quantity-manual:create')
? {
type: 'meterReading',
btnName: '抄表'
}
type: 'meterReading',
btnName: '抄表'
}
: undefined,
this.$auth.hasPermi('base:energy-quantity-manual:update')
? {
type: 'edit',
btnName: '编辑'
}
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:energy-quantity-manual:delete')
? {
type: 'delete',
btnName: '删除'
}
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
].filter((v) => v),
//
queryParams: {
pageNo: 1,
@ -209,10 +185,10 @@ export default {
break
default:
this.$modal.confirm('是否确认导出').then(() => {
return energyQuantityManualExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '能源报表.xls');
}).catch(() => {})
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
}).then(response => {
this.$download.excel(response, '能源报表.xls');
}).catch(() => { })
}
},
/** 查询列表 */
@ -281,13 +257,13 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
console.log(row.id)
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function() {
return energyQuantityManualDelete({id: row.id});
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function () {
return energyQuantityManualDelete({ id: row.id });
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
}
};

View File

@ -2,27 +2,12 @@
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:selectWidth="55"
:max-height="tableH"
@selection-change="selectChange"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
</div>
</template>
@ -71,7 +56,8 @@ export default {
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId'
param: 'energyTypeId',
filterable: true
},
{
type: 'datePicker',
@ -129,7 +115,7 @@ export default {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
@ -146,7 +132,7 @@ export default {
let arr = location.href.split('?')[1].split('&')
this.formConfig[1].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
} else {
this.formConfig[1].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
this.formConfig[1].defaultSelect = [Date.now() - 7 * 24 * 3600000, Date.now()]
}
this.queryParams.startTime = this.formConfig[1].defaultSelect[0]
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]

View File

@ -16,10 +16,7 @@
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
:key="item.value"
:label="item.label"
<el-option v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
@ -28,9 +25,9 @@
<el-col :span="12">
<el-form-item label="计价方式" prop="pricingMethod">
<el-select v-model="form.pricingMethod" placeholder="请选择" style="width: 100%;">
<el-option label="时间段" :value= '0' ></el-option>
<el-option label="使用量" :value= '1' ></el-option>
<el-option label="固定价位" :value= '2' ></el-option>
<el-option label="时间段" :value='0'></el-option>
<el-option label="使用量" :value='1'></el-option>
<el-option label="固定价位" :value='2'></el-option>
</el-select>
</el-form-item>
</el-col>
@ -38,56 +35,33 @@
<el-row>
<el-col :span="12" v-show="form.pricingMethod === 2">
<el-form-item label="单价(元)" prop="pricingMethod">
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999"
style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" v-show="form.pricingMethod === 1">
<el-form-item label="计量维度" prop="dim">
<el-select v-model="form.dim" placeholder="请选择" style="width: 100%;">
<el-option label="月" :value= '4' ></el-option>
<el-option label="年" :value= '5' ></el-option>
<el-option label="月" :value='4'></el-option>
<el-option label="年" :value='5'></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" v-show="form.pricingMethod === 0">
<el-col :span="24" v-show="form.pricingMethod === 0">
<el-form-item label="时间段" prop="pricingMethod">
<base-table
:key='timeKye'
:table-props="tableProps1"
:table-data="tableData1"
:add-button-show="addButtonShow"
@emitButtonClick="emitButtonClick1"
@emitFun="inputChange1"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick1"
/>
<base-table :key='timeKye' :table-props="tableProps1" :table-data="tableData1"
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick1" @emitFun="inputChange1">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick1" />
</base-table>
</el-form-item>
</el-col>
<el-col :span="24" v-show="form.pricingMethod === 1">
<el-form-item label="使用量" prop="pricingMethod">
<base-table
:key='usedKye'
:table-props="tableProps2"
:table-data="tableData2"
:add-button-show="addButtonShow"
@emitButtonClick="emitButtonClick2"
@emitFun="inputChange2"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick2"
/>
<base-table :key='usedKye' :table-props="tableProps2" :table-data="tableData2"
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick2" @emitFun="inputChange2">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick2" />
</base-table>
</el-form-item>
</el-col>
@ -153,9 +127,11 @@ export default {
name: '',
code: '',
unit: '',
singlePrice: 0,
pricingMethod: 2,
leaderName: '',
push: false
dim: '',
push: false,
description: ''
},
isEdit: false, //
rules: {
@ -182,22 +158,24 @@ export default {
if (id) {
this.isEdit = true
this.form.id = id
getEnergyType( id ).then((res) => {
getEnergyType(id).then((res) => {
if (res.code === 0) {
this.form.name = res.data.name
this.form.code = res.data.code
this.form.unit = res.data.unit
this.form.pricingMethod = res.data.pricingMethod
this.form.leaderName = res.data.leaderName
this.form.push = res.data.push ? true : false
switch(this.form.pricingMethod) {
this.form.push = res.data.push ? true : false
this.form.description = res.data.description
switch (this.form.pricingMethod) {
case 0:
this.tableData1 = res.data.segPriceList || []
break;
case 1:
this.tableData2 = res.data.usedPriceList || []
this.form.dim = res.data.dim
break;
default:
this.form.singlePrice = res.data.singlePrice || 0
}
}
})
@ -234,7 +212,7 @@ export default {
emitButtonClick1() {
let n = this.tableData1.length
let obj = {}
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
obj.startTime = n === 0 ? '' : this.tableData1[n - 1].endTime
obj.endTime = ''
obj.price = 0
this.tableData1.push(obj)
@ -242,7 +220,7 @@ export default {
emitButtonClick2() {
let n = this.tableData2.length
let obj = {}
obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed
obj.startUsed = n === 0 ? 0 : this.tableData2[n - 1].endUsed
obj.endUsed = 0
obj.price = 0
this.tableData2.push(obj)
@ -259,7 +237,7 @@ export default {
submitForm() {
this.$refs['form'].validate((valid) => {
if (valid) {
switch(this.form.pricingMethod) {
switch (this.form.pricingMethod) {
case 0://
if (this.tableData1.length === 0) {
this.$modal.msgError('时间段表格数据不能为空')
@ -289,7 +267,7 @@ export default {
default://
if (!this.form.singlePrice) {
this.$modal.msgError('单价有误请检查,请检查')
return false
return false
}
}
console.log(this.form)
@ -302,11 +280,11 @@ export default {
unit: this.form.unit,
pricingMethod: this.form.pricingMethod,
description: this.form.description,
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
dim: this.form.pricingMethod === 1 ? this.form.dim : '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
push:this.form.push ? 1 : 0
segPriceList: this.form.pricingMethod === 0 ? this.tableData1 : [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2 : [],
push: this.form.push ? 1 : 0
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
@ -320,11 +298,11 @@ export default {
unit: this.form.unit,
pricingMethod: this.form.pricingMethod,
description: this.form.description,
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
dim: this.form.pricingMethod === 1 ? this.form.dim : '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
push:this.form.push ? 1 : 0
segPriceList: this.form.pricingMethod === 0 ? this.tableData1 : [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2 : [],
push: this.form.push ? 1 : 0
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");

View File

@ -2,40 +2,22 @@
<div class="app-container energyOverlimitLog">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
</el-tabs>
<!-- 列表 -->
<div v-if="activeName === 'auto'">
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH" />
</div>
<div v-if="activeName === 'manual'">
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps2"
:table-data="list2" :max-height="tableH" />
</div>
<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" />
</div>
</template>
@ -160,8 +142,8 @@ export default {
method: '1'
},
typeList: [
{id: 1, name: '合并'},
{id: 2, name: '详细'}
{ id: 1, name: '合并' },
{ id: 2, name: '详细' }
]
};
},
@ -183,7 +165,7 @@ export default {
getList() {
getEnergyOverlimitLogPage(this.queryParams).then(response => {
let arr = response.data.list || [];
arr&&arr.map((item) => {
arr && arr.map((item) => {
this.typeList.map((i) => {
if (item.type === i.id) {
item.type = i.name
@ -191,15 +173,21 @@ export default {
})
if (item.minValue && item.maxValue) {
item.limitValue = item.minValue + '-' + item.maxValue
} else if(item.minValue){
} else if (item.minValue) {
item.limitValue = '最小值' + item.minValue
}else if(item.maxValue){
} else if (item.maxValue) {
item.limitValue = '最大值' + item.maxValue
} else {
item.limitValue = ''
}
})
this.list = arr
if (this.queryParams.method === '1') {
this.list = arr
this.list2 = []
} else {
this.list2 = arr
this.list1 = []
}
this.total = response.data.total;
});
},
@ -212,7 +200,7 @@ export default {
toggleTab() {
if (this.activeName === 'auto') {
this.queryParams.method = '1'
}else{
} else {
this.queryParams.method = '2'
}
this.queryParams.pageNo = 1
@ -232,21 +220,27 @@ export default {
height: 2px;
background-color: #e4e7ed;
}
.el-tabs__nav-wrap::after {
width: 0;
}
.el-tabs__item {
padding: 0 10px;
}
.el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item {
color: rgba(0, 0, 0, 0.45);
}
.searchBarBox {
margin-bottom: 0;
}

View File

@ -35,20 +35,20 @@ import {
} from '@/api/equipment/analysis/statistics';
const tableProps = [
{
prop: 'recordTime',
label: '时间段',
filter: (val) => {
if (val && val.length > 0) {
return (
moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
' ~ ' +
moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
);
}
return '-';
},
},
// {
// prop: 'recordTime',
// label: '',
// filter: (val) => {
// if (val && val.length > 0) {
// return (
// moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
// ' ~ ' +
// moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
// );
// }
// return '-';
// },
// },
{
prop: 'lineName',
label: '产线',
@ -158,7 +158,7 @@ export default {
: '',
btnName: '导出',
name: 'export',
color: 'warning',
color: 'primary',
plain: true,
},
],

View File

@ -104,24 +104,24 @@ export default {
{ name: '故障时长', value: 580 },
],
},
{
//
name: '',
type: 'pie',
center: ['50%', '48%'],
radius: ['60%', '75%'],
itemStyle: {
borderRadius: 10,
},
label: {
show: false,
},
data: [
//<=========
{ name: '总', value: 3000 },
{ name: '', value: 1400 },
],
},
// {
// //
// name: '',
// type: 'pie',
// center: ['50%', '48%'],
// radius: ['60%', '75%'],
// itemStyle: {
// borderRadius: 10,
// },
// label: {
// show: false,
// },
// data: [
// //<=========
// { name: '', value: 3000 },
// { name: '', value: 1400 },
// ],
// },
// {
// name: this.value.equipmentName || 'Default',
// type: 'pie',
@ -195,22 +195,22 @@ export default {
this.config.title.text = lineName;
this.config.title.subtext = equipmentName;
this.config.series[0].data = [
{ name: '工作时长', value: workTime },
{ name: '停机时长', value: stopTime },
{ name: '故障时长', value: downTime },
];
this.config.series[1].data = [
{ name: '速度开动率', value: peEfficiency },
{ name: '', value: 100 },
// { name: '', value: peEfficiency },
// { name: '', value: Math.ceil(peEfficiency) - peEfficiency },
{ name: '有效时长', value: workTime },
{ name: '关机时长', value: stopTime },
{ name: '中断时长', value: downTime }
];
// this.config.series[1].data = [
// { name: '', value: peEfficiency },
// // { name: '', value: 100 },
// // { name: '', value: peEfficiency },
// // { name: '', value: Math.ceil(peEfficiency) - peEfficiency },
// ];
//
this.textData = {
workTime: +workTime.toFixed(2),
stopTime: +stopTime.toFixed(2),
downTime: +downTime.toFixed(2),
peEfficiency: +peEfficiency.toFixed(2),
workTime: +workTime?.toFixed(2),
stopTime: +stopTime?.toFixed(2),
downTime: +downTime?.toFixed(2),
// peEfficiency: +peEfficiency?.toFixed(2),
};
},
},

View File

@ -19,6 +19,7 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
max-height="600"
@emitFun="handleEmitFun">
<!-- <method-btn
v-if="tableBtn.length"
@ -93,17 +94,29 @@ export default {
{ prop: 'downCount', label: '故障次数' },
],
searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'month',
// selectOptions: Array(12)
// .fill(0)
// .map((v, i) => ({
// id: i + 1,
// name: `${i + 1}`,
// })),
// },
{
type: 'select',
label: '请选择月份',
placeholder: '请选择月份',
type: 'datePicker',
label: '时间',
dateType: 'month',
format: 'yyyy-MM',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 240,
param: 'month',
selectOptions: Array(12)
.fill(0)
.map((v, i) => ({
id: i + 1,
name: `${i + 1}`,
})),
},
{
__index: 'line',
@ -111,6 +124,7 @@ export default {
label: '产线',
placeholder: '请选择产线',
param: 'lineId',
filterable: true
},
{
type: 'button',
@ -164,7 +178,13 @@ export default {
},
});
if (code === 0) {
this.list = data;
this.list = data.map(item => {
item.mtbf = item.mtbf?.toFixed(2)
item.mttr = item.mttr?.toFixed(2)
item.workTime = item.workTime?.toFixed(2)
item.downTime = item.downTime?.toFixed(2)
return item
});
} else {
this.list.splice(0);
}
@ -174,12 +194,14 @@ export default {
switch (btn.btnName) {
case 'search':
if (btn.month) {
this.queryParams.recordTime = [
moment()
.month(btn.month - 1)
.format('YYYY-MM') + '-01 00:00:00',
moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
];
// this.queryParams.recordTime = [
// moment()
// .month(btn.month - 1)
// .format('YYYY-MM') + '-01 00:00:00',
// moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
// ];
this.queryParams.recordTime = [btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00']
console.log(btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00')
} else {
this.queryParams.recordTime = null;
}

View File

@ -26,7 +26,8 @@
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"></base-table>
@emitFun="handleEmitFun"
:max-height="tableH"></base-table>
</el-tab-pane>
<el-tab-pane :label="'\u3000柱状图\u3000'" name="graph">
<div
@ -57,6 +58,7 @@ export default {
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
return {
dialogVisible: false,
tableH: this.tableHeight(260),
urls: {
page: '/analysis/equipment-analysis/quality',
},
@ -155,12 +157,12 @@ export default {
},
{
// width: 160,
prop: 'inQuantity',
prop: 'totalQuantity',
label: '加工数量',
},
{
// width: 160,
prop: 'outQuantity',
prop: 'okQuantity',
label: '合格数量',
},
{
@ -252,6 +254,9 @@ export default {
this.fillProductOptions();
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.$refs['search-bar'].headBtnClick('search');
},
methods: {

View File

@ -38,7 +38,7 @@
import SmallTitle from './SmallTitle';
import { getworkerAll } from '@/api/base/materialUseLog';
import Editor from '@/components/Editor';
import DialogForm from '@/components/DialogForm';
import DialogForm from './DialogForm';
export default {
name: 'AlarmHandle',

View File

@ -0,0 +1,520 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-08-15 10:32:36
description: 弹窗的表单组件
-->
<template>
<el-form
ref="form"
:model="form"
:label-width="`${labelWidth}px`"
:size="size"
:label-position="labelPosition"
v-loading="formLoading">
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
<el-input
v-if="col.input"
v-model="form[col.prop]"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
:disabled="disabled"
v-bind="col.bind" />
<el-input
v-if="col.textarea"
type="textarea"
v-model="form[col.prop]"
:disabled="disabled"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
v-bind="col.bind" />
<el-select
v-if="col.select"
v-model="form[col.prop]"
:placeholder="`请选择${col.label}`"
:disabled="disabled"
@change="$emit('update', form)"
v-bind="col.bind">
<el-option
v-for="opt in optionListOf[col.prop]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
<el-date-picker
v-if="col.datetime"
v-model="form[col.prop]"
type="datetime"
:disabled="disabled"
:placeholder="`请选择${col.label}`"
value-format="timestamp"
@change="$emit('update', form)"
v-bind="col.bind"></el-date-picker>
<el-switch
v-if="col.switch"
v-model="form[col.prop]"
:disabled="disabled"
active-color="#0b58ff"
inactive-color="#e1e1e1"
@change="$emit('update', form)"
v-bind="col.bind"></el-switch>
<component
v-if="col.subcomponent"
:key="col.key"
:disabled="disabled"
:read-only="disabled"
:is="col.subcomponent"
v-model="form[col.prop]"
:inlineStyle="col.style"
@on-change="$emit('update', form)"
v-bind="col.bind"></component>
<div
class="upload-area"
:class="uploadOpen ? '' : 'height-48'"
ref="uploadArea"
:key="col.prop"
v-if="col.upload">
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
<el-button
type="text"
icon="el-icon-arrow-right"
@click="handleFilesOpen" />
</span>
<!-- :file-list="uploadedFileList" -->
<el-upload
v-if="col.upload"
class="upload-in-dialog"
:key="col.prop + '__el-upload'"
:action="uploadUrl"
:headers="uploadHeaders"
:show-file-list="false"
icon="el-icon-upload2"
:disabled="disabled"
:before-upload="beforeUpload"
:on-success="
(response, file, fileList) => {
handleUploadSuccess(response, file, col.prop);
}
"
v-bind="col.bind">
<el-button
size="mini"
:disabled="disabled || col.bind?.disabled || false">
<svg-icon
icon-class="icon-upload"
style="color: inherit"></svg-icon>
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
<uploadedFile
class="file"
v-for="file in form[col.prop]"
:file="file"
:key="file.fileUrl"
:disabled="disabled"
@delete="!disabled && handleDeleteFile(file, col.prop)" />
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getAccessToken } from '@/utils/auth';
import tupleImg from '@/assets/images/tuple.png';
import cache from '@/utils/cache';
/**
* 找到最长的label
* @param {*} options
*/
function findMaxLabelWidth(rows) {
let max = 0;
rows.forEach((row) => {
row.forEach((opt) => {
// debugger;
if (!opt.label) return 0;
if (opt.label.length > max) {
max = opt.label.length;
if (opt.label.includes('(')) {
max = max - 3;
}
}
});
});
return max;
}
const uploadedFile = {
name: 'UploadedFile',
props: ['file', 'disabled'],
data() {
return {};
},
methods: {
handleDelete() {
this.$emit('delete', this.file);
},
async handleDownload() {
const data = await this.$axios({
url: this.file.fileUrl,
method: 'get',
responseType: 'blob',
});
await this.$message.success('开始下载');
// create download link
const url = window.URL.createObjectURL(data);
const link = document.createElement('a');
link.href = url;
link.download = this.file.fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
},
mounted() {},
render: function (h) {
return (
<div
title={this.file.fileName}
onClick={this.handleDownload}
style={{
background: `url(${tupleImg}) no-repeat`,
backgroundSize: '14px',
backgroundPosition: '0 55%',
paddingLeft: '20px',
paddingRight: '24px',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
overflow: 'hidden',
cursor: 'pointer',
display: 'inline-block',
}}>
{this.file.fileName}
{!this.disabled && (
<el-button
type="text"
icon="el-icon-close"
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
class="dialog__upload_component__close"
onClick={this.handleDelete}
/>
)}
</div>
);
},
};
export default {
name: 'DialogForm',
model: {
prop: 'dataForm',
event: 'update',
},
emits: ['update'],
components: { uploadedFile },
props: {
rows: {
type: Array,
default: () => [],
},
dataForm: {
type: Object,
default: () => ({}),
},
disabled: {
type: Boolean,
default: false,
},
hasFiles: {
type: Boolean | Array,
default: false,
},
labelPosition: {
type: String,
default: 'right',
},
size: {
type: String,
default: '',
},
},
data() {
return {
uploadOpen: false,
form: {},
formLoading: true,
optionListOf: {},
uploadedFileList: [],
dataLoaded: false,
uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() },
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // headersurl
};
},
computed: {
labelWidth() {
let max = findMaxLabelWidth(this.rows);
// 20px
return max * 20;
// return max * 20 + 'px';
},
},
watch: {
rows: {
handler() {
this.$nextTick(() => {
this.handleOptions('watch');
});
},
deep: true,
immediate: false,
},
dataForm: {
handler(val) {
this.form = JSON.parse(JSON.stringify(val));
if (this.hasFiles) {
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
this.form.files = this.form.files ?? [];
} else if (Array.isArray(this.hasFiles)) {
this.hasFiles.forEach((prop) => {
this.form[prop] = this.form[prop] ?? [];
});
}
}
},
deep: true,
immediate: true,
},
},
mounted() {
// options
this.handleOptions();
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
// getCode
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
async handleOptions(trigger = 'monuted') {
console.log('[dialogForm:handleOptions]');
const promiseList = [];
this.rows.forEach((cols) => {
cols.forEach((opt) => {
if (opt.value && !this.form[opt.prop]) {
//
this.form[opt.prop] = opt.value;
}
if (opt.options) {
this.$set(this.optionListOf, opt.prop, opt.options);
} else if (opt.url) {
// dependswatcher
if (opt.depends) {
this.$watch(
() => this.form[opt.depends],
(id) => {
console.log('<', opt.depends, '>', 'changed', id);
if (id == null) return;
//
this.form[opt.prop] = null;
//
this.$axios({
url: `${opt.url}?id=${id}`,
}).then((res) => {
this.$set(
this.optionListOf,
opt.prop,
res.data.map((item) => ({
label: item[opt.labelKey ?? 'name'],
value: item[opt.valueKey ?? 'id'],
}))
);
});
},
{
immediate: false,
}
);
return;
}
//
if (opt.select || (opt.input && !this.form?.id)) {
promiseList.push(async () => {
const response = await this.$axios(opt.url, {
method: opt.method ?? 'get',
// data: opt.method == 'post' ? opt.queryParams : null
});
// console.log('[dialogForm:handleOptions:response]', response);
if (opt.select) {
//
const list =
'list' in response.data
? response.data.list
: response.data;
if (opt.cache) {
cache.store(opt.cache, list);
}
this.$set(
this.optionListOf,
opt.prop,
list.map((item) => ({
label: item[opt.labelKey ?? 'name'],
value: item[opt.valueKey ?? 'id'],
}))
);
} else if (opt.input) {
console.log('setting code: ', response.data);
//
this.form[opt.prop] = response.data;
// dataFormcodebug
this.$emit('update', this.form);
}
});
}
}
});
});
console.log('[dialogForm:handleOptions] done!');
// watch
if (trigger == 'watch') {
this.formLoading = false;
return;
}
try {
await Promise.all(promiseList.map((fn) => fn()));
this.formLoading = false;
this.dataLoaded = true;
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
} catch (error) {
console.log('[dialogForm:handleOptions:error]', error);
this.formLoading = false;
}
if (!promiseList.length) this.formLoading = false;
},
//
beforeUpload(file) {
const checkFileSize = () => {
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$modal.msgError('上传文件大小不能超过 2MB!');
}
return isLt2M;
};
const checkFileType = () => {
const isJPG =
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/jpg';
return isJPG;
};
// return checkFileSize() && checkFileType();
return checkFileSize();
},
// bind
handleUploadSuccess(response, file, prop) {
console.log('[handleUploadSuccess]', response, file, prop);
this.form[prop].push({
fileName: file.name,
fileUrl: response.data,
fileType: prop == 'files' ? 2 : 1,
});
this.$modal.msgSuccess('上传成功');
this.$emit('update', this.form);
},
getFileName(fileUrl) {
return fileUrl.split('/').pop();
},
handleFilesOpen() {
this.uploadOpen = !this.uploadOpen;
},
handleDeleteFile(file, prop) {
this.form[prop] = this.form[prop].filter(
(item) => item.fileUrl != file.fileUrl
);
this.$emit('update', this.form);
},
},
};
</script>
<style scoped lang="scss">
.el-date-editor,
.el-select {
width: 100%;
}
.upload-area {
// background: #ccc;
// display: grid;
// grid-auto-rows: 34px;
// grid-template-columns: repeat(6, minmax(32px, max-content));
// gap: 8px;
// align-items: center;
position: relative;
overflow: hidden;
transition: height 0.3s ease-out;
}
.upload-in-dialog {
// display: inline-block;
margin-right: 24px;
// background: #ccc;
position: relative;
// top: -13px;
float: left;
}
.close-icon {
// background: #ccc;
position: absolute;
top: 0;
right: 12px;
z-index: 100;
transition: transform 0.3s ease-out;
}
.close-icon.open {
transform: rotateZ(90deg);
}
</style>
<style>
.dialog__upload_component__close {
color: #ccc;
}
.dialog__upload_component__close:hover {
/* color: #777; */
color: red;
}
.height-48 {
height: 35px !important;
}
</style>

View File

@ -28,7 +28,7 @@
<el-form-item
label="报警级别"
prop="grade"
:rules="[{ required: true, message: '报警级别不能为空', trigger: 'blur' }]">
:rules="[{ required: false, message: '报警级别不能为空', trigger: 'blur' }]">
<el-select
:disabled="disabled"
v-model="dataForm.grade"

View File

@ -7,10 +7,11 @@
<template>
<el-drawer
:visible="visible"
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="true"
class="drawer"
:before-close="beforeClose"
custom-class="mes-drawer"
:size="size || '50%'"
@closed="$emit('destroy')">
@ -43,7 +44,51 @@
:rows="formRows" /> -->
<!-- <el-row v-if="mode.includes('detail')" style="margin-bottom: 24px"> -->
<el-row style="margin-bottom: 24px">
<el-form
ref="form"
:model="dataForm"
label-width="100px"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="设备"
prop="equipmentId"
:rules="[{ required: true, message: '设备不能为空', trigger: 'change' }]">
<el-select
:disabled="isdetail"
v-model="dataForm.equipmentId"
placeholder="请选择设备"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in equipmentList"
:key="opt.id"
:label="opt.name"
:value="opt.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="报警分组"
prop="groupId"
:rules="[{ required: true, message: '报警分组不能为空', trigger: 'change' }]">
<el-select
:disabled="isdetail"
v-model="dataForm.groupId"
placeholder="请选择报警分组"
@change="$emit('update', dataForm)">
<el-option
v-for="opt in grouList"
:key="opt.id"
:label="opt.name"
:value="opt.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- <el-row style="margin-bottom: 24px">
<el-col :span="8">
<div
class="title"
@ -62,7 +107,7 @@
{{ form.code }}
</div>
</el-col>
</el-row>
</el-row> -->
<!-- <el-row v-else style="margin-bottom: 24px" :gutter="20">
<el-form ref="form" :model="form">
<el-col :span="8">
@ -128,12 +173,11 @@
</section>
</div>
<div class="drawer-body__footer">
<div v-if="!mode.includes('detail')" class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button
type="primary"
v-if="!mode.includes('detail')"
@click="handleCancel">
@click="handleSave">
确定
</el-button>
</div>
@ -163,6 +207,8 @@
<script>
import BaseInfoForm from '@/components/DialogForm';
import DialogForm from './dialogForm';
import { getEquipmentList, getgroupAllList } from '@/api/equipment/base/config/config'
import { updateEquipmentBindGroup } from '@/api/base/equipmentBindGroup';
const SmallTitle = {
name: 'SmallTitle',
@ -191,16 +237,21 @@ const SmallTitle = {
export default {
components: { SmallTitle, DialogForm, BaseInfoForm },
props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId id
props: ['sections', 'defaultMode', 'dataId', 'size', 'equipmentId', 'id'], // dataId id
data() {
return {
mode: '',
visible: false,
showForm: false,
isdetail: false,
formLoading: false,
grouList: [],
equipmentList: [],
total: 0,
form: {},
list: [],
attrTitle: '',
dataForm: {},
attrForm: {
id: null,
equipmentGroupId: '',
@ -325,6 +376,34 @@ export default {
}
},
methods: {
// handleSave() {
// updateEquipmentBindGroup(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// },
async getDict() {
const res = await getEquipmentList({
pageNo: 1,
pageSize: 100,
special: false
})
this.equipmentList = res.data.list
const groupRes = await getgroupAllList()
this.grouList = groupRes.data
},
beforeClose(done) {
if (this.mode.includes('edit')) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
handleTableBtnClick({ type, data }) {
switch (type) {
case 'edit':
@ -342,6 +421,16 @@ export default {
init() {
this.visible = true;
//
// this.dataForm = {
// equipmentId: this.equipmentId,
// groupId: this.dataId
// }
this.getDict()
this.$set(this.dataForm, 'equipmentId', this.equipmentId)
this.$set(this.dataForm, 'groupId', this.dataId)
this.$set(this.dataForm, 'id', this.id)
this.isdetail = this.mode === 'detail' ? true : false
},
async getAttrList() {
@ -360,9 +449,9 @@ export default {
if (valid) {
const isEdit = !this.mode.includes('detail');
await this.$axios({
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
url: '/base/equipment-bind-group/update',
method: isEdit ? 'put' : 'post',
data: this.form,
data: this.dataForm,
});
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
this.visible = false;

View File

@ -48,6 +48,8 @@
size="45%"
:default-mode="editMode"
:data-id="alarmForm.id"
:equipment-id="equipmentId"
:id="id"
:sections="[
{
name: '基本信息',
@ -220,7 +222,7 @@ export default {
{
select: true,
label: '设备',
url: '/base/core-equipment/page?pageNo=1&pageSize=100',
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
prop: 'equipmentId',
bind: {
filterable: true,
@ -266,6 +268,8 @@ export default {
equipmentGroupCode: undefined,
equipmentGroupName: undefined,
},
equipmentId: undefined,
id: undefined,
editVisible: false,
editMode: '',
drawerBaseInfoRows: [
@ -440,6 +444,8 @@ export default {
this.alarmForm.id = groupId;
this.alarmForm.equipmentGroupCode = groupCode;
this.alarmForm.equipmentGroupName = groupName;
this.equipmentId = equipmentId;
this.id = id;
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();

View File

@ -379,7 +379,7 @@ export default {
});
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
return {
name: item.name,
name: item.code,
id: item.id,
};
});
@ -463,7 +463,10 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = '添加设备与实时采集关系表(一对多)';
this.title = '添加设备采集配置';
this.$nextTick(() => {
this.$refs.addOrUpdate.init()
})
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -472,7 +475,7 @@ export default {
getEquipmentPlcConnect(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改设备与实时采集关系表(一对多)';
this.title = '修改设备采集配置';
});
},
/** 提交按钮 */

View File

@ -218,9 +218,9 @@ export default {
label: '是否采集', // 0 , 1
prop: 'collection',
bind: {
'active-value': 1,
'active-value': 1,
'inactive-value': 0,
value: 1,
value: 1,
},
},
],
@ -294,7 +294,7 @@ export default {
name: undefined,
enName: undefined,
description: undefined,
collection: undefined,
collection: 1,
};
this.resetForm('form');
},

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-22 10:08:13
* @LastEditTime: 2024-03-15 18:54:23
* @Description:
-->
<template>
@ -39,9 +39,9 @@
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { createCorePL, updateCorePL, getCorePL, getCode, getCorePLList } from "@/api/base/coreProductionLine";
import { createCorePL, updateCorePL, getCorePL, getCode } from "@/api/base/coreProductionLine";
import { createEquipmentPlcConnect, updateEquipmentPlcConnect } from '@/api/base/equipmentPlcConnect';
import { getplcAllList, listByParentId } from "@/api/equipment/base/config/config";
import { getplcAllList, getTree } from "@/api/equipment/base/config/config";
export default {
mixins: [basicAdd],
@ -95,22 +95,29 @@ export default {
this.getDict()
},
methods: {
init() {
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
},
async getDict() {
//
const res = await getplcAllList();
this.plcList = res.data;
// 线
const res1 = await getCorePLList();
//
const res1 = await getTree();
this.plLineList = res1.data;
this.plLineList.forEach(item => {
listByParentId({ id: item.id }).then(resp => {
if (resp.data.length > 0) {
// item.children = resp.data
this.$set(item, 'children', resp.data)
// this.$forceUpdate()
}
})
})
// const res1 = await getCorePLList();
// this.plLineList = res1.data;
// this.plLineList.forEach(item => {
// listByParentId({ id: item.id }).then(resp => {
// if (resp.data.length > 0) {
// // item.children = resp.data
// this.$set(item, 'children', resp.data)
// // this.$forceUpdate()
// }
// })
// })
},
//
dataFormSubmit() {

View File

@ -99,7 +99,7 @@
<el-option
v-for="plc in plcList"
:key="plc.id"
:label="plc.name"
:label="plc.plcTableName"
:value="plc.id"></el-option>
</el-select>
</el-form-item>
@ -404,9 +404,9 @@ export default {
this.eqList = data;
});
this.$axios({
url: '/base/equipment-plc/page',
url: '/base/equipment-plc/listAll',
}).then(({ code, data }) => {
this.plcList = data.list;
this.plcList = data;
});
}
for (const section of this.sections) {

View File

@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-29 14:59:28
* @LastEditTime: 2024-03-20 17:58:29
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
:wrapper-closable="true"
:before-close="beforeClose"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
@ -35,7 +36,8 @@
<el-select
v-model="dataForm.departmentId"
:disabled="isdetail"
:placeholder="`请选择部门`">
:placeholder="`请选择部门`"
style="width: 100%">
<el-option
v-for="opt in departmentOptions"
:key="opt.id"
@ -78,7 +80,7 @@
v-for="opt in inspectorOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
:value="opt.label" />
</el-select>
</el-form-item>
</el-col>
@ -89,33 +91,32 @@
type="datetime"
:disabled="isdetail"
placeholder="请选择巡检时间"
value-format="timestamp"></el-date-picker>
value-format="timestamp"
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="attr-list" v-if="idAttrShow">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
<div v-if="idAttrShow">
<small-title>
巡检内容
</small-title>
<div v-if="!isdetail">
<div>
<SearchBar
:formConfigs="searchBarFormConfig"
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
</div>
<!-- <template>
<span style="display: inline-block;" @click="addNew()">
<div v-if="!isdetail" style="display: flex">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<!-- <div class="action_btn"> -->
<el-button type="text" class="action_btn" @click="addNew()">
<span style="display: inline-block;">
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
<span class="add">添加</span>
<span class="add">添加内容</span>
</span>
</template> -->
</el-button>
<!-- </div> -->
</div>
<base-table
:table-props="tableProps"
@ -228,14 +229,14 @@ export default {
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
// {
// type: 'button',
// btnName: '',
// name: 'add',
// color: 'success',
// plain: true
// }
],
listQuery: {
pageSize: 10,
@ -269,6 +270,17 @@ export default {
this.getDict()
},
methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
async getDict() {
//
const res = await groupClassesListAll();
@ -372,6 +384,7 @@ export default {
if (id) {
this.idAttrShow = true
} else {
this.dataForm.checkPerson = [this.$store.getters.nickname]
this.idAttrShow = false
}
@ -418,7 +431,7 @@ export default {
});
},
getConfirmed() {
return this.$confirm('是否直接确认巡检记录', '提示', {
return this.$confirm('是否直接确认巡检', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@ -431,10 +444,16 @@ export default {
}
this.$nextTick(() => {
this.getConfirmed().then(confirm => {
// let checkPersonParam = '';
// if (!this.dataForm.checkPerson || this.dataForm.checkPerson.trim() == '') {
// /** */
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
// } else {
// checkPersonParam = `&checkPerson=${this.dataForm.checkPerson}`
// }
this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
method: 'put',
data: [this.dataForm.id],
}).then(res =>{
@ -500,10 +519,6 @@ export default {
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
@ -532,11 +547,6 @@ export default {
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
@ -544,7 +554,7 @@ export default {
}
.action_btn {
float: right;
margin: -32px 15px 0;
/* margin: 0 15px 0; */
font-size: 14px;
}
.add {

View File

@ -179,8 +179,14 @@ export default {
this.$modal
.confirm('是否确认所有选中巡检单"?')
.then(() => {
// let checkPersonParam = '';
// if (!row.checkPerson || row.checkPerson.trim() == '') {
// /** */
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
// }
return this.$axios({
url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId,
// url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam,
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
@ -394,11 +400,17 @@ export default {
this.$modal
.confirm('是否确认巡检单"' + row.name + '"?')
.then(() => {
// let checkPersonParam = '';
// const nickname = this.$store.getters.nickname;
// if (!row.checkPerson || row.checkPerson.trim() == '') {
// /** */
// checkPersonParam = `&checkPerson=${nickname}`;
// } else {
// checkPersonParam = `&checkPerson=${row.checkPerson}`
// }
return this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`,
method: 'put',
data: [row.id],
});

View File

@ -98,12 +98,12 @@ export default {
addContent: false,
searchBarKeys: ['name', 'actualCheckTime'],
tableBtn: [
// this.$auth.hasPermi('equipment:check-record:detail')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
this.$auth.hasPermi('equipment:check-record:detail')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
// this.$auth.hasPermi('equipment:check-record:update')
// ? {
// type: 'edit',
@ -120,9 +120,9 @@ export default {
tableProps: [
{ prop: 'name', label: '巡检单名称' },
{ prop: 'department', label: '部门' },
{ prop: 'actualCheckTime', label: '巡检时间', filter: parseTime },
{ prop: 'planCheckTime', label: '巡检时间', filter: parseTime },
{ prop: 'groupClass', label: '班次' },
{ prop: 'opt', label: '巡检内容', name: '详情', subcomponent: btn },
// { prop: 'opt', label: '', name: '', subcomponent: btn },
{ prop: 'remark', label: '备注' }
// { prop: 'origin', label: '', filter: (val) => ['', '', 'PDA'][val] },
// { prop: 'sectionName', label: '' },
@ -416,10 +416,14 @@ export default {
.catch(() => {});
},
handleDetail({ id }) {
this.addOrUpdateVisible = true
this.addContent = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
this.$refs.addContent.init(id, true);
});
// this.addOrUpdateVisible = true
// this.$nextTick(() => {
// this.$refs.addOrUpdate.init(id, true);
// });
},
/** 导出按钮操作 */
handleExport() {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-29 14:58:37
* @LastEditTime: 2024-03-15 18:38:52
* @Description:
-->
<template>
@ -11,29 +11,23 @@
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="120px">
label-width="150px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="巡检单名称" prop="name">
<el-input
v-model="dataForm.name"
placeholder="请输入巡检单名称" />
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检单编码" prop="code">
<el-input
v-model="dataForm.code"
placeholder="请输入巡检单编码" />
<el-input v-model="dataForm.code" placeholder="请输入巡检单编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]">
<el-select
v-model="dataForm.departmentId"
:placeholder="`请选择部门`"
@ -57,8 +51,13 @@
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="巡检频率(天/次)" prop="checkPeriod">
<el-input
v-model="dataForm.checkPeriod"
placeholder="请输入巡检频率(天/次)" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-input
@ -83,8 +82,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
@ -96,9 +93,14 @@
<script>
import basicAdd from '../../../../core/mixins/basic-add';
import { getCheckOrder, getOrderCode, createCheckOrder, updateCheckOrder } from "@/api/equipment/base/inspection/settings";
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
import {
getCheckOrder,
getOrderCode,
createCheckOrder,
updateCheckOrder,
} from '@/api/equipment/base/inspection/settings';
import { getCoreDepartmentList } from '@/api/base/coreDepartment';
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
import { getDictDataLabel } from '@/utils/dict';
// import { getEquipmentAll } from '@/api/base/equipment'
@ -107,118 +109,141 @@ export default {
data() {
return {
urlOptions: {
isGetCode: true,
codeURL: getOrderCode,
isGetCode: true,
codeURL: getOrderCode,
createURL: createCheckOrder,
updateURL: updateCheckOrder,
infoURL: getCheckOrder,
},
dataForm: {
id: null,
id: null,
code: null,
name: null,
departmentId: null,
planCheckTime: null,
confirmTimeLimit: null,
groupClass: null,
remark: null
remark: null,
checkPeriod: null
},
groupOptions: [],
departmentOptions: [],
dataRule: {
confirmTimeLimit: [
{ required: true, message: '确认时限不能为空', trigger: 'blur' }
{ required: true, message: '确认时限不能为空', trigger: 'blur' },
],
code: [
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' }
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' },
],
name: [
{ required: true, message: '巡检单名称不能为空', trigger: 'blur' }
{ required: true, message: '巡检单名称不能为空', trigger: 'blur' },
],
planCheckTime: [
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' }
],
checkPeriod: [
{ required: true, message: '巡检频率不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字类型',
trigger: 'blur',
transform: (val) => Number(val),
}
]
}
};
},
created() {
const currenttime = new Date()
this.dataForm.planCheckTime = new Date(currenttime.getFullYear(), currenttime.getMonth(), currenttime.getDate(), 8, 0, 0).getTime()
console.log('11', this.dataForm.planCheckTime, currenttime)
const currenttime = new Date();
this.dataForm.planCheckTime = new Date(
currenttime.getFullYear(),
currenttime.getMonth(),
currenttime.getDate(),
8,
0,
0
).getTime();
},
mounted() {
this.getDict()
this.getDict();
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
if (response.data.groupClass === '') {
this.dataForm.groupClass = []
this.dataForm.id = id || '';
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr();
}
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then((response) => {
this.dataForm = response.data;
if (response.data?.groupClass === '') {
this.dataForm.groupClass = [];
} else {
this.dataForm.groupClass = response.data?.groupClass.split(',') || undefined
this.dataForm.groupClass =
response.data?.groupClass?.split(',') || undefined;
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode();
}
}
});
},
});
},
async getDict() {
//
const res = await getCoreDepartmentList();
this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll();
this.groupOptions = res1.data.map((item) => {
item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
return item
}) || [];
this.groupOptions =
res1.data.map((item) => {
item.label =
item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict);
return item;
}) || [];
// const res = await getEquipmentAll()
// this.eqList = res.data
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
this.urlOptions.updateURL({
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
this.urlOptions
.updateURL({
...this.dataForm,
special: false,
status: 0,
groupClass: this.dataForm.groupClass?.join(','),
})
.then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
this.urlOptions
.createURL({
...this.dataForm,
special: false,
status: 0,
groupClass: this.dataForm.groupClass.join(',')
}).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
this.urlOptions.createURL({
...this.dataForm,
special: false,
status: 0,
groupClass: this.dataForm.groupClass.join(',')
}).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
groupClass: this.dataForm.groupClass?.join(','),
})
.then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
});
});
},
},
};
</script>

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="180"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -37,9 +37,7 @@
@close="cancel"
@cancel="cancel"
@confirm="handleConfirm">
<add
ref="add"
@refreshDataList="successSubmit" />
<add ref="add" @refreshDataList="successSubmit" />
</base-dialog>
<!-- 添加巡检查看详情 -->
<addOrUpdata
@ -52,8 +50,9 @@
<script>
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue';
import add from './add.vue'
import add from './add.vue';
import { parseTime } from '../../../../core/mixins/code-filter';
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
// import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -71,14 +70,14 @@ export default {
? {
type: 'add',
btnName: '添加',
showTip: '添加巡检'
}
showTip: '添加巡检',
}
: undefined,
this.$auth.hasPermi('equipment:check-setting:update')
? {
type: 'edit',
btnName: '修改',
}
}
: undefined,
// this.$auth.hasPermi('equipment:check-setting:update')
// ? {
@ -90,20 +89,50 @@ export default {
? {
type: 'delete',
btnName: '删除',
}
}
: undefined,
].filter((v) => v),
tableProps: [
{ prop: 'name', label: '巡检单名称', width: 110, showOverflowtooltip: true },
{ prop: 'code', label: '巡检单编码', minWidth: 150, showOverflowtooltip: true },
{
prop: 'name',
label: '巡检单名称',
width: 110,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '巡检单编码',
minWidth: 150,
showOverflowtooltip: true,
},
{ prop: 'department', label: '部门', showOverflowtooltip: true },
{ prop: 'planCheckTime', label: '计划巡检时间', width: 150, filter: parseTime },
{ prop: 'confirmTimeLimit', label: '确认时限', showOverflowtooltip: true },
{
prop: 'planCheckTime',
label: '计划巡检时间',
width: 150,
filter: parseTime,
},
{
prop: 'checkPeriod',
label: '巡检频率(天/次)',
width: 150,
showOverflowtooltip: true,
},
{
prop: 'confirmTimeLimit',
label: '确认时限',
showOverflowtooltip: true,
},
{ prop: 'groupClass', label: '班次', showOverflowtooltip: true },
{ prop: 'creator', label: '创建人', showOverflowtooltip: true },
{ prop: 'createTime', label: '创建时间', width: 150, filter: parseTime },
{
prop: 'createTime',
label: '创建时间',
width: 150,
filter: parseTime,
},
// { prop: 'responsible', label: '' },
{ prop: 'remark', label: '备注' } // TODO:
{ prop: 'remark', label: '备注' }, // TODO:
],
searchBarFormConfig: [
{
@ -136,7 +165,7 @@ export default {
name: 'add',
plain: true,
color: 'success',
}
},
// {
// type: this.$auth.hasPermi('equipment:check-setting:export')
// ? 'button'
@ -177,7 +206,11 @@ export default {
clearable: true,
},
rules: [
{ required: true, message: '设备名称不能为空', trigger: 'change' },
{
required: true,
message: '设备名称不能为空',
trigger: 'change',
},
],
},
{
@ -196,13 +229,13 @@ export default {
equipmentId: null,
name: null,
special: false,
status: 0
status: 0,
},
//
form: {},
basePath: '/base/equipment-check-order',
mode: null,
groupList: []
groupList: [],
};
},
created() {
@ -212,12 +245,12 @@ export default {
},
methods: {
handleConfirm() {
this.$refs.add.dataFormSubmit()
},
this.$refs.add.dataFormSubmit();
},
successSubmit() {
this.cancel()
this.getList()
},
this.cancel();
this.getList();
},
initSearchBar() {
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set(
@ -231,9 +264,9 @@ export default {
});
},
getGroup() {
groupClassesListAll().then(res => {
this.groupList = res.data || []
})
groupClassesListAll().then((res) => {
this.groupList = res.data || [];
});
},
/** 查询列表 */
getList() {
@ -247,9 +280,9 @@ export default {
},
/** 取消按钮 */
cancel() {
this.$refs.add.formClear()
this.$refs.add.formClear();
this.open = false;
this.title = ''
this.title = '';
// this.reset();
},
/** 表单重置 */

View File

@ -73,7 +73,7 @@ const remainBox = {
color() {
if (this.value) {
const v = +this.value;
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
return v <= 1 ? 'red' : v > 1 && v <= 2 ? 'yellow' : 'green';
}
return 'unset';
},
@ -84,9 +84,10 @@ const remainBox = {
style={`background: ${
this.color
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
this.color == 'red' ? '#fff' : 'unset'
// this.color == 'red' ? '#fff' : 'unset'
'#fff'
}`}>
{this.injectData[this.injectData.prop] || ''}
{this.injectData[this.injectData.prop]?.toFixed(0) || ''}
</div>
);
},
@ -128,22 +129,26 @@ export default {
// width: 180,
// filter: parseTime(createTime),
// },
{ prop: 'code', label: '保养计划单号' },
{ prop: 'name', label: '保养计划名称' },
{ prop: 'departmentName', label: '部门' },
{ prop: 'lineName', label: '产线名' },
{ prop: 'code', label: '保养计划单号', minWidth: 118, showOverflowtooltip: true },
{ prop: 'name', label: '保养计划名称', minWidth: 118, showOverflowtooltip: true },
{ prop: 'departmentName', label: '部门', minWidth: 100, showOverflowtooltip: true },
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true },
{
prop: 'lastPlanMaintainTime',
label: '上次计划保养时间',
filter: parseTime,
minWidth: 160,
showOverflowtooltip: true
},
{
prop: 'lastMaintainTime',
label: '上次实际保养时间',
filter: parseTime,
minWidth: 160,
showOverflowtooltip: true
},
{ prop: 'nextPlanMaintainTime', label: '下次计划保养时间', filter: parseTime },
{ prop: 'maintainer', label: '计划保养人员' },
{ prop: 'nextPlanMaintainTime', label: '下次计划保养时间', filter: parseTime, minWidth: 160, showOverflowtooltip: true },
{ prop: 'maintainer', label: '计划保养人员', minWidth: 160, showOverflowtooltip: true },
// { prop: 'equipmentName', label: '' },
// { prop: 'equipmentCode', label: '' },
// { prop: 'maintenancePeriod', label: '' },
@ -153,11 +158,12 @@ export default {
// filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
// },
// { prop: 'opt1', label: '', name: '', subcomponent: btn },
{ prop: 'opt2', label: '保养内容', name: '详情', subcomponent: btn },
{ prop: 'opt2', label: '保养内容', name: '详情', subcomponent: btn, width: 100 },
{
prop: 'remainDays',
label: '距离下次保养剩余时间(天)',
subcomponent: remainBox,
minWidth: 210,
}
],
searchBarFormConfig: [
@ -232,23 +238,24 @@ export default {
.catch(() => { });
},
initSearchBar() {
this.http('/base/core-equipment/page', 'get', {
special: false,
pageNo: 1,
pageSize: 99
}).then(({ data }) => {
this.$set(
this.searchBarFormConfig[1],
'selectOptions',
(data?.list || []).map((item) => ({
name: item.name,
id: item.id,
}))
);
});
// this.http('/base/core-equipment/page', 'get', {
// special: false,
// pageNo: 1,
// pageSize: 99
// }).then(({ data }) => {
// this.$set(
// this.searchBarFormConfig[1],
// 'selectOptions',
// (data?.list || []).map((item) => ({
// name: item.name,
// id: item.id,
// }))
// );
// });
this.http('/base/equipment-maintain-plan/page', 'get', {
pageNo: 1,
pageSize: 100,
special: false
}).then(({ data }) => {
this.$set(
this.searchBarFormConfig[0],

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-28 19:52:13
* @LastEditTime: 2024-03-13 15:55:36
* @Description:
-->
<template>
@ -67,7 +67,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="确认时限(h)" prop="confirmTimeLimit">
<el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
<el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入确认时限" />
</el-form-item>
</el-col>
</el-row>

View File

@ -64,8 +64,9 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import Editor from '@/components/Editor';
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
import AddContent from './addContent.vue';
import { parseTime } from '../../../../core/mixins/code-filter';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
const btn = {
name: 'tableBtn',
@ -128,20 +129,22 @@ export default {
// width: 180,
// filter: timeFilter,
// },
{ prop: 'maintainOrderNumber', label: '设备保养单号' },
{ prop: 'planName', label: '保养计划名称' },
{ prop: 'departmentName', label: '部门' },
{ prop: 'lineName', label: '产线名' },
{ prop: 'planStartTime', label: '计划开始时间', filter: timeFilter },
{ prop: 'planEndTime', label: '计划结束时间', filter: timeFilter },
{ prop: 'startTime', label: '实际开始时间', filter: timeFilter },
{ prop: 'endTime', label: '实际结束时间', filter: timeFilter },
{ prop: 'maintainOrderNumber', label: '设备保养单号', width: 170, showOverflowtooltip: true },
{ prop: 'planName', label: '保养计划名称', width: 150, showOverflowtooltip: true },
{ prop: 'departmentName', label: '部门', width: 120, showOverflowtooltip: true },
{ prop: 'lineName', label: '产线名', width: 120, showOverflowtooltip: true },
{ prop: 'planStartTime', label: '计划开始时间', filter: parseTime, width: 150, showOverflowtooltip: true },
{ prop: 'planEndTime', label: '计划结束时间', filter: parseTime, width: 150, showOverflowtooltip: true },
{ prop: 'startTime', label: '实际开始时间', filter: parseTime, width: 150, showOverflowtooltip: true },
{ prop: 'endTime', label: '实际结束时间', filter: parseTime, width: 150, showOverflowtooltip: true },
// { prop: 'equipmentName', label: '' },
// { prop: 'maintainWorker', label: '' },
{
prop: 'relatePlan',
label: '保养计划类型',
filter: (v) => (v != null ? ['', '计划型', '非计划型'][v] : ''),
width: 170,
showOverflowtooltip: true
},
{ prop: 'opt', label: '详情', name: '详情', subcomponent: btn }
// { prop: 'maintainDuration', label: '(h)' },
@ -174,6 +177,7 @@ export default {
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'startTime',
defaultSelect: []
// width: 350,
},
// {
@ -349,23 +353,28 @@ export default {
};
},
created() {
let end = moment().format('YYYY-MM-DD 08:00:00')
const current = new Date()
let start = parseTime(new Date(current.getFullYear(), current.getMonth(), current.getDate() - 3, 8, 0, 0))
this.searchBarFormConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = [start, end]
this.initSearchBar();
if (this.$route.query) {
// this.queryParams.equipmentId =
// this.$route.query?.equipmentId ?? undefined;
this.queryParams.maintainPlanId =
this.$route.query?.maintainPlanId ?? undefined;
// this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
// this.searchBarFormConfig[0].defaultSelect =
// this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[0].defaultSelect =
this.$route.query.maintainPlanId ?? undefined;
this.searchBarFormConfig[1].defaultSelect =
this.$route.query?.createTime ?? undefined;
// this.searchBarFormConfig[3].defaultSelect =
// Number(this.$route.query.relatePlan) ?? undefined;
}
// if (this.$route.query) {
// // this.queryParams.equipmentId =
// // this.$route.query?.equipmentId ?? undefined;
// this.queryParams.maintainPlanId =
// this.$route.query?.maintainPlanId ?? undefined;
// // this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
// this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
// // this.searchBarFormConfig[0].defaultSelect =
// // this.$route.query.equipmentId ?? undefined;
// this.searchBarFormConfig[0].defaultSelect =
// this.$route.query.maintainPlanId ?? undefined;
// this.searchBarFormConfig[1].defaultSelect =
// this.$route.query?.createTime ?? undefined;
// // this.searchBarFormConfig[3].defaultSelect =
// // Number(this.$route.query.relatePlan) ?? undefined;
// }
this.getList();
if (this.$route.query.addRecord) {
this.handleAdd()

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>
@ -160,6 +167,7 @@ import Editor from "@/components/Editor";
import { getDictDatas } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import { getDictDataLabel } from '@/utils/dict';
import tupleImg from '@/assets/images/tuple.png';
const uploadedFile = {
name: 'UploadedFile',
@ -253,6 +261,9 @@ export default {
},
mounted() { },
methods: {
closed() {
this.$emit('destroy')
},
setFileName(val) {
this.fileName = val
},
@ -372,7 +383,7 @@ export default {
.drawer-body__content {
flex: 1;
/* background: #eee; */
padding: 20px 30px;
padding: 5px 10px;
overflow-y: auto;
}

View File

@ -29,7 +29,7 @@
</el-col>
<!-- 产线名 -->
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="产线名" prop="lineId">
<el-select
v-model="formFilters.lineId"
@ -45,10 +45,10 @@
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<!-- 工段名 -->
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="工段名" prop="sectionId">
<el-select
v-model="formFilters.sectionId"
@ -64,7 +64,7 @@
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<!-- 设备名称 -->
<el-col :span="8">
@ -220,7 +220,7 @@
label="维修工"
prop="repairman"
:rules="[
{ required: true, message: '维修工不能为空', trigger: 'blur' },
{ required: false, message: '维修工不能为空', trigger: 'blur' },
]">
<el-select
v-model="form.repairman"
@ -234,7 +234,7 @@
v-for="opt in workerOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
:value="opt.label" />
</el-select>
</el-form-item>
</el-col>
@ -262,7 +262,7 @@
prop="repairMode"
:rules="[
{
required: true,
required: false,
message: '维修方式不能为空',
trigger: 'blur',
},
@ -393,7 +393,7 @@
:file="file"
:key="file.fileUrl"
:disabled="disabled"
@delete="!disabled && handleDeleteFile(file, col.prop)" />
@delete="!disabled && handleDeleteFile(file)" />
</div>
</el-form-item>
</el-col>
@ -597,9 +597,9 @@ export default {
/** 设置默认维修工为用户自己 */
setInitWorker() {
/** 获取用户自身id */
const userId = this.$store.getters.userId;
const nickname = this.$store.getters.nickname;
this.$nextTick(() => {
this.form.repairman = [userId];
this.form.repairman = [nickname];
});
},
@ -630,8 +630,8 @@ export default {
/** 获取设备 */
async initEquipment() {
const response = await this.$axios('/base/core-equipment/listAll');
this.equipmentList = response.data || [];
this.equipmentOptions = response.data || [];
this.equipmentList = response.data.filter(item => item.special === false) || [];
this.equipmentOptions = response.data.filter(item => item.special === false) || [];
// this.allSpeicalEquipments = equipmentOptions;
},
/** 获取维修工 - 同时从用户表和员工表拉取数据 */
@ -678,10 +678,12 @@ export default {
file.type === 'image/jpeg' ||
file.type === 'image/png' ||
file.type === 'image/jpg';
if (!isJPG) {
this.$modal.msgError('只能上传jpg/png文件!');
}
return isJPG;
};
return checkFileSize();
// return checkFileSize() && checkFileType();
return checkFileSize() && checkFileType();
},
// handlers

View File

@ -92,23 +92,34 @@ export default {
});
if (code == 0) {
this.listLine = data;
return;
} else {
this.listLine.splice(0);
}
this.listLine.splice(0);
},
async getEquipmentByLineId(id) {
const { data, code } = await this.$axios({
url: '/base/core-equipment/listByLine',
params: {
id,
},
//
const res = await this.$axios({
url: '/base/core-equipment/listAll',
});
if (code == 0) {
this.listEq = data;
if (res.code == 0) {
this.listEq = res.data;
return;
}
this.listEq.splice(0);
},
async getEquipmentByLineId(id) {
if (id) {
const { data, code } = await this.$axios({
url: '/base/core-equipment/listByLine',
params: {
id,
},
});
if (code == 0) {
this.listEq = data;
return;
}
this.listEq.splice(0);
}
},
handleSearch() {
this.$emit('action', {
action: 'search',

View File

@ -83,33 +83,41 @@ export default {
data() {
return {
tableProps: [
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'inQuantity', label: '投入数' },
{ prop: 'outQuantity', label: '产出数' },
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true },
{ prop: 'inQuantity', label: '投入数', minWidth: 80, showOverflowtooltip: true },
{ prop: 'outQuantity', label: '产出数', minWidth: 80, showOverflowtooltip: true },
{
prop: 'run',
label: '是否运行',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'status',
label: '状态',
filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '',
minWidth: 90,
showOverflowtooltip: true
},
{
prop: 'error',
label: '是否故障',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'quantityRecordTime',
label: '生产量记录时间',
filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
},
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
// { prop: 'opt1', label: '', name: '', subcomponent: btn },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
],
searchBarForm: {

View File

@ -17,7 +17,7 @@
padding: 16px 16px 0;
border-radius: 8px;
">
<div class="blue-title">生产节拍时序图</div>
<!-- <div class="blue-title">生产节拍时序图</div> -->
<!-- <h1>设备状态时序图</h1> -->
<!-- 搜索工作栏 -->
<SearchBar
@ -76,6 +76,7 @@
<script>
import LineChart from './components/lineChart.vue';
import moment from 'moment';
// import response from './response.json';
export default {
@ -84,6 +85,7 @@ export default {
props: {},
data() {
return {
moment,
startTime: null, // new Date(2023, 8, 26, 0, 0, 0, 0).getTime(),
accumulators: new Map(),
searchBarFormConfig: [
@ -94,6 +96,7 @@ export default {
selectOptions: [],
param: 'lineId',
onchange: true,
filterable: true
},
{
type: 'select',
@ -101,11 +104,12 @@ export default {
placeholder: '请选择工段',
selectOptions: [],
param: 'sectionId',
filterable: true
},
//
{
type: 'datePicker',
label: '时间段',
label: '日期',
dateType: 'date', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
@ -263,7 +267,11 @@ export default {
this.initProductline();
this.initWorksection();
this.initEquipment();
// this.getList();
let end = moment().format('YYYY-MM-DD 23:59:59')
let start = moment().format('YYYY-MM-DD 00:00:00')
this.searchBarFormConfig[2].defaultSelect = start
this.queryParams.recordTime = [start, end]
this.getList();
},
methods: {
handleSearchBarBtnClick({ btnName, ...payload }) {
@ -293,8 +301,10 @@ export default {
},
handleSearchBarChanged({ param, value }) {
this.searchBarFormConfig[1].defaultSelect = null
if (!value) {
this.searchBarFormConfig[1].selectOptions = [];
// this.searchBarFormConfig[1].defaultSelect = null
return;
}
switch (param) {
@ -486,7 +496,10 @@ export default {
const { code, data } = await this.$axios({
url: '/monitoring/equipment-monitor/quantity-series',
method: 'get',
params: this.queryParams,
params: {
equipmentId: this.queryParams.equipmentId,
recordTime: this.queryParams.recordTime
}
});
this.queryParams.equipmentId = null; //

View File

@ -112,7 +112,7 @@ export default class GanttGraph {
// top: 12 + 128 * this.gridIndex,
top: 12 + 104 * this.gridIndex,
right: 48,
left: 88,
left: 183,
height: 56
}
}

View File

@ -17,7 +17,7 @@
padding: 16px 16px 0;
border-radius: 8px;
">
<div class="blue-title">生产节拍时序图</div>
<!-- <div class="blue-title">生产节拍时序图</div> -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@ -119,6 +119,7 @@ export default {
selectOptions: [],
param: 'lineId',
onchange: true,
filterable: true,
},
{
type: 'select',
@ -126,6 +127,7 @@ export default {
placeholder: '请选择工段',
selectOptions: [],
param: 'sectionId',
filterable: true,
},
//
{
@ -172,20 +174,20 @@ export default {
// demo: [
// [
// {
// equipmentName: '',
// equipmentName: '线2线',
// duration: 30,
// relativeDuration: 0.6,
// status: 0,
// startPos: 0,
// startTime: 1691568181000,
// startTime: 1711073203686,
// },
// {
// equipmentName: '',
// equipmentName: '线2线',
// duration: 20,
// relativeDuration: 0.4,
// status: 2,
// startPos: 30,
// startTime: 1691569981000
// startTime: 1711072203686,
// },
// ],
// ],
@ -257,6 +259,10 @@ export default {
(eq) => eq[0].equipmentId
);
this.graphList = this.objectToArray(data);
// this.graphList = this.demo.map(item => {
// item.key = item[0].equipmentName;
// return item;
// });
}
},

View File

@ -2,59 +2,57 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zhp
* @LastEditTime: 2023-12-08 13:59:20
* @LastEditTime: 2024-03-22 17:11:55
* @Description:
-->
<template>
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer" size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<!-- <div class="visual-part"> -->
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="100px" label-position="top">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备名称" prop="equipmentId">
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
@change="getCode" placeholder="请选择设备名称">
<el-option v-for="dict in equipmentList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备Bom编码" prop="code">
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入设备Bom编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备物料BOM名称" prop="name">
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备物料BOM名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="当前状态" prop="enabled">
<el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
placeholder="请选择当前状态">
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="100px" label-position="top">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备名称" prop="equipmentId">
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
@change="getCode" placeholder="请选择设备名称">
<el-option v-for="dict in equipmentList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备Bom编码" prop="code">
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入设备Bom编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备物料BOM名称" prop="name">
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备物料BOM名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="当前状态" prop="enabled">
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- </div> -->
<div class="attr-list" v-if="idAttrShow">
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
@ -77,9 +75,9 @@
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
</div>
</div>
<div class="drawer-body__footer">
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :product-id="dataForm.id" @refreshDataList="getList" />
</el-drawer>
@ -200,7 +198,7 @@ export default {
}
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.urlOptions.updateURL(this.dataForm).then(res => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
@ -208,7 +206,7 @@ export default {
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
this.urlOptions.createURL(this.dataForm).then(res => {
this.$modal.msgSuccess("新增成功");
this.idAttrShow = true;
this.dataForm.id = res.data

View File

@ -93,6 +93,7 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'equipmentId',
filterable: true
},
{
type: 'input',
@ -146,6 +147,26 @@ export default {
});
}
},
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除设备物料bom${name}`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
getDict() {
getEquipmentList().then((res) => {
// console.log(res);

View File

@ -1,62 +1,64 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-12-14 14:03:27
* @LastEditors: zhp
* @LastEditTime: 2024-03-22 17:12:03
* @Description:
-->
<template>
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="false" class="drawer" size="50%">
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer" size="50%">
<small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<!-- <div class="visual-part"> -->
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="100px" label-position="top">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备名称" prop="equipmentId">
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
@change="getCode" placeholder="请选择设备名称">
<el-option v-for="dict in equipmentList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数Bom编码" prop="code">
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入参数Bom编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备参数BOM名称" prop="name">
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备参数BOM名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="当前状态" prop="enabled">
<!-- <el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" /> -->
<el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
placeholder="请选择当前状态">
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="100px" label-position="top">
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备名称" prop="equipmentId">
<el-select v-model="dataForm.equipmentId" filterable :disabled="isdetail" style="width: 100%"
@change="getCode" placeholder="请选择设备名称">
<el-option v-for="dict in equipmentList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="设备编码" prop="equipmentCode">
<el-input v-model="dataForm.equipmentCode" clearable :disabled="isdetail" placeholder="请输入设备编码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="参数Bom编码" prop="code">
<el-input v-model="dataForm.code" clearable :disabled="isdetail" placeholder="请输入参数Bom编码" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="8">
<el-form-item label="设备参数BOM名称" prop="name">
<el-input v-model="dataForm.name" clearable :disabled="isdetail" placeholder="请输入设备参数BOM名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="当前状态" prop="enabled">
<!-- <el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0" /> -->
<!-- <el-select v-model="dataForm.enabled" filterable :disabled="isdetail" style="width: 100%"
placeholder="请选择当前状态">
<el-option v-for="dict in enableList" :key=" dict.id" :label="dict.name" :value="dict.id" />
</el-select> -->
<el-switch v-model="dataForm.enabled" :active-value="1" :inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" :disabled="isdetail" clearable placeholder="请输入备注" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-form>
<!-- </div> -->
<!-- <div v-if="!isdetail" class="drawer-body__footer">
@ -83,7 +85,7 @@
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
</div>
</div>
<div v-if="!isdetail" class="drawer-body__footer">
<div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
@ -224,6 +226,7 @@ export default {
this.equipmentList.forEach((ele) => {
if (val === ele.id) {
this.dataForm.equipmentCode = ele.code
console.log(this.dataForm.equipmentCode);
}
})
},
@ -286,7 +289,7 @@ export default {
}
//
if (this.dataForm.id) {
this.urlOptions.updateURL(this.dataForm).then(response => {
this.urlOptions.updateURL(this.dataForm).then(res => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
this.$emit("refreshDataList");
@ -294,7 +297,7 @@ export default {
return;
}
//
this.urlOptions.createURL(this.dataForm).then(response => {
this.urlOptions.createURL(this.dataForm).then(res => {
this.$modal.msgSuccess("新增成功");
this.idAttrShow = true;
this.dataForm.id = res.data
@ -336,16 +339,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

@ -93,6 +93,8 @@ export default {
labelField: 'name',
valueField: 'id',
param: 'equipmentId',
filterable: true
// filter
},
{
type: 'input',
@ -158,6 +160,26 @@ export default {
})
})
},
deleteHandle(id, name, index) {
this.$confirm(`是否确认删除设备参数bom${ name}`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
},
//
getDataList() {
this.dataListLoading = true;

View File

@ -1,8 +1,8 @@
<!--
<!--
filename: index.vue
author: liubin
date: 2023-10-19 10:03:42
description:
description:
-->
<template>
@ -189,7 +189,7 @@ export default {
input: true,
label: '工艺编码',
prop: 'code',
// url: '/base/core-equipment/getCode',
url: '/extend/process-flow/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

@ -1,6 +1,6 @@
<template>
<div>
<el-drawer title="查看详情" :visible.sync="visible" size="70%">
<el-drawer title="查看详情" :visible.sync="visible" size="70%" :show-close='false'>
<div class="box">
<el-row class="topBox">
<el-col :span="6">
@ -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

@ -210,8 +210,8 @@ export default {
mobileCodeTimer: 0,
loginForm: {
loginType: 'uname',
username: 'admin',
password: 'admin123',
username: '',
password: '',
captchaVerification: '',
mobile: '',
mobileCode: '',
@ -297,9 +297,9 @@ export default {
this.handleLogin({});
},
getCookie() {
const username = getUsername();
const password = getPassword();
const rememberMe = getRememberMe();
// const username = getUsername();
// const password = getPassword();
// const rememberMe = getRememberMe();
const tenantName = getTenantName();
this.loginForm = {
...this.loginForm,

View File

@ -272,7 +272,7 @@ export default {
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
// { prop: 'externalCode', label: '' },
{ prop: 'equipmentId', label: '设备编码' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'totalQuantity', label: '加工数量' },
],

View File

@ -60,14 +60,7 @@
</el-col>
<el-col :span='6'>
<el-form-item label="包装要求" prop="packReq">
<el-select v-model="form.packReq" placeholder="请选择" style="width: 100%;" clearable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.PACK_SPEC)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input v-model="form.packReq"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -127,7 +120,7 @@ export default {
this.form.customerId = res.data.customerId
this.form.planQuantity = res.data.planQuantity
this.form.deliveTime = res.data.deliveTime ? res.data.deliveTime : null
this.form.packReq = res.data.packReq ? res.data.packReq+'' : ''
this.form.packReq = res.data.packReq
this.form.remark = res.data.remark
setTimeout(() => {
this.getSpecifications(this.form.planProductId)

View File

@ -125,7 +125,7 @@ const tableProps = [
{
prop: 'packReq',
label: '包装要求',
filter: publicFormatter('pack_spec'),
// filter: publicFormatter('pack_spec'),
minWidth: 120,
showOverflowtooltip: true
},

View File

@ -3,34 +3,35 @@
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>集团编码: {{orderGroupMsg.code}}</span>
<span>集团编码: {{ orderGroupMsg.code }}</span>
</div>
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon
icon-class="return" /> 返回</el-button>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名称</div>
<div class="lightTip" :title='orderGroupMsg.name'>{{orderGroupMsg.name}}</div>
<div class="lightTip" :title='orderGroupMsg.name'>{{ orderGroupMsg.name }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip" :title="orderGroupMsg.productName">{{orderGroupMsg.productName}}</div>
<div class="lightTip" :title="orderGroupMsg.productName">{{ orderGroupMsg.productName }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{orderGroupMsg.specifications}}</div>
<div class="lightTip">{{ orderGroupMsg.specifications }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">客户</div>
<div class="lightTip">{{orderGroupMsg.customerName}}</div>
<div class="lightTip">{{ orderGroupMsg.customerName }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">包装要求</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.PACK_SPEC, orderGroupMsg.packReq)}}</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.PACK_SPEC, orderGroupMsg.packReq) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">交货时间</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.deliveTime)}}</div>
<div class="lightTip">{{ parseTime(orderGroupMsg.deliveTime) }}</div>
</el-col>
</el-row>
<el-row>
@ -40,15 +41,15 @@
</el-col>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderGroupMsg.planQuantity}}</div>
<div class="lightTip">{{ orderGroupMsg.planQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{orderGroupMsg.planArea}}</div>
<div class="lightTip">{{ orderGroupMsg.planArea }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderGroupMsg.status)}}</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderGroupMsg.status) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
@ -62,15 +63,15 @@
<el-row>
<el-col :span='4'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderGroupMsg.actualquantity }}</div>
<div class="lightTip">{{ orderGroupMsg.actualquantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{orderGroupMsg.completeRate}}</div>
<div class="lightTip">{{ orderGroupMsg.completeRate }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">{{orderGroupMsg.nokQuantity}}</div>
<div class="lightTip">{{ orderGroupMsg.nokQuantity }}</div>
</el-col>
</el-row>
</div>
@ -78,21 +79,21 @@
<div class="box2" v-for="(item, index) in orderMsg" :key='index'>
<div class="boxTitle">
<span class="blueTitle"></span>
<span>厂务订单编码: {{item.code}}</span>
<span>厂务订单编码: {{ item.code }}</span>
</div>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名称</div>
<div class="lightTip" :title="item.name">{{item.name}}</div>
<div class="lightTip" :title="item.name">{{ item.name }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip" :title="item.productName">{{item.productName}}</div>
<div class="lightTip" :title="item.productName">{{ item.productName }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{item.specifications}}</div>
<div class="lightTip">{{ item.specifications }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">创建时间</div>
@ -110,19 +111,19 @@
<el-row>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{item.planQuantity}}</div>
<div class="lightTip">{{ item.planQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{item.planArea}}</div>
<div class="lightTip">{{ item.planArea }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">预计用时()</div>
<div class="lightTip">{{item.expectTime}}</div>
<div class="lightTip">{{ item.expectTime }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, item.status)}}</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.ORDER_STATUS, item.status) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
@ -136,15 +137,15 @@
<el-row>
<el-col :span='4'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{item.actualQuantity }}</div>
<div class="lightTip">{{ item.actualQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{item.completeProp}}</div>
<div class="lightTip">{{ item.completeProp }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">{{item.nokQuantity}}</div>
<div class="lightTip">{{ item.nokQuantity }}</div>
</el-col>
</el-row>
</div>
@ -153,13 +154,8 @@
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="item.coreWorkOrderRespVOS || []"
:max-height="tableH"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps"
:table-data="item.coreWorkOrderRespVOS || []" :max-height="tableH" />
</div>
</div>
</template>
@ -192,14 +188,14 @@ const tableProps = [
filter: publicFormatter('workshop')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
prop: 'planAssignmentQuantity',
label: '计划分配数量',
width: 110
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
prop: 'actualAssignmentQuantity',
label: '实际分配数量',
width: 110
},
{
prop: 'actualArea',
@ -266,16 +262,16 @@ export default {
id: this.orderGroupId
}).then(res => {
this.orderGroupMsg = res.data
if ( res.data.orderIdNum && res.data.orderIdNum > 0) {
if (res.data.orderIdNum && res.data.orderIdNum > 0) {
this.orderMsg = res.data.orderDetailVOS
}else{
} else {
this.orderMsg = []
}
})
},
//
returnOrderManage() {
this.$router.push({path: '/order/base/order-group'})
this.$router.push({ path: '/order/base/order-group' })
}
}
}
@ -285,43 +281,51 @@ export default {
height: calc(100vh - 120px - 8px);
background-color: rgb(242, 244, 249);
overflow: auto;
.box1, .box2 {
.box1,
.box2 {
background-color: #fff;
border-radius: 9px;
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
color: rgba(0, 0, 0, 0.85);
margin-bottom: 8px;
}
.lightTip {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
color: rgba(102, 102, 102, 0.75);
margin-bottom: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.box2 {
height: 415px;
padding: 12px 16px 0;
margin: 8px 0;
}
.box1 {
height: 215px;
padding: 16px 16px 0 16px;
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
margin: 0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;

View File

@ -5,13 +5,10 @@
<el-form-item label="工单名称" prop="name" v-if='!isBind'>
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
<el-option
v-for="item in workOrderList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable
@change="getWorkOrderMsg">
<el-option v-for="item in workOrderList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -23,12 +20,8 @@
</el-col>
<el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
<el-option
v-for="item in productList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
<el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -42,36 +35,28 @@
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="计划开始时间">
<el-date-picker
v-model="planStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
<el-date-picker v-model="planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;" placeholder="选择日期" :disabled="isBind">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划完成时间">
<el-date-picker
v-model="planFinishTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
<el-date-picker v-model="planFinishTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;" placeholder="选择日期" :disabled="isBind">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind"
style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind"
style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
@ -79,18 +64,15 @@
<el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;">
<el-option
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-option v-for="item in processFlowList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" :disabled="isBind" @change='selectMethod'>
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" :disabled="isBind"
@change='selectMethod'>
<el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select>
@ -99,10 +81,7 @@
<el-col :span='6'>
<el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
<el-option v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
@ -111,11 +90,7 @@
<el-col :span='6'>
<el-form-item label="工单类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-option v-for="item in workOrderTypeList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -123,45 +98,39 @@
</el-row>
<el-row :gutter="20">
<el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责车间" prop="roomNameDict">
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
<el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option v-for="item in productLineList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责车间" prop="roomNameDict">
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="负责人" prop="workers">
<el-input v-model="form.workers" :disabled="isBind"></el-input>
</el-form-item>
</el-col>
<el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999"
style="width: 100%;"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
import { getProcessFlowList, getWorkOrderCode, orderIssue, getFreeWOlist, getWorkOrderById } from '@/api/base/orderManage'
import { getLineAll } from '@/api/base/productionLine'
import moment from 'moment'
export default {
@ -202,8 +171,8 @@ export default {
processFlowList: [],
productLineList: [],
workOrderTypeList: [
{id: 1,name:'普通'},
{id: 2, name:'特殊'}
{ id: 1, name: '普通' },
{ id: 2, name: '特殊' }
],
planStartTime: '',
planFinishTime: '',
@ -223,7 +192,7 @@ export default {
this.form.planProductId = data.planProductId
// this.form.processFlowId = data.processFlowId
// this.form.materialMethod = data.materialMethod
}else{//
} else {//
this.isBind = true
}
},
@ -244,7 +213,7 @@ export default {
this.processFlowList = res.data || []
})
// list
workOrderList({
getFreeWOlist({
status: 1
}).then(res => {
this.workOrderList = res.data || []
@ -252,10 +221,10 @@ export default {
},
//
selectMethod(val) {
if (val === 2 && !this.form.processFlowId ) {
if (val === 2 && !this.form.processFlowId) {
this.form.materialMethod = 1
this.$modal.msgError("请先选择关联工艺");
}else if (val === 1) {
} else if (val === 1) {
this.form.processFlowId = ''
}
},
@ -273,32 +242,32 @@ export default {
workOrderId: this.form.workOrderId,
orderId: this.form.orderId,
planAssignmentQuantity: this.form.planAssignmentQuantity
}).then((res) => {
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功")
this.$emit('addWorkOrderSubmit')
}
})
}else{//
} else {//
this.$refs['addWorkOrder'].validate((valid) => {
if (valid) {
//
let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
orderIssue({ ..._this.form }).then(res => {
if (res.code === 0) {
_this.$modal.msgSuccess("操作成功")
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// // 使
// _this.$modal.confirm('使?').then(function() {
// _this.$router.push({
// path: '/core/core-work-order?workOrderName='+encodeURI(name)
// })
// })
}
})
//
let _this = this
_this.form.planStartTime = _this.planStartTime ? new Date(_this.planStartTime).valueOf() : ''
_this.form.planFinishTime = _this.planFinishTime ? new Date(_this.planFinishTime).valueOf() : ''
orderIssue({ ..._this.form }).then(res => {
if (res.code === 0) {
_this.$modal.msgSuccess("操作成功")
let name = this.form.name
_this.$emit('addWorkOrderSubmit')
// // 使
// _this.$modal.confirm('使?').then(function() {
// _this.$router.push({
// path: '/core/core-work-order?workOrderName='+encodeURI(name)
// })
// })
}
})
} else {
return false
}
@ -319,7 +288,7 @@ export default {
//
getWorkOrderMsg() {
if (this.form.workOrderId) {
getWorkOrderById({id:this.form.workOrderId}).then(res => {
getWorkOrderById({ id: this.form.workOrderId }).then(res => {
if (res.code === 0) {
this.form.code = res.data.code
this.form.planProductId = res.data.planProductId
@ -345,7 +314,7 @@ export default {
getSpecifications(val) {
for (let i of this.productList) {
if (i.id === val) {
this.form.specifications = i.specifications
this.form.specifications = i.specifications
return
}
}

View File

@ -1,28 +1,31 @@
<template>
<div class="orderDetailData">
<div v-show="!isSingle" style="position: relative;padding-right: 90px;">
<TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName'/>
<el-button type="primary" plain size="small" style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
<TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName' />
<el-button type="primary" plain size="small"
style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon
icon-class="return" /> 返回</el-button>
</div>
<div class="box1">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>订单编码: {{orderMsg.code}}</span>
<span>订单编码: {{ orderMsg.code }}</span>
</div>
<el-button v-show="isSingle" type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
<el-button v-show="isSingle" type="primary" plain size="small" style="float: right;"
@click="returnOrderManage"><svg-icon icon-class="return" /> 返回</el-button>
<div style="padding-left: 14px;">
<el-row>
<el-col :span='4'>
<div class="blodTip">订单名</div>
<div class="lightTip">{{orderMsg.name}}</div>
<div class="lightTip">{{ orderMsg.name }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip">{{orderMsg.productName}}</div>
<div class="lightTip">{{ orderMsg.productName }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品规格</div>
<div class="lightTip">{{orderMsg.specifications}}</div>
<div class="lightTip">{{ orderMsg.specifications }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">创建时间</div>
@ -40,11 +43,11 @@
<el-row>
<el-col :span='4'>
<div class="blodTip">计划加工数量</div>
<div class="lightTip">{{orderMsg.planQuantity}}</div>
<div class="lightTip">{{ orderMsg.planQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">加工平方数(平方米)</div>
<div class="lightTip">{{orderMsg.planArea}}</div>
<div class="lightTip">{{ orderMsg.planArea }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">预计用时()</div>
@ -52,7 +55,7 @@
</el-col>
<el-col :span='4'>
<div class="blodTip">状态</div>
<div class="lightTip">{{getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status)}}</div>
<div class="lightTip">{{ getDictDataLabel(DICT_TYPE.ORDER_STATUS, orderMsg.status) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
@ -66,15 +69,15 @@
<el-row>
<el-col :span='4'>
<div class="blodTip">实际生产数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
<div class="lightTip">{{ orderMsg.actualQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">完成比%</div>
<div class="lightTip">{{orderMsg.completeProp}}</div>
<div class="lightTip">{{ orderMsg.completeProp }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">废片数量</div>
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
<div class="lightTip">{{ orderMsg.nokQuantity }}</div>
</el-col>
</el-row>
</div>
@ -85,13 +88,8 @@
<span>工单信息</span>
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps1"
:table-data="list1"
:max-height="tableH"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps1"
:table-data="list1" :max-height="tableH" />
</div>
</div>
</template>
@ -125,14 +123,14 @@ const tableProps1 = [
filter: publicFormatter('workshop')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
prop: 'planAssignmentQuantity',
label: '计划分配数量',
width: 110
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
prop: 'actualAssignmentQuantity',
label: '实际分配数量',
width: 110
},
{
prop: 'actualArea',
@ -193,13 +191,13 @@ export default {
processFlowName: ''
}
},
components:{ TopTab },
components: { TopTab },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(510) / 2
})
if (this.$route.query.orderIdString && this.$route.query.orderIdString!=='undefined') {
getOrderList({ids:this.$route.query.orderIdString}).then(res => {
if (this.$route.query.orderIdString && this.$route.query.orderIdString !== 'undefined') {
getOrderList({ ids: this.$route.query.orderIdString }).then(res => {
this.orderIdList = res.data.map(item => {
return {
id: item.id,
@ -211,7 +209,7 @@ export default {
})
this.isSingle = false
console.log('aaaaa')
}else{
} else {
this.orderId = this.$route.query.orderId
this.isSingle = true
this.getMsg()
@ -253,40 +251,48 @@ export default {
<style lang='scss' scoped>
.orderDetailData {
background-color: rgb(242, 244, 249);
.box1, .box2{
.box1,
.box2 {
background-color: #fff;
border-radius: 9px;
}
.box2 {
height: calc(100vh - 351px);
padding: 12px 16px 0;
margin-top: 8px;
}
.box1 {
height: 215px;
padding: 16px 16px 0 16px;
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
color: rgba(0, 0, 0, 0.85);
margin-bottom: 8px;
}
.lightTip {
height: 16px;
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
color: rgba(102, 102, 102, 0.75);
margin-bottom: 12px;
}
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
margin: 0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;

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,15 +97,18 @@ export default {
// },
{
prop: 'productionLineName',
label: '产线',
label: '产线',
width:120,
},
{
prop: 'sectionName',
label: '工段',
label: '工段',
width: 120,
},
{
prop: 'inspectionInfoList',
label: '检测内容',
label: '检测内容',
showOverflowtooltip: true,
}
],
//
@ -163,13 +166,20 @@ export default {
this.resetForm('form');
},
deleteHandle(id, name, index, data) {
console.log(data)
// const params = new URLSearchParams();
// params.append('productionLineId', data.productionLineId)
// params.append('sectionId', data.sectionId);
this.$confirm(`确认要删除产线名为${data.productionLineName}的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.urlOptions.deleteURL({
'productionLineId': data.productionLineId,
'sectionId': data.sectionId,
}).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-30 10:53:32
* @LastEditTime: 2024-02-23 15:16:35
* @LastEditTime: 2024-03-15 14:07:15
* @LastEditors: zhp
* @Description:
-->
@ -31,7 +31,7 @@
<el-col :span="12" style="border-left: 1px solid #ccc">
<div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">选择工</span>
<span style="">选择工</span>
</div>
<BomSelection ref="materialsBomList" :key="materialsBomList.equipmentId + 'materialsBomList'"

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-30 10:52:01
* @LastEditTime: 2024-02-01 14:43:53
* @LastEditTime: 2024-03-15 14:06:55
* @LastEditors: zhp
* @Description:
-->
@ -64,7 +64,7 @@
:limit.sync="queryParams.pageSize"
@pagination="getList" /> -->
<base-dialog dialogTitle="选择产线工" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
<base-dialog dialogTitle="选择产线工" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
@confirm="submitForm">
<el-row>
<el-form ref="dataForm" :model="dataForm" label-width="120px" :inline="true" class="demo-form-inline">

View File

@ -34,6 +34,7 @@ import basicPage from './basic-page';
import moment from 'moment';
import addOrUpdate from './dialogForm.vue';
import ProcessBomList from './ProcessBomList.vue';
import row from './row.vue';
export default {
name: 'QualityInspectionBoxBtn',
mixins: [basicPage],
@ -51,8 +52,16 @@ export default {
label: '用户名称',
selectOptions: [],
labelField: 'name',
valueField: 'id',
valueField: 'name',
param: 'userName',
},
{
type: 'select',
label: '用户昵称',
selectOptions: [],
labelField: 'name',
valueField: 'name',
param: 'nickName',
},
{
type: 'button',
@ -107,7 +116,8 @@ export default {
},
{
prop: 'datas',
label: '产线及工段',
label: '产线及工段',
subcomponent: row
}
],
//
@ -143,10 +153,16 @@ export default {
}).then((res) => {
this.searchBarFormConfig[0].selectOptions = res.data.map((item) => {
return {
id: item.id,
id: item.username,
name:item.username
}
})
this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
return {
id: item.nickname,
name: item.nickname
}
})
})
},
getDataList() {
@ -154,7 +170,7 @@ export default {
this.urlOptions.getDataListURL(this.listQuery).then(res => {
this.tableData = res.data.list.map((item) => {
return {
datas: item.strList ? item.strList.toString() : null,
datas: item.strList || null,
nickName: item.nickName,
userName: item.userName,
userId: item.userId
@ -206,7 +222,9 @@ export default {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.inspectionDetContent = val.inspectionDetContent ? val.inspectionDetContent : undefined;
this.listQuery.userName = val.userName ? val.userName : undefined;
this.listQuery.nickName = val.nickName ? val.nickName : undefined;
// this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList()
break;

Some files were not shown because too many files have changed in this diff Show More