Compare commits

..

No commits in common. "2592551e66ac76d85337e241bcfe583727ad8414" and "45717867802931627b2b11d6ba60bb77d71aa6ee" have entirely different histories.

98 changed files with 7280 additions and 8371 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-04-08 16:46:49 # @LastEditTime: 2024-04-03 11:22:19
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###
@ -18,7 +18,7 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://192.168.2.173:48080' # 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.49:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:9001' # VUE_APP_BASE_API = 'http://192.168.4.173:48082'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082' # 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.62:48082'

View File

@ -54,27 +54,3 @@ export function energyQuantityManualExport(data) {
responseType: 'blob' 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
})
}

View File

@ -32,7 +32,6 @@ const actions = {
} }
// 处理 dictValue 层级 // 处理 dictValue 层级
dictDataMap[dictData.dictType].push({ dictDataMap[dictData.dictType].push({
id: dictData.id,
value: dictData.value, value: dictData.value,
label: dictData.label, label: dictData.label,
colorType: dictData.colorType, colorType: dictData.colorType,

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-03 10:54:53 * @LastEditTime: 2024-03-29 16:49:00
* @Description: * @Description:
--> -->
<template> <template>
@ -34,7 +34,7 @@
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12"> <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
<base-container :beilv="1" :size="'eqStatus'" :title="'周转进度'" :title-icon="'order'" :back="'energy'"> <base-container :beilv="1" :size="'eqStatus'" :title="'周转进度'" :title-icon="'order'" :back="'energy'">
<div class="order" style="width:100%; overflow: hidden scroll;height: 350px;"> <div class="order" style="width:100%; overflow: hidden scroll;height: 350px;">
<el-row v-for="op in orderProcessList" :key="op.id" style="margin-bottom: .5em"> <el-row v-for="op in orderProcessList" :key="op.id" style="margin-bottom: 1em">
<!-- <p v-if="op.outRate === 1" class="now-secondary-title" <!-- <p v-if="op.outRate === 1" class="now-secondary-title"
style="font-size: 14px; opacity: calc(.6);color:#4679FD"> style="font-size: 14px; opacity: calc(.6);color:#4679FD">
<i class="el-icon-check" /> <i class="el-icon-check" />
@ -42,7 +42,7 @@
</p> --> </p> -->
<!-- <p class="now-secondary-title">{{ op.name }}</p> --> <!-- <p class="now-secondary-title">{{ op.name }}</p> -->
<p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p> <p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p>
<el-progress style="width: 935px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10" <el-progress style="width: 910px;" 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" /> define-back-color="rgba(32, 57, 96, 1)" :percentage="op.outRate * 100" class="custom-progress-bar" />
</el-row> </el-row>
</div> </div>
@ -606,10 +606,8 @@ export default {
background-image: linear-gradient(to right, #4573fe, #47f8dc); background-image: linear-gradient(to right, #4573fe, #47f8dc);
} }
::v-deep .el-progress__text { ::v-deep .el-progress__text {
width: 50px;
margin-top: -70px; margin-top: -70px;
margin-left: 834px; margin-left: 820px;
text-align: right;
// background-color: unset; // background-color: unset;
// background-image: linear-gradient(to right, #4573fe, #47f8dc); // background-image: linear-gradient(to right, #4573fe, #47f8dc);
} }

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-29 16:50:26 * @Date: 2024-01-29 16:50:26
* @LastEditTime: 2024-04-07 16:05:59 * @LastEditTime: 2024-04-02 15:01:40
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -41,11 +41,10 @@
</div> --> </div> -->
<!-- 像下面这样表格里的limit值也许可以用js动态计算出来 --> <!-- 像下面这样表格里的limit值也许可以用js动态计算出来 -->
<div v-if="coldDetData" class="myLegend"> <div v-if="coldDetData" class="myLegend">
<div class=" barCircleLegend"></div>
<div class=" barCircle"></div>
<h4 class="barText">产线良品率</h4>
<div class="barLegend"></div> <div class="barLegend"></div>
<h4 class="barCircleText">产线产量</h4> <h4 class="barText">产线产量</h4>
<div class="barCircle"></div>
<h4 class="barCircleText">产线良品率</h4>
</div> </div>
<double-y-chart ref="productChart" :id="'doubleYChart'" :name-list="cxNameList" :data-list="cxDataList" <double-y-chart ref="productChart" :id="'doubleYChart'" :name-list="cxNameList" :data-list="cxDataList"
:height="359" :show-legend="true" /> :height="359" :show-legend="true" />
@ -310,7 +309,6 @@ export default {
window.location.reload() window.location.reload()
}, 86400000) }, 86400000)
// this.getData() // this.getData()
// this.getReaiData()
}, },
destroyed() { destroyed() {
this.CutWebsocketClose() this.CutWebsocketClose()
@ -412,13 +410,13 @@ export default {
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡') topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡')
productList.push(ele.productArea) productList.push(ele.productArea)
wasteList.push(ele.wastArea) wasteList.push(ele.wastArea)
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡') nameWasteList.push('缺陷面积:' + ele.wastArea + '㎡')
// yieldList.push({ // yieldList.push({
// name: '', // name: '',
// yield:ele.yield // yield:ele.yield
// }) // })
sumAreaList.push(ele.sumArea) sumAreaList.push(ele.sumArea)
yieldList.push((ele.yield * 100).toFixed(0)) yieldList.push((ele.yield * 100).toFixed(3))
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList) this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
@ -429,82 +427,39 @@ export default {
this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]]) this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
}) })
}, },
// getReaiData() { getData() {
// let detData = [ let detData = [
// { {
// name: '1', name: '1',
// run: '', run: '运行',
// }, },
// { {
// name: '2', name: '2',
// run: '', run: '未运行',
// }, },
// { {
// name: '3', name: '3',
// run: '', run: '运行',
// }, },
// { {
// name: '4', name: '4',
// run: '', run: '未运行',
// }, },
// { {
// name: '1', name: '1',
// run: '', run: '运行',
// }, },
// ] ]
// let arr = [] this.realEqList = detData.map((item, index) => [
// let index = 0 // console.log(item)
// for (let i in detData) { `<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
// index++, </span>`,
// arr.push([ `<span style="color:rgba(255,255,255,0.5)">${item.name || ''}</span>`,
// `<span style="color:rgba(255,255,255,0.5)" >${index || ''} `<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>`,
// </span>`, ])
// // `<span style="color:rgba(255,255,255,0.5)" >${i || ''} this.realEqConfig.data = this.realEqList
// // </span>`, this.$refs['realEqScrollBoard'].updateRows(this.realEqList)
// `<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) { CutWebsocketClose(e) {
this.Cutws.ws.onclose = (event) => { console.log(event );} this.Cutws.ws.onclose = (event) => { console.log(event );}
}, },
@ -617,16 +572,16 @@ export default {
this.cutWsData = event?.data ? JSON.parse(event?.data) : {} this.cutWsData = event?.data ? JSON.parse(event?.data) : {}
if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') { if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'table') {
let cutArr = this.cutWsData.productHourData.map((item, index) => [ let cutArr = this.cutWsData.productHourData.map((item, index) => [
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''} `<span style="color:rgba(255,255,255,0.7)" >${index + 1 || ''}
</span>`, </span>`,
`<span style="color:rgba(255,255,255,0.5)" >${item.lineName || ''} `<span style="color:rgba(255,255,255,0.7)" >${item.lineName || ''}
</span>`, </span>`,
`<span style="color:rgba(255,255,255,0.5)">${this.formatTime(item.time) || ''}</span>`, `<span style="color:rgba(255,255,255,0.7)">${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.7)">${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.7)">${item.productArea + '㎡' || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`, `<span style="color:rgba(255,255,255,0.7)">${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(2) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</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>` <div style = "${(item.product * 100).toFixed(2) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(2) + '%' || ''}</div>`
]) ])
this.cutConfig.data = cutArr this.cutConfig.data = cutArr
// this.$nextTick(() => { // this.$nextTick(() => {
@ -649,16 +604,16 @@ export default {
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡') topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡')
productList.push(ele.productArea) productList.push(ele.productArea)
wasteList.push(ele.wastArea) wasteList.push(ele.wastArea)
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡') nameWasteList.push('缺陷面积:' + ele.wastArea + '㎡')
sumAreaList.push(ele.sumArea) sumAreaList.push(ele.sumArea)
yieldList.push(parseFloat((ele.yield * 100).toFixed(0))) yieldList.push(parseFloat((ele.yield * 100).toFixed(3)))
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]]) 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.secondPileChart.initChart(nameList, [topNameList[1]], [nameWasteList[1]], [productList[1]], [wasteList[1]])
this.$refs.thirdPileChart.initChart(nameList, [topNameList[2]], [nameWasteList[2]], [productList[2]], [wasteList[2]]) this.$refs.thirdPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
this.$refs.fourthPileChart.initChart(nameList, [topNameList[3]], [nameWasteList[3]], [productList[3]], [wasteList[3]]) this.$refs.fourthPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]]) this.$refs.fifthPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList) this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
}) })
} }
@ -745,25 +700,6 @@ export default {
// this.funWebsocket.onclose = this.funWebsocketClose // 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() { // funWebsocketOnOpen() {
// console.log('socket') // console.log('socket')
// this.SJGWebsocket.onmessage() // this.SJGWebsocket.onmessage()
@ -861,7 +797,7 @@ export default {
.myLegend{ .myLegend{
position: absolute; position: absolute;
top: -20px; top: -20px;
right: 20px; right: 50px;
font-size: 12px; font-size: 12px;
color: rgba(255,255,255,.6); color: rgba(255,255,255,.6);
.barLegend{ .barLegend{
@ -871,29 +807,19 @@ export default {
height: 10px; height: 10px;
display: inline-block; display: inline-block;
margin-right: 5px; margin-right: 5px;
border-radius: 30%;
} }
.barText{ .barText{
// float: right; // float: right;
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
} }
.barCircleLegend{
width: 15px;
height: 1px;
background-color: rgba(255, 209, 96, 1);
position: absolute;
left: -4.1715px;
top: 21.7px;
}
.barCircle{ .barCircle{
width: 6px; width: 7px;
height: 6px; height: 7px;
border-radius: 50%; border-radius: 50%;
background-color: rgba(255, 209, 96, 1); background-color: rgba(255, 209, 96, 1);
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 5px;
margin-bottom: 1.7px;
} }
.barCircleText{ .barCircleText{
display: inline-block; display: inline-block;

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-01-21 14:43:06 * @Date: 2022-01-21 14:43:06
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-03 16:33:24 * @LastEditTime: 2024-03-29 14:50:50
* @Description: * @Description:
--> -->
<template> <template>
@ -85,6 +85,7 @@ export default {
defaultConfig: { defaultConfig: {
// legend // legend
legend: { legend: {
orient: 'vertical',
left: '75%', left: '75%',
bottom: 0, bottom: 0,
itemHeight: 10, itemHeight: 10,
@ -196,7 +197,7 @@ export default {
// //
...this.defaultConfig.legend, ...this.defaultConfig.legend,
// //
// ...this.legendConfig ...this.legendConfig
}, },
color: this.barColor, color: this.barColor,
series: [ series: [

View File

@ -2,7 +2,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-03 16:28:40 * @LastEditTime: 2024-04-01 09:12:56
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -100,9 +100,8 @@ export default {
show: true, // show: true, //
position: 'top', // position: 'top', //
textStyle: { // textStyle: { //
color: 'rgba(255,255,255,0.5)', // color: '#ced1d5',
fontSize: 12, fontSize: 12
fontWight: 'bolder'
} }
}, },
} }
@ -194,19 +193,18 @@ export default {
axisLine: { axisLine: {
lineStyle: { lineStyle: {
type: 'solid', type: 'solid',
color: '#25528f', // 线 color: '#213259', // 线
width: '1' // 线 width: '1' // 线
} }
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
align: 'center',
color: 'rgba(255,255,255,0.5)' // color: 'rgba(255,255,255,0.5)' //
} }
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#25528f' color: '#213259'
} }
}, },
data: nameList data: nameList
@ -228,7 +226,6 @@ export default {
nameTextStyle: {// y nameTextStyle: {// y
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
align: "left", align: "left",
padding: [0, 0, 0, 8]
}, },
position: 'right', position: 'right',
alignTicks: true, alignTicks: true,
@ -236,20 +233,19 @@ export default {
show: true, show: true,
lineStyle: { lineStyle: {
type: 'solid', type: 'solid',
color: '#25528f', // 线 color: '#213259', // 线
width: '1' // 线 width: '1' // 线
} }
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: 'rgba(255,255,255,0.5)', // color: '#ced1d5', //
formatter: '{value}%', formatter: '{value}%'
align:'left',
} }
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#25528f' color: '#213259'
} }
} }
// type: 'value' // type: 'value'
@ -274,7 +270,6 @@ export default {
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
// fontSize: 10, // fontSize: 10,
align: "right", align: "right",
padding:[0,4,0,0]
}, },
position: 'left', position: 'left',
alignTicks: true, alignTicks: true,
@ -282,21 +277,19 @@ export default {
show: true, show: true,
lineStyle: { lineStyle: {
type: 'solid', type: 'solid',
color: '#25528f', // 线 color: '#213259', // 线
width: '1' // 线 width: '1' // 线
} }
}, },
axisLabel: { axisLabel: {
// padding: [0, 20, 0, 0],
textStyle: { textStyle: {
margin: 60,
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
formatter: '{value} 片' formatter: '{value} 片'
} }
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#25528f' color: '#213259'
} }
} }
// type: 'value' // type: 'value'

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-09-21 09:06:28 * @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-03 17:09:12 * @LastEditTime: 2024-03-29 16:26:28
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -105,7 +105,7 @@ export default {
show: true, // show: true, //
position: 'top', // position: 'top', //
textStyle: { // textStyle: { //
color: 'rgba(255,255,255,0.5)', // color: '#ced1d5',
fontSize: 12, fontSize: 12,
fontWight:'bolder' fontWight:'bolder'
} }
@ -167,19 +167,19 @@ export default {
type: 'cross' type: 'cross'
} }
}, },
grid: { top: 70, right: 20, bottom: 10, left: 10, containLabel: true }, grid: { top: 90, right: 70, bottom: 20, left: 20, containLabel: true },
// legend: { legend: {
// itemWidth: 10, itemWidth: 10,
// itemHeight: 10, itemHeight: 10,
// top: '2%', top: '0%',
// right: '30px', right: '20px',
// data: ['线', '线'], data: ['产线良品率', '产线产量'],
// textStyle: { textStyle: {
// fontSize: 12 * this.beilv, fontSize: 12 * this.beilv,
// color: '#ced1d5', color: '#ced1d5',
// fontWight: 'bolder' fontWight: 'bolder'
// } }
// }, },
xAxis: { xAxis: {
axisTick: { axisTick: {
show: false show: false
@ -227,7 +227,6 @@ export default {
nameTextStyle: {// y nameTextStyle: {// y
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
align: "left", align: "left",
padding: [0, 0, 0, 2]
}, },
position: 'right', position: 'right',
alignTicks: true, alignTicks: true,
@ -272,7 +271,6 @@ export default {
nameTextStyle: { nameTextStyle: {
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
// fontSize: 10, // fontSize: 10,
padding: [0, 4, 0, 0],
align: "right", align: "right",
}, },
// position: 'left', // position: 'left',

View File

@ -113,7 +113,7 @@ export default {
textStyle: { // textStyle: { //
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
fontSize: 12, fontSize: 12,
fontWeight: 'normal' fontWeight: 'bolder'
} }
}, },
} }
@ -133,7 +133,7 @@ export default {
type: 'shadow' // 线'line' | 'shadow' type: 'shadow' // 线'line' | 'shadow'
} }
}, },
grid: { top: 70, right: 40, bottom: 10, left: 40, containLabel: true }, grid: { top: 90, right: 60, bottom: 20, left: 30, containLabel: true },
// legend: { // legend: {
// itemWidth: 10, // itemWidth: 10,
// itemHeight: 10, // itemHeight: 10,
@ -175,7 +175,7 @@ export default {
name: '单位kwh', name: '单位kwh',
nameTextStyle: { nameTextStyle: {
color: 'rgba(255,255,255,0.5)', // color: 'rgba(255,255,255,0.5)', //
fontSize: 12, fontSize: 10,
align: 'right', align: 'right',
}, },
type: 'value', type: 'value',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-27 13:54:52 * @Date: 2023-12-27 13:54:52
* @LastEditTime: 2024-04-03 18:12:18 * @LastEditTime: 2024-04-01 09:14:45
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -114,10 +114,6 @@ export default {
totalData.push(sum); 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) console.log('total', totalData)
const series = [ const series = [
'良品', '良品',
@ -138,7 +134,7 @@ export default {
// }, // },
color:colors[sid], color:colors[sid],
data: rawData.length != 0 ? rawData[sid].map((d, did) => data: rawData.length != 0 ? rawData[sid].map((d, did) =>
totalData[did] <= 0 ? 0 : (d / totalData[did]).toFixed(4) totalData[did] <= 0 ? 0 : d / totalData[did]
) : [] ) : []
}; };
}); });
@ -167,15 +163,15 @@ export default {
let singleData = series.filter(function (item) { let singleData = series.filter(function (item) {
return item.name == name return item.name == name
}) })
return name + parseFloat((singleData[0].data * 100).toFixed(0)) + '%' return name + parseFloat((singleData[0].data * 100).toFixed(3)) + '%'
}, },
itemWidth: 12, itemWidth: 12,
itemHeight: 12, itemHeight: 12,
bottom: '20', bottom: '20',
left: '20', left: '20',
icon: 'roundRect', icon: 'rect',
textStyle: { textStyle: {
color: 'rgba(255,255,255,.9)', color: 'rgba(255,255,255,.6)',
fontSize:12, fontSize:12,
} }
}, },
@ -208,7 +204,7 @@ export default {
splitNumber: 50, splitNumber: 50,
// boundaryGap: [20, 20], // boundaryGap: [20, 20],
textStyle: { textStyle: {
color: 'rgba(255,255,255,.9)', color: 'rgba(255,255,255,.6)',
verticalAlign: 'bottom', verticalAlign: 'bottom',
fontSize: 16, fontSize: 16,
align: 'left', align: 'left',
@ -236,7 +232,7 @@ export default {
splitNumber: 50, splitNumber: 50,
// boundaryGap: [20, 20], // boundaryGap: [20, 20],
textStyle: { textStyle: {
color: 'rgba(255,255,255,.9)', color: 'rgba(255,255,255,.6)',
verticalAlign: 'bottom', verticalAlign: 'bottom',
fontSize: 16, fontSize: 16,
align: 'right', align: 'right',

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-03 17:14:03 * @LastEditTime: 2024-04-02 09:46:46
* @Description: * @Description:
--> -->
<template> <template>
@ -39,11 +39,11 @@
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%"> <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
<base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'"> <base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'">
<div class="order" style="width: 100%; overflow: hidden scroll; height: 350px"> <div class="order" style="width: 100%; overflow: hidden scroll; height: 350px">
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em"> <el-row v-for="op in orderList" :key="op.id" style="margin-bottom: 1em">
<!-- <el-col :span="12"> --> <!-- <el-col :span="12"> -->
<p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p> <p class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</p>
<el-progress style="width: 620px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10" <el-progress style="width: 610px;" 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" /> define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" />
</el-row> </el-row>
</div> </div>
@ -67,13 +67,6 @@
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12"> <el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
<base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'" <base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'"
:title="'产线产量及良品率'" :title-icon="'productLine'"> :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" /> <double-y-chart ref="productLineChart" :id="'doubleYChart'" :height="390" :show-legend="true" />
</base-container> </base-container>
</el-col> </el-col>
@ -380,26 +373,6 @@ export default {
id: '4', id: '4',
name: '测试工单4', name: '测试工单4',
progressRate: 0.32323, 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', // id: '5',
@ -416,7 +389,7 @@ export default {
return { return {
id: ele.id, id: ele.id,
name: ele.name, name: ele.name,
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)), progressRate: parseFloat((ele.progressRate * 100).toFixed(3)),
}; };
} }
}); });
@ -444,61 +417,28 @@ export default {
`<span style="color:rgba(255,255,255,0.5)">${item.error || ''}</span>`, `<span style="color:rgba(255,255,255,0.5)">${item.error || ''}</span>`,
]); ]);
this.eqConfig.data = eqArr; this.eqConfig.data = eqArr;
let data = [ let arr = ['D64', 'D62', 'D61', 'D63', 'D65']
{ // let arr = [5, 6, 2, 4, 7, 9, 15];
lineName: 'D62', // 7
outputNum: '11111', for (let i = 0; i < arr.length - 1; i++) {
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 < data.length - i - 1; j++) { for (let j = 0; j < arr.length - i - 1; j++) {
// //
if (data[j].lineName.substr(data[j].lineName.length - 1, 1) > data[j + 1].lineName.substr(data[j + 1].lineName.length - 1, 1)) { if (arr[j].substr(arr[j].length - 1, 1) > arr[j + 1].substr(arr[j + 1].length - 1, 1)) {
// //
let temp = data[j]; let temp = arr[j];
data[j] = data[j + 1]; arr[j] = arr[j + 1];
data[j + 1] = temp; arr[j + 1] = temp;
} }
} }
} }
data.forEach((ele) => { console.log(arr);
// if (item.id == ele.productionLineId) { this.$refs['eqScrollBoard'].updateRows(eqArr);
// 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( this.$refs.productLineChart.initChart(
nameList, arr,
passRateList, [98, 97, 98.7, 98.5, 98.3],
outputNumList [3134, 2323, 3232, 3233, 2321]
); );
})
// this.getList() // this.getList()
this.initWebSocket(); this.initWebSocket();
this.SJGInitWebSocket(); this.SJGInitWebSocket();
@ -690,7 +630,7 @@ export default {
return { return {
id: ele.id, id: ele.id,
name: ele.name, name: ele.name,
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)), progressRate: parseFloat((ele.progressRate * 100).toFixed(3)),
}; };
} }
}); });
@ -721,19 +661,6 @@ export default {
let nameList = []; let nameList = [];
let passRateList = []; let passRateList = [];
let outputNumList = []; let outputNumList = [];
// let arr = ['D64', 'D62', 'D61', 'D63', 'D65']
for (let i = 0; i < this.SJGWsData.detData.length - 1; i++) {
//
for (let j = 0; j < this.SJGWsData.detData.length - i - 1; j++) {
//
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 = this.SJGWsData.detData[j];
this.SJGWsData.detData[j] = this.SJGWsData.detData[j + 1];
this.SJGWsData.detData[j + 1] = temp;
}
}
}
this.SJGWsData.detData.forEach((ele) => { this.SJGWsData.detData.forEach((ele) => {
// if (item.id == ele.productionLineId) { // if (item.id == ele.productionLineId) {
// if (item.name.substr(0, 1) == "D") { // if (item.name.substr(0, 1) == "D") {
@ -744,6 +671,19 @@ export default {
// } // }
// } // }
}); });
// let arr = ['D64', 'D62', 'D61', 'D63', 'D65']
for (let i = 0; i < nameList.length - 1; i++) {
//
for (let j = 0; j < nameList.length - i - 1; j++) {
//
if (nameList[j].substr(nameList[j].length - 1, 1) > nameList[j + 1].substr(nameList[j + 1].length - 1, 1)) {
//
let temp = nameList[j];
nameList[j] = nameList[j + 1];
nameList[j + 1] = temp;
}
}
}
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.productLineChart.initChart( this.$refs.productLineChart.initChart(
nameList, nameList,
@ -802,51 +742,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <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 { .visual-container {
width: 1920px; width: 1920px;
height: 1080px; height: 1080px;
@ -920,9 +815,8 @@ export default {
background-image: linear-gradient(to right, #4573fe, #47f8dc); background-image: linear-gradient(to right, #4573fe, #47f8dc);
} }
::v-deep .el-progress__text { ::v-deep .el-progress__text {
width: 50px;
margin-top: -70px; margin-top: -70px;
margin-left: 538px; margin-left: 490px;
// background-color: unset; // background-color: unset;
// background-image: linear-gradient(to right, #4573fe, #47f8dc); // background-image: linear-gradient(to right, #4573fe, #47f8dc);
} }

View File

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

View File

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

View File

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

View File

@ -2,20 +2,37 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-08 11:49:33 * @LastEditTime: 2024-02-28 10:38:34
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"> :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" />
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> <add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
</div> </div>
</template> </template>
@ -24,7 +41,6 @@ import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict'; // import unitDict from './unitDict';
import basicPage from '../mixins/basic-page'; import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { import {
getPackingModel, getPackingModel,
} from '@/api/base/printModel.js' } from '@/api/base/printModel.js'
@ -75,7 +91,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -128,7 +144,7 @@ export default {
param: 'createTime', param: 'createTime',
}, },
{ {
type: this.$auth.hasPermi('base:packaging-print-log:query') ? 'button' : '', type: 'button',
btnName: '搜索', btnName: '搜索',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@ -298,7 +314,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.workOrderId = val.workOrderId; this.listQuery.workOrderId = val.workOrderId;
if (val.createTime && val.createTime.length != 0) { if (val.createTime && val.createTime.length != 0) {
this.listQuery.createTime = val.createTime this.listQuery.createTime = val.createTime
@ -313,7 +329,7 @@ export default {
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@ -2,14 +2,13 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-03 15:08:38 * @LastEditTime: 2023-12-04 13:38:45
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" <base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :table-data="tableData">
:table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
@ -27,8 +26,6 @@ import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import printModelDesign from '../custom/index' 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 { import {
deletePackingModel, deletePackingModel,
getPackingModelPage, getPackingModelPage,
@ -62,7 +59,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -165,7 +162,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.packagingCode = val.packagingCode; this.listQuery.packagingCode = val.packagingCode;
this.listQuery.createTime = val.createTime; this.listQuery.createTime = val.createTime;
this.getDataList(); this.getDataList();
@ -173,7 +170,7 @@ export default {
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@ -2,20 +2,37 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-04-03 15:09:06 * @LastEditTime: 2023-12-04 13:44:01
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :max-height="tableH" :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize" :formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData"> :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" />
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> <add-or-update
v-if="addOrUpdateVisible"
ref="addOrUpdate"
@refreshDataList="getDataList" />
</div> </div>
</template> </template>
@ -24,7 +41,6 @@ import AddOrUpdate from './add-or-updata';
// import unitDict from './unitDict'; // import unitDict from './unitDict';
import basicPage from '../mixins/basic-page'; import basicPage from '../mixins/basic-page';
import { parseTime } from '../mixins/code-filter'; import { parseTime } from '../mixins/code-filter';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { import {
deletePackingType, deletePackingType,
getPackingTypePage, getPackingTypePage,
@ -48,7 +64,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -138,7 +154,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.packagingCode = val.packagingCode; this.listQuery.packagingCode = val.packagingCode;
this.listQuery.createTime = val.createTime; this.listQuery.createTime = val.createTime;
this.getDataList(); this.getDataList();
@ -146,7 +162,7 @@ export default {
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@ -92,9 +92,7 @@ export default {
param: 'searchTime', param: 'searchTime',
}, },
{ {
type: this.$auth.hasPermi('cost:energyCost:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -116,9 +116,7 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: this.$auth.hasPermi('cost:energyCostHis:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -124,9 +124,7 @@ export default {
filterable: true, filterable: true,
}, },
{ {
type: this.$auth.hasPermi('cost:rawMaterialConfig:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -97,9 +97,7 @@ export default {
param: 'searchTime', param: 'searchTime',
}, },
{ {
type: this.$auth.hasPermi('cost:rawMaterialCost:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -115,9 +115,7 @@ export default {
defaultSelect: [], defaultSelect: [],
}, },
{ {
type: this.$auth.hasPermi('cost:rawMaterialCostHis:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -1,17 +1,13 @@
<template> <template>
<div style="height: 370px"> <div style="height: 370px;">
<NotMsg v-show="notMsg"/> <NotMsg v-show="notMsg"/>
<div <div id="numRateChart" class="num-rate-chart" style="width:900px;height:420px;" v-show='!notMsg'></div>
id="numRateChart"
class="num-rate-chart"
style="width: 900px; height: 420px"
v-show="!notMsg"></div>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import resize from './../mixins/resize'; import resize from './../mixins/resize'
import NotMsg from './../components/NotMsg'; import NotMsg from './../components/NotMsg'
export default { export default {
name: 'NumRateChart', name: 'NumRateChart',
mixins: [resize], mixins: [resize],
@ -19,88 +15,65 @@ export default {
data() { data() {
return { return {
chart: null, chart: null,
notMsg: true, notMsg:true
}; }
}, },
computed: { computed: {
productline() { productline() {
return this.$store.state.websocket.productline; return this.$store.state.websocket.productline
}, }
}, },
watch:{ watch:{
productline: { productline: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
if (newVal === oldVal) { if (newVal === oldVal) {
return false; return false
}
this.updateChart()
this.$emit('emitFun')
}
} }
this.updateChart();
this.$emit('emitFun');
},
},
}, },
mounted() { mounted() {
this.$el.addEventListener('resize', () => { this.$el.addEventListener('resize', () => {
console.log('resziing.....'); console.log('resziing.....');
}); });
this.updateChart(); this.updateChart()
}, },
methods: { methods: {
updateChart() { updateChart() {
if (this.productline && this.productline.length > 0) { if (this.productline && this.productline.length > 0) {
this.notMsg = false; this.notMsg = false
} else { } else {
this.notMsg = true; this.notMsg = true
return; return
} }
let xData = []; let xData = []
let outputNum = []; let outputNum = []
let passRate = []; let passRate = []
for (let i = 0; i < this.productline.length - 1; i++) { this.productline && this.productline.length > 0 && this.productline.map(item => {
// if ((item.lineName).includes('D')) {
for (let j = 0; j < this.productline.length - i - 1; j++) { xData.push(item.lineName)
// outputNum.push(item.outputNum)
if ( passRate.push(item.passRate?item.passRate*100:null)
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 ( if (
this.chart !== null && this.chart !== null &&
this.chart !== '' && this.chart !== '' &&
this.chart !== undefined this.chart !== undefined
) { ) {
this.chart.dispose(); this.chart.dispose()
} }
this.chart = echarts.init(document.getElementById('numRateChart')); this.chart = echarts.init(document.getElementById('numRateChart'));
var option = { var option = {
grid: { top: 82, right: 60, bottom: 20, left: 90 }, grid: { top: 82, right: 60, bottom: 20, left: 90 },
tooltip: { tooltip: {
trigger: 'axis', trigger: "axis",
axisPointer: { axisPointer: {
type: 'shadow', type: "shadow",
}, },
className: 'num-rate-chart-tooltip', className: "num-rate-chart-tooltip"
}, },
legend: { legend: {
itemWidth:10, itemWidth:10,
@ -110,32 +83,32 @@ export default {
icon: 'rect', icon: 'rect',
data: [ data: [
{name:'产线产量',itemStyle:{color:'#364BFE'}}, {name:'产线产量',itemStyle:{color:'#364BFE'}},
{ name: '良品率', itemStyle: { color: '#FFCB59' } }, {name:'良品率',itemStyle:{color:'#FFCB59'}}
], ],
textStyle: { textStyle: {
color: '#DFF1FE', color: "#DFF1FE",
fontSize: 12, fontSize: 12,
}, }
}, },
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
data: xData, data: xData,
axisLabel: { axisLabel: {
color: '#fff', color: "#fff",
fontSize: 12, fontSize: 12,
}, },
axisPointer: { axisPointer: {
type: 'shadow', type: 'shadow'
}, },
axisTick: { show: false }, axisTick: { show: false },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
width: 1, width: 1,
color: '#213259', color: "#213259",
},
}, },
}, },
}
], ],
yAxis: [ yAxis: [
{ {
@ -147,20 +120,21 @@ export default {
align: 'right', align: 'right',
}, },
axisLabel: { axisLabel: {
color: '#fff', color: "#fff",
fontSize: 12, fontSize: 12,
formatter: '{value}'
}, },
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: '#213259', color: "#213259",
}, },
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#213259a0', color: "#213259a0",
},
}, },
}
}, },
{ {
type: 'value', type: 'value',
@ -171,22 +145,24 @@ export default {
align: 'LEFT', align: 'LEFT',
}, },
axisLabel: { axisLabel: {
color: '#fff', color: "#fff",
fontSize: 12, fontSize: 12,
formatter: '{value}%', formatter: () =>{
return value ? '{value} %': '-'
}
}, },
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: '#213259', color: "#213259",
}, },
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#213259a0', color: "#213259a0",
},
},
}, },
}
}
], ],
series: [ series: [
{ {
@ -195,16 +171,16 @@ export default {
tooltip: { tooltip: {
valueFormatter: function (value) { valueFormatter: function (value) {
return value; return value;
}, }
}, },
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#5CB7FF' }, { offset: 0, color: '#5CB7FF' },
{ offset: 1, color: '#364BFE' }, { offset: 1, color: '#364BFE' }
]), ])
}, },
data: outputNum, data: outputNum
}, },
{ {
name: '良品率', name: '良品率',
@ -213,31 +189,31 @@ export default {
tooltip: { tooltip: {
valueFormatter: function (value) { valueFormatter: function (value) {
return value?value + '%':'-'; return value?value + '%':'-';
}, }
}, },
itemStyle: { itemStyle: {
color: '#FFD160', color: '#FFD160'
}, },
areaStyle: { areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB59' + '40' }, { offset: 0, color: '#FFCB59' + "40" },
{ offset: 0.5, color: '#FFCB59' + '20' }, { offset: 0.5, color: '#FFCB59' + "20" },
{ offset: 1, color: '#FFCB59' + '00' }, { offset: 1, color: '#FFCB59' + "00" },
]), ]),
}, },
lineStyle: { lineStyle: {
width: 1, width: 1
}, },
symbol: 'circle', symbol: 'circle',
symbolSize: 5, symbolSize: 5,
data: passRate, data: passRate
}, }
], ]
};
option && this.chart.setOption(option);
},
},
}; };
option && this.chart.setOption(option)
}
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.num-rate-chart { .num-rate-chart {

View File

@ -1,17 +1,9 @@
<template> <template>
<div style="flex: 1"> <div style="flex: 1;">
<Container <Container name="各工序缺陷汇总" size="middle" style="">
name="各工序缺陷汇总" <TimePrompt class="timeShow" :timestr="timestr" />
size="middle" <div style="padding: 5px 10px;">
style=""> <dv-scroll-board :config="config" style="width:575px;height:380px" ref='defectScrollBoard'/>
<TimePrompt
class="timeShow"
:timestr="timestr" />
<div style="padding: 5px 10px">
<dv-scroll-board
:config="config"
style="width: 575px; height: 380px"
ref="defectScrollBoard" />
</div> </div>
</Container> </Container>
</div> </div>
@ -19,14 +11,14 @@
<script> <script>
import Container from '../components/Container.vue'; import Container from '../components/Container.vue';
import TimePrompt from '../components/TimePrompt'; import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'; import { switchShowTime } from '../utils'
export default { export default {
name: 'DefectSum', name: 'DefectSum',
components: { Container, TimePrompt }, components: { Container, TimePrompt },
computed: { computed: {
defectSum() { defectSum() {
return this.$store.state.websocket.defectSum; return this.$store.state.websocket.defectSum
}, }
}, },
data() { data() {
return { return {
@ -38,23 +30,14 @@ export default {
evenRowBGC: 'rgba(14, 32, 62, 0.8)', evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60], columnWidth: [60],
align: ['center'], align: ['center'],
data: [ data: [],
// // data: [[1, 'Y61', '','10','']],
[1, 'D61', '成型', '3片', '细长泡'], rowNum: 10
[2, 'D62', '组合落板', '4片', '细长泡'], }
[3, 'D61', '磨边', '6片', '开口泡'], }
[4, 'D63', '清洗', '5片', '结石'],
[5, 'D64', '打孔', '2片', '结石'],
[6, 'D63', '成型', '7片', '开口泡'],
[7, 'D61', '上片', '8片', '结石'],
],
// data: [],
rowNum: 10,
},
};
}, },
mounted() { mounted() {
this.timestr = switchShowTime('日'); this.timestr = switchShowTime('日')
}, },
watch:{ watch:{
defectSum: { defectSum: {
@ -64,15 +47,15 @@ export default {
item.productionLineName, item.productionLineName,
item.sectionName, item.sectionName,
item.count, item.count,
item.inspectionTypeName, item.inspectionTypeName
]); ]);
this.config.data = outArr; this.config.data = outArr
this.$refs['defectScrollBoard'].updateRows(outArr); this.$refs['defectScrollBoard'].updateRows(outArr)
this.timestr = switchShowTime('日'); this.timestr = switchShowTime('日')
}, }
}, }
}, }
}; }
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.timeShow { .timeShow {

View File

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

View File

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

View File

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

View File

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

View File

@ -14,7 +14,7 @@ export default {
return { return {
chartDom: '', chartDom: '',
chart: '', chart: '',
chartHeight: this.tableHeight(314), chartHeight: this.tableHeight(214) - 100,
}; };
}, },
props: { props: {
@ -37,7 +37,7 @@ export default {
}, },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.chartHeight = this.tableHeight(314); this.chartHeight = this.tableHeight(214) - 70;
}); });
}, },
methods: { methods: {

View File

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

View File

@ -1,40 +1,37 @@
<template> <template>
<div <div id="analysischartLine" style="width: 100%;height: 100%;"></div>
id="analysischartLine"
style="width: 100%"
:style="{ height: chartHeight + 'px' }"></div>
</template> </template>
<script> <script>
import * as echarts from 'echarts'; import * as echarts from 'echarts'
import resize from '@/utils/chartMixins/resize'; import resize from '@/utils/chartMixins/resize'
export default { export default {
name: 'LineChart', name: "LineChart",
mixins: [resize], mixins: [resize],
data() { data() {
return { return {
chartDom: '', chartDom: '',
chart: '', chart: '',
chartHeight: this.tableHeight(250) / 2, chartHeight: this.tableHeight(214) - 70
}; }
}, },
props: { props: {
chartData: { chartData: {
type: Array, type: Array,
required: true, required: true,
default: () => { default: () => {
return []; return []
}, }
}, }
}, },
watch: { watch: {
chartData: function () { chartData: function () {
this.getChart(); this.getChart()
}, }
}, },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.chartHeight = this.tableHeight(250) / 2; this.chartHeight = this.tableHeight(214) - 70
}); })
}, },
methods: { methods: {
getChart() { getChart() {
@ -43,77 +40,63 @@ export default {
this.chart !== '' && this.chart !== '' &&
this.chart !== undefined this.chart !== undefined
) { ) {
this.chart.dispose(); // Dom this.chart.dispose() // Dom
} }
this.chartDom = document.getElementById('analysischartLine'); this.chartDom = document.getElementById('analysischartLine')
this.chart = echarts.init(this.chartDom); this.chart = echarts.init(this.chartDom)
if (this.chartData.length === 0) { if (this.chartData.length === 0) {
return false; return false
} }
let xData = []; let xData = []
let arr = this.chartData[0].type; let arr = this.chartData[0].type
let keys = Object.keys(this.chartData[0]); let keys = Object.keys(this.chartData[0])
let yData = []; let yData = []
for (let j = 0; j < arr.length; j++) { for (let j = 0; j < arr.length; j++) {
for (let k = 0; k < keys.length; k++) { for (let k = 0; k < keys.length; k++) {
if ( if (keys[k].indexOf(arr[j] + '_上年同期') > -1 || keys[k].indexOf(arr[j] + '_能源消耗') > -1) {
keys[k].indexOf(arr[j] + '_上年同期') > -1 ||
keys[k].indexOf(arr[j] + '_能源消耗') > -1
) {
let obj = { let obj = {
name: '', name: '',
type: 'line', type: 'line',
data: [], data: []
}; }
obj.name = keys[k]; obj.name = keys[k]
yData.push(obj); yData.push(obj)
} }
} }
} }
for (let i = 0; i < this.chartData.length; i++) { for (let i = 0; i < this.chartData.length; i++) {
xData.push(this.chartData[i].time); xData.push(this.chartData[i].time)
for (let p = 0; p < yData.length; p++) { for (let p = 0; p < yData.length; p++) {
yData[p].data.push(this.chartData[i][yData[p].name]); yData[p].data.push(this.chartData[i][yData[p].name])
} }
} }
var option = { var option = {
color: [ color: ['#FFDC94', '#8EF0AB', '#63BDFF', '#288AFF', '#7164FF', '#FF6860', '#FF9747', '#B0EB42', '#D680FF', '#0043D2'],
'#FFDC94',
'#8EF0AB',
'#63BDFF',
'#288AFF',
'#7164FF',
'#FF6860',
'#FF9747',
'#B0EB42',
'#D680FF',
'#0043D2',
],
legend: { legend: {
data: keys, data: keys,
right: '1%', right: '1%'
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis'
}, },
grid: { grid: {
left: '1%', left: '1%',
right: '1%', right: '1%',
bottom: '3%', bottom: '3%',
containLabel: true, containLabel: true
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: xData, data: xData
}, },
yAxis: { yAxis: {
type: 'value', type: 'value'
}, },
series: yData, series: yData
}; };
option && this.chart.setOption(option); option && this.chart.setOption(option);
}, }
}, }
}; }
</script> </script>

