Compare commits

...

25 Commits

Author SHA1 Message Date
zwq
60f6c3a8fe 更新成本 2024-04-09 11:05:37 +08:00
a4b340ac5d Merge pull request 'projects/mesxc-dy' (#318) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #318
2024-04-09 08:18:01 +08:00
helloDy
2592551e66 Merge branch 'projects/mesxc-test' into projects/mesxc-dy 2024-04-08 17:03:21 +08:00
helloDy
1fde96e677 工单bug,改动 2024-04-08 17:02:55 +08:00
0b16e1fe0d Merge pull request '驾驶舱修改' (#317) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #317
2024-04-08 16:39:30 +08:00
bdd14eec70 驾驶舱修改 2024-04-08 16:38:12 +08:00
44e7e219a4 Merge pull request 'projects/mesxc-zhp' (#316) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #316
2024-04-08 16:37:26 +08:00
‘937886381’
ec51beb8ea Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-08 15:14:37 +08:00
‘937886381’
433618e71d 修改bug 2024-04-08 15:13:52 +08:00
812b72f10d Merge pull request 'projects/mesxc-zhp' (#315) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #315
2024-04-08 15:11:34 +08:00
‘937886381’
05f10ab51d Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-08 14:49:46 +08:00
‘937886381’
e7828fd277 修改bug 2024-04-08 14:49:20 +08:00
58457487d1 Merge pull request 'projects/mesxc-zhp' (#314) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #314
2024-04-08 14:09:52 +08:00
‘937886381’
6c54c223c5 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-08 13:55:56 +08:00
‘937886381’
b2cc509f8e 权限 2024-04-08 13:55:22 +08:00
b6236e89b1 Merge pull request '1' (#313) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #313
2024-04-08 12:26:34 +08:00
cbc7cbc574 1 2024-04-08 12:25:44 +08:00
b5b952e1cc Merge pull request 'projects/mesxc-zjl' (#312) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #312
2024-04-08 10:44:09 +08:00
33ed9f15fa Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-08 10:42:42 +08:00
c85c6e4323 能源 2024-04-08 10:41:43 +08:00
30d22b34e1 Merge pull request '成本按钮权限' (#311) from projects/mesxc-zwq into projects/mesxc-test
Reviewed-on: #311
2024-04-08 09:05:52 +08:00
f960ece594 Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-07 16:14:52 +08:00
949675b3a2 1 2024-04-07 16:13:57 +08:00
a06682de3f Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-07 15:41:17 +08:00
e1773dae03 1 2024-04-07 15:39:26 +08:00
72 changed files with 5954 additions and 5605 deletions

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-04-03 11:22:19
# @LastEditTime: 2024-04-08 16:46:49
# @LastEditors: DY
# @Description:
###

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-22 08:53:20
* @LastEditTime: 2024-04-08 10:21:46
* @Description:
-->
<template>
@ -214,7 +214,9 @@ export default {
actualQuantity: this.dataForm.actualQuantity
}).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.saveData(tempList)
if (tempList.length > 0) {
this.saveData(tempList)
}
this.visible = false;
this.$emit("refreshDataList");
});

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-21 16:52:46
* @LastEditTime: 2024-04-08 14:27:29
* @Description:
-->
<template>
@ -182,7 +182,8 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="orderList">
:table-data="orderList"
:max-height="tableH">
<method-btn
v-if="!isdetail"
slot="handleBtn"
@ -209,7 +210,8 @@
:table-props="tableProps1"
:page="listQuery1.pageNo"
:limit="listQuery1.pageSize"
:table-data="materialList" />
:table-data="materialList"
:max-height="tableH" />
<!-- <pagination
v-show="listQuery1.total > 0"
:total="listQuery1.total"
@ -235,6 +237,7 @@ import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import topTabVue from '../../order/base/orderManage/components/topTab.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableBtn = [
{
@ -292,9 +295,11 @@ const tableProps1 = [
];
export default {
mixins: [tableHeightMixin],
components: { SmallTitle, topTabVue },
data() {
return {
heightNum: 380,
tableBtn,
tableProps,
tableProps1,
@ -455,7 +460,7 @@ export default {
// this.listQuery.total = response.data.total;
});
// 使
console.log()
console.log('111我看看', this.dataForm.materialMethod)
if (this.dataForm.id) {
if (this.dataForm.materialMethod === 1) {
//

View File

@ -9,7 +9,8 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData">
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
@ -62,7 +63,7 @@ import {
getCoreWOList
} from '@/api/base/coreWorkOrder';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
@ -132,7 +133,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage, tableHeightMixin],
components: {
AddWorkOrder,
AddOrUpdate,

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-02-28 10:38:34
* @LastEditTime: 2024-04-08 11:49:33
* @Description:
-->
<template>
@ -128,7 +128,7 @@ export default {
param: 'createTime',
},
{
type: 'button',
type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '',
btnName: '搜索',
name: 'search',
color: 'primary',

View File

@ -32,6 +32,7 @@ import {
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
@ -61,7 +62,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage,tableHeightMixin],
data() {
return {
urlOptions: {
@ -70,7 +71,6 @@ export default {
},
tableData: [],
tableProps,
tableH: this.tableHeight(260),
drawerVisible: false,
formConfig: [
{
@ -113,9 +113,6 @@ export default {
},
components: {},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getEnergyTypeListAll().then((response) => {
this.formConfig[0].selectOptions = response.data;
});

View File

@ -32,6 +32,7 @@ import {
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
@ -71,7 +72,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage,tableHeightMixin],
data() {
return {
urlOptions: {
@ -80,7 +81,6 @@ export default {
},
tableData: [],
tableProps,
tableH: this.tableHeight(260),
drawerVisible: false,
formConfig: [
{
@ -137,9 +137,6 @@ export default {
},
components: {},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

View File

@ -12,7 +12,7 @@
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:max-height="tableH"
:max-height="tableH"
:table-data="tableData">
<method-btn
v-if="tableBtn.length"
@ -53,6 +53,7 @@ import {
} from '@/api/cost/costMaterialSet';
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
@ -91,7 +92,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage,tableHeightMixin],
data() {
return {
urlOptions: {
@ -99,7 +100,6 @@ export default {
deleteURL: deleteCostMaterialSet,
},
tableProps,
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
? {
@ -132,7 +132,11 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermi('cost:rawMaterialConfig:create') &&
this.$auth.hasPermi('cost:rawMaterialConfig:query')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('cost:rawMaterialConfig:create')
@ -150,9 +154,6 @@ export default {
AddOrUpdate,
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data;
});

View File

@ -32,6 +32,7 @@ import {
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
@ -66,7 +67,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage,tableHeightMixin],
data() {
return {
urlOptions: {
@ -75,7 +76,6 @@ export default {
},
tableData: [],
tableProps,
tableH: this.tableHeight(260),
drawerVisible: false,
formConfig: [
{
@ -118,9 +118,6 @@ export default {
},
components: {},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
getHotMaterialList().then((response) => {
this.formConfig[0].selectOptions = response.data;
});

View File

@ -32,6 +32,7 @@ import {
import { getHotMaterialList } from '@/api/base/coreHotMaterial';
import { publicFormatter } from '@/utils/dict';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
@ -70,7 +71,7 @@ const tableProps = [
];
export default {
mixins: [basicPage],
mixins: [basicPage,tableHeightMixin],
data() {
return {
urlOptions: {
@ -79,7 +80,6 @@ export default {
},
tableData: [],
tableProps,
tableH: this.tableHeight(260),
drawerVisible: false,
formConfig: [
{
@ -136,9 +136,6 @@ export default {
},
components: {},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);

View File

@ -1,234 +1,258 @@
<template>
<div style="height: 370px;">
<NotMsg v-show="notMsg"/>
<div id="numRateChart" class="num-rate-chart" style="width:900px;height:420px;" v-show='!notMsg'></div>
</div>
<div style="height: 370px">
<NotMsg v-show="notMsg" />
<div
id="numRateChart"
class="num-rate-chart"
style="width: 900px; height: 420px"
v-show="!notMsg"></div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import resize from './../mixins/resize'
import NotMsg from './../components/NotMsg'
import resize from './../mixins/resize';
import NotMsg from './../components/NotMsg';
export default {
name: 'NumRateChart',
mixins: [resize],
components:{ NotMsg },
data() {
return {
chart: null,
notMsg:true
}
},
computed: {
productline() {
return this.$store.state.websocket.productline
}
},
watch:{
productline: {
name: 'NumRateChart',
mixins: [resize],
components: { NotMsg },
data() {
return {
chart: null,
notMsg: true,
};
},
computed: {
productline() {
return this.$store.state.websocket.productline;
},
},
watch: {
productline: {
handler(newVal, oldVal) {
if (newVal === oldVal) {
return false
}
this.updateChart()
this.$emit('emitFun')
}
}
},
mounted() {
if (newVal === oldVal) {
return false;
}
this.updateChart();
this.$emit('emitFun');
},
},
},
mounted() {
this.$el.addEventListener('resize', () => {
console.log('resziing.....');
});
this.updateChart()
this.updateChart();
},
methods: {
updateChart() {
if (this.productline && this.productline.length > 0) {
this.notMsg = false
} else {
this.notMsg = true
return
}
let xData = []
let outputNum = []
let passRate = []
this.productline && this.productline.length > 0 && this.productline.map(item => {
if ((item.lineName).includes('D')) {
xData.push(item.lineName)
outputNum.push(item.outputNum)
passRate.push(item.passRate?item.passRate*100:null)
}
})
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose()
}
this.chart = echarts.init(document.getElementById('numRateChart'));
var option = {
grid: { top: 82, right: 60, bottom: 20, left: 90 },
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
className: "num-rate-chart-tooltip"
},
legend: {
itemWidth:10,
itemHeight:10,
top: '2.5%',
methods: {
updateChart() {
if (this.productline && this.productline.length > 0) {
this.notMsg = false;
} else {
this.notMsg = true;
return;
}
let xData = [];
let outputNum = [];
let passRate = [];
for (let i = 0; i < this.productline.length - 1; i++) {
//
for (let j = 0; j < this.productline.length - i - 1; j++) {
//
if (
this.productline[j].lineName.substr(
this.productline[j].lineName.length - 1,
1
) >
this.productline[j + 1].lineName.substr(
this.productline[j + 1].lineName.length - 1,
1
)
) {
//
let temp = this.productline[j];
this.productline[j] = this.productline[j + 1];
this.productline[j + 1] = temp;
}
}
}
this.productline &&
this.productline.length > 0 &&
this.productline.map((item) => {
if (item.lineName.includes('D')) {
xData.push(item.lineName);
outputNum.push(item.outputNum);
passRate.push(item.passRate);
}
});
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose();
}
this.chart = echarts.init(document.getElementById('numRateChart'));
var option = {
grid: { top: 82, right: 60, bottom: 20, left: 90 },
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
className: 'num-rate-chart-tooltip',
},
legend: {
itemWidth: 10,
itemHeight: 10,
top: '2.5%',
right: '20px',
icon: 'rect',
data: [
{name:'产线产量',itemStyle:{color:'#364BFE'}},
{name:'良品率',itemStyle:{color:'#FFCB59'}}
],
textStyle: {
color: "#DFF1FE",
fontSize: 12,
}
},
xAxis: [
{
type: 'category',
data: xData,
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisPointer: {
type: 'shadow'
},
axisTick: { show: false },
axisLine: {
lineStyle: {
width: 1,
color: "#213259",
},
},
}
],
yAxis: [
{
type: 'value',
name: '产量/片',
nameTextStyle: {
color: '#fff',
fontSize: 10,
align: 'right',
},
axisLabel: {
color: "#fff",
fontSize: 12,
formatter: '{value}'
},
axisLine: {
show: true,
lineStyle: {
color: "#213259",
},
},
splitLine: {
lineStyle: {
color: "#213259a0",
},
}
},
{
type: 'value',
name: '良品率',
nameTextStyle: {
color: '#fff',
fontSize: 10,
align: 'LEFT',
},
axisLabel: {
color: "#fff",
fontSize: 12,
formatter: () =>{
return value ? '{value} %': '-'
}
},
axisLine: {
show: true,
lineStyle: {
color: "#213259",
},
},
splitLine: {
lineStyle: {
color: "#213259a0",
},
}
}
],
series: [
{
name: '产线产量',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 20,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#5CB7FF' },
{ offset: 1, color: '#364BFE' }
])
},
data: outputNum
},
{
name: '良品率',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value?value + '%':'-';
}
},
itemStyle: {
color: '#FFD160'
},
areaStyle: {
icon: 'rect',
data: [
{ name: '产线产量', itemStyle: { color: '#364BFE' } },
{ name: '良品率', itemStyle: { color: '#FFCB59' } },
],
textStyle: {
color: '#DFF1FE',
fontSize: 12,
},
},
xAxis: [
{
type: 'category',
data: xData,
axisLabel: {
color: '#fff',
fontSize: 12,
},
axisPointer: {
type: 'shadow',
},
axisTick: { show: false },
axisLine: {
lineStyle: {
width: 1,
color: '#213259',
},
},
},
],
yAxis: [
{
type: 'value',
name: '产量/片',
nameTextStyle: {
color: '#fff',
fontSize: 10,
align: 'right',
},
axisLabel: {
color: '#fff',
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: '#213259',
},
},
splitLine: {
lineStyle: {
color: '#213259a0',
},
},
},
{
type: 'value',
name: '良品率',
nameTextStyle: {
color: '#fff',
fontSize: 10,
align: 'LEFT',
},
axisLabel: {
color: '#fff',
fontSize: 12,
formatter: '{value}%',
},
axisLine: {
show: true,
lineStyle: {
color: '#213259',
},
},
splitLine: {
lineStyle: {
color: '#213259a0',
},
},
},
],
series: [
{
name: '产线产量',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
},
},
barWidth: 20,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB59' + "40" },
{ offset: 0.5, color: '#FFCB59' + "20" },
{ offset: 1, color: '#FFCB59' + "00" },
]),
},
lineStyle: {
width: 1
},
symbol: 'circle',
symbolSize: 5,
data: passRate
}
]
};
option && this.chart.setOption(option)
}
}
}
{ offset: 0, color: '#5CB7FF' },
{ offset: 1, color: '#364BFE' },
]),
},
data: outputNum,
},
{
name: '良品率',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value ? value + '%' : '-';
},
},
itemStyle: {
color: '#FFD160',
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB59' + '40' },
{ offset: 0.5, color: '#FFCB59' + '20' },
{ offset: 1, color: '#FFCB59' + '00' },
]),
},
lineStyle: {
width: 1,
},
symbol: 'circle',
symbolSize: 5,
data: passRate,
},
],
};
option && this.chart.setOption(option);
},
},
};
</script>
<style scoped lang="scss">
.num-rate-chart {
width: 100%;
height: 100%;
top: -50px;
top: -50px;
}
</style>
<style>
.num-rate-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.num-rate-chart-tooltip * {
color: #fff !important;
}
.num-rate-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.num-rate-chart-tooltip * {
color: #fff !important;
}
</style>

View File

@ -1,66 +1,83 @@
<template>
<div style="flex: 1;">
<Container name="各工序缺陷汇总" size="middle" style="">
<TimePrompt class="timeShow" :timestr="timestr" />
<div style="padding: 5px 10px;">
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='defectScrollBoard'/>
</div>
</Container>
</div>
<div style="flex: 1">
<Container
name="各工序缺陷汇总"
size="middle"
style="">
<TimePrompt
class="timeShow"
:timestr="timestr" />
<div style="padding: 5px 10px">
<dv-scroll-board
:config="config"
style="width: 575px; height: 380px"
ref="defectScrollBoard" />
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container.vue';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'
import { switchShowTime } from '../utils';
export default {
name: 'DefectSum',
components: { Container, TimePrompt },
computed: {
defectSum() {
return this.$store.state.websocket.defectSum
}
},
data() {
return {
timestr: '',
config: {
header: ['序号', '产线', '工序','损耗片数','缺陷类型'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60],
align: ['center'],
data: [],
// data: [[1, 'Y61', '','10','']],
rowNum: 10
}
}
},
mounted() {
this.timestr = switchShowTime('日')
},
watch:{
defectSum: {
name: 'DefectSum',
components: { Container, TimePrompt },
computed: {
defectSum() {
return this.$store.state.websocket.defectSum;
},
},
data() {
return {
timestr: '',
config: {
header: ['序号', '产线', '工序', '损耗片数', '缺陷类型'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60],
align: ['center'],
data: [
//
[1, 'D61', '成型', '3片', '细长泡'],
[2, 'D62', '组合落板', '4片', '细长泡'],
[3, 'D61', '磨边', '6片', '开口泡'],
[4, 'D63', '清洗', '5片', '结石'],
[5, 'D64', '打孔', '2片', '结石'],
[6, 'D63', '成型', '7片', '开口泡'],
[7, 'D61', '上片', '8片', '结石'],
],
// data: [],
rowNum: 10,
},
};
},
mounted() {
this.timestr = switchShowTime('日');
},
watch: {
defectSum: {
handler(newVal, oldVal) {
let outArr = this.defectSum.map((item, index) => [
index+1,
item.productionLineName,
item.sectionName,
item.count,
item.inspectionTypeName
]);
this.config.data = outArr
this.$refs['defectScrollBoard'].updateRows(outArr)
this.timestr = switchShowTime('日')
}
}
}
}
let outArr = this.defectSum.map((item, index) => [
index + 1,
item.productionLineName,
item.sectionName,
item.count,
item.inspectionTypeName,
]);
this.config.data = outArr;
this.$refs['defectScrollBoard'].updateRows(outArr);
this.timestr = switchShowTime('日');
},
},
},
};
</script>
<style lang='scss' scoped>
.timeShow {
position: absolute;
top: 20px;
left: 240px;
position: absolute;
top: 20px;
left: 240px;
}
</style>

View File

@ -1,313 +1,324 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增 -->
<base-dialog
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%"
>
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
width="50%">
<add-or-update
ref="addOrUpdate"
@successSubmit="successSubmit" />
</base-dialog>
<!-- 装车 -->
<base-dialog
<!-- 装车 -->
<base-dialog
dialogTitle="装车"
:dialogVisible="centervisible2"
@cancel="handleCancel2"
@confirm="handleConfirm2"
:before-close="handleCancel2"
width="50%"
>
<loaded-page ref="loadedPage" @successSubmit="successSubmit2" />
width="50%">
<loaded-page
ref="loadedPage"
@successSubmit="successSubmit2" />
</base-dialog>
<!-- 发货详情 -->
<delivery-log-detail ref='deliveryLogDetail' v-if='showDetail' />
</div>
<!-- 发货详情 -->
<delivery-log-detail
ref="deliveryLogDetail"
v-if="showDetail" />
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery'
import AddOrUpdate from './components/addOrUpdate'
import LoadedPage from './components/loadedPage'
import DeliveryLogDetail from './components/deliveryLogDetail.vue'
import { parseTime } from '@/utils/ruoyi';
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery';
import AddOrUpdate from './components/addOrUpdate';
import LoadedPage from './components/loadedPage';
import DeliveryLogDetail from './components/deliveryLogDetail.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'orderName',
label: '订单名',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'name',
label: '发货单名称',
minWidth: 100,
showOverflowtooltip: true
},
{
prop: 'deliveryTime',
label: '发货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'code',
label: '发货单号',
showOverflowtooltip: true
},
{
prop: 'deliverPerName',
label: '发货负责人',
minWidth: 100
},
{
prop: 'principal',
label: '运输负责人',
minWidth: 100
},
{
prop: 'principalCall',
label: '运输联系方式',
minWidth: 110,
showOverflowtooltip: true
},
{
prop: 'principalCost',
label: '运输费用',
align: 'right'
},
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true
}
]
{
prop: 'orderName',
label: '订单名',
minWidth: 100,
showOverflowtooltip: true,
},
{
prop: 'name',
label: '发货单名称',
minWidth: 100,
showOverflowtooltip: true,
},
{
prop: 'deliveryTime',
label: '发货时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'code',
label: '发货单号',
showOverflowtooltip: true,
},
{
prop: 'deliverPerName',
label: '发货负责人',
minWidth: 100,
},
{
prop: 'principal',
label: '运输负责人',
minWidth: 100,
},
{
prop: 'principalCall',
label: '运输联系方式',
minWidth: 110,
showOverflowtooltip: true,
},
{
prop: 'principalCost',
label: '运输费用',
align: 'right',
},
{
prop: 'remark',
label: '备注',
showOverflowtooltip: true,
},
];
export default {
name: "DeliveryLog",
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名',
param: 'orderName',
defaultSelect: ''
},
{
type: 'input',
label: '发货单名称',
param: 'name'
},
{
type: 'input',
label: '发货单号',
param: 'code'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
orderName: '',
code: '',
name: ''
},
tableProps,
list: [],
tableH: this.tableHeight(260),
total: 0,
tableBtn: [
this.$auth.hasPermi('extend:delivery-log:loaded')
? {
type: 'loaded',
btnName: '装车'
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
centervisible2: false,
showDetail: false
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1]
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
} else {
this.formConfig[0].defaultSelect = ''
}
this.queryParams.orderName = this.formConfig[0].defaultSelect
this.getList();
},
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
watch: {
$route: 'initData'
},
methods: {
initData(to) {
if (to.name === 'DeliveryLog') {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1]
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
} else {
this.formConfig[0].defaultSelect = ''
}
this.queryParams.orderName = this.formConfig[0].defaultSelect
this.getList()
}
},
getList() {
deliveryLogPage({...this.queryParams}).then(res => {
let arr = res.data.list || []
arr && arr.map(item => {
item.principalCost = item.principalCost.toFixed(2)
})
this.list = arr
this.total = res.data.total || 0
})
},
buttonClick(val) {
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.orderName = val.orderName
this.queryParams.code = val.code
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id)
})
break
case 'delete':
this.handleDelete(val.data)
break
case 'loaded':
this.centervisible2 = true
this.$nextTick(() => {
this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId)
})
break
default:
this.showDetail = true
this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data)
})
}
},
//
handleCancel() {
this.$refs.addOrUpdate.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.addOrUpdate.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?').then(function() {
return deliveryLogDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel2() {
this.$refs.loadedPage.formClear()
this.centervisible2 = false
},
handleConfirm2() {
this.$refs.loadedPage.submitForm()
},
successSubmit2() {
this.handleCancel2()
this.getList()
}
}
}
name: 'DeliveryLog',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名',
param: 'orderName',
defaultSelect: '',
},
{
type: 'input',
label: '发货单名称',
param: 'name',
},
{
type: 'input',
label: '发货单号',
param: 'code',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('extend:delivery-log:create')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('extend:delivery-log:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
orderName: '',
code: '',
name: '',
},
tableProps,
list: [],
total: 0,
tableBtn: [
this.$auth.hasPermi('extend:delivery-log:loaded')
? {
type: 'loaded',
btnName: '装车',
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:detail')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('extend:delivery-log:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
centervisible2: false,
showDetail: false,
};
},
created() {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1];
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
} else {
this.formConfig[0].defaultSelect = '';
}
this.queryParams.orderName = this.formConfig[0].defaultSelect;
this.getList();
},
components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
watch: {
$route: 'initData',
},
methods: {
initData(to) {
if (to.name === 'DeliveryLog') {
if (location.href.indexOf('?') > 0) {
let arr = location.href.split('?')[1];
this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
} else {
this.formConfig[0].defaultSelect = '';
}
this.queryParams.orderName = this.formConfig[0].defaultSelect;
this.getList();
}
},
getList() {
deliveryLogPage({ ...this.queryParams }).then((res) => {
let arr = res.data.list || [];
arr &&
arr.map((item) => {
item.principalCost = item.principalCost.toFixed(2);
});
this.list = arr;
this.total = res.data.total || 0;
});
},
buttonClick(val) {
if (val.btnName === 'search') {
this.queryParams.name = val.name;
this.queryParams.orderName = val.orderName;
this.queryParams.code = val.code;
this.getList();
} else {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init();
});
}
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(val.data.id);
});
break;
case 'delete':
this.handleDelete(val.data);
break;
case 'loaded':
this.centervisible2 = true;
this.$nextTick(() => {
this.$refs.loadedPage.init(
val.data.id,
val.data.code,
val.data.orderId
);
});
break;
default:
this.showDetail = true;
this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data);
});
}
},
//
handleCancel() {
this.$refs.addOrUpdate.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.addOrUpdate.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
//
handleDelete(val) {
this.$modal
.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?')
.then(function () {
return deliveryLogDelete({ id: val.id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
},
//
handleCancel2() {
this.$refs.loadedPage.formClear();
this.centervisible2 = false;
},
handleConfirm2() {
this.$refs.loadedPage.submitForm();
},
successSubmit2() {
this.handleCancel2();
this.getList();
},
},
};
</script>

View File

@ -1,130 +1,124 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 详情抽屉 -->
<delivery-log-det-detail ref='deliveryLogDetail'/>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 详情抽屉 -->
<delivery-log-det-detail ref="deliveryLogDetail" />
</div>
</template>
<script>
import { deliveryProgressPage } from '@/api/base/delivery'
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue'
import { deliveryProgressPage } from '@/api/base/delivery';
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'orderName',
label: '订单名',
showOverflowtooltip: true
},
{
prop: 'customerName',
label: '客户名称',
showOverflowtooltip: true
},
{
prop: 'unit',
label: '单位'
},
{
prop: 'orderNum',
label: '订单数量'
},
{
prop: 'num',
label: '发货数量'
},
{
prop: 'rate',
label: '累计发货比例(%)'
}
]
{
prop: 'orderName',
label: '订单名',
showOverflowtooltip: true,
},
{
prop: 'customerName',
label: '客户名称',
showOverflowtooltip: true,
},
{
prop: 'unit',
label: '单位',
},
{
prop: 'orderNum',
label: '订单数量',
},
{
prop: 'num',
label: '发货数量',
},
{
prop: 'rate',
label: '累计发货比例(%)',
},
];
export default {
name: "DeliveryLogDet",
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名',
param: 'orderName'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
orderName: ''
},
tableProps,
list: [],
tableH: this.tableHeight(260),
total: 0,
tableBtn: [
this.$auth.hasPermi('extend:delivery-log-det:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined
].filter((v) => v)
}
},
components: { DeliveryLogDetDetail },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList();
},
methods: {
getList() {
deliveryProgressPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
buttonClick(val) {
this.queryParams.orderName = val.orderName
this.getList()
},
handleClick(val) {
console.log(val)
this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data)
})
}
}
}
name: 'DeliveryLogDet',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名',
param: 'orderName',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
orderName: '',
},
tableProps,
list: [],
total: 0,
tableBtn: [
this.$auth.hasPermi('extend:delivery-log-det:detail')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
].filter((v) => v),
};
},
components: { DeliveryLogDetDetail },
created() {
this.getList();
},
methods: {
getList() {
deliveryProgressPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
buttonClick(val) {
this.queryParams.orderName = val.orderName;
this.getList();
},
handleClick(val) {
console.log(val);
this.$nextTick(() => {
this.$refs.deliveryLogDetail.init(val.data);
});
},
},
};
</script>

