Compare commits
65 Commits
dad71db912
...
projects/m
| Author | SHA1 | Date | |
|---|---|---|---|
| d3d93acd0f | |||
| a4fceeb981 | |||
| 84468cc883 | |||
| ea04d55fc1 | |||
| ef1078360a | |||
| 60f6c3a8fe | |||
| a4b340ac5d | |||
|
|
2592551e66 | ||
|
|
1fde96e677 | ||
| 0b16e1fe0d | |||
| abcec3bcdc | |||
| bdd14eec70 | |||
| 44e7e219a4 | |||
|
|
ec51beb8ea | ||
|
|
433618e71d | ||
| 812b72f10d | |||
|
|
05f10ab51d | ||
|
|
e7828fd277 | ||
| 58457487d1 | |||
|
|
6c54c223c5 | ||
|
|
b2cc509f8e | ||
| b6236e89b1 | |||
| cbc7cbc574 | |||
| b5b952e1cc | |||
| 33ed9f15fa | |||
| c85c6e4323 | |||
| 30d22b34e1 | |||
| 3d3fa2ccee | |||
| f960ece594 | |||
| 949675b3a2 | |||
| f52815abe6 | |||
|
|
ac4cea0c7e | ||
|
|
93fea84c79 | ||
| a06682de3f | |||
| e1773dae03 | |||
| f6d866907c | |||
| 7fe8d7e72c | |||
| 1e4a33a703 | |||
| d1ad913bab | |||
|
|
38edf00925 | ||
|
|
bf231f7157 | ||
| 04e2471a54 | |||
|
|
9e2ce5f636 | ||
|
|
8a54c046d9 | ||
| 3fa702cc12 | |||
| 8ebff703ee | |||
|
|
02e267e647 | ||
|
|
a6ffba4cf8 | ||
| 3de4d5c5f2 | |||
| c6c2d1c3b1 | |||
|
|
1bbd749094 | ||
|
|
073b4b8e20 | ||
| 3ec82a6a41 | |||
| 7c83268e0c | |||
| 49cb1e6877 | |||
|
|
481dde003a | ||
|
|
43e54e8ee7 | ||
| 28dbe075a4 | |||
|
|
4571786780 | ||
|
|
21cef13168 | ||
| 5f5e0ffc69 | |||
| 4d0841bd32 | |||
| b6d3b17300 | |||
|
|
34aeb029b5 | ||
|
|
caf614ca35 |
14
.env.dev
14
.env.dev
@@ -1,8 +1,8 @@
|
||||
###
|
||||
# @Author: Do not edit
|
||||
# @Date: 2023-08-29 09:40:39
|
||||
# @LastEditTime: 2024-04-01 08:31:57
|
||||
# @LastEditors: zhp
|
||||
# @LastEditTime: 2024-04-08 16:46:49
|
||||
# @LastEditors: DY
|
||||
# @Description:
|
||||
###
|
||||
# 开发环境配置
|
||||
@@ -18,15 +18,17 @@ VUE_APP_TITLE = MES系统
|
||||
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.4.173:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.4.173:9001'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
|
||||
# VUE_APP_BASE_API = 'http://192.168.1.47:48082'
|
||||
# socket地址
|
||||
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
||||
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||
# VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
||||
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
|
||||
VUE_APP_Socket_Dcs_API = 'ws://192.168.0.33:8080'
|
||||
|
||||
# 积木报表指向地址
|
||||
VUE_APP_JIMU_API = 'http://10.70.2.22:8080'
|
||||
|
||||
@@ -53,4 +53,28 @@ export function energyQuantityManualExport(data) {
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
// 获得能源表名配置分页
|
||||
export function energyTablePage(data) {
|
||||
return request({
|
||||
url: '/base/energy-table/page',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 获得能源表名配置
|
||||
export function energyTableGet(query) {
|
||||
return request({
|
||||
url: '/base/energy-table/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 更新能源表名配置
|
||||
export function energyTableUpdate(data) {
|
||||
return request({
|
||||
url: '/base/energy-table/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -5,6 +5,7 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||
window.addEventListener('resize', this._setTableHeight);
|
||||
},
|
||||
destroyed() {
|
||||
@@ -12,7 +13,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
_setTableHeight() {
|
||||
this.tableH = this.tableHeight(260);
|
||||
this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260);
|
||||
// this.tableH = this.tableHeight(260);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -32,6 +32,7 @@ const actions = {
|
||||
}
|
||||
// 处理 dictValue 层级
|
||||
dictDataMap[dictData.dictType].push({
|
||||
id: dictData.id,
|
||||
value: dictData.value,
|
||||
label: dictData.label,
|
||||
colorType: dictData.colorType,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-29 16:49:00
|
||||
* @LastEditTime: 2024-04-03 10:54:53
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -34,7 +34,7 @@
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :beilv="1" :size="'eqStatus'" :title="'周转进度'" :title-icon="'order'" :back="'energy'">
|
||||
<div class="order" style="width:100%; overflow: hidden scroll;height: 350px;">
|
||||
<el-row v-for="op in orderProcessList" :key="op.id" style="margin-bottom: 1em">
|
||||
<el-row v-for="op in orderProcessList" :key="op.id" style="margin-bottom: .5em">
|
||||
<!-- <p v-if="op.outRate === 1" class="now-secondary-title"
|
||||
style="font-size: 14px; opacity: calc(.6);color:#4679FD">
|
||||
<i class="el-icon-check" />
|
||||
@@ -42,7 +42,7 @@
|
||||
</p> -->
|
||||
<!-- <p class="now-secondary-title">{{ op.name }}</p> -->
|
||||
<p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p>
|
||||
<el-progress style="width: 910px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
|
||||
<el-progress style="width: 935px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
|
||||
define-back-color="rgba(32, 57, 96, 1)" :percentage="op.outRate * 100" class="custom-progress-bar" />
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -606,8 +606,10 @@ export default {
|
||||
background-image: linear-gradient(to right, #4573fe, #47f8dc);
|
||||
}
|
||||
::v-deep .el-progress__text {
|
||||
width: 50px;
|
||||
margin-top: -70px;
|
||||
margin-left: 820px;
|
||||
margin-left: 834px;
|
||||
text-align: right;
|
||||
// background-color: unset;
|
||||
// background-image: linear-gradient(to right, #4573fe, #47f8dc);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2024-01-29 16:50:26
|
||||
* @LastEditTime: 2024-04-02 15:01:40
|
||||
* @LastEditTime: 2024-04-07 16:05:59
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -41,10 +41,11 @@
|
||||
</div> -->
|
||||
<!-- 像下面这样表格里的limit值,也许可以用js动态计算出来 -->
|
||||
<div v-if="coldDetData" class="myLegend">
|
||||
<div class=" barCircleLegend"></div>
|
||||
<div class=" barCircle"></div>
|
||||
<h4 class="barText">产线良品率</h4>
|
||||
<div class="barLegend"></div>
|
||||
<h4 class="barText">产线产量</h4>
|
||||
<div class="barCircle"></div>
|
||||
<h4 class="barCircleText">产线良品率</h4>
|
||||
<h4 class="barCircleText">产线产量</h4>
|
||||
</div>
|
||||
<double-y-chart ref="productChart" :id="'doubleYChart'" :name-list="cxNameList" :data-list="cxDataList"
|
||||
:height="359" :show-legend="true" />
|
||||
@@ -309,6 +310,7 @@ export default {
|
||||
window.location.reload()
|
||||
}, 86400000)
|
||||
// this.getData()
|
||||
// this.getReaiData()
|
||||
},
|
||||
destroyed() {
|
||||
this.CutWebsocketClose()
|
||||
@@ -410,13 +412,13 @@ export default {
|
||||
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡')
|
||||
productList.push(ele.productArea)
|
||||
wasteList.push(ele.wastArea)
|
||||
nameWasteList.push('缺陷面积:' + ele.wastArea + '㎡')
|
||||
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
|
||||
// yieldList.push({
|
||||
// name: '良品',
|
||||
// yield:ele.yield
|
||||
// })
|
||||
sumAreaList.push(ele.sumArea)
|
||||
yieldList.push((ele.yield * 100).toFixed(3))
|
||||
yieldList.push((ele.yield * 100).toFixed(0))
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
|
||||
@@ -427,39 +429,82 @@ export default {
|
||||
this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
|
||||
})
|
||||
},
|
||||
getData() {
|
||||
let detData = [
|
||||
{
|
||||
name: '1',
|
||||
run: '运行',
|
||||
},
|
||||
{
|
||||
name: '2',
|
||||
run: '未运行',
|
||||
},
|
||||
{
|
||||
name: '3',
|
||||
run: '运行',
|
||||
},
|
||||
{
|
||||
name: '4',
|
||||
run: '未运行',
|
||||
},
|
||||
{
|
||||
name: '1',
|
||||
run: '运行',
|
||||
},
|
||||
]
|
||||
this.realEqList = detData.map((item, index) => [
|
||||
// console.log(item)
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.name || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.run == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div> ${item.run || ''}</span>`,
|
||||
])
|
||||
this.realEqConfig.data = this.realEqList
|
||||
this.$refs['realEqScrollBoard'].updateRows(this.realEqList)
|
||||
},
|
||||
// getReaiData() {
|
||||
// let detData = [
|
||||
// {
|
||||
// name: '1',
|
||||
// run: '运行',
|
||||
// },
|
||||
// {
|
||||
// name: '2',
|
||||
// run: '未运行',
|
||||
// },
|
||||
// {
|
||||
// name: '3',
|
||||
// run: '运行',
|
||||
// },
|
||||
// {
|
||||
// name: '4',
|
||||
// run: '未运行',
|
||||
// },
|
||||
// {
|
||||
// name: '1',
|
||||
// run: '运行',
|
||||
// },
|
||||
// ]
|
||||
// let arr = []
|
||||
// let index = 0
|
||||
// for (let i in detData) {
|
||||
// index++,
|
||||
// arr.push([
|
||||
// `<span style="color:rgba(255,255,255,0.5)" >${index || ''}
|
||||
// </span>`,
|
||||
// // `<span style="color:rgba(255,255,255,0.5)" >${i || ''}
|
||||
// // </span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${i || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)"><div style="${detData[i] == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div> ${detData[i] || ''}</span>`,
|
||||
// ])
|
||||
// }
|
||||
// // this.$nextTick(() => {
|
||||
// this.annealFunConfig.data = arr
|
||||
// this.$refs['annealFunScrollBoard'].updateRows(arr)
|
||||
// // })
|
||||
// },
|
||||
// getData() {
|
||||
// let detData = [
|
||||
// {
|
||||
// name: '1',
|
||||
// run: '运行',
|
||||
// },
|
||||
// {
|
||||
// name: '2',
|
||||
// run: '未运行',
|
||||
// },
|
||||
// {
|
||||
// name: '3',
|
||||
// run: '运行',
|
||||
// },
|
||||
// {
|
||||
// name: '4',
|
||||
// run: '未运行',
|
||||
// },
|
||||
// {
|
||||
// name: '1',
|
||||
// run: '运行',
|
||||
// },
|
||||
// ]
|
||||
// this.realEqList = detData.map((item, index) => [
|
||||
// // console.log(item)
|
||||
// `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
// </span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)">${item.name || ''}</span>`,
|
||||
// `<span style="color:rgba(255,255,255,0.5)"><div style="${item.run == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div> ${item.run || ''}</span>`,
|
||||
// ])
|
||||
// // this.$nextTick(() => {
|
||||
// this.realEqConfig.data = this.realEqList
|
||||
// this.$refs['realEqScrollBoard'].updateRows(this.realEqList)
|
||||
// // })
|
||||
// },
|
||||
CutWebsocketClose(e) {
|
||||
this.Cutws.ws.onclose = (event) => { console.log(event );}
|
||||
},
|
||||
@@ -572,16 +617,16 @@ export default {
|
||||
this.cutWsData = event?.data ? JSON.parse(event?.data) : {}
|
||||
if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') {
|
||||
let cutArr = this.cutWsData.productHourData.map((item, index) => [
|
||||
`<span style="color:rgba(255,255,255,0.7)" >${index + 1 || ''}
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)" >${item.lineName || ''}
|
||||
`<span style="color:rgba(255,255,255,0.5)" >${item.lineName || ''}
|
||||
</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${this.formatTime(item.time) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${this.getSize(item.size) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${item.productArea + '㎡' || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.7)">${item.wasteArea + '㎡' || ''}</span>`,
|
||||
`<div style = "${(item.product * 100).toFixed(2) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>
|
||||
<div style = "${(item.product * 100).toFixed(2) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>`
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.formatTime(item.time) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.productArea) + '㎡' || ''}</span>`,
|
||||
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`,
|
||||
`<div style = "${(item.product * 100).toFixed(0) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>
|
||||
<div style = "${(item.product * 100).toFixed(0) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>`
|
||||
])
|
||||
this.cutConfig.data = cutArr
|
||||
// this.$nextTick(() => {
|
||||
@@ -604,16 +649,16 @@ export default {
|
||||
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡')
|
||||
productList.push(ele.productArea)
|
||||
wasteList.push(ele.wastArea)
|
||||
nameWasteList.push('缺陷面积:' + ele.wastArea + '㎡')
|
||||
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
|
||||
sumAreaList.push(ele.sumArea)
|
||||
yieldList.push(parseFloat((ele.yield * 100).toFixed(3)))
|
||||
yieldList.push(parseFloat((ele.yield * 100).toFixed(0)))
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
|
||||
this.$refs.secondPileChart.initChart(nameList, [topNameList[1]], [nameWasteList[1]], [productList[1]], [wasteList[1]])
|
||||
this.$refs.thirdPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
|
||||
this.$refs.fourthPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
|
||||
this.$refs.fifthPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
|
||||
this.$refs.thirdPileChart.initChart(nameList, [topNameList[2]], [nameWasteList[2]], [productList[2]], [wasteList[2]])
|
||||
this.$refs.fourthPileChart.initChart(nameList, [topNameList[3]], [nameWasteList[3]], [productList[3]], [wasteList[3]])
|
||||
this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
|
||||
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
|
||||
})
|
||||
}
|
||||
@@ -700,6 +745,25 @@ export default {
|
||||
// this.funWebsocket.onclose = this.funWebsocketClose
|
||||
// }
|
||||
},
|
||||
NumFormat(value) {
|
||||
if (!value) return '0.00'
|
||||
value = value.toFixed(2)
|
||||
var intPart = Math.trunc(value) // 获取整数部分
|
||||
// var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
|
||||
var floatPart = '.00' // 预定义小数部分
|
||||
var value2Array = value.split('.')
|
||||
// =2表示数据有小数位
|
||||
if (value2Array.length === 2) {
|
||||
floatPart = value2Array[1].toString() // 拿到小数部分
|
||||
if (floatPart.length === 1) {
|
||||
return intPart + '.' + floatPart + '0'
|
||||
} else {
|
||||
return intPart + '.' + floatPart
|
||||
}
|
||||
} else {
|
||||
return intPart + floatPart
|
||||
}
|
||||
},
|
||||
// funWebsocketOnOpen() {
|
||||
// console.log('socket连接成功')
|
||||
// this.SJGWebsocket.onmessage()
|
||||
@@ -797,7 +861,7 @@ export default {
|
||||
.myLegend{
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
right: 50px;
|
||||
right: 20px;
|
||||
font-size: 12px;
|
||||
color: rgba(255,255,255,.6);
|
||||
.barLegend{
|
||||
@@ -807,19 +871,29 @@ export default {
|
||||
height: 10px;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border-radius: 30%;
|
||||
}
|
||||
.barText{
|
||||
// float: right;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.barCircleLegend{
|
||||
width: 15px;
|
||||
height: 1px;
|
||||
background-color: rgba(255, 209, 96, 1);
|
||||
position: absolute;
|
||||
left: -4.1715px;
|
||||
top: 21.7px;
|
||||
}
|
||||
.barCircle{
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(255, 209, 96, 1);
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 1.7px;
|
||||
}
|
||||
.barCircleText{
|
||||
display: inline-block;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-29 14:50:50
|
||||
* @LastEditTime: 2024-04-03 16:33:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -85,7 +85,6 @@ export default {
|
||||
defaultConfig: {
|
||||
// 默认的legend配置
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: '75%',
|
||||
bottom: 0,
|
||||
itemHeight: 10,
|
||||
@@ -197,7 +196,7 @@ export default {
|
||||
// 默认配置
|
||||
...this.defaultConfig.legend,
|
||||
// 外部传入配置
|
||||
...this.legendConfig
|
||||
// ...this.legendConfig
|
||||
},
|
||||
color: this.barColor,
|
||||
series: [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-21 09:06:28
|
||||
* @LastEditTime: 2024-04-01 09:12:56
|
||||
* @LastEditTime: 2024-04-03 16:28:40
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -100,8 +100,9 @@ export default {
|
||||
show: true, //开启显示
|
||||
position: 'top', //在上方显示
|
||||
textStyle: { //数值样式
|
||||
color: '#ced1d5',
|
||||
fontSize: 12
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
fontWight: 'bolder'
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -193,18 +194,19 @@ export default {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
align: 'center',
|
||||
color: 'rgba(255,255,255,0.5)' // 坐标值得具体的颜色
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
},
|
||||
data: nameList
|
||||
@@ -226,6 +228,7 @@ export default {
|
||||
nameTextStyle: {// y轴上方单位的颜色
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
align: "left",
|
||||
padding: [0, 0, 0, 8]
|
||||
},
|
||||
position: 'right',
|
||||
alignTicks: true,
|
||||
@@ -233,19 +236,20 @@ export default {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#ced1d5', // 坐标值得具体的颜色
|
||||
formatter: '{value}%'
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
formatter: '{value}%',
|
||||
align:'left',
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
}
|
||||
// type: 'value'
|
||||
@@ -270,6 +274,7 @@ export default {
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
// fontSize: 10,
|
||||
align: "right",
|
||||
padding:[0,4,0,0]
|
||||
},
|
||||
position: 'left',
|
||||
alignTicks: true,
|
||||
@@ -277,19 +282,21 @@ export default {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'solid',
|
||||
color: '#213259', // 左边线的颜色
|
||||
color: '#25528f', // 左边线的颜色
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
// padding: [0, 20, 0, 0],
|
||||
textStyle: {
|
||||
margin: 60,
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
formatter: '{value} 片'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: '#213259'
|
||||
color: '#25528f'
|
||||
}
|
||||
}
|
||||
// type: 'value'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-21 09:06:28
|
||||
* @LastEditTime: 2024-03-29 16:26:28
|
||||
* @LastEditTime: 2024-04-03 17:09:12
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
show: true, //开启显示
|
||||
position: 'top', //在上方显示
|
||||
textStyle: { //数值样式
|
||||
color: '#ced1d5',
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
fontWight:'bolder'
|
||||
}
|
||||
@@ -167,19 +167,19 @@ export default {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
grid: { top: 90, right: 70, bottom: 20, left: 20, containLabel: true },
|
||||
legend: {
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
top: '0%',
|
||||
right: '20px',
|
||||
data: ['产线良品率', '产线产量'],
|
||||
textStyle: {
|
||||
fontSize: 12 * this.beilv,
|
||||
color: '#ced1d5',
|
||||
fontWight: 'bolder'
|
||||
}
|
||||
},
|
||||
grid: { top: 70, right: 20, bottom: 10, left: 10, containLabel: true },
|
||||
// legend: {
|
||||
// itemWidth: 10,
|
||||
// itemHeight: 10,
|
||||
// top: '2%',
|
||||
// right: '30px',
|
||||
// data: ['产线良品率', '产线产量'],
|
||||
// textStyle: {
|
||||
// fontSize: 12 * this.beilv,
|
||||
// color: '#ced1d5',
|
||||
// fontWight: 'bolder'
|
||||
// }
|
||||
// },
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: false
|
||||
@@ -227,6 +227,7 @@ export default {
|
||||
nameTextStyle: {// y轴上方单位的颜色
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
align: "left",
|
||||
padding: [0, 0, 0, 2]
|
||||
},
|
||||
position: 'right',
|
||||
alignTicks: true,
|
||||
@@ -271,6 +272,7 @@ export default {
|
||||
nameTextStyle: {
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
// fontSize: 10,
|
||||
padding: [0, 4, 0, 0],
|
||||
align: "right",
|
||||
},
|
||||
// position: 'left',
|
||||
|
||||
@@ -113,7 +113,7 @@ export default {
|
||||
textStyle: { //数值样式
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
fontWeight: 'bolder'
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export default {
|
||||
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
|
||||
}
|
||||
},
|
||||
grid: { top: 90, right: 60, bottom: 20, left: 30, containLabel: true },
|
||||
grid: { top: 70, right: 40, bottom: 10, left: 40, containLabel: true },
|
||||
// legend: {
|
||||
// itemWidth: 10,
|
||||
// itemHeight: 10,
|
||||
@@ -175,7 +175,7 @@ export default {
|
||||
name: '单位kwh',
|
||||
nameTextStyle: {
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 10,
|
||||
fontSize: 12,
|
||||
align: 'right',
|
||||
},
|
||||
type: 'value',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-27 13:54:52
|
||||
* @LastEditTime: 2024-04-01 09:14:45
|
||||
* @LastEditTime: 2024-04-03 18:12:18
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -114,6 +114,10 @@ export default {
|
||||
totalData.push(sum);
|
||||
}
|
||||
// }
|
||||
// rawData[1].map((d, did) =>
|
||||
// console.log((d / totalData[did]).toFixed(3))
|
||||
// // totalData[did] <= 0 ? 0 : d / totalData[did]
|
||||
// )
|
||||
console.log('total', totalData)
|
||||
const series = [
|
||||
'良品',
|
||||
@@ -134,7 +138,7 @@ export default {
|
||||
// },
|
||||
color:colors[sid],
|
||||
data: rawData.length != 0 ? rawData[sid].map((d, did) =>
|
||||
totalData[did] <= 0 ? 0 : d / totalData[did]
|
||||
totalData[did] <= 0 ? 0 : (d / totalData[did]).toFixed(4)
|
||||
) : []
|
||||
};
|
||||
});
|
||||
@@ -163,15 +167,15 @@ export default {
|
||||
let singleData = series.filter(function (item) {
|
||||
return item.name == name
|
||||
})
|
||||
return name + parseFloat((singleData[0].data * 100).toFixed(3)) + '%'
|
||||
return name + parseFloat((singleData[0].data * 100).toFixed(0)) + '%'
|
||||
},
|
||||
itemWidth: 12,
|
||||
itemHeight: 12,
|
||||
bottom: '20',
|
||||
left: '20',
|
||||
icon: 'rect',
|
||||
icon: 'roundRect',
|
||||
textStyle: {
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
color: 'rgba(255,255,255,.9)',
|
||||
fontSize:12,
|
||||
}
|
||||
},
|
||||
@@ -204,7 +208,7 @@ export default {
|
||||
splitNumber: 50,
|
||||
// boundaryGap: [20, 20],
|
||||
textStyle: {
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
color: 'rgba(255,255,255,.9)',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 16,
|
||||
align: 'left',
|
||||
@@ -232,7 +236,7 @@ export default {
|
||||
splitNumber: 50,
|
||||
// boundaryGap: [20, 20],
|
||||
textStyle: {
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
color: 'rgba(255,255,255,.9)',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 16,
|
||||
align: 'right',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-07-19 15:18:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-04-02 09:46:46
|
||||
* @LastEditTime: 2024-04-03 17:14:03
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -39,11 +39,11 @@
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
|
||||
<base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'">
|
||||
<div class="order" style="width: 100%; overflow: hidden scroll; height: 350px">
|
||||
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: 1em">
|
||||
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em">
|
||||
<!-- <el-col :span="12"> -->
|
||||
|
||||
<p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p>
|
||||
<el-progress style="width: 610px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
|
||||
<el-progress style="width: 620px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
|
||||
define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" />
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -67,6 +67,13 @@
|
||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||
<base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'"
|
||||
:title="'产线产量及良品率'" :title-icon="'productLine'">
|
||||
<div class="myLegend">
|
||||
<div class=" barCircleLegend"></div>
|
||||
<div class=" barCircle"></div>
|
||||
<h4 class="barText">产线良品率</h4>
|
||||
<div class="barLegend"></div>
|
||||
<h4 class="barCircleText">产线产量</h4>
|
||||
</div>
|
||||
<double-y-chart ref="productLineChart" :id="'doubleYChart'" :height="390" :show-legend="true" />
|
||||
</base-container>
|
||||
</el-col>
|
||||
@@ -373,7 +380,27 @@ export default {
|
||||
id: '4',
|
||||
name: '测试工单4',
|
||||
progressRate: 0.32323,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '测试工单4',
|
||||
progressRate: 0.32323,
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '测试工单4',
|
||||
progressRate: 0.32323,
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '测试工单4',
|
||||
progressRate: 0.32323,
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: '测试工单4',
|
||||
progressRate: 0.32323,
|
||||
},
|
||||
// {
|
||||
// id: '5',
|
||||
// name: '测试工单',
|
||||
@@ -389,7 +416,7 @@ export default {
|
||||
return {
|
||||
id: ele.id,
|
||||
name: ele.name,
|
||||
progressRate: parseFloat((ele.progressRate * 100).toFixed(3)),
|
||||
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -417,28 +444,61 @@ export default {
|
||||
`<span style="color:rgba(255,255,255,0.5)">${item.error || ''}</span>`,
|
||||
]);
|
||||
this.eqConfig.data = eqArr;
|
||||
let arr = ['D64', 'D62', 'D61', 'D63', 'D65']
|
||||
// let arr = [5, 6, 2, 4, 7, 9, 15];
|
||||
// 因为7个数,所以长度减去一次为最大循环次数
|
||||
for (let i = 0; i < arr.length - 1; i++) {
|
||||
let data = [
|
||||
{
|
||||
lineName: 'D62',
|
||||
outputNum: '11111',
|
||||
passRate: '0.9873'
|
||||
},
|
||||
{
|
||||
lineName: 'D63',
|
||||
outputNum: '23212',
|
||||
passRate: '0.9873'
|
||||
},
|
||||
{
|
||||
lineName: 'D61',
|
||||
outputNum: '423323',
|
||||
passRate: '0.9873'
|
||||
},
|
||||
{
|
||||
lineName: 'D64',
|
||||
outputNum: '43434',
|
||||
passRate: '0.9873'
|
||||
},
|
||||
]
|
||||
let nameList = [];
|
||||
let passRateList = [];
|
||||
let outputNumList = [];
|
||||
// let arr = ['D64', 'D62', 'D61', 'D63', 'D65']
|
||||
for (let i = 0; i < data.length - 1; i++) {
|
||||
// 二次循环,注意:再减去外层的循环次数,向后依次两两相互比较转换;
|
||||
for (let j = 0; j < arr.length - i - 1; j++) {
|
||||
for (let j = 0; j < data.length - i - 1; j++) {
|
||||
// 当前一个值大于后一个值
|
||||
if (arr[j].substr(arr[j].length - 1, 1) > arr[j + 1].substr(arr[j + 1].length - 1, 1)) {
|
||||
if (data[j].lineName.substr(data[j].lineName.length - 1, 1) > data[j + 1].lineName.substr(data[j + 1].lineName.length - 1, 1)) {
|
||||
// 定义变量,以赋值的形式前后交换,直到换到最小的在前面,左右再无比较,则循环结束形成排序结果
|
||||
let temp = arr[j];
|
||||
arr[j] = arr[j + 1];
|
||||
arr[j + 1] = temp;
|
||||
let temp = data[j];
|
||||
data[j] = data[j + 1];
|
||||
data[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(arr);
|
||||
this.$refs['eqScrollBoard'].updateRows(eqArr);
|
||||
this.$refs.productLineChart.initChart(
|
||||
arr,
|
||||
[98, 97, 98.7, 98.5, 98.3],
|
||||
[3134, 2323, 3232, 3233, 2321]
|
||||
);
|
||||
data.forEach((ele) => {
|
||||
// if (item.id == ele.productionLineId) {
|
||||
// if (item.name.substr(0, 1) == "D") {
|
||||
// console.log(ele)
|
||||
nameList.push(ele.lineName);
|
||||
outputNumList.push(ele.outputNum);
|
||||
passRateList.push(ele.passRate);
|
||||
// }
|
||||
// }
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.$refs.productLineChart.initChart(
|
||||
nameList,
|
||||
passRateList,
|
||||
outputNumList
|
||||
);
|
||||
})
|
||||
// this.getList()
|
||||
this.initWebSocket();
|
||||
this.SJGInitWebSocket();
|
||||
@@ -630,7 +690,7 @@ export default {
|
||||
return {
|
||||
id: ele.id,
|
||||
name: ele.name,
|
||||
progressRate: parseFloat((ele.progressRate * 100).toFixed(3)),
|
||||
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -661,29 +721,29 @@ export default {
|
||||
let nameList = [];
|
||||
let passRateList = [];
|
||||
let outputNumList = [];
|
||||
this.SJGWsData.detData.forEach((ele) => {
|
||||
// if (item.id == ele.productionLineId) {
|
||||
// if (item.name.substr(0, 1) == "D") {
|
||||
// console.log(ele)
|
||||
nameList.push(ele.lineName);
|
||||
outputNumList.push(ele.outputNum);
|
||||
passRateList.push(ele.passRate);
|
||||
// }
|
||||
// }
|
||||
});
|
||||
// let arr = ['D64', 'D62', 'D61', 'D63', 'D65']
|
||||
for (let i = 0; i < nameList.length - 1; i++) {
|
||||
for (let i = 0; i < this.SJGWsData.detData.length - 1; i++) {
|
||||
// 二次循环,注意:再减去外层的循环次数,向后依次两两相互比较转换;
|
||||
for (let j = 0; j < nameList.length - i - 1; j++) {
|
||||
for (let j = 0; j < this.SJGWsData.detData.length - i - 1; j++) {
|
||||
// 当前一个值大于后一个值
|
||||
if (nameList[j].substr(nameList[j].length - 1, 1) > nameList[j + 1].substr(nameList[j + 1].length - 1, 1)) {
|
||||
if (this.SJGWsData.detData[j].lineName.substr(this.SJGWsData.detData[j].lineName.length - 1, 1) > this.SJGWsData.detData[j + 1].lineName.substr(this.SJGWsData.detData[j + 1].lineName.length - 1, 1)) {
|
||||
// 定义变量,以赋值的形式前后交换,直到换到最小的在前面,左右再无比较,则循环结束形成排序结果
|
||||
let temp = nameList[j];
|
||||
nameList[j] = nameList[j + 1];
|
||||
nameList[j + 1] = temp;
|
||||
let temp = this.SJGWsData.detData[j];
|
||||
this.SJGWsData.detData[j] = this.SJGWsData.detData[j + 1];
|
||||
this.SJGWsData.detData[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.SJGWsData.detData.forEach((ele) => {
|
||||
// if (item.id == ele.productionLineId) {
|
||||
// if (item.name.substr(0, 1) == "D") {
|
||||
// console.log(ele)
|
||||
nameList.push(ele.lineName);
|
||||
outputNumList.push(ele.outputNum);
|
||||
passRateList.push(ele.passRate);
|
||||
// }
|
||||
// }
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.$refs.productLineChart.initChart(
|
||||
nameList,
|
||||
@@ -742,6 +802,51 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.myLegend {
|
||||
position: absolute;
|
||||
top: -28px;
|
||||
right: 20px;
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, .6);
|
||||
|
||||
.barLegend {
|
||||
// float: left;
|
||||
background: linear-gradient(#9DD5FF, #1295FF);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: inline-block;
|
||||
margin-right: 5px;
|
||||
border-radius: 30%;
|
||||
}
|
||||
|
||||
.barText {
|
||||
// float: right;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.barCircleLegend {
|
||||
width: 15px;
|
||||
height: 1px;
|
||||
background-color: rgba(255, 209, 96, 1);
|
||||
position: absolute;
|
||||
left: -4.1715px;
|
||||
top: 21.7px;
|
||||
}
|
||||
|
||||
.barCircle {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(255, 209, 96, 1);
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 1.7px;
|
||||
}
|
||||
.barCircleText {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.visual-container {
|
||||
width: 1920px;
|
||||
height: 1080px;
|
||||
@@ -815,8 +920,9 @@ export default {
|
||||
background-image: linear-gradient(to right, #4573fe, #47f8dc);
|
||||
}
|
||||
::v-deep .el-progress__text {
|
||||
width: 50px;
|
||||
margin-top: -70px;
|
||||
margin-left: 490px;
|
||||
margin-left: 538px;
|
||||
// background-color: unset;
|
||||
// background-image: linear-gradient(to right, #4573fe, #47f8dc);
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
@@ -33,38 +34,49 @@ import {
|
||||
getcoreAlarmLogPage
|
||||
} from '@/api/base/coreAlarmLog';
|
||||
import {DICT_TYPE, getDictDatas, publicFormatter } from "@/utils/dict";
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'alarmTime',
|
||||
label: '报警时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'alarmSource',
|
||||
label: '报警来源'
|
||||
label: '报警来源',
|
||||
width: 200,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'alarmType',
|
||||
label: '报警类型'
|
||||
label: '报警类型',
|
||||
width: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(DICT_TYPE.EQU_ALARM_LEVEL)
|
||||
filter: publicFormatter(DICT_TYPE.EQU_ALARM_LEVEL),
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'alarmReason',
|
||||
label: '报警原因'
|
||||
label: '报警原因',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'alarmContent',
|
||||
label: '报警详细'
|
||||
label: '报警详细',
|
||||
showOverflowtooltip: true
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -74,7 +86,7 @@ export default {
|
||||
tableBtn: [].filter((v)=>v),
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
alarmSource: undefined,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-20 16:20:39
|
||||
* @LastEditTime: 2024-04-02 16:46:17
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "客户编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "客户名称不能为空", trigger: "blur" }],
|
||||
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
// contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
telephone: [
|
||||
{ required: false, trigger: "blur", message: "手机号不能为空" },
|
||||
{
|
||||
|
||||
@@ -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"
|
||||
@@ -45,41 +46,56 @@ import {
|
||||
getCustomerPage,
|
||||
deleteCustomer
|
||||
} from '@/api/base/coreCustomer';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '客户名称'
|
||||
label: '客户名称',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '客户编码'
|
||||
label: '客户编码',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'contact',
|
||||
label: '联系人'
|
||||
label: '联系人',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'telephone',
|
||||
label: '联系电话'
|
||||
label: '联系电话',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: '地址'
|
||||
label: '地址',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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"
|
||||
@@ -45,6 +46,7 @@ import {
|
||||
getCoreDepartmentPage,
|
||||
deleteCoreDepartment
|
||||
} from '@/api/base/coreDepartment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -71,7 +73,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -64,8 +64,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="进场日期" prop="enterTime" :rules="[]">
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择进场日期"
|
||||
<el-form-item label="进厂日期" prop="enterTime" :rules="[]">
|
||||
<el-date-picker v-model="form.enterTime" :disabled="disabled" type="datetime" placeholder="请选择进厂日期"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -78,7 +79,7 @@
|
||||
queryParams: {
|
||||
equipmentId: form.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:core-equipment-attr:update')
|
||||
@@ -118,6 +119,7 @@ import {
|
||||
} from '@/api/base/equipment';
|
||||
import Editor from '@/components/Editor';
|
||||
import AssetsUpload from './components/AssetsUpload.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'Equipment',
|
||||
@@ -125,7 +127,7 @@ export default {
|
||||
Editor,
|
||||
EquipmentDrawer,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name', 'code'],
|
||||
@@ -157,8 +159,8 @@ export default {
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'name', label: '设备名称' },
|
||||
{ width: 256, prop: 'code', label: '设备编码' },
|
||||
{ prop: 'name', label: '设备名称', width: 180, showOverflowtooltip: true },
|
||||
{ width: 250, prop: 'code', label: '设备编码' },
|
||||
{ prop: 'equipmentTypeName', label: '设备类型' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
{ prop: 'abbr', label: '缩写' },
|
||||
@@ -484,7 +486,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
code: '',
|
||||
name: '',
|
||||
special: false
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -51,13 +52,13 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import DialogForm from './dialogForm.vue';
|
||||
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
// import { getAccessToken } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentLineBind',
|
||||
components: { DialogForm },
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
basePath: '/base/core-equipment-bind-section',
|
||||
@@ -81,12 +82,13 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
width: 150,
|
||||
showOverflowtooltip: true,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ prop: 'productionLineName', label: '产线名称' },
|
||||
{ prop: 'workshopSectionName', label: '工段名称' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'productionLineName', label: '产线名称', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'workshopSectionName', label: '工段名称', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名称', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'sort', label: '工段中排序' },
|
||||
{
|
||||
prop: 'lineDataType',
|
||||
@@ -236,7 +238,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
equipmentName: null,
|
||||
productionLineId: null,
|
||||
},
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -50,6 +51,7 @@
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
import {
|
||||
createEquipmentType,
|
||||
@@ -65,7 +67,7 @@ import {
|
||||
export default {
|
||||
name: 'EquipmentType',
|
||||
components: {},
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['name'],
|
||||
@@ -171,7 +173,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
name: '',
|
||||
},
|
||||
// 表单参数
|
||||
|
||||
@@ -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"
|
||||
@@ -43,38 +44,51 @@ import basicPage from '../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../core/mixins/code-filter';
|
||||
import { getHotMaterialPage, deleteHotMaterial } from '@/api/base/coreHotMaterial';
|
||||
import { publicFormatter } from "@/utils/dict";
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '原料名称'
|
||||
label: '原料名称',
|
||||
minWidth: 250,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '原料编码'
|
||||
label: '原料编码',
|
||||
width: 250,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
filter: publicFormatter('unit_dict'),
|
||||
width: 90,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'dailyCost',
|
||||
label: '每日消耗量'
|
||||
label: '每日消耗量',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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"
|
||||
@@ -45,6 +46,7 @@ import {
|
||||
getCoreMajorPage,
|
||||
deleteCoreMajor
|
||||
} from '@/api/base/coreMajor';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -71,7 +73,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-03-13 13:54:01
|
||||
* @LastEditTime: 2024-03-27 13:47:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
:before-close="beforeClose"
|
||||
@closed="$emit('destroy')"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
@@ -262,6 +264,15 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
if (!this.isdetail) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
}
|
||||
},
|
||||
clearArea() {
|
||||
this.$set(this.dataForm, 'area', 0)
|
||||
this.$set(this.dataForm, 'weight', 0)
|
||||
|
||||
@@ -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"
|
||||
@@ -26,7 +27,8 @@
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList" />
|
||||
@refreshDataList="getDataList"
|
||||
@destroy="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -39,43 +41,58 @@ import {
|
||||
getCoreProductPage,
|
||||
deleteCoreProduct
|
||||
} from '@/api/base/coreProduct';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产品名称'
|
||||
label: '产品名称',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '产品编码'
|
||||
label: '产品编码',
|
||||
width: 190,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'productType',
|
||||
label: '产品类型',
|
||||
filter: publicFormatter('product_type')
|
||||
filter: publicFormatter('product_type'),
|
||||
width: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'specifications',
|
||||
label: '规格'
|
||||
label: '规格',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict')
|
||||
filter: publicFormatter('unit_dict'),
|
||||
width: 90,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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"
|
||||
@@ -48,34 +49,47 @@ import {
|
||||
import { getStatus } from '@/api/core/base/productionLine';
|
||||
import codeFilter from '../../core/mixins/code-filter';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'factoryName',
|
||||
label: '工厂'
|
||||
label: '工厂',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'roomNameDict',
|
||||
label: '车间名称',
|
||||
filter: publicFormatter('workshop')
|
||||
filter: publicFormatter('workshop'),
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '产线名称'
|
||||
label: '产线名称',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '产线编码'
|
||||
label: '产线编码',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'enabled',
|
||||
label: '当前状态',
|
||||
filter: codeFilter('lineStatus')
|
||||
filter: codeFilter('lineStatus'),
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
// {
|
||||
// prop: 'tvalue',
|
||||
@@ -83,16 +97,20 @@ const tableProps = [
|
||||
// },
|
||||
{
|
||||
prop: 'description',
|
||||
label: '描述'
|
||||
label: '描述',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-22 10:27:43
|
||||
* @LastEditTime: 2024-04-02 16:46:49
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
dataRule: {
|
||||
code: [{ required: true, message: "供应商编号不能为空", trigger: "blur" }],
|
||||
name: [{ required: true, message: "供应商名称不能为空", trigger: "blur" }],
|
||||
contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
// contact: [{ required: true, message: "联系人不能为空", trigger: "blur" }],
|
||||
telephone: [
|
||||
{ required: false, trigger: "blur", message: "手机号不能为空" },
|
||||
{
|
||||
|
||||
@@ -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"
|
||||
@@ -45,41 +46,56 @@ import {
|
||||
getCoreSupplierPage,
|
||||
deleteCoreSupplier
|
||||
} from '@/api/base/coreSupplier';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '供应商编码'
|
||||
label: '供应商编码',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '供应商名称'
|
||||
label: '供应商名称',
|
||||
width: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'contact',
|
||||
label: '联系人'
|
||||
label: '联系人',
|
||||
width: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'telephone',
|
||||
label: '联系电话'
|
||||
label: '联系电话',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'address',
|
||||
label: '地址'
|
||||
label: '地址',
|
||||
width: 180,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
minWidth: 90,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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");
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
// 产品
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
@@ -46,20 +47,27 @@ import {
|
||||
deleteCoreWorker
|
||||
} from '@/api/base/coreWorker';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'name',
|
||||
label: '姓名'
|
||||
label: '姓名',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '员工号'
|
||||
label: '员工号',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'sex',
|
||||
@@ -70,32 +78,44 @@ const tableProps = [
|
||||
prop: 'entryTime',
|
||||
label: '入职时间',
|
||||
filter: (val) => val ? moment(val).format('yyyy-MM-DD') : '',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'telephone',
|
||||
label: '联系电话'
|
||||
label: '联系电话',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
filter: (val) => ['', '在职', '离职'][val]
|
||||
filter: (val) => ['', '在职', '离职'][val],
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'departmentName',
|
||||
label: '部门'
|
||||
label: '部门',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'majorName',
|
||||
label: '专业'
|
||||
label: '专业',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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"
|
||||
@@ -45,12 +46,14 @@ import {
|
||||
getCWSectionPage,
|
||||
deleteCWSection
|
||||
} from '@/api/base/coreWorkshopSection';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
filter: parseTime
|
||||
filter: parseTime,
|
||||
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
@@ -70,12 +73,13 @@ const tableProps = [
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
label: '备注',
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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"
|
||||
@@ -40,6 +41,7 @@ import {
|
||||
} from '@/api/base/material';
|
||||
import { listData } from "@/api/system/dict/data";
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -75,7 +77,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -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"
|
||||
@@ -38,6 +39,7 @@ import {
|
||||
getMaterialPBPage,
|
||||
deleteMaterialPB
|
||||
} from '@/api/base/materialProductBom';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
@@ -55,7 +57,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
|
||||
@@ -2,38 +2,21 @@
|
||||
* @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>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList" />
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -41,6 +24,7 @@ import AddOrUpdate from './add-or-updata';
|
||||
// import unitDict from './unitDict';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import {
|
||||
getPackingModel,
|
||||
} from '@/api/base/printModel.js'
|
||||
@@ -91,7 +75,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -144,7 +128,7 @@ export default {
|
||||
param: 'createTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '',
|
||||
btnName: '搜索',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
@@ -314,7 +298,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.workOrderId = val.workOrderId;
|
||||
if (val.createTime && val.createTime.length != 0) {
|
||||
this.listQuery.createTime = val.createTime
|
||||
@@ -329,7 +313,7 @@ export default {
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-04 13:38:45
|
||||
* @LastEditTime: 2024-04-03 15:08:38
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
|
||||
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
@@ -25,7 +26,9 @@ import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import printModelDesign from '../custom/index'
|
||||
import { updatePackingModel,} from '@/api/base/printModel.js';
|
||||
import { updatePackingModel, } from '@/api/base/printModel.js';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
import {
|
||||
deletePackingModel,
|
||||
getPackingModelPage,
|
||||
@@ -59,7 +62,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -162,7 +165,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.packagingCode = val.packagingCode;
|
||||
this.listQuery.createTime = val.createTime;
|
||||
this.getDataList();
|
||||
@@ -170,7 +173,7 @@ export default {
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
|
||||
@@ -2,38 +2,21 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 14:55:51
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-12-04 13:44:01
|
||||
* @LastEditTime: 2024-04-03 15:09:06
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList" />
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
|
||||
:table-data="tableData">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -41,6 +24,7 @@ import AddOrUpdate from './add-or-updata';
|
||||
// import unitDict from './unitDict';
|
||||
import basicPage from '../mixins/basic-page';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import {
|
||||
deletePackingType,
|
||||
getPackingTypePage,
|
||||
@@ -64,7 +48,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
@@ -154,7 +138,7 @@ export default {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.listQuery.packagingCode = val.packagingCode;
|
||||
this.listQuery.createTime = val.createTime;
|
||||
this.getDataList();
|
||||
@@ -162,7 +146,7 @@ export default {
|
||||
case 'reset':
|
||||
this.$refs.searchBarForm.resetForm();
|
||||
this.listQuery = {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
};
|
||||
|
||||
@@ -106,6 +106,10 @@ export default {
|
||||
activeIndex(val) {
|
||||
this.initChart(val);
|
||||
},
|
||||
daterange(val) {
|
||||
console.log('222', val)
|
||||
this.templateOption.xAxis.data = val
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -124,8 +128,8 @@ export default {
|
||||
},
|
||||
/** 初始化/设置 图表 */
|
||||
initChart(val) {
|
||||
console.log('tableData', this.tableData);
|
||||
if (!this.chart) this.chart = echarts.init(this.$refs.chartDiv);
|
||||
this.chart.clear();
|
||||
switch (val) {
|
||||
case 0:
|
||||
const eqCt = this.tableData.map((row) => ({
|
||||
@@ -139,7 +143,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
|
||||
series: eqCt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
case 1:
|
||||
const eqTt = this.tableData.map((row) => ({
|
||||
@@ -153,7 +157,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备TT' },
|
||||
series: eqTt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
case 2:
|
||||
const plCt = this.tableData.map((row) => ({
|
||||
@@ -167,7 +171,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '产线CT' },
|
||||
series: plCt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
case 3:
|
||||
const plTt = this.tableData.map((row) => ({
|
||||
@@ -181,9 +185,10 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '产线TT' },
|
||||
series: plTt,
|
||||
});
|
||||
}, true);
|
||||
break;
|
||||
default:
|
||||
this.activeIndex = 0
|
||||
const eqCt2 = this.tableData.map((row) => ({
|
||||
name: row.equName,
|
||||
type: 'line',
|
||||
@@ -195,7 +200,7 @@ export default {
|
||||
...this.templateOption,
|
||||
yAxis: { ...this.templateOption.yAxis, name: '设备CT' },
|
||||
series: eqCt2,
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -18,13 +18,15 @@
|
||||
:page="1"
|
||||
:limit="999"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData" />
|
||||
:table-data="tableData"
|
||||
:max-height="tableH" />
|
||||
<div v-if="tableData.length == 0" class="no-data-bg"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000产线平衡分析图\u3000'" name="graph">
|
||||
<div class="graph" style="height: 800px">
|
||||
<!-- graph -->
|
||||
<AnalysisChart
|
||||
ref="analysisChart"
|
||||
v-if="activeName == 'graph'"
|
||||
:table-data="tableData"
|
||||
:daterange="dateArr"></AnalysisChart>
|
||||
@@ -47,13 +49,14 @@ import BalanceChart from '../balanceChart';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import AnalysisChart from './chart.vue';
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BalanceChart,
|
||||
AnalysisChart,
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
activeName: 'table',
|
||||
@@ -176,6 +179,11 @@ export default {
|
||||
// const p = this.tableProps
|
||||
// const d = this.tableData
|
||||
// debugger;
|
||||
if (this.activeName == 'graph') {
|
||||
this.$nextTick(() => {
|
||||
this.$refs['analysisChart'].initChart()
|
||||
})
|
||||
}
|
||||
this.ready = true;
|
||||
},
|
||||
|
||||
|
||||
@@ -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"
|
||||
@@ -41,6 +42,7 @@
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '../../mixins/basic-page';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
import {
|
||||
deleteFactory,
|
||||
getFactoryPage
|
||||
@@ -71,7 +73,7 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
},
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
},
|
||||
|
||||
@@ -27,13 +27,16 @@
|
||||
import { getPdlDataOneDay } from '@/api/core/monitoring/data24'
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getSchedulingMonitoringRecord1 } from '@/api/monitoring/teamProduction'
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'productionLineData24',
|
||||
mixins: [tableHeightMixin],
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
heightNum: 240,
|
||||
urlOptions: {
|
||||
getDataListURL: getPdlDataOneDay
|
||||
},
|
||||
@@ -56,9 +59,9 @@ export default {
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(240)
|
||||
})
|
||||
// window.addEventListener('resize', () => {
|
||||
// this.tableH = this.tableHeight(240)
|
||||
// })
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
@@ -115,7 +118,7 @@ export default {
|
||||
/** 把 list 里的数据转换成 tableProps 对应的格式 */
|
||||
convertList(list) {
|
||||
// let sectionArr= []
|
||||
let temp = Object.values(list.datamap)
|
||||
let temp = list.datamap ? Object.values(list?.datamap) : []
|
||||
console.log('111', temp)
|
||||
|
||||
temp.forEach(item => {
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
@@ -92,13 +92,15 @@ export default {
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:cost-energy-search:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCost:export')
|
||||
type: this.$auth.hasPermi('extend:cost-energy-search:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -111,9 +113,6 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
getEnergyTypeListAll().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
@@ -116,13 +116,15 @@ export default {
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:cost-enery-auto-report:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:energyCostHis:export')
|
||||
type: this.$auth.hasPermi('extend:cost-enery-auto-report:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -135,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);
|
||||
|
||||
@@ -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,15 +100,14 @@ export default {
|
||||
deleteURL: deleteCostMaterialSet,
|
||||
},
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi(`cost:rawMaterialConfig:update`)
|
||||
this.$auth.hasPermi(`extend:cost-material-set:update`)
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi(`cost:rawMaterialConfig:delete`)
|
||||
this.$auth.hasPermi(`extend:cost-material-set:delete`)
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
@@ -124,16 +124,22 @@ export default {
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:cost-material-set:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
type:
|
||||
this.$auth.hasPermi('extend:cost-material-set:create') &&
|
||||
this.$auth.hasPermi('extend:cost-material-set:query')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialConfig:create')
|
||||
type: this.$auth.hasPermi('extend:cost-material-set:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
@@ -148,9 +154,6 @@ export default {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
@@ -97,13 +97,15 @@ export default {
|
||||
param: 'searchTime',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:cost-material-search:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCost:export')
|
||||
type: this.$auth.hasPermi('extend:cost-material-search:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -116,9 +118,6 @@ export default {
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
getHotMaterialList().then((response) => {
|
||||
this.formConfig[0].selectOptions = response.data;
|
||||
});
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
@@ -115,13 +115,15 @@ export default {
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
type: this.$auth.hasPermi('extend:cost-material-auto-report:query')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('cost:rawMaterialCostHis:export')
|
||||
type: this.$auth.hasPermi('extend:cost-material-auto-report:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
@@ -134,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);
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -1,24 +1,23 @@
|
||||
<!--
|
||||
filename: MaterialCost.vue
|
||||
author: liubin
|
||||
date: 2023-12-06 09:09:27
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<Container name="原料用量统计" size="middle" style="">
|
||||
<div style="flex: 1; display: flex; gap: 8px;flex-direction: column;">
|
||||
<Container
|
||||
name="原料用量统计"
|
||||
size="middle"
|
||||
style="">
|
||||
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
|
||||
<div
|
||||
class="absolute"
|
||||
style="
|
||||
flex:3;
|
||||
flex: 2;
|
||||
padding: 12px 12px 0 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-auto-rows: repeat(4, 1fr);
|
||||
gap: 8px;
|
||||
">
|
||||
<ShadowRect v-for="(item, index) in materialMsg1" :key="index" :rounded="false">
|
||||
<ShadowRect
|
||||
v-for="(item, index) in materialMsg"
|
||||
:key="index"
|
||||
:rounded="false">
|
||||
<div
|
||||
class="material"
|
||||
style="
|
||||
@@ -30,43 +29,24 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
">
|
||||
<span style="color: #0ee8e4; font-weight: 500; font-size: 32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
|
||||
{{item.materialUsed}}
|
||||
<span
|
||||
style="
|
||||
color: #0ee8e4;
|
||||
font-weight: 500;
|
||||
font-size: 32px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
">
|
||||
{{ item.materialUsed }}
|
||||
</span>
|
||||
<span style="color: #fff; font-size: 16px; letter-spacing: 1px">
|
||||
- {{item.materialName}}/kg-
|
||||
</span>
|
||||
</div>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
<div style="flex:1;
|
||||
padding: 0 12px 12px 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 8px;">
|
||||
<ShadowRect v-for="(item, index) in materialMsg2" :key="index" :rounded="false">
|
||||
<div
|
||||
class="material"
|
||||
style="
|
||||
flex: 1;
|
||||
padding-bottom: 3px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
">
|
||||
<span style="color: #0ee8e4; font-weight: 500; font-size: 32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">
|
||||
{{item.materialUsed}}
|
||||
</span>
|
||||
<span style="color: #fff; font-size: 16px; letter-spacing: 1px">
|
||||
- {{item.materialName}}/kg-
|
||||
- {{ item.materialName }}/kg-
|
||||
</span>
|
||||
</div>
|
||||
</ShadowRect>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
@@ -81,12 +61,9 @@ export default {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
materialMsg1() {
|
||||
return this.$store.state.websocket.material.slice(0,9)
|
||||
materialMsg() {
|
||||
return this.$store.state.websocket.material;
|
||||
},
|
||||
materialMsg2() {
|
||||
return this.$store.state.websocket.material.slice(9)
|
||||
}
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
return {
|
||||
chartDom: '',
|
||||
chart: '',
|
||||
chartHeight: this.tableHeight(214) - 100,
|
||||
chartHeight: this.tableHeight(314),
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.chartHeight = this.tableHeight(214) - 70;
|
||||
this.chartHeight = this.tableHeight(314);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,102 +1,119 @@
|
||||
<template>
|
||||
<div id="analysischartLine" style="width: 100%;height: 100%;"></div>
|
||||
<div
|
||||
id="analysischartLine"
|
||||
style="width: 100%"
|
||||
:style="{ height: chartHeight + 'px' }"></div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import resize from '@/utils/chartMixins/resize'
|
||||
import * as echarts from 'echarts';
|
||||
import resize from '@/utils/chartMixins/resize';
|
||||
export default {
|
||||
name: "LineChart",
|
||||
mixins: [resize],
|
||||
data() {
|
||||
return {
|
||||
chartDom: '',
|
||||
chart: '',
|
||||
chartHeight: this.tableHeight(214) - 70
|
||||
}
|
||||
},
|
||||
props: {
|
||||
chartData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartData: function () {
|
||||
this.getChart()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.chartHeight = this.tableHeight(214) - 70
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getChart() {
|
||||
if (
|
||||
this.chart !== null &&
|
||||
this.chart !== '' &&
|
||||
this.chart !== undefined
|
||||
) {
|
||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
||||
}
|
||||
this.chartDom = document.getElementById('analysischartLine')
|
||||
this.chart = echarts.init(this.chartDom)
|
||||
if (this.chartData.length === 0) {
|
||||
return false
|
||||
}
|
||||
let xData = []
|
||||
let arr = this.chartData[0].type
|
||||
let keys = Object.keys(this.chartData[0])
|
||||
let yData = []
|
||||
for (let j = 0; j < arr.length; j++) {
|
||||
for (let k = 0; k < keys.length; k++) {
|
||||
if (keys[k].indexOf(arr[j] + '_上年同期') > -1 || keys[k].indexOf(arr[j] + '_能源消耗') > -1) {
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
data: []
|
||||
}
|
||||
obj.name = keys[k]
|
||||
yData.push(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.chartData.length; i++) {
|
||||
xData.push(this.chartData[i].time)
|
||||
for (let p = 0; p < yData.length; p++) {
|
||||
yData[p].data.push(this.chartData[i][yData[p].name])
|
||||
}
|
||||
}
|
||||
var option = {
|
||||
color: ['#FFDC94', '#8EF0AB', '#63BDFF', '#288AFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
|
||||
legend: {
|
||||
data: keys,
|
||||
right: '1%'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '1%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: yData
|
||||
};
|
||||
name: 'LineChart',
|
||||
mixins: [resize],
|
||||
data() {
|
||||
return {
|
||||
chartDom: '',
|
||||
chart: '',
|
||||
chartHeight: this.tableHeight(250) / 2,
|
||||
};
|
||||
},
|
||||
props: {
|
||||
chartData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
chartData: function () {
|
||||
this.getChart();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.chartHeight = this.tableHeight(250) / 2;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getChart() {
|
||||
if (
|
||||
this.chart !== null &&
|
||||
this.chart !== '' &&
|
||||
this.chart !== undefined
|
||||
) {
|
||||
this.chart.dispose(); // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
||||
}
|
||||
this.chartDom = document.getElementById('analysischartLine');
|
||||
this.chart = echarts.init(this.chartDom);
|
||||
if (this.chartData.length === 0) {
|
||||
return false;
|
||||
}
|
||||
let xData = [];
|
||||
let arr = this.chartData[0].type;
|
||||
let keys = Object.keys(this.chartData[0]);
|
||||
let yData = [];
|
||||
for (let j = 0; j < arr.length; j++) {
|
||||
for (let k = 0; k < keys.length; k++) {
|
||||
if (
|
||||
keys[k].indexOf(arr[j] + '_上年同期') > -1 ||
|
||||
keys[k].indexOf(arr[j] + '_能源消耗') > -1
|
||||
) {
|
||||
let obj = {
|
||||
name: '',
|
||||
type: 'line',
|
||||
data: [],
|
||||
};
|
||||
obj.name = keys[k];
|
||||
yData.push(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < this.chartData.length; i++) {
|
||||
xData.push(this.chartData[i].time);
|
||||
for (let p = 0; p < yData.length; p++) {
|
||||
yData[p].data.push(this.chartData[i][yData[p].name]);
|
||||
}
|
||||
}
|
||||
var option = {
|
||||
color: [
|
||||
'#FFDC94',
|
||||
'#8EF0AB',
|
||||
'#63BDFF',
|
||||
'#288AFF',
|
||||
'#7164FF',
|
||||
'#FF6860',
|
||||
'#FF9747',
|
||||
'#B0EB42',
|
||||
'#D680FF',
|
||||
'#0043D2',
|
||||
],
|
||||
legend: {
|
||||
data: keys,
|
||||
right: '1%',
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '1%',
|
||||
bottom: '3%',
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xData,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
},
|
||||
series: yData,
|
||||
};
|
||||
|
||||
option && this.chart.setOption(option);
|
||||
}
|
||||
}
|
||||
}
|
||||
option && this.chart.setOption(option);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -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"
|
||||
|
||||
@@ -1,143 +1,153 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-area @submit="getList" @exportD="exportData"/>
|
||||
<div v-show='chartData.length'>
|
||||
<div class="chartTitle">同比分析图</div>
|
||||
<div style='width: 100%;height: 400px;'>
|
||||
<line-chart ref="analysisLineChart" :chartData="chartData"/>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
class="yoy-out-table"
|
||||
/>
|
||||
</div>
|
||||
<!-- 没有数据 -->
|
||||
<div class="no-data-bg" v-show='!chartData.length'></div>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-area
|
||||
@submit="getList"
|
||||
@exportD="exportData" />
|
||||
<div v-show="chartData.length">
|
||||
<div class="chartTitle">同比分析图</div>
|
||||
<div style="width: 100%">
|
||||
<line-chart
|
||||
ref="analysisLineChart"
|
||||
:chartData="chartData" />
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH"
|
||||
class="yoy-out-table" />
|
||||
</div>
|
||||
<!-- 没有数据 -->
|
||||
<div
|
||||
class="no-data-bg"
|
||||
v-show="!chartData.length"></div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getYoy } from "@/api/analysis/energyAnalysis"
|
||||
import subRate from "./components/subRate.vue"
|
||||
import SearchArea from "./components/searchArea"
|
||||
import LineChart from "./components/lineChart"
|
||||
import FileSaver from "file-saver"
|
||||
import * as XLSX from 'xlsx/xlsx.mjs'
|
||||
import { getYoy } from '@/api/analysis/energyAnalysis';
|
||||
import subRate from './components/subRate.vue';
|
||||
import SearchArea from './components/searchArea';
|
||||
import LineChart from './components/lineChart';
|
||||
import FileSaver from 'file-saver';
|
||||
import * as XLSX from 'xlsx/xlsx.mjs';
|
||||
export default {
|
||||
name: 'YoyAnalysis',
|
||||
components: { SearchArea, LineChart },
|
||||
data() {
|
||||
return {
|
||||
chartData: [],
|
||||
tableProps: [],
|
||||
list: [],
|
||||
tableH: this.tableHeight(640)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(640)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getList(params) {
|
||||
getYoy({ ...params }).then((res) => {
|
||||
if (res.code === 0 && res.data) {
|
||||
this.getTableList(res.data)
|
||||
} else {
|
||||
this.chartData = []
|
||||
this.list = []
|
||||
}
|
||||
})
|
||||
},
|
||||
getTableList(arr) {
|
||||
let data = arr.data
|
||||
let nameData = arr.nameData
|
||||
let tempX = []
|
||||
data[0].data.map((item) => {
|
||||
let obj = {}
|
||||
obj.prop = item.dynamicName
|
||||
obj.label = item.dynamicName
|
||||
obj.id = item.id
|
||||
obj.children = []
|
||||
tempX.push(obj)
|
||||
})
|
||||
for (let i = 0; i < nameData.length; i++) {
|
||||
for (let j = 0; j < tempX.length; j++) {
|
||||
if (tempX[j].id === nameData[i].parentId) {
|
||||
let obj = {}
|
||||
obj.prop = tempX[j].prop + '_' + nameData[i].name
|
||||
obj.label = nameData[i].name
|
||||
if (obj.label.indexOf('同比')!= -1) {
|
||||
obj.subcomponent = subRate
|
||||
}
|
||||
tempX[j].children.push(obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
this.tableProps = [{prop: 'time',label: '时间'}].concat(tempX)
|
||||
console.log(this.tableProps)
|
||||
// 数据
|
||||
this.list = []
|
||||
for (let k = 0; k < data.length; k++) {
|
||||
let obj = {}
|
||||
obj.time = data[k].time
|
||||
let arr1 = data[k].data
|
||||
obj.type = []
|
||||
for (let q = 0; q < arr1.length; q++) {
|
||||
let name = arr1[q].dynamicName
|
||||
obj.type.push(name)
|
||||
let arr2 = arr1[q].children
|
||||
for (let p = 0; p < arr2.length; p++) {
|
||||
let prop = name + '_' + arr2[p].dynamicName
|
||||
obj[prop] = arr2[p].dynamicValue
|
||||
}
|
||||
}
|
||||
this.list.push(obj)
|
||||
}
|
||||
this.chartData = this.list
|
||||
},
|
||||
exportData(val) {
|
||||
if (this.list.length > 0) {
|
||||
var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
|
||||
let fileName = val.name + "同比分析.xlsx"
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: "xlsx",
|
||||
bookSST: true,
|
||||
type: "array"
|
||||
})
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
new Blob([wbout], { type: "application/octet-stream" }),
|
||||
fileName
|
||||
)
|
||||
} catch (e) {
|
||||
if (typeof console !== "undefined") console.log(e, wbout);
|
||||
}
|
||||
return wbout
|
||||
} else {
|
||||
this.$modal.msgWarning("暂无数据导出")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'YoyAnalysis',
|
||||
components: { SearchArea, LineChart },
|
||||
data() {
|
||||
return {
|
||||
chartData: [],
|
||||
tableProps: [],
|
||||
list: [],
|
||||
tableH: this.tableHeight(250) / 2,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(250) / 2;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getList(params) {
|
||||
getYoy({ ...params }).then((res) => {
|
||||
if (res.code === 0 && res.data) {
|
||||
this.getTableList(res.data);
|
||||
} else {
|
||||
this.chartData = [];
|
||||
this.list = [];
|
||||
}
|
||||
});
|
||||
},
|
||||
getTableList(arr) {
|
||||
let data = arr.data;
|
||||
let nameData = arr.nameData;
|
||||
let tempX = [];
|
||||
data[0].data.map((item) => {
|
||||
let obj = {};
|
||||
obj.prop = item.dynamicName;
|
||||
obj.label = item.dynamicName;
|
||||
obj.id = item.id;
|
||||
obj.children = [];
|
||||
tempX.push(obj);
|
||||
});
|
||||
for (let i = 0; i < nameData.length; i++) {
|
||||
for (let j = 0; j < tempX.length; j++) {
|
||||
if (tempX[j].id === nameData[i].parentId) {
|
||||
let obj = {};
|
||||
obj.prop = tempX[j].prop + '_' + nameData[i].name;
|
||||
obj.label = nameData[i].name;
|
||||
if (obj.label.indexOf('同比') != -1) {
|
||||
obj.subcomponent = subRate;
|
||||
}
|
||||
tempX[j].children.push(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX);
|
||||
console.log(this.tableProps);
|
||||
// 数据
|
||||
this.list = [];
|
||||
for (let k = 0; k < data.length; k++) {
|
||||
let obj = {};
|
||||
obj.time = data[k].time;
|
||||
let arr1 = data[k].data;
|
||||
obj.type = [];
|
||||
for (let q = 0; q < arr1.length; q++) {
|
||||
let name = arr1[q].dynamicName;
|
||||
obj.type.push(name);
|
||||
let arr2 = arr1[q].children;
|
||||
for (let p = 0; p < arr2.length; p++) {
|
||||
let prop = name + '_' + arr2[p].dynamicName;
|
||||
obj[prop] = arr2[p].dynamicValue;
|
||||
}
|
||||
}
|
||||
this.list.push(obj);
|
||||
}
|
||||
this.chartData = this.list;
|
||||
},
|
||||
exportData(val) {
|
||||
if (this.list.length > 0) {
|
||||
var wb = XLSX.utils.table_to_book(
|
||||
document.querySelector('.yoy-out-table')
|
||||
);
|
||||
let fileName = val.name + '同比分析.xlsx';
|
||||
var wbout = XLSX.write(wb, {
|
||||
bookType: 'xlsx',
|
||||
bookSST: true,
|
||||
type: 'array',
|
||||
});
|
||||
try {
|
||||
FileSaver.saveAs(
|
||||
new Blob([wbout], { type: 'application/octet-stream' }),
|
||||
fileName
|
||||
);
|
||||
} catch (e) {
|
||||
if (typeof console !== 'undefined') console.log(e, wbout);
|
||||
}
|
||||
return wbout;
|
||||
} else {
|
||||
this.$modal.msgWarning('暂无数据导出');
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.yoy-out-table {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.chartTitle {
|
||||
font-size: 16px;
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
color: #000;
|
||||
}
|
||||
.chartTitle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background-color: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
vertical-align: bottom;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
</style>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,132 +1,163 @@
|
||||
<template>
|
||||
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="能源类型" prop="typeId">
|
||||
<el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option
|
||||
v-for="item in energyListType"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="参数列名" prop="plcParamName">
|
||||
<el-input v-model="form.plcParamName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="参数名称" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否采集" prop="collection">
|
||||
<el-switch v-model="form.collection"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="form.description"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-form
|
||||
ref="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
:model="form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="能源类型"
|
||||
prop="typeId">
|
||||
<el-select
|
||||
v-model="form.typeId"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="item in energyListType"
|
||||
:key="item.id"
|
||||
:label="item.labelName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="参数列名"
|
||||
prop="plcParamName">
|
||||
<el-input v-model="form.plcParamName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="参数名称"
|
||||
prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="单位"
|
||||
prop="unit">
|
||||
<el-select
|
||||
v-model="form.unit"
|
||||
placeholder="请选择"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.UNIT_DICT)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="是否采集"
|
||||
prop="collection">
|
||||
<el-switch v-model="form.collection"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="描述"
|
||||
prop="description">
|
||||
<el-input v-model="form.description"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getEnergyPlcParam, updateEnergyPlcParam, createEnergyPlcParam } from '@/api/base/energyPlcParam'
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType'
|
||||
import {
|
||||
getEnergyPlcParam,
|
||||
updateEnergyPlcParam,
|
||||
createEnergyPlcParam,
|
||||
} from '@/api/base/energyPlcParam';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
export default {
|
||||
name: 'EnergyPlcParamAdd',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
typeId: '',
|
||||
plcParamName: '',
|
||||
name: '',
|
||||
unit: '',
|
||||
description: '',
|
||||
collection: true,
|
||||
connectId: ''
|
||||
},
|
||||
energyListType: [],
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
typeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
||||
plcParamName: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(param) {
|
||||
this.form.connectId = param.connectId
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.energyListType = res.data || []
|
||||
})
|
||||
if (param.id) {
|
||||
this.isEdit = true
|
||||
this.form.id = param.id
|
||||
getEnergyPlcParam(this.form.id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
this.form.collection = this.form.collection === 0 ? false : true
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isEdit = false
|
||||
this.form.id = ''
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.collection = this.form.collection === false ? 0 : 1
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
updateEnergyPlcParam({...this.form}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
createEnergyPlcParam({...this.form}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.form.resetFields()
|
||||
this.isEdit = false
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'EnergyPlcParamAdd',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
typeId: '',
|
||||
plcParamName: '',
|
||||
name: '',
|
||||
unit: '',
|
||||
description: '',
|
||||
collection: true,
|
||||
connectId: '',
|
||||
},
|
||||
energyListType: [],
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
typeId: [
|
||||
{ required: true, message: '能源类型不能为空', trigger: 'change' },
|
||||
],
|
||||
plcParamName: [
|
||||
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(param) {
|
||||
this.form.connectId = param.connectId;
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.energyListType = res.data || [];
|
||||
});
|
||||
if (param.id) {
|
||||
this.isEdit = true;
|
||||
this.form.id = param.id;
|
||||
getEnergyPlcParam(this.form.id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data;
|
||||
this.form.collection = this.form.collection === 0 ? false : true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isEdit = false;
|
||||
this.form.id = '';
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.form.collection = this.form.collection === false ? 0 : 1;
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
updateEnergyPlcParam({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
createEnergyPlcParam({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.form.resetFields();
|
||||
this.isEdit = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<div class="energyQuantityManualAddTable">
|
||||
<el-table
|
||||
:data="renderData"
|
||||
border
|
||||
style="width: 100%"
|
||||
:header-cell-style="{
|
||||
background: '#F2F4F9',
|
||||
color: '#606266',
|
||||
}">
|
||||
<el-table-column
|
||||
prop="tableName"
|
||||
label="表名*">
|
||||
<template slot-scope="scope">
|
||||
<div class="tableInner">
|
||||
<el-select
|
||||
v-model="scope.row.tableName"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
@change="changeSelect(scope.row, 'tableName')">
|
||||
<el-option
|
||||
v-for="item in tableNameList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="readingQuantity"
|
||||
label="抄表数*">
|
||||
<template slot-scope="scope">
|
||||
<div class="tableInner">
|
||||
<el-input-number
|
||||
v-model="scope.row.readingQuantity"
|
||||
:min="0"
|
||||
:max="999999999"
|
||||
style="width: 100%"
|
||||
:controls="false"
|
||||
@change="changeInput(scope.row, 'readingQuantity')"
|
||||
:precision="2"></el-input-number>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button
|
||||
class="addButton"
|
||||
icon="el-icon-plus"
|
||||
@click="emitButtonClick">
|
||||
新增
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'AddTable',
|
||||
props: {
|
||||
tableData: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
tableNameList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
renderData() {
|
||||
return this.tableData.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
_pageIndex: index + 1,
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
emitButtonClick() {
|
||||
this.$emit('emitButtonClick');
|
||||
},
|
||||
changeInput(val1, val2) {
|
||||
val1.prop = val2;
|
||||
this.$emit('emitFun', val1);
|
||||
},
|
||||
changeSelect(val1, val2) {
|
||||
val1.prop = val2;
|
||||
this.$emit('emitFun', val1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.energyQuantityManualAddTable {
|
||||
.el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
.addButton {
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
border-top: none;
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
border-radius: 0;
|
||||
}
|
||||
.addButton:hover {
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
.addButton:focus {
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
.tableInner .el-input__inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
height: 33px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang='scss'>
|
||||
.energyQuantityManualAddTable {
|
||||
.el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -1,167 +1,212 @@
|
||||
<template>
|
||||
<el-form ref="energyQuantityManualForm" :rules="rules" label-width="90px" :model="form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span='12'>
|
||||
<el-form-item label="抄表日期" prop="recordTime">
|
||||
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
|
||||
placeholder="选择日期" style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span='24'>
|
||||
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
|
||||
@emitFun="inputChange" @emitButtonClick="emitButtonClick" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-form
|
||||
ref="energyQuantityManualForm"
|
||||
:rules="rules"
|
||||
label-width="90px"
|
||||
:model="form">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="能源类型"
|
||||
prop="energyTypeId">
|
||||
<el-select
|
||||
v-model="form.energyTypeId"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
@change="selEnergyType"
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.labelName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="抄表日期"
|
||||
prop="recordTime">
|
||||
<el-date-picker
|
||||
v-model="form.recordTime"
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="timestamp"
|
||||
placeholder="选择日期"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<add-table
|
||||
:table-data="tableData"
|
||||
:table-name-list="tableNameList"
|
||||
@emitFun="inputChange"
|
||||
@emitButtonClick="emitButtonClick" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { energyQuantityManualCreate, energyQuantityManualUpdate, energyQuantityManualGet } from '@/api/base/energyQuantityManual'
|
||||
import moment from 'moment'
|
||||
import InputArea from './InputArea'
|
||||
import SelectArea from './SelectArea'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '表名*',
|
||||
subcomponent: SelectArea
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表数*',
|
||||
subcomponent: InputArea
|
||||
}
|
||||
]
|
||||
import {
|
||||
energyQuantityManualCreate,
|
||||
energyQuantityManualUpdate,
|
||||
energyQuantityManualGet,
|
||||
} from '@/api/base/energyQuantityManual';
|
||||
import moment from 'moment';
|
||||
import AddTable from './AddTable';
|
||||
import { energyTableGet } from '@/api/base/energyQuantityManual';
|
||||
export default {
|
||||
name: 'EnergyQuantityManualAdd',
|
||||
props: {
|
||||
energyTypeList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
tableData: [],
|
||||
addButtonShow: '新增',
|
||||
form: {
|
||||
id: '',
|
||||
energyTypeId: '',
|
||||
unit: '',
|
||||
recordTime: ''
|
||||
},
|
||||
rules: {
|
||||
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
|
||||
recordTime: [{ required: true, message: '抄表日期不能为空', trigger: 'change' }]
|
||||
},
|
||||
isEdit: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(params) {
|
||||
this.form.recordTime = moment().valueOf()
|
||||
if (params.type === 'add') {
|
||||
this.isEdit = false
|
||||
} else if (params.type === 'meterReading') {
|
||||
this.isEdit = false
|
||||
this.form.energyTypeId = params.energyTypeId
|
||||
let obj = {}
|
||||
obj.tableName = params.tableName + ''
|
||||
obj.readingQuantity = 0
|
||||
this.tableData.push(obj)
|
||||
} else {
|
||||
this.isEdit = true
|
||||
this.form.id = params.id
|
||||
this.addButtonShow = ''
|
||||
energyQuantityManualGet({ id: this.form.id }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form.energyTypeId = res.data.energyTypeId
|
||||
this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
|
||||
let obj = {}
|
||||
obj.tableName = res.data.tableName ? res.data.tableName + '' : ''
|
||||
obj.readingQuantity = res.data.readingQuantity
|
||||
this.tableData.push(obj)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
inputChange(val) {
|
||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
|
||||
},
|
||||
emitButtonClick() {
|
||||
let obj = {}
|
||||
obj.tableName = ''
|
||||
obj.readingQuantity = 0
|
||||
this.tableData.push(obj)
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['energyQuantityManualForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 校验表格
|
||||
if (this.tableData.length === 0) {
|
||||
this.$modal.msgError("抄表数据不能为空");
|
||||
return false
|
||||
} else {
|
||||
for (let item of this.tableData) {
|
||||
console.log(item)
|
||||
if (!item.tableName || (!item.readingQuantity && item.readingQuantity !== 0)) {
|
||||
this.$modal.msgError("抄表数据有空值,请检查");
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
energyQuantityManualUpdate({
|
||||
id: this.form.id,
|
||||
energyTypeId: this.form.energyTypeId,
|
||||
recordTime: this.form.recordTime,
|
||||
tableName: this.tableData[0].tableName,
|
||||
readingQuantity: this.tableData[0].readingQuantity
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
energyQuantityManualCreate({
|
||||
energyTypeId: this.form.energyTypeId,
|
||||
recordTime: this.form.recordTime,
|
||||
data: this.tableData
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.energyQuantityManualForm.resetFields()
|
||||
this.form.unit = ''
|
||||
this.isEdit = false
|
||||
this.addButtonShow = '新增'
|
||||
this.tableData = []
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'EnergyQuantityManualAdd',
|
||||
props: {
|
||||
energyTypeList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
tableNameList: [], //表名list
|
||||
addButtonShow: '新增',
|
||||
form: {
|
||||
id: '',
|
||||
energyTypeId: '',
|
||||
unit: '',
|
||||
recordTime: '',
|
||||
},
|
||||
rules: {
|
||||
energyTypeId: [
|
||||
{ required: true, message: '能源类型不能为空', trigger: 'change' },
|
||||
],
|
||||
recordTime: [
|
||||
{ required: true, message: '抄表日期不能为空', trigger: 'change' },
|
||||
],
|
||||
},
|
||||
isEdit: false,
|
||||
};
|
||||
},
|
||||
components: { AddTable },
|
||||
methods: {
|
||||
init(params) {
|
||||
this.form.recordTime = moment().valueOf();
|
||||
if (params.type === 'add') {
|
||||
this.isEdit = false;
|
||||
} 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;
|
||||
this.tableData.push(obj);
|
||||
} else {
|
||||
this.isEdit = true;
|
||||
this.form.id = params.id;
|
||||
this.addButtonShow = '';
|
||||
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;
|
||||
let obj = {};
|
||||
obj.tableName = res.data.tableName ? res.data.tableName + '' : '';
|
||||
obj.readingQuantity = res.data.readingQuantity;
|
||||
this.tableData.push(obj);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
inputChange(val) {
|
||||
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop];
|
||||
console.log(this.tableData);
|
||||
},
|
||||
emitButtonClick() {
|
||||
if (!this.form.energyTypeId) {
|
||||
this.$modal.msgWarning('请先选择能源类型');
|
||||
return false;
|
||||
}
|
||||
let obj = {};
|
||||
obj.tableName = '';
|
||||
obj.readingQuantity = 0;
|
||||
this.tableData.push(obj);
|
||||
},
|
||||
selEnergyType(id) {
|
||||
// 切换能源类型
|
||||
this.tableData = [];
|
||||
this.tableNameList = [];
|
||||
energyTableGet({ energyTypeId: id }).then((res) => {
|
||||
this.tableNameList = res.data.tableObjs || [];
|
||||
if (this.tableNameList.length === 0) {
|
||||
this.$modal.msgWarning(
|
||||
'当前能源类型暂无配置表名,请先到《表名配置》页面配置'
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['energyQuantityManualForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 校验表格
|
||||
if (this.tableData.length === 0) {
|
||||
this.$modal.msgError('抄表数据不能为空');
|
||||
return false;
|
||||
} else {
|
||||
for (let item of this.tableData) {
|
||||
console.log(item);
|
||||
if (
|
||||
!item.tableName ||
|
||||
(!item.readingQuantity && item.readingQuantity !== 0)
|
||||
) {
|
||||
this.$modal.msgError('抄表数据有空值,请检查');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
energyQuantityManualUpdate({
|
||||
id: this.form.id,
|
||||
energyTypeId: this.form.energyTypeId,
|
||||
recordTime: this.form.recordTime,
|
||||
tableName: this.tableData[0].tableName,
|
||||
readingQuantity: this.tableData[0].readingQuantity,
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
energyQuantityManualCreate({
|
||||
energyTypeId: this.form.energyTypeId,
|
||||
recordTime: this.form.recordTime,
|
||||
data: this.tableData,
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.energyQuantityManualForm.resetFields();
|
||||
this.form.unit = '';
|
||||
this.isEdit = false;
|
||||
this.addButtonShow = '新增';
|
||||
this.tableData = [];
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,271 +1,323 @@
|
||||
<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" @selection-change="selectChange">
|
||||
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
<!-- 新增 -->
|
||||
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
<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"
|
||||
@selection-change="selectChange">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel">
|
||||
<energy-quantity-manual-add
|
||||
ref="energyQuantityManualAdd"
|
||||
:energyTypeList="energyTypeList"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { energyQuantityManualPage, energyQuantityManualDelete, energyQuantityManualExport } from "@/api/base/energyQuantityManual"
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType"
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime, parseTimeTable } from '@/utils/ruoyi'
|
||||
// import FileSaver from "file-saver"
|
||||
// import * as XLSX from 'xlsx/xlsx.mjs'
|
||||
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'
|
||||
import moment from 'moment'
|
||||
import {
|
||||
energyQuantityManualPage,
|
||||
energyQuantityManualDelete,
|
||||
energyQuantityManualExport,
|
||||
} from '@/api/base/energyQuantityManual';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
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',
|
||||
label: '能源类型',
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('energy_unit'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '能源表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '抄表日期',
|
||||
filter: parseTimeTable('{y}-{m}-{d}'),
|
||||
minWidth: 110
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表值'
|
||||
},
|
||||
{
|
||||
prop: 'useQty',
|
||||
label: '差值'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'energyTypeLabel',
|
||||
label: '能源类型',
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('unit_dict'),
|
||||
minWidth: 110,
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '能源表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 110,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '抄表日期',
|
||||
filter: parseTimeTable('{y}-{m}-{d}'),
|
||||
minWidth: 110,
|
||||
},
|
||||
{
|
||||
prop: 'readingQuantity',
|
||||
label: '抄表值',
|
||||
},
|
||||
{
|
||||
prop: 'useQty',
|
||||
label: '差值',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "EnergyQuantityManual",
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '抄表日期',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: "timestamp",
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: []
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-quantity-manual:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-quantity-manual:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
? {
|
||||
type: 'meterReading',
|
||||
btnName: '抄表'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除'
|
||||
}
|
||||
: undefined
|
||||
].filter((v) => v),
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: '',
|
||||
recordTime: []
|
||||
},
|
||||
energyTypeList: [],
|
||||
exportList: [],
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
|
||||
};
|
||||
},
|
||||
components: { EnergyQuantityManualAdd },
|
||||
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')).valueOf()
|
||||
this.formConfig[1].defaultSelect = [start, end]
|
||||
this.queryParams.recordTime[0] = start
|
||||
this.queryParams.recordTime[1] = end
|
||||
this.getList();
|
||||
this.getTypeList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
this.queryParams.recordTime[0] = val.timeVal ? moment(moment(val.timeVal[0]).format('YYYY-MM-DD 00:00:00')).valueOf() : null
|
||||
this.queryParams.recordTime[1] = val.timeVal ? moment(moment(val.timeVal[1]).format('YYYY-MM-DD 23:59:59')).valueOf() : null
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.getList()
|
||||
break
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
let params = {}
|
||||
params.type = 'add'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(params)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.$modal.confirm('是否确认导出').then(() => {
|
||||
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
}).catch(() => { })
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyQuantityManualPage(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
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.centervisible = true
|
||||
let paramA = {}
|
||||
paramA.type = 'edit'
|
||||
paramA.id = val.data.id
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramA)
|
||||
})
|
||||
break
|
||||
case 'meterReading':
|
||||
this.addOrEditTitle = '新增'
|
||||
this.centervisible = true
|
||||
let paramB = {}
|
||||
paramB.type = 'meterReading'
|
||||
paramB.energyTypeId = val.data.energyTypeId
|
||||
paramB.tableName = val.data.tableName
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramB)
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.handleDelete(val.data)
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.energyQuantityManualAdd.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyQuantityManualAdd.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row.id)
|
||||
this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function () {
|
||||
return energyQuantityManualDelete({ id: row.id });
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
name: 'EnergyQuantityManual',
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
labelField: 'labelName',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '抄表日期',
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-quantity-manual:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:create')
|
||||
? {
|
||||
type: 'meterReading',
|
||||
btnName: '抄表',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:energy-quantity-manual:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: '',
|
||||
recordTime: [],
|
||||
},
|
||||
energyTypeList: [],
|
||||
exportList: [],
|
||||
addOrEditTitle: '',
|
||||
centervisible: false,
|
||||
};
|
||||
},
|
||||
components: { EnergyQuantityManualAdd },
|
||||
mixins: [tableHeightMixin],
|
||||
created() {
|
||||
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')
|
||||
).valueOf();
|
||||
this.formConfig[1].defaultSelect = [start, end];
|
||||
this.queryParams.recordTime[0] = start;
|
||||
this.queryParams.recordTime[1] = end;
|
||||
this.getList();
|
||||
this.getTypeList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId;
|
||||
this.queryParams.recordTime[0] = val.timeVal
|
||||
? moment(moment(val.timeVal[0]).format('YYYY-MM-DD 00:00:00')).valueOf()
|
||||
: null;
|
||||
this.queryParams.recordTime[1] = val.timeVal
|
||||
? moment(moment(val.timeVal[1]).format('YYYY-MM-DD 23:59:59')).valueOf()
|
||||
: null;
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.getList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
let params = {};
|
||||
params.type = 'add';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(params);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$modal
|
||||
.confirm('是否确认导出')
|
||||
.then(() => {
|
||||
return energyQuantityManualExport({
|
||||
energyTypeId: this.queryParams.energyTypeId,
|
||||
recordTime: this.queryParams.recordTime,
|
||||
});
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '能源报表.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyQuantityManualPage(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.energyType === 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;
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.centervisible = true;
|
||||
let paramA = {};
|
||||
paramA.type = 'edit';
|
||||
paramA.id = val.data.id;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramA);
|
||||
});
|
||||
break;
|
||||
case 'meterReading':
|
||||
this.addOrEditTitle = '新增';
|
||||
this.centervisible = true;
|
||||
let paramB = {};
|
||||
paramB.type = 'meterReading';
|
||||
paramB.energyTypeId = val.data.energyTypeId;
|
||||
paramB.tableName = val.data.tableName;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyQuantityManualAdd.init(paramB);
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.handleDelete(val.data);
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
handleCancel() {
|
||||
this.$refs.energyQuantityManualAdd.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyQuantityManualAdd.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row.id);
|
||||
this.$modal
|
||||
.confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?')
|
||||
.then(function () {
|
||||
return energyQuantityManualDelete({ id: row.id });
|
||||
})
|
||||
.then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
label-width="100px"
|
||||
:model="form">
|
||||
<el-form-item
|
||||
label="能源类型"
|
||||
prop="energyType">
|
||||
<el-input v-model="form.energyType"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="能源表名"
|
||||
prop="tableIds">
|
||||
<el-select
|
||||
v-model="form.tableIds"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
:multiple="true"
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="dict in getDictDatas('table_name')"
|
||||
:key="dict.id"
|
||||
:label="dict.label"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
energyTableGet,
|
||||
energyTableUpdate,
|
||||
} from '@/api/base/energyQuantityManual';
|
||||
export default {
|
||||
name: 'TableNameConfigUpdate',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
energyType: '',
|
||||
energyTypeId: '',
|
||||
tableIds: [],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
energyTableGet({ energyTypeId: id }).then((res) => {
|
||||
this.form.energyType = res.data.energyType || '';
|
||||
this.form.energyTypeId = res.data.energyTypeId || '';
|
||||
this.form.tableIds =
|
||||
res.data.tableObjs &&
|
||||
res.data.tableObjs.map((item) => {
|
||||
return item.id;
|
||||
});
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
// 编辑
|
||||
energyTableUpdate({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
formClear() {
|
||||
this.form.energyType = '';
|
||||
this.form.energyTypeId = '';
|
||||
this.form.tableIds = [];
|
||||
this.isEdit = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
108
src/views/energy/base/tableNameConfig/index.vue
Normal file
108
src/views/energy/base/tableNameConfig/index.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<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>
|
||||
<!-- 新增 -->
|
||||
<base-dialog
|
||||
dialogTitle="编辑"
|
||||
:dialogVisible="centervisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel">
|
||||
<table-name-config-update
|
||||
ref="tableNameConfigU"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
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',
|
||||
label: '能源类型',
|
||||
width: 200,
|
||||
filter: publicFormatter('energy_type'),
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '能源表名',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: 'TableNameConfig',
|
||||
components: { tableNameConfigUpdate },
|
||||
data() {
|
||||
return {
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:table-name-config:edit')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
},
|
||||
heightNum: 165,
|
||||
centervisible: false,
|
||||
};
|
||||
},
|
||||
mixins: [tableHeightMixin],
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
energyTablePage({ ...this.queryParams }).then((res) => {
|
||||
let temp = res.data.list || [];
|
||||
this.list = temp.map((item) => {
|
||||
return {
|
||||
energyType: item.energyType,
|
||||
energyTypeId: item.energyTypeId,
|
||||
tableName: item.tables.join('、'),
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log('编辑');
|
||||
this.centervisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tableNameConfigU.init(val.data.energyTypeId);
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.tableNameConfigU.formClear();
|
||||
this.centervisible = false;
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.tableNameConfigU.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -33,11 +33,28 @@
|
||||
v-model="objIds"
|
||||
:options="objList"
|
||||
:props="{ checkStrictly: true, value: 'id', label: 'name' }"
|
||||
popper-class="cascaderParent"
|
||||
@change="selectObj"
|
||||
clearable></el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="监控能源类型"
|
||||
prop="energyTypeId">
|
||||
<el-select
|
||||
v-model="form.energyTypeId"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
@change="toggleType">
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.labelName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="12"
|
||||
v-if="form.method == 2">
|
||||
@@ -56,24 +73,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="监控能源类型"
|
||||
prop="energyTypeId">
|
||||
<el-select
|
||||
v-model="form.energyTypeId"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
filterable
|
||||
@change="toggleType">
|
||||
<el-option
|
||||
v-for="item in this.energyTypeList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="12"
|
||||
v-if="form.method == 1">
|
||||
@@ -183,6 +182,7 @@ export default {
|
||||
limitType: '',
|
||||
minValue: 0,
|
||||
maxValue: 0,
|
||||
tableName: '',
|
||||
},
|
||||
objIds: [], // 回显数组
|
||||
isEdit: false, //是否是编辑
|
||||
@@ -215,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 + ''
|
||||
@@ -295,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 = '';
|
||||
@@ -353,8 +356,3 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.cascaderParent .el-cascader-panel .el-scrollbar:first-child .el-radio {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -48,9 +48,10 @@ import {
|
||||
deleteEnergyLimit,
|
||||
} from '@/api/monitoring/energyLimit';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { getTree } from '@/api/base/factory';
|
||||
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',
|
||||
@@ -60,20 +61,27 @@ const tableProps = [
|
||||
{
|
||||
prop: 'objName',
|
||||
label: '监控对象',
|
||||
minWidth: 100,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'objCode',
|
||||
label: '对象编码',
|
||||
minWidth: 140,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'tableName',
|
||||
label: '能源表名',
|
||||
filter: publicFormatter('table_name'),
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
filter: publicFormatter('energy_type'),
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
@@ -97,6 +105,7 @@ const tableProps = [
|
||||
export default {
|
||||
name: 'EnergyLimit',
|
||||
components: { EnergyLimitAdd },
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
@@ -104,6 +113,7 @@ export default {
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
labelField: 'labelName',
|
||||
param: 'energyTypeId',
|
||||
},
|
||||
{
|
||||
@@ -148,7 +158,6 @@ export default {
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
@@ -173,9 +182,6 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260);
|
||||
});
|
||||
this.getList();
|
||||
this.getTypeList();
|
||||
// 获取对象树形结构
|
||||
|
||||
@@ -1,248 +1,270 @@
|
||||
<template>
|
||||
<div class="app-container energyOverlimitLog">
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<el-tabs v-model="activeName" @tab-click="toggleTab">
|
||||
<el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
|
||||
<el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 列表 -->
|
||||
<div v-if="activeName === 'auto'">
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
|
||||
:max-height="tableH" />
|
||||
</div>
|
||||
<div v-if="activeName === 'manual'">
|
||||
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps2"
|
||||
:table-data="list2" :max-height="tableH" />
|
||||
</div>
|
||||
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
<div class="app-container energyOverlimitLog">
|
||||
<!-- 搜索工作栏 -->
|
||||
<search-bar
|
||||
:formConfigs="formConfig"
|
||||
ref="searchBarForm"
|
||||
@headBtnClick="buttonClick" />
|
||||
<el-tabs
|
||||
v-model="activeName"
|
||||
@tab-click="toggleTab">
|
||||
<el-tab-pane
|
||||
label="自动抄表"
|
||||
name="auto"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
label="手动抄表"
|
||||
name="manual"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 列表 -->
|
||||
<div v-if="activeName === 'auto'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps"
|
||||
:table-data="list"
|
||||
:max-height="tableH" />
|
||||
</div>
|
||||
<div v-if="activeName === 'manual'">
|
||||
<base-table
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-props="tableProps2"
|
||||
:table-data="list2"
|
||||
:max-height="tableH" />
|
||||
</div>
|
||||
<pagination
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEnergyOverlimitLogPage } from "@/api/monitoring/energyOverlimitLog";
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType";
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
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',
|
||||
label: '监控对象'
|
||||
},
|
||||
{
|
||||
prop: 'objCode',
|
||||
label: '对象编码'
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '监控模式'
|
||||
},
|
||||
{
|
||||
prop: 'paramName',
|
||||
label: '监控参数'
|
||||
},
|
||||
{
|
||||
prop: 'limitType',
|
||||
label: '指标类型',
|
||||
filter: publicFormatter('monitor_index_type')
|
||||
},
|
||||
{
|
||||
prop: 'realityValue',
|
||||
label: '实际值'
|
||||
},
|
||||
{
|
||||
prop: 'limitValue',
|
||||
label: '阈值'
|
||||
},
|
||||
{
|
||||
prop: 'overValue',
|
||||
label: '超出值'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '提醒时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'objName',
|
||||
label: '监控对象',
|
||||
},
|
||||
{
|
||||
prop: 'objCode',
|
||||
label: '对象编码',
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
filter: publicFormatter('energy_type'),
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '监控模式',
|
||||
},
|
||||
{
|
||||
prop: 'paramName',
|
||||
label: '监控参数',
|
||||
},
|
||||
{
|
||||
prop: 'limitType',
|
||||
label: '指标类型',
|
||||
filter: publicFormatter('monitor_index_type'),
|
||||
},
|
||||
{
|
||||
prop: 'realityValue',
|
||||
label: '实际值',
|
||||
},
|
||||
{
|
||||
prop: 'limitValue',
|
||||
label: '阈值',
|
||||
},
|
||||
{
|
||||
prop: 'overValue',
|
||||
label: '超出值',
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '提醒时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
const tableProps2 = [
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
},
|
||||
{
|
||||
prop: 'limitType',
|
||||
label: '指标类型',
|
||||
filter: publicFormatter('monitor_index_type')
|
||||
},
|
||||
{
|
||||
prop: 'realityValue',
|
||||
label: '实际值'
|
||||
},
|
||||
{
|
||||
prop: 'limitValue',
|
||||
label: '阈值'
|
||||
},
|
||||
{
|
||||
prop: 'overValue',
|
||||
label: '超出值'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '提醒时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
filter: publicFormatter('energy_type'),
|
||||
},
|
||||
{
|
||||
prop: 'limitType',
|
||||
label: '指标类型',
|
||||
filter: publicFormatter('monitor_index_type'),
|
||||
},
|
||||
{
|
||||
prop: 'realityValue',
|
||||
label: '实际值',
|
||||
},
|
||||
{
|
||||
prop: 'limitValue',
|
||||
label: '阈值',
|
||||
},
|
||||
{
|
||||
prop: 'overValue',
|
||||
label: '超出值',
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '提醒时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "EnergyOverlimitLog",
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId'
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标类型',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.MONITOR_INDEX_TYPE),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'indexType'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
}
|
||||
],
|
||||
activeName: 'auto',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
tableH: this.tableHeight(260),
|
||||
total: 0,
|
||||
list: [],
|
||||
list2: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: '',
|
||||
indexType: '',
|
||||
method: '1'
|
||||
},
|
||||
typeList: [
|
||||
{ id: 1, name: '合并' },
|
||||
{ id: 2, name: '详细' }
|
||||
]
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList();
|
||||
this.getTypeList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
this.queryParams.indexType = val.indexType
|
||||
this.getList()
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getEnergyOverlimitLogPage(this.queryParams).then(response => {
|
||||
let arr = response.data.list || [];
|
||||
arr && arr.map((item) => {
|
||||
this.typeList.map((i) => {
|
||||
if (item.type === i.id) {
|
||||
item.type = i.name
|
||||
}
|
||||
})
|
||||
if (item.minValue && item.maxValue) {
|
||||
item.limitValue = item.minValue + '-' + item.maxValue
|
||||
} else if (item.minValue) {
|
||||
item.limitValue = '最小值' + item.minValue
|
||||
} else if (item.maxValue) {
|
||||
item.limitValue = '最大值' + item.maxValue
|
||||
} else {
|
||||
item.limitValue = ''
|
||||
}
|
||||
})
|
||||
if (this.queryParams.method === '1') {
|
||||
this.list = arr
|
||||
this.list2 = []
|
||||
} else {
|
||||
this.list2 = arr
|
||||
this.list1 = []
|
||||
}
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
console.log(res)
|
||||
this.formConfig[0].selectOptions = res.data || []
|
||||
})
|
||||
},
|
||||
toggleTab() {
|
||||
if (this.activeName === 'auto') {
|
||||
this.queryParams.method = '1'
|
||||
} else {
|
||||
this.queryParams.method = '2'
|
||||
}
|
||||
this.queryParams.pageNo = 1
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
name: 'EnergyOverlimitLog',
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
labelField: 'labelName',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '指标类型',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.MONITOR_INDEX_TYPE),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'indexType',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
activeName: 'auto',
|
||||
tableProps,
|
||||
tableProps2,
|
||||
total: 0,
|
||||
list: [],
|
||||
list2: [],
|
||||
heightNum: 300,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: '',
|
||||
indexType: '',
|
||||
method: '1',
|
||||
},
|
||||
typeList: [
|
||||
{ id: 1, name: '合并' },
|
||||
{ id: 2, name: '详细' },
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getTypeList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId;
|
||||
this.queryParams.indexType = val.indexType;
|
||||
this.getList();
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getEnergyOverlimitLogPage(this.queryParams).then((response) => {
|
||||
let arr = response.data.list || [];
|
||||
arr &&
|
||||
arr.map((item) => {
|
||||
this.typeList.map((i) => {
|
||||
if (item.type === i.id) {
|
||||
item.type = i.name;
|
||||
}
|
||||
});
|
||||
if (item.minValue && item.maxValue) {
|
||||
item.limitValue = item.minValue + '-' + item.maxValue;
|
||||
} else if (item.minValue) {
|
||||
item.limitValue = '最小值' + item.minValue;
|
||||
} else if (item.maxValue) {
|
||||
item.limitValue = '最大值' + item.maxValue;
|
||||
} else {
|
||||
item.limitValue = '';
|
||||
}
|
||||
});
|
||||
if (this.queryParams.method === '1') {
|
||||
this.list = arr;
|
||||
this.list2 = [];
|
||||
} else {
|
||||
this.list2 = arr;
|
||||
this.list1 = [];
|
||||
}
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
console.log(res);
|
||||
this.formConfig[0].selectOptions = res.data || [];
|
||||
});
|
||||
},
|
||||
toggleTab() {
|
||||
if (this.activeName === 'auto') {
|
||||
this.queryParams.method = '1';
|
||||
} else {
|
||||
this.queryParams.method = '2';
|
||||
}
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.energyOverlimitLog {
|
||||
.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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,185 +1,198 @@
|
||||
<template>
|
||||
<div class="app-container" id='energyReportBox'>
|
||||
|
||||
<!-- 搜索工作栏 -->
|
||||
<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="energyReportBox">
|
||||
<!-- 搜索工作栏 -->
|
||||
<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 { energyReportPageAuto, energyReportPageExportAuto } from "@/api/monitoring/energyReport"
|
||||
import { getEnergyTypeListAll } from "@/api/base/energyType";
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import {
|
||||
energyReportPageAuto,
|
||||
energyReportPageExportAuto,
|
||||
} from '@/api/monitoring/energyReport';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'statisticType',
|
||||
label: '统计类型',
|
||||
filter: publicFormatter('statistic_type')
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '开始时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '结束时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'statisticName',
|
||||
label: '统计方案'
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
},
|
||||
{
|
||||
prop: 'startNum',
|
||||
label: '抄表数(起始)'
|
||||
},
|
||||
{
|
||||
prop: 'endNum',
|
||||
label: '抄表数(结束)'
|
||||
},
|
||||
{
|
||||
prop: 'useNum',
|
||||
label: '消耗量'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'statisticType',
|
||||
label: '统计类型',
|
||||
filter: publicFormatter('statistic_type'),
|
||||
},
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '开始时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'endTime',
|
||||
label: '结束时间',
|
||||
filter: parseTime,
|
||||
minWidth: 160,
|
||||
},
|
||||
{
|
||||
prop: 'statisticName',
|
||||
label: '统计方案',
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型',
|
||||
filter: publicFormatter('energy_type'),
|
||||
},
|
||||
{
|
||||
prop: 'startNum',
|
||||
label: '抄表数(起始)',
|
||||
},
|
||||
{
|
||||
prop: 'endNum',
|
||||
label: '抄表数(结束)',
|
||||
},
|
||||
{
|
||||
prop: 'useNum',
|
||||
label: '消耗量',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "EnergyLimit",
|
||||
data() {
|
||||
return {
|
||||
isFold: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '统计类型',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.STATISTIC_TYPE),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'statisticType'
|
||||
},
|
||||
{
|
||||
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('monitoring:energy-report:export') ? 'button' : '',
|
||||
btnName: '导出',
|
||||
name: 'add',
|
||||
color: 'primary',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: null,
|
||||
statisticType: null,
|
||||
startTime: null,
|
||||
endTime: null
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
this.isFold = this.searchBarWidth('energyReportBox', 1198)
|
||||
})
|
||||
this.getList()
|
||||
this.getTypeList()
|
||||
},
|
||||
mounted() {
|
||||
this.isFold = this.searchBarWidth('energyReportBox', 1198)
|
||||
},
|
||||
methods: {
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data || []
|
||||
// this.energyTypeList = res.data || []
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1
|
||||
this.queryParams.energyTypeId = val.energyTypeId
|
||||
this.queryParams.statisticType = val.statisticType
|
||||
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 energyReportPageExportAuto({...this.queryParams});
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '能源统计报表.xls');
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyReportPageAuto(this.queryParams).then(response => {
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total;
|
||||
});
|
||||
}
|
||||
}
|
||||
name: 'EnergyReport',
|
||||
data() {
|
||||
return {
|
||||
isFold: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '能源类型',
|
||||
labelField: 'labelName',
|
||||
selectOptions: [],
|
||||
param: 'energyTypeId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '统计类型',
|
||||
selectOptions: this.getDictDatas(this.DICT_TYPE.STATISTIC_TYPE),
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
param: 'statisticType',
|
||||
},
|
||||
{
|
||||
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('monitoring:energy-report:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'add',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
tableH: this.tableHeight(260),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
energyTypeId: null,
|
||||
statisticType: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', this._eventListeners);
|
||||
this.getList();
|
||||
this.getTypeList();
|
||||
},
|
||||
mounted() {
|
||||
this.isFold = this.searchBarWidth('energyReportBox', 1198);
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('resize', this._eventListeners);
|
||||
},
|
||||
methods: {
|
||||
_eventListeners() {
|
||||
this.tableH = this.tableHeight(260);
|
||||
this.isFold = this.searchBarWidth('energyReportBox', 1198);
|
||||
},
|
||||
getTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.formConfig[0].selectOptions = res.data || [];
|
||||
// this.energyTypeList = res.data || []
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.queryParams.pageNo = 1;
|
||||
this.queryParams.energyTypeId = val.energyTypeId;
|
||||
this.queryParams.statisticType = val.statisticType;
|
||||
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 energyReportPageExportAuto({ ...this.queryParams });
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '能耗统计报表.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
energyReportPageAuto(this.queryParams).then((response) => {
|
||||
this.list = response.data.list || [];
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,128 +1,160 @@
|
||||
<template>
|
||||
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="方案名称" prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="方案编码" prop="code">
|
||||
<el-input v-model="form.code" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="统计类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.STATISTIC_TYPE)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="能源类型" prop="energyTypeId">
|
||||
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
|
||||
<el-option
|
||||
v-for="item in energyListType"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-form
|
||||
ref="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
:model="form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="方案名称"
|
||||
prop="name">
|
||||
<el-input v-model="form.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="方案编码"
|
||||
prop="code">
|
||||
<el-input
|
||||
v-model="form.code"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="统计类型"
|
||||
prop="type">
|
||||
<el-select
|
||||
v-model="form.type"
|
||||
placeholder="请选择"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in getDictDatas(DICT_TYPE.STATISTIC_TYPE)"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="能源类型"
|
||||
prop="energyTypeId">
|
||||
<el-select
|
||||
v-model="form.energyTypeId"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="item in energyListType"
|
||||
:key="item.id"
|
||||
:label="item.labelName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="remark">
|
||||
<el-input v-model="form.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import { getCode, createEnergyStatistics, updateEnergyStatistics, getEnergyStatistics } from "@/api/monitoring/energyStatistics";
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType'
|
||||
import {
|
||||
getCode,
|
||||
createEnergyStatistics,
|
||||
updateEnergyStatistics,
|
||||
getEnergyStatistics,
|
||||
} from '@/api/monitoring/energyStatistics';
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType';
|
||||
import { number } from 'echarts';
|
||||
export default {
|
||||
name: 'EnergyStatisticsAdd',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
name: '',
|
||||
code: '',
|
||||
type: '',
|
||||
energyTypeId: ''
|
||||
},
|
||||
plcList: [],
|
||||
objList: [],
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
name: [{ required: true, message: '方案名称不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '统计类型不能为空', trigger: 'change' }],
|
||||
energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }]
|
||||
},
|
||||
energyListType: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.energyListType = res.data || []
|
||||
})
|
||||
if (id) {
|
||||
this.isEdit = true
|
||||
this.form.id = id
|
||||
getEnergyStatistics( id ).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
this.form.type = this.form.type + ''
|
||||
}
|
||||
})
|
||||
} else {
|
||||
getCode().then((res) => {
|
||||
this.form.code = res.data
|
||||
})
|
||||
this.isEdit = false
|
||||
this.form.id = ''
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
updateEnergyStatistics({...this.form}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
createEnergyStatistics({...this.form}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.form.resetFields()
|
||||
this.isEdit = false
|
||||
}
|
||||
}
|
||||
}
|
||||
name: 'EnergyStatisticsAdd',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
id: '',
|
||||
name: '',
|
||||
code: '',
|
||||
type: '',
|
||||
energyTypeId: '',
|
||||
},
|
||||
plcList: [],
|
||||
objList: [],
|
||||
isEdit: false, //是否是编辑
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '方案名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '统计类型不能为空', trigger: 'change' },
|
||||
],
|
||||
energyTypeId: [
|
||||
{ required: true, message: '能源类型不能为空', trigger: 'change' },
|
||||
],
|
||||
},
|
||||
energyListType: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.energyListType = res.data || [];
|
||||
});
|
||||
if (id) {
|
||||
this.isEdit = true;
|
||||
this.form.id = id;
|
||||
getEnergyStatistics(id).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data;
|
||||
this.form.type = this.form.type + '';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
getCode().then((res) => {
|
||||
this.form.code = res.data;
|
||||
});
|
||||
this.isEdit = false;
|
||||
this.form.id = '';
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.isEdit) {
|
||||
// 编辑
|
||||
updateEnergyStatistics({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
createEnergyStatistics({ ...this.form }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.$emit('successSubmit');
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
formClear() {
|
||||
this.$refs.form.resetFields();
|
||||
this.isEdit = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,222 +1,259 @@
|
||||
<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 :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
|
||||
@confirm="handleConfirm" :before-close="handleCancel">
|
||||
<energy-statistics-add ref="energyStatistics" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 参数绑定/查看 -->
|
||||
<energy-statistics-det ref="plcParam" @closeDrawer="closeDrawer"
|
||||
:energyTypeList="energyTypeList"></energy-statistics-det>
|
||||
</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>
|
||||
<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-statistics-add
|
||||
ref="energyStatistics"
|
||||
@successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
<!-- 参数绑定/查看 -->
|
||||
<energy-statistics-det
|
||||
ref="plcParam"
|
||||
@closeDrawer="closeDrawer"
|
||||
:energyTypeList="energyTypeList"></energy-statistics-det>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getEnergyStatisticsPage, deleteEnergyStatistics } from "@/api/monitoring/energyStatistics";
|
||||
import { publicFormatter } from '@/utils/dict'
|
||||
import { getEnergyTypeListAll } from '@/api/base/energyType'
|
||||
import EnergyStatisticsAdd from './components/energyStatisticsAdd'
|
||||
import EnergyStatisticsDet from './components/energyStatisticsDet'
|
||||
import {
|
||||
getEnergyStatisticsPage,
|
||||
deleteEnergyStatistics,
|
||||
} from '@/api/monitoring/energyStatistics';
|
||||
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',
|
||||
label: '方案名称'
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '方案编码',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '统计类型',
|
||||
filter: publicFormatter('statistic_type')
|
||||
},
|
||||
{
|
||||
prop: 'energyType',
|
||||
label: '能源类型'
|
||||
},
|
||||
{
|
||||
prop: 'paramNum',
|
||||
label: '统计参数数量'
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注'
|
||||
}
|
||||
]
|
||||
{
|
||||
prop: 'name',
|
||||
label: '方案名称',
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '方案编码',
|
||||
minWidth: 120,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '统计类型',
|
||||
filter: publicFormatter('statistic_type'),
|
||||
},
|
||||
{
|
||||
prop: 'energyTypeLabel',
|
||||
label: '能源类型',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'paramNum',
|
||||
label: '统计参数数量',
|
||||
},
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
},
|
||||
];
|
||||
export default {
|
||||
name: "EnergyStatistics",
|
||||
components: { EnergyStatisticsAdd, EnergyStatisticsDet },
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '方案名称',
|
||||
placeholder: '方案名称',
|
||||
param: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary'
|
||||
},
|
||||
{
|
||||
type: 'separate'
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('monitoring:energy-statistics:create') ? 'button' : '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('monitoring:energy-statistics:bind')
|
||||
? {
|
||||
type: 'connect',
|
||||
btnName: '绑定'
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '详情'
|
||||
},
|
||||
this.$auth.hasPermi('monitoring:energy-statistics:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑'
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('monitoring:energy-statistics: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
|
||||
},
|
||||
energyTypeList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
this.getList();
|
||||
},
|
||||
mounted() {
|
||||
// 获取能源列表
|
||||
this.getEnergyTypeList()
|
||||
},
|
||||
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.energyStatistics.init()
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
getEnergyStatisticsPage(this.queryParams).then(response => {
|
||||
let arr = response.data.list || [];
|
||||
this.list = arr
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val)
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑'
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyStatistics.init(val.data.id)
|
||||
})
|
||||
this.centervisible = true
|
||||
break
|
||||
case 'delete':
|
||||
this.handleDelete(val.data)
|
||||
break
|
||||
case 'detail':
|
||||
this.$nextTick(() => {
|
||||
this.$refs.plcParam.init(val.data, 'detail')
|
||||
})
|
||||
break
|
||||
default:
|
||||
this.$nextTick(() => {
|
||||
this.$refs.plcParam.init(val.data, 'connect')
|
||||
})
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.energyStatistics.formClear()
|
||||
this.centervisible = false
|
||||
this.addOrEditTitle = ''
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyStatistics.submitForm()
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel()
|
||||
this.getList()
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?').then(function () {
|
||||
return deleteEnergyStatistics(row.id);
|
||||
}).then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
closeDrawer() {
|
||||
this.getList()
|
||||
},
|
||||
getEnergyTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.energyTypeList = res.data || []
|
||||
})
|
||||
}
|
||||
}
|
||||
name: 'EnergyStatistics',
|
||||
components: { EnergyStatisticsAdd, EnergyStatisticsDet },
|
||||
mixins: [tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '方案名称',
|
||||
placeholder: '方案名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('monitoring:energy-statistics:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('monitoring:energy-statistics:bind')
|
||||
? {
|
||||
type: 'connect',
|
||||
btnName: '绑定',
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
this.$auth.hasPermi('monitoring:energy-statistics:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('monitoring:energy-statistics:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
}
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 班次基础信息列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
addOrEditTitle: '',
|
||||
// 是否显示弹出层
|
||||
centervisible: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
},
|
||||
energyTypeList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
mounted() {
|
||||
// 获取能源列表
|
||||
this.getEnergyTypeList();
|
||||
},
|
||||
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.energyStatistics.init();
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
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;
|
||||
});
|
||||
},
|
||||
handleClick(val) {
|
||||
console.log(val);
|
||||
switch (val.type) {
|
||||
case 'edit':
|
||||
this.addOrEditTitle = '编辑';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.energyStatistics.init(val.data.id);
|
||||
});
|
||||
this.centervisible = true;
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDelete(val.data);
|
||||
break;
|
||||
case 'detail':
|
||||
this.$nextTick(() => {
|
||||
this.$refs.plcParam.init(val.data, 'detail');
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$nextTick(() => {
|
||||
this.$refs.plcParam.init(val.data, 'connect');
|
||||
});
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$refs.energyStatistics.formClear();
|
||||
this.centervisible = false;
|
||||
this.addOrEditTitle = '';
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$refs.energyStatistics.submitForm();
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEnergyStatistics(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
closeDrawer() {
|
||||
this.getList();
|
||||
},
|
||||
getEnergyTypeList() {
|
||||
getEnergyTypeListAll().then((res) => {
|
||||
this.energyTypeList = res.data || [];
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -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>
|
||||
@@ -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"
|
||||
@@ -33,6 +34,7 @@ import {
|
||||
getEqAnalysis,
|
||||
exportEqAnalysisExcel,
|
||||
} from '@/api/equipment/analysis/statistics';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const tableProps = [
|
||||
// {
|
||||
@@ -52,35 +54,49 @@ const tableProps = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'sectionName',
|
||||
label: '工段',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
minWidth: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'equipmentType',
|
||||
label: '设备类型',
|
||||
width: 150,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'workTime',
|
||||
label: '工作时间累积(h)',
|
||||
width: 160,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'repairCount',
|
||||
label: '维修次数',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'maintainCount',
|
||||
label: '保养次数',
|
||||
width: 120,
|
||||
showOverflowtooltip: true
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
mixins: [basicPage, tableHeightMixin],
|
||||
data() {
|
||||
const today = new Date();
|
||||
|
||||
@@ -110,7 +126,7 @@ export default {
|
||||
tableBtn: [].filter((v) => v),
|
||||
tableData: [],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
total: 1,
|
||||
recordTime: [
|
||||
|
||||
@@ -75,6 +75,12 @@ export default {
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: (v) => {
|
||||
const num = String(v.value)?.split('.').length === 2 ? v.value?.toFixed(2) : v.value
|
||||
return `<div>
|
||||
<span>${v.name}: ${num}</span>
|
||||
</div>`
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
max-height="600"
|
||||
:max-height="tableH"
|
||||
@emitFun="handleEmitFun">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
@@ -42,14 +42,16 @@
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'ExceptionAnalysis',
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
heightNum: 220,
|
||||
searchBarKeys: ['name', 'code'],
|
||||
// tableBtn: [
|
||||
// this.$auth.hasPermi('base:equipment-group:update')
|
||||
|
||||
@@ -48,9 +48,11 @@
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import LineChart from './components/lineChart.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'QualityAnalysis',
|
||||
mixins: [tableHeightMixin],
|
||||
components: { LineChart },
|
||||
props: {},
|
||||
data() {
|
||||
@@ -58,7 +60,6 @@ export default {
|
||||
const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableH: this.tableHeight(260),
|
||||
urls: {
|
||||
page: '/analysis/equipment-analysis/quality',
|
||||
},
|
||||
@@ -254,9 +255,9 @@ export default {
|
||||
this.fillProductOptions();
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
// window.addEventListener('resize', () => {
|
||||
// this.tableH = this.tableHeight(260)
|
||||
// })
|
||||
this.$refs['search-bar'].headBtnClick('search');
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -61,6 +62,8 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import AddOrUpdate from './AddOrUpdate.vue';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
const btn = {
|
||||
@@ -89,7 +92,7 @@ const btn = {
|
||||
export default {
|
||||
name: 'Record',
|
||||
components: { AddOrUpdate },
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
readOnly: false,
|
||||
@@ -116,17 +119,17 @@ export default {
|
||||
// : undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'productionLine', label: '产线' },
|
||||
{ prop: 'workshopSection', label: '工段' },
|
||||
{ prop: 'equipment', label: '设备名称' },
|
||||
{ prop: 'productionLine', label: '产线', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'workshopSection', label: '工段', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'equipment', label: '设备名称', width: 120, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
||||
},
|
||||
{ prop: 'createTime', label: '报警时间', filter: timeFilter },
|
||||
{ prop: 'alarmCode', label: '设备报警码' },
|
||||
{ prop: 'alarmContent', label: '报警内容' },
|
||||
{ prop: 'createTime', label: '报警时间', filter: timeFilter, width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'alarmCode', label: '设备报警码', width: 180, showOverflowtooltip: true },
|
||||
{ prop: 'alarmContent', label: '报警内容', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'opt1', label: '处理记录', name: '查看', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '处理', name: '报警处理', subcomponent: btn },
|
||||
// { prop: 'remark', label: '备注' },
|
||||
@@ -203,7 +206,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
lineId: null,
|
||||
equipmentId: null,
|
||||
recordTime: [],
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -70,7 +71,7 @@
|
||||
queryParams: {
|
||||
equipmentGroupId: alarmForm.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:alarm-group:update')
|
||||
@@ -109,10 +110,11 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
// import { getAccessToken } from '@/utils/auth';
|
||||
import BasicDrawer from './components/BasicDrawer.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentGroup',
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
components: { BasicDrawer },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -72,7 +73,7 @@
|
||||
queryParams: {
|
||||
equipmentGroupId: alarmForm.id,
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
},
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:equipment-group:update')
|
||||
@@ -112,11 +113,12 @@ import moment from 'moment';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import BasicDrawer from './components/BasicDrawer.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentBindGroup',
|
||||
components: { BasicDrawer },
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
searchBarKeys: ['groupId', 'equipmentName'],
|
||||
@@ -254,7 +256,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
equipmentName: null,
|
||||
groupId: null,
|
||||
},
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -127,10 +128,11 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import BasicDrawer from './components/BasicDrawer.vue';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentPlcConnect',
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
components: { BasicDrawer, AddOrUpdate },
|
||||
data() {
|
||||
return {
|
||||
@@ -156,14 +158,14 @@ export default {
|
||||
: undefined,
|
||||
].filter((v) => v),
|
||||
tableProps: [
|
||||
{ prop: 'productionLine', label: '产线' },
|
||||
{ prop: 'workshopSection', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备名' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'plcCode', label: '关联表编码' },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'plcName', label: '标识名称' },
|
||||
{ prop: 'bindingParameters', label: '绑定参数数量' },
|
||||
{ prop: 'productionLine', label: '产线', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'workshopSection', label: '工段', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentName', label: '设备名', width: 120, showOverflowtooltip: true },
|
||||
{ prop: 'equipmentCode', label: '设备编码', width: 200, showOverflowtooltip: true },
|
||||
{ prop: 'plcCode', label: '关联表编码', width: 220, showOverflowtooltip: true },
|
||||
{ prop: 'plcTableName', label: '关联表名', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'plcName', label: '标识名称', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'bindingParameters', label: '绑定参数数量', width: 120, showOverflowtooltip: true },
|
||||
// {
|
||||
// _action: 'params-bind',
|
||||
// label: '查看绑定',
|
||||
@@ -269,7 +271,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
plcId: null,
|
||||
equipmentId: null,
|
||||
},
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
ref="pageTable"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -60,6 +61,7 @@ import {
|
||||
exportEquipmentPlcExcel,
|
||||
} from '@/api/base/equipmentPlc';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const switchBtn = {
|
||||
name: 'SwitchBtn',
|
||||
@@ -99,7 +101,7 @@ const switchBtn = {
|
||||
|
||||
export default {
|
||||
name: 'EquipmentPlc',
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
@@ -127,16 +129,16 @@ export default {
|
||||
// width: 180,
|
||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
// },
|
||||
{ prop: 'code', label: '编码' },
|
||||
{ prop: 'plcTableName', label: '关联表名' },
|
||||
{ prop: 'name', label: '标识名称' },
|
||||
{ prop: 'enName', label: '英文名称' },
|
||||
{ prop: 'code', label: '编码', width: 180, showOverflowtooltip: true },
|
||||
{ prop: 'plcTableName', label: '关联表名', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'name', label: '标识名称', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'enName', label: '英文名称', width: 150, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'collection',
|
||||
label: '是否采集',
|
||||
subcomponent: switchBtn,
|
||||
},
|
||||
{ prop: 'description', label: '描述' },
|
||||
{ prop: 'description', label: '描述', minWidth: 150, showOverflowtooltip: true },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@@ -240,7 +242,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
plcTableName: null,
|
||||
name: null,
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
background: '#f2f4f9',
|
||||
color: '#606266',
|
||||
}"
|
||||
:max-height="tableH"
|
||||
class="waiting-list-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
@@ -37,8 +38,9 @@
|
||||
<el-table-column
|
||||
v-if="selectedBox[0]"
|
||||
label="巡检单名称"
|
||||
:show-overflow-tooltip="true"
|
||||
prop="name"></el-table-column>
|
||||
<el-table-column v-if="selectedBox[1]" label="部门" prop="planName">
|
||||
<el-table-column v-if="selectedBox[1]" label="部门" :show-overflow-tooltip="true" prop="planName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.department || '---' }}
|
||||
</template>
|
||||
@@ -46,6 +48,7 @@
|
||||
<el-table-column
|
||||
v-if="selectedBox[2]"
|
||||
label="巡检时间"
|
||||
width="150"
|
||||
prop="actualCheckTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.actualCheckTime | timeFilter }}
|
||||
@@ -54,6 +57,8 @@
|
||||
<el-table-column
|
||||
v-if="selectedBox[3]"
|
||||
label="班次"
|
||||
width="180"
|
||||
:show-overflow-tooltip="true"
|
||||
prop="groupClass">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.groupClass || '---' }}
|
||||
@@ -62,6 +67,7 @@
|
||||
<el-table-column
|
||||
v-if="selectedBox[4]"
|
||||
label="确认截止时间"
|
||||
width="150"
|
||||
prop="confirmDueTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.confirmDueTime | timeFilter }}
|
||||
@@ -70,6 +76,7 @@
|
||||
<el-table-column
|
||||
v-if="selectedBox[5]"
|
||||
width="150"
|
||||
:show-overflow-tooltip="true"
|
||||
label="备注"
|
||||
prop="remark">
|
||||
<template slot-scope="scope">
|
||||
@@ -172,6 +179,7 @@ export default {
|
||||
true
|
||||
],
|
||||
selectedPlan: [],
|
||||
tableH: this.tableHeight(260)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -182,6 +190,16 @@ export default {
|
||||
}));
|
||||
},
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row, index) {
|
||||
return true;
|
||||
|
||||
@@ -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,
|
||||
@@ -139,7 +145,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
maintainPlanId: null,
|
||||
startTime: null,
|
||||
special: false,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -65,6 +66,7 @@ import addRecord from './addRecord.vue';
|
||||
import AddContent from './addContent.vue';
|
||||
import { exportCheckOrderExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -91,7 +93,7 @@ const btn = {
|
||||
export default {
|
||||
name: 'EquipmentInspectionRecord',
|
||||
components: { addRecord, AddContent },
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
@@ -250,7 +252,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
special: false,
|
||||
name: null,
|
||||
actualCheckTime: null,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -53,13 +54,14 @@ import addOrUpdata from './add-or-updata.vue';
|
||||
import add from './add.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentCheckSetting',
|
||||
components: { addOrUpdata, add },
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
@@ -102,7 +104,7 @@ export default {
|
||||
{
|
||||
prop: 'code',
|
||||
label: '巡检单编码',
|
||||
minWidth: 150,
|
||||
minWidth: 170,
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{ prop: 'department', label: '部门', showOverflowtooltip: true },
|
||||
@@ -225,7 +227,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
equipmentId: null,
|
||||
name: null,
|
||||
special: false,
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
:before-close="beforeClose"
|
||||
@closed="$emit('destroy')">
|
||||
<SmallTitle slot="title">编辑</SmallTitle>
|
||||
|
||||
@@ -344,6 +345,7 @@ export default {
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
bind: { clearable: true, filterable: true },
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
// pageNo: 1,
|
||||
@@ -443,6 +445,15 @@ export default {
|
||||
this.getList('line');
|
||||
},
|
||||
methods: {
|
||||
beforeClose(done) {
|
||||
// if (!this.isdetail) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
// }
|
||||
},
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
background: '#f2f4f9',
|
||||
color: '#606266',
|
||||
}"
|
||||
:max-height="tableH"
|
||||
class="waiting-list-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
@@ -36,8 +37,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[0]"
|
||||
width="128"
|
||||
width="160"
|
||||
label="设备保养单号"
|
||||
:show-overflow-tooltip="true"
|
||||
prop="maintainOrderNumber"></el-table-column>
|
||||
<el-table-column v-if="selectedBox[1]" width="128" label="保养计划名称" prop="planName">
|
||||
<template slot-scope="scope">
|
||||
@@ -224,6 +226,7 @@ export default {
|
||||
true,
|
||||
],
|
||||
selectedPlan: [],
|
||||
tableH: this.tableHeight(260),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -234,6 +237,16 @@ export default {
|
||||
}));
|
||||
},
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
})
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(260)
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row, index) {
|
||||
return (
|
||||
|
||||
@@ -335,6 +335,7 @@ export default {
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
bind: { clearable: true, filterable: true },
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
// pageNo: 1,
|
||||
|
||||
@@ -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: '导出',
|
||||
@@ -197,7 +201,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
maintainPlanId: null,
|
||||
startTime: null,
|
||||
special: false,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
:table-data="list"
|
||||
@emitFun="handleEmitFun">
|
||||
@emitFun="handleEmitFun"
|
||||
:max-height="tableH">
|
||||
<!-- <method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
@@ -59,6 +60,7 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import AddContent from '../PlanConfig/addContent.vue';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
|
||||
const remainBox = {
|
||||
name: 'RemainBox',
|
||||
@@ -116,7 +118,7 @@ const btn = {
|
||||
export default {
|
||||
name: 'Monitor',
|
||||
components: { AddContent },
|
||||
mixins: [basicPageMixin],
|
||||
mixins: [basicPageMixin, tableHeightMixin],
|
||||
data() {
|
||||
return {
|
||||
addContent: false,
|
||||
@@ -129,7 +131,7 @@ export default {
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'code', label: '保养计划单号', minWidth: 118, showOverflowtooltip: true },
|
||||
{ prop: 'code', label: '保养计划单号', width: 150, showOverflowtooltip: true },
|
||||
{ prop: 'name', label: '保养计划名称', minWidth: 118, showOverflowtooltip: true },
|
||||
{ prop: 'departmentName', label: '部门', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'lineName', label: '产线名', minWidth: 100, showOverflowtooltip: true },
|
||||
@@ -191,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: '导出',
|
||||
@@ -205,7 +207,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
special: false,
|
||||
equipmentName: null,
|
||||
createTime: null,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user