Compare commits

..

10 Commits

34 changed files with 895 additions and 499 deletions

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-21 10:50:55
* @LastEditTime: 2023-11-23 19:10:07
* @LastEditors: DY
* @Description:
*/
@ -32,3 +32,13 @@ export function exportMaintainMonitorExcel(query) {
responseType: 'blob'
})
}
// 导出设备保养记录
export function exportMaintainLogExcel(query) {
return request({
url: '/base/equipment-maintain-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-11-10 16:09:33
* @LastEditTime: 2023-11-16 18:57:08
* @LastEditTime: 2023-11-23 20:29:28
* @LastEditors: DY
* @Description:
*/
@ -31,3 +31,13 @@ export function deleteRepair(id) {
method: 'delete'
})
}
// 导出设备维修
export function exportRepairLogExcel(query) {
return request({
url: '/base/equipment-repair-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -33,6 +33,7 @@ export default {
addUrl: '',
pageUrl: '',
infoUrl: '',
deleteUrl: '',
basePath: '',
form: {}
};
@ -60,7 +61,7 @@ export default {
return this.$axios({
url,
method,
params: method === 'get' ? payload : null,
params: (method === 'get' || method === 'delete') ? payload : null,
data: method !== 'get' ? payload : null,
})
},
@ -77,6 +78,7 @@ export default {
return this.http(this.infoUrl == '' ? this.infoPath : this.infoUrl, 'get', payload);
},
del(payload) {
debugger;
return this.http(this.deleteUrl == '' ? this.deletePath : this.deleteUrl, 'delete', payload);
},

View File

@ -163,7 +163,7 @@ input, textarea{
}
::-webkit-scrollbar-thumb {
background-color: rgba(144,147,153,.5);
background-color: #EDEDED;
background-clip: padding-box;
min-height: 28px;
-webkit-border-radius: 2em;
@ -174,7 +174,7 @@ input, textarea{
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(144,147,153,.3);
background-color: #D9D9D9;
}
// 抽屉head区域---start

View File

@ -288,10 +288,10 @@ export default {
[
{
input: true,
label: '产品加工时间(s)',
label: '单件产品加工时间(s)',
prop: 'processingTime',
rules: [
{ required: true, message: '产品加工时间不能为空', trigger: 'blur' },
{ required: true, message: '单件产品加工时间不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字值',
@ -319,9 +319,16 @@ export default {
prop: 'description',
},
],
[
{
upload: true,
label: '上传资料',
prop: 'files',
},
],
[
{ input: true, label: '备注', prop: 'remark' }
]
],
// [
// {
// assetUpload: true,

View File

@ -189,6 +189,10 @@ export default {
],
label: '产线统计类型',
prop: 'lineDataType',
bind: {
clearable: true, filterable: true
},
rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }],
},
{
select: true,
@ -199,6 +203,10 @@ export default {
],
label: '工段统计类型',
prop: 'sectionDataType',
bind: {
clearable: true, filterable: true
},
rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }],
},
],
],

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 09:47:53
* @LastEditTime: 2023-11-23 18:45:15
* @Description:
-->
<template>
@ -49,7 +49,9 @@
</el-row>
<el-row :gutter="20">
<el-col :span="8">负责人:{{ dataForm.workers }}</el-col>
<el-col :span="8">关联产线:{{ dataForm.productLineNames }}</el-col>
<el-col :span="8">关联产线:
<span v-for="(item, index) in dataForm.productLineNames" :key="index" style="margin-right: 10px">{{ item }}</span>
</el-col>
<el-col :span="8">物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }}</el-col>
</el-row>
<el-row :gutter="20">

View File

@ -39,6 +39,7 @@ import {
deleteMaterial
} from '@/api/base/material';
import { listData } from "@/api/system/dict/data";
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
@ -59,8 +60,9 @@ const tableProps = [
label: '英文名称'
},
{
prop: 'materialType',
label: '物料类型'
prop: 'type',
label: '物料类型',
filter: publicFormatter('material_type')
},
{
prop: 'supplierName',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-22 11:09:44
* @LastEditTime: 2023-11-23 15:00:00
* @Description:
-->
<template>
@ -311,6 +311,9 @@ export default {
row.mUnit = u.label
}
})
} else {
row.unit = null
row.mUnit = ''
}
// row.materialCode = tempList[0].code
// row.unit = tempList[0].unit

View File