View File

@ -187,8 +187,11 @@
@click="resetBtn">
重置
</el-button>
<span class="separateStyle"></span>
<span
class="separateStyle"
v-hasPermi="['analysis:contrast-analysis:export']"></span>
<el-button
v-hasPermi="['analysis:contrast-analysis:export']"
type="primary"
size="small"
plain

View File

@ -80,10 +80,13 @@
</el-button>
</el-form-item>
<el-form-item>
<span class="separateStyle"></span>
<span
class="separateStyle"
v-hasPermi="['analysis:qoq-analysis:export']"></span>
</el-form-item>
<el-form-item>
<el-button
v-hasPermi="['analysis:qoq-analysis:export']"
type="primary"
size="small"
@click="exportData"

View File

@ -170,8 +170,11 @@
@click="resetBtn">
重置
</el-button>
<span class="separateStyle"></span>
<span
class="separateStyle"
v-hasPermi="['analysis:trend-analysis:export']"></span>
<el-button
v-hasPermi="['analysis:trend-analysis:export']"
type="primary"
size="small"
plain

View File

@ -69,10 +69,13 @@
</el-button>
</el-form-item>
<el-form-item>
<span class="separateStyle"></span>
<span
class="separateStyle"
v-hasPermi="['analysis:yoy-analysis:export']"></span>
</el-form-item>
<el-form-item>
<el-button
v-hasPermi="['analysis:yoy-analysis:export']"
type="primary"
size="small"
@click="exportData"

View File

@ -1,197 +1,219 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel">
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-plc-add
ref="energyPlc"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc";
// import { publicFormatter } from '@/utils/dict'
import EnergyPlcAdd from './components/energyPlcAdd.vue'
import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
import EnergyPlcAdd from './components/energyPlcAdd.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'plcTableName',
label: '关联表名',
showOverflowtooltip: true
},
{
prop: 'code',
label: '关联表编码',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'name',
label: '标识名',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'enName',
label: '英文标识名'
},
{
prop: 'collection',
label: '是否采集'
},
{
prop: 'description',
label: '描述',
showOverflowtooltip: true
}
]
{
prop: 'plcTableName',
label: '关联表名',
showOverflowtooltip: true,
},
{
prop: 'code',
label: '关联表编码',
minWidth: 150,
showOverflowtooltip: true,
},
{
prop: 'name',
label: '标识名',
minWidth: 150,
showOverflowtooltip: true,
},
{
prop: 'enName',
label: '英文标识名',
},
{
prop: 'collection',
label: '是否采集',
},
{
prop: 'description',
label: '描述',
showOverflowtooltip: true,
},
];
export default {
name: "EnergyPlc",
components: { EnergyPlcAdd },
data() {
return {
formConfig: [
{
type: 'input',
label: '标识名',
placeholder: '标识名',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:energy-plc:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:energy-plc:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v) => v),
tableH: this.tableHeight(260),
collectionList: [
{ value: 0, label: '否' },
{ value: 1, label: '是' }
],
//
total: 0,
//
list: [],
//
addOrEditTitle: "",
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null
}
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.name = val.name
this.getList()
break
default:
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.energyPlc.init()
})
}
},
/** 查询列表 */
getList() {
getEnergyPlcPage(this.queryParams).then(response => {
let arr = response.data.list || [];
arr && arr.map(item => {
this.collectionList.map(i => {
if (item.collection === i.value) {
item.collection = i.label
}
})
})
this.list = arr
this.total = response.data.total;
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.$nextTick(() => {
this.$refs.energyPlc.init(val.data.id)
})
this.centervisible = true
break
default:
this.handleDelete(val.data)
}
},
handleCancel() {
this.$refs.energyPlc.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.energyPlc.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function () {
return deleteEnergyPlc(row.id);
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
}
name: 'EnergyPlc',
components: { EnergyPlcAdd },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '标识名',
placeholder: '标识名',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:energy-plc:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:energy-plc:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
collectionList: [
{ value: 0, label: '否' },
{ value: 1, label: '是' },
],
//
total: 0,
//
list: [],
//
addOrEditTitle: '',
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
},
};
},
created() {
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.name = val.name;
this.getList();
break;
default:
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.energyPlc.init();
});
}
},
/** 查询列表 */
getList() {
getEnergyPlcPage(this.queryParams).then((response) => {
let arr = response.data.list || [];
arr &&
arr.map((item) => {
this.collectionList.map((i) => {
if (item.collection === i.value) {
item.collection = i.label;
}
});
});
this.list = arr;
this.total = response.data.total;
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.energyPlc.init(val.data.id);
});
this.centervisible = true;
break;
default:
this.handleDelete(val.data);
}
},
handleCancel() {
this.$refs.energyPlc.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.energyPlc.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?')
.then(function () {
return deleteEnergyPlc(row.id);
})
.then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
},
};
</script>

View File

@ -1,226 +1,258 @@
<template>
<div>
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
<div class="box">
<el-form :inline="true">
<el-form-item label="关联表名">
<el-input v-model="plcTableName" size='small' readonly></el-input>
</el-form-item>
<el-form-item label="对象">
<el-input v-model="objName" size='small' readonly></el-input>
</el-form-item>
<el-form-item v-if="showBtn">
<el-button type="success" size='small' plain @click="addNew">新增</el-button>
</el-form-item>
</el-form>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</el-drawer>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<energy-plc-param-add ref="energyPlcParam" @successSubmit="successSubmit" />
</base-dialog>
</div>
<div>
<el-drawer
:title="drawerTitle"
:visible.sync="visible"
size="70%"
@close="closeD"
:show-close="false">
<div class="box">
<el-form :inline="true">
<el-form-item label="关联表名">
<el-input
v-model="plcTableName"
size="small"
readonly
style="width: 250px"></el-input>
</el-form-item>
<el-form-item label="对象">
<el-input
v-model="objName"
size="small"
readonly
style="width: 250px"></el-input>
</el-form-item>
<el-form-item v-if="showBtn">
<el-button
type="success"
size="small"
plain
@click="addNew">
新增
</el-button>
</el-form-item>
</el-form>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-plc-param-add
ref="energyPlcParam"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { getEnergyPlcParamPage, deleteEnergyPlcParam } from '@/api/base/energyPlcParam'
import EnergyPlcParamAdd from './energyPlcParamAdd'
import { publicFormatter } from '@/utils/dict'
import {
getEnergyPlcParamPage,
deleteEnergyPlcParam,
} from '@/api/base/energyPlcParam';
import EnergyPlcParamAdd from './energyPlcParamAdd';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'typeId',
label: '能源类型'
},
{
prop: 'plcParamName',
label: '参数列名'
},
{
prop: 'name',
label: '参数名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('energy_unit')
},
{
prop: 'collection',
label: '是否采集'
},
{
prop: 'description',
label: '描述'
}
]
{
prop: 'typeId',
label: '能源类型',
filter: publicFormatter('energy_type'),
},
{
prop: 'plcParamName',
label: '参数列名',
},
{
prop: 'name',
label: '参数名称',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'collection',
label: '是否采集',
},
{
prop: 'description',
label: '描述',
},
];
export default {
name: 'EnergyPlcParam',
props: {
energyTypeList: {
type: Array,
required: true,
default: () => {
return []
}
}
},
data() {
return {
visible: false,
drawerTitle: '',
tableProps,
tableData: [],
tableBtn: [],
tableH: this.tableHeight(115),
total: 0,
queryParams: {
pageNo: 1,
pageSize: 30,
connectId: null
},
plcTableName: '',
objName: '',
//
addOrEditTitle: "",
//
centervisible: false,
collectionList: [
{value: 0,label: '否'},
{value: 1,label: '是'}
],
showBtn: true
}
},
components: { EnergyPlcParamAdd },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115)
})
},
methods: {
init(data,title) {
this.visible = true
this.queryParams.connectId = data.id
this.plcTableName = data.plcTableName
this.objName = data.objName
this.getList()
if (title === 'detail') {
this.drawerTitle = '查看参数'
this.showBtn = false
this.tableBtn = []
} else {
this.drawerTitle = '参数绑定'
this.showBtn = true
this.tableBtn = [
{
type: 'edit',
btnName: '编辑'
},
{
type: 'delete',
btnName: '删除'
}
]
}
},
getList() {
getEnergyPlcParamPage({...this.queryParams}).then((res) => {
let arr = res.data.list || []
arr&&arr.map(item => {
this.collectionList.map(i => {
if (item.collection === i.value) {
item.collection = i.label
}
})
this.energyTypeList.map(j => {
if (item.typeId === j.id) {
item.typeId = j.name
}
})
})
this.tableData = arr
this.total = res.data.total;
})
},
//
addNew() {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.energyPlcParam.init({'connectId': this.queryParams.connectId, id: ''})
})
},
handleCancel() {
this.$refs.energyPlcParam.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.energyPlcParam.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.energyPlcParam.init({'connectId': this.queryParams.connectId, id: val.data.id})
})
break
default:
this.handleDelete(val.data)
}
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除参数列名为"' + row.plcParamName + '"的数据项?').then(function() {
return deleteEnergyPlcParam(row.id);
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
closeD() {
this.$emit('closeDrawer')
}
}
}
name: 'EnergyPlcParam',
props: {
energyTypeList: {
type: Array,
required: true,
default: () => {
return [];
},
},
},
data() {
return {
visible: false,
drawerTitle: '',
tableProps,
tableData: [],
tableBtn: [],
tableH: this.tableHeight(115),
total: 0,
queryParams: {
pageNo: 1,
pageSize: 30,
connectId: null,
},
plcTableName: '',
objName: '',
//
addOrEditTitle: '',
//
centervisible: false,
collectionList: [
{ value: 0, label: '否' },
{ value: 1, label: '是' },
],
showBtn: true,
};
},
components: { EnergyPlcParamAdd },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115);
});
},
methods: {
init(data, title) {
this.visible = true;
this.queryParams.connectId = data.id;
this.plcTableName = data.plcTableName;
this.objName = data.objName;
this.getList();
if (title === 'detail') {
this.drawerTitle = '查看参数';
this.showBtn = false;
this.tableBtn = [];
} else {
this.drawerTitle = '参数绑定';
this.showBtn = true;
this.tableBtn = [
{
type: 'edit',
btnName: '编辑',
},
{
type: 'delete',
btnName: '删除',
},
];
}
},
getList() {
getEnergyPlcParamPage({ ...this.queryParams }).then((res) => {
let arr = res.data.list || [];
arr &&
arr.map((item) => {
this.collectionList.map((i) => {
if (item.collection === i.value) {
item.collection = i.label;
}
});
this.energyTypeList.map((j) => {
if (item.typeId === j.id) {
item.typeId = j.name;
}
});
});
this.tableData = arr;
this.total = res.data.total;
});
},
//
addNew() {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.energyPlcParam.init({
connectId: this.queryParams.connectId,
id: '',
});
});
},
handleCancel() {
this.$refs.energyPlcParam.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.energyPlcParam.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.energyPlcParam.init({
connectId: this.queryParams.connectId,
id: val.data.id,
});
});
break;
default:
this.handleDelete(val.data);
}
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除参数列名为"' + row.plcParamName + '"的数据项?')
.then(function () {
return deleteEnergyPlcParam(row.id);
})
.then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeD() {
this.$emit('closeDrawer');
},
},
};
</script>
<style lang="scss" scoped>
.box {
padding: 0 32px;
padding: 0 32px;
}
</style>