View File

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

View File

@ -1,36 +1,31 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-area <search-area @submit="getList" @exportD="exportData"/>
@submit="getList" <div v-show='chartData.length'>
@exportD="exportData" />
<div v-show="chartData.length">
<div class="chartTitle">同比分析图</div> <div class="chartTitle">同比分析图</div>
<div style="width: 100%"> <div style='width: 100%;height: 400px;'>
<line-chart <line-chart ref="analysisLineChart" :chartData="chartData"/>
ref="analysisLineChart"
:chartData="chartData" />
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<base-table <base-table
:table-props="tableProps" :table-props="tableProps"
:table-data="list" :table-data="list"
:max-height="tableH" :max-height="tableH"
class="yoy-out-table" /> class="yoy-out-table"
/>
</div> </div>
<!-- 没有数据 --> <!-- 没有数据 -->
<div <div class="no-data-bg" v-show='!chartData.length'></div>
class="no-data-bg"
v-show="!chartData.length"></div>
</div> </div>
</template> </template>
<script> <script>
import { getYoy } from '@/api/analysis/energyAnalysis'; import { getYoy } from "@/api/analysis/energyAnalysis"
import subRate from './components/subRate.vue'; import subRate from "./components/subRate.vue"
import SearchArea from './components/searchArea'; import SearchArea from "./components/searchArea"
import LineChart from './components/lineChart'; import LineChart from "./components/lineChart"
import FileSaver from 'file-saver'; import FileSaver from "file-saver"
import * as XLSX from 'xlsx/xlsx.mjs'; import * as XLSX from 'xlsx/xlsx.mjs'
export default { export default {
name: 'YoyAnalysis', name: 'YoyAnalysis',
components: { SearchArea, LineChart }, components: { SearchArea, LineChart },
@ -39,103 +34,98 @@ export default {
chartData: [], chartData: [],
tableProps: [], tableProps: [],
list: [], list: [],
tableH: this.tableHeight(250) / 2, tableH: this.tableHeight(640)
}; }
}, },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(250) / 2; this.tableH = this.tableHeight(640)
}); })
}, },
methods: { methods: {
getList(params) { getList(params) {
getYoy({ ...params }).then((res) => { getYoy({ ...params }).then((res) => {
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
this.getTableList(res.data); this.getTableList(res.data)
} else { } else {
this.chartData = []; this.chartData = []
this.list = []; this.list = []
} }
}); })
}, },
getTableList(arr) { getTableList(arr) {
let data = arr.data; let data = arr.data
let nameData = arr.nameData; let nameData = arr.nameData
let tempX = []; let tempX = []
data[0].data.map((item) => { data[0].data.map((item) => {
let obj = {}; let obj = {}
obj.prop = item.dynamicName; obj.prop = item.dynamicName
obj.label = item.dynamicName; obj.label = item.dynamicName
obj.id = item.id; obj.id = item.id
obj.children = []; obj.children = []
tempX.push(obj); tempX.push(obj)
}); })
for (let i = 0; i < nameData.length; i++) { for (let i = 0; i < nameData.length; i++) {
for (let j = 0; j < tempX.length; j++) { for (let j = 0; j < tempX.length; j++) {
if (tempX[j].id === nameData[i].parentId) { if (tempX[j].id === nameData[i].parentId) {
let obj = {}; let obj = {}
obj.prop = tempX[j].prop + '_' + nameData[i].name; obj.prop = tempX[j].prop + '_' + nameData[i].name
obj.label = nameData[i].name; obj.label = nameData[i].name
if (obj.label.indexOf('同比')!= -1) { if (obj.label.indexOf('同比')!= -1) {
obj.subcomponent = subRate; obj.subcomponent = subRate
} }
tempX[j].children.push(obj); tempX[j].children.push(obj)
} }
} }
} }
this.tableProps = [{ prop: 'time', label: '时间' }].concat(tempX); this.tableProps = [{prop: 'time',label: '时间'}].concat(tempX)
console.log(this.tableProps); console.log(this.tableProps)
// //
this.list = []; this.list = []
for (let k = 0; k < data.length; k++) { for (let k = 0; k < data.length; k++) {
let obj = {}; let obj = {}
obj.time = data[k].time; obj.time = data[k].time
let arr1 = data[k].data; let arr1 = data[k].data
obj.type = []; obj.type = []
for (let q = 0; q < arr1.length; q++) { for (let q = 0; q < arr1.length; q++) {
let name = arr1[q].dynamicName; let name = arr1[q].dynamicName
obj.type.push(name); obj.type.push(name)
let arr2 = arr1[q].children; let arr2 = arr1[q].children
for (let p = 0; p < arr2.length; p++) { for (let p = 0; p < arr2.length; p++) {
let prop = name + '_' + arr2[p].dynamicName; let prop = name + '_' + arr2[p].dynamicName
obj[prop] = arr2[p].dynamicValue; obj[prop] = arr2[p].dynamicValue
} }
} }
this.list.push(obj); this.list.push(obj)
} }
this.chartData = this.list; this.chartData = this.list
}, },
exportData(val) { exportData(val) {
if (this.list.length > 0) { if (this.list.length > 0) {
var wb = XLSX.utils.table_to_book( var wb = XLSX.utils.table_to_book(document.querySelector(".yoy-out-table"))
document.querySelector('.yoy-out-table') let fileName = val.name + "同比分析.xlsx"
);
let fileName = val.name + '同比分析.xlsx';
var wbout = XLSX.write(wb, { var wbout = XLSX.write(wb, {
bookType: 'xlsx', bookType: "xlsx",
bookSST: true, bookSST: true,
type: 'array', type: "array"
}); })
try { try {
FileSaver.saveAs( FileSaver.saveAs(
new Blob([wbout], { type: 'application/octet-stream' }), new Blob([wbout], { type: "application/octet-stream" }),
fileName fileName
); )
} catch (e) { } catch (e) {
if (typeof console !== 'undefined') console.log(e, wbout); if (typeof console !== "undefined") console.log(e, wbout);
} }
return wbout; return wbout
} else { } else {
this.$modal.msgWarning('暂无数据导出'); this.$modal.msgWarning("暂无数据导出")
}
}
}
} }
},
},
};
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
.yoy-out-table {
margin-top: 20px;
}
.chartTitle { .chartTitle {
font-size: 16px; font-size: 16px;
color: #000; color: #000;
@ -145,7 +135,7 @@ export default {
display: inline-block; display: inline-block;
width: 4px; width: 4px;
height: 18px; height: 18px;
background-color: #0b58ff; background-color: #0B58FF;
border-radius: 1px; border-radius: 1px;
margin-right: 8px; margin-right: 8px;
vertical-align: bottom; vertical-align: bottom;

View File

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

View File

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

View File

@ -1,72 +1,51 @@
<template> <template>
<el-form <el-form ref="form" :rules="rules" label-width="100px" :model="form">
ref="form"
:rules="rules"
label-width="100px"
:model="form">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="能源类型" prop="typeId">
label="能源类型" <el-select v-model="form.typeId" placeholder="请选择" style="width: 100%;" filterable>
prop="typeId">
<el-select
v-model="form.typeId"
placeholder="请选择"
style="width: 100%"
filterable>
<el-option <el-option
v-for="item in energyListType" v-for="item in energyListType"
:key="item.id" :key="item.id"
:label="item.labelName" :label="item.name"
:value="item.id"></el-option> :value="item.id">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="参数列名" prop="plcParamName">
label="参数列名"
prop="plcParamName">
<el-input v-model="form.plcParamName"></el-input> <el-input v-model="form.plcParamName"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="参数名称" prop="name">
label="参数名称"
prop="name">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="单位" prop="unit">
label="单位" <el-select v-model="form.unit" placeholder="请选择" style="width: 100%;">
prop="unit">
<el-select
v-model="form.unit"
placeholder="请选择"
style="width: 100%">
<el-option <el-option
v-for="item in getDictDatas(DICT_TYPE.UNIT_DICT)" v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"></el-option> :value="item.value">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="是否采集" prop="collection">
label="是否采集"
prop="collection">
<el-switch v-model="form.collection"></el-switch> <el-switch v-model="form.collection"></el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="描述" prop="description">
label="描述"
prop="description">
<el-input v-model="form.description"></el-input> <el-input v-model="form.description"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -74,12 +53,8 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { import { getEnergyPlcParam, updateEnergyPlcParam, createEnergyPlcParam } from '@/api/base/energyPlcParam'
getEnergyPlcParam, import { getEnergyTypeListAll } from '@/api/base/energyType'
updateEnergyPlcParam,
createEnergyPlcParam,
} from '@/api/base/energyPlcParam';
import { getEnergyTypeListAll } from '@/api/base/energyType';
export default { export default {
name: 'EnergyPlcParamAdd', name: 'EnergyPlcParamAdd',
data() { data() {
@ -92,72 +67,66 @@ export default {
unit: '', unit: '',
description: '', description: '',
collection: true, collection: true,
connectId: '', connectId: ''
}, },
energyListType: [], energyListType: [],
isEdit: false, // isEdit: false, //
rules: { rules: {
typeId: [ typeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
{ required: true, message: '能源类型不能为空', trigger: 'change' }, plcParamName: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }],
], name: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }]
plcParamName: [ }
{ required: true, message: '参数列名不能为空', trigger: 'blur' }, }
],
name: [
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
],
},
};
}, },
methods: { methods: {
init(param) { init(param) {
this.form.connectId = param.connectId; this.form.connectId = param.connectId
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.energyListType = res.data || []; this.energyListType = res.data || []
}); })
if (param.id) { if (param.id) {
this.isEdit = true; this.isEdit = true
this.form.id = param.id; this.form.id = param.id
getEnergyPlcParam(this.form.id).then((res) => { getEnergyPlcParam(this.form.id).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.form = res.data; this.form = res.data
this.form.collection = this.form.collection === 0 ? false : true; this.form.collection = this.form.collection === 0 ? false : true
} }
}); })
} else { } else {
this.isEdit = false; this.isEdit = false
this.form.id = ''; this.form.id = ''
} }
}, },
submitForm() { submitForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.form.collection = this.form.collection === false ? 0 : 1; this.form.collection = this.form.collection === false ? 0 : 1
if (this.isEdit) { if (this.isEdit) {
// //
updateEnergyPlcParam({...this.form}).then((res) => { updateEnergyPlcParam({...this.form}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit'); this.$emit('successSubmit')
} }
}); })
} else { } else {
createEnergyPlcParam({...this.form}).then((res) => { createEnergyPlcParam({...this.form}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit'); this.$emit('successSubmit')
} }
}); })
} }
} else { } else {
return false; return false
} }
}); })
}, },
formClear() { formClear() {
this.$refs.form.resetFields(); this.$refs.form.resetFields()
this.isEdit = false; this.isEdit = false
}, }
}, }
}; }
</script> </script>

