Merge branch 'projects/mes-test' of git.picaiba.com:mt-fe-group/yudao-dev into projects/mes-test
This commit is contained in:
commit
be430ebbff
@ -142,6 +142,9 @@ function findMaxLabelWidth(rows) {
|
||||
if (!opt.label) return 0;
|
||||
if (opt.label.length > max) {
|
||||
max = opt.label.length;
|
||||
if (opt.label.includes('(')) {
|
||||
max = max - 3
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -239,7 +242,7 @@ export default {
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -83,7 +83,7 @@ export default {
|
||||
],
|
||||
},
|
||||
placeholder: '请输入内容',
|
||||
readOnly: true,
|
||||
// readOnly: false,
|
||||
},
|
||||
};
|
||||
},
|
||||
@ -123,11 +123,13 @@ export default {
|
||||
const editor = this.$refs.editor;
|
||||
this.Quill = new Quill(editor, this.options);
|
||||
// 取消自动聚焦 start
|
||||
this.Quill?.enable(false);
|
||||
this.$nextTick(() => {
|
||||
this.Quill?.enable(true);
|
||||
this.Quill?.blur();
|
||||
if (!this.readOnly) {
|
||||
this.Quill?.enable();
|
||||
}
|
||||
// if (!this.readOnly) {
|
||||
// this.Quill?.enable();
|
||||
// }
|
||||
});
|
||||
// 如果设置了上传地址则自定义图片上传事件
|
||||
if (this.type === 'url') {
|
||||
@ -196,7 +198,7 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="scss" scoped>
|
||||
.editor-wrapper {
|
||||
position: relative;
|
||||
cursor: not-allowed;
|
||||
|
228
src/views/core/analysis/balanceAnalysis/chart.vue
Normal file
228
src/views/core/analysis/balanceAnalysis/chart.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<!--
|
||||
filename: chart.vue
|
||||
author: liubin
|
||||
date: 2023-11-29 09:03:01
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="analysis-chart">
|
||||
<!-- tt ct 选择 -->
|
||||
<el-button
|
||||
v-for="(item, index) in ['设备CT', '设备TT', '产线CT', '产线TT']"
|
||||
:key="index"
|
||||
:class="[index == activeIndex ? 'activeButton' : '']"
|
||||
@click="activeIndex = index">
|
||||
{{ item }}
|
||||
</el-button>
|
||||
<!-- chart -->
|
||||
<div id="chart" ref="chartDiv" class="chart" style="margin-top: 12px" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
name: 'AnalysisChart',
|
||||
components: {},
|
||||
props: ['daterange', 'tableData'],
|
||||
data() {
|
||||
return {
|
||||
activeIndex: 0,
|
||||
chart: null,
|
||||
templateOption: {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
legend: {
|
||||
icon: 'roundRect',
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
},
|
||||
grid: {
|
||||
top: '12%',
|
||||
left: '6%',
|
||||
right: '6%',
|
||||
bottom: '12%',
|
||||
},
|
||||
xAxis: {
|
||||
name: '时间',
|
||||
axisLabel: {
|
||||
margin: 12,
|
||||
rotate: -8,
|
||||
},
|
||||
axisTicks: {
|
||||
show: false,
|
||||
},
|
||||
data: this.daterange || [
|
||||
'2020-01-02',
|
||||
'2020-02-02',
|
||||
'2020-03-02',
|
||||
'2020-04-02',
|
||||
],
|
||||
},
|
||||
yAxis: {
|
||||
name: ['设备CT', '设备TT', '产线CT', '产线TT'][this.activeIndex],
|
||||
nameLocation: 'end',
|
||||
nameGap: 28,
|
||||
nameTextStyle: {
|
||||
fontSize: 14,
|
||||
align: 'right',
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#333',
|
||||
opacity: 0.6,
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'der Hund',
|
||||
type: 'line',
|
||||
data: [15, undefined, 36, 11],
|
||||
},
|
||||
{
|
||||
name: 'die Katze',
|
||||
type: 'line',
|
||||
data: [5, 2, 6, 3],
|
||||
},
|
||||
{
|
||||
name: 'die Maus',
|
||||
type: 'line',
|
||||
data: [11, 12, 13, 10],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.initChart();
|
||||
},
|
||||
deactivated() {},
|
||||
watch: {
|
||||
activeIndex(val) {
|
||||
this.initChart(val);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
*
|
||||
* @param {object} row 表格的每一列
|
||||
* @param {string} key 表格列prop的后缀
|
||||
*/
|
||||
getListFromTableRow(row, key = '_eq_ct') {
|
||||
const list = [];
|
||||
for (const prop of Object.keys(row).sort()) {
|
||||
if (prop.endsWith(key)) {
|
||||
list.push(row[prop]);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
},
|
||||
/** 初始化/设置 图表 */
|
||||
initChart(val) {
|
||||
console.log('tableData', this.tableData);
|
||||
if (!this.chart) this.chart = echarts.init(this.$refs.chartDiv);
|
||||
switch (val) {
|
||||
case 0:
|
||||
const eqCt = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
data: this.getListFromTableRow(row, '_eq_ct'),
|
||||
}));
|
||||
this.chart.setOption({
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
|
||||
series: eqCt,
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
const eqTt = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
data: this.getListFromTableRow(row, '_eq_tt'),
|
||||
}));
|
||||
this.chart.setOption({
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备TT' },
|
||||
series: eqTt,
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
const plCt = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
data: this.getListFromTableRow(row, '_pl_ct'),
|
||||
}));
|
||||
this.chart.setOption({
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '产线CT' },
|
||||
series: plCt,
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
const plTt = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
data: this.getListFromTableRow(row, '_pl_tt'),
|
||||
}));
|
||||
this.chart.setOption({
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '产线TT' },
|
||||
series: plTt,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
const eqCt2 = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
symbol: 'circle',
|
||||
symbolSize: 8,
|
||||
data: this.getListFromTableRow(row, '_eq_ct'),
|
||||
}));
|
||||
this.chart.setOption({
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
|
||||
series: eqCt2,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.analysis-chart {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.analysis-chart >>> .el-button {
|
||||
background: #f1f1f1;
|
||||
color: #333;
|
||||
transition: all 0.3s;
|
||||
border: none;
|
||||
|
||||
&.activeButton,
|
||||
&:hover {
|
||||
background: #0b58ff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
#chart {
|
||||
height: 100%;
|
||||
/* background: #ccc; */
|
||||
}
|
||||
</style>
|
@ -1,51 +1,56 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="app-container" style="flex: 1; height: 1px">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
|
||||
<!-- <div v-if="tableData.length"> -->
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
@tab-click="handleTabClick"
|
||||
style="height: 100%">
|
||||
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
||||
<!-- @emitFun="handleEmitFun"> -->
|
||||
<base-table
|
||||
v-if="activeName == 'table'"
|
||||
:span-method="mergeColumnHandler"
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
|
||||
<div class="graph" style="height: 100%">
|
||||
<!-- graph -->
|
||||
<!-- <Graph
|
||||
<div class="custom-tabs" style="">
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
@tab-click="handleTabClick"
|
||||
style="height: 100%">
|
||||
<el-tab-pane :label="'\u2002数据列表\u2002'" name="table">
|
||||
<base-table
|
||||
v-if="activeName == 'table' && ready"
|
||||
:span-method="mergeRow"
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData" />
|
||||
<div v-if="tableData.length == 0" class="no-data-bg"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
|
||||
<div class="graph" style="height: 800px">
|
||||
<!-- graph -->
|
||||
<AnalysisChart
|
||||
v-if="activeName == 'graph'"
|
||||
:table-data="tableData"
|
||||
:daterange="dateArr"></AnalysisChart>
|
||||
<!-- <div v-else class="no-data-bg"></div> -->
|
||||
<!-- <Graph
|
||||
v-if="list.length"
|
||||
:equipment-list="list"
|
||||
:render="renderKey" /> -->
|
||||
<!-- <BalanceChart ref="lineChart" /> -->
|
||||
<div v-if="list.length == 0" class="no-data-bg"></div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- <SearchBar :formConfigs="[{ label: '产线平衡分析图', type: 'title' }]" /> -->
|
||||
<!-- </div>
|
||||
<div v-else class="no-data-bg"></div> -->
|
||||
<!-- <BalanceChart ref="lineChart" /> -->
|
||||
<!-- <div v-if="list.length == 0" class="no-data-bg"></div> -->
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BalanceChart from '../balanceChart';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AnalysisChart from './chart.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BalanceChart,
|
||||
AnalysisChart,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
@ -98,6 +103,13 @@ export default {
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
sectionMap: {},
|
||||
lastSection: null,
|
||||
currRowIndex: 0,
|
||||
spanArr: [],
|
||||
// 保存时间列表
|
||||
dateArr: [],
|
||||
ready: false,
|
||||
};
|
||||
},
|
||||
|
||||
@ -156,11 +168,19 @@ export default {
|
||||
const { data, nameData } = await this.getCT();
|
||||
await this.buildProps(nameData);
|
||||
await this.buildTableData(data);
|
||||
const xxxx = this.tableData;
|
||||
debugger;
|
||||
this.tableData = this.tableData.sort((a, b) => {
|
||||
if (a.sectionName < b.sectionName) return -1;
|
||||
return 1;
|
||||
});
|
||||
// const p = this.tableProps
|
||||
// const d = this.tableData
|
||||
// debugger;
|
||||
this.ready = true;
|
||||
},
|
||||
|
||||
buildProps(nameData) {
|
||||
this.initTableProps();
|
||||
this.dateArr = [];
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
const dateArr = Array.from(
|
||||
@ -199,7 +219,7 @@ export default {
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
this.dateArr = dateArr;
|
||||
resolve();
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
@ -208,38 +228,68 @@ export default {
|
||||
},
|
||||
|
||||
async buildTableData(data) {
|
||||
/** 处理 工段 分组 */
|
||||
const sectionList = data.map((item) => {});
|
||||
},
|
||||
this.tableData = [];
|
||||
const sectionArr = Array.from(
|
||||
new Set(data.map((item) => item.sectionName))
|
||||
).sort();
|
||||
|
||||
setRowSpan(arr) {
|
||||
let count = 0;
|
||||
arr.forEach((item, index) => {
|
||||
if (index === 0) {
|
||||
this.spanArr.push(1);
|
||||
} else {
|
||||
if (item === arr[index - 1]) {
|
||||
this.spanArr[count] += 1;
|
||||
this.spanArr.push(0);
|
||||
} else {
|
||||
count = index;
|
||||
this.spanArr.push(1);
|
||||
}
|
||||
const sectionMap = sectionArr.reduce(
|
||||
(sum, curr) => ({ ...sum, [curr]: 0 }),
|
||||
{}
|
||||
);
|
||||
|
||||
console.log('sectionArr', sectionArr);
|
||||
console.log('sectionMap', sectionMap);
|
||||
let spanArr = Array.from(sectionArr, () => 0);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
/** 处理 工段 分组 */
|
||||
data.map((item) => {
|
||||
sectionMap[item.sectionName]++;
|
||||
/** 处理 设备 */
|
||||
const row = {
|
||||
equName: item.equName,
|
||||
sectionName: item.sectionName,
|
||||
};
|
||||
item.data.forEach((eq) => {
|
||||
const date = eq.dynamicName;
|
||||
eq.children.forEach((sub) => {
|
||||
if (sub.dynamicName == '设备CT')
|
||||
row[date + '_eq_ct'] = sub.dynamicValue;
|
||||
if (sub.dynamicName == '设备TT')
|
||||
row[date + '_eq_tt'] = sub.dynamicValue;
|
||||
if (sub.dynamicName == '产线CT')
|
||||
row[date + '_pl_ct'] = sub.dynamicValue;
|
||||
if (sub.dynamicName == '产线TT')
|
||||
row[date + '_pl_tt'] = sub.dynamicValue;
|
||||
});
|
||||
});
|
||||
this.tableData.push(row);
|
||||
});
|
||||
|
||||
/** 生成span数组 */
|
||||
const tmp = [...spanArr];
|
||||
for (const [index, key] of sectionArr.entries()) {
|
||||
tmp[index + 1] = tmp[index] + sectionMap[key];
|
||||
}
|
||||
|
||||
console.log('tep', tmp);
|
||||
spanArr = tmp;
|
||||
|
||||
this.sectionMap = sectionMap;
|
||||
this.spanArr = spanArr;
|
||||
resolve();
|
||||
});
|
||||
},
|
||||
|
||||
/** 合并table列的规则 */
|
||||
mergeColumnHandler({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex == 0) {
|
||||
if (this.spanArr[rowIndex]) {
|
||||
return [
|
||||
this.spanArr[rowIndex], // row span
|
||||
1, // col span
|
||||
];
|
||||
} else {
|
||||
return [0, 0];
|
||||
mergeRow({ row, column, rowIndex, columnIndex }) {
|
||||
if (columnIndex == 1) {
|
||||
const span = this.sectionMap[row.sectionName];
|
||||
if (this.spanArr.includes(rowIndex)) {
|
||||
console.log('span...');
|
||||
return [span, 1];
|
||||
}
|
||||
return [0, 0];
|
||||
}
|
||||
},
|
||||
|
||||
@ -319,6 +369,7 @@ export default {
|
||||
// this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
@ -381,3 +432,23 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.custom-tabs >>> .el-tabs__header {
|
||||
margin-bottom: 8px;
|
||||
display: inline-block;
|
||||
transform: translateY(-12px);
|
||||
}
|
||||
.custom-tabs >>> .el-tabs__item {
|
||||
padding-left: 0px !important;
|
||||
padding-right: 0px !important;
|
||||
line-height: 36px !important;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.custom-tabs >>> .el-tabs__content {
|
||||
height: calc(100% - 42px);
|
||||
}
|
||||
.custom-tabs >>> .el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
@ -63,7 +63,7 @@ const tableProps = [
|
||||
}
|
||||
]
|
||||
export default {
|
||||
name: "EnergyPlc",
|
||||
name: "EnergyQuantityRealtime",
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
@ -125,10 +125,34 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
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.queryParams.startTime = this.formConfig[1].defaultSelect[0]
|
||||
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||
this.getList();
|
||||
this.getTypeList()
|
||||
},
|
||||
watch: {
|
||||
$route: 'initData'
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'EnergyQuantityRealtime') {
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
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.queryParams.startTime = this.formConfig[1].defaultSelect[0]
|
||||
this.queryParams.endTime = this.formConfig[1].defaultSelect[1]
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
|
@ -80,8 +80,7 @@ export default {
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350,
|
||||
clearable: false,
|
||||
required:true
|
||||
clearable: false
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -122,35 +121,11 @@ export default {
|
||||
this.tableH = this.tableHeight(260)
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||
})
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
} else {
|
||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||
}
|
||||
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
|
||||
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
|
||||
this.getList()
|
||||
this.getTypeList()
|
||||
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
|
||||
},
|
||||
watch: {
|
||||
$route: 'initData'
|
||||
},
|
||||
methods: {
|
||||
initData(to) {
|
||||
if (to.name === 'EnergyReportSearch') {
|
||||
if (location.href.indexOf('?') > 0) {
|
||||
let arr = location.href.split('?')[1].split('&')
|
||||
this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]]
|
||||
} else {
|
||||
this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()]
|
||||
}
|
||||
this.queryParams.startTime = this.formConfig[2].defaultSelect[0]
|
||||
this.queryParams.endTime = this.formConfig[2].defaultSelect[1]
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.formConfig[1].selectOptions = res.data || []
|
||||
|
@ -9,7 +9,8 @@
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="mode.includes('detail') ? true : false"
|
||||
:before-close="handleCancel"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@ -129,13 +130,12 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="handleCancel">返回</el-button>
|
||||
<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="handleSave">
|
||||
保存
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,7 +9,8 @@
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="mode.includes('detail') ? true : false"
|
||||
:before-close="handleCancel"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@ -128,11 +129,10 @@
|
||||
</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">
|
||||
确定
|
||||
</el-button>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="700px"
|
||||
width="30%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
|
@ -25,6 +25,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="90"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -41,7 +42,7 @@
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="700px"
|
||||
width="45%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
@ -127,7 +128,7 @@ export default {
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'code', label: '编码' },
|
||||
{ prop: 'code', label: '编码', showOverflowtooltip: true },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'name', label: '标识名称' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
@ -136,7 +137,7 @@ export default {
|
||||
label: '是否采集',
|
||||
subcomponent: switchBtn,
|
||||
},
|
||||
{ prop: 'description', label: '描述' },
|
||||
{ prop: 'description', label: '描述', showOverflowtooltip: true },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -213,16 +214,28 @@ export default {
|
||||
},
|
||||
],
|
||||
[
|
||||
// {
|
||||
// switch: true,
|
||||
// label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
||||
// prop: 'collection',
|
||||
// bind: {
|
||||
// 'active-value': 1,
|
||||
// 'inactive-value': 0,
|
||||
// value: 1,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
switch: true,
|
||||
label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
||||
select: true,
|
||||
options: [
|
||||
{ label: '否', value: 0 },
|
||||
{ label: '是', value: 1 }
|
||||
],
|
||||
label: '是否采集',
|
||||
prop: 'collection',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
value: 1,
|
||||
},
|
||||
},
|
||||
clearable: true, filterable: true
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
|
@ -9,7 +9,8 @@
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="mode.includes('detail') ? true : false"
|
||||
:before-close="handleCancel"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
:size="size || '50%'"
|
||||
@ -147,13 +148,12 @@
|
||||
</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="handleSave">
|
||||
保存
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,8 @@
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
size="60%"
|
||||
@closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '查看详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
@ -265,6 +266,7 @@ export default {
|
||||
this.fileName = this.dataForm.files[0].fileName
|
||||
}
|
||||
this.setConfig()
|
||||
this.setInspectionContet()
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
|
@ -49,7 +49,8 @@
|
||||
<addRecord
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
@refreshDataList="getList"
|
||||
@destroy="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
<script>
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
// import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
@ -67,7 +67,7 @@ const remainBox = {
|
||||
color() {
|
||||
if (this.value) {
|
||||
const v = +this.value;
|
||||
return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
||||
return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F';
|
||||
}
|
||||
return 'unset';
|
||||
},
|
||||
@ -78,9 +78,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>
|
||||
);
|
||||
},
|
||||
@ -121,30 +122,35 @@ export default {
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'name', label: '保养计划' },
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'sectionName', label: '工段名' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'name', label: '保养计划', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'sectionName', label: '工段名', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率' },
|
||||
{
|
||||
prop: 'maintainType',
|
||||
label: '保养类型',
|
||||
showOverflowtooltip: true,
|
||||
filter: publicFormatter(this.DICT_TYPE.MAINTAIN_TYPE),
|
||||
},
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次保养时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离保养时间(天)',
|
||||
subcomponent: remainBox,
|
||||
minWidth: 150,
|
||||
// showOverflowtooltip: true
|
||||
},
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn, width: 100 },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn, width: 100 },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -176,6 +182,7 @@ export default {
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
|
@ -99,23 +99,24 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
width: 150,
|
||||
filter: timeFilter,
|
||||
},
|
||||
{ prop: 'maintainOrderNumber', label: '设备保养单号' },
|
||||
{ prop: 'startTime', label: '开始时间', filter: timeFilter },
|
||||
{ prop: 'endTime', label: '结束时间', filter: timeFilter },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'maintainWorker', label: '保养人员' },
|
||||
{ prop: 'maintainOrderNumber', label: '设备保养单号', width: 110, showOverflowtooltip: true },
|
||||
{ prop: 'startTime', label: '开始时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'endTime', label: '结束时间', filter: timeFilter, minWidth: 150, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintainWorker', label: '保养人员', minWidth: 100, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'relatePlan',
|
||||
label: '是否计划保养',
|
||||
width: 120,
|
||||
filter: (v) => (v != null ? ['', '是', '否'][v] : ''),
|
||||
},
|
||||
{ prop: 'planName', label: '保养计划名称' },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
|
||||
{ prop: 'timeUsed', label: '实际保养用时(h)' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
{ prop: 'planName', label: '保养计划名称', minWidth: 120, showOverflowtooltip: true },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)', minWidth: 130, showOverflowtooltip: true },
|
||||
{ prop: 'timeUsed', label: '实际保养用时(h)', minWidth: 130 },
|
||||
{ prop: 'remark', label: '备注', minWidth: 100, showOverflowtooltip: true },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -162,6 +163,15 @@ export default {
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:maintain-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'warning',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:maintain-record:create')
|
||||
? 'button'
|
||||
@ -171,14 +181,6 @@ export default {
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:maintain-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
@ -213,17 +215,29 @@ export default {
|
||||
},
|
||||
],
|
||||
[
|
||||
// {
|
||||
// switch: true,
|
||||
// label: '是否计划保养',
|
||||
// prop: 'relatePlan',
|
||||
// bind: {
|
||||
// 'active-value': 1,
|
||||
// 'inactive-value': 2,
|
||||
// },
|
||||
// rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }],
|
||||
// },
|
||||
{
|
||||
switch: true,
|
||||
select: true,
|
||||
options: [
|
||||
{ label: '是', value: 1 },
|
||||
{ label: '否', value: 2 }
|
||||
],
|
||||
label: '是否计划保养',
|
||||
prop: 'relatePlan',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 2,
|
||||
clearable: true, filterable: true
|
||||
},
|
||||
rules: [{ required: true, message: '是否计划保养不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{},
|
||||
{
|
||||
select: true,
|
||||
label: '所属计划',
|
||||
@ -234,6 +248,11 @@ export default {
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '保养用时',
|
||||
prop: 'timeUsed',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -260,11 +279,7 @@ export default {
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '保养用时',
|
||||
prop: 'timeUsed',
|
||||
},
|
||||
{}
|
||||
],
|
||||
|
||||
[
|
||||
|
@ -9,166 +9,168 @@
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="disabled"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
custom-class="mes-drawer"
|
||||
size="65%"
|
||||
@closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
|
||||
</small-title>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<span>{{ dataForm.equipmentName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修工" prop="repairman">
|
||||
<span>{{ dataForm.repairman }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||
<span>{{ dataForm.repairmanPhone }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
{{ '可编辑信息' }}
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修开始时间"
|
||||
prop="maintenanceStartTime"
|
||||
:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceStartTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="dataForm"
|
||||
label-width="100px"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<span>{{ dataForm.equipmentName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修工" prop="repairman">
|
||||
<span>{{ dataForm.repairman }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||
<span>{{ dataForm.repairmanPhone }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修结束时间"
|
||||
prop="maintenanceFinishTime"
|
||||
:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceFinishTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider style="margin-top: -10px" />
|
||||
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
{{ '设备维修信息' }}
|
||||
</small-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修开始时间"
|
||||
prop="maintenanceStartTime"
|
||||
:rules="[{ required: true, message: '维修开始时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceStartTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修结束时间"
|
||||
prop="maintenanceFinishTime"
|
||||
:rules="[{ required: true, message: '维修结束时间不能为空', trigger: 'blur' }]">
|
||||
<el-date-picker
|
||||
v-model="dataForm.maintenanceFinishTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
placeholder="请选择维修开始时间"
|
||||
value-format="timestamp" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="维修方式"
|
||||
prop="repairMode"
|
||||
:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.repairMode"
|
||||
placeholder="请选择维修方式">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('repair-mode')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.faultType"
|
||||
placeholder="请选择故障类型">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('fault-type')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修方式"
|
||||
prop="repairMode"
|
||||
:rules="[{ required: true, message: '维修方式不能为空', trigger: 'blur' }]">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.repairMode"
|
||||
placeholder="请选择维修方式">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('repair-mode')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-select
|
||||
:disabled="disabled"
|
||||
v-model="dataForm.faultType"
|
||||
placeholder="请选择故障类型">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas('fault-type')"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item
|
||||
label="故障明细"
|
||||
prop="faultDetail"
|
||||
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item
|
||||
label="故障明细"
|
||||
prop="faultDetail"
|
||||
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="380"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="380"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修附件" prop="file">
|
||||
<FileUpload v-model="file" :limit="1" :f-name="fileName" :disabled="disabled" @name="setFileName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<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>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@ -300,56 +302,39 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
|
@ -17,7 +17,7 @@
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
:width="180"
|
||||
:width="120"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleTableBtnClick" />
|
||||
</base-table>
|
||||
@ -48,7 +48,8 @@
|
||||
<CustomDialogForm
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
@refreshDataList="getList"
|
||||
@destroy="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -69,12 +70,6 @@ export default {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['maintenanceStatus', 'createTime', 'equipmentId'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:repair:update')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:repair:finish')
|
||||
? {
|
||||
type: 'finish',
|
||||
@ -83,10 +78,16 @@ export default {
|
||||
: undefined,
|
||||
this.$auth.hasPermi('equipment:repair:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '修改',
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
// this.$auth.hasPermi('equipment:repair:update')
|
||||
// ? {
|
||||
// type: 'edit',
|
||||
// btnName: '修改',
|
||||
// }
|
||||
// : undefined,
|
||||
this.$auth.hasPermi('equipment:repair:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
@ -99,29 +100,31 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
width: 150,
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'repairOrderNumber', label: '设备维修单号' },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
|
||||
{ prop: 'repairOrderNumber', label: '设备维修单号', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'maintenanceFinishTime',
|
||||
label: '结束时间',
|
||||
filter: parseTime,
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceStatus',
|
||||
label: '维修状态',
|
||||
filter: (v) => (v != null ? ['未完成', '完成', '进行中'][v] : ''),
|
||||
},
|
||||
{ prop: 'maintenanceDuration', label: '维修时长(h)' },
|
||||
{ prop: 'maintenanceDuration', label: '维修时长(h)', width: 110 },
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'maintenanceDetail', label: '维修明细' },
|
||||
{ prop: 'repairman', label: '维修工' },
|
||||
{ prop: 'repairmanPhone', label: '联系方式' },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
{ prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@ -176,6 +179,7 @@ export default {
|
||||
type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
|
@ -80,6 +80,8 @@
|
||||
<el-select
|
||||
v-if="open"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
clearable
|
||||
v-model="queryParams.equipmentId"
|
||||
placeholder="请选择一个设备">
|
||||
<el-option
|
||||
|
@ -290,7 +290,8 @@ export default {
|
||||
break;
|
||||
case '2': // 能源
|
||||
this.$router.push({
|
||||
path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||
// path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||
path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||
})
|
||||
break;
|
||||
default:
|
||||
|
@ -115,12 +115,12 @@ export default {
|
||||
vm.$set(
|
||||
vm.searchBarFormConfig[0],
|
||||
'defaultSelect',
|
||||
to.params.equipmentCode
|
||||
to.params.equipmentName
|
||||
);
|
||||
vm.$set(
|
||||
vm.searchBarFormConfig[1],
|
||||
'defaultSelect',
|
||||
to.params.equipmentName
|
||||
to.params.equipmentCode
|
||||
);
|
||||
vm.handleQuery();
|
||||
});
|
||||
|
@ -33,7 +33,7 @@
|
||||
:data-value="fc.id"
|
||||
class="factory-list__item"
|
||||
:class="{ 'is-current': fc.id == currentFactory?.id }">
|
||||
<span>
|
||||
<span :data-value="fc.id">
|
||||
{{ fc.label }}
|
||||
</span>
|
||||
<svg-icon
|
||||
@ -98,9 +98,7 @@
|
||||
</base-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000柱状图\u3000'" name="graph">
|
||||
<div
|
||||
class="graph"
|
||||
style="height: 100%;">
|
||||
<div class="graph" style="height: 100%">
|
||||
<!-- graph -->
|
||||
<Graph
|
||||
v-if="list.length"
|
||||
|
@ -11,7 +11,7 @@
|
||||
<base-table class="base-table__margin" :table-props="productProps" :page="1" :limit="10" :table-data="list">
|
||||
</base-table>
|
||||
<div v-for="(item,index) in downProps" :key="index">
|
||||
<div class="blue-title">工单:{{ list[index].workOrderName }}</div>
|
||||
<div class="blue-title">工单名称:{{ list[index].workOrderName }}</div>
|
||||
<base-table class="base-table__margin" :table-props="item" :page="1" :limit="10"
|
||||
:table-data="downList[index]">
|
||||
</base-table>
|
||||
@ -214,7 +214,7 @@ export default {
|
||||
{
|
||||
// width: 160,
|
||||
prop: 'workOrderName',
|
||||
label: '工单名',
|
||||
label: '工单名称',
|
||||
},
|
||||
...this.dynamicProps,
|
||||
{
|
||||
|
@ -9,8 +9,8 @@
|
||||
<el-form ref="form" :model="innerDataForm" label-width="100px" v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单号" prop="workOrderId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="innerDataForm.workOrderId" placeholder="请选择工单号" filterable clearable>
|
||||
<el-form-item label="工单名称" prop="workOrderId" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||
<el-select v-model="innerDataForm.workOrderId" placeholder="请选择工单名称" filterable clearable>
|
||||
<el-option v-for="opt in workOrderList" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -141,8 +141,8 @@ export default {
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单号',
|
||||
placeholder: '请选择工单号',
|
||||
label: '工单名称',
|
||||
placeholder: '请选择工单名称',
|
||||
param: 'workOrderId',
|
||||
selectOptions: [],
|
||||
filterable:true
|
||||
@ -215,7 +215,7 @@ export default {
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'workOrderName',
|
||||
label: '工单Id',
|
||||
label: '工单名称',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
|
@ -67,8 +67,8 @@ export default {
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '工单号',
|
||||
placeholder: '请选择工单号',
|
||||
label: '工单名称',
|
||||
placeholder: '请选择工单名称',
|
||||
param: 'workOrderIdList',
|
||||
selectOptions: [],
|
||||
multiple: true,
|
||||
@ -205,8 +205,8 @@ export default {
|
||||
return [
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'workOrderId',
|
||||
label: '工单号',
|
||||
prop: 'workOrderName',
|
||||
label: '工单名称',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
|
Loading…
Reference in New Issue
Block a user