View File

@ -57,14 +57,18 @@ import { getTree } from '@/api/analysis/energyAnalysis';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyPlcConnectAdd from './components/energyPlcConnectAdd';
import EnergyPlcParam from './components/energyPlcParam';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'objName',
label: '对象',
minWidth: 130,
showOverflowtooltip: true,
},
{
prop: 'objCode',
label: '对象编码',
minWidth: 150,
showOverflowtooltip: true,
},
{
@ -86,11 +90,13 @@ const tableProps = [
{
prop: 'varNum',
label: '绑定参数数量',
width: 110,
},
];
export default {
name: 'EnergyPlcConnect',
components: { EnergyPlcConnectAdd, EnergyPlcParam },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
@ -144,7 +150,6 @@ export default {
}
: undefined,
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
@ -165,9 +170,6 @@ export default {
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList();
},
mounted() {

View File

@ -20,9 +20,9 @@
@change="changeSelect(scope.row, 'tableName')">
<el-option
v-for="item in tableNameList"
:key="item.id"
:key="item.value"
:label="item.label"
:value="item.id"></el-option>
:value="item.value"></el-option>
</el-select>
</div>
</template>

View File

@ -1,38 +0,0 @@
<template>
<div class="tableInner">
<!-- <el-input v-model="list[itemProp]" @blur="changeInput" /> -->
<el-input-number v-model="list[itemProp]" @change="changeInput" :min="0" :max="999999999" style='width: 100%;' :controls='false' :precision='2'></el-input-number>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeInput() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -1,44 +0,0 @@
<template>
<div class="tableInner">
<el-select v-model="list[itemProp]" placeholder="请选择" style="width: 100%;" @change="changeSelect">
<el-option
v-for="item in getDictDatas(DICT_TYPE.TABLE_NAME)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'SelectArea',
props: {
injectData: {
type: Object,
default: () => ({})
},
itemProp: {
type: String
}
},
data() {
return {
list: this.injectData
}
},
methods: {
changeSelect() {
console.log(this.list)
this.$emit('emitData', this.list)
}
}
}
</script>
<style scoped>
.tableInner .el-input__inner {
border: none;
padding: 0;
height: 33px;
}
</style>

View File

@ -40,18 +40,10 @@
<el-row :gutter="20">
<el-col :span="24">
<add-table
:table-props="tableProps"
:table-data="tableData"
:table-name-list="tableNameList"
@emitFun="inputChange"
@emitButtonClick="emitButtonClick" />
<!-- <base-table
border
:table-props="tableProps"
:table-data="tableData"
:add-button-show="addButtonShow"
@emitFun="inputChange"
@emitButtonClick="emitButtonClick" /> -->
</el-col>
</el-row>
</el-form>
@ -64,21 +56,7 @@ import {
} from '@/api/base/energyQuantityManual';
import moment from 'moment';
import AddTable from './AddTable';
import InputArea from './InputArea';
import SelectArea from './SelectArea';
import { energyTableGet } from '@/api/base/energyQuantityManual';
const tableProps = [
{
prop: 'tableName',
label: '表名*',
subcomponent: SelectArea,
},
{
prop: 'readingQuantity',
label: '抄表数*',
subcomponent: InputArea,
},
];
export default {
name: 'EnergyQuantityManualAdd',
props: {
@ -92,7 +70,6 @@ export default {
},
data() {
return {
tableProps,
tableData: [],
tableNameList: [], //list
addButtonShow: '新增',
@ -122,6 +99,7 @@ export default {
} else if (params.type === 'meterReading') {
this.isEdit = false;
this.form.energyTypeId = params.energyTypeId;
this.selEnergyType(this.form.energyTypeId);
let obj = {};
obj.tableName = params.tableName + '';
obj.readingQuantity = 0;
@ -133,6 +111,7 @@ export default {
energyQuantityManualGet({ id: this.form.id }).then((res) => {
if (res.code === 0) {
this.form.energyTypeId = res.data.energyTypeId;
this.selEnergyType(this.form.energyTypeId);
this.form.recordTime = res.data.recordTime
? res.data.recordTime
: null;
@ -164,6 +143,11 @@ export default {
this.tableNameList = [];
energyTableGet({ energyTypeId: id }).then((res) => {
this.tableNameList = res.data.tableObjs || [];
if (this.tableNameList.length === 0) {
this.$modal.msgWarning(
'当前能源类型暂无配置表名,请先到《表名配置》页面配置'
);
}
});
},
submitForm() {

View File

@ -52,18 +52,18 @@ import { publicFormatter } from '@/utils/dict';
import { parseTimeTable } from '@/utils/ruoyi';
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'energyType',
prop: 'energyTypeLabel',
label: '能源类型',
minWidth: 110,
filter: publicFormatter('energy_type'),
showOverflowtooltip: true,
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('energy_unit'),
filter: publicFormatter('unit_dict'),
minWidth: 110,
},
{
@ -142,7 +142,6 @@ export default {
},
],
tableProps,
tableH: this.tableHeight(260),
//
total: 0,
//
@ -181,10 +180,8 @@ export default {
};
},
components: { EnergyQuantityManualAdd },
mixins: [tableHeightMixin],
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let start = moment(
moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')
@ -244,6 +241,11 @@ export default {
? item.amount.toFixed(2)
: ''
: '';
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr;
this.total = response.data.total;
@ -305,7 +307,7 @@ export default {
handleDelete(row) {
console.log(row.id);
this.$modal
.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?')
.confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?')
.then(function () {
return energyQuantityManualDelete({ id: row.id });
})

View File

@ -1,220 +1,254 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" />
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:selectWidth="55"
:max-height="tableH"
@selection-change="selectChange" />
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</template>
<script>
import { getEnergyQuantityRealtimePage } from "@/api/base/energyQuantityRealtime"
import { getEnergyTypeListAll } from "@/api/base/energyType"
// import { publicFormatter } from '@/utils/dict'
import FileSaver from "file-saver"
import * as XLSX from 'xlsx/xlsx.mjs'
import { getEnergyQuantityRealtimePage } from '@/api/base/energyQuantityRealtime';
import { getEnergyTypeListAll } from '@/api/base/energyType';
// import { publicFormatter } from '@/utils/dict';
import FileSaver from 'file-saver';
import * as XLSX from 'xlsx/xlsx.mjs';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'objName',
label: '统计对象',
showOverflowtooltip: true
},
{
prop: 'objCode',
label: '对象编码',
showOverflowtooltip: true
},
{
prop: 'energyTypeName',
label: '能源类型',
showOverflowtooltip: true
},
{
prop: 'startValue',
label: '初始值'
},
{
prop: 'endValue',
label: '当前值'
},
{
prop: 'diffValue',
label: '差值'
},
{
prop: 'amount',
label: '金额'
}
]
{
prop: 'objName',
label: '统计对象',
showOverflowtooltip: true,
},
{
prop: 'objCode',
label: '对象编码',
showOverflowtooltip: true,
},
{
prop: 'energyTypeLabel',
label: '能源类型',
showOverflowtooltip: true,
},
{
prop: 'startValue',
label: '初始值',
},
{
prop: 'endValue',
label: '当前值',
},
{
prop: 'diffValue',
label: '差值',
},
{
prop: 'amount',
label: '金额',
},
];
export default {
name: "EnergyQuantityRealtime",
data() {
return {
formConfig: [
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: this.$auth.hasPermi('base:energy-quantity-realtime:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
tableProps,
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: '',
startTime: null,
endTime: null
},
energyTypeList: [],
exportList: []
};
},
created() {
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
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
switch (val.btnName) {
case 'search':
this.getList()
break
default:
this.exportTable()
}
},
/** 查询列表 */
getList() {
getEnergyQuantityRealtimePage(this.queryParams).then(response => {
let arr = response.data.list || []
arr && arr.map(item => {
item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : ''
})
this.list = arr
this.total = response.data.total;
this.exportList = []
});
},
getTypeList() {
getEnergyTypeListAll().then((res) => {
this.formConfig[0].selectOptions = res.data || []
this.energyTypeList = res.data || []
})
},
selectChange(val) {
console.log(val)
this.exportList = val
},
//
exportTable() {
if (this.exportList.length > 0) {
let body = this.exportList.map((x) => [
x.objName,
x.objCode,
x.energyTypeName,
x.startValue,
x.endValue,
x.diffValue,
x.amount
])
let header = []
this.tableProps.map((y) => {
header.push(y.label)
})
body.unshift(header)
console.log(body)
const filename = '能源抄表.xlsx'
const ws_name = 'Sheet1'
const wb = XLSX.utils.book_new()
const ws = XLSX.utils.aoa_to_sheet(body)
XLSX.utils.book_append_sheet(wb, ws, ws_name)
let wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'array'
})
FileSaver.saveAs(
new Blob([wbout], {
type: 'application/octet-stream'
}),
filename
)
} else {
this.$modal.msgWarning('请勾选需要导出的数据')
}
}
}
name: 'EnergyQuantityRealtime',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'select',
label: '能源类型',
labelField: 'labelName',
selectOptions: [],
param: 'energyTypeId',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:energy-quantity-realtime:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
tableProps,
//
total: 0,
//
list: [],
//
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: '',
startTime: null,
endTime: null,
},
energyTypeList: [],
exportList: [],
};
},
created() {
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;
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
switch (val.btnName) {
case 'search':
this.getList();
break;
default:
this.exportTable();
}
},
/** 查询列表 */
getList() {
getEnergyQuantityRealtimePage(this.queryParams).then((response) => {
let arr = response.data.list || [];
arr &&
arr.map((item) => {
item.amount = item.amount
? !isNaN(parseFloat(item.amount)) && isFinite(item.amount)
? item.amount.toFixed(2)
: ''
: '';
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyTypeName === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr;
this.total = response.data.total;
this.exportList = [];
});
},
getTypeList() {
getEnergyTypeListAll().then((res) => {
this.formConfig[0].selectOptions = res.data || [];
this.energyTypeList = res.data || [];
});
},
selectChange(val) {
console.log(val);
this.exportList = val;
},
//
exportTable() {
if (this.exportList.length > 0) {
let body = this.exportList.map((x) => [
x.objName,
x.objCode,
x.energyTypeLabel,
x.startValue,
x.endValue,
x.diffValue,
x.amount,
]);
let header = [];
this.tableProps.map((y) => {
header.push(y.label);
});
body.unshift(header);
console.log(body);
const filename = '能源抄表.xlsx';
const ws_name = 'Sheet1';
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(body);
XLSX.utils.book_append_sheet(wb, ws, ws_name);
let wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'array',
});
FileSaver.saveAs(
new Blob([wbout], {
type: 'application/octet-stream',
}),
filename
);
} else {
this.$modal.msgWarning('请勾选需要导出的数据');
}
},
},
};
</script>

View File

@ -40,6 +40,7 @@ import { getEnergyTypePage, deleteEnergyType } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
import InnerTable from './components/InnerTable';
import EnergyTypeAdd from './components/energyTypeAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'code',
@ -48,9 +49,8 @@ const tableProps = [
minWidth: 150,
},
{
prop: 'name',
prop: 'energyTypeLabel',
label: '能源类型',
filter: publicFormatter('energy_type'),
},
{
prop: 'unit',
@ -70,6 +70,7 @@ const tableProps = [
export default {
name: 'EnergyType',
components: { EnergyTypeAdd },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
@ -96,7 +97,7 @@ export default {
}
: undefined,
].filter((v) => v),
tableH: this.tableHeight(220),
heightNum: 220,
pricingMethodList: [
{ value: 0, label: '分时间段计价' },
{ value: 1, label: '分使用量计价' },
@ -118,9 +119,6 @@ export default {
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220);
});
this.getList();
},
methods: {
@ -142,6 +140,11 @@ export default {
item.pricingMethod = i.label;
}
});
this.getDictDatas('energy_type').map((subItem) => {
if (item.name === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr;
this.total = response.data.total;
@ -174,8 +177,9 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row);
this.$modal
.confirm('是否确认删除能源类型为"' + row.name + '"的数据项?')
.confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?')
.then(function () {
return deleteEnergyType(row.id);
})

View File

@ -32,6 +32,7 @@
import { energyTablePage } from '@/api/base/energyQuantityManual';
import { publicFormatter } from '@/utils/dict';
import tableNameConfigUpdate from './components/tableNameConfigUpdate.vue';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'energyType',
@ -63,10 +64,11 @@ export default {
pageNo: 1,
pageSize: 100,
},
tableH: this.tableHeight(165),
heightNum: 165,
centervisible: false,
};
},
mixins: [tableHeightMixin],
created() {
this.getList();
},

View File

@ -182,6 +182,7 @@ export default {
limitType: '',
minValue: 0,
maxValue: 0,
tableName: '',
},
objIds: [], //
isEdit: false, //
@ -214,6 +215,9 @@ export default {
if (res.code === 0) {
this.form = res.data;
this.form.plcParamId = res.data.plcParamId || '';
this.form.tableName = this.form.tableName
? this.form.tableName + ''
: '';
this.form.method = this.form.method ? this.form.method + '' : '';
this.form.limitType = this.form.limitType
? this.form.limitType + ''
@ -294,7 +298,7 @@ export default {
},
selectObj(val) {
this.form.objectId = val[val.length - 1];
this.form.objectType = val.length - 1;
this.form.objectType = val.length;
if (this.form.energyTypeId && this.form.type) {
this.getDetailList();
this.form.plcParamId = '';

View File

@ -51,6 +51,7 @@ import { getEnergyTypeListAll } from '@/api/base/energyType';
import { getTree } from '@/api/analysis/energyAnalysis';
import { publicFormatter } from '@/utils/dict';
import EnergyLimitAdd from './components/energyLimitAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'method',
@ -104,6 +105,7 @@ const tableProps = [
export default {
name: 'EnergyLimit',
components: { EnergyLimitAdd },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
@ -156,7 +158,6 @@ export default {
}
: undefined,
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
@ -181,9 +182,6 @@ export default {
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList();
this.getTypeList();
//

View File

@ -45,6 +45,7 @@ import { getEnergyOverlimitLogPage } from '@/api/monitoring/energyOverlimitLog';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'objName',
@ -123,6 +124,7 @@ const tableProps2 = [
];
export default {
name: 'EnergyOverlimitLog',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
@ -151,10 +153,10 @@ export default {
activeName: 'auto',
tableProps,
tableProps2,
tableH: this.tableHeight(260),
total: 0,
list: [],
list2: [],
heightNum: 300,
//
queryParams: {
pageNo: 1,
@ -170,9 +172,6 @@ export default {
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList();
this.getTypeList();
},

View File

@ -72,7 +72,7 @@ const tableProps = [
},
];
export default {
name: 'EnergyLimit',
name: 'EnergyReport',
data() {
return {
isFold: false,
@ -181,7 +181,7 @@ export default {
return energyReportPageExportAuto({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '能统计报表.xls');
this.$download.excel(response, '能统计报表.xls');
})
.catch(() => {});
}

View File

@ -1,161 +1,171 @@
<template>
<div class="app-container" id='energyReportSearchBox'>
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
:isFold="isFold"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
<div
class="app-container"
id="energyReportSearchBox">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
:isFold="isFold"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH" />
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</template>
<script>
import { energyReportPage, energyReportPageExport } from "@/api/monitoring/energyReport";
import { getEnergyTypeListAll } from "@/api/base/energyType"
import {
energyReportPage,
energyReportPageExport,
} from '@/api/monitoring/energyReport';
import { publicFormatter } from '@/utils/dict';
import { getEnergyTypeListAll } from '@/api/base/energyType';
const tableProps = [
{
prop: 'statisticName',
label: '统计方案'
},
{
prop: 'energyType',
label: '能源类型'
},
{
prop: 'startValue',
label: '抄表数(起始)'
},
{
prop: 'endValue',
label: '抄表数(结束)'
},
{
prop: 'diffValue',
label: '消耗量'
}
]
{
prop: 'statisticName',
label: '统计方案',
},
{
prop: 'energyType',
label: '能源类型',
filter: publicFormatter('energy_type'),
},
{
prop: 'startValue',
label: '抄表数(起始)',
},
{
prop: 'endValue',
label: '抄表数(结束)',
},
{
prop: 'diffValue',
label: '消耗量',
},
];
export default {
name: "EnergyReportSearch",
data() {
return {
isFold: false,
formConfig: [
{
type: 'input',
label: '统计方案',
param: 'statisticName'
},
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
clearable: false
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: this.$auth.hasPermi('monitoring:energy-report-search:export') ? 'button' : '',
btnName: '导出',
name: 'add',
color: 'primary',
plain: true
}
],
tableProps,
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
queryParams: {
pageNo: 1,
pageSize: 20,
statisticName: null,
startTime: null,
endTime: null
},
energyTypeList: []
};
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
})
this.getList()
this.getTypeList()
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180)
},
methods: {
getTypeList() {
getEnergyTypeListAll().then((res) => {
this.formConfig[1].selectOptions = res.data || []
})
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1
this.queryParams.statisticName = val.statisticName
this.queryParams.energyTypeId = val.energyTypeId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
this.getList()
break
default:
this.$modal.confirm('是否确认导出').then(() => {
return energyReportPageExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '能源统计查询报表.xls');
}).catch(() => {})
}
},
/** 查询列表 */
getList() {
energyReportPage({...this.queryParams}).then(response => {
this.list = response.data.list || [];
this.total = response.data.total;
});
}
}
name: 'EnergyReportSearch',
data() {
return {
isFold: false,
formConfig: [
{
type: 'input',
label: '统计方案',
param: 'statisticName',
},
{
type: 'select',
label: '能源类型',
labelField: 'labelName',
selectOptions: [],
param: 'energyTypeId',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
clearable: false,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('monitoring:energy-report-search:export')
? 'button'
: '',
btnName: '导出',
name: 'add',
color: 'primary',
plain: true,
},
],
tableProps,
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
queryParams: {
pageNo: 1,
pageSize: 20,
statisticName: null,
startTime: null,
endTime: null,
},
energyTypeList: [],
};
},
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180);
});
this.getList();
this.getTypeList();
this.isFold = this.searchBarWidth('energyReportSearchBox', 1180);
},
methods: {
getTypeList() {
getEnergyTypeListAll().then((res) => {
this.formConfig[1].selectOptions = res.data || [];
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.statisticName = val.statisticName;
this.queryParams.energyTypeId = val.energyTypeId;
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
this.getList();
break;
default:
this.$modal
.confirm('是否确认导出')
.then(() => {
return energyReportPageExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '能源统计查询报表.xls');
})
.catch(() => {});
}
},
/** 查询列表 */
getList() {
energyReportPage({ ...this.queryParams }).then((response) => {
this.list = response.data.list || [];
this.total = response.data.total;
});
},
},
};
</script>

View File

@ -1,230 +1,271 @@
<template>
<div>
<el-drawer :title="drawerTitle" :visible.sync="visible" size="70%" @close='closeD' :show-close='false'>
<div class="box">
<el-form :inline="true">
<el-form-item label="方案名称">
<el-input v-model="name" size='small' readonly></el-input>
</el-form-item>
<el-form-item label="能源类型">
<el-input v-model="energyType" size='small' readonly></el-input>
</el-form-item>
<el-form-item>
<el-button type="success" size='small' v-if="showBtn" plain @click="addNew">新增</el-button>
<el-button type="danger" size='small' v-if="showBtn" plain @click="deleteAll">批量删除</el-button>
</el-form-item>
</el-form>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
:selectWidth="55"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</el-drawer>
<!-- 新增 -->
<energy-statistics-det-add ref="energyStatistics" @closeDet="closeDet" />
</div>
<div>
<el-drawer
:title="drawerTitle"
:visible.sync="visible"
size="70%"
@close="closeD"
:show-close="false">
<div class="box">
<el-form :inline="true">
<el-form-item label="方案名称">
<el-input
v-model="name"
size="small"
readonly></el-input>
</el-form-item>
<el-form-item label="能源类型">
<el-input
v-model="energyTypeLabel"
size="small"
readonly></el-input>
</el-form-item>
<el-form-item>
<el-button
type="success"
size="small"
v-if="showBtn"
plain
@click="addNew">
新增
</el-button>
<el-button
type="danger"
size="small"
v-if="showBtn"
plain
@click="deleteAll">
批量删除
</el-button>
</el-form-item>
</el-form>
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
:selectWidth="55"
@selection-change="selectChange">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
<!-- 新增 -->
<energy-statistics-det-add
ref="energyStatistics"
@closeDet="closeDet" />
</div>
</template>
<script>
import { getEnergyStatisticsDetPage, deleteEnergyStatisticsDet, deleteMany } from '@/api/monitoring/energyStatisticsDet'
import EnergyStatisticsDetAdd from './energyStatisticsDetAdd'
import { publicFormatter } from '@/utils/dict'
import {
getEnergyStatisticsDetPage,
deleteEnergyStatisticsDet,
deleteMany,
} from '@/api/monitoring/energyStatisticsDet';
import EnergyStatisticsDetAdd from './energyStatisticsDetAdd';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'objName',
label: '所属对象'
},
{
prop: 'objCode',
label: '对象编码'
},
{
prop: 'paramName',
label: '参数名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('energy_unit')
},
{
prop: 'desc',
label: '描述'
}
]
{
prop: 'objName',
label: '所属对象',
},
{
prop: 'objCode',
label: '对象编码',
},
{
prop: 'paramName',
label: '参数名称',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'desc',
label: '描述',
},
];
export default {
name: 'EnergyStatisticsDet',
props: {
energyTypeList: {
type: Array,
required: true,
default: () => {
return []
}
}
},
data() {
return {
visible: false,
drawerTitle: '',
tableProps,
tableData: [],
tableBtn: [],
tableH: this.tableHeight(115),
total: 0,
queryParams: {
pageNo: 1,
pageSize: 30,
statisticsId: null
},
name: '',
energyType: '',
energyTypeId: '',
//
addOrEditTitle: "",
//
centervisible: false,
collectionList: [
{value: 0,label: '否'},
{value: 1,label: '是'}
],
showBtn: true,
selectedList: []
}
},
components: { EnergyStatisticsDetAdd },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115)
})
},
methods: {
init(data,title) {
this.visible = true
this.queryParams.statisticsId = data.id
this.name = data.name
this.energyType = data.energyType
this.energyTypeId = data.energyTypeId
this.getList()
if (title === 'detail') {
this.drawerTitle = '查看参数'
this.showBtn = false
this.tableBtn = []
} else {
this.drawerTitle = '参数绑定'
this.showBtn = true
this.tableBtn = [
{
type: 'delete',
btnName: '删除'
}
]
}
},
getList() {
console.log(this.queryParams)
getEnergyStatisticsDetPage({...this.queryParams}).then((res) => {
let arr = res.data.list || []
arr&&arr.map(item => {
this.collectionList.map(i => {
if (item.collection === i.value) {
item.collection = i.label
}
})
this.energyTypeList.map(j => {
if (item.typeId === j.id) {
item.typeId = j.name
}
})
})
this.tableData = arr
this.total = res.data.total;
})
},
//
addNew() {
this.$nextTick(() => {
this.$refs.energyStatistics.init({'statisticsId': this.queryParams.statisticsId, energyTypeId:this.energyTypeId})
})
},
selectChange(val) {
console.log(val)
this.selectedList = val
},
//
deleteAll() {
let arr = []
if (this.selectedList.length === 0) {
this.$modal.msgWarning("请选勾选数据")
return false
} else {
this.selectedList.map((item) => {
arr.push(item.id)
})
}
this.$modal.confirm('是否确认删除所有勾选的数据项?').then(function() {
return deleteMany(arr);
}).then(() => {
this.queryParams.pageNo = 1
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
handleCancel() {
this.$refs.energyStatistics.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.energyStatistics.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
handleClick(val) {
this.handleDelete(val.data)
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除参数列名为"' + row.paramName + '"的数据项?').then(function() {
return deleteEnergyStatisticsDet(row.id);
}).then(() => {
this.queryParams.pageNo = 1
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
closeD() {
this.$emit('closeDrawer')
},
closeDet() { //
this.getList()
}
}
}
name: 'EnergyStatisticsDet',
props: {
energyTypeList: {
type: Array,
required: true,
default: () => {
return [];
},
},
},
data() {
return {
visible: false,
drawerTitle: '',
tableProps,
tableData: [],
tableBtn: [],
tableH: this.tableHeight(115),
total: 0,
queryParams: {
pageNo: 1,
pageSize: 30,
statisticsId: null,
},
name: '',
energyTypeLabel: '',
energyTypeId: '',
//
addOrEditTitle: '',
//
centervisible: false,
collectionList: [
{ value: 0, label: '否' },
{ value: 1, label: '是' },
],
showBtn: true,
selectedList: [],
};
},
components: { EnergyStatisticsDetAdd },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(115);
});
},
methods: {
init(data, title) {
this.visible = true;
this.queryParams.statisticsId = data.id;
this.name = data.name;
this.energyTypeLabel = data.energyTypeLabel;
this.energyTypeId = data.energyTypeId;
this.getList();
if (title === 'detail') {
this.drawerTitle = '查看参数';
this.showBtn = false;
this.tableBtn = [];
} else {
this.drawerTitle = '参数绑定';
this.showBtn = true;
this.tableBtn = [
{
type: 'delete',
btnName: '删除',
},
];
}
},
getList() {
console.log(this.queryParams);
getEnergyStatisticsDetPage({ ...this.queryParams }).then((res) => {
let arr = res.data.list || [];
arr &&
arr.map((item) => {
this.collectionList.map((i) => {
if (item.collection === i.value) {
item.collection = i.label;
}
});
this.energyTypeList.map((j) => {
if (item.typeId === j.id) {
item.typeId = j.name;
}
});
});
this.tableData = arr;
this.total = res.data.total;
});
},
//
addNew() {
this.$nextTick(() => {
this.$refs.energyStatistics.init({
statisticsId: this.queryParams.statisticsId,
energyTypeId: this.energyTypeId,
});
});
},
selectChange(val) {
console.log(val);
this.selectedList = val;
},
//
deleteAll() {
let arr = [];
if (this.selectedList.length === 0) {
this.$modal.msgWarning('请选勾选数据');
return false;
} else {
this.selectedList.map((item) => {
arr.push(item.id);
});
}
this.$modal
.confirm('是否确认删除所有勾选的数据项?')
.then(function () {
return deleteMany(arr);
})
.then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
handleCancel() {
this.$refs.energyStatistics.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.energyStatistics.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
handleClick(val) {
this.handleDelete(val.data);
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除参数列名为"' + row.paramName + '"的数据项?')
.then(function () {
return deleteEnergyStatisticsDet(row.id);
})
.then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeD() {
this.$emit('closeDrawer');
},
closeDet() {
//
this.getList();
},
},
};
</script>
<style lang="scss" scoped>
.box {
padding: 0 32px;
padding: 0 32px;
}
</style>

View File

@ -1,179 +1,178 @@
<template>
<el-drawer
title="新增"
:visible.sync="centervisible"
size="60%"
@close='closeA'
:show-close='false'>
<div class="box">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
:removeBlue='true'
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:selectWidth="55"
@selection-change="selectChange"
>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
</el-drawer>
<el-drawer
title="新增"
:visible.sync="centervisible"
size="60%"
@close="closeA"
:show-close="false">
<div class="box">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
:removeBlue="true"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:selectWidth="55"
@selection-change="selectChange"></base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</el-drawer>
</template>
<script>
import { addParamPage, createEnergyStatisticsDet } from '@/api/monitoring/energyStatisticsDet'
import { publicFormatter } from '@/utils/dict'
import {
addParamPage,
createEnergyStatisticsDet,
} from '@/api/monitoring/energyStatisticsDet';
import { publicFormatter } from '@/utils/dict';
const tableProps = [
{
prop: 'objName',
label: '所属对象'
},
{
prop: 'objCode',
label: '对象编码'
},
{
prop: 'paramName',
label: '参数名称'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('energy_unit')
},
{
prop: 'desc',
label: '描述'
}
]
{
prop: 'objName',
label: '所属对象',
},
{
prop: 'objCode',
label: '对象编码',
},
{
prop: 'paramName',
label: '参数名称',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'desc',
label: '描述',
},
];
export default {
name: 'EnergyStatisticsDetAdd',
data() {
return {
centervisible: false,
formConfig: [
{
type: 'select',
label: '对象类型',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label',
valueField: 'value',
param: 'objType'
},
{
type: 'input',
label: '参数名称',
placeholder: '参数名称',
param: 'paramName'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: 'button',
btnName: '关联',
name: 'add',
color: 'primary',
plain: true
}
],
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: null,
statisticId: null,
paramName: '',
objType: ''
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260),
selectedList: []
}
},
methods: {
init(param) {
this.queryParams.statisticId = param.statisticsId
this.queryParams.energyTypeId = param.energyTypeId
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.centervisible = true
this.getList()
},
getList() {
addParamPage({...this.queryParams}).then((res) => {
this.list = res.data.list || []
this.total = res.data.total
})
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.objType = val.objType
this.queryParams.paramName = val.paramName
this.getList()
break
default:
//
this.connectParam()
}
},
//
selectChange(val) {
this.selectedList = val
},
//
connectParam() {
let param = {
statisticsId: this.queryParams.statisticId,
plcParamIds: []
}
if (this.selectedList.length === 0) {
this.$modal.msgWarning("请选勾选数据")
return false
} else {
this.selectedList.map((item) => {
param.plcParamIds.push(item.id)
})
}
createEnergyStatisticsDet({...param}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
this.queryParams.pageNo = 1;
this.getList()
}
})
},
closeA() {
this.$emit('closeDet')
}
}
}
name: 'EnergyStatisticsDetAdd',
data() {
return {
centervisible: false,
formConfig: [
{
type: 'select',
label: '对象类型',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label',
valueField: 'value',
param: 'objType',
},
{
type: 'input',
label: '参数名称',
placeholder: '参数名称',
param: 'paramName',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: 'button',
btnName: '关联',
name: 'add',
color: 'primary',
plain: true,
},
],
queryParams: {
pageNo: 1,
pageSize: 20,
energyTypeId: null,
statisticId: null,
paramName: '',
objType: '',
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260),
selectedList: [],
};
},
methods: {
init(param) {
this.queryParams.statisticId = param.statisticsId;
this.queryParams.energyTypeId = param.energyTypeId;
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.centervisible = true;
this.getList();
},
getList() {
addParamPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total;
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.objType = val.objType;
this.queryParams.paramName = val.paramName;
this.getList();
break;
default:
//
this.connectParam();
}
},
//
selectChange(val) {
this.selectedList = val;
},
//
connectParam() {
let param = {
statisticsId: this.queryParams.statisticId,
plcParamIds: [],
};
if (this.selectedList.length === 0) {
this.$modal.msgWarning('请选勾选数据');
return false;
} else {
this.selectedList.map((item) => {
param.plcParamIds.push(item.id);
});
}
createEnergyStatisticsDet({ ...param }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess('操作成功');
this.queryParams.pageNo = 1;
this.getList();
}
});
},
closeA() {
this.$emit('closeDet');
},
},
};
</script>
<style lang="scss" scoped>
.box {
padding: 0 32px;
padding: 0 32px;
}
</style>