View File

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

View File

@ -1,139 +0,0 @@
<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>

View File

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

View File

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

View File

@ -1,62 +1,47 @@
<template> <template>
<el-form <el-form ref="energyQuantityManualForm" :rules="rules" label-width="90px" :model="form">
ref="energyQuantityManualForm"
:rules="rules"
label-width="90px"
:model="form">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span='12'>
<el-form-item <el-form-item label="能源类型" prop="energyTypeId">
label="能源类型" <el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
prop="energyTypeId"> <el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id">
<el-select </el-option>
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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span='12'>
<el-form-item <el-form-item label="抄表日期" prop="recordTime">
label="抄表日期" <el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp"
prop="recordTime"> placeholder="选择日期" style="width: 100%;">
<el-date-picker </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-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span='24'>
<add-table <base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow"
:table-data="tableData" @emitFun="inputChange" @emitButtonClick="emitButtonClick" />
:table-name-list="tableNameList"
@emitFun="inputChange"
@emitButtonClick="emitButtonClick" />
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
<script> <script>
import { import { energyQuantityManualCreate, energyQuantityManualUpdate, energyQuantityManualGet } from '@/api/base/energyQuantityManual'
energyQuantityManualCreate, import moment from 'moment'
energyQuantityManualUpdate, import InputArea from './InputArea'
energyQuantityManualGet, import SelectArea from './SelectArea'
} from '@/api/base/energyQuantityManual'; const tableProps = [
import moment from 'moment'; {
import AddTable from './AddTable'; prop: 'tableName',
import { energyTableGet } from '@/api/base/energyQuantityManual'; label: '表名*',
subcomponent: SelectArea
},
{
prop: 'readingQuantity',
label: '抄表数*',
subcomponent: InputArea
}
]
export default { export default {
name: 'EnergyQuantityManualAdd', name: 'EnergyQuantityManualAdd',
props: { props: {
@ -64,108 +49,78 @@ export default {
type: Array, type: Array,
required: true, required: true,
default: () => { default: () => {
return []; return []
}, }
}, }
}, },
data() { data() {
return { return {
tableProps,
tableData: [], tableData: [],
tableNameList: [], //list
addButtonShow: '新增', addButtonShow: '新增',
form: { form: {
id: '', id: '',
energyTypeId: '', energyTypeId: '',
unit: '', unit: '',
recordTime: '', recordTime: ''
}, },
rules: { rules: {
energyTypeId: [ energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }],
{ required: true, message: '能源类型不能为空', trigger: 'change' }, recordTime: [{ required: true, message: '抄表日期不能为空', trigger: 'change' }]
],
recordTime: [
{ required: true, message: '抄表日期不能为空', trigger: 'change' },
],
}, },
isEdit: false, isEdit: false
}; }
}, },
components: { AddTable },
methods: { methods: {
init(params) { init(params) {
this.form.recordTime = moment().valueOf(); this.form.recordTime = moment().valueOf()
if (params.type === 'add') { if (params.type === 'add') {
this.isEdit = false; this.isEdit = false
} else if (params.type === 'meterReading') { } else if (params.type === 'meterReading') {
this.isEdit = false; this.isEdit = false
this.form.energyTypeId = params.energyTypeId; this.form.energyTypeId = params.energyTypeId
this.selEnergyType(this.form.energyTypeId); let obj = {}
let obj = {}; obj.tableName = params.tableName + ''
obj.tableName = params.tableName + ''; obj.readingQuantity = 0
obj.readingQuantity = 0; this.tableData.push(obj)
this.tableData.push(obj);
} else { } else {
this.isEdit = true; this.isEdit = true
this.form.id = params.id; this.form.id = params.id
this.addButtonShow = ''; this.addButtonShow = ''
energyQuantityManualGet({ id: this.form.id }).then((res) => { energyQuantityManualGet({ id: this.form.id }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.form.energyTypeId = res.data.energyTypeId; this.form.energyTypeId = res.data.energyTypeId
this.selEnergyType(this.form.energyTypeId); this.form.recordTime = res.data.recordTime ? res.data.recordTime : null
this.form.recordTime = res.data.recordTime let obj = {}
? res.data.recordTime obj.tableName = res.data.tableName ? res.data.tableName + '' : ''
: null; obj.readingQuantity = res.data.readingQuantity
let obj = {}; this.tableData.push(obj)
obj.tableName = res.data.tableName ? res.data.tableName + '' : '';
obj.readingQuantity = res.data.readingQuantity;
this.tableData.push(obj);
} }
}); })
} }
}, },
inputChange(val) { inputChange(val) {
this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]; this.tableData[val._pageIndex - 1][val.prop] = val[val.prop]
console.log(this.tableData);
}, },
emitButtonClick() { emitButtonClick() {
if (!this.form.energyTypeId) { let obj = {}
this.$modal.msgWarning('请先选择能源类型'); obj.tableName = ''
return false; obj.readingQuantity = 0
} this.tableData.push(obj)
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() { submitForm() {
this.$refs['energyQuantityManualForm'].validate((valid) => { this.$refs['energyQuantityManualForm'].validate((valid) => {
if (valid) { if (valid) {
// //
if (this.tableData.length === 0) { if (this.tableData.length === 0) {
this.$modal.msgError('抄表数据不能为空'); this.$modal.msgError("抄表数据不能为空");
return false; return false
} else { } else {
for (let item of this.tableData) { for (let item of this.tableData) {
console.log(item); console.log(item)
if ( if (!item.tableName || (!item.readingQuantity && item.readingQuantity !== 0)) {
!item.tableName || this.$modal.msgError("抄表数据有空值,请检查");
(!item.readingQuantity && item.readingQuantity !== 0) return false
) {
this.$modal.msgError('抄表数据有空值,请检查');
return false;
} }
} }
} }
@ -176,37 +131,37 @@ export default {
energyTypeId: this.form.energyTypeId, energyTypeId: this.form.energyTypeId,
recordTime: this.form.recordTime, recordTime: this.form.recordTime,
tableName: this.tableData[0].tableName, tableName: this.tableData[0].tableName,
readingQuantity: this.tableData[0].readingQuantity, readingQuantity: this.tableData[0].readingQuantity
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit'); this.$emit('successSubmit')
} }
}); })
} else { } else {
energyQuantityManualCreate({ energyQuantityManualCreate({
energyTypeId: this.form.energyTypeId, energyTypeId: this.form.energyTypeId,
recordTime: this.form.recordTime, recordTime: this.form.recordTime,
data: this.tableData, data: this.tableData
}).then((res) => { }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit'); this.$emit('successSubmit')
} }
}); })
} }
} else { } else {
return false; return false
} }
}); })
}, },
formClear() { formClear() {
this.$refs.energyQuantityManualForm.resetFields(); this.$refs.energyQuantityManualForm.resetFields()
this.form.unit = ''; this.form.unit = ''
this.isEdit = false; this.isEdit = false
this.addButtonShow = '新增'; this.addButtonShow = '新增'
this.tableData = []; this.tableData = []
}, }
}, }
}; }
</script> </script>