@ -215,12 +215,33 @@ export default {
this.$refs.addOrUpdate.init(val.data.id);
});
} else if (val.type === "delete") {
this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex)
this.deleteHandle(val.data.id, val.data.materialName)
} else if (val.type === "change") {
this.changeStatus(val.data.id)
} else {
this.otherMethods(val)
}
},
//
deleteHandle(id, name) {
this.$confirm(`是否确认删除物料名称为${name}的数据项?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
});
})
.catch(() => { });
}
},
};

View File

@ -6,17 +6,27 @@
* @Description:
-->
<template>
<div>
<div class="balace-chart">
<div style="margin: 20px">
<el-button v-for="(item, index) in buttonList" :key="index" :class="[item.actived ? 'activeButton': 'normalButton']" @click="changeChart(index)">{{ item.name }}</el-button>
<el-button
v-for="(item, index) in buttonList"
:key="index"
:class="[item.actived ? 'activeButton' : '']"
@click="changeChart(index)">
{{ item.name }}
</el-button>
</div>
<div id="chart" ref="chartDiv" :class="className" :style="{height:height,width:width}" />
<div
id="chart"
ref="chartDiv"
:class="className"
:style="{ height: height, width: width }" />
</div>
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import * as echarts from 'echarts';
require('echarts/theme/macarons'); // echarts theme
// import resize from './mixins/resize'
export default {
@ -24,15 +34,15 @@ export default {
props: {
className: {
type: String,
default: 'chart'
default: 'chart',
},
width: {
type: String,
default: '100%'
default: '100%',
},
height: {
type: String,
default: '350px'
default: '350px',
},
// autoResize: {
// type: Boolean,
@ -44,44 +54,47 @@ export default {
chart: null,
dataArray: [],
xDatas: [],
buttonList: []
}
buttonList: [],
};
},
mounted() {
// this.initChart()
this.$nextTick(() => {
this.changeChart(0);
});
},
methods: {
changeChart(index) {
this.setOptions(this.xDatas, this.dataArray[index])
this.setOptions(this.xDatas, this.dataArray[index]);
this.buttonList.forEach((item, s) => {
if (index === s) {
// item.actived = true
this.$nextTick(() =>{
this.$nextTick(() => {
// item.actived = true
this.$set(item, 'actived', true)
})
this.$set(item, 'actived', true);
});
} else {
// item.actived = false
this.$nextTick(() =>{
this.$nextTick(() => {
// item.actived = false
this.$set(item, 'actived', false)
})
this.$set(item, 'actived', false);
});
// this.$set(item, 'actived', false)
}
})
console.log('看一下数22222据', this.dataArray)
});
console.log('看一下数22222据', this.dataArray);
},
initChart(xData, yData, lineName) {
this.dataArray = yData
this.dataArray = yData;
this.buttonList = this.dataArray.map((item, index) => {
return {
'name': item.name,
'actived': index === 0 ? true : false
}
})
console.log('看一下数据', this.dataArray)
this.xDatas = xData
this.chart = echarts.init(this.$refs.chartDiv, 'macarons')
name: item.name,
actived: index === 0 ? true : false,
};
});
console.log('看一下数据', this.dataArray);
this.xDatas = xData;
this.chart = echarts.init(this.$refs.chartDiv, 'macarons');
// this.chart = echarts.init(document.getElementById('chart'), 'macarons')
// this.setOptions(xData, yData[0], lineName)
},
@ -97,16 +110,16 @@ export default {
this.chart.setOption({
xAxis: {
type: 'category',
data: xData
data: xData,
},
tooltip: {
trigger: 'axis'
trigger: 'axis',
},
legend: {
data:lineName
data: lineName,
},
yAxis: {
type: 'value'
type: 'value',
},
series: [
{
@ -118,19 +131,25 @@ export default {
name: '产线CT',
data: dataList.plData,
type: 'line',
}
]
})
}
}
}
},
],
});
},
},
};
</script>
<style scoped>
.activeButton {
background-color: rgb(93,159,255);
}
.normalButton {
background-color: none;
.balace-chart >>> .el-button {
background: #e3e3e3;
color: #333;
transition: all 0.3s;
border: none;
&.activeButton,
&:hover {
background: #0b58ff;
color: #fff;
}
}
</style>

View File

@ -2,7 +2,7 @@
<el-drawer
title="发货进度"
:visible.sync="centervisible"
size="80%"
size="50%"
class="deliveryLogDetail"
@close='closeA'
:show-close='false'>
@ -47,7 +47,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="150"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="viewDetDetail"
@ -65,7 +65,7 @@
<div v-if="activeName === 'barChart'">
<div
id="logDetPieBar"
style="width: 100%"
style="width: 60%"
:style="{ height: chartHeight + 'px' }"
></div>
</div>
@ -75,7 +75,7 @@
<!-- 详情抽屉 -->
<el-drawer
title="发货详情"
size="60%"
size="50%"
:append-to-body="true"
:visible.sync="innerDrawer"
@close='closeB'
@ -141,7 +141,8 @@ const tableProps = [
},
{
prop: 'rate',
label: '发货比列(%)'
label: '发货比列(%)',
width: 110
},
{
prop: 'principalCost',
@ -173,7 +174,8 @@ const tableProps2 = [
},
{
prop: 'packagingSize',
label: '装箱规格(片/箱)'
label: '装箱规格(片/箱)',
minWidth: 140
},
{
prop: 'packagingNum',
@ -210,8 +212,8 @@ export default {
tableBtn: [
this.$auth.hasPermi('base:group-team:update')
? {
type: 'detDetail',
btnName: '查看发货详情'
type: 'detail',
btnName: '详情'
}
: undefined
].filter((v) => v),
@ -230,7 +232,7 @@ export default {
//
chartDom: '',
chart: '',
chartHeight: this.tableHeight(300)
chartHeight: this.tableHeight(300)*0.6
}
},
// watch: {
@ -270,6 +272,8 @@ export default {
}
},
getBar() {
let color = ['#7164FF','#288AFF','#63BDFF','#8EF0AB','#FFCE6A']
let colorList = []
if (
this.chart !== null &&
this.chart !== '' &&
@ -280,64 +284,90 @@ export default {
this.chartDom = document.getElementById('logDetPieBar')
this.chart = echarts.init(this.chartDom)
let seriesData = []
let sumData = 0
this.tableData && this.tableData.map(item =>{
if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) {
let obj = {}
obj.value = item.rate
obj.name = item.name
obj.value = this.tableData[i].num
obj.name = this.tableData[i].name
seriesData.push(obj)
sumData+=item.rate
})
if (sumData < 100) {
if (i < 5) {
colorList.push(color[i])
} else {
colorList.push(color[i%5])
}
}
}
if (this.orderMsg.num < this.orderMsg.orderNum) {
let obj = {}
obj.value = 100 - sumData
obj.value = this.orderMsg.orderNum - this.orderMsg.num
obj.name = "未发货"
seriesData.push(obj)
colorList.push('#F5F5F5')
}else {
let obj = {}
obj.value = 0
obj.name = "未发货"
seriesData.push(obj)
colorList.push('#F5F5F5')
}
var option = {
color: ['#B0EB42', '#FF9747', '#FF6860', '#7164FF', '#288AFF', '#63BDFF', '#73DE93', '#FFCE6A'],
tooltip: {
trigger: 'item',
formatter: function(params) {
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${params.color};"></span>`
return `<span>
<span style="color:rgba(0,0,0,0.85);">${str}${params.name}</span>
<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${params.percent}</span>
</span>`
}
},
color: colorList,
legend: {
type: 'scroll',
orient: 'vertical',
right: '10%',
top: 20,
bottom: 20,
icon: 'rect',
itemHeight: 8,
itemWidth: 8
bottom: '5%',
left: 'center',
itemWidth: 8,
itemHeight: 8
},
series: [
{
type: 'pie',
radius: ['60%', '80%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
radius: ['40%', '55%'],
emphasis: {
scale: false
},
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
alignTo: 'edge',
formatter: '{name|{b}}\n{value|{c}}',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
name: {
fontSize: 14,
color: 'rgba(0,0,0,0.65)'
},
scale: true ,
scaleSize: 20 ,
},
labelLine: {
show: false
value: {
fontSize: 14,
color: 'rgba(0,0,0,0.65)'
}
}
},
data: seriesData
},
{
type: 'pie',
radius: ['40%', '40%'],
label: {
show: true,
position: 'center',
color: '#000',
formatter: [
'{a|'+this.orderMsg.orderNum+'}',
'{b|总数}'
].join('\n\n'),
rich: {
a: {
fontSize: 26 +'px'
},
b: {
fontSize: 16 +'px'
}
}
},
emphasis: {
scale: false
},
data: [100]
}
]
};
@ -377,11 +407,13 @@ export default {
</script>
<style scoped lang='scss'>
.box1 {
height: 56px;
height: 76px;
border-bottom: 1px solid #E9E9E9;
margin: 0px 8px 20px 30px;
.box_col {
display: inline-block;
width: 20%;
padding: 8px 8px 8px 40px;
padding: 8px 8px 8px 8px;
.blodTip {
height: 16px;
font-size: 14px;
@ -398,7 +430,7 @@ export default {
}
}
.box2 {
padding:32px 32px 30px 30px;
padding:0px 32px 30px 30px;
height: calc(100vh - 150px);
}
.boxTitle {

View File

@ -28,59 +28,96 @@
<script>
import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter';
import moment from 'moment';
import {
getEqAnalysis,
exportEqAnalysisExcel
exportEqAnalysisExcel,
} from '@/api/equipment/analysis/statistics';
const tableProps = [
{
prop: 'recordTime',
label: '时间段',
filter: parseTime
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: '产线'
label: '产线',
},
{
prop: 'sectionName',
label: '工段'
label: '工段',
},
{
prop: 'equipmentName',
label: '设备名称'
label: '设备名称',
},
{
prop: 'equipmentType',
label: '设备类型'
label: '设备类型',
},
{
prop: 'workTime',
label: '工作时间累积(h)'
label: '工作时间累积(h)',
},
{
prop: 'repairCount',
label: '维修次数'
label: '维修次数',
},
{
prop: 'maintainCount',
label: '保养次数'
}
label: '保养次数',
},
];
export default {
mixins: [basicPage],
data() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
0,
0,
0
);
const todayEnd = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23,
59,
59
);
return {
urlOptions: {
getDataListURL: getEqAnalysis,
exportURL: exportEqAnalysisExcel,
},
tableProps,
tableBtn: [].filter((v)=>v),
tableBtn: [].filter((v) => v),
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
recordTime: [
moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
moment(todayEnd).format('YYYY-MM-DD HH:mm:ss'),
],
},
formConfig: [
{
type: 'input',
@ -101,7 +138,10 @@ export default {
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'recordTime',
defaultSelect: [],
defaultSelect: [
moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
moment(todayEnd).format('YYYY-MM-DD HH:mm:ss'),
],
},
{
type: 'button',
@ -113,21 +153,24 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('equipment:analysis-statistics:export') ? 'button' : '',
type: this.$auth.hasPermi('equipment:analysis-statistics:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
plain: true
plain: true,
},
],
};
},
created() {},
mounted() {},
methods: {
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.urlOptions.getDataListURL(this.listQuery).then((response) => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false;
@ -139,7 +182,9 @@ export default {
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.equipmentName = val.name ? val.name : undefined;
this.listQuery.recordTime = val.recordTime ? val.recordTime : undefined;
this.listQuery.recordTime = val.recordTime
? val.recordTime
: undefined;
this.getDataList();
break;
case 'reset':
@ -164,14 +209,18 @@ export default {
let params = { ...this.listQuery };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.$modal
.confirm('是否确认导出所有数据项?')
.then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
})
.then((response) => {
this.$download.excel(response, '设备统计分析.xls');
this.exportLoading = false;
}).catch(() => { });
}
})
.catch(() => {});
},
},
};
</script>