View File

@ -53,6 +53,7 @@ import { publicFormatter } from '@/utils/dict';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyStatisticsAdd from './components/energyStatisticsAdd';
import EnergyStatisticsDet from './components/energyStatisticsDet';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'name',
@ -70,9 +71,9 @@ const tableProps = [
filter: publicFormatter('statistic_type'),
},
{
prop: 'energyType',
prop: 'energyTypeLabel',
label: '能源类型',
filter: publicFormatter('energy_type'),
showOverflowtooltip: true,
},
{
prop: 'paramNum',
@ -86,6 +87,7 @@ const tableProps = [
export default {
name: 'EnergyStatistics',
components: { EnergyStatisticsAdd, EnergyStatisticsDet },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
@ -139,7 +141,6 @@ export default {
}
: undefined,
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
@ -158,9 +159,6 @@ export default {
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList();
},
mounted() {
@ -187,6 +185,13 @@ export default {
getList() {
getEnergyStatisticsPage(this.queryParams).then((response) => {
let arr = response.data.list || [];
arr.map((item) => {
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr;
this.total = response.data.total;
});

View File

@ -1,271 +1,289 @@
<template>
<div class="orderEnergyContainer">
<div class="box1">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<el-row>
<el-col :span='4'>
<div class="blodTip">工单名称</div>
<div class="lightTip">{{ orderMsg.name }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">产品名称</div>
<div class="lightTip">{{orderMsg.productName }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">计划完成数量</div>
<div class="lightTip">{{orderMsg.planQuantity }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际完成时间</div>
<div class="lightTip">{{ parseTime(orderMsg.finishProduceTime) }}</div>
</el-col>
<el-col :span='4'>
<div class="blodTip">实际加工数量</div>
<div class="lightTip">{{orderMsg.actualQuantity }}</div>
</el-col>
</el-row>
</div>
<div class="box3">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>能耗信息</span>
</div>
<div class="toggleTabBox">
<div :class="{ active: activeModule === 'dataList' }" @click="toggleTab('dataList')">数据列表</div>
<div :class="{ active: activeModule === 'barChart' }" @click="toggleTab('barChart')">柱状图</div>
</div>
<div>
<div v-show="activeModule === 'dataList'">
<!-- 表格 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
</div>
<!-- 图形 -->
<div v-show="activeModule === 'barChart'">
<bar-chart ref="orderEnergyChart" :chartData="chartData"/>
</div>
</div>
</div>
</div>
<div class="orderEnergyContainer">
<div class="box1">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
</div>
<div class="box2">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>工单信息</span>
</div>
<el-row>
<el-col :span="4">
<div class="blodTip">工单名称</div>
<div class="lightTip">{{ orderMsg.name }}</div>
</el-col>
<el-col :span="4">
<div class="blodTip">产品名称</div>
<div class="lightTip">{{ orderMsg.productName }}</div>
</el-col>
<el-col :span="4">
<div class="blodTip">计划完成数量</div>
<div class="lightTip">{{ orderMsg.planQuantity }}</div>
</el-col>
<el-col :span="4">
<div class="blodTip">实际开始时间</div>
<div class="lightTip">{{ parseTime(orderMsg.startProduceTime) }}</div>
</el-col>
<el-col :span="4">
<div class="blodTip">实际完成时间</div>
<div class="lightTip">
{{ parseTime(orderMsg.finishProduceTime) }}
</div>
</el-col>
<el-col :span="4">
<div class="blodTip">实际加工数量</div>
<div class="lightTip">{{ orderMsg.actualQuantity }}</div>
</el-col>
</el-row>
</div>
<div class="box3">
<div class="boxTitle">
<span class="blueTitle"></span>
<span>能耗信息</span>
</div>
<div class="toggleTabBox">
<div
:class="{ active: activeModule === 'dataList' }"
@click="toggleTab('dataList')">
数据列表
</div>
<div
:class="{ active: activeModule === 'barChart' }"
@click="toggleTab('barChart')">
柱状图
</div>
</div>
<div>
<div v-show="activeModule === 'dataList'">
<!-- 表格 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH" />
</div>
<!-- 图形 -->
<div v-show="activeModule === 'barChart'">
<bar-chart
ref="orderEnergyChart"
:chartData="chartData" />
</div>
</div>
</div>
</div>
</template>
<script>
const tableProps = [
{
prop: 'objName',
label: '对象名称'
},
{
prop: 'objCode',
label: '对象编码'
},
{
prop: 'energyType',
label: '能源类型'
},
{
prop: 'startNum',
label: '工单开始值'
},
{
prop: 'endNum',
label: '工单结束值/当前值'
},
{
prop: 'useNum',
label: '使用量'
}
]
import { getEnergyTypeListAll } from '@/api/base/energyType'
import { workOrderList } from '@/api/base/orderManage'
import { getWorkOrderMsg, getOrderEnergyData } from '@/api/monitoring/orderEnergy'
import BarChart from "./components/barChart"
{
prop: 'objName',
label: '对象名称',
},
{
prop: 'objCode',
label: '对象编码',
},
{
prop: 'energyType',
label: '能源类型',
},
{
prop: 'startNum',
label: '工单开始值',
},
{
prop: 'endNum',
label: '工单结束值/当前值',
},
{
prop: 'useNum',
label: '使用量',
},
];
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { workOrderList } from '@/api/base/orderManage';
import {
getWorkOrderMsg,
getOrderEnergyData,
} from '@/api/monitoring/orderEnergy';
import BarChart from './components/barChart';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default {
name: 'OrderEnergy',
data() {
return {
formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
param: 'workOrderId',
clearable: false
},
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
filterable: true,
width: 120,
clearable: false
},
{
type: 'select',
label: '对象维度',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label',
valueField: 'value',
param: 'objType',
width: 100,
clearable: false
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
tableProps,
tableData: [],
tableH: this.tableHeight(400),
//
queryParams: {
workOrderId: '',
objType: '',
energyTypeId: ''
},
orderMsg: {},
chartData: [],
activeModule: 'dataList'
}
},
components: { BarChart },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(400)
})
this.getListArr()
},
methods: {
getListArr() {
workOrderList().then(res => {
this.formConfig[0].selectOptions = res.data || []
})
getEnergyTypeListAll().then(res => {
this.formConfig[1].selectOptions = res.data || []
})
},
buttonClick(val) {
if (!val.workOrderId) {
this.$modal.msgWarning('工单不能为空')
return false
}
if (!val.energyTypeId) {
this.$modal.msgWarning('能源类型不能为空')
return false
}
if (!val.objType) {
this.$modal.msgWarning('对象维度不能为空')
return false
}
this.queryParams.workOrderId = val.workOrderId
this.queryParams.objType = val.objType
this.queryParams.energyTypeId = val.energyTypeId
getWorkOrderMsg({ ...this.queryParams }).then(res => {
this.orderMsg = res.data || {}
getOrderEnergyData({
...this.queryParams,
startProduceTime: res.data.startProduceTime || '',
finishProduceTime: res.data.finishProduceTime || ''
}).then(result => {
this.tableData = result.data || []
this.chartData = result.data || []
})
})
},
toggleTab(val) {
this.activeModule = val
if (this.activeModule === 'barChart') {
this.$nextTick((res) => {
this.$refs.orderEnergyChart.getChart()
})
}
},
headBtnClick() {}
}
}
name: 'OrderEnergy',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
param: 'workOrderId',
clearable: false,
},
{
type: 'select',
label: '能源类型',
selectOptions: [],
param: 'energyTypeId',
labelField: 'labelName',
filterable: true,
width: 120,
clearable: false,
},
{
type: 'select',
label: '对象维度',
selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE),
labelField: 'label',
valueField: 'value',
param: 'objType',
width: 100,
clearable: false,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
tableProps,
tableData: [],
heightNum: 400,
//
queryParams: {
workOrderId: '',
objType: '',
energyTypeId: '',
},
orderMsg: {},
chartData: [],
activeModule: 'dataList',
};
},
components: { BarChart },
mounted() {
this.getListArr();
},
methods: {
getListArr() {
workOrderList().then((res) => {
this.formConfig[0].selectOptions = res.data || [];
});
getEnergyTypeListAll().then((res) => {
this.formConfig[1].selectOptions = res.data || [];
});
},
buttonClick(val) {
if (!val.workOrderId) {
this.$modal.msgWarning('工单不能为空');
return false;
}
if (!val.energyTypeId) {
this.$modal.msgWarning('能源类型不能为空');
return false;
}
if (!val.objType) {
this.$modal.msgWarning('对象维度不能为空');
return false;
}
this.queryParams.workOrderId = val.workOrderId;
this.queryParams.objType = val.objType;
this.queryParams.energyTypeId = val.energyTypeId;
getWorkOrderMsg({ ...this.queryParams }).then((res) => {
this.orderMsg = res.data || {};
getOrderEnergyData({
...this.queryParams,
startProduceTime: res.data.startProduceTime || '',
finishProduceTime: res.data.finishProduceTime || '',
}).then((result) => {
this.tableData = result.data || [];
this.chartData = result.data || [];
});
});
},
toggleTab(val) {
this.activeModule = val;
if (this.activeModule === 'barChart') {
this.$nextTick((res) => {
this.$refs.orderEnergyChart.getChart();
});
}
},
headBtnClick() {},
},
};
</script>
<style lang='scss' scoped>
.orderEnergyContainer {
background-color: rgb(242, 244, 249);
.box1, .box2, .box3 {
background-color: #fff;
border-radius: 9px;
}
.box1 {
height: 64px;
padding: 12px 16px 0;
}
.box2 {
height: 122px;
margin: 8px 0;
padding: 16px;
.blodTip {
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
font-weight: 400;
color: rgba(102,102,102,0.75);
}
}
.box3 {
padding: 16px;
height: calc(100vh - 330px);
.toggleTabBox {
display: inline-block;
div {
display: inline-block;
padding:0 8px 4px;
color: rgba(102, 102, 102, 0.5);
border-bottom: 2px solid rgba(242, 244, 249, 1);
cursor: pointer;
}
.active {
color: rgba(0,0,0,0.85);
border-bottom-color: #0B58FF;
}
}
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin:0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
background-color: rgb(242, 244, 249);
.box1,
.box2,
.box3 {
background-color: #fff;
border-radius: 9px;
}
.box1 {
height: 64px;
padding: 12px 16px 0;
}
.box2 {
height: 122px;
margin: 8px 0;
padding: 16px;
.blodTip {
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 8px;
}
.lightTip {
font-weight: 400;
color: rgba(102, 102, 102, 0.75);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.box3 {
padding: 16px;
height: calc(100vh - 330px);
.toggleTabBox {
display: inline-block;
div {
display: inline-block;
padding: 0 8px 4px;
color: rgba(102, 102, 102, 0.5);
border-bottom: 2px solid rgba(242, 244, 249, 1);
cursor: pointer;
}
.active {
color: rgba(0, 0, 0, 0.85);
border-bottom-color: #0b58ff;
}
}
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin: 0 10px 20px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -104,21 +104,27 @@ export default {
type: 'separate',
},
{
type: 'button',
type: this.$auth.hasPermi('equipment:inspection-confirm:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{
type: 'button',
type: this.$auth.hasPermi('equipment:inspection-confirm:confirm')
? 'button'
: '',
btnName: '批量确认',
name: 'batchConfirm',
color: 'primary',
plain: true,
},
{
type: 'button',
type: this.$auth.hasPermi('equipment:inspection-confirm:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
plain: true,

View File

@ -160,21 +160,25 @@ export default {
type: 'separate',
},
{
type: 'button',
type: this.$auth.hasPermi('equipment:maintain-confirm:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,
color: 'success',
},
{
type: 'button',
type: this.$auth.hasPermi('equipment:maintain-confirm:confirm')
? 'button'
: '',
btnName: '批量确认',
name: 'batchConfirm',
color: 'primary',
plain: true,
},
{
type: this.$auth.hasPermi('equipment:maintain-record:export')
type: this.$auth.hasPermi('equipment:maintain-confirm:export')
? 'button'
: '',
btnName: '导出',

View File

@ -193,7 +193,7 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-inspection-type:export')
type: this.$auth.hasPermi('equipment:maintain-monitor:export')
? 'button'
: '',
btnName: '导出',

View File

@ -112,7 +112,7 @@ export default {
param: 'code',
},
{
type: 'button',
type: this.$auth.hasPermi('extend:process-equ-material-bom:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -113,7 +113,7 @@ export default {
param: 'code',
},
{
type: 'button',
type: this.$auth.hasPermi('extend:process-equ-value-bom:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -1,244 +1,292 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
@confirm="handleConfirm" :before-close="handleCancel" width='50%'>
<group-class-add ref="classList" @successSubmit="successSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="50%">
<group-class-add
ref="classList"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses";
import GroupClassAdd from './components/groupClassAdd'
import { formatDate } from '@/utils'
import { publicFormatter } from '@/utils/dict'
import {
getGroupClassesPage,
deleteGroupClasses,
updateGroupClasses,
} from '@/api/base/groupClasses';
import GroupClassAdd from './components/groupClassAdd';
import { formatDate } from '@/utils';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'enableTimeStr',
label: '生效时段',
minWidth: 300
},
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
minWidth: 100
},
{
prop: 'name',
label: '班次名称'
},
{
prop: 'timeStr',
label: '班次时间',
minWidth: 100
},
{
prop: 'code',
label: '班次编码',
minWidth: 200
},
{
prop: 'status',
label: '班次状态'
},
{
prop: 'remark',
label: '备注'
}
]
{
prop: 'enableTimeStr',
label: '生效时段',
minWidth: 300,
},
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
minWidth: 100,
},
{
prop: 'name',
label: '班次名称',
},
{
prop: 'timeStr',
label: '班次时间',
minWidth: 100,
},
{
prop: 'code',
label: '班次编码',
minWidth: 200,
},
{
prop: 'status',
label: '班次状态',
},
{
prop: 'remark',
label: '备注',
},
];
export default {
name: "GroupClasses",
components: { GroupClassAdd },
data() {
return {
formConfig: [
{
type: 'input',
label: '班次名称',
placeholder: '班次名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-classes:cancel')
? {
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: '不可用'
}
]
}
}
: undefined,
this.$auth.hasPermi('base:group-classes:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:group-classes:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
addOrEditTitle: "",
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null
}
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.name = val.name
this.getList()
break
default:
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.classList.init()
})
}
},
/** 查询列表 */
getList() {
getGroupClassesPage(this.queryParams).then(res => {
if (res.code === 0 && res.data.list.length > 0) {
res.data.list.map(item => {
item.enableTimeStr = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久')
item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5)
item.status = item.status === true ? '可用' : '不可用'
})
this.list = res.data.list;
this.total = res.data.total;
} else {
this.list = []
this.total = 0
}
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.$nextTick(() => {
this.$refs.classList.init(val.data.id)
})
this.centervisible = true
break
case 'cancel':
this.discard(val.data)
break
default:
this.handleDelete(val.data)
}
},
handleCancel() {
this.$refs.classList.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.classList.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
discard(row) {
let obj = {}
obj.id = row.id
obj.startTime = row.startTime
obj.endTime = row.endTime
obj.enableTime = row.enableTime
obj.disableTime = Date.parse(new Date())
this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function () {
return updateGroupClasses({ ...obj })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => { });
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row)
let _this = this
if (row.status === '可用') {//
_this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function () {
return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
return deleteGroupClasses(row.id);
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => { });
})
} else {
_this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
return deleteGroupClasses(row.id);
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
}
}
name: 'GroupClasses',
components: { GroupClassAdd },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '班次名称',
placeholder: '班次名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:group-classes:create')
? 'button'
: '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-classes:cancel')
? {
type: 'cancel',
btnName: '作废',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'status',
value: '不可用',
},
],
},
}
: undefined,
this.$auth.hasPermi('base:group-classes:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:group-classes:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
//
total: 0,
//
list: [],
//
addOrEditTitle: '',
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
},
};
},
created() {
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.name = val.name;
this.getList();
break;
default:
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.classList.init();
});
}
},
/** 查询列表 */
getList() {
getGroupClassesPage(this.queryParams).then((res) => {
if (res.code === 0 && res.data.list.length > 0) {
res.data.list.map((item) => {
item.enableTimeStr =
formatDate(item.enableTime) +
'至' +
(item.disableTime ? formatDate(item.disableTime) : '永久');
item.timeStr =
item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
item.status = item.status === true ? '可用' : '不可用';
});
this.list = res.data.list;
this.total = res.data.total;
} else {
this.list = [];
this.total = 0;
}
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.classList.init(val.data.id);
});
this.centervisible = true;
break;
case 'cancel':
this.discard(val.data);
break;
default:
this.handleDelete(val.data);
}
},
handleCancel() {
this.$refs.classList.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.classList.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
discard(row) {
let obj = {};
obj.id = row.id;
obj.startTime = row.startTime;
obj.endTime = row.endTime;
obj.enableTime = row.enableTime;
obj.disableTime = Date.parse(new Date());
this.$modal
.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?')
.then(function () {
return updateGroupClasses({ ...obj });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row);
let _this = this;
if (row.status === '可用') {
//
_this.$modal
.confirm(
'删除的班次"' +
row.name +
'"可能会影响交接班计划,请点取消再次确认!'
)
.then(function () {
return _this.$modal
.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupClasses(row.id);
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
});
} else {
_this.$modal
.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupClasses(row.id);
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
}
},
},
};
</script>