View File

@ -1,147 +1,119 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo" :max-height="tableH" @selection-change="selectChange">
:limit="queryParams.pageSize" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
: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" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" /> @pagination="getList" />
<!-- 新增 --> <!-- 新增 -->
<base-dialog <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
:dialogTitle="addOrEditTitle" @confirm="handleConfirm" :before-close="handleCancel">
:dialogVisible="centervisible" <energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-quantity-manual-add
ref="energyQuantityManualAdd"
:energyTypeList="energyTypeList"
@successSubmit="successSubmit" /> @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { energyQuantityManualPage, energyQuantityManualDelete, energyQuantityManualExport } from "@/api/base/energyQuantityManual"
energyQuantityManualPage, import { getEnergyTypeListAll } from "@/api/base/energyType"
energyQuantityManualDelete, import { publicFormatter } from '@/utils/dict'
energyQuantityManualExport, import { parseTime, parseTimeTable } from '@/utils/ruoyi'
} from '@/api/base/energyQuantityManual'; // import FileSaver from "file-saver"
import { getEnergyTypeListAll } from '@/api/base/energyType'; // import * as XLSX from 'xlsx/xlsx.mjs'
import { publicFormatter } from '@/utils/dict'; import EnergyQuantityManualAdd from './components/energyQuantityManualAdd'
import { parseTimeTable } from '@/utils/ruoyi'; import moment from 'moment'
import EnergyQuantityManualAdd from './components/energyQuantityManualAdd';
import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'energyTypeLabel', prop: 'energyType',
label: '能源类型', label: '能源类型',
minWidth: 110, minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'unit', prop: 'unit',
label: '单位', label: '单位',
filter: publicFormatter('unit_dict'), filter: publicFormatter('energy_unit'),
minWidth: 110, minWidth: 110
}, },
{ {
prop: 'tableName', prop: 'tableName',
label: '能源表名', label: '能源表名',
filter: publicFormatter('table_name'), filter: publicFormatter('table_name'),
minWidth: 110, minWidth: 110,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'recordTime', prop: 'recordTime',
label: '抄表日期', label: '抄表日期',
filter: parseTimeTable('{y}-{m}-{d}'), filter: parseTimeTable('{y}-{m}-{d}'),
minWidth: 110, minWidth: 110
}, },
{ {
prop: 'readingQuantity', prop: 'readingQuantity',
label: '抄表值', label: '抄表值'
}, },
{ {
prop: 'useQty', prop: 'useQty',
label: '差值', label: '差值'
}, }
]; ]
export default { export default {
name: 'EnergyQuantityManual', name: "EnergyQuantityManual",
data() { data() {
return { return {
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
labelField: 'labelName',
selectOptions: [], selectOptions: [],
param: 'energyTypeId', param: 'energyTypeId',
filterable: true, filterable: true
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '抄表日期', label: '抄表日期',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'timestamp', valueFormat: "timestamp",
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'timeVal', param: 'timeVal',
defaultSelect: [], defaultSelect: []
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary'
}, },
{ {
type: 'separate', type: 'separate'
}, },
{ {
type: this.$auth.hasPermi('base:energy-quantity-manual:export') type: this.$auth.hasPermi('base:energy-quantity-manual:export') ? 'button' : '',
? 'button'
: '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'primary',
plain: true, plain: true
}, },
{ {
type: this.$auth.hasPermi('base:energy-quantity-manual:create') type: this.$auth.hasPermi('base:energy-quantity-manual:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true
}, }
], ],
tableProps, tableProps,
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
@ -150,174 +122,150 @@ export default {
this.$auth.hasPermi('base:energy-quantity-manual:create') this.$auth.hasPermi('base:energy-quantity-manual:create')
? { ? {
type: 'meterReading', type: 'meterReading',
btnName: '抄表', btnName: '抄表'
} }
: undefined, : undefined,
this.$auth.hasPermi('base:energy-quantity-manual:update') this.$auth.hasPermi('base:energy-quantity-manual:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑'
} }
: undefined, : undefined,
this.$auth.hasPermi('base:energy-quantity-manual:delete') this.$auth.hasPermi('base:energy-quantity-manual:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除'
} }
: undefined, : undefined
].filter((v) => v), ].filter((v) => v),
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
energyTypeId: '', energyTypeId: '',
recordTime: [], recordTime: []
}, },
energyTypeList: [], energyTypeList: [],
exportList: [], exportList: [],
addOrEditTitle: '', addOrEditTitle: '',
centervisible: false, centervisible: false,
}; };
}, },
components: { EnergyQuantityManualAdd }, components: { EnergyQuantityManualAdd },
mixins: [tableHeightMixin],
created() { created() {
let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf(); window.addEventListener('resize', () => {
let start = moment( this.tableH = this.tableHeight(260)
moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00') })
).valueOf(); let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
this.formConfig[1].defaultSelect = [start, end]; let start = moment(moment().subtract(7, 'days').format('YYYY-MM-DD 00:00:00')).valueOf()
this.queryParams.recordTime[0] = start; this.formConfig[1].defaultSelect = [start, end]
this.queryParams.recordTime[1] = end; this.queryParams.recordTime[0] = start
this.queryParams.recordTime[1] = end
this.getList(); this.getList();
this.getTypeList(); this.getTypeList()
}, },
methods: { methods: {
buttonClick(val) { buttonClick(val) {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.energyTypeId = val.energyTypeId; this.queryParams.energyTypeId = val.energyTypeId
this.queryParams.recordTime[0] = val.timeVal this.queryParams.recordTime[0] = val.timeVal ? moment(moment(val.timeVal[0]).format('YYYY-MM-DD 00:00:00')).valueOf() : null
? moment(moment(val.timeVal[0]).format('YYYY-MM-DD 00:00:00')).valueOf() this.queryParams.recordTime[1] = val.timeVal ? moment(moment(val.timeVal[1]).format('YYYY-MM-DD 23:59:59')).valueOf() : null
: null;
this.queryParams.recordTime[1] = val.timeVal
? moment(moment(val.timeVal[1]).format('YYYY-MM-DD 23:59:59')).valueOf()
: null;
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.getList(); this.getList()
break; break
case 'add': case 'add':
this.addOrEditTitle = '新增'; this.addOrEditTitle = '新增'
this.centervisible = true; this.centervisible = true
let params = {}; let params = {}
params.type = 'add'; params.type = 'add'
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.energyQuantityManualAdd.init(params); this.$refs.energyQuantityManualAdd.init(params)
}); })
break; break
default: default:
this.$modal this.$modal.confirm('是否确认导出').then(() => {
.confirm('是否确认导出') return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime });
.then(() => { }).then(response => {
return energyQuantityManualExport({
energyTypeId: this.queryParams.energyTypeId,
recordTime: this.queryParams.recordTime,
});
})
.then((response) => {
this.$download.excel(response, '能源报表.xls'); this.$download.excel(response, '能源报表.xls');
}) }).catch(() => { })
.catch(() => {});
} }
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
energyQuantityManualPage(this.queryParams).then((response) => { energyQuantityManualPage(this.queryParams).then(response => {
let arr = response.data.list || []; let arr = response.data.list || []
arr && arr && arr.map(item => {
arr.map((item) => { item.amount = item.amount ? (!isNaN(parseFloat(item.amount)) && isFinite(item.amount) ? item.amount.toFixed(2) : '') : ''
item.amount = item.amount })
? !isNaN(parseFloat(item.amount)) && isFinite(item.amount) this.list = arr
? 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.total = response.data.total;
this.exportList = []; this.exportList = []
}); });
}, },
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.formConfig[0].selectOptions = res.data || []; this.formConfig[0].selectOptions = res.data || []
this.energyTypeList = res.data || []; this.energyTypeList = res.data || []
}); })
}, },
selectChange(val) { selectChange(val) {
console.log(val); console.log(val)
this.exportList = val; this.exportList = val
}, },
handleClick(val) { handleClick(val) {
console.log(val); console.log(val)
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑'; this.addOrEditTitle = '编辑'
this.centervisible = true; this.centervisible = true
let paramA = {}; let paramA = {}
paramA.type = 'edit'; paramA.type = 'edit'
paramA.id = val.data.id; paramA.id = val.data.id
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.energyQuantityManualAdd.init(paramA); this.$refs.energyQuantityManualAdd.init(paramA)
}); })
break; break
case 'meterReading': case 'meterReading':
this.addOrEditTitle = '新增'; this.addOrEditTitle = '新增'
this.centervisible = true; this.centervisible = true
let paramB = {}; let paramB = {}
paramB.type = 'meterReading'; paramB.type = 'meterReading'
paramB.energyTypeId = val.data.energyTypeId; paramB.energyTypeId = val.data.energyTypeId
paramB.tableName = val.data.tableName; paramB.tableName = val.data.tableName
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.energyQuantityManualAdd.init(paramB); this.$refs.energyQuantityManualAdd.init(paramB)
}); })
break; break
default: default:
this.handleDelete(val.data); this.handleDelete(val.data)
} }
}, },
// //
handleCancel() { handleCancel() {
this.$refs.energyQuantityManualAdd.formClear(); this.$refs.energyQuantityManualAdd.formClear()
this.centervisible = false; this.centervisible = false
this.addOrEditTitle = ''; this.addOrEditTitle = ''
}, },
handleConfirm() { handleConfirm() {
this.$refs.energyQuantityManualAdd.submitForm(); this.$refs.energyQuantityManualAdd.submitForm()
}, },
successSubmit() { successSubmit() {
this.handleCancel(); this.handleCancel()
this.getList(); this.getList()
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
console.log(row.id); console.log(row.id)
this.$modal this.$modal.confirm('是否确认删除能源类型为"' + row.energyType + '"的数据项?').then(function () {
.confirm('是否确认删除能源类型为"' + row.energyTypeLabel + '"的数据项?')
.then(function () {
return energyQuantityManualDelete({ id: row.id }); return energyQuantityManualDelete({ id: row.id });
}) }).then(() => {
.then(() => {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList();
this.$modal.msgSuccess('删除成功'); this.$modal.msgSuccess("删除成功");
}) }).catch(() => { });
.catch(() => {}); }
}, }
},
}; };
</script> </script>