View File

@ -237,6 +237,7 @@ export default {
label: '工厂',
placeholder: '请选择工厂',
param: 'factoryId',
filterable: true,
selectOptions: [],
},
{
@ -244,6 +245,7 @@ export default {
label: '产线',
placeholder: '请选择产线',
param: 'lineId',
filterable: true,
selectOptions: [],
},
//

View File

@ -310,7 +310,7 @@ export default {
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.then(function () {
return this.delete({ id });
return this.del({ id });
})
.then(() => {
this.getList();

View File

@ -198,26 +198,23 @@ export default {
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ width: 240, prop: 'code', label: '报警编码' },
{ prop: 'code', label: '报警编码' },
{
width: 100,
prop: 'type',
label: '报警类型',
filter: (val) =>
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
},
{
width: 90,
prop: 'grade',
label: '报警级别',
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
},
{ width: 180, prop: 'alarmCode', label: '设备报警编码' },
{ width: 128, prop: 'plcParamName', label: '参数列名' },
{ width: 128, prop: 'alarmContent', label: '报警内容' },
{ prop: 'alarmCode', label: '设备报警编码' },
{ prop: 'plcParamName', label: '参数列名' },
{ prop: 'alarmContent', label: '报警内容' },
],
alarmForm: {
id: undefined,

View File

@ -52,7 +52,7 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict';
import { deleteCheck } from "@/api/equipment/base/inspection/settings";
import { deleteCheck } from '@/api/equipment/base/inspection/settings';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -128,15 +128,21 @@ export default {
label: '巡检内容编号',
prop: 'code',
url: '/base/equipment-check/getCode',
rules: [{ required: true, message: '巡检内容编号不能为空', trigger: 'blur' }],
rules: [
{
required: true,
message: '巡检内容编号不能为空',
trigger: 'blur',
},
],
[
},
{
input: true,
label: '巡检项目',
prop: 'program',
rules: [{ required: true, message: '巡检项目不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
],
},
],
[
@ -144,10 +150,10 @@ export default {
input: true,
label: '巡检内容',
prop: 'content',
rules: [{ required: true, message: '巡检内容不能为空', trigger: 'blur' }],
},
rules: [
{ required: true, message: '巡检内容不能为空', trigger: 'blur' },
],
[
},
{
input: true,
label: '备注',
@ -168,7 +174,7 @@ export default {
code: '',
program: '',
id: undefined,
content: ''
content: '',
},
basePath: '/base/equipment-check',
mode: null,
@ -271,10 +277,10 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除巡检项目名称为"' + row.program + '"的数据项?')
.confirm('是否确认删除巡检项目?')
.then(function () {
// return this.delete({ id });
return deleteCheck(id)
// return this.del({ id });
return deleteCheck(id);
})
.then(() => {
this.getList();

View File

@ -105,6 +105,7 @@ export default {
label: '设备',
placeholder: '请选择设备',
param: 'equipmentId',
filterable: true
},
//
{

View File

@ -54,7 +54,6 @@
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue';
// import { publicFormatter } from '@/utils/dict';
@ -101,9 +100,9 @@ export default {
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'responsible', label: '负责人' },
{ prop: 'equipmentCode', label: '描述' },
{ prop: 'checkNumber', label: '巡检条数' } // TODO:
{ prop: 'checkNumber', label: '巡检条数' }, // TODO:
],
searchBarFormConfig: [
{
@ -151,14 +150,18 @@ export default {
input: true,
label: '配置名称',
prop: 'name',
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
],
},
{
input: true,
label: '配置编码',
prop: 'code',
url: '/base/equipment-check-config/getCode',
rules: [{ required: true, message: '配置编码不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '配置编码不能为空', trigger: 'blur' },
],
},
],
[
@ -167,7 +170,9 @@ export default {
label: '设备名称',
prop: 'equipmentId',
url: '/base/core-equipment/listAll',
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
],
},
{
input: true,
@ -288,9 +293,9 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.then(function () {
return this.delete({ id });
.confirm('是否确认删除该巡检记录?')
.then(() => {
return this.del({ id });
})
.then(() => {
this.getList();
@ -317,14 +322,14 @@ export default {
},
handleDetail({ id }) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "详情";
this.addOrEditTitle = '详情';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
});
},
handleAddDetail({ id }) {
this.addOrUpdateVisible = true;
this.addOrEditTitle = "添加巡检";
this.addOrEditTitle = '添加巡检';
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});

View File

@ -52,6 +52,7 @@ import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
import { parseTime } from '@/utils/ruoyi'
const remainBox = {
name: 'RemainBox',
@ -99,7 +100,7 @@ const btn = {
render: function (h) {
return (
<el-button type="text" onClick={this.handleClick}>
{this.injectData.label}
{this.injectData.name}
</el-button>
);
},
@ -113,16 +114,16 @@ export default {
return {
searchBarKeys: ['planId', 'equipmentId'],
tableProps: [
{
prop: 'createTime',
label: '添加时间',
fixed: true,
width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: parseTime(createTime),
// },
{ prop: 'name', label: '保养计划' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'maintenancePeriod', label: '保养频率' },
@ -134,16 +135,16 @@ export default {
{
prop: 'lastMaintainTime',
label: '上次保养时间',
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
filter: parseTime,
},
{ prop: 'nextMaintainTime', label: '计划下次保养时间' },
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
{
prop: 'remainDays',
label: '距离保养时间(天)',
subcomponent: remainBox,
},
{ prop: 'opt1', label: '设备保养', subcomponent: btn },
{ prop: 'opt2', label: '保养记录', subcomponent: btn },
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
],
searchBarFormConfig: [
{
@ -243,15 +244,16 @@ export default {
switch (action) {
//
case '设备保养':
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: {
equipmentId: value.equipmentId,
equipmentName: value.equipmentName
this.$router.push({ path: '/equipment/base/maintain/record',query: {
addRecord: 1,
row: value
} })
break;
case '保养记录':
const queryData = {
equipmentId: value.equipmentId,
maintainPlanId: value.id
maintainPlanId: value.id,
relatePlan: value.lastMaintainTime ? 1 : 2
}
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
break;

View File

@ -51,6 +51,7 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'
import { publicFormatter } from '@/utils/dict';
export default {
name: 'PlanConfig',
@ -95,7 +96,7 @@ export default {
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ prop: 'maintainType', label: '保养类型' },
{ prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
{ prop: 'remark', label: '备注' },
],
searchBarFormConfig: [
@ -106,37 +107,37 @@ export default {
param: 'equipmentName',
},
//
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'createTime',
// defaultSelect: [
// new Date(y, m, d)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// new Date(y, m, d, 23, 59, 59)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// ],
},
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
// // valueFormat: 'timestamp',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// defaultTime: ['00:00:00', '23:59:59'],
// param: 'createTime',
// // defaultSelect: [
// // new Date(y, m, d)
// // .toLocaleString()
// // .split('/')
// // .map((item, index) => {
// // if (index == 1 || index == 2) return item.padStart(2, '0');
// // return item;
// // })
// // .join('-'),
// // new Date(y, m, d, 23, 59, 59)
// // .toLocaleString()
// // .split('/')
// // .map((item, index) => {
// // if (index == 1 || index == 2) return item.padStart(2, '0');
// // return item;
// // })
// // .join('-'),
// // ],
// },
{
type: 'button',
btnName: '查询',
@ -224,6 +225,17 @@ export default {
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
},
],
[
{
switch: true,
label: '启用状态',
prop: 'enabled',
bind: {
'active-value': 1,
'inactive-value': 0,
},
}
],
[{ input: true, label: '备注', prop: 'remark' }],
],
//
@ -300,7 +312,8 @@ export default {
const queryData = {
equipmentId: row.equipmentId,
maintainPlanId: row.id,
relatePlan: row.enabled
isAdd: 1
// relatePlan: row.enabled
}
if (this.queryParams.createTime) {
queryData.createTime = this.queryParams.createTime

View File

@ -53,7 +53,7 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import Editor from '@/components/Editor';
import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record';
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -121,14 +121,14 @@ export default {
},
{
type: 'select',
label: '保养计划',
placeholder: '请选择保养计划',
label: '计划名称',
placeholder: '请选择计划名称',
param: 'maintainPlanId',
},
//
{
type: 'datePicker',
label: '时间',
label: '保养开始时间',
dateType: 'daterange', // datetimerange
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -311,13 +311,16 @@ export default {
this.searchBarFormConfig[0].defaultSelect =
this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[1].defaultSelect =
Number(this.$route.query.maintainPlanId) ?? undefined;
this.$route.query.maintainPlanId ?? undefined;
this.searchBarFormConfig[2].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()
}
},
methods: {
initSearchBar() {
@ -398,6 +401,19 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
if (this.$route.query.addRecord) {
//
const tempRow = this.$route.query.row
this.form.equipmentId = tempRow.equipmentId
this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2
this.form.startTime = tempRow.nextMaintainTime
this.form.maintainPlanId = tempRow.id
}
if (this.$route.query.isAdd) {
//
this.form.equipmentId = this.$route.query.equipmentId
this.form.maintainPlanId = this.$route.query.maintainPlanId
}
this.open = true;
this.title = '添加保养记录';
},
@ -440,7 +456,7 @@ export default {
handleDelete(row) {
const id = row.id;
this.$modal
.confirm('是否删除设备名称为"' + row.equipmentName + '"的数据项?')
.confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?')
.then(function () {
return deleteEqMaintainLog(id);
})
@ -456,7 +472,7 @@ export default {
this.info({ id }).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改保养记录';
this.title = '查看保养记录详情';
});
},
/** 导出按钮操作 */
@ -469,10 +485,10 @@ export default {
.confirm('是否确认导出所有保养记录?')
.then(() => {
this.exportLoading = true;
return exportEquipmentTypeExcel(params);
return exportMaintainLogExcel(params);
})
.then((response) => {
this.$download.excel(response, '保养记录.xls');
this.$download.excel(response, '设备保养记录.xls');
this.exportLoading = false;
})
.catch(() => {});

View File

@ -41,12 +41,12 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="故障发生时间" prop="faultTime">
<span>{{ dataForm.faultTime }}</span>
<span>{{ parseTime(dataForm.faultTime) }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="故障级别" prop="faultLevel">
<span>{{ dataForm.faultLevel }}</span>
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
@ -164,11 +164,11 @@
</el-form>
<div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button>
<el-button v-if="disabled" type="primary" @click="goEdit()">
<el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
<!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
编辑
</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
</el-button> -->
<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
</div>
</el-drawer>
</template>
@ -179,6 +179,8 @@ import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
import Editor from "@/components/Editor";
import FileUpload from "@/components/FileUpload";
import { getDictDatas } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import { getDictDataLabel } from '@/utils/dict';
export default {
name: 'DialogForm',

View File

@ -53,12 +53,12 @@
</template>
<script>
import moment from 'moment';
// import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import CustomDialogForm from './CustomDialogForm.vue';
import { deleteRepair } from '@/api/equipment/base/repair'
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
import { parseTime } from '@/utils/ruoyi'
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentRepair',
@ -100,14 +100,14 @@ export default {
label: '添加时间',
fixed: true,
width: 180,
filter: timeFilter,
filter: parseTime,
},
{ prop: 'repairOrderNumber', label: '设备维修单号' },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: timeFilter },
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
{
prop: 'maintenanceFinishTime',
label: '结束时间',
filter: timeFilter,
filter: parseTime,
},
{
prop: 'maintenanceStatus',
@ -129,6 +129,7 @@ export default {
label: '设备',
placeholder: '请选择设备',
param: 'equipmentId',
filterable: true,
},
{
type: 'select',
@ -417,10 +418,10 @@ export default {
.confirm('是否确认导出所有维修记录?')
.then(() => {
this.exportLoading = true;
return exportEquipmentTypeExcel(params);
return exportRepairLogExcel(params);
})
.then((response) => {
this.$download.excel(response, '维修记录.xls');
this.$download.excel(response, '设备维修.xls');
this.exportLoading = false;
})
.catch(() => {});

View File

@ -0,0 +1,36 @@
<!--
* @Author: zhp
* @Date: 2023-11-08 14:00:52
* @LastEditTime: 2023-11-24 09:12:36
* @LastEditors: DY
* @Description:
-->
<template>
<div v-html="content" />
</template>
<script>
export default {
props: {
injectData: {
type: Object,
default: () => ({})
}
},
data() {
return {
content: ''
}
},
mounted() {
this.getContent()
console.log('12', this.injectData)
},
methods: {
getContent() {
this.content = this.injectData.description ?? ''
}
}
}
</script>

View File

@ -60,8 +60,9 @@ import { publicFormatter } from '@/utils/dict';
import Editor from '@/components/Editor';
import addSparts from './addSparts.vue';
import { deleteConfig } from '@/api/equipment/base/spare-parts/config'
import htmls from './htmls.vue'
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
export default {
name: 'EquipmentSparePartsConfig',
@ -111,7 +112,7 @@ export default {
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'responsible', label: '负责人' },
// { prop: 'unit', label: '', filter: publicFormatter('unit_dict') },
{ prop: 'description', label: '描述' },
{ prop: 'description', label: '描述', subcomponent: htmls },
{ prop: 'sparePartNumber', label: '备品备件数量' },
// { prop: 'remark', label: '' },
],

View File

@ -52,7 +52,7 @@
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict';
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list'
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -95,7 +95,7 @@ export default {
searchBarFormConfig: [
{
type: 'input',
label: '关键字',
label: '备件名称',
placeholder: '请输入备件名称',
param: 'name',
},
@ -132,20 +132,33 @@ export default {
input: true,
label: '备件名称',
prop: 'name',
rules: [{ required: true, message: '备件名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '备件名称不能为空', trigger: 'blur' },
],
},
{
input: true,
label: '备件型号',
prop: 'model',
label: '备件编码',
prop: 'code',
url: '/base/equipment-spare-part/getCode',
rules: [
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
],
},
],
[
{
input: true,
label: '备件型号',
prop: 'model',
},
{
input: true,
label: '规格',
prop: 'specifications',
},
],
[
{
select: true,
label: '供应商',
@ -155,10 +168,10 @@ export default {
filterable: true,
clearable: true,
},
rules: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
},
rules: [
{ required: true, message: '供应商不能为空', trigger: 'blur' },
],
[
},
{
select: true,
label: '物料类型',
@ -169,8 +182,12 @@ export default {
filterable: true,
clearable: true,
},
rules: [{ required: true, message: '物料类型不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '物料类型不能为空', trigger: 'blur' },
],
},
],
[
{
input: true,
label: '使用寿命',
@ -184,14 +201,14 @@ export default {
},
],
},
],
[
{
select: true,
label: '单位',
prop: 'unit', //
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
},
],
[
{
input: true,
label: '备注',

View File

@ -72,10 +72,10 @@ const remainBox = {
},
computed: {
value() {
const temp = this.injectData[this.injectData.prop] || null
const temp = this.injectData[this.injectData.prop] || null;
if (temp) {
console.log('12', temp)
return temp === 'Green' ? 'green' : 'red'
console.log('12', temp);
return temp === 'Green' ? 'green' : 'red';
}
return this.injectData[this.injectData.prop] || null;
},
@ -83,7 +83,7 @@ const remainBox = {
if (this.value) {
// const v = +this.value;
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
return this.value
return this.value;
}
return 'unset';
},
@ -95,8 +95,7 @@ const remainBox = {
this.color
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
'unset'
// this.color == 'red' ? '#fff' : 'unset'
this.color == 'red' || this.color == 'green' ? '#fff' : 'unset'
}`}>
{this.injectData[this.injectData.prop] || ''}
</div>
@ -112,7 +111,10 @@ const btn = {
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
this.$emit('emitData', {
action: this.injectData.name,
value: this.injectData,
});
},
},
render: function (h) {
@ -124,8 +126,6 @@ const btn = {
},
};
export default {
name: 'EquipmentSparePartsMonitor',
components: { addSparts },
@ -162,7 +162,12 @@ export default {
{ prop: 'responsible', label: '负责人' },
{ prop: 'color', label: '是否超期', subcomponent: remainBox },
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
{ prop: 'opt2', label: '更换记录', name: '更新记录', subcomponent: btn }, // TODO:
{
prop: 'opt2',
label: '更换记录',
name: '更新记录',
subcomponent: btn,
}, // TODO:
// { prop: 'remark', label: '' },
],
searchBarFormConfig: [
@ -171,12 +176,14 @@ export default {
label: '产线',
placeholder: '请选择产线',
param: 'lineId',
filterable: true,
},
{
type: 'select',
label: '设备',
placeholder: '请选择设备',
param: 'equipmentId',
filterable: true,
},
{
type: 'button',
@ -211,7 +218,9 @@ export default {
input: true,
label: '配置名称',
prop: 'name',
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
],
},
],
[
@ -224,7 +233,9 @@ export default {
filterable: true,
clearable: true,
},
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
rules: [
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
],
},
],
[
@ -281,29 +292,29 @@ export default {
}
},
eqOperation({ id }) {
this.addOrUpdateVisible = true
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
updateLog({ id }) {
this.addOrUpdateVisible = true
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id, true);
});
},
initSearchBar() {
// 线
getCorePLList().then(res => {
getCorePLList().then((res) => {
this.$set(
this.searchBarFormConfig[0],
'selectOptions',
res.data.map((item) => ({
name: item.name,
id: item.id
id: item.id,
}))
);
})
});
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set(
this.searchBarFormConfig[1],
@ -319,7 +330,11 @@ export default {
getList() {
this.loading = true;
//
this.http('/base/equipment-spare-part-config/monitor', 'get', this.queryParams).then((response) => {
this.http(
'/base/equipment-spare-part-config/monitor',
'get',
this.queryParams
).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
@ -338,7 +353,7 @@ export default {
name: null,
equipmentId: null,
description: null,
responsible: null
responsible: null,
};
this.resetForm('form');
},
@ -397,7 +412,7 @@ export default {
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.then(function () {
return this.delete({ id });
return this.del({ id });
})
.then(() => {
this.getList();

View File

@ -0,0 +1,138 @@
<!--
filename: SearchBar.vue
author: liubin
date: 2023-11-23 14:01:17
description:
-->
<template>
<div class="search-bar">
<div class="vertical-blue-line"></div>
<el-form
:inline="true"
ref="search-bar__form"
:model="form"
class="search-bar__form">
<el-form-item :label="'产线'" prop="productionLineId">
<el-select
size="small"
placeholder="请选择产线"
@change="getEquipmentByLineId"
v-model="form.productionLineId">
<el-option
v-for="item in listLine"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="'设备'" prop="equipmentId">
<el-select
size="small"
placeholder="请选择设备"
v-model="form.equipmentId">
<el-option
v-for="item in listEq"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-button type="primary" @click="handleSearch" size="small">
查询
</el-button>
</div>
</template>
<script>
export default {
name: 'SearchBar',
model: {
prop: 'value',
event: 'change',
},
props: {
value: {
type: Object,
default: () => {},
},
},
data() {
return {
listLine: [],
listEq: [],
};
},
computed: {
form: {
set(val) {
this.emit(val);
},
get() {
return this.value;
},
},
},
mounted() {
this.getLine();
},
methods: {
emit(newValue) {
debugger;
this.$emit('update', { ...this.form, ...newValue });
},
async getLine() {
const { data, code } = await this.$axios({
url: '/base/core-production-line/listAll',
});
if (code == 0) {
this.listLine = data;
return;
}
this.listLine.splice(0);
},
async getEquipmentByLineId(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() {},
},
};
</script>
<style scoped lang="scss">
.search-bar {
padding: 12px 0;
font-size: 16px;
position: relative;
display: flex;
align-items: center;
gap: 12px;
:deep(.el-form-item) {
margin-bottom: 0 !important;
margin-right: 0;
&:not(:last-child) {
margin-right: 18px;
}
}
}
.vertical-blue-line {
width: 4px;
height: 18px;
background: #0b58ff;
border-radius: 2px;
}
</style>

View File

@ -1,10 +1,7 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<SearchBarNew v-model="searchBarForm" />
<!-- 列表 -->
<base-table
@ -13,13 +10,13 @@
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun">
<method-btn
<!-- <method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
@clickBtn="handleTableBtnClick" /> -->
</base-table>
<!-- 分页组件 -->
@ -50,22 +47,23 @@
</template>
<script>
import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi'
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
import { parseTime } from '@/utils/ruoyi';
import SearchBarNew from '../SearchBar.vue';
const btn = {
name: 'tableBtn',
props: ['injectData'],
components: {},
data() {
return {};
},
methods: {
handleClick() {
this.$emit('emitData', { action: this.injectData.label, value: this.injectData });
this.$emit('emitData', {
action: this.injectData.label,
value: this.injectData,
});
},
},
render: function (h) {
@ -77,134 +75,62 @@ const btn = {
},
};
// monitoring/equipment-monitor/realtime-page
export default {
name: 'StatusAndParams',
mixins: [basicPageMixin],
components: { SearchBarNew },
data() {
return {
searchBarKeys: ['equipmentName', 'recordTime'],
tableBtn: [
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('equipment:spare-parts-config:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
tableProps: [
{ prop: 'productionLine', label: '设备名称' },
{ prop: 'workshopSection', label: '设备编码' },
{ prop: 'equipment', label: '投入数' },
{ prop: 'productionLine', label: '产出数' },
{ prop: 'workshopSection', label: '是否运行' },
{ prop: 'equipment22', label: '状态' },
// { prop: 'alarmGrade', label: '', filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL) },
{ prop: 'productionLine', label: '是否故障' },
{ prop: 'workshopSection', label: '生产量记录时间', filter: parseTime },
{ prop: 'equipment1', label: '状态记录时间', filter: parseTime },
{ prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码' },
{ prop: 'inQuantity', label: '投入数' },
{ prop: 'outQuantity', label: '产出数' },
{
prop: 'run',
label: '是否运行',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
},
{
prop: 'status',
label: '状态',
filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '',
},
{
prop: 'error',
label: '是否故障',
filter: (val) => (val != null ? (val ? '是' : '否') : ''),
},
{
prop: 'quantityRecordTime',
label: '生产量记录时间',
filter: parseTime,
},
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
{ prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn } // TODO:
// { prop: 'remark', label: '' },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
],
searchBarFormConfig: [
{
type: 'input',
label: '设备名',
placeholder: '请输入设备名称',
param: 'equipmentName',
searchBarForm: {
productionLineId: null,
equipmentId: null,
},
//
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd',
// valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始日期',
endPlaceholder: '结束日期',
defaultTime: ['00:00:00', '23:59:59'],
param: 'recordTime',
// defaultSelect: [
// new Date(y, m, d)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// new Date(y, m, d, 23, 59, 59)
// .toLocaleString()
// .split('/')
// .map((item, index) => {
// if (index == 1 || index == 2) return item.padStart(2, '0');
// return item;
// })
// .join('-'),
// ],
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: 'separate',
// },
// {
// type: this.$auth.hasPermi('equipment:spare-parts-config:create')
// ? 'button'
// : '',
// btnName: '',
// name: 'add',
// plain: true,
// color: 'success',
// },
// {
// type: this.$auth.hasPermi('equipment:spare-parts-config:export')
// ? 'button'
// : '',
// btnName: '',
// name: 'export',
// color: 'warning',
// },
],
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
lineId: null,
equipmentId: null,
productionLineId: null,
},
basePath: '/base/equipment-alarm-log',
list: []
list: [],
};
},
created() {
// this.getList();
},
methods: {
handleEmitFun(val) {
console.log('你好', val)
console.log('你好', val);
if (val.action === '状态可视化') {
//
} else {
@ -215,15 +141,19 @@ export default {
getList() {
this.loading = true;
//
this.recv(this.queryParams).then((response) => {
this.http(
'/monitoring/equipment-monitor/realtime-page',
'get',
this.queryParams
).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
successSubmit() {
this.cancel()
this.getList()
this.cancel();
this.getList();
},
/** 取消按钮 */
cancel() {
@ -270,7 +200,7 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.$refs.addOrUpdate.dataFormSubmit()
this.$refs.addOrUpdate.dataFormSubmit();
// this.$refs['form'].validate((valid) => {
// if (!valid) {
// return;
@ -297,8 +227,8 @@ export default {
const id = row.id;
this.$modal
.confirm('是否确认删除记录"' + row.name + '"?')
.then(function () {
return this.delete({ id });
.then(() => {
return this.del({ id });
})
.then(() => {
this.getList();

View File

@ -61,6 +61,8 @@
v-if="open"
style="width: 100%"
v-model="queryParams.equipmentId"
filterable
clearable
placeholder="请选择一个设备">
<el-option
v-for="eq in eqList"

View File

@ -94,12 +94,19 @@
<script>
import Gantt from './chart';
import moment from 'moment';
export default {
name: 'SGStatus',
components: {},
props: {},
data() {
const today = new Date();
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
return {
chart: null,
searchBarFormConfig: [
@ -129,6 +136,7 @@ export default {
placeholder: '选择日期',
param: 'recordTime',
required: true,
defaultSelect: moment(todayStart).format('YYYY-MM-DD HH:mm:ss'),
},
{
type: 'button',
@ -369,7 +377,10 @@ export default {
const { code, data } = await this.$axios({
url: '/monitoring/equipment-monitor/status-series',
method: 'get',
params: this.queryParams,
params: {
recordTime: this.queryParams.recordTime,
equipmentId: this.queryParams.equipmentId,
},
});
if (code == 0) {
const newEqlist = this.objectToArray(data);

View File

@ -193,7 +193,8 @@ export default {
this.$auth.hasPermi('base:order-manage:addWorkOrder')
? {
type: 'add',
btnName: '新增工单',
btnName: '新增',
showTip: '新增工单',
showParam: {
type: '|',
data: [
@ -219,7 +220,8 @@ export default {
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'bind',
btnName: '绑定工单',
btnName: '绑定',
showTip: '绑定工单',
showParam: {
type: '|',
data: [
@ -245,7 +247,8 @@ export default {
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'complete',
btnName: '完成订单',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '|',
data: [

View File

@ -22,7 +22,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="250"
:width="140"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
@ -160,19 +160,52 @@ export default {
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? {
type: 'orderDetail',
btnName: '工单详情'
btnName: '工单',
showTip: '工单详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
? {
type: 'qualityDetail',
btnName: '质量详情'
btnName: '质量',
showTip: '质量详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
? {
type: 'sendOutDetail',
btnName: '发货详情'
btnName: '发货',
showTip: '发货详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'workOrderNum',
value: 1
}
]
}
}
: undefined
].filter((v) => v),