View File

@ -1,253 +1,260 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
@emitFun="handleTableEvents"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='40%'
>
<group-team-add ref="groupList" @successSubmit="successSubmit" />
</base-dialog>
<!-- 组员编辑 -->
<worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
@emitFun="handleTableEvents">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="40%">
<group-team-add
ref="groupList"
@successSubmit="successSubmit" />
</base-dialog>
<!-- 组员编辑 -->
<worker-edit
v-if="paramVisible"
ref="workerEditParam"
@closeDrawer="closeDrawer"></worker-edit>
</div>
</template>
<script>
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
import { parseTime } from '@/utils/ruoyi'
import GroupTeamAdd from './components/groupTeamAdd'
import StatusBtn from './components/statusBtn'
import WorkerOperate from './components/workerOperate'
import WorkerEdit from './components/workerEdit'
import { publicFormatter } from '@/utils/dict'
import {
getGroupTeamPage,
deleteGroupTeam,
updateGroupTeam,
} from '@/api/base/groupTeam';
import { parseTime } from '@/utils/ruoyi';
import GroupTeamAdd from './components/groupTeamAdd';
import StatusBtn from './components/statusBtn';
import WorkerOperate from './components/workerOperate';
import WorkerEdit from './components/workerEdit';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop')
},
{
prop: 'name',
label: '班组名称'
},
{
prop: 'code',
label: '编码',
minWidth: 220
},
{
prop: 'num',
label: '班组人数'
},
{
prop: 'leaderName',
label: '组长'
},
{
prop: 'enabled',
label: '班组状态',
subcomponent: StatusBtn
},
{
prop: 'workerName',
label: '组员',
subcomponent: WorkerOperate
},
]
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
},
{
prop: 'name',
label: '班组名称',
},
{
prop: 'code',
label: '编码',
minWidth: 220,
},
{
prop: 'num',
label: '班组人数',
},
{
prop: 'leaderName',
label: '组长',
},
{
prop: 'enabled',
label: '班组状态',
subcomponent: StatusBtn,
},
{
prop: 'workerName',
label: '组员',
subcomponent: WorkerOperate,
},
];
export default {
name: "GroupTeam",
components: { GroupTeamAdd, WorkerEdit },
data() {
return {
formConfig: [
{
type: 'input',
label: '班组名称',
placeholder: '班组名称',
param: 'name'
},
{
type: 'input',
label: '组长',
placeholder: '组长',
param: 'leaderName'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: 'separate'
},
{
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-team:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:group-team:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v) => v),
tableH: this.tableHeight(260),
//
total: 0,
//
list: [],
//
addOrEditTitle: "",
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
code: null
},
paramVisible: false
};
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.leaderName = val.leaderName
this.queryParams.name = val.name
this.getList()
break
default:
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.groupList.init()
})
}
},
/** 查询列表 */
getList() {
getGroupTeamPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.$nextTick(() => {
this.$refs.groupList.init(val.data.id)
})
this.centervisible = true
break
default:
this.handleDelete(val.data)
}
},
//
handleTableEvents(params) {
console.log(params)
if (params.name === 'state') {//
updateGroupTeam({ ...params.payload }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
}
})
}else {// &
this.paramVisible = true
this.$nextTick(() => {
this.$refs.workerEditParam.init(params)
})
}
},
handleCancel() {
this.$refs.groupList.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.groupList.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?').then(function() {
return deleteGroupTeam(row.id);
}).then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
closeDrawer() {
this.getList()
}
}
name: 'GroupTeam',
components: { GroupTeamAdd, WorkerEdit },
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '班组名称',
placeholder: '班组名称',
param: 'name',
},
{
type: 'input',
label: '组长',
placeholder: '组长',
param: 'leaderName',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
tableProps,
tableBtn: [
this.$auth.hasPermi('base:group-team:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:group-team:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
//
total: 0,
//
list: [],
//
addOrEditTitle: '',
//
centervisible: false,
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
code: null,
},
paramVisible: false,
};
},
created() {
this.getList();
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.queryParams.pageNo = 1;
this.queryParams.leaderName = val.leaderName;
this.queryParams.name = val.name;
this.getList();
break;
default:
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.groupList.init();
});
}
},
/** 查询列表 */
getList() {
getGroupTeamPage(this.queryParams).then((response) => {
this.list = response.data.list;
this.total = response.data.total;
});
},
handleClick(val) {
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.$nextTick(() => {
this.$refs.groupList.init(val.data.id);
});
this.centervisible = true;
break;
default:
this.handleDelete(val.data);
}
},
//
handleTableEvents(params) {
console.log(params);
if (params.name === 'state') {
//
updateGroupTeam({ ...params.payload }).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess('操作成功');
}
});
} else {
// &
this.paramVisible = true;
this.$nextTick(() => {
this.$refs.workerEditParam.init(params);
});
}
},
handleCancel() {
this.$refs.groupList.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.groupList.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteGroupTeam(row.id);
})
.then(() => {
this.queryParams.pageNo = 1;
this.getList();
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
closeDrawer() {
this.getList();
},
},
};
</script>

View File