View File

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

View File

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

View File

@ -1,76 +0,0 @@
<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>

View File

@ -1,108 +0,0 @@
<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>

View File

@ -33,28 +33,11 @@
v-model="objIds" v-model="objIds"
:options="objList" :options="objList"
:props="{ checkStrictly: true, value: 'id', label: 'name' }" :props="{ checkStrictly: true, value: 'id', label: 'name' }"
popper-class="cascaderParent"
@change="selectObj" @change="selectObj"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
</el-col> </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 <el-col
:span="12" :span="12"
v-if="form.method == 2"> v-if="form.method == 2">
@ -73,6 +56,24 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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 <el-col
:span="12" :span="12"
v-if="form.method == 1"> v-if="form.method == 1">
@ -182,7 +183,6 @@ export default {
limitType: '', limitType: '',
minValue: 0, minValue: 0,
maxValue: 0, maxValue: 0,
tableName: '',
}, },
objIds: [], // objIds: [], //
isEdit: false, // isEdit: false, //
@ -215,9 +215,6 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.form = res.data; this.form = res.data;
this.form.plcParamId = res.data.plcParamId || ''; 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.method = this.form.method ? this.form.method + '' : '';
this.form.limitType = this.form.limitType this.form.limitType = this.form.limitType
? this.form.limitType + '' ? this.form.limitType + ''
@ -298,7 +295,7 @@ export default {
}, },
selectObj(val) { selectObj(val) {
this.form.objectId = val[val.length - 1]; this.form.objectId = val[val.length - 1];
this.form.objectType = val.length; this.form.objectType = val.length - 1;
if (this.form.energyTypeId && this.form.type) { if (this.form.energyTypeId && this.form.type) {
this.getDetailList(); this.getDetailList();
this.form.plcParamId = ''; this.form.plcParamId = '';
@ -356,3 +353,8 @@ export default {
}, },
}; };
</script> </script>
<style>
.cascaderParent .el-cascader-panel .el-scrollbar:first-child .el-radio {
display: none;
}
</style>

View File

@ -48,10 +48,9 @@ import {
deleteEnergyLimit, deleteEnergyLimit,
} from '@/api/monitoring/energyLimit'; } from '@/api/monitoring/energyLimit';
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from '@/api/base/energyType';
import { getTree } from '@/api/analysis/energyAnalysis'; import { getTree } from '@/api/base/factory';
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict';
import EnergyLimitAdd from './components/energyLimitAdd'; import EnergyLimitAdd from './components/energyLimitAdd';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'method', prop: 'method',
@ -61,27 +60,20 @@ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '监控对象', label: '监控对象',
minWidth: 100,
showOverflowtooltip: true,
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码',
minWidth: 140,
showOverflowtooltip: true,
}, },
{ {
prop: 'tableName', prop: 'tableName',
label: '能源表名', label: '能源表名',
filter: publicFormatter('table_name'), filter: publicFormatter('table_name'),
minWidth: 120,
showOverflowtooltip: true,
}, },
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型', label: '能源类型',
filter: publicFormatter('energy_type'), filter: publicFormatter('energy_type'),
showOverflowtooltip: true,
}, },
{ {
prop: 'type', prop: 'type',
@ -105,7 +97,6 @@ const tableProps = [
export default { export default {
name: 'EnergyLimit', name: 'EnergyLimit',
components: { EnergyLimitAdd }, components: { EnergyLimitAdd },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -113,7 +104,6 @@ export default {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
selectOptions: [], selectOptions: [],
labelField: 'labelName',
param: 'energyTypeId', param: 'energyTypeId',
}, },
{ {
@ -158,6 +148,7 @@ export default {
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
@ -182,6 +173,9 @@ export default {
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260);
});
this.getList(); this.getList();
this.getTypeList(); this.getTypeList();
// //

View File

@ -1,139 +1,115 @@
<template> <template>
<div class="app-container energyOverlimitLog"> <div class="app-container energyOverlimitLog">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <el-tabs v-model="activeName" @tab-click="toggleTab">
ref="searchBarForm" <el-tab-pane label="自动抄表" name="auto"></el-tab-pane>
@headBtnClick="buttonClick" /> <el-tab-pane label="手动抄表" name="manual"></el-tab-pane>
<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> </el-tabs>
<!-- 列表 --> <!-- 列表 -->
<div v-if="activeName === 'auto'"> <div v-if="activeName === 'auto'">
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH" /> :max-height="tableH" />
</div> </div>
<div v-if="activeName === 'manual'"> <div v-if="activeName === 'manual'">
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps2"
:page="queryParams.pageNo" :table-data="list2" :max-height="tableH" />
:limit="queryParams.pageSize"
:table-props="tableProps2"
:table-data="list2"
:max-height="tableH" />
</div> </div>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" /> @pagination="getList" />
</div> </div>
</template> </template>
<script> <script>
import { getEnergyOverlimitLogPage } from '@/api/monitoring/energyOverlimitLog'; import { getEnergyOverlimitLogPage } from "@/api/monitoring/energyOverlimitLog";
import { getEnergyTypeListAll } from '@/api/base/energyType'; import { getEnergyTypeListAll } from "@/api/base/energyType";
import { publicFormatter } from '@/utils/dict'; import { publicFormatter } from '@/utils/dict'
import { parseTime } from '@/utils/ruoyi'; import { parseTime } from '@/utils/ruoyi'
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'objName', prop: 'objName',
label: '监控对象', label: '监控对象'
}, },
{ {
prop: 'objCode', prop: 'objCode',
label: '对象编码', label: '对象编码'
}, },
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型', label: '能源类型'
filter: publicFormatter('energy_type'),
}, },
{ {
prop: 'type', prop: 'type',
label: '监控模式', label: '监控模式'
}, },
{ {
prop: 'paramName', prop: 'paramName',
label: '监控参数', label: '监控参数'
}, },
{ {
prop: 'limitType', prop: 'limitType',
label: '指标类型', label: '指标类型',
filter: publicFormatter('monitor_index_type'), filter: publicFormatter('monitor_index_type')
}, },
{ {
prop: 'realityValue', prop: 'realityValue',
label: '实际值', label: '实际值'
}, },
{ {
prop: 'limitValue', prop: 'limitValue',
label: '阈值', label: '阈值'
}, },
{ {
prop: 'overValue', prop: 'overValue',
label: '超出值', label: '超出值'
}, },
{ {
prop: 'time', prop: 'time',
label: '提醒时间', label: '提醒时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, }
]; ]
const tableProps2 = [ const tableProps2 = [
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型', label: '能源类型'
filter: publicFormatter('energy_type'),
}, },
{ {
prop: 'limitType', prop: 'limitType',
label: '指标类型', label: '指标类型',
filter: publicFormatter('monitor_index_type'), filter: publicFormatter('monitor_index_type')
}, },
{ {
prop: 'realityValue', prop: 'realityValue',
label: '实际值', label: '实际值'
}, },
{ {
prop: 'limitValue', prop: 'limitValue',
label: '阈值', label: '阈值'
}, },
{ {
prop: 'overValue', prop: 'overValue',
label: '超出值', label: '超出值'
}, },
{ {
prop: 'time', prop: 'time',
label: '提醒时间', label: '提醒时间',
filter: parseTime, filter: parseTime,
minWidth: 160, minWidth: 160
}, }
]; ]
export default { export default {
name: 'EnergyOverlimitLog', name: "EnergyOverlimitLog",
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
labelField: 'labelName',
selectOptions: [], selectOptions: [],
param: 'energyTypeId', param: 'energyTypeId'
}, },
{ {
type: 'select', type: 'select',
@ -141,100 +117,102 @@ export default {
selectOptions: this.getDictDatas(this.DICT_TYPE.MONITOR_INDEX_TYPE), selectOptions: this.getDictDatas(this.DICT_TYPE.MONITOR_INDEX_TYPE),
labelField: 'label', labelField: 'label',
valueField: 'value', valueField: 'value',
param: 'indexType', param: 'indexType'
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary'
}, }
], ],
activeName: 'auto', activeName: 'auto',
tableProps, tableProps,
tableProps2, tableProps2,
tableH: this.tableHeight(260),
total: 0, total: 0,
list: [], list: [],
list2: [], list2: [],
heightNum: 300,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
energyTypeId: '', energyTypeId: '',
indexType: '', indexType: '',
method: '1', method: '1'
}, },
typeList: [ typeList: [
{ id: 1, name: '合并' }, { id: 1, name: '合并' },
{ id: 2, name: '详细' }, { id: 2, name: '详细' }
], ]
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList(); this.getList();
this.getTypeList(); this.getTypeList()
}, },
methods: { methods: {
buttonClick(val) { buttonClick(val) {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.energyTypeId = val.energyTypeId; this.queryParams.energyTypeId = val.energyTypeId
this.queryParams.indexType = val.indexType; this.queryParams.indexType = val.indexType
this.getList(); this.getList()
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
getEnergyOverlimitLogPage(this.queryParams).then((response) => { getEnergyOverlimitLogPage(this.queryParams).then(response => {
let arr = response.data.list || []; let arr = response.data.list || [];
arr && arr && arr.map((item) => {
arr.map((item) => {
this.typeList.map((i) => { this.typeList.map((i) => {
if (item.type === i.id) { if (item.type === i.id) {
item.type = i.name; item.type = i.name
} }
}); })
if (item.minValue && item.maxValue) { if (item.minValue && item.maxValue) {
item.limitValue = item.minValue + '-' + item.maxValue; item.limitValue = item.minValue + '-' + item.maxValue
} else if (item.minValue) { } else if (item.minValue) {
item.limitValue = '最小值' + item.minValue; item.limitValue = '最小值' + item.minValue
} else if (item.maxValue) { } else if (item.maxValue) {
item.limitValue = '最大值' + item.maxValue; item.limitValue = '最大值' + item.maxValue
} else { } else {
item.limitValue = ''; item.limitValue = ''
} }
}); })
if (this.queryParams.method === '1') { if (this.queryParams.method === '1') {
this.list = arr; this.list = arr
this.list2 = []; this.list2 = []
} else { } else {
this.list2 = arr; this.list2 = arr
this.list1 = []; this.list1 = []
} }
this.total = response.data.total; this.total = response.data.total;
}); });
}, },
getTypeList() { getTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
console.log(res); console.log(res)
this.formConfig[0].selectOptions = res.data || []; this.formConfig[0].selectOptions = res.data || []
}); })
}, },
toggleTab() { toggleTab() {
if (this.activeName === 'auto') { if (this.activeName === 'auto') {
this.queryParams.method = '1'; this.queryParams.method = '1'
} else { } else {
this.queryParams.method = '2'; this.queryParams.method = '2'
}
this.queryParams.pageNo = 1
this.getList()
}
} }
this.queryParams.pageNo = 1;
this.getList();
},
},
}; };
</script> </script>
<style lang='scss'> <style lang='scss'>
.energyOverlimitLog { .energyOverlimitLog {
.el-tabs__nav::after { .el-tabs__nav::after {
content: ''; content: "";
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;

View File

@ -56,7 +56,6 @@ const tableProps = [
{ {
prop: 'energyType', prop: 'energyType',
label: '能源类型', label: '能源类型',
filter: publicFormatter('energy_type'),
}, },
{ {
prop: 'startNum', prop: 'startNum',
@ -72,7 +71,7 @@ const tableProps = [
}, },
]; ];
export default { export default {
name: 'EnergyReport', name: 'EnergyLimit',
data() { data() {
return { return {
isFold: false, isFold: false,
@ -80,7 +79,6 @@ export default {
{ {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
labelField: 'labelName',
selectOptions: [], selectOptions: [],
param: 'energyTypeId', param: 'energyTypeId',
filterable: true, filterable: true,
@ -181,7 +179,7 @@ export default {
return energyReportPageExportAuto({ ...this.queryParams }); return energyReportPageExportAuto({ ...this.queryParams });
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '能统计报表.xls'); this.$download.excel(response, '能统计报表.xls');
}) })
.catch(() => {}); .catch(() => {});
} }

View File

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

View File

@ -1,67 +1,46 @@
<template> <template>
<el-form <el-form ref="form" :rules="rules" label-width="100px" :model="form">
ref="form"
:rules="rules"
label-width="100px"
:model="form">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="方案名称" prop="name">
label="方案名称"
prop="name">
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="方案编码" prop="code">
label="方案编码" <el-input v-model="form.code" disabled></el-input>
prop="code">
<el-input
v-model="form.code"
disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="统计类型" prop="type">
label="统计类型" <el-select v-model="form.type" placeholder="请选择" style="width: 100%;">
prop="type">
<el-select
v-model="form.type"
placeholder="请选择"
style="width: 100%">
<el-option <el-option
v-for="item in getDictDatas(DICT_TYPE.STATISTIC_TYPE)" v-for="item in getDictDatas(DICT_TYPE.STATISTIC_TYPE)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"></el-option> :value="item.value">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="能源类型" prop="energyTypeId">
label="能源类型" <el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
prop="energyTypeId">
<el-select
v-model="form.energyTypeId"
placeholder="请选择"
style="width: 100%"
filterable>
<el-option <el-option
v-for="item in energyListType" v-for="item in energyListType"
:key="item.id" :key="item.id"
:label="item.labelName" :label="item.name"
:value="item.id"></el-option> :value="item.id">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="备注" prop="remark">
label="备注"
prop="remark">
<el-input v-model="form.remark"></el-input> <el-input v-model="form.remark"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -69,13 +48,8 @@
</el-form> </el-form>
</template> </template>
<script> <script>
import { import { getCode, createEnergyStatistics, updateEnergyStatistics, getEnergyStatistics } from "@/api/monitoring/energyStatistics";
getCode, import { getEnergyTypeListAll } from '@/api/base/energyType'
createEnergyStatistics,
updateEnergyStatistics,
getEnergyStatistics,
} from '@/api/monitoring/energyStatistics';
import { getEnergyTypeListAll } from '@/api/base/energyType';
import { number } from 'echarts'; import { number } from 'echarts';
export default { export default {
name: 'EnergyStatisticsAdd', name: 'EnergyStatisticsAdd',
@ -86,45 +60,39 @@ export default {
name: '', name: '',
code: '', code: '',
type: '', type: '',
energyTypeId: '', energyTypeId: ''
}, },
plcList: [], plcList: [],
objList: [], objList: [],
isEdit: false, // isEdit: false, //
rules: { rules: {
name: [ name: [{ required: true, message: '方案名称不能为空', trigger: 'blur' }],
{ required: true, message: '方案名称不能为空', trigger: 'blur' }, type: [{ required: true, message: '统计类型不能为空', trigger: 'change' }],
], energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }]
type: [
{ required: true, message: '统计类型不能为空', trigger: 'change' },
],
energyTypeId: [
{ required: true, message: '能源类型不能为空', trigger: 'change' },
],
}, },
energyListType: [], energyListType: [],
}; }
}, },
methods: { methods: {
init(id) { init(id) {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.energyListType = res.data || []; this.energyListType = res.data || []
}); })
if (id) { if (id) {
this.isEdit = true; this.isEdit = true
this.form.id = id; this.form.id = id
getEnergyStatistics( id ).then((res) => { getEnergyStatistics( id ).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.form = res.data; this.form = res.data
this.form.type = this.form.type + ''; this.form.type = this.form.type + ''
} }
}); })
} else { } else {
getCode().then((res) => { getCode().then((res) => {
this.form.code = res.data; this.form.code = res.data
}); })
this.isEdit = false; this.isEdit = false
this.form.id = ''; this.form.id = ''
} }
}, },
submitForm() { submitForm() {
@ -134,27 +102,27 @@ export default {
// //
updateEnergyStatistics({...this.form}).then((res) => { updateEnergyStatistics({...this.form}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit'); this.$emit('successSubmit')
} }
}); })
} else { } else {
createEnergyStatistics({...this.form}).then((res) => { createEnergyStatistics({...this.form}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess('操作成功'); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit'); this.$emit('successSubmit')
} }
}); })
} }
} else { } else {
return false; return false
} }
}); })
}, },
formClear() { formClear() {
this.$refs.form.resetFields(); this.$refs.form.resetFields()
this.isEdit = false; this.isEdit = false
}, }
}, }
}; }
</script> </script>