@ -1,152 +1,150 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<!-- 查看详情 -->
<group-team-view-detail v-if="paramVisible" ref="groupTeamViewDetail"/>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<!-- 查看详情 -->
<group-team-view-detail
v-if="paramVisible"
ref="groupTeamViewDetail" />
</div>
</template>
<script>
import { getByWorkOrder } from '@/api/monitoring/groupTeamView'
import { workOrderList } from '@/api/base/workOrder'
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue'
import { publicFormatter } from '@/utils/dict'
import { getByWorkOrder } from '@/api/monitoring/groupTeamView';
import { workOrderList } from '@/api/base/workOrder';
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100
},
{
prop: 'name',
label: '班组名称'
},
{
prop: 'leaderName',
label: '班组长'
},
{
prop: 'num',
label: '人数'
},
{
prop: 'workCount',
label: '上班次数'
}
]
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100,
},
{
prop: 'name',
label: '班组名称',
},
{
prop: 'leaderName',
label: '班组长',
},
{
prop: 'num',
label: '人数',
},
{
prop: 'workCount',
label: '上班次数',
},
];
export default {
name: 'GroupTeamView',
data() {
return {
formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
param: 'workOrderId',
clearable: false,
filterable: true
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
//
queryParams: {
pageNo: 1,
pageSize: 1000,
workOrderId: ''
},
workOrderList: [],
workOrderName: '',
tableBtn: [
this.$auth.hasPermi('base:group-team-view:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined
].filter((v) => v),
tableProps,
tableH: this.tableHeight(220),
list: [],
paramVisible: false
}
},
components: { GroupTeamViewDetail },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(220)
})
this.getOrderList()
},
methods: {
// list
getOrderList() {
workOrderList().then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data || []
this.workOrderList = res.data || []
})
},
//
buttonClick(val) {
if (!val.workOrderId) {
this.$modal.msgWarning('工单不能为空')
return false
}
this.queryParams.workOrderId = val.workOrderId
this.getList()
},
// table
getList() {
getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => {
this.list = res.data || []
})
},
handleClick(val) {
this.paramVisible = true
let params = {}
params.teamId = val.data.id
params.teamName = val.data.name
this.workOrderList.map(item => {
if (val.data.workOrderId === item.id) {
this.workOrderName = item.name
}
})
params.workOrderId = val.data.workOrderId
params.workOrderName = this.workOrderName
params.roomNameDict = val.data.roomNameDict
this.$nextTick(() => {
this.$refs.groupTeamViewDetail.init(params)
})
}
}
}
name: 'GroupTeamView',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'select',
label: '工单',
selectOptions: [],
param: 'workOrderId',
clearable: false,
filterable: true,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
//
queryParams: {
pageNo: 1,
pageSize: 1000,
workOrderId: '',
},
heightNum: 220,
workOrderList: [],
workOrderName: '',
tableBtn: [
this.$auth.hasPermi('base:group-team-view:detail')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
].filter((v) => v),
tableProps,
list: [],
paramVisible: false,
};
},
components: { GroupTeamViewDetail },
mounted() {
this.getOrderList();
},
methods: {
// list
getOrderList() {
workOrderList().then((res) => {
console.log(res);
this.formConfig[0].selectOptions = res.data || [];
this.workOrderList = res.data || [];
});
},
//
buttonClick(val) {
if (!val.workOrderId) {
this.$modal.msgWarning('工单不能为空');
return false;
}
this.queryParams.workOrderId = val.workOrderId;
this.getList();
},
// table
getList() {
getByWorkOrder({ id: this.queryParams.workOrderId }).then((res) => {
this.list = res.data || [];
});
},
handleClick(val) {
this.paramVisible = true;
let params = {};
params.teamId = val.data.id;
params.teamName = val.data.name;
this.workOrderList.map((item) => {
if (val.data.workOrderId === item.id) {
this.workOrderName = item.name;
}
});
params.workOrderId = val.data.workOrderId;
params.workOrderName = this.workOrderName;
params.roomNameDict = val.data.roomNameDict;
this.$nextTick(() => {
this.$refs.groupTeamViewDetail.init(params);
});
},
},
};
</script>

View File

@ -1,130 +1,146 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-area @submit="buttonClick" />
<!-- <search-bar
<div class="app-container">
<!-- 搜索工作栏 -->
<search-area @submit="buttonClick" />
<!-- <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/> -->
<!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
<!-- 查看生产情况 -->
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' />
</div>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 查看生产情况 -->
<team-production-detail
v-if="paramVisible"
ref="schedulingMonitoringDetail" />
</div>
</template>
<script>
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction'
import { parseTime } from '@/utils/ruoyi'
import TeamProductionDetail from './components/teamProductionDetail'
import { publicFormatter } from '@/utils/dict'
import SearchArea from './components/searchArea'
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction';
import { parseTime } from '@/utils/ruoyi';
import TeamProductionDetail from './components/teamProductionDetail';
import { publicFormatter } from '@/utils/dict';
import SearchArea from './components/searchArea';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100
},
// {
// prop: 'createTime',
// label: '',
// filter: parseTime,
// minWidth: 160
// },
{
prop: 'startDay',
label: '上班日期',
minWidth: 100
},
{
prop: 'startTime',
label: '上班时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'endTime',
label: '下班时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'classesName',
label: '班次名称',
showOverflowtooltip: true
},
{
prop: 'teamName',
label: '班组名称',
showOverflowtooltip: true
}
]
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100,
},
// {
// prop: 'createTime',
// label: '',
// filter: parseTime,
// minWidth: 160
// },
{
prop: 'startDay',
label: '上班日期',
minWidth: 100,
},
{
prop: 'startTime',
label: '上班时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'endTime',
label: '下班时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'classesName',
label: '班次名称',
showOverflowtooltip: true,
},
{
prop: 'teamName',
label: '班组名称',
showOverflowtooltip: true,
},
];
export default {
name: 'GroupTeamScheduling',
data() {
return {
//
queryParams: {
pageNo: 1,
pageSize: 20,
classesId: '',
teamName: '',
startDay: []
},
tableProps,
tableBtn: [
this.$auth.hasPermi('base:team-production:detail')
? {
type: 'productionDetail',
btnName: '查看',
showTip: '生产情况'
}
: undefined
].filter((v) => v),
list: [],
tableH: this.tableHeight(260),
total: 0,
paramVisible: false
}
},
components: { TeamProductionDetail, SearchArea },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.classesId = val.classesId
this.queryParams.teamName = val.teamName
this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : ''
this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : ''
this.getList()
},
getList() {
groupTeamSchedulingPage({ ...this.queryParams }).then(res => {
console.log(res)
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
handleClick(val) {
console.log(val)
this.paramVisible = true
this.$nextTick(() => {
this.$refs.schedulingMonitoringDetail.init(val.data)
})
}
}
}
name: 'GroupTeamScheduling',
mixins: [tableHeightMixin],
data() {
return {
//
queryParams: {
pageNo: 1,
pageSize: 20,
classesId: '',
teamName: '',
startDay: [],
},
tableProps,
tableBtn: [
this.$auth.hasPermi('base:team-production:detail')
? {
type: 'productionDetail',
btnName: '查看',
showTip: '生产情况',
}
: undefined,
].filter((v) => v),
list: [],
total: 0,
paramVisible: false,
};
},
components: { TeamProductionDetail, SearchArea },
mounted() {
this.getList();
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.classesId = val.classesId;
this.queryParams.teamName = val.teamName;
this.queryParams.startDay[0] = val.tiemStr
? val.tiemStr[0] + ' 00:00:00'
: '';
this.queryParams.startDay[1] = val.tiemStr
? val.tiemStr[1] + ' 23:59:59'
: '';
this.getList();
},
getList() {
groupTeamSchedulingPage({ ...this.queryParams }).then((res) => {
console.log(res);
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
handleClick(val) {
console.log(val);
this.paramVisible = true;
this.$nextTick(() => {
this.$refs.schedulingMonitoringDetail.init(val.data);
});
},
},
};
</script>

View File

@ -1,440 +1,465 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="240"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<order-group-add ref="orderGroupAdd" @successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
dialogTitle="绑定厂务订单"
:dialogVisible="bindOrderVisible"
@cancel="bindOrderCancel"
@confirm="bindOrderConfirm"
:before-close="bindOrderCancel"
width='60%'
>
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="240"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="60%">
<order-group-add
ref="orderGroupAdd"
@successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
dialogTitle="绑定厂务订单"
:dialogVisible="bindOrderVisible"
@cancel="bindOrderCancel"
@confirm="bindOrderConfirm"
:before-close="bindOrderCancel"
width="60%">
<bind-order
ref="bindOrder"
@bindOrderSubmit="bindOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
import { customerList } from '@/api/base/orderManage'
import OrderGroupAdd from './components/orderGroupAdd'
import BindOrder from './components/bindOrder'
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi';
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup';
import { customerList } from '@/api/base/orderManage';
import OrderGroupAdd from './components/orderGroupAdd';
import BindOrder from './components/bindOrder';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 150
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'productName',
label: '产品名称',
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'specifications',
label: '产品规格',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualquantity',
label: '实际加工量',
width: 100
},
{
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'packReq',
label: '包装要求',
// filter: publicFormatter('pack_spec'),
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'orderIdNum',
label: '订单数量'
}
]
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '订单编码',
minWidth: 150,
},
{
prop: 'customerId',
label: '客户',
showOverflowtooltip: true,
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status'),
},
{
prop: 'productName',
label: '产品名称',
minWidth: 200,
showOverflowtooltip: true,
},
{
prop: 'specifications',
label: '产品规格',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100,
},
{
prop: 'actualquantity',
label: '实际加工量',
width: 100,
},
{
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'packReq',
label: '包装要求',
// filter: publicFormatter('pack_spec'),
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'orderIdNum',
label: '订单数量',
},
];
export default {
name: 'OrderGroup',
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status'
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
planFinishTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-group:bind')
? {
type: 'bind',
btnName: '绑定',
showTip: '厂务订单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-group:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-group:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-group:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
{
type: 'detail',
btnName: '详情'
},
this.$auth.hasPermi('base:order-group:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
bindOrderVisible: false,
orderDetailVisible: false
}
},
components: { OrderGroupAdd, BindOrder },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
getList() {
getOrderGroupPage({...this.queryParams}).then(res => {
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
let tempData = result.data || []
if (tempData.length > 0) {
arr.map(item => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name
}
}
})
this.list = arr
}
})
}else {
this.list = arr
}
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.planFinishTime = []
}
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderGroupAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderGroupAdd.init(val.data.id)
})
break
case 'cancel':
this.handleEditStatus(val.data, '作废', '6')
break
case 'detail':
this.$router.push({path: '/order/base/order-group/order-group-detail-data?orderGroupId='+ val.data.id})
break
case 'termination':
this.handleEditStatus(val.data, '终止', '5')
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.bindOrderVisible = true
this.$nextTick(() => {
this.$refs.bindOrder.init(val.data)
})
break
case 'complete':
this.handleEditStatus(val.data, '完成', '4')
break
default:
}
},
// ,
handleEditStatus(val, tip, status) {
let _this = this
if (val.orderIdNum > 0) {//
_this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步'
}).then(function() {
console.log('同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
})
}else {
return console.log('关闭')
}
})
}else{//
_this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() {
return groupOrderStatusSet({ id: val.id, status: status})
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
}).catch(() => {});
}
},
handleCancel() {
this.$refs.orderGroupAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.orderGroupAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
bindOrderCancel() {
this.$refs.bindOrder.formClear()
this.bindOrderVisible = false
},
bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit()
},
bindOrderSubmit() {
this.bindOrderCancel()
this.getList()
}
}
}
name: 'OrderGroup',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name',
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:order-group:create')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
planFinishTime: [],
},
total: 0,
tableProps,
list: [],
tableBtn: [
this.$auth.hasPermi('base:order-group:bind')
? {
type: 'bind',
btnName: '绑定',
showTip: '厂务订单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-group:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-group:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-group:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2,
},
],
},
}
: undefined,
{
type: 'detail',
btnName: '详情',
},
this.$auth.hasPermi('base:order-group:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2,
},
],
},
}
: undefined,
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
bindOrderVisible: false,
orderDetailVisible: false,
};
},
components: { OrderGroupAdd, BindOrder },
created() {
this.getList();
},
methods: {
getList() {
getOrderGroupPage({ ...this.queryParams }).then((res) => {
let arr = res.data.records || [];
this.total = res.data.total || 0;
if (arr.length > 0) {
customerList().then((result) => {
let tempData = result.data || [];
if (tempData.length > 0) {
arr.map((item) => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name;
}
}
});
this.list = arr;
}
});
} else {
this.list = arr;
}
});
},
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.queryParams.name = val.name;
this.queryParams.status = val.status;
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00';
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59';
} else {
this.queryParams.planFinishTime = [];
}
this.getList();
} else {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.orderGroupAdd.init();
});
}
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.orderGroupAdd.init(val.data.id);
});
break;
case 'cancel':
this.handleEditStatus(val.data, '作废', '6');
break;
case 'detail':
this.$router.push({
path:
'/order/base/order-group/order-group-detail-data?orderGroupId=' +
val.data.id,
});
break;
case 'termination':
this.handleEditStatus(val.data, '终止', '5');
break;
case 'bind':
this.workIssueTitle = '绑定工单';
this.bindOrderVisible = true;
this.$nextTick(() => {
this.$refs.bindOrder.init(val.data);
});
break;
case 'complete':
this.handleEditStatus(val.data, '完成', '4');
break;
default:
}
},
// ,
handleEditStatus(val, tip, status) {
let _this = this;
if (val.orderIdNum > 0) {
//
_this
.$confirm(
'是否将"' + tip + '"操作同步至下级订单和工单?',
'确认信息',
{
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步',
}
)
.then(function () {
console.log('同步');
groupOrderStatusSet({
id: val.id,
status: status,
isSync: true,
}).then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
});
})
.catch((action) => {
if (action === 'cancel') {
console.log('不同步');
groupOrderStatusSet({
id: val.id,
status: status,
isSync: false,
}).then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
});
} else {
return console.log('关闭');
}
});
} else {
//
_this.$modal
.confirm(
'是否确认"' + tip + '"集团订单名称为"' + val.name + '"的数据项?'
)
.then(function () {
return groupOrderStatusSet({ id: val.id, status: status });
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
}
},
handleCancel() {
this.$refs.orderGroupAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.orderGroupAdd.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
//
bindOrderCancel() {
this.$refs.bindOrder.formClear();
this.bindOrderVisible = false;
},
bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit();
},
bindOrderSubmit() {
this.bindOrderCancel();
this.getList();
},
},
};
</script>

View File

@ -1,470 +1,494 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="290"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<order-add ref="orderAdd" @successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
:dialogTitle="workIssueTitle"
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width='70%'
>
<add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="290"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="60%">
<order-add
ref="orderAdd"
@successSubmit="successSubmit" />
</base-dialog>
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
:dialogTitle="workIssueTitle"
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width="70%">
<add-work-order
ref="addWorkOrder"
@addWorkOrderSubmit="addWorkOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderPage, orderStatusSet, customerList, orderFinish } from '@/api/base/orderManage'
import OrderAdd from './components/orderAdd'
import AddWorkOrder from './components/addWorkOrder'
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi';
import {
getOrderPage,
orderStatusSet,
customerList,
orderFinish,
} from '@/api/base/orderManage';
import OrderAdd from './components/orderAdd';
import AddWorkOrder from './components/addWorkOrder';
import { publicFormatter } from '@/utils/dict';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 150,
showOverflowtooltip: true
},
{
prop: 'triggerOrigin',
label: '来源',
filter: publicFormatter('order_Origin')
},
{
prop: 'priority',
label: '优先级',
filter: publicFormatter('order_priority')
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100
},
{
prop: 'productName',
label: '产品',
width: 200,
showOverflowtooltip: true
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict')
},
{
prop: 'price',
label: '单价(元)',
align: 'right'
},
{
prop: 'workOrderNum',
label: '工单数量'
}
]
{
prop: 'createTime',
label: '添加时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '订单编码',
minWidth: 150,
showOverflowtooltip: true,
},
{
prop: 'triggerOrigin',
label: '来源',
filter: publicFormatter('order_Origin'),
},
{
prop: 'priority',
label: '优先级',
filter: publicFormatter('order_priority'),
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status'),
},
{
prop: 'planQuantity',
label: '计划加工量',
width: 100,
},
{
prop: 'actualQuantity',
label: '实际加工量',
width: 100,
},
{
prop: 'productName',
label: '产品',
width: 200,
showOverflowtooltip: true,
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('unit_dict'),
},
{
prop: 'price',
label: '单价(元)',
align: 'right',
},
{
prop: 'workOrderNum',
label: '工单数量',
},
];
export default {
name: 'OrderManage',
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name'
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status'
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
lastIssuedTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
? {
type: 'add',
btnName: '新增',
showTip: '新增工单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('base:order-manage:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
orderDetailVisible: false
}
},
components: { OrderAdd, AddWorkOrder },
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
},
methods: {
getList() {
getOrderPage({...this.queryParams}).then(res => {
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
let tempData = result.data || []
if (tempData.length > 0) {
arr.map(item => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name
}
}
item.price = item.price ? item.price.toFixed(2) : '0.00'
})
this.list = arr
}
})
}else {
this.list = arr
}
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.lastIssuedTime = []
}
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.orderAdd.init(val.data.id)
})
break
case 'cancel':
this.handleEditStatus(val.data, '作废', '6')
break
case 'termination':
this.handleEditStatus(val.data, '终止', '5')
break
case 'detail':
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
break
case 'add':
this.workIssueTitle = '新增工单'
this.addWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'add')
})
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.addWorkOrdervisible = true
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'bind')
})
break
case 'complete':
this.handleEditStatus(val.data, '完成', '4')
break
default:
}
},
// ,
handleEditStatus(val, tip, status) {
let _this = this
if (val.workOrderNum > 0) {//
_this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步'
}).then(function() {
console.log('同步')
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
})
}else {
return console.log('关闭')
}
})
}else{//
_this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
return orderStatusSet({ id: val.id, status: status})
}).then(() => {
_this.getList();
_this.$modal.msgSuccess("操作成功");
}).catch(() => {});
}
},
//
handleCancel() {
this.$refs.orderAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.orderAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
},
//
addWorkOrderCancel() {
this.$refs.addWorkOrder.formClear()
this.addWorkOrdervisible = false
},
addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit()
},
addWorkOrderSubmit() {
this.addWorkOrderCancel()
this.getList()
}
// bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear()
// this.bindWorkOrdervisible = false
// },
// bindWorkOrderConfirm() {
// this.$refs.bindWorkOrder.bindWorkOrderSubmit()
// },
// bindWorkOrderSubmit() {
// this.bindWorkOrderCancel()
// this.getList()
// }
}
}
name: 'OrderManage',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '订单名称',
placeholder: '订单名称',
param: 'name',
},
{
type: 'select',
label: '状态',
selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
labelField: 'label',
valueField: 'value',
param: 'status',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:order-manage:create')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
name: null,
status: null,
lastIssuedTime: [],
},
total: 0,
tableProps,
list: [],
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
? {
type: 'add',
btnName: '新增',
showTip: '新增工单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
? {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-manage:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-manage:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-manage:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('base:order-manage:edit')
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2,
},
],
},
}
: undefined,
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
orderDetailVisible: false,
};
},
components: { OrderAdd, AddWorkOrder },
created() {
this.getList();
},
methods: {
getList() {
getOrderPage({ ...this.queryParams }).then((res) => {
let arr = res.data.records || [];
this.total = res.data.total || 0;
if (arr.length > 0) {
customerList().then((result) => {
let tempData = result.data || [];
if (tempData.length > 0) {
arr.map((item) => {
for (let i of tempData) {
if (item.customerId === i.id) {
item.customerId = i.name;
}
}
item.price = item.price ? item.price.toFixed(2) : '0.00';
});
this.list = arr;
}
});
} else {
this.list = arr;
}
});
},
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.queryParams.name = val.name;
this.queryParams.status = val.status;
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00';
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59';
} else {
this.queryParams.lastIssuedTime = [];
}
this.getList();
} else {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.orderAdd.init();
});
}
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.orderAdd.init(val.data.id);
});
break;
case 'cancel':
this.handleEditStatus(val.data, '作废', '6');
break;
case 'termination':
this.handleEditStatus(val.data, '终止', '5');
break;
case 'detail':
this.$router.push({
path:
'/order/base/order-manage/order-detail-data?orderId=' +
val.data.id,
});
break;
case 'add':
this.workIssueTitle = '新增工单';
this.addWorkOrdervisible = true;
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'add');
});
break;
case 'bind':
this.workIssueTitle = '绑定工单';
this.addWorkOrdervisible = true;
this.$nextTick(() => {
this.$refs.addWorkOrder.init(val.data, 'bind');
});
break;
case 'complete':
this.handleEditStatus(val.data, '完成', '4');
break;
default:
}
},
// ,
handleEditStatus(val, tip, status) {
let _this = this;
if (val.workOrderNum > 0) {
//
_this
.$confirm('是否将"' + tip + '"操作同步至下级工单?', '确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步',
})
.then(function () {
console.log('同步');
orderStatusSet({ id: val.id, status: status, isSync: true }).then(
() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
}
);
})
.catch((action) => {
if (action === 'cancel') {
console.log('不同步');
orderStatusSet({
id: val.id,
status: status,
isSync: false,
}).then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
});
} else {
return console.log('关闭');
}
});
} else {
//
_this.$modal
.confirm(
'是否确认"' + tip + '"厂务订单名称为"' + val.name + '"的数据项?'
)
.then(function () {
return orderStatusSet({ id: val.id, status: status });
})
.then(() => {
_this.getList();
_this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
}
},
//
handleCancel() {
this.$refs.orderAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.orderAdd.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
//
addWorkOrderCancel() {
this.$refs.addWorkOrder.formClear();
this.addWorkOrdervisible = false;
},
addWorkOrderConfirm() {
this.$refs.addWorkOrder.addWorkOrderSubmit();
},
addWorkOrderSubmit() {
this.addWorkOrderCancel();
this.getList();
},
// bindWorkOrderCancel() {
// this.$refs.bindWorkOrder.formClear()
// this.bindWorkOrdervisible = false
// },
// bindWorkOrderConfirm() {
// this.$refs.bindWorkOrder.bindWorkOrderSubmit()
// },
// bindWorkOrderSubmit() {
// this.bindWorkOrderCancel()
// this.getList()
// }
},
};
</script>

View File

@ -1,390 +1,427 @@
<template>
<div class="app-container orderMonitoring">
<!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-tabs v-model="activeName" @tab-click="toggleTab">
<el-tab-pane label="数据列表" name="dataList"></el-tab-pane>
<el-tab-pane label="环形图" name="barChart"></el-tab-pane>
</el-tabs>
<!-- -->
<div v-if="activeName === 'dataList'">
<base-table :page="1" :limit="1000000000000" :table-props="tableProps" :table-data="list" :max-height="tableH"
row-key="id" :tree-props="{ children: 'orderMonitorVOS', hasChildren: 'hasChildren' }">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="100" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
<!-- -->
<monitoring-ring-charts ref='monitoringRingCharts' v-else :chart-list='chartList' />
<!-- <pagination
<div class="app-container orderMonitoring">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<el-tabs
v-model="activeName"
@tab-click="toggleTab">
<el-tab-pane
label="数据列表"
name="dataList"></el-tab-pane>
<el-tab-pane
label="环形图"
name="barChart"></el-tab-pane>
</el-tabs>
<!-- -->
<div v-if="activeName === 'dataList'">
<base-table
:page="1"
:limit="1000000000000"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
row-key="id"
:tree-props="{
children: 'orderMonitorVOS',
hasChildren: 'hasChildren',
}">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="100"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
</div>
<!-- -->
<monitoring-ring-charts
ref="monitoringRingCharts"
v-else
:chart-list="chartList" />
<!-- <pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getPage"
/> -->
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { publicFormatter } from '@/utils/dict'
import { orderGroupMonitor } from '@/api/base/orderGroup'
import MonitoringRingCharts from './../components/monitoringRingCharts'
import moment from "moment"
import { parseTime } from '@/utils/ruoyi';
import { publicFormatter } from '@/utils/dict';
import { orderGroupMonitor } from '@/api/base/orderGroup';
import MonitoringRingCharts from './../components/monitoringRingCharts';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'orderType',
label: '订单类型'
},
{
prop: 'customerName',
label: '客户'
},
{
prop: 'productname',
label: '产品',
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'planStartTime',
label: '计划开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},
{
prop: 'startProduceTime',
label: '实际开始时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'finishProduceTime',
label: '实际完成时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'lineNames',
label: '加工线',
filter: (val) => val ? val.join(',') : '',
minWidth: 180
},
{
prop: 'planQuantity',
label: '计划生产量',
width: 100
},
{
prop: 'actualquantity',
label: '实际产出量',
width: 100
},
{
prop: 'completeRate',
label: '订单完成率',
width: 100
},
{
prop: 'orderNum',
label: '关联订单/工单数量',
width: 110
}
]
{
prop: 'name',
label: '订单名称',
minWidth: 140,
showOverflowtooltip: true,
},
{
prop: 'orderType',
label: '订单类型',
},
{
prop: 'customerName',
label: '客户',
},
{
prop: 'productname',
label: '产品',
minWidth: 200,
showOverflowtooltip: true,
},
{
prop: 'planStartTime',
label: '计划开始时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'planFinishTime',
label: '计划完成时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status'),
},
{
prop: 'startProduceTime',
label: '实际开始时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'finishProduceTime',
label: '实际完成时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'lineNames',
label: '加工线',
filter: (val) => (val ? val.join(',') : ''),
minWidth: 180,
},
{
prop: 'planQuantity',
label: '计划生产量',
width: 100,
},
{
prop: 'actualquantity',
label: '实际产出量',
width: 100,
},
{
prop: 'completeRate',
label: '订单完成率',
width: 100,
},
{
prop: 'orderNum',
label: '关联订单/工单数量',
width: 110,
},
];
export default {
name: 'OrderCompletionMonitoring',
data() {
return {
formConfig: [
{
type: 'input',
label: '集团订单名称',
param: 'name'
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
activeName: 'dataList',
//
queryParams: {
name: null,
deliveTime: []
},
tableProps,
list: [],
tableH: this.tableHeight(260),
total: 0,
tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? {
type: 'orderDetail',
btnName: '详情',
showTip: '订单/工单详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'orderNum',
value: 1
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
? {
type: 'qualityDetail',
btnName: '质量',
showTip: '质量详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'orderNum',
value: 1
},
{
type: 'unequal',
name: 'woIdString',
value: ''
}
]
}
}
: undefined
// this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
// ? {
// type: 'sendOutDetail',
// btnName: '',
// showTip: '',
// showParam: {
// type: '&',
// data: [
// {
// type: 'more',
// name: 'workOrderNum',
// value: 1
// }
// ]
// }
// }
// : undefined
].filter((v) => v),
chartList: []
}
},
components: { MonitoringRingCharts },
mounted() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
let start = moment().subtract(30, 'days').format('yyyy-MM-DD')
let end = moment().format('yyyy-MM-DD')
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.deliveTime[0] = start + ' 00:00:00'
this.queryParams.deliveTime[1] = end + ' 23:59:59'
this.getPage()
},
methods: {
getPage() {
orderGroupMonitor({ ...this.queryParams }).then(res => {
let arr = res.data || []
if (arr.length > 0) {
let color = ['#7164FF', '#288AFF', '#63BDFF', '#8EF0AB', '#FFCE6A']
let arr2 = []
arr.map(item => {
item.orderType = '集团订单'//
let woIdString = ''//str
//=========
let arr3 = []
let obj = {}
obj.orderGroupName = item.name
obj.id = item.id
obj.num = item.planQuantity || 0
let sunNum = 0
if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) {
for (let i = 0; i < item.orderMonitorVOS.length; i++) {
item.orderMonitorVOS[i].orderType = '厂务订单'//
item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid
item.orderMonitorVOS[i].orderNum = item.orderMonitorVOS[i].workOrderNum
woIdString += item.orderMonitorVOS[i].woIdString ? item.orderMonitorVOS[i].woIdString : ''
//==============
let subObj = {}
subObj.value = item.orderMonitorVOS[i].actualquantity
subObj.name = item.orderMonitorVOS[i].name
if (i < 5) {
subObj.color = color[i]
} else {
subObj.color = color[i % 5]
}
sunNum += (item.orderMonitorVOS[i].actualquantity || 0)
arr3.push(subObj)
}
}
item.woIdString = woIdString
arr3.push({
value: item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0,
name: '未生产',
color: '#F5F5F5'
})
obj.sunNum = sunNum
obj.order = arr3
arr2.push(obj)
})
this.chartList = arr2
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart()
})
}
} else {
//
this.chartList = []
}
console.log(arr)
this.list = arr
})
},
//
buttonClick(val) {
this.queryParams.name = val.name
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.deliveTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.deliveTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.deliveTime = []
}
this.getPage()
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'orderDetail':
if (val.data.orderType === '集团订单') {
this.$router.push({//
path: '/order/base/order-manage/order-detail-data?orderIdString=' + val.data.orderIds.join(',')
})
} else {
this.$router.push({//
path: '/core/core-work-order-detail?woIdString=' + val.data.woIdString
})
}
break
case 'qualityDetail':
this.$router.push({
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString=' + val.data.woIdString
})
break
default:
// this.$router.push({
// path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
// })
}
},
toggleTab() {
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart()
})
}
}
}
}
name: 'OrderCompletionMonitoring',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '集团订单名称',
param: 'name',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 250,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
activeName: 'dataList',
//
queryParams: {
name: null,
deliveTime: [],
},
tableProps,
list: [],
total: 0,
tableBtn: [
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
? {
type: 'orderDetail',
btnName: '详情',
showTip: '订单/工单详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'orderNum',
value: 1,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
? {
type: 'qualityDetail',
btnName: '质量',
showTip: '质量详情',
showParam: {
type: '&',
data: [
{
type: 'more',
name: 'orderNum',
value: 1,
},
{
type: 'unequal',
name: 'woIdString',
value: '',
},
],
},
}
: undefined,
// this.$auth.hasPermi('base:order-completion-monitoring:sendOut')
// ? {
// type: 'sendOutDetail',
// btnName: '',
// showTip: '',
// showParam: {
// type: '&',
// data: [
// {
// type: 'more',
// name: 'workOrderNum',
// value: 1
// }
// ]
// }
// }
// : undefined
].filter((v) => v),
chartList: [],
};
},
components: { MonitoringRingCharts },
mounted() {
let start = moment().subtract(30, 'days').format('yyyy-MM-DD');
let end = moment().format('yyyy-MM-DD');
this.formConfig[1].defaultSelect = [start, end];
this.queryParams.deliveTime[0] = start + ' 00:00:00';
this.queryParams.deliveTime[1] = end + ' 23:59:59';
this.getPage();
},
methods: {
getPage() {
orderGroupMonitor({ ...this.queryParams }).then((res) => {
let arr = res.data || [];
if (arr.length > 0) {
let color = ['#7164FF', '#288AFF', '#63BDFF', '#8EF0AB', '#FFCE6A'];
let arr2 = [];
arr.map((item) => {
item.orderType = '集团订单'; //
let woIdString = ''; //str
//=========
let arr3 = [];
let obj = {};
obj.orderGroupName = item.name;
obj.id = item.id;
obj.num = item.planQuantity || 0;
let sunNum = 0;
if (item.orderMonitorVOS && item.orderMonitorVOS.length > 0) {
for (let i = 0; i < item.orderMonitorVOS.length; i++) {
item.orderMonitorVOS[i].orderType = '厂务订单'; //
item.orderMonitorVOS[i].id = item.orderMonitorVOS[i].orderid;
item.orderMonitorVOS[i].orderNum =
item.orderMonitorVOS[i].workOrderNum;
woIdString += item.orderMonitorVOS[i].woIdString
? item.orderMonitorVOS[i].woIdString + ','
: '';
//==============
let subObj = {};
subObj.value = item.orderMonitorVOS[i].actualquantity;
subObj.name = item.orderMonitorVOS[i].name;
if (i < 5) {
subObj.color = color[i];
} else {
subObj.color = color[i % 5];
}
sunNum += item.orderMonitorVOS[i].actualquantity || 0;
arr3.push(subObj);
}
woIdString = woIdString.slice(0, -1);
}
item.woIdString = woIdString;
arr3.push({
value:
item.planQuantity - sunNum > 0 ? item.planQuantity - sunNum : 0,
name: '未生产',
color: '#F5F5F5',
});
obj.sunNum = sunNum;
obj.order = arr3;
arr2.push(obj);
});
this.chartList = arr2;
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart();
});
}
} else {
//
this.chartList = [];
}
console.log(arr);
this.list = arr;
});
},
//
buttonClick(val) {
this.queryParams.name = val.name;
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.deliveTime[0] = val.timeVal[0] + ' 00:00:00';
this.queryParams.deliveTime[1] = val.timeVal[1] + ' 23:59:59';
} else {
this.queryParams.deliveTime = [];
}
this.getPage();
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'orderDetail':
if (val.data.orderType === '集团订单') {
this.$router.push({
//
path:
'/order/base/order-manage/order-detail-data?orderIdString=' +
val.data.orderIds.join(','),
});
} else {
this.$router.push({
//
path:
'/core/core-work-order-detail?woIdString=' +
val.data.woIdString,
});
}
break;
case 'qualityDetail':
this.$router.push({
path:
'/quality/base/quality-inspection-data/detection-information/statistical-data?woIdString=' +
val.data.woIdString,
});
break;
default:
// this.$router.push({
// path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name)
// })
}
},
toggleTab() {
if (this.activeName === 'barChart' && this.chartList.length > 0) {
this.$nextTick(() => {
this.$refs.monitoringRingCharts.initChart();
});
}
},
},
};
</script>
<style lang='scss'>
.orderMonitoring {
.el-tabs__nav::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: #e4e7ed;
}
.el-tabs__nav::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: #e4e7ed;
}
.el-tabs__nav-wrap::after {
width: 0;
}
.el-tabs__nav-wrap::after {
width: 0;
}
.el-tabs__item {
padding: 0 10px;
}
.el-tabs__item {
padding: 0 10px;
}
.el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item:hover {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item.is-active {
color: rgba(0, 0, 0, 0.85);
}
.el-tabs__item {
color: rgba(0, 0, 0, 0.45);
}
.el-tabs__item {
color: rgba(0, 0, 0, 0.45);
}
.searchBarBox {
margin-bottom: 0;
}
.searchBarBox {
margin-bottom: 0;
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin: 0 10px 16px 0;
}
.boxTitle {
display: inline-block;
font-size: 16px;
font-weight: 400;
color: #000000;
margin: 0 10px 16px 0;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
.blueTitle {
content: '';
display: inline-block;
width: 4px;
height: 18px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
vertical-align: bottom;
}
}
</style>

View File

@ -135,7 +135,7 @@ export default {
width: 250
},
{
type: 'button',
type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',
@ -144,7 +144,7 @@ export default {
type: 'separate',
},
{
type: this.$auth.hasPermi('base:quality-scrap-det:create') ? 'button' : '',
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',

View File

@ -131,7 +131,7 @@ export default {
// width: 350,
},
{
type: this.$auth.hasPermi(' base: quality - isra - statistics: query') ? 'button' : '',
type: this.$auth.hasPermi('base:quality-isra-statistics:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',
@ -207,15 +207,16 @@ export default {
}).then((res) => {
let mapArr= []
let mapLegendData = []
let obj = {
name: '',
type: 'line',
// stack: 'Total',
data: [],
mapXAxisData: [],
}
// let mapXAxisData = []
for (let i in res.data) {
let obj = {
name: '',
type: 'line',
// stack: 'Total',
data: [],
mapXAxisData:[],
}
// console.log(i)
let dataArr = []
res.data[i].forEach(ele => {
@ -227,6 +228,7 @@ export default {
mapLegendData.push(i)
mapArr.push(obj)
}
console.log(mapArr);
// console.log(res.data[res]);
var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
var myChart = echarts.init(chartDom);
@ -267,6 +269,7 @@ export default {
},
series: mapArr
}
myChart.clear()
option && myChart.setOption(option);
})
this.$axios({
@ -374,6 +377,7 @@ export default {
}
]
}
myChart.clear()
option && myChart.setOption(option);
})
},

View File

@ -119,7 +119,7 @@ export default {
// filterable: true
// },
{
type: 'button',
type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -218,7 +218,11 @@ export default {
width: 350,
},
{
type: 'button',
type: this.$auth.hasPermi(
'monitoring:device-parameters:query'
)
? 'button'
: '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -260,17 +260,24 @@ export default {
// ],
// },
{
type: 'button',
type: this.$auth.hasPermi(
'monitoring:equipment-traceability:query'
)
? 'button'
: '',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'button',
type: this.$auth.hasPermi(
'monitoring:equipment-traceability:export'
)
? 'button'
: '',
btnName: '导出',
name: 'export',
color: 'warning',
},
// {
// type: 'separate',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-03-29 14:08:18
* @LastEditTime: 2024-04-07 16:19:18
* @Description:
-->
<template>
@ -84,21 +84,21 @@ export default {
// },
tableProps,
// tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi(`base:packaging-print-log:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi(`base:packaging-print-log:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
// tableBtn: [
// this.$auth.hasPermi(`base:packaging-print-log:update`)
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi(`base:packaging-print-log:delete`)
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
].filter((v) => v),
// ].filter((v) => v),
list: [],
listQuery: {
pageSize: 10,
@ -131,7 +131,7 @@ export default {
width: 250
},
{
type: 'button',
type: this.$auth.hasPermi('monitoring:materiel-date-from:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-03-29 14:08:30
* @LastEditTime: 2024-04-07 16:25:19
* @Description:
-->
<template>
@ -147,7 +147,8 @@ export default {
// width: 250
// },
{
type: 'button',
type: this.$auth.hasPermi('monitoring:rawMaterial-traceability:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-03-29 15:32:33
* @LastEditTime: 2024-04-07 16:26:56
* @Description:
-->
<template>
@ -135,7 +135,12 @@ export default {
width: 250
},
{
type: 'button',
type: this.$auth.hasPermi(
'monitoring:process-traceability:query'
)
? 'button'
: '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -159,7 +159,11 @@ export default {
// width: 350,
},
{
type: 'button',
type: this.$auth.hasPermi(
'base:quality-inspection-record:query'
)
? 'button'
: '',
btnName: '查询',
name: 'search',
color: 'primary',

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-03-27 09:27:23
* @LastEditTime: 2024-04-08 11:47:39
* @LastEditors: zhp
* @Description:
-->
@ -18,8 +18,8 @@
<el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-day:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>

View File

@ -9,8 +9,8 @@
<el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>

View File

@ -16,8 +16,8 @@
<el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-weekly:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>

View File

@ -11,8 +11,8 @@
<el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-year:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-29 09:48:32
* @LastEditTime: 2024-04-08 11:45:52
* @LastEditors: zhp
* @Description:
-->
@ -12,8 +12,9 @@
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
</el-button>
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
@ -28,122 +29,122 @@
<el-table-column :label="'许昌安彩月成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
null
}} </span>
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
null
}} </span>
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
0 :
null
}} </span>
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="本月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上月" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>

View File

@ -14,9 +14,9 @@
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
<!-- <el-button type="primary" @click="getDataList()">查询</el-button> -->
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
</el-button>
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
@ -31,126 +31,126 @@
<el-table-column :label="'许昌安彩周成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="本周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="上周" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-29 09:48:49
* @LastEditTime: 2024-04-08 11:46:49
* @LastEditors: zhp
* @Description:
-->
@ -14,8 +14,9 @@
style="width: 350px" placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
</el-button>
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
@ -33,126 +34,126 @@
<el-table-column :label="'许昌安彩年成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineId" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="missCheckHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassHis" label="去年" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>

View File

@ -1,185 +1,188 @@
<template>
<div class="app-container vocHis">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:row-class-name="tableRowClassName"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
<div class="app-container vocHis">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:row-class-name="tableRowClassName" />
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</template>
<script>
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
import moment from 'moment'
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi';
import {
environmentalCheckRecordPage,
environmentalCheckRecordExport,
environmentalCheckPage,
} from '@/api/safetyEnvironmental/environmental';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'checkName',
label: '指标名称'
},
{
prop: 'checkValue',
label: '检测数值'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val]
},
{
prop: 'recordPerson',
label: '录入人'
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160
}
]
{
prop: 'checkName',
label: '指标名称',
},
{
prop: 'checkValue',
label: '检测数值',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit'),
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val],
},
{
prop: 'recordPerson',
label: '录入人',
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160,
},
];
export default {
name: 'VocDetectionHistory',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 3,
startTime: null,
endTime: null
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260)
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = start
this.queryParams.endTime = end
this.getSelectList()
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
if (val.btnName === 'search') {
this.getList()
} else {
this.$modal.confirm('是否确认导出').then(() => {
return environmentalCheckRecordExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {})
}
},
getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 3
}).then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data.list || []
})
},
tableRowClassName({row, rowIndex}) {
console.log(row)
if (row.markRed) {
return 'warning-row'
}else {
return ''
}
}
}
}
name: 'VocDetectionHistory',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 3,
startTime: null,
endTime: null,
},
tableProps,
list: [],
total: 0,
};
},
created() {
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
this.formConfig[1].defaultSelect = [start, end];
this.queryParams.startTime = start;
this.queryParams.endTime = end;
this.getSelectList();
this.getList();
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId;
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
if (val.btnName === 'search') {
this.getList();
} else {
this.$modal
.confirm('是否确认导出')
.then(() => {
return environmentalCheckRecordExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '废水检测历史记录.xls');
})
.catch(() => {});
}
},
getList() {
environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 3,
}).then((res) => {
console.log(res);
this.formConfig[0].selectOptions = res.data.list || [];
});
},
tableRowClassName({ row, rowIndex }) {
console.log(row);
if (row.markRed) {
return 'warning-row';
} else {
return '';
}
},
},
};
</script>
<style lang='scss'>
.vocHis {
.el-table .warning-row {
background: #fee1e1;
}
.el-table .warning-row {
background: #fee1e1;
}
}
</style>