View File

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

View File

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

View File

@ -1,93 +1,65 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"> :max-height="tableH">
<method-btn <method-btn v-if="tableBtn.length" slot="handleBtn" :width="160" label="操作" :method-list="tableBtn"
v-if="tableBtn.length"
slot="handleBtn"
:width="160"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" /> @pagination="getList" />
<!-- 新增 --> <!-- 新增 -->
<base-dialog <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
:dialogTitle="addOrEditTitle" @confirm="handleConfirm" :before-close="handleCancel">
:dialogVisible="centervisible" <energy-statistics-add ref="energyStatistics" @successSubmit="successSubmit" />
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel">
<energy-statistics-add
ref="energyStatistics"
@successSubmit="successSubmit" />
</base-dialog> </base-dialog>
<!-- 参数绑定/查看 --> <!-- 参数绑定/查看 -->
<energy-statistics-det <energy-statistics-det ref="plcParam" @closeDrawer="closeDrawer"
ref="plcParam"
@closeDrawer="closeDrawer"
:energyTypeList="energyTypeList"></energy-statistics-det> :energyTypeList="energyTypeList"></energy-statistics-det>
</div> </div>
</template> </template>
<script> <script>
import { import { getEnergyStatisticsPage, deleteEnergyStatistics } from "@/api/monitoring/energyStatistics";
getEnergyStatisticsPage, import { publicFormatter } from '@/utils/dict'
deleteEnergyStatistics, import { getEnergyTypeListAll } from '@/api/base/energyType'
} from '@/api/monitoring/energyStatistics'; import EnergyStatisticsAdd from './components/energyStatisticsAdd'
import { publicFormatter } from '@/utils/dict'; import EnergyStatisticsDet from './components/energyStatisticsDet'
import { getEnergyTypeListAll } from '@/api/base/energyType';
import EnergyStatisticsAdd from './components/energyStatisticsAdd';
import EnergyStatisticsDet from './components/energyStatisticsDet';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'name', prop: 'name',
label: '方案名称', label: '方案名称'
}, },
{ {
prop: 'code', prop: 'code',
label: '方案编码', label: '方案编码',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true, showOverflowtooltip: true
}, },
{ {
prop: 'type', prop: 'type',
label: '统计类型', label: '统计类型',
filter: publicFormatter('statistic_type'), filter: publicFormatter('statistic_type')
}, },
{ {
prop: 'energyTypeLabel', prop: 'energyType',
label: '能源类型', label: '能源类型'
showOverflowtooltip: true,
}, },
{ {
prop: 'paramNum', prop: 'paramNum',
label: '统计参数数量', label: '统计参数数量'
}, },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注'
}, }
]; ]
export default { export default {
name: 'EnergyStatistics', name: "EnergyStatistics",
components: { EnergyStatisticsAdd, EnergyStatisticsDet }, components: { EnergyStatisticsAdd, EnergyStatisticsDet },
mixins: [tableHeightMixin],
data() { data() {
return { return {
formConfig: [ formConfig: [
@ -95,165 +67,156 @@ export default {
type: 'input', type: 'input',
label: '方案名称', label: '方案名称',
placeholder: '方案名称', placeholder: '方案名称',
param: 'name', param: 'name'
}, },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary'
}, },
{ {
type: 'separate', type: 'separate'
}, },
{ {
type: this.$auth.hasPermi('monitoring:energy-statistics:create') type: this.$auth.hasPermi('monitoring:energy-statistics:create') ? 'button' : '',
? 'button'
: '',
btnName: '新增', btnName: '新增',
name: 'add', name: 'add',
color: 'success', color: 'success',
plain: true, plain: true
}, }
], ],
tableProps, tableProps,
tableBtn: [ tableBtn: [
this.$auth.hasPermi('monitoring:energy-statistics:bind') this.$auth.hasPermi('monitoring:energy-statistics:bind')
? { ? {
type: 'connect', type: 'connect',
btnName: '绑定', btnName: '绑定'
} }
: undefined, : undefined,
{ {
type: 'detail', type: 'detail',
btnName: '详情', btnName: '详情'
}, },
this.$auth.hasPermi('monitoring:energy-statistics:update') this.$auth.hasPermi('monitoring:energy-statistics:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '编辑', btnName: '编辑'
} }
: undefined, : undefined,
this.$auth.hasPermi('monitoring:energy-statistics:delete') this.$auth.hasPermi('monitoring:energy-statistics:delete')
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除'
} }
: undefined, : undefined
].filter((v) => v), ].filter((v) => v),
tableH: this.tableHeight(260),
// //
total: 0, total: 0,
// //
list: [], list: [],
// //
addOrEditTitle: '', addOrEditTitle: "",
// //
centervisible: false, centervisible: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null, name: null
}, },
energyTypeList: [], energyTypeList: []
}; };
}, },
created() { created() {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList(); this.getList();
}, },
mounted() { mounted() {
// //
this.getEnergyTypeList(); this.getEnergyTypeList()
}, },
methods: { methods: {
buttonClick(val) { buttonClick(val) {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.queryParams.name = val.name; this.queryParams.name = val.name
this.getList(); this.getList()
break; break
default: default:
this.addOrEditTitle = '新增'; this.addOrEditTitle = '新增'
this.centervisible = true; this.centervisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.energyStatistics.init(); this.$refs.energyStatistics.init()
}); })
} }
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
getEnergyStatisticsPage(this.queryParams).then((response) => { getEnergyStatisticsPage(this.queryParams).then(response => {
let arr = response.data.list || []; let arr = response.data.list || [];
arr.map((item) => { this.list = arr
this.getDictDatas('energy_type').map((subItem) => {
if (item.energyType === subItem.value) {
item.energyTypeLabel = subItem.label;
}
});
});
this.list = arr;
this.total = response.data.total; this.total = response.data.total;
}); });
}, },
handleClick(val) { handleClick(val) {
console.log(val); console.log(val)
switch (val.type) { switch (val.type) {
case 'edit': case 'edit':
this.addOrEditTitle = '编辑'; this.addOrEditTitle = '编辑'
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.energyStatistics.init(val.data.id); this.$refs.energyStatistics.init(val.data.id)
}); })
this.centervisible = true; this.centervisible = true
break; break
case 'delete': case 'delete':
this.handleDelete(val.data); this.handleDelete(val.data)
break; break
case 'detail': case 'detail':
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.plcParam.init(val.data, 'detail'); this.$refs.plcParam.init(val.data, 'detail')
}); })
break; break
default: default:
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.plcParam.init(val.data, 'connect'); this.$refs.plcParam.init(val.data, 'connect')
}); })
} }
}, },
handleCancel() { handleCancel() {
this.$refs.energyStatistics.formClear(); this.$refs.energyStatistics.formClear()
this.centervisible = false; this.centervisible = false
this.addOrEditTitle = ''; this.addOrEditTitle = ''
}, },
handleConfirm() { handleConfirm() {
this.$refs.energyStatistics.submitForm(); this.$refs.energyStatistics.submitForm()
}, },
successSubmit() { successSubmit() {
this.handleCancel(); this.handleCancel()
this.getList(); this.getList()
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal this.$modal.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?').then(function () {
.confirm('是否确认删除方案名称为"' + row.name + '"的数据项?')
.then(function () {
return deleteEnergyStatistics(row.id); return deleteEnergyStatistics(row.id);
}) }).then(() => {
.then(() => {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1;
this.getList(); this.getList();
this.$modal.msgSuccess('删除成功'); this.$modal.msgSuccess("删除成功");
}) }).catch(() => { });
.catch(() => {});
}, },
closeDrawer() { closeDrawer() {
this.getList(); this.getList()
}, },
getEnergyTypeList() { getEnergyTypeList() {
getEnergyTypeListAll().then((res) => { getEnergyTypeListAll().then((res) => {
this.energyTypeList = res.data || []; this.energyTypeList = res.data || []
}); })
}, }
}, }
}; };
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo" <base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :table-data="tableData"> :limit="listQuery.pageSize" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -16,7 +16,7 @@
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
// import DetailOrUpdate from './detail-or-updata'; // import DetailOrUpdate from './detail-or-updata';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import basicPage from '../../core/mixins/basic-page'; import basicPage from '../../core/mixins/basic-page';
import StatusBtn from './statusBtn.vue' import StatusBtn from './statusBtn.vue'
import { import {
@ -54,7 +54,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -112,7 +112,7 @@ export default {
param: 'code', param: 'code',
}, },
{ {
type: this.$auth.hasPermi('extend:process-equ-material-bom:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo" <base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :table-data="tableData"> :limit="listQuery.pageSize" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -16,7 +16,7 @@
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
// import DetailOrUpdate from './detail-or-updata'; // import DetailOrUpdate from './detail-or-updata';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import basicPage from '../../core/mixins/basic-page'; import basicPage from '../../core/mixins/basic-page';
import StatusBtn from './statusBtn.vue' import StatusBtn from './statusBtn.vue'
import { import {
@ -54,7 +54,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -113,7 +113,7 @@ export default {
param: 'code', param: 'code',
}, },
{ {
type: this.$auth.hasPermi('extend:process-equ-value-bom:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,9 +54,7 @@ export default {
param: 'inspectionDetContent', param: 'inspectionDetContent',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-btn:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -66,9 +66,7 @@ export default {
param: 'nickName', param: 'nickName',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-box-permissions:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

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

View File

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

View File

@ -134,9 +134,7 @@ export default {
param: 'name', param: 'name',
}, },
{ {
type: this.$auth.hasPermi('base:quality-inspection-type:query') type: 'button',
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -10,7 +10,7 @@
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table :max-height="tableH" :table-props="tableProps" :page="1" :limit="20" :table-data="list"> <base-table :table-props="tableProps" :page="1" :limit="10" :table-data="list">
</base-table> </base-table>
</el-row> </el-row>
@ -85,7 +85,6 @@ import {
import moment from 'moment'; import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
export default { export default {
@ -93,7 +92,7 @@ export default {
// components: { // components: {
// DialogForm, // DialogForm,
// }, // },
mixins: [tableHeightMixin], // mixins: [basicPageMixin],
data() { data() {
return { return {
list: [], list: [],
@ -131,7 +130,7 @@ export default {
// width: 350, // width: 350,
}, },
{ {
type: this.$auth.hasPermi('base:quality-isra-statistics:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@ -207,6 +206,8 @@ export default {
}).then((res) => { }).then((res) => {
let mapArr= [] let mapArr= []
let mapLegendData = [] let mapLegendData = []
// let mapXAxisData = []
for (let i in res.data) {
let obj = { let obj = {
name: '', name: '',
type: 'line', type: 'line',
@ -214,9 +215,6 @@ export default {
data: [], data: [],
mapXAxisData:[], mapXAxisData:[],
} }
// let mapXAxisData = []
for (let i in res.data) {
// console.log(i) // console.log(i)
let dataArr = [] let dataArr = []
res.data[i].forEach(ele => { res.data[i].forEach(ele => {
@ -228,7 +226,6 @@ export default {
mapLegendData.push(i) mapLegendData.push(i)
mapArr.push(obj) mapArr.push(obj)
} }
console.log(mapArr);
// console.log(res.data[res]); // console.log(res.data[res]);
var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain') var chartDom = this.activeName === 'day' ? document.getElementById('mapDayMain') : this.activeName === 'week' ? document.getElementById('mapWeekMain') : document.getElementById('mapMonthMain')
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
@ -269,7 +266,6 @@ export default {
}, },
series: mapArr series: mapArr
} }
myChart.clear()
option && myChart.setOption(option); option && myChart.setOption(option);
}) })
this.$axios({ this.$axios({
@ -377,7 +373,6 @@ export default {
} }
] ]
} }
myChart.clear()
option && myChart.setOption(option); option && myChart.setOption(option);
}) })
}, },

View File

@ -1,16 +1,38 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo" :formConfigs="formConfig"
:limit="listQuery.pageSize" :table-data="tableData"> ref="searchBarForm"
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" @headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
: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" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" />
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel" <base-dialog
@confirm="handleConfirm" :before-close="handleCancel" width="40%"> :dialogTitle="addOrEditTitle"
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update> :dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="40%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@ -24,7 +46,6 @@ import {
deleteQualityScrapDet, deleteQualityScrapDet,
} from '@/api/base/qualityScrapDet'; } from '@/api/base/qualityScrapDet';
import { getList, } from "@/api/base/qualityScrapType"; import { getList, } from "@/api/base/qualityScrapType";
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'createTime', prop: 'createTime',
@ -50,7 +71,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -92,7 +113,7 @@ export default {
filterable: true filterable: true
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@ -156,7 +177,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.content = val.content ? val.content : undefined; this.listQuery.content = val.content ? val.content : undefined;
this.listQuery.typeId = val.typeId ? val.typeId : undefined; this.listQuery.typeId = val.typeId ? val.typeId : undefined;
this.getDataList(); this.getDataList();
@ -164,7 +185,7 @@ export default {
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo" <base-table v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :table-data="tableData"> :limit="listQuery.pageSize" :table-data="tableData">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> @clickBtn="handleClick" />
@ -19,7 +19,7 @@
<script> <script>
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import DetailOrUpdate from './detail-or-updata'; import DetailOrUpdate from './detail-or-updata';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import basicPage from './basic-page'; import basicPage from './basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import { import {
@ -68,7 +68,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -119,7 +119,7 @@ export default {
// filterable: true // filterable: true
// }, // },
{ {
type: this.$auth.hasPermi('base:quality-scrap-det:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@ -214,7 +214,7 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.workOrderId = val.workOrderId ? val.workOrderId : undefined; this.listQuery.workOrderId = val.workOrderId ? val.workOrderId : undefined;
// this.listQuery.teamId = val.teamId ? val.teamId : undefined; // this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList(); this.getDataList();
@ -222,7 +222,7 @@ export default {
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@ -1,16 +1,38 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :page="listQuery.pageNo" :formConfigs="formConfig"
:limit="listQuery.pageSize" :table-data="tableData"> ref="searchBarForm"
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" @headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
: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" /> @clickBtn="handleClick" />
</base-table> </base-table>
<pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" />
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="addOrUpdateVisible" @cancel="handleCancel" <base-dialog
@confirm="handleConfirm" :before-close="handleCancel" width="40%"> :dialogTitle="addOrEditTitle"
<add-or-update ref="addOrUpdate" @refreshDataList="successSubmit"></add-or-update> :dialogVisible="addOrUpdateVisible"
@cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
width="40%">
<add-or-update
ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update>
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@ -19,7 +41,6 @@
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import basicPage from '../../../core/mixins/basic-page'; import basicPage from '../../../core/mixins/basic-page';
import { parseTime } from '../../../core/mixins/code-filter'; import { parseTime } from '../../../core/mixins/code-filter';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import { import {
getQualityScrapTypePage, getQualityScrapTypePage,
deleteQualityScrapType deleteQualityScrapType
@ -50,7 +71,7 @@ const tableProps = [
]; ];
export default { export default {
mixins: [basicPage, tableHeightMixin], mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -82,7 +103,7 @@ export default {
param: 'name', param: 'name',
}, },
{ {
type: this.$auth.hasPermi('base:quality-scrap-type:query') ? 'button' : '', type: 'button',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
@ -138,14 +159,14 @@ export default {
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 20; this.listQuery.pageSize = 10;
this.listQuery.name = val.name ? val.name : undefined; this.listQuery.name = val.name ? val.name : undefined;
this.getDataList(); this.getDataList();
break; break;
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();
this.listQuery = { this.listQuery = {
pageSize: 20, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 1, total: 1,
}; };

View File

@ -8,8 +8,7 @@
<el-tab-pane :label="'\u2002表格数据\u2002'" name="table"> <el-tab-pane :label="'\u2002表格数据\u2002'" name="table">
<!-- 列表 --> <!-- 列表 -->
<div class="blue-title">产品名{{ productDetail.name }} 产品规格{{ productDetail.specifications }}</div> <div class="blue-title">产品名{{ productDetail.name }} 产品规格{{ productDetail.specifications }}</div>
<base-table :max-height="tableH" class="base-table__margin" :table-props="productProps" :page="1" <base-table class="base-table__margin" :table-props="productProps" :page="1" :limit="10" :table-data="list">
:limit="10" :table-data="list">
</base-table> </base-table>
<div v-for="(item,index) in downProps" :key="index"> <div v-for="(item,index) in downProps" :key="index">
<div class="blue-title">工单名称:{{ list[index].workOrderName }}</div> <div class="blue-title">工单名称:{{ list[index].workOrderName }}</div>
@ -52,7 +51,6 @@ import {
getProductList, getProductList,
getWorkOrderList getWorkOrderList
} from '@/api/monitoring/statisticalData'; } from '@/api/monitoring/statisticalData';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
// import Editor from '@/components/Editor'; // import Editor from '@/components/Editor';
import moment from 'moment'; import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
@ -63,7 +61,7 @@ export default {
// components: { // components: {
// DialogForm, // DialogForm,
// }, // },
mixins: [tableHeightMixin], // mixins: [basicPageMixin],
data() { data() {
return { return {
list: [], list: [],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,22 +1,43 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar :isFold="true" :formConfigs="searchBarFormConfig" ref="search-bar" <SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" /> @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table :table-props="tableProps" :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list" <base-table
:table-props="tableProps"
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-data="list"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<method-btn v-if="tableBtn.length" slot="handleBtn" label="操作" :width="120" fixed="right" :method-list="tableBtn" <method-btn
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="120"
fixed="right"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<base-dialog :dialogTitle="title" :dialogVisible="open" width="50%" @close="cancel" @cancel="cancel" <base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="50%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" /> <DialogForm v-if="open" ref="form" v-model="form" />
</base-dialog> </base-dialog>
@ -159,11 +180,7 @@ export default {
// width: 350, // width: 350,
}, },
{ {
type: this.$auth.hasPermi( type: 'button',
'base:quality-inspection-record:query'
)
? 'button'
: '',
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',

View File

@ -1,11 +1,17 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" <SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" /> @headBtnClick="handleSearchBarBtnClick" />
<!-- 列表 --> <!-- 列表 -->
<base-table :max-height="tableH" :table-props="tableProps" :page="1" :limit="10" :table-data="list"> <base-table
:table-props="tableProps"
:page="1"
:limit="10"
:table-data="list">
<!-- <method-btn <!-- <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
@ -45,7 +51,6 @@ import {
} from '@/api/monitoring/statisticalData'; } from '@/api/monitoring/statisticalData';
// import Editor from '@/components/Editor'; // import Editor from '@/components/Editor';
import moment from 'moment'; import moment from 'moment';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
@ -54,7 +59,7 @@ export default {
// components: { // components: {
// DialogForm, // DialogForm,
// }, // },
mixins: [tableHeightMixin], // mixins: [basicPageMixin],
data() { data() {
return { return {
list: [], list: [],
@ -106,12 +111,6 @@ export default {
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
},
{
type: 'button',
btnName: '返回',
name: 'back',
color: 'primary',
}, },
// { // {
// type: this.$auth.hasPermi( // type: this.$auth.hasPermi(
@ -374,9 +373,8 @@ export default {
this.queryParams.productionId = val.productionId ? val.productionId : undefined this.queryParams.productionId = val.productionId ? val.productionId : undefined
this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
this.getList() this.getList()
} else if (val.btnName === 'back') {
this.$router.go(-1)
} }
// console.log(val); // console.log(val);
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-08 11:45:52 * @LastEditTime: 2024-03-29 09:48:32
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -12,9 +12,8 @@
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月"> <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询 <el-button type="primary" @click="getDataList()">查询</el-button>
</el-button> <el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">

View File

@ -14,9 +14,9 @@
style="width: 350px" placeholder="选择周"> style="width: 350px" placeholder="选择周">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询 <el-button type="primary" @click="getDataList()">查询</el-button>
</el-button> <!-- <el-button type="primary" @click="getDataList()">查询</el-button> -->
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain <el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-08 11:46:49 * @LastEditTime: 2024-03-29 09:48:49
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -14,9 +14,8 @@
style="width: 350px" placeholder="选择年"> style="width: 350px" placeholder="选择年">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询 <el-button type="primary" @click="getDataList()">查询</el-button>
</el-button> <el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('report:auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button> <!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> --> <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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