View File

@ -1,205 +1,210 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<voc-add ref="vocAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="60%">
<voc-add
ref="vocAdd"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import VocAdd from './components/vocAdd'
import { publicFormatter } from '@/utils/dict'
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
import { parseTime } from '@/utils/ruoyi';
import VocAdd from './components/vocAdd';
import { publicFormatter } from '@/utils/dict';
import {
environmentalCheckPage,
environmentalCheckDelete,
} from '@/api/safetyEnvironmental/environmental';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指标编码',
minWidth: 120
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'minValue',
label: '最小值'
},
{
prop: 'maxValue',
label: '最大值'
},
{
prop: 'creator',
label: '创建人'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '指标编码',
minWidth: 120,
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit'),
},
{
prop: 'minValue',
label: '最小值',
},
{
prop: 'maxValue',
label: '最大值',
},
{
prop: 'creator',
label: '创建人',
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160,
},
];
export default {
name: 'VocDetectionIndication',
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 3,
name: null
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:voc:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:voc:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
addOrEditTitle: '',
centervisible: false
}
},
components: { VocAdd },
mounted() {
this.getList()
},
methods: {
getList() {
environmentalCheckPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.vocAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.vocAdd.init(val.data.id)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return environmentalCheckDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.vocAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.vocAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
name: 'VocDetectionIndication',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 3,
name: null,
},
total: 0,
tableProps,
list: [],
tableBtn: [
this.$auth.hasPermi('base:voc:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:voc:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
};
},
components: { VocAdd },
mounted() {
this.getList();
},
methods: {
getList() {
environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.queryParams.name = val.name;
this.getList();
} else {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.vocAdd.init();
});
}
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.vocAdd.init(val.data.id);
});
break;
default:
this.handleDelete(val.data);
}
},
//
handleDelete(val) {
this.$modal
.confirm('是否确认删除"' + val.name + '"的数据项?')
.then(function () {
return environmentalCheckDelete({ id: val.id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
},
//
handleCancel() {
this.$refs.vocAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.vocAdd.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
},
};
</script>

View File

@ -1,185 +1,188 @@
<template>
<div class="app-container wasteGasHis">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:row-class-name="tableRowClassName"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
<div class="app-container wasteGasHis">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:row-class-name="tableRowClassName" />
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</template>
<script>
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
import moment from 'moment'
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi';
import {
environmentalCheckRecordPage,
environmentalCheckRecordExport,
environmentalCheckPage,
} from '@/api/safetyEnvironmental/environmental';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'checkName',
label: '指标名称'
},
{
prop: 'checkValue',
label: '检测数值'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val]
},
{
prop: 'recordPerson',
label: '录入人'
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160
}
]
{
prop: 'checkName',
label: '指标名称',
},
{
prop: 'checkValue',
label: '检测数值',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit'),
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val],
},
{
prop: 'recordPerson',
label: '录入人',
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160,
},
];
export default {
name: 'WasteGasDetectionHistory',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 2,
startTime: null,
endTime: null
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260)
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = start
this.queryParams.endTime = end
this.getSelectList()
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
if (val.btnName === 'search') {
this.getList()
} else {
this.$modal.confirm('是否确认导出').then(() => {
return environmentalCheckRecordExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '废气检测历史记录.xls');
}).catch(() => {})
}
},
getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 2
}).then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data.list || []
})
},
tableRowClassName({row, rowIndex}) {
console.log(row)
if (row.markRed) {
return 'warning-row'
}else {
return ''
}
}
}
}
name: 'WasteGasDetectionHistory',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 2,
startTime: null,
endTime: null,
},
tableProps,
list: [],
total: 0,
};
},
created() {
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
this.formConfig[1].defaultSelect = [start, end];
this.queryParams.startTime = start;
this.queryParams.endTime = end;
this.getSelectList();
this.getList();
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId;
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
if (val.btnName === 'search') {
this.getList();
} else {
this.$modal
.confirm('是否确认导出')
.then(() => {
return environmentalCheckRecordExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '废气检测历史记录.xls');
})
.catch(() => {});
}
},
getList() {
environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 2,
}).then((res) => {
console.log(res);
this.formConfig[0].selectOptions = res.data.list || [];
});
},
tableRowClassName({ row, rowIndex }) {
console.log(row);
if (row.markRed) {
return 'warning-row';
} else {
return '';
}
},
},
};
</script>
<style lang='scss'>
.wasteGasHis {
.el-table .warning-row {
background: #fee1e1;
}
.el-table .warning-row {
background: #fee1e1;
}
}
</style>

View File

@ -1,205 +1,210 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<waste-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="60%">
<waste-gas-add
ref="wasteGasAdd"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import WasteGasAdd from './components/wasteGasAdd'
import { publicFormatter } from '@/utils/dict'
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
import { parseTime } from '@/utils/ruoyi';
import WasteGasAdd from './components/wasteGasAdd';
import { publicFormatter } from '@/utils/dict';
import {
environmentalCheckPage,
environmentalCheckDelete,
} from '@/api/safetyEnvironmental/environmental';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指标编码',
minWidth: 120
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'minValue',
label: '最小值'
},
{
prop: 'maxValue',
label: '最大值'
},
{
prop: 'creator',
label: '创建人'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '指标编码',
minWidth: 120,
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit'),
},
{
prop: 'minValue',
label: '最小值',
},
{
prop: 'maxValue',
label: '最大值',
},
{
prop: 'creator',
label: '创建人',
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160,
},
];
export default {
name: 'WasteGasDetectionIndication',
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 2,
name: null
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:waste-gas:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:waste-gas:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
addOrEditTitle: '',
centervisible: false
}
},
components: { WasteGasAdd },
mounted() {
this.getList()
},
methods: {
getList() {
environmentalCheckPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteGasAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteGasAdd.init(val.data.id)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return environmentalCheckDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.wasteGasAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.wasteGasAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
name: 'WasteGasDetectionIndication',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 2,
name: null,
},
total: 0,
tableProps,
list: [],
tableBtn: [
this.$auth.hasPermi('base:waste-gas:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:waste-gas:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
};
},
components: { WasteGasAdd },
mounted() {
this.getList();
},
methods: {
getList() {
environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.queryParams.name = val.name;
this.getList();
} else {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.wasteGasAdd.init();
});
}
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.wasteGasAdd.init(val.data.id);
});
break;
default:
this.handleDelete(val.data);
}
},
//
handleDelete(val) {
this.$modal
.confirm('是否确认删除"' + val.name + '"的数据项?')
.then(function () {
return environmentalCheckDelete({ id: val.id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
},
//
handleCancel() {
this.$refs.wasteGasAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.wasteGasAdd.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
},
};
</script>

View File

@ -1,185 +1,190 @@
<template>
<div class="app-container wasteWaterHis">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:row-class-name="tableRowClassName"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div>
<div class="app-container wasteWaterHis">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
:row-class-name="tableRowClassName" />
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
</div>
</template>
<script>
import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
import moment from 'moment'
import { publicFormatter } from '@/utils/dict';
import { parseTime } from '@/utils/ruoyi';
import {
environmentalCheckRecordPage,
environmentalCheckRecordExport,
environmentalCheckPage,
} from '@/api/safetyEnvironmental/environmental';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'checkName',
label: '指标名称'
},
{
prop: 'checkValue',
label: '检测数值'
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val]
},
{
prop: 'recordPerson',
label: '录入人'
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160
}
]
{
prop: 'checkName',
label: '指标名称',
},
{
prop: 'checkValue',
label: '检测数值',
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit'),
},
{
prop: 'checkTime',
label: '检测时间',
filter: parseTime,
minWidth: 160,
},
{
prop: 'origin',
label: '来源',
filter: (val) => ['手动', '自动'][val],
},
{
prop: 'recordPerson',
label: '录入人',
},
{
prop: 'recordTime',
label: '录入时间',
filter: parseTime,
minWidth: 160,
},
];
export default {
name: 'WasteWaterDetectionHistory',
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true
},
{
type: 'datePicker',
label: '检测时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "timestamp",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 1,
startTime: null,
endTime: null
},
tableProps,
list: [],
total: 0,
tableH: this.tableHeight(260)
}
},
created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
this.formConfig[1].defaultSelect = [start, end]
this.queryParams.startTime = start
this.queryParams.endTime = end
this.getSelectList()
this.getList()
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
if (val.btnName === 'search') {
this.getList()
} else {
this.$modal.confirm('是否确认导出').then(() => {
return environmentalCheckRecordExport({...this.queryParams});
}).then(response => {
this.$download.excel(response, '废水检测历史记录.xls');
}).catch(() => {})
}
},
getList() {
environmentalCheckRecordPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 1
}).then(res => {
console.log(res)
this.formConfig[0].selectOptions = res.data.list || []
})
},
tableRowClassName({row, rowIndex}) {
console.log(row)
if (row.markRed) {
return 'warning-row'
}else {
return ''
}
}
}
}
name: 'WasteWaterDetectionHistory',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'select',
label: '指标名称',
selectOptions: [],
param: 'checkId',
filterable: true,
},
{
type: 'datePicker',
label: '检测时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:waste-water:export')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkId: null,
checkType: 1,
startTime: null,
endTime: null,
},
tableProps,
list: [],
total: 0,
};
},
created() {
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
this.formConfig[1].defaultSelect = [start, end];
this.queryParams.startTime = start;
this.queryParams.endTime = end;
this.getSelectList();
this.getList();
},
methods: {
buttonClick(val) {
this.queryParams.pageNo = 1;
this.queryParams.checkId = val.checkId;
this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
if (val.btnName === 'search') {
this.getList();
} else {
this.$modal
.confirm('是否确认导出')
.then(() => {
return environmentalCheckRecordExport({ ...this.queryParams });
})
.then((response) => {
this.$download.excel(response, '废水检测历史记录.xls');
})
.catch(() => {});
}
},
getList() {
environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
getSelectList() {
environmentalCheckPage({
pageNo: 1,
pageSize: 100,
checkType: 1,
}).then((res) => {
console.log(res);
this.formConfig[0].selectOptions = res.data.list || [];
});
},
tableRowClassName({ row, rowIndex }) {
console.log(row);
if (row.markRed) {
return 'warning-row';
} else {
return '';
}
},
},
};
</script>
<style lang='scss'>
.wasteWaterHis {
.el-table .warning-row {
background: #fee1e1;
}
.el-table .warning-row {
background: #fee1e1;
}
}
</style>

View File

@ -1,205 +1,212 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width='60%'
>
<waste-water-add ref="wasteWaterAdd" @successSubmit="successSubmit" />
</base-dialog>
</div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 新增&编辑 -->
<base-dialog
:dialogTitle="addOrEditTitle"
:dialogVisible="centervisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="60%">
<waste-water-add
ref="wasteWaterAdd"
@successSubmit="successSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import WasteWaterAdd from './components/wasteWaterAdd'
import { publicFormatter } from '@/utils/dict'
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
import { parseTime } from '@/utils/ruoyi';
import WasteWaterAdd from './components/wasteWaterAdd';
import { publicFormatter } from '@/utils/dict';
import {
environmentalCheckPage,
environmentalCheckDelete,
} from '@/api/safetyEnvironmental/environmental';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true
},
{
prop: 'code',
label: '指标编码',
minWidth: 120
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit')
},
{
prop: 'minValue',
label: '最小值'
},
{
prop: 'maxValue',
label: '最大值'
},
{
prop: 'creator',
label: '创建人'
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160
}
]
{
prop: 'name',
label: '指标名称',
minWidth: 120,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '指标编码',
minWidth: 120,
},
{
prop: 'unit',
label: '单位',
filter: publicFormatter('environment_check_unit'),
},
{
prop: 'minValue',
label: '最小值',
},
{
prop: 'maxValue',
label: '最大值',
},
{
prop: 'creator',
label: '创建人',
},
{
prop: 'createTime',
label: '创建时间',
filter: parseTime,
minWidth: 160,
},
];
export default {
name: 'WasteWaterDetectionIndication',
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name'
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
},
{
type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true
}
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 1,
name: null
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:waste-water:update')
? {
type: 'edit',
btnName: '编辑'
}
: undefined,
this.$auth.hasPermi('base:waste-water:delete')
? {
type: 'delete',
btnName: '删除'
}
: undefined
].filter((v)=>v),
addOrEditTitle: '',
centervisible: false
}
},
components: { WasteWaterAdd },
mounted() {
this.getList()
},
methods: {
getList() {
environmentalCheckPage({...this.queryParams}).then(res => {
this.list = res.data.list || []
this.total = res.data.total || 0
})
},
buttonClick(val) {
console.log(val)
if (val.btnName === 'search') {
this.queryParams.name = val.name
this.getList()
} else {
this.addOrEditTitle = '新增'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteWaterAdd.init()
})
}
},
handleClick(val) {
console.log(val)
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑'
this.centervisible = true
this.$nextTick(() => {
this.$refs.wasteWaterAdd.init(val.data.id)
})
break
default:
this.handleDelete(val.data)
}
},
//
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return environmentalCheckDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
//
handleCancel() {
this.$refs.wasteWaterAdd.formClear()
this.centervisible = false
this.addOrEditTitle = ''
},
handleConfirm() {
this.$refs.wasteWaterAdd.submitForm()
},
successSubmit() {
this.handleCancel()
this.getList()
}
}
}
name: 'WasteWaterDetectionIndication',
mixins: [tableHeightMixin],
data() {
return {
formConfig: [
{
type: 'input',
label: '指标名称',
placeholder: '指标名称',
param: 'name',
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('base:waste-water:create')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
plain: true,
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
checkType: 1,
name: null,
},
total: 0,
tableProps,
list: [],
tableBtn: [
this.$auth.hasPermi('base:waste-water:update')
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
this.$auth.hasPermi('base:waste-water:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
addOrEditTitle: '',
centervisible: false,
};
},
components: { WasteWaterAdd },
mounted() {
this.getList();
},
methods: {
getList() {
environmentalCheckPage({ ...this.queryParams }).then((res) => {
this.list = res.data.list || [];
this.total = res.data.total || 0;
});
},
buttonClick(val) {
console.log(val);
if (val.btnName === 'search') {
this.queryParams.name = val.name;
this.getList();
} else {
this.addOrEditTitle = '新增';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.wasteWaterAdd.init();
});
}
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.addOrEditTitle = '编辑';
this.centervisible = true;
this.$nextTick(() => {
this.$refs.wasteWaterAdd.init(val.data.id);
});
break;
default:
this.handleDelete(val.data);
}
},
//
handleDelete(val) {
this.$modal
.confirm('是否确认删除"' + val.name + '"的数据项?')
.then(function () {
return environmentalCheckDelete({ id: val.id });
})
.then(() => {
this.getList();
this.$modal.msgSuccess('操作成功');
})
.catch(() => {});
},
//
handleCancel() {
this.$refs.wasteWaterAdd.formClear();
this.centervisible = false;
this.addOrEditTitle = '';
},
handleConfirm() {
this.$refs.wasteWaterAdd.submitForm();
},
successSubmit() {
this.handleCancel();
this.getList();
},
},
};
